blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
410
content_id
stringlengths
40
40
detected_licenses
listlengths
0
51
license_type
stringclasses
2 values
repo_name
stringlengths
5
132
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
80
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
5.85k
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
listlengths
1
1
author_id
stringlengths
0
313
2158056c6c4baf1bd637633a2c3f793649314400
1ac0cc960e5e2f19b265cc7b536c877a13f29340
/Nearpod/src/main/java/info/influx/Nearpod/model/user/UserInfo.java
c0aca75e1e11e4d7014b9a95698226b4b7fe4c95
[]
no_license
github-krishnakanth/Assessment
a342bbbc2e093c86473df798bcf13d7c8469d8fc
d6d20f34595e5690a3055a76464b9f9ef608a50a
refs/heads/master
2021-01-15T01:27:59.948261
2020-09-13T15:43:06
2020-09-13T15:43:06
242,830,383
0
0
null
2020-09-11T15:22:23
2020-02-24T19:58:38
Java
UTF-8
Java
false
false
1,668
java
package info.influx.Nearpod.model.user; import java.time.LocalDateTime; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; import io.swagger.annotations.ApiModelProperty; public class UserInfo { static final long serialVersionId = 1L; @ApiModelProperty(notes = "The Database generated user, token and session mapping Id") private Long id; @ApiModelProperty(notes = "username") private String username; @ApiModelProperty(notes = "password") private String password; @ApiModelProperty(notes = "Role of user") private String role; @ApiModelProperty(notes = "Indicated whether the user is enabled or disabled. A disabled user cannot be authenticated") private boolean enabled; @ApiModelProperty(notes = "The Database generated user, token and session mapping created time") private LocalDateTime createdTime; @ApiModelProperty(notes = "The Database generated user, token and session mapping updated time") private LocalDateTime updatedTime; public UserInfo() { } public UserInfo(String username, String password, boolean enabled, LocalDateTime createdTime, LocalDateTime updatedTime) { this.username = username; this.password = password; this.enabled = enabled; this.createdTime = createdTime; this.updatedTime = updatedTime; } @PrePersist protected void onCreate() { createdTime = LocalDateTime.now(); updatedTime = LocalDateTime.now(); } @PreUpdate protected void onUpdate() { updatedTime = LocalDateTime.now(); } public Long getId() { return id; } public LocalDateTime getCreatedTime() { return createdTime; } public LocalDateTime getUpdatedTime() { return updatedTime; } }
[ "thisiskrishnakanth@gmail.com" ]
thisiskrishnakanth@gmail.com
56fdb3e335ab7ffa2f8ab06293c39225967fa056
cc8b95353c82aeb9c708c2ca413da19c63151b9b
/app/src/main/java/com/yrkj/yrlife/been/Complaints.java
89f60164c828d87cad7f443fdd006c4df824b0e5
[]
no_license
ChuJianan/erlife
d8435eb170ab5848a19cdf3fa59d1afda9dcdf8e
352688f4fbcafb7abfde787da8b158f48f18aa21
refs/heads/master
2021-01-16T23:56:08.701092
2016-11-30T03:58:29
2016-11-30T03:58:29
54,858,064
0
0
null
null
null
null
UTF-8
Java
false
false
1,121
java
package com.yrkj.yrlife.been; /** * Created by cjn on 2016/11/14. */ public class Complaints extends Entity { private String img_urls; private String name; private String content; private String time; private String floor; private int star_nub; public String getImg_urls() { return img_urls; } public void setImg_urls(String img_urls) { this.img_urls = img_urls; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } public String getFloor() { return floor; } public void setFloor(String floor) { this.floor = floor; } public int getStar_nub() { return star_nub; } public void setStar_nub(int star_nub) { this.star_nub = star_nub; } }
[ "cjn@chaoweiinfo.com" ]
cjn@chaoweiinfo.com
40eface98027ee6c8d9add54baa4a948190ab8bb
57bb1878a4005a37c51cb3fe3a210d9f2c3d419f
/src/synsoftech/mysql/Dlg_mysql_database.java
f2ac586b0c24bf6163872f0a359d092528dbfe8b
[]
no_license
yespickmeup/Synsoftech
f21b5ab59406e7419b6c60c52a1dabd5c57d2281
299f8d4a864549da6af15a68db80453236803c79
refs/heads/master
2021-05-04T11:51:58.494557
2020-03-06T06:47:24
2020-03-06T06:47:24
51,809,704
0
0
null
null
null
null
UTF-8
Java
false
false
43,572
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 synsoftech.mysql; import POS.pnl.Dashboard; import com.jgoodies.binding.adapter.AbstractTableAdapter; import com.jgoodies.binding.list.ArrayListModel; import java.awt.Dimension; import java.awt.Point; import java.awt.Toolkit; import java.awt.Window; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.UnsupportedFlavorException; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.io.IOException; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.JLabel; import javax.swing.ListModel; import javax.swing.ListSelectionModel; import mijzcx.synapse.desk.utils.CloseDialog; import mijzcx.synapse.desk.utils.KeyMapping; import mijzcx.synapse.desk.utils.KeyMapping.KeyAction; import mijzcx.synapse.desk.utils.TableWidthUtilities; import synsoftech.fields.Field; import synsoftech.fields.Label; import synsoftech.panels.Confirm; import synsoftech.rendering.Dlg_transfer_object; import synsoftech.util.ImageRenderer1; import synsoftech.util.TableRenderer; /** * * @author Guinness */ public class Dlg_mysql_database extends javax.swing.JDialog { /** * Creates new form Dlg_mysql_database */ //<editor-fold defaultstate="collapsed" desc=" callback "> private Callback callback; public void setCallback(Callback callback) { this.callback = callback; } public static interface Callback { void ok(CloseDialog closeDialog, OutputData data); } public static class InputData { } public static class OutputData { } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" Constructors "> private Dlg_mysql_database(java.awt.Frame parent, boolean modal) { super(parent, modal); setUndecorated(true); initComponents(); myInit(); } private Dlg_mysql_database(java.awt.Dialog parent, boolean modal) { super(parent, modal); setUndecorated(true); initComponents(); myInit(); } public Dlg_mysql_database() { super(); setUndecorated(true); initComponents(); myInit(); } private Dlg_mysql_database myRef; private void setThisRef(Dlg_mysql_database myRef) { this.myRef = myRef; } private static java.util.Map<Object, Dlg_mysql_database> dialogContainer = new java.util.HashMap(); public static void clearUpFirst(java.awt.Window parent) { if (dialogContainer.containsKey(parent)) { dialogContainer.remove(parent); } } public static Dlg_mysql_database create(java.awt.Window parent, boolean modal) { if (modal) { return create(parent, ModalityType.APPLICATION_MODAL); } return create(parent, ModalityType.MODELESS); } public static Dlg_mysql_database create(java.awt.Window parent, java.awt.Dialog.ModalityType modalType) { if (parent instanceof java.awt.Frame) { Dlg_mysql_database dialog = dialogContainer.get(parent); if (dialog == null) { dialog = new Dlg_mysql_database((java.awt.Frame) parent, false); dialog.setModalityType(modalType); dialogContainer.put(parent, dialog); java.util.logging.Logger.getAnonymousLogger().log(Level.INFO, "instances: {0}", dialogContainer.size()); dialog.setThisRef(dialog); return dialog; } else { dialog.setModalityType(modalType); return dialog; } } if (parent instanceof java.awt.Dialog) { Dlg_mysql_database dialog = dialogContainer.get(parent); if (dialog == null) { dialog = new Dlg_mysql_database((java.awt.Dialog) parent, false); dialog.setModalityType(modalType); dialogContainer.put(parent, dialog); java.util.logging.Logger.getAnonymousLogger().log(Level.INFO, "instances: {0}", dialogContainer.size()); dialog.setThisRef(dialog); return dialog; } else { dialog.setModalityType(modalType); return dialog; } } return null; } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" main "> public static void main(String args[]) { try { javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { throw new RuntimeException(e); } Dlg_mysql_database dialog = Dlg_mysql_database.create(new javax.swing.JFrame(), true); dialog.setVisible(true); } //</editor-fold> //<editor-fold defaultstate="collapsed" desc=" added "> @Override public void setVisible(boolean visible) { super.setVisible(visible); if (visible == true) { getContentPane().removeAll(); initComponents(); myInit(); repaint(); } } public javax.swing.JPanel getSurface() { return (javax.swing.JPanel) getContentPane(); } public void nullify() { myRef.setVisible(false); myRef = null; } //</editor-fold> /** * 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() { jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new Label.Separator2(); tf_db = new Field.Combo(); jScrollPane1 = new javax.swing.JScrollPane(); tbl_tables = new javax.swing.JTable(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); jLabel12 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); lbl_db = new org.jdesktop.swingx.JXLabel(); jProgressBar1 = new javax.swing.JProgressBar(); jLabel13 = new javax.swing.JLabel(); pnl_holder = new javax.swing.JPanel(); pnl_return = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); pnl_data = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); jLabel1.setText("Host Name:"); jLabel2.setText("Localhost"); jLabel3.setText("3306"); jLabel4.setText("Port:"); jLabel5.setText("root"); jLabel6.setText("Username:"); jLabel7.setText("Password:"); jLabel8.setText("password"); tf_db.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N tf_db.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tf_dbMouseClicked(evt); } }); tf_db.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_dbActionPerformed(evt); } }); tbl_tables.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { {}, {}, {}, {} }, new String [] { } )); tbl_tables.setGridColor(new java.awt.Color(204, 204, 204)); tbl_tables.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tbl_tablesMouseClicked(evt); } public void mouseEntered(java.awt.event.MouseEvent evt) { tbl_tablesMouseEntered(evt); } }); jScrollPane1.setViewportView(tbl_tables); jLabel10.setText("No of Tables:"); jLabel11.setText("0"); jLabel12.setText("Database:"); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/synsoftech/mysql/light33 (1).png"))); // NOI18N jButton1.setToolTipText("Create Database"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/synsoftech/mysql/minus104 (1).png"))); // NOI18N jButton2.setToolTipText("Drop Database"); jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/synsoftech/mysql/copy26.png"))); // NOI18N jButton3.setToolTipText("Duplicate Database w/out Data"); jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/synsoftech/mysql/data21.png"))); // NOI18N jButton4.setToolTipText("Duplicate Database w/ Data"); jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/synsoftech/mysql/light33 (1).png"))); // NOI18N jButton5.setToolTipText("Create Table"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); lbl_db.setLineWrap(true); jProgressBar1.setString(""); jProgressBar1.setStringPainted(true); jLabel13.setText("Status:"); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addComponent(tf_db, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel12) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(lbl_db, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0) .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jButton5, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addGap(0, 37, Short.MAX_VALUE) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 378, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap()) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addGap(23, 23, 23) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jLabel2)) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(jLabel3)) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(jLabel5)) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel7) .addComponent(jLabel8)) .addGap(5, 5, 5) .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tf_db, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lbl_db, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel13, javax.swing.GroupLayout.PREFERRED_SIZE, 17, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(5, 5, 5)) ); pnl_holder.setBackground(new java.awt.Color(255, 255, 255)); pnl_holder.setLayout(new java.awt.CardLayout()); pnl_return.setBackground(new java.awt.Color(255, 255, 255)); jTextArea1.setColumns(20); jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N jTextArea1.setLineWrap(true); jTextArea1.setRows(5); jScrollPane2.setViewportView(jTextArea1); javax.swing.GroupLayout pnl_returnLayout = new javax.swing.GroupLayout(pnl_return); pnl_return.setLayout(pnl_returnLayout); pnl_returnLayout.setHorizontalGroup( pnl_returnLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnl_returnLayout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 538, Short.MAX_VALUE) .addContainerGap()) ); pnl_returnLayout.setVerticalGroup( pnl_returnLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(pnl_returnLayout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 594, Short.MAX_VALUE) .addContainerGap()) ); pnl_holder.add(pnl_return, "card2"); pnl_data.setBackground(new java.awt.Color(255, 255, 255)); javax.swing.GroupLayout pnl_dataLayout = new javax.swing.GroupLayout(pnl_data); pnl_data.setLayout(pnl_dataLayout); pnl_dataLayout.setHorizontalGroup( pnl_dataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 558, Short.MAX_VALUE) ); pnl_dataLayout.setVerticalGroup( pnl_dataLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 616, Short.MAX_VALUE) ); pnl_holder.add(pnl_data, "card3"); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(pnl_holder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(0, 0, 0)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(pnl_holder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents private void tf_dbActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tf_dbActionPerformed init_db(); }//GEN-LAST:event_tf_dbActionPerformed private void tf_dbMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tf_dbMouseClicked init_db(); }//GEN-LAST:event_tf_dbMouseClicked private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jButton1ActionPerformed private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed add_table(); }//GEN-LAST:event_jButton5ActionPerformed private void tbl_tablesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbl_tablesMouseClicked select_table(); }//GEN-LAST:event_tbl_tablesMouseClicked private void tbl_tablesMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbl_tablesMouseEntered // TODO add your handling code here: }//GEN-LAST:event_tbl_tablesMouseEntered /** * @param args the command line arguments */ // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JButton jButton4; private javax.swing.JButton jButton5; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel10; private javax.swing.JLabel jLabel11; private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JLabel jLabel8; private javax.swing.JLabel jLabel9; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JProgressBar jProgressBar1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JTextArea jTextArea1; private org.jdesktop.swingx.JXLabel lbl_db; private javax.swing.JPanel pnl_data; private javax.swing.JPanel pnl_holder; private javax.swing.JPanel pnl_return; private javax.swing.JTable tbl_tables; private javax.swing.JTextField tf_db; // End of variables declaration//GEN-END:variables private void myInit() { init_key(); init_tbl_tables(); } Dashboard dash; public void do_pass(String host_name, String port, String username, String password, Dashboard b) { dash = b; jLabel2.setText(host_name); jLabel3.setText(port); jLabel5.setText(username); jLabel8.setText(password); jLabel8.setVisible(false); jLabel7.setVisible(false); } // <editor-fold defaultstate="collapsed" desc="Key"> private void disposed() { this.dispose(); } private void init_key() { KeyMapping.mapKeyWIFW(getSurface(), KeyEvent.VK_ESCAPE, new KeyAction() { @Override public void actionPerformed(ActionEvent e) { // btn_0.doClick(); disposed(); } }); } // </editor-fold> List<Mysql.databases> db_list = new ArrayList(); private void init_db() { final String hostname = jLabel2.getText(); final String port = jLabel3.getText(); final String username = jLabel5.getText(); final String password = jLabel8.getText(); String search = tf_db.getText(); db_list.clear(); db_list = Mysql.get_databases(hostname, port, username, password); Object[][] obj = new Object[db_list.size()][1]; int i = 0; for (Mysql.databases to : db_list) { obj[i][0] = " " + to.db_name; i++; } JLabel[] labels = {}; int[] tbl_widths_customers = {tf_db.getWidth()}; int width = 0; String[] col_names = {""}; TableRenderer tr = new TableRenderer(); TableRenderer. setPopup(tf_db, obj, labels, tbl_widths_customers, col_names); tr.setCallback(new TableRenderer.Callback() { @Override public void ok(TableRenderer.OutputData data) { final Mysql.databases to = (Mysql.databases) db_list.get(data.selected_row); lbl_db.setText(to.db_name); tf_db.setText(to.db_name); jProgressBar1.setString("Loading...Please wait..."); jProgressBar1.setIndeterminate(true); Thread t = new Thread(new Runnable() { @Override public void run() { loadData_tables(Mysql.get_tables(to.db_name, hostname, port, username, password)); jLabel11.setText("" + tbl_tables_ALM.size()); jProgressBar1.setString("Finished..."); jProgressBar1.setIndeterminate(false); } }); t.start(); } }); } private ArrayListModel tbl_tables_ALM; private TbltablesModel tbl_tables_M; private void init_tbl_tables() { tbl_tables_ALM = new ArrayListModel(); tbl_tables_M = new TbltablesModel(tbl_tables_ALM); tbl_tables.setModel(tbl_tables_M); tbl_tables.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); tbl_tables.setRowHeight(25); int[] tbl_widths_tables = {100, 50, 30, 30, 30, 30, 30}; for (int i = 0, n = tbl_widths_tables.length; i < n; i++) { if (i == 0) { continue; } TableWidthUtilities.setColumnWidth(tbl_tables, i, tbl_widths_tables[i]); } Dimension d = tbl_tables.getTableHeader().getPreferredSize(); d.height = 0; tbl_tables.getTableHeader().setPreferredSize(d); tbl_tables.getTableHeader().setFont(new java.awt.Font("Arial", 0, 12)); tbl_tables.setRowHeight(25); tbl_tables.setFont(new java.awt.Font("Arial", 0, 12)); tbl_tables.getColumnModel().getColumn(2).setCellRenderer(new ImageRenderer1()); tbl_tables.getColumnModel().getColumn(3).setCellRenderer(new ImageRenderer1()); tbl_tables.getColumnModel().getColumn(4).setCellRenderer(new ImageRenderer1()); tbl_tables.getColumnModel().getColumn(5).setCellRenderer(new ImageRenderer1()); tbl_tables.getColumnModel().getColumn(6).setCellRenderer(new ImageRenderer1()); } private void loadData_tables(List<Mysql.tables> acc) { tbl_tables_ALM.clear(); tbl_tables_ALM.addAll(acc); } public static class TbltablesModel extends AbstractTableAdapter { public static String[] COLUMNS = { "", "", "", "", "", "", "" }; public TbltablesModel(ListModel listmodel) { super(listmodel, COLUMNS); } @Override public boolean isCellEditable(int row, int column) { return false; } @Override public Class getColumnClass(int col) { if (col == 1000) { return Boolean.class; } return Object.class; } @Override public Object getValueAt(int row, int col) { Mysql.tables tt = (Mysql.tables) getRow(row); switch (col) { case 0: return " " + tt.table_name; case 1: return " " + tt.no_of_records; case 2: return "/synsoftech/mysql/eye18 (1).png"; case 3: return "/synsoftech/mysql/copy26.png"; case 4: return "/synsoftech/mysql/minus42.png"; case 5: return "/synsoftech/mysql/empty.png"; default: return "/synsoftech/mysql/add186.png"; } } } private void select_table() { int row = tbl_tables.getSelectedRow(); if (row < 0) { return; } final String db_name = lbl_db.getText(); final String hostname = jLabel2.getText(); final String port = jLabel3.getText(); final String username = jLabel5.getText(); final String password = jLabel8.getText(); final Mysql.tables to = (Mysql.tables) tbl_tables_ALM.get(row); int col = tbl_tables.getSelectedColumn(); if (col == 0) { view_columns(); } if (col == 2) { //View table } if (col == 3) { duplicate_table(); } if (col == 4) { Window p = (Window) this; Confirm nd = Confirm.create(p, true); nd.setTitle(""); if (dash == null) { nd.do_pass(jPanel1.getRootPane()); } else { nd.do_pass(dash.getRootPane()); } nd.setCallback(new Confirm.Callback() { @Override public void ok(CloseDialog closeDialog, Confirm.OutputData data) { closeDialog.ok(); jProgressBar1.setString("Loading...Please wait..."); jProgressBar1.setIndeterminate(true); Thread t = new Thread(new Runnable() { @Override public void run() { String text = Mysql.drop_table(db_name, to.table_name, hostname, port, username, password); jTextArea1.setText(text); loadData_tables(Mysql.get_tables(db_name, hostname, port, username, password)); jLabel11.setText("" + tbl_tables_ALM.size()); jProgressBar1.setString("Finished..."); jProgressBar1.setIndeterminate(false); } }); t.start(); } }); nd.setLocationRelativeTo(this); nd.setVisible(true); } if (col == 5) { Window p = (Window) this; Confirm nd = Confirm.create(p, true); nd.setTitle(""); if (dash == null) { nd.do_pass(jPanel1.getRootPane()); } else { nd.do_pass(dash.getRootPane()); } nd.setCallback(new Confirm.Callback() { @Override public void ok(CloseDialog closeDialog, Confirm.OutputData data) { closeDialog.ok(); jProgressBar1.setString("Loading...Please wait..."); jProgressBar1.setIndeterminate(true); Thread t = new Thread(new Runnable() { @Override public void run() { String text = Mysql.empty_table(db_name, to.table_name, hostname, port, username, password); jTextArea1.setText(text); loadData_tables(Mysql.get_tables(db_name, hostname, port, username, password)); jLabel11.setText("" + tbl_tables_ALM.size()); jProgressBar1.setString("Finished..."); jProgressBar1.setIndeterminate(false); } }); t.start(); } }); nd.setLocationRelativeTo(this); nd.setVisible(true); } if (col == 6) { Window p = (Window) this; Dlg_add_column nd = Dlg_add_column.create(p, true); nd.setTitle(""); nd.setCallback(new Dlg_add_column.Callback() { @Override public void ok(CloseDialog closeDialog, final Dlg_add_column.OutputData data) { closeDialog.ok(); jProgressBar1.setString("Loading...Please wait..."); jProgressBar1.setIndeterminate(true); Thread t = new Thread(new Runnable() { @Override public void run() { String text = Mysql.add_column(db_name, to.table_name, hostname, port, username, password, data.column_name, data.data_type, data.size); jTextArea1.setText(text); loadData_tables(Mysql.get_tables(db_name, hostname, port, username, password)); jProgressBar1.setString("Finished..."); jProgressBar1.setIndeterminate(false); } }); t.start(); } }); Point point = jButton5.getLocationOnScreen(); nd.setLocation(point.x + 35, point.y + 34); nd.setVisible(true); } } private void duplicate_table() { int row = tbl_tables.getSelectedRow(); if (row < 0) { return; } final Mysql.tables to = (Mysql.tables) tbl_tables_ALM.get(row); final String db_name = lbl_db.getText(); final String hostname = jLabel2.getText(); final String port = jLabel3.getText(); final String username = jLabel5.getText(); final String password = jLabel8.getText(); Window p = (Window) this; Dlg_mysql_duplicate_table nd = Dlg_mysql_duplicate_table.create(p, true); nd.setTitle(""); nd.setCallback(new Dlg_mysql_duplicate_table.Callback() { @Override public void ok(CloseDialog closeDialog, final Dlg_mysql_duplicate_table.OutputData data) { closeDialog.ok(); jProgressBar1.setString("Loading...Please wait..."); jProgressBar1.setIndeterminate(true); Thread t = new Thread(new Runnable() { @Override public void run() { List<Mysql.columns> datas = Mysql.get_columns(db_name, to.table_name, hostname, port, username, password); String text = Mysql.duplicate_table(db_name, to.table_name, hostname, port, username, password, data.table_name, datas); jTextArea1.setText(text); loadData_tables(Mysql.get_tables(db_name, hostname, port, username, password)); jLabel11.setText("" + tbl_tables_ALM.size()); jProgressBar1.setString("Finished..."); jProgressBar1.setIndeterminate(false); } }); t.start(); } }); Point point = jButton5.getLocationOnScreen(); nd.setLocation(point.x + 35, point.y + 34); nd.setVisible(true); } private void view_columns() { int row = tbl_tables.getSelectedRow(); if (row < 0) { return; } Mysql.tables to = (Mysql.tables) tbl_tables_ALM.get(row); String db_name = lbl_db.getText(); final String hostname = jLabel2.getText(); final String port = jLabel3.getText(); final String username = jLabel5.getText(); final String password = jLabel8.getText(); List<Mysql.columns> datas = Mysql.get_columns(db_name, to.table_name, hostname, port, username, password); Window p = (Window) this; Dlg_mysql_columns nd = Dlg_mysql_columns.create(p, true); nd.setTitle(""); nd.do_pass(datas, to.table_name, db_name); nd.setCallback(new Dlg_mysql_columns.Callback() { @Override public void ok(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); } @Override public void transfer_object(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); jTextArea1.setText(data.ret_val); copy_paste(data.ret_val); } @Override public void insert(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); jTextArea1.setText(data.ret_val); copy_paste(data.ret_val); } @Override public void update(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); jTextArea1.setText(data.ret_val); copy_paste(data.ret_val); } @Override public void delete(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); jTextArea1.setText(data.ret_val); copy_paste(data.ret_val); } @Override public void select(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); jTextArea1.setText(data.ret_val); copy_paste(data.ret_val); } @Override public void table(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); jTextArea1.setText(data.ret_val); copy_paste(data.ret_val); } @Override public void crud(CloseDialog closeDialog, Dlg_mysql_columns.OutputData data) { closeDialog.ok(); jTextArea1.setText(data.ret_val); copy_paste(data.ret_val); } }); Point point = jButton5.getLocationOnScreen(); nd.setLocation(point.x + 35, point.y + 34); nd.setPreferredSize(new Dimension(380, jScrollPane1.getHeight())); nd.setVisible(true); } private void copy_paste(String output) { Toolkit toolkit = Toolkit.getDefaultToolkit(); Clipboard clipboard = toolkit.getSystemClipboard(); StringSelection strSel = new StringSelection(output); clipboard.setContents(strSel, null); String result = ""; try { result = (String) clipboard.getData(DataFlavor.stringFlavor); } catch (UnsupportedFlavorException e) { } catch (IOException e) { } } private void add_table() { final String hostname = jLabel2.getText(); final String port = jLabel3.getText(); final String username = jLabel5.getText(); final String password = jLabel8.getText(); Window p = (Window) this; Dlg_mysql_create_table_columns nd = Dlg_mysql_create_table_columns.create(p, true); nd.setTitle(""); nd.do_pass(); nd.setCallback(new Dlg_mysql_create_table_columns.Callback() { @Override public void ok(CloseDialog closeDialog, final Dlg_mysql_create_table_columns.OutputData data) { closeDialog.ok(); jProgressBar1.setString("Loading...Please wait..."); jProgressBar1.setIndeterminate(true); Thread t = new Thread(new Runnable() { @Override public void run() { String text = Mysql.create_table(lbl_db.getText(), data.table_name, data.columns, hostname, port, username, password); loadData_tables(Mysql.get_tables(lbl_db.getText(), hostname, port, username, password)); jLabel11.setText("" + tbl_tables_ALM.size()); jTextArea1.setText(text); jProgressBar1.setString("Finished..."); jProgressBar1.setIndeterminate(false); } }); t.start(); } }); Point point = jButton5.getLocationOnScreen(); nd.setPreferredSize(new Dimension(nd.getWidth(), jScrollPane1.getHeight() + 34)); nd.setLocation(point.x + 40, point.y); nd.setVisible(true); } }
[ "rpascua.synsoftech@gmail.com" ]
rpascua.synsoftech@gmail.com
dfcf56f8cc50a2e23440a7fe434ffbd8e3b11bec
87ca25bb8961dd6c277c5597bd1def8f71b69746
/src/main/java/com/miaotec/commons/cache/redis/OP.java
fa80090fb260d34bfe0121b240b74d0893fb7bc1
[]
no_license
xuan5451/fenmiaoxin
4f03e9217e2ad2b4c7720467c4202d8a0dce4fad
dd759bbd786d3bbb473b36725b1b967e35e62b36
refs/heads/master
2020-03-24T10:29:16.783737
2018-07-29T14:43:12
2018-07-29T14:43:12
142,657,638
0
0
null
null
null
null
UTF-8
Java
false
false
137
java
/** * */ package com.miaotec.commons.cache.redis; /** * @author zhangyonghui * */ public enum OP { READORWRITE, READ, WRITE };
[ "xuan5451@users.noreply.github.com" ]
xuan5451@users.noreply.github.com
1a8a948d97c6686d8d264f28affa9f60f5382718
a20fef25e4485423db84eb6fe6610aa1e4ddfa89
/src/infy/com/hospital/manager/DischargeSummaryManager.java
9ea31860e0a2521a2dd606e55e49b3398fb21a2a
[]
no_license
5h4thru/POST_Project
508f3e83e4790b251d70ad7a3a3501770e377011
711f7458f8652dc52b429250905d567514b04abb
refs/heads/master
2016-09-06T17:03:05.396751
2015-08-11T04:00:07
2015-08-11T04:00:07
40,520,422
0
0
null
null
null
null
UTF-8
Java
false
false
418
java
package infy.com.hospital.manager; import infy.com.hospital.service.DischargeSummaryService; import infy.com.hospital.to.DischargeTO; public class DischargeSummaryManager { public DischargeTO dischargeSummary(String registrationNo) throws Exception { try { DischargeTO dto=new DischargeSummaryService().dischargeSummary(registrationNo); return dto; } catch(Exception e) { throw e; } } }
[ "durgasaipreethamp@yahoo.com" ]
durgasaipreethamp@yahoo.com
0dc967a634778395d7fa73d3ec89f2646c22a673
7f2e72f1bdfd9a6f1b8b5227b78f91634d18a74e
/src/main/java/reflect/demo/b/Servace.java
6daa968902748e95b13edfe81d78c869c88b7840
[]
no_license
zhichao19930808/JavaSE
d5186318d53bcc99212a3276b243094b7726f903
77163b3da891430eb867fa6f3c2e50423186b8c0
refs/heads/master
2021-01-19T02:27:42.222114
2017-07-21T09:53:48
2017-07-21T09:53:48
87,279,738
0
0
null
null
null
null
UTF-8
Java
false
false
570
java
package reflect.demo.b; /** * Created by Administrator on 2017/5/5. * 高层应用类 */ //强耦合 -> 松散耦合 解耦合 public class Servace { private DeviceWriter deviceWriter; //解决空指针异常: //1.创建构造方法 /* public Servace(DeviceWriter deviceWriter) { this.deviceWriter = deviceWriter; } */ //2.创建一个set方法 public void setDeviceWriter(DeviceWriter deviceWriter) { this.deviceWriter = deviceWriter; } public void write() { deviceWriter.writerToDevice(); } }
[ "zhichaoglory@163.com" ]
zhichaoglory@163.com
11d02c24342c4433457ee68ce0619478e8b00e85
85cfc652459ca2f015aa8c8dc55240721632cee0
/bin/custom/cartridge/cartridgestorefront/web/addonsrc/smarteditaddon/de/hybris/platform/smarteditaddon/interceptors/beforeview/SmarteditaddonResponsiveStrategy.java
2744135c1ea6f78a52b594df2bb93e80a9076749
[]
no_license
varshadhamal/Hybris-test
43e5479b9909e41e6276dfde6b4f4ff1cdae9b0e
a29c6090680110ab733e2077772c9c477d497df6
refs/heads/master
2020-03-18T06:31:01.940494
2018-05-22T11:58:12
2018-05-22T11:58:12
134,400,503
0
1
null
null
null
null
UTF-8
Java
false
false
773
java
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE or an SAP affiliate company. * All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.smarteditaddon.interceptors.beforeview; /** * Strategy to determine if the storefront is responsive or non responsive. */ public interface SmarteditaddonResponsiveStrategy { /** * Indicate if the storefront is responsive (true) or not (false). * * @return Boolean representing the responsiveness of the storefront */ Boolean isResponsive(); }
[ "varsha.d.saste@accenture.com" ]
varsha.d.saste@accenture.com
ff8b7f3a970a6a79278f47897de07cdb7b66c91a
c0060408025bc8e138a0d2a7bc0a49e0aafc37c0
/BodyPlan/BodyPlanBackend/src/main/java/cz/bodyplan/be/spring/repository/DavidRepositoryImpl.java
ec116cd66c77d011043f936783e02f578727a3ea
[]
no_license
javauniverzity/project
029ebb87c22873ca16d754471dc2fc31cb003e4b
d7bca05e640aa150014ef79559991d03b2a8b29b
refs/heads/master
2021-01-01T20:35:13.618480
2015-06-18T09:15:18
2015-06-18T09:15:18
33,610,878
0
0
null
null
null
null
UTF-8
Java
false
false
3,528
java
package cz.bodyplan.be.spring.repository; import java.util.List; import javax.persistence.criteria.CriteriaBuilder; import javax.persistence.criteria.CriteriaQuery; import javax.persistence.criteria.Root; import org.springframework.stereotype.Repository; import org.springframework.transaction.annotation.Transactional; import cz.bodyplan.web.interfaces.repository.UserRepository; import cz.bodyplan.web.vo.dto.User; public class DavidRepositoryImpl<David>extends Template<David> { @Repository @Transactional(readOnly = true) public class UserRepositoryImpl extends Template<User> implements UserRepository { /** * vytvoreni uzivatele */ @Override @Transactional(readOnly = false) public void create(final User user) { super.persist(user); } /** * odstraneni uzivatele */ @Override @Transactional(readOnly = false) public void remove(final User user) { super.delete(user); } /** * vrati uzivatele podle uzivatelskeho jmena, to je jedinecnne */ @Override public User loadUserByUsername(final String username) { if (username == null || "".equals(username)) { return null; } final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); // final DetachedCriteria crit = DetachedCriteria.forClass(User.class).add(Restrictions.eq("username", username)); final CriteriaQuery<User> crit = criteriaBuilder.createQuery(User.class); final Root<User> users = crit.from(User.class); crit.select(users).where(criteriaBuilder.equal(users.get("username"), username)); final List<User> results = findByCriteria(crit); if (results.size() != 0) { return results.get(0); } return null; } /** * vrati vsechny uzivatele systemu */ @Override public List<User> getListOfUsers() { final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); final CriteriaQuery<User> createQuery = criteriaBuilder.createQuery(User.class); final CriteriaQuery<User> select = createQuery.select(createQuery.from(User.class)); return findByCriteria(select); } /** * ulozeni zmen uzivatele */ @Override @Transactional(readOnly = false) public void update(final User user) { super.update(user); } @Override public User loadById(final Long id) { if (id == null) { return null; } // final DetachedCriteria crit = DetachedCriteria.forClass(User.class).add(Restrictions.eq("id", id)); final CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); // final DetachedCriteria crit = DetachedCriteria.forClass(User.class).add(Restrictions.eq("username", username)); final CriteriaQuery<User> crit = criteriaBuilder.createQuery(User.class); final Root<User> users = crit.from(User.class); crit.select(users).where(criteriaBuilder.equal(users.get("id"), id)); final List<User> results = findByCriteria(crit); if (results.size() != 0) { return results.get(0); } return null; } } }
[ "David@192.168.16.60" ]
David@192.168.16.60
6e7eac4526b762141fcc821d734e70e90bfd6204
526b96793324791355a2dbe7a0e64a393506d109
/src/htmlstructure/HTMLCode.java
f5b9f9afeb925ad0fa1b5c7615ab23ccc7e3f1a8
[]
no_license
adeelshahid/psd-parse-html
fd3f0bc3d834866dde0ac0198eefa6c847a1465c
25f7b573f250806d08b8ec8d94bfc6456ec98b91
refs/heads/master
2020-06-29T11:20:53.978414
2016-09-05T21:22:18
2016-09-05T21:22:18
67,451,241
0
1
null
null
null
null
UTF-8
Java
false
false
237
java
package htmlstructure; import java.util.ArrayList; import layerstructure.LayerStructure; import psd.model.Layer; public class HTMLCode { public static void generate(ArrayList<Layer> layers) { LayerStructure.process(layers); } }
[ "imadeelshahid@gmail.com" ]
imadeelshahid@gmail.com
ae057c5a4b8856bdca1a01167c65888259dc7fbb
4589a9b3563e39d49039aa846fea25d9dbc10a8a
/src/before/factory/factory_one/IWorkFactory.java
461fa60c6b9df5b804e4905cec2f7552f4658630
[]
no_license
moocstudent/DesignPattern1
3769f733484e963110f65a6b75e5293cd1ec76ef
b728ea7c82e96960fac20baab0f3dc6f80336ea2
refs/heads/master
2022-03-06T13:07:06.189716
2019-12-07T15:08:16
2019-12-07T15:08:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
170
java
package before.factory.factory_one; /** * 获取工作的接口 可以理解为智联/58/Boss等招聘平台 */ public interface IWorkFactory { Work getWork(); }
[ "deadzq@qq.com" ]
deadzq@qq.com
47a092b17cdf07b5c39e79733c09ac3c866e8f00
5f84735a68feec078b9fcef19283fcda537ebe5a
/api/src/main/java/org/queryall/api/querytype/QueryTypeEnum.java
6f0069ac1fbad1879ece7b076221ae5918b4f701
[]
no_license
ansell/queryall
a07bea0f3a889ca6aeba9275f3255fa77b7a4be4
870cb10467737ebcb7a39543f5a0fe6a3f3ba40c
refs/heads/develop
2020-05-19T20:57:21.319597
2015-12-27T05:38:16
2015-12-27T05:38:16
2,281,948
1
0
null
2013-07-14T23:45:40
2011-08-28T03:44:23
Java
UTF-8
Java
false
false
1,588
java
/** * */ package org.queryall.api.querytype; import java.util.Collection; import java.util.Set; import org.openrdf.model.URI; import org.queryall.api.services.QueryAllEnum; import org.queryall.api.services.ServiceUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * QueryType implementations register themselves with this enumeration when they are loaded. * * NOTE: This is not an enumeration as java does not support extensible enumerations, but it should * act like one for all purposes other than java's underpowered switch case statement. * */ public class QueryTypeEnum extends QueryAllEnum { private static final Logger LOG = LoggerFactory.getLogger(QueryTypeEnum.class); @SuppressWarnings("unused") private static final boolean TRACE = QueryTypeEnum.LOG.isTraceEnabled(); private static final boolean DEBUG = QueryTypeEnum.LOG.isDebugEnabled(); @SuppressWarnings("unused") private static final boolean INFO = QueryTypeEnum.LOG.isInfoEnabled(); /** * @deprecated Use {@link ServiceUtils#getQueryTypeEnumsByTypeUris(Set<URI>)} instead */ @Deprecated public static Collection<QueryTypeEnum> byTypeUris(final Set<URI> nextTypeUris) { return ServiceUtils.getQueryTypeEnumsByTypeUris(nextTypeUris); } /** * Create a new QueryType enum using the given name, which must be unique. * * @param nextName * @param nextTypeURIs */ public QueryTypeEnum(final String nextName, final Set<URI> nextTypeURIs) { super(nextName, nextTypeURIs); } }
[ "p_ansell@yahoo.com" ]
p_ansell@yahoo.com
75dae0caa264248f06fb05ccbcdc095c7b23eb1e
e9124854d2bb3a40f6642858f3777e89a88b1d54
/custom/toint/tointfacades/testsrc/org/toint/facades/suggestion/DefaultSimpleSuggestionFacadeIntegrationTest.java
0833721316cf916a3180c4a021c810fd12f724e7
[]
no_license
Prashanth-techouts/Toint
9bcba94fd0422f20131c24cd9e0ec19e789941d6
dbd466fae6303a6c796ffd52f169119a4a7ee134
refs/heads/master
2023-09-03T02:20:49.827317
2021-10-22T10:48:30
2021-10-22T10:48:30
419,990,956
0
0
null
null
null
null
UTF-8
Java
false
false
2,759
java
/* * Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. */ package org.toint.facades.suggestion; import de.hybris.bootstrap.annotations.IntegrationTest; import de.hybris.platform.catalog.enums.ProductReferenceTypeEnum; import de.hybris.platform.commercefacades.product.data.ProductData; import de.hybris.platform.core.model.user.UserModel; import de.hybris.platform.servicelayer.ServicelayerTransactionalTest; import de.hybris.platform.servicelayer.user.UserService; import de.hybris.platform.site.BaseSiteService; import org.toint.facades.suggestion.impl.DefaultSimpleSuggestionFacade; import java.util.Arrays; import java.util.Collections; import java.util.List; import javax.annotation.Resource; import junit.framework.Assert; import org.apache.commons.lang.math.NumberUtils; import org.junit.Before; import org.junit.Test; /** * Integration test suite for {@link DefaultSimpleSuggestionFacade}. */ @IntegrationTest public class DefaultSimpleSuggestionFacadeIntegrationTest extends ServicelayerTransactionalTest { @Resource private SimpleSuggestionFacade simpleSuggestionFacade; @Resource private BaseSiteService baseSiteService; @Resource private UserService userService; @Before public void setUp() throws Exception { userService.setCurrentUser(userService.getAnonymousUser()); importCsv("/tointfacades/test/testSimpleSuggestionFacade.csv", "utf-8"); baseSiteService.setCurrentBaseSite(baseSiteService.getBaseSiteForUID("testSite"), false); } @Test public void testReferencesForPurchasedInCategory() { final UserModel user = userService.getUserForUID("dejol"); userService.setCurrentUser(user); List<ProductData> result = simpleSuggestionFacade.getReferencesForPurchasedInCategory("cameras", Collections.EMPTY_LIST, false, null); Assert.assertEquals(4, result.size()); result = simpleSuggestionFacade.getReferencesForPurchasedInCategory("cameras", Collections.EMPTY_LIST, false, NumberUtils.INTEGER_ONE); Assert.assertEquals(1, result.size()); result = simpleSuggestionFacade.getReferencesForPurchasedInCategory("cameras", Arrays.asList(ProductReferenceTypeEnum.SIMILAR), false, null); Assert.assertEquals(1, result.size()); result = simpleSuggestionFacade.getReferencesForPurchasedInCategory("cameras", Arrays.asList(ProductReferenceTypeEnum.ACCESSORIES), false, null); Assert.assertEquals(2, result.size()); result = simpleSuggestionFacade.getReferencesForPurchasedInCategory("cameras", Arrays.asList(ProductReferenceTypeEnum.ACCESSORIES), true, null); Assert.assertEquals(1, result.size()); final ProductData product = result.get(0); Assert.assertEquals("adapterDC", product.getCode()); Assert.assertEquals("adapter", product.getName()); } }
[ "prashanth.g@techouts.com" ]
prashanth.g@techouts.com
b400b5540149b4e3d7fae83a483a3bf1f3375c99
a9073cbdb325801bdddf35f1b2b13e6a9eeb2e7d
/hw15-0036479615/src/main/java/hr/fer/zemris/java/tecaj_13/web/servlets/NewEntryServlet.java
c95f24200c08fa4ba3f9fa8958d90c7ef825f93a
[]
no_license
svennjegac/FER-java-opjj
6b1dc8fb691940c561c589233af3a5b46f96309e
d7e59bf000c63d9ffa3941d5c22256d2dd426a06
refs/heads/master
2020-03-29T04:13:54.366615
2019-09-08T00:27:36
2019-09-08T00:27:36
149,521,553
1
0
null
null
null
null
UTF-8
Java
false
false
1,148
java
package hr.fer.zemris.java.tecaj_13.web.servlets; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import hr.fer.zemris.java.tecaj_13.model.BlogUser; /** * Servlet processes request for new entry. * * @author Sven Njegač * @version 1.0 */ @WebServlet(name="add-entry-servlet", urlPatterns={"/author/new"}) public class NewEntryServlet extends HttpServlet { /** UID. */ private static final long serialVersionUID = 1L; @Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { BlogUser user = (BlogUser) req.getAttribute("author"); if (user == null || req.getSession().getAttribute("current_user_id") == null || user.getId() != (Long) req.getSession().getAttribute("current_user_id")) { resp.sendRedirect(req.getContextPath() + "/servleti/main"); return; } req.getRequestDispatcher("/WEB-INF/pages/edit-update-entry.jsp").forward(req, resp); } }
[ "sven.njegac@fer.hr" ]
sven.njegac@fer.hr
6d10d712796dc1561e74bc3bac662e0f4118da77
f4e45b006f9dfe6b233b970ffb4b710d7941f91a
/SpringBoot-r/src/main/java/com/example/model/Products.java
9cbb128358771a60e352c943db930755e097094a
[]
no_license
KiaShamaei/springOracleJDBC
bdefa1a4930a10fd7d7e5134e4895846d590bb4b
9b32f99880b137711b97e2e7a48e4783b5d984b4
refs/heads/master
2023-03-23T14:56:03.200456
2021-03-14T16:47:11
2021-03-14T16:47:11
347,694,810
0
0
null
null
null
null
UTF-8
Java
false
false
543
java
package com.example.model; public class Products { private int Id ; private String name ; private String price; public int getId() { return Id; } public void setId(int id) { Id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPrice() { return price; } public void setPrice(String price) { this.price = price; } public Products(int id, String name, String price) { super(); Id = id; this.name = name; this.price = price; } }
[ "Shamaei.Kiarash@TaraTechGroup.com" ]
Shamaei.Kiarash@TaraTechGroup.com
5e881b533bee4e8d4cdc753ff5cccd2b84eb0a61
9eba5bbeabf4a98fd63a96877f7914683a67c63e
/src/main/java/br/com/faspinheiro/projetojavarest/controller/ItemPedidoController.java
e2436a1c6cb6bc6bf7c30d7abc4b3c978202c50c
[]
no_license
faspinheiro/projetojavarest
3788398828cc1b971ed737f1ba56ac8adef14284
1515593ad67abb82935a9988ab9548b8efb308ea
refs/heads/master
2022-04-19T05:50:48.407938
2020-04-12T16:21:37
2020-04-12T16:21:37
255,105,251
0
0
null
null
null
null
UTF-8
Java
false
false
1,424
java
package br.com.faspinheiro.projetojavarest.controller; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import br.com.faspinheiro.projetojavarest.negocio.ItemPedido; import br.com.faspinheiro.projetojavarest.service.ItemPedidoService; @RestController @RequestMapping("/api/itempedido") public class ItemPedidoController { @Autowired private ItemPedidoService servico; @GetMapping public List<ItemPedido> obterLista(){ return (List<ItemPedido>) servico.obterTodos(); } @GetMapping("{id}") public ItemPedido obterUm(@PathVariable Integer id) { return servico.obterItemPedido(id).get(); } @PostMapping public void incluir(@RequestBody ItemPedido item) { servico.incluir(item); } @DeleteMapping("{id}") public void excluir(@PathVariable Integer id) { servico.excluir(id); } public ItemPedidoService getServico() { return servico; } public void setServico(ItemPedidoService servico) { this.servico = servico; } }
[ "faspinheiro@gmail.com" ]
faspinheiro@gmail.com
ef735edb200e7beecfd9dd1d907cb781c9b5b462
b4bd89d15d031c34d766f358b57e3f50786b9ce3
/SpringBootjpa1/src/test/java/com/service/CoderServiceImplTest.java
ad3db74a9cf5cb3f73d27f11a75ce3efd369fef0
[]
no_license
rishchimata/myrep
daf40bea2e774d4d5b190a7954e16b3939e69ea2
5e6ab73f3cf3deb4312cfcf3a97e604f8fda8ce6
refs/heads/main
2023-08-05T01:33:57.476287
2021-09-17T06:58:51
2021-09-17T06:58:51
392,630,031
0
0
null
null
null
null
UTF-8
Java
false
false
2,629
java
package com.service; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.*; import java.util.ArrayList; import java.util.List; import java.util.Optional; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; import com.entity.Coder; import com.repository.CoderRepo; @SpringBootTest class CoderServiceImplTest { @Autowired CoderServiceImpl coderservice; @MockBean CoderRepo repo; @Test void testGetCoders() { Coder c1=new Coder(); c1.setCid(1); c1.setCname("Madhu"); c1.setTech("JavaFS"); Coder c2=new Coder(); c2.setCid(2); c2.setCname("Madhuri"); c2.setTech("Java"); List<Coder> coderList = new ArrayList<>(); coderList.add(c1); coderList.add(c2); Mockito.when(repo.findAll()).thenReturn(coderList); assertThat(coderservice.getCoders()).isEqualTo(coderList); } @Test void testGetCoderById() { Coder c1=new Coder(); c1.setCid(1); c1.setCname("Madhu"); c1.setTech("JavaFS"); Optional<Coder> c2=Optional.of(c1); Mockito.when(repo.findById(1)).thenReturn(c2); assertThat(coderservice.getCoderById(1)).isEqualTo(c1); } @Test void testAddCoder() { Coder c1=new Coder(); c1.setCid(1); c1.setCname("Madhu"); c1.setTech("JavaFS"); Mockito.when(repo.save(c1)).thenReturn(c1); assertThat(coderservice.addCoder(c1)).isEqualTo(c1); } @Test void testUpdateCoder() throws Exception { Coder c1=new Coder(); c1.setCid(1); c1.setCname("Madhu"); c1.setTech("JavaFS"); Optional<Coder> c2=Optional.of(c1); Mockito.when(repo.findById(1)).thenReturn(c2); Mockito.when(repo.save(c1)).thenReturn(c1); c1.setCname("Madhulika"); c1.setTech("ML"); assertThat(coderservice.updateCoder(c1)).isEqualTo(c1); } @Test void testDeleteCoder() { Coder c1=new Coder(); c1.setCid(1); c1.setCname("Madhu"); c1.setTech("JavaFS"); Optional<Coder> c2=Optional.of(c1); Mockito.when(repo.findById(1)).thenReturn(c2); Mockito.when(repo.existsById(c1.getCid())).thenReturn(false); assertFalse(repo.existsById(c1.getCid())); } /* * @Test void testDeleteCoderById() { fail("Not yet implemented"); } * * @Test void testGetCoderByCname() { fail("Not yet implemented"); } * * @Test void testFindByTechSorted() { fail("Not yet implemented"); } */ }
[ "RISHI@DESKTOP-0OOCA2N" ]
RISHI@DESKTOP-0OOCA2N
6ddf3aeaec6ab7b209516697627fa32d802f26cd
c9ff4c7d1c23a05b4e5e1e243325d6d004829511
/aws-java-sdk-eventbridge/src/main/java/com/amazonaws/services/eventbridge/model/transform/RunCommandTargetMarshaller.java
16518f8e9927b962821f80dd20956ef1b52fd952
[ "Apache-2.0" ]
permissive
Purushotam-Thakur/aws-sdk-java
3c5789fe0b0dbd25e1ebfdd48dfd71e25a945f62
ab58baac6370f160b66da96d46afa57ba5bdee06
refs/heads/master
2020-07-22T23:27:57.700466
2019-09-06T23:28:26
2019-09-06T23:28:26
207,350,924
1
0
Apache-2.0
2019-09-09T16:11:46
2019-09-09T16:11:45
null
UTF-8
Java
false
false
2,265
java
/* * Copyright 2014-2019 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.eventbridge.model.transform; import java.util.List; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.eventbridge.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * RunCommandTargetMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class RunCommandTargetMarshaller { private static final MarshallingInfo<String> KEY_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Key").build(); private static final MarshallingInfo<List> VALUES_BINDING = MarshallingInfo.builder(MarshallingType.LIST).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("Values").build(); private static final RunCommandTargetMarshaller instance = new RunCommandTargetMarshaller(); public static RunCommandTargetMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(RunCommandTarget runCommandTarget, ProtocolMarshaller protocolMarshaller) { if (runCommandTarget == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(runCommandTarget.getKey(), KEY_BINDING); protocolMarshaller.marshall(runCommandTarget.getValues(), VALUES_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
63dffe82858c34d59b79211da6818d64196e8525
ad8782fdbf30fe04e8b6b53a6fe8961fe35f833e
/src/com/book/borrow/dao/BorrowBackDao.java
65161d214cd3067f0912ab3bd7e1c33c54bf6cf1
[]
no_license
fujun126/book
4d0a4b9439d4f74d863f2e95e5eb405e46bacb80
bbb2d212e600d9de397994251c67decc7b612b3f
refs/heads/master
2021-07-13T17:25:33.060531
2017-10-16T09:47:12
2017-10-16T09:51:15
107,108,685
0
0
null
null
null
null
GB18030
Java
false
false
9,901
java
package com.book.borrow.dao; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import com.book.book.pojo.Bookinfo; import com.book.borrow.pojo.BorrowBack; import com.book.reader.pojo.Reader; import com.book.util.DB; public class BorrowBackDao { private DB db = DB.getDB(); private Connection conn; private PreparedStatement pstmt ; /** * 新增借书记录 */ public boolean saveBorrowBack(BorrowBack bb){ conn=db.getConn(); String sql = "insert into tb_borrow_back(readerid,bookid,borrowTime,backTime,operator) values(?,?,now(),?,?)"; try { pstmt = conn.prepareStatement(sql); pstmt.setInt(1, bb.getReader().getId()); pstmt.setInt(2, bb.getBook().getId()); pstmt.setString(3, bb.getBackTime()); pstmt.setInt(4, bb.getOperator()); int i = pstmt.executeUpdate(); if(i>0){ return true; } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, null); } return false; } /** * 修改借书记录 */ public boolean editBorrowBack(BorrowBack bb){ conn=db.getConn(); String sql = "update tb_borrow_back set readerid=?,bookid=?,borrowTime=now(),backTime=?,operator=? where id=?"; try { pstmt = conn.prepareStatement(sql); pstmt.setInt(1, bb.getBook().getId()); pstmt.setInt(2, bb.getBook().getId()); pstmt.setString(3, bb.getBackTime()); pstmt.setInt(4, bb.getOperator()); pstmt.setInt(5, bb.getId()); int i = pstmt.executeUpdate(); if(i>0){ return true; } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, null); } return false; } /** * 删除借书记录 */ public boolean delBorrowBack(int id){ conn=db.getConn(); String sql = "delete from tb_borrow_back where id=?"; try { pstmt = conn.prepareStatement(sql); pstmt.setInt(1, id); int i = pstmt.executeUpdate(); if(i>0){ return true; } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, null); } return false; } /** * 查询已经借阅的数据 */ public List<BorrowBack> queryBorrowBack(){ conn=db.getConn(); String sql = "select a.id,readerid,b.name readername,bookid,c.bookname,borrowTime," + "backTime,realTime,a.operator,ifback from tb_borrow_back a,tb_reader b,tb_bookinfo c " + "where a.readerid=b.id and a.bookid=c.id and ifback=0"; ResultSet rs = null; List<BorrowBack> list = new ArrayList<BorrowBack>(); try { pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); while(rs!=null && rs.next()){ BorrowBack bb = new BorrowBack(); bb.setId(rs.getInt("id")); Reader reader = new Reader(); reader.setId(rs.getInt("readerid")); reader.setName(rs.getString("readername")); bb.setReader(reader); Bookinfo book = new Bookinfo(); book.setId(rs.getInt("bookid")); book.setBookname(rs.getString("bookname")); bb.setBook(book); bb.setBorrowTime(rs.getString("borrowTime")); bb.setBackTime(rs.getString("backTime")); bb.setRealTime(rs.getString("realTime")); bb.setOperator(rs.getInt("operator")); bb.setIfback(rs.getInt("ifback")); list.add(bb); } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, rs); } return list; } /** * 查询全部数据 */ public List<BorrowBack> queryAllBorrowBack(){ conn=db.getConn(); String sql = "select a.id,readerid,b.name readername,bookid,c.bookname,borrowTime," + "backTime,realTime,a.operator,ifback from tb_borrow_back a,tb_reader b,tb_bookinfo c " + "where a.readerid=b.id and a.bookid=c.id "; ResultSet rs = null; List<BorrowBack> list = new ArrayList<BorrowBack>(); try { pstmt = conn.prepareStatement(sql); rs = pstmt.executeQuery(); while(rs!=null && rs.next()){ BorrowBack bb = new BorrowBack(); bb.setId(rs.getInt("id")); Reader reader = new Reader(); reader.setId(rs.getInt("readerid")); reader.setName(rs.getString("readername")); bb.setReader(reader); Bookinfo book = new Bookinfo(); book.setId(rs.getInt("bookid")); book.setBookname(rs.getString("bookname")); bb.setBook(book); bb.setBorrowTime(rs.getString("borrowTime")); bb.setBackTime(rs.getString("backTime")); bb.setRealTime(rs.getString("realTime")); bb.setOperator(rs.getInt("operator")); bb.setIfback(rs.getInt("ifback")); list.add(bb); } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, rs); } return list; } /** * 查询单条数据 */ public BorrowBack getBorrowBack(int id){ conn=db.getConn(); String sql = "select a.id,readerid,b.name readername,bookid,c.bookname,borrowTime," + "backTime,realTime,a.operator,ifback from tb_borrow_back a,tb_reader b,tb_bookinfo c " + "where a.readerid=b.id and a.bookid=c.id and ifback=0 and a.id=?"; ResultSet rs = null; BorrowBack bb = null; try { pstmt = conn.prepareStatement(sql); pstmt.setInt(1, id); rs = pstmt.executeQuery(); if(rs!=null && rs.next()){ bb = new BorrowBack(); bb.setId(rs.getInt("id")); Reader reader = new Reader(); reader.setId(rs.getInt("readerid")); reader.setName(rs.getString("readername")); bb.setReader(reader); Bookinfo book = new Bookinfo(); book.setId(rs.getInt("bookid")); book.setBookname(rs.getString("bookname")); bb.setBook(book); bb.setBorrowTime(rs.getString("borrowTime")); bb.setBackTime(rs.getString("backTime")); bb.setRealTime(rs.getString("realTime")); bb.setOperator(rs.getInt("operator")); bb.setIfback(rs.getInt("ifback")); } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, rs); } return bb; } /** * 还书:修改借书记录中的真实还书时间以及是否还书字段 */ public boolean editBorrowBackForBack(int id){ conn=db.getConn(); String sql = "update tb_borrow_back set realTime=now(),ifback=1 where id=?"; try { pstmt = conn.prepareStatement(sql); pstmt.setInt(1, id); int i = pstmt.executeUpdate(); if(i>0){ return true; } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, null); } return false; } /** * 带条件查询数据 */ public List<BorrowBack> queryBorrowBack(BorrowBack bb){ conn=db.getConn(); String sql = "select a.id,readerid,b.name readername,bookid,c.bookname,borrowTime," + "backTime,realTime,a.operator,ifback from tb_borrow_back a,tb_reader b,tb_bookinfo c " + "where a.readerid=b.id and a.bookid=c.id"; /////////动态条件///////// Map<Integer, Object> map = new HashMap<Integer, Object>(); if(!bb.getReader().getName().equals("")){ sql += " and b.name like concat('%',?,'%')"; map.put(map.size()+1, bb.getReader().getName()); } if(!bb.getBook().getBookname().equals("")){ sql += " and bookname like concat('%',?,'%')"; map.put(map.size()+1, bb.getBook().getBookname()); } if(bb.getIfback()==0){ sql += " and ifback = 0 and backTime >= curdate()"; } if(bb.getIfback()==1){ sql += " and ifback = 1"; } if(bb.getIfback()==2){ sql += " and ifback = 0 and backTime < curdate()"; } if(!bb.getStartDate().equals("") && !bb.getEndDate().equals("")){ if(bb.getTimeType()==0) sql += " and borrowTime between ? and ?"; else if(bb.getTimeType()==1) sql += " and backTime between ? and ?"; else if(bb.getTimeType()==2) sql += " and realTime between ? and ?"; map.put(map.size()+1, bb.getStartDate()); map.put(map.size()+1, bb.getEndDate()); } if(!bb.getStartDate().equals("") && bb.getEndDate().equals("")){ if(bb.getTimeType()==0) sql += " and borrowTime >= ?"; else if(bb.getTimeType()==1) sql += " and backTime >= ?"; else if(bb.getTimeType()==2) sql += " and realTime >= ?"; map.put(map.size()+1, bb.getStartDate()); } if(bb.getStartDate().equals("") && !bb.getEndDate().equals("")){ if(bb.getTimeType()==0) sql += " and borrowTime <= ?"; else if(bb.getTimeType()==1) sql += " and backTime <= ?"; else if(bb.getTimeType()==2) sql += " and realTime <= ?"; map.put(map.size()+1, bb.getEndDate()); } System.out.println(sql); ///////////////// ResultSet rs = null; List<BorrowBack> list = new ArrayList<BorrowBack>(); try { pstmt = conn.prepareStatement(sql); Set<Map.Entry<Integer, Object>> set = map.entrySet(); for (Map.Entry<Integer, Object> entry : set) { pstmt.setObject(entry.getKey(), entry.getValue()); } rs = pstmt.executeQuery(); while(rs!=null && rs.next()){ BorrowBack bean = new BorrowBack(); bean.setId(rs.getInt("id")); Reader reader = new Reader(); reader.setId(rs.getInt("readerid")); reader.setName(rs.getString("readername")); bean.setReader(reader); Bookinfo book = new Bookinfo(); book.setId(rs.getInt("bookid")); book.setBookname(rs.getString("bookname")); bean.setBook(book); bean.setBorrowTime(rs.getString("borrowTime")); bean.setBackTime(rs.getString("backTime")); bean.setRealTime(rs.getString("realTime")); bean.setOperator(rs.getInt("operator")); bean.setIfback(rs.getInt("ifback")); list.add(bean); } } catch (SQLException e) { e.printStackTrace(); } finally{ db.close(conn, pstmt, rs); } return list; } }
[ "Administrator@192.168.0.102" ]
Administrator@192.168.0.102
092567df45bac27d294c5804f51bd675cab3f441
dbf6a63c8dcd380ff7465d398547b908ecfe0bc3
/Code Chef/src/Positive_AND/Main2.java
9189d6db32d4b3c6db2c9a5a495189e56126b532
[]
no_license
zikrullahMd/Java-Codes
0eea4a922021ca8e87895e104ce735d997dd8939
50c60d8ed9a4e0afe82fb66af61246e349f70462
refs/heads/master
2023-04-26T08:55:03.780530
2021-05-21T16:16:46
2021-05-21T16:16:46
368,940,347
0
0
null
2021-05-20T03:28:55
2021-05-19T16:52:47
Java
UTF-8
Java
false
false
1,052
java
package Positive_AND; import java.util.*; public class Main2 { static void swap(int x, int y, int[] a) { a[x] = a[x] ^ a[y]; a[y] = a[x] ^ a[y]; a[x] = a[x] ^ a[y]; } static int[] rearrangeArray(int a[], int n) { for(int i = 4;i<n;i=i*2){ swap(i-1,i,a); } return a; } static boolean PowerOfTwoBinary(int x) { if((x & x-1) == 0) return true; else return false; } public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); int t = in.nextInt(); int[] a = new int[100001]; a[0] = 2; a[1] = 3; a[2] = 1; for(int i = 3;i<a.length;i++){ a[i] = i+1; } int[] b = new int[a.length]; b = rearrangeArray(a,a.length); while(t-->0) { int n = in.nextInt(); if(n == 1) { System.out.println(1); continue; } if(PowerOfTwoBinary(n)) { System.out.println(-1); continue; } for(int i = 0;i<n;i++) { System.out.print(b[i]+" "); } System.out.println(); } } }
[ "mohmmedzikrullah159@gmail.com" ]
mohmmedzikrullah159@gmail.com
6478be00c16b1a481a7f5d3b922e3daccd5555b1
1dbac8fdb6435778db19d825307e5fc595c6e71a
/mydubbo-framework/src/main/java/com/renwei/dubbo/rpc/NettyRpcServer.java
351bd5811908fd0d1650e3adf2ccbc512da92b11
[]
no_license
renw87/dubbo-demo
2e0517f24c58c5118d51d7e592c0f2726568c7d2
b29dadeb5220b76f28285c658878426a024f5bef
refs/heads/master
2022-07-04T14:28:03.684282
2020-03-29T13:11:39
2020-03-29T13:11:39
143,361,719
0
0
null
2022-06-10T19:56:33
2018-08-03T01:24:48
Java
UTF-8
Java
false
false
4,551
java
package com.renwei.dubbo.rpc; import com.renwei.dubbo.annotation.RpcAnnotation; import com.renwei.dubbo.registry.RegistryService; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; import io.netty.channel.EventLoopGroup; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.nio.NioServerSocketChannel; import io.netty.handler.codec.LengthFieldBasedFrameDecoder; import io.netty.handler.codec.LengthFieldPrepender; import io.netty.handler.codec.serialization.ClassResolvers; import io.netty.handler.codec.serialization.ObjectDecoder; import io.netty.handler.codec.serialization.ObjectEncoder; import java.util.HashMap; import java.util.Map; public class NettyRpcServer { private RegistryService registryService; private String serviceAddress; private Map<String, Object> handlerMap = new HashMap<>(16); public NettyRpcServer(RegistryService registryService, String serviceAddress) { this.registryService = registryService; this.serviceAddress = serviceAddress; } /** * 发布服务 */ public void publisher() { for (String serviceName : handlerMap.keySet()) { registryService.registry(serviceName, serviceAddress); } try { EventLoopGroup bossGroup = new NioEventLoopGroup(); EventLoopGroup workerGroup = new NioEventLoopGroup(); //启动netty服务 ServerBootstrap bootstrap = new ServerBootstrap(); bootstrap.group(bossGroup, workerGroup).channel(NioServerSocketChannel.class); bootstrap.childHandler(new ChannelInitializer<Channel>() { @Override protected void initChannel(Channel channel) throws Exception { ChannelPipeline channelPipeline = channel.pipeline(); //channelPipeline.addLast(new ObjectDecoder(1024 * 1024, ClassResolvers.weakCachingConcurrentResolver(this.getClass().getClassLoader()))); //channelPipeline.addLast(new ObjectEncoder()); //自定义协议解码器 /** 入参有5个,分别解释如下 maxFrameLength:框架的最大长度。如果帧的长度大于此值,则将抛出TooLongFrameException。 lengthFieldOffset:长度字段的偏移量:即对应的长度字段在整个消息数据中得位置 lengthFieldLength:长度字段的长度。如:长度字段是int型表示,那么这个值就是4(long型就是8) lengthAdjustment:要添加到长度字段值的补偿值 initialBytesToStrip:从解码帧中去除的第一个字节数 */ channelPipeline.addLast("frameDecoder", new LengthFieldBasedFrameDecoder(Integer.MAX_VALUE,0,4, 0, 4)); channelPipeline.addLast("frameEncoder", new LengthFieldPrepender(4)); channelPipeline.addLast("decoder", new ObjectDecoder(Integer.MAX_VALUE, ClassResolvers.cacheDisabled(this.getClass().getClassLoader()))); channelPipeline.addLast("encoder", new ObjectEncoder()); channelPipeline.addLast(new RpcServerHandler(handlerMap)); } }).option(ChannelOption.SO_BACKLOG, 128).childOption(ChannelOption.SO_KEEPALIVE, true); String[] addr = serviceAddress.split(":"); String ip = addr[0]; int port = Integer.valueOf(addr[1]); ChannelFuture future = bootstrap.bind(ip, port).sync(); System.out.println("服务启动,成功。"); future.channel().closeFuture().sync(); } catch (InterruptedException e) { e.printStackTrace(); } } /** * 子对象的实现 * * @param services 对象实现类 */ public void bind(Object... services) { //将实现类通过注解获取实现类的名称、实现类的实现放入map集合中。 for (Object service : services) { RpcAnnotation annotation = service.getClass().getAnnotation(RpcAnnotation.class); if(annotation != null) { String serviceName = annotation.value().getName(); handlerMap.put(serviceName, service); } } } }
[ "renwei_8080@126.com" ]
renwei_8080@126.com
10af9b61b565d9a6664ef03c5ce2c2a7480da6dd
792a181ee484b75818b39af16e47b6cbeea5a28b
/IronChests2/client/cpw/mods/ironchest/client/IronChestRenderHelper.java
1fbcfb66594548efc1dc70578b59c148e21c4f43
[]
no_license
Aerith-Ninetails/ironchest
487a45e4f96e0a46f608a59d7f1c2182131ca22a
5b9778de030c7ffa9b1c65cdd94a91eced4a1bc7
refs/heads/master
2021-01-18T07:22:23.370448
2012-07-12T03:38:59
2012-07-12T03:38:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,027
java
/******************************************************************************* * Copyright (c) 2012 cpw. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Public License v3.0 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/gpl.html * * Contributors: * cpw - initial API and implementation ******************************************************************************/ package cpw.mods.ironchest.client; import cpw.mods.ironchest.mod_IronChest; import net.minecraft.src.Block; import net.minecraft.src.ChestItemRenderHelper; import net.minecraft.src.TileEntityRenderer; public class IronChestRenderHelper extends ChestItemRenderHelper { @Override public void renderChest(Block block, int i, float f) { if (block==mod_IronChest.ironChestBlock) { TileEntityRenderer.instance.renderTileEntityAt(block.getTileEntity(i), 0.0D, 0.0D, 0.0D, 0.0F); } else { super.renderChest(block, i, f); } } }
[ "cpw@weeksfamily.ca" ]
cpw@weeksfamily.ca
81360d0dcf2edbe88fb6ef241c867d2f76899c2a
5148293c98b0a27aa223ea157441ac7fa9b5e7a3
/Method_Scraping/xml_scraping/NicadOutputFile_t2_flink/Nicad_t2_flink658.java
5c11baa6066e86a2de04f7cf8d54d62bbbb29264
[]
no_license
ryosuke-ku/TestCodeSeacherPlus
cfd03a2858b67a05ecf17194213b7c02c5f2caff
d002a52251f5461598c7af73925b85a05cea85c6
refs/heads/master
2020-05-24T01:25:27.000821
2019-08-17T06:23:42
2019-08-17T06:23:42
187,005,399
0
0
null
null
null
null
UTF-8
Java
false
false
632
java
// clone pairs:11468:90% // 13083:flink/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/SubtaskExecutionAttemptAccumulatorsInfo.java public class Nicad_t2_flink658 { public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } SubtaskExecutionAttemptAccumulatorsInfo that = (SubtaskExecutionAttemptAccumulatorsInfo) o; return subtaskIndex == that.subtaskIndex && attemptNum == that.attemptNum && Objects.equals(id, that.id) && Objects.equals(userAccumulatorList, that.userAccumulatorList); } }
[ "naist1020@gmail.com" ]
naist1020@gmail.com
bd71df76e94a0971a7f777907acbcc5b2cd926f5
3307bf6109f86177b145b32f75fe971a279a94b7
/testapp/app/src/main/java/try_run/gagan/shah/testapp/BackgroundServies.java
6be8ad6ef5eb2eeca1156403506a0f2c8687a3e0
[]
no_license
harsimar95/GeoguardPro_MDM_Test
b417c03dccba530cb3ced3ac3912b36cce1efa81
d4a50fe87998d98bb6a39c312e0b9d31867bf48b
refs/heads/master
2020-06-18T07:21:17.641385
2019-07-10T13:33:49
2019-07-10T13:33:49
196,211,180
0
0
null
null
null
null
UTF-8
Java
false
false
1,087
java
package try_run.gagan.shah.testapp; import android.app.Activity; import android.app.IntentService; import android.content.Intent; /** * Created by sumanthanda on 10/27/16. */ public class BackgroundServies extends IntentService { private static final int MY_ACCESS_FINE_LOCATION = 101; private static final int MY_ACCESS_COARSE_LOCATION = 102; private Activity activity; private boolean permissionIsGranted = false; public BackgroundServies() { super("Service"); } public BackgroundServies(Main5Activity main5Activity) { super("Service"); this.activity = main5Activity; } @Override protected void onHandleIntent(Intent intent) { System.out.println("Background servies Start"); System.out.println(activity); GpsHandler gpsHandler=new GpsHandler(this); gpsHandler.GPSlocation(new GpsHandler.Update() { @Override public void Updatelocation(String longi, String lati) { System.out.println(longi+" "+lati); } }); } }
[ "ishusharma@mansainfotech.com" ]
ishusharma@mansainfotech.com
5cad50f6638093c33c7e493e3d86b12beb0e400a
cbbf631bc8d28de27ec341193276e1d150b316da
/app/src/main/java/test/home/com/parkingapp/activity/ParkingHistoryActivity/ParkingHistoryActivity.java
f4270a540a79c5ac359991343b4b827177952b39
[]
no_license
mkylychev/ParkingApp
45d721c91525b349fea0ad72bfd32ac93b8d22e5
8d142c79acfd855a96f6c8aeba09af39fe7d34b0
refs/heads/master
2020-04-15T11:37:38.404389
2019-01-08T11:54:01
2019-01-08T11:54:01
164,637,874
0
0
null
null
null
null
UTF-8
Java
false
false
2,845
java
package test.home.com.parkingapp.activity.ParkingHistoryActivity; import android.content.DialogInterface; import android.location.Location; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; import butterknife.BindView; import butterknife.ButterKnife; import io.realm.Realm; import test.home.com.parkingapp.R; import test.home.com.parkingapp.activity.ParkingPlaceListActivity.ParkingPlaceListPresenter; import test.home.com.parkingapp.adapter.ParkingHistoryAdapter; import test.home.com.parkingapp.model.ParkingInfo; import test.home.com.parkingapp.model.ParkingPlace; public class ParkingHistoryActivity extends AppCompatActivity implements ParkingHistoryActivityMVP.View, ParkingHistoryAdapter.AdapterItemClickListener { @BindView(R.id.recycler_view) RecyclerView recyclerView; private ParkingHistoryAdapter adapter; private List<ParkingInfo> resultList; ParkingHistoryPresenter presenter; private Realm mRealm; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_with_recycler_view); ButterKnife.bind(this); mRealm = Realm.getDefaultInstance(); resultList = new ArrayList<>(); adapter = new ParkingHistoryAdapter(resultList, this, this); recyclerView.setAdapter(adapter); recyclerView.setItemAnimator(new DefaultItemAnimator()); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(this)); } @Override protected void onStart() { super.onStart(); presenter = new ParkingHistoryPresenter(() -> mRealm.where(ParkingInfo.class).findAll()); presenter.setView(this); presenter.loadData(); } @Override public void updateData(ParkingInfo infoModel) { resultList.add(infoModel); adapter.notifyDataSetChanged(); } @Override public void deleteParkingInfo(ParkingInfo parkingInfo) { adapter.removeItem(parkingInfo); } @Override public void showEmptyMessage() { Toast.makeText(this,"Parking history is empty", Toast.LENGTH_LONG).show(); } @Override public void onClick(ParkingInfo place) { new AlertDialog.Builder(this) .setTitle("Delete") .setMessage("Delete from history") .setNegativeButton("No",null) .setPositiveButton("Yes", (dialogInterface, i) -> presenter.delete(place, mRealm)).create().show(); } }
[ "mkylychev@gmail.com" ]
mkylychev@gmail.com
c096843f7f59e4224048c21bf3d56c51095c0d78
9107c550a00047570b700853420f3cb8f3d5893c
/javaweb小项目合集/src/cn/swun/HiServlet.java
f60b3c5356ac13a38bd55eec034a9fea2ad0be82
[]
no_license
SamuelHXD/Web_Project
6aee8cad9bd2090af097e9ca968dc4df768f1df3
454a6877434c37292ad7fc28e9b819caea2a51b0
refs/heads/master
2022-12-21T13:36:10.144358
2020-01-03T09:46:56
2020-01-03T09:46:56
225,574,246
0
0
null
2022-12-15T23:45:34
2019-12-03T08:58:06
Java
UTF-8
Java
false
false
1,015
java
package cn.swun; import java.io.IOException; import javax.servlet.ServletConfig; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HiServlet extends HttpServlet { //1.默认首次访问时实例化 //2.修改配置后在启动tomcat时实例化 public HiServlet() { System.out.println("实例化HiServlet"); } //在实例化Servlet后由tomcat自动调用 @Override public void init(ServletConfig config) throws ServletException { super.init(config); System.out.println("初始化HiServlet"); } //每次访问都可以调用 @Override protected void service( HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { System.out.println("调用HiServlet"); } //正常关闭tomcat时调用销毁 @Override public void destroy() { super.destroy(); System.out.println("销毁HiServlet"); } }
[ "xiangdonghuang66@163.com" ]
xiangdonghuang66@163.com
cc47299b4c2af939b7533273d5f02ab9e5baa7cb
110c70acc796767eaabb3fa77702cd1942d3a29a
/qdge/gui/undo/TransformationHistoryItem.java
3a019f4d7030c07fc1b40cc239e15851e74965ca
[]
no_license
nvcleemp/qdge
d4c571c246d397abd45c947dc2b958a9d7d4fd3d
15c6a55458df9f24ede9a3b120339cc6dc8883bc
refs/heads/master
2021-04-03T07:47:50.196644
2020-09-10T09:24:57
2020-09-10T09:24:57
124,684,113
1
0
null
null
null
null
UTF-8
Java
false
false
1,485
java
/* * Copyright (C) 2018 Nico Van Cleemput * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package qdge.gui.undo; import qdge.data.Graph; import qdge.transformations.GraphTransformation; /** * * @author nvcleemp */ public class TransformationHistoryItem extends AbstractHistoryItem { private final Graph graph; private final GraphTransformation action; private final GraphTransformation inverseAction; public TransformationHistoryItem(Graph graph, String description, GraphTransformation action, GraphTransformation inverseAction) { super(description); this.graph = graph; this.action = action; this.inverseAction = inverseAction; } @Override public void undo() { inverseAction.transformGraph(graph); } @Override public void redo() { action.transformGraph(graph); } }
[ "nico.vancleemput@gmail.com" ]
nico.vancleemput@gmail.com
e434932b32609f7b664c1c79580aae63bcb25d6a
e020359159de43de7428f17aaabd5dc43db12a15
/src/uk/co/droidinactu/exerciseplanner/planviewer/RaceDatePickerDialog.java
1371c675e92139fbafd5a03cb049f7faa8357aad
[]
no_license
mrspaceman/exerciseplanner
ea0038e8880b69d048d36cdb3dcd203905720435
bbf700a4f4020ba1597329c174c90886ef476330
refs/heads/master
2016-09-05T19:09:59.019190
2014-07-22T05:37:23
2014-07-22T05:37:23
10,455,760
1
0
null
null
null
null
UTF-8
Java
false
false
2,046
java
package uk.co.droidinactu.exerciseplanner.planviewer; import java.util.Calendar; import android.app.DialogFragment; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.Button; import android.widget.DatePicker; public class RaceDatePickerDialog extends DialogFragment implements OnClickListener { static RaceDatePickerDialog newInstance() { final RaceDatePickerDialog f = new RaceDatePickerDialog(); return f; } PlanViewerActivity actvty = null; DatePicker datePkr; @Override public void onClick(final View v) { if (actvty == null) { actvty = (PlanViewerActivity) getActivity(); } if (v.getId() == R.id.race_date_picker_btn_done) { actvty.updateRaceDate(datePkr.getYear(), datePkr.getMonth() + 1, datePkr.getDayOfMonth()); } else if (v.getId() == R.id.race_date_picker_btn_no_race) { actvty.updateRaceDateNone(); } dismiss(); } @Override public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); final int style = DialogFragment.STYLE_NORMAL; final int theme = android.R.style.Theme_Holo; setStyle(style, theme); } @Override public View onCreateView(final LayoutInflater inflater, final ViewGroup container, final Bundle savedInstanceState) { final View v = inflater.inflate(R.layout.race_date_picker_dialog, container, false); datePkr = (DatePicker) v.findViewById(R.id.race_date_picker_date); datePkr.getCalendarView().setFirstDayOfWeek(Calendar.getInstance().getFirstDayOfWeek()); // datePkr.getCalendarView().setFirstDayOfWeek(Calendar.MONDAY); final Button btnDone = (Button) v.findViewById(R.id.race_date_picker_btn_done); btnDone.setOnClickListener(this); final Button btnNoRace = (Button) v.findViewById(R.id.race_date_picker_btn_no_race); btnNoRace.setOnClickListener(this); return v; } public void setActivity(final PlanViewerActivity planViewerActivity) { actvty = planViewerActivity; } }
[ "andyaspellclark@gmail.com" ]
andyaspellclark@gmail.com
d3f42bb4ae03a1a00c4b8f57adfed0594bf3c31b
031b1c5b0c404f23ccd61a08845695bd4c3827f2
/project/Pat/learn/src/main/java/com/zixin/learn/nnuo/DJ1155.java
9de7384ce7774ba202f9f78ec31b9f0b77c157a4
[]
no_license
AndyFlower/zixin
c8d957fd8b1e6ca0e1ae63389bc8151ab93dbb55
647705e5f14fae96f82d334ba1eb8a534735bfd9
refs/heads/master
2022-12-23T21:10:44.872371
2021-02-10T07:15:21
2021-02-10T07:15:21
232,578,547
1
0
null
2022-12-16T15:41:14
2020-01-08T14:13:25
Java
UTF-8
Java
false
false
315
java
package com.zixin.learn.nnuo; public class DJ1155 { //求反序数 求1000到9999之间的反序数 public static void main(String[] args) { for(int i=1000;i<9999;i++) { int x= i*9; int y=0; while(x>0) { y=y*10+(x%10); x=x/10; } if(y==i) { System.out.println(i); } } } }
[ "3410766560@qq.com" ]
3410766560@qq.com
40ec40ccd4154aa86dc78438d650811363e24b7e
0d7ba4de219a6094948ccae188927ad91d6d1490
/src/day4_10_11/Exercise2.java
909b054f82c84810d0e207b792c325d1240711c7
[]
no_license
Al3xDum4/JavaFundamentals
6017acd10af47214c905e581ddf939b6cce67134
d649a54a63652ca4feb2267f3b4472364672facb
refs/heads/master
2020-09-15T21:43:09.508320
2019-12-15T07:04:21
2019-12-15T07:04:21
223,562,009
0
0
null
null
null
null
UTF-8
Java
false
false
355
java
package day4_10_11; import java.time.DayOfWeek; import java.time.LocalDate; public class Exercise2 { //Write a Java program to get day-in-week name for now date. public static void main(String[] args) { LocalDate astazi = LocalDate.now(); DayOfWeek dayOfWeek=astazi.getDayOfWeek(); System.out.println(dayOfWeek); } }
[ "alex.m.duma@gmail.com" ]
alex.m.duma@gmail.com
758e1b22b9f2203745f234cef96a643830837c02
ad7b7aa78ec53cf6e9e6f7e037f37a7015189de0
/app/src/main/java/com/example/nutritionassistant/feedback.java
014f2367b4b05fd4b60278eec71a58fc35282f27
[]
no_license
akshatbharara/Nutrition-Assistant
e2c6ba3621c7341eeb7c7641ae702ed8067863a9
7add1440fe780d4676137b5e1b3f2c6985f65418
refs/heads/master
2022-12-13T09:37:54.431516
2020-09-14T08:02:03
2020-09-14T08:02:03
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,115
java
package com.example.nutritionassistant; import android.app.ProgressDialog; import android.content.DialogInterface; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; public class feedback extends AppCompatActivity { DatabaseReference databaseReference; Button feedback; FirebaseAuth firebaseAuth; FirebaseUser firebaseUser; Intent intent; EditText mssg; EditText name; ProgressDialog dialog; /* access modifiers changed from: protected */ public void onCreate(Bundle savedInstanceState) { feedback.super.onCreate(savedInstanceState); setContentView(R.layout.activity_feedback2); this.name = (EditText) findViewById(R.id.feduser); this.mssg = (EditText) findViewById(R.id.fedmssg); this.firebaseAuth = FirebaseAuth.getInstance(); this.databaseReference = FirebaseDatabase.getInstance().getReference("Feedback"); this.feedback = (Button) findViewById(R.id.feedbackcall); FirebaseUser currentUser = this.firebaseAuth.getCurrentUser(); dialog=new ProgressDialog(com.example.nutritionassistant.feedback.this); this.feedback.setOnClickListener(new View.OnClickListener() { public void onClick(View view) { dialog.setMessage("Submitting Feedback please wait!!!"); dialog.show(); FirebaseDatabase.getInstance().getReference("Feedback") .child(FirebaseAuth.getInstance().getCurrentUser().getUid()) .setValue(new FeedbackChild(feedback.this.name.getText().toString(), feedback.this.mssg.getText().toString())) .addOnCompleteListener(new OnCompleteListener<Void>() { /* JADX WARNING: type inference failed for: r0v2, types: [com.example.nutritionassistant.feedback, android.content.Context] */ /* JADX WARNING: type inference failed for: r0v5, types: [com.example.nutritionassistant.feedback, android.content.Context] */ /* JADX WARNING: type inference failed for: r2v3, types: [com.example.nutritionassistant.feedback, android.content.Context] */ public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()) { dialog.dismiss(); Toast.makeText(feedback.this, "Feedback Submitted Successfully",Toast.LENGTH_LONG).show(); feedback.this.intent = new Intent(feedback.this, signedin.class); feedback.this.startActivity(feedback.this.intent); return; } else { alertmessage("Error sending feedback!!!"); } } }); } }); } public void alertmessage(String mssg) { AlertDialog.Builder builder=new AlertDialog.Builder(feedback.this); builder.setMessage(mssg).setPositiveButton("OK", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); } }).show(); } } class FeedbackChild { public String mssg; public String name; public FeedbackChild() { //default constructor } public FeedbackChild(String nm, String ms) { this.name = nm; this.mssg = ms; } }
[ "58360668+Black-Hawk22@users.noreply.github.com" ]
58360668+Black-Hawk22@users.noreply.github.com
f9cbe53285884418e13a7d7139c93626dbd9b688
c7f8221de49bfc2b6c28fcd34c833f96658e9a0b
/src/main/java/rustichromia/gui/GuiHandler.java
8ca9f76e6fdc24564c410ed83b70128896eb0925
[ "MIT" ]
permissive
DaedalusGame/Heterorustichromia
9276330ce3e35a787a0a489207e6512f51c29162
f32893b1a7fc7a4b0116e4dbbd5d165663299d02
refs/heads/master
2021-07-14T21:23:28.470907
2020-07-11T11:13:44
2020-07-11T11:13:44
185,208,292
1
2
MIT
2020-07-11T11:13:45
2019-05-06T14:01:49
Java
UTF-8
Java
false
false
1,724
java
package rustichromia.gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraftforge.fml.common.network.IGuiHandler; import rustichromia.tile.TileEntityAssembler; import rustichromia.tile.TileEntityRatiobox; public class GuiHandler implements IGuiHandler { public static final int ASSEMBLER_RECIPE = 0; public static final int RATIOBOX = 1; public static final int FILTER_ITEM = 2; @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case ASSEMBLER_RECIPE: TileEntityAssembler assembler = (TileEntityAssembler) world.getTileEntity(new BlockPos(x, y, z)); return new ContainerAssembler(player, assembler); case RATIOBOX: TileEntityRatiobox ratioBox = (TileEntityRatiobox) world.getTileEntity(new BlockPos(x, y, z)); return new ContainerRatioBox(player, ratioBox); default: return null; } } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { switch (ID) { case ASSEMBLER_RECIPE: TileEntityAssembler assembler = (TileEntityAssembler) world.getTileEntity(new BlockPos(x, y, z)); return new GuiAssembler(player, assembler); case RATIOBOX: TileEntityRatiobox ratioBox = (TileEntityRatiobox) world.getTileEntity(new BlockPos(x, y, z)); return new GuiRatioBox(player, ratioBox); default: return null; } } }
[ "bordlistian@hotmail.de" ]
bordlistian@hotmail.de
7f9d8d13d0ef43fc2016716c8f4b1c06222a94f0
54c2ba8bcede572abae27886fe7a599215030924
/src/main/java/com/jd/open/api/sdk/request/wms/LogisticsPoGetRequest.java
aa8b74ae102ce536b932ed95d1c8de18f4e2ea18
[]
no_license
pingjiang/jd-open-api-sdk-src
4c8bcc1e139657c0b6512126e9408cc71873ee30
0d82d3a14fb7f931a4a1e25dc18fb2f1cfaadd81
refs/heads/master
2021-01-01T17:57:04.734329
2014-06-26T03:49:36
2014-06-26T03:49:36
21,227,086
17
15
null
null
null
null
UTF-8
Java
false
false
1,198
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) // Source File Name: LogisticsPoGetRequest.java package com.jd.open.api.sdk.request.wms; import com.jd.open.api.sdk.internal.util.JsonUtil; import com.jd.open.api.sdk.request.AbstractRequest; import com.jd.open.api.sdk.request.JdRequest; import java.io.IOException; import java.util.Map; import java.util.TreeMap; public class LogisticsPoGetRequest extends AbstractRequest implements JdRequest { public LogisticsPoGetRequest() { } public void setInboundNo(String inboundNo) { this.inboundNo = inboundNo; } public String getInboundNo() { return inboundNo; } public String getApiMethod() { return "jingdong.logistics.po.get"; } public String getAppJsonParams() throws IOException { Map pmap = new TreeMap(); pmap.put("inbound_no", inboundNo); return JsonUtil.toJson(pmap); } public Class getResponseClass() { return com.jd.open.api.sdk.response.wms.LogisticsPoGetResponse.class; } private String inboundNo; }
[ "pingjiang1989@gmail.com" ]
pingjiang1989@gmail.com
456d07caf0ed28009c225166ccabdfbe57109982
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13141-42-10-NSGA_II-WeightedSum:TestLen:CallDiversity/com/xpn/xwiki/plugin/webdav/XWikiDavFilter_ESTest_scaffolding.java
07202be1c7907911cfcfae2171bc5cbce5264ee6
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
446
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sun Jan 19 03:15:54 UTC 2020 */ package com.xpn.xwiki.plugin.webdav; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; @EvoSuiteClassExclude public class XWikiDavFilter_ESTest_scaffolding { // Empty scaffolding for empty test suite }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
062665f76b184f68e254f5bb936bb3621d9455ee
097689cb15f57ed753422489c1129404769b863a
/SSM/chapter06/Spring/src/main/java/com/beerus/test/Greeting2.java
bc8d21d26194d281642d328869f4edebf204600f
[]
no_license
Beeru4/project
f247ae4a6669ba8b93965c0fa50d2cfe285e1918
cf12bce4d6d5750f8ff2f748182249724e287a76
refs/heads/master
2020-05-15T13:33:40.217444
2019-05-17T07:50:21
2019-05-17T07:50:21
182,304,194
0
0
null
null
null
null
UTF-8
Java
false
false
657
java
package com.beerus.test; /** * @Author Beerus * @Description 说话规范类(使用p标签注入, p命名空间依赖setter方法) * @Date 2019/4/23 **/ public class Greeting2 { private String context;//说话的内容 private String userName;//用户名 public Greeting2() { } //提供setter方法注入 public void setContext(String context) { this.context = context; } public void setUserName(String userName) { this.userName = userName; } /** * 说话方法 */ public void speak() { System.out.println(this.userName + "说:" + "\"" + this.context + "\""); } }
[ "beeru4@163.com" ]
beeru4@163.com
67d1595e11f8034fc388b04230d349b1594207e1
423dc171fc540669d2379491a6dad1aa7c6cfc74
/excercises/implementation/Recursion.java
089294f27a1e275a8358b617449c9b7554f9d9e3
[]
no_license
chilja/Practice
fc098196906e251a4c43cc487c4109795e1ae997
183017cd11bbf5bc9f53abc8c5af30bbcb9277d4
refs/heads/master
2020-06-01T06:32:22.456754
2015-04-27T13:25:53
2015-04-27T13:25:53
34,312,385
0
0
null
null
null
null
UTF-8
Java
false
false
10,684
java
/** * */ package excercises.implementation; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; /** * @author chiljagossow * */ public class Recursion { /** * @param args */ public static void main(String[] args) { Recursion r = new Recursion(); int[][] screen = {{1,1,2,2,2},{2,2,3,1,1},{1,3,3,3,3},{2,2,3,2,3},{1,1,1,2,2}}; print(screen); r.color(screen, 2, 2, 0); print(screen); } // 9.7 public void color(int[][] screen, int i, int j, int newColor) { if(screen == null || i < 0 || j < 0 || i >= screen.length || j >= screen[0].length) return; int original = screen[i][j]; screen[i][j] = newColor; if (((i-1) > 0) && (screen[i-1][j] == original)) { color(screen, i-1, j, newColor); } if (((i+1) < screen.length) && (screen[i+1][j] == original)){ color(screen, i+1, j, newColor); } if (((j-1) > 0) && (screen[i][j-1] == original)){ color(screen, i, j-1, newColor); } if (((j+1) < screen[0].length) && (screen[i][j+1] == original)) { color(screen, i, j+1, newColor); } } static boolean findCircle(Node head) { Node slow = head; Node fast = head.next; while (slow != null && fast != null && fast.next != null) { if (slow.equals(fast)) return true; slow = slow.next; fast = fast.next.next; } return false; } static class Node { Node next; private int data; Node ( int data ) { this.data = data; } void append( int data ) { if (next == null) { next = new Node(data); } else { next.append(data); } } void append( Node n) { if (next == null) { next = n; } else { next.append(n); } } public boolean equals(Object o) { if (o instanceof Node) { return ((Node) o).data == this.data; } return false; } } static boolean isPalindrome( Node head ) { Node tail = head; Node previous = null; while (tail.next != null) { previous = tail; tail = tail.next; } if ( head.data == tail.data) { if (previous == null) return true; // chop off head and tail head = head.next; previous.next = null; return isPalindrome(head); } return false; } static int countZeroes(int n) { long result = factorial(n); int zeroCounter = 0; while ( (result % 10) == 0) { result = result / 10; zeroCounter++; } return zeroCounter; } static int factorial(int n) { if ( n == 1) return 1; return (n * ( factorial(n -1))); } static boolean evaluate( boolean x1, boolean x2, boolean x3) { return ( (x1 & x2 & x3) | ( (!x1) & (!x2) & (!x3))); } static boolean evaluateBoard( boolean[][] board ) { for ( int i = 0; i < 3; i++) { if (evaluate( board[i][0], board[i][1], board[i][2])) return true; } for ( int i = 0; i < 3; i++) { if (evaluate( board[0][i], board[1][i], board[2][i])) return true; } if (evaluate( board[0][0], board[1][1], board[2][2])) return true; if (evaluate( board[0][2], board[1][1], board[2][0])) return true; return false; } static void print(boolean[][] chessBoard) { for ( int i = 0; i< 8; i++) { for ( int j = 0; j< 8; j++) { if ( chessBoard[i][j] == false) { System.out.print(0); } else { System.out.print(1); } } System.out.println(); } } static void print(int[][] screen) { for ( int i = 0; i< screen.length; i++) { for ( int j = 0; j< screen[0].length; j++) { System.out.print(screen[i][j]); } System.out.println(); } System.out.println(); } static boolean[][] placeQueen(boolean[][] chessBoard, int i, int j) { for ( int x = 0; x < chessBoard.length; x++) { chessBoard[i][x] = true; chessBoard[x][j] = true; } for ( int x = 0, y = j-i; x < chessBoard.length; x++, y++) { if (y >= 0 && y < chessBoard.length) { chessBoard[x][y] = true; } } for ( int x = 0, y = j-i; x < chessBoard.length; x++, y--) { if (y >= 0 && y < chessBoard.length) { chessBoard[x][y] = true; } } return chessBoard; } static void colorMatrix(int[][] matrix, int color, int x, int y) { Screen screen = new Screen(matrix); screen.print(); screen.colorComponent( screen.getPixel(x, y), color); screen.print(); } static class Screen { int[][] pixels; Screen(int[][] pixels) { this.pixels = pixels; } void print() { for (int i = 0; i < pixels.length; i++) { for (int j = 0; j < pixels[0].length; j++) { System.out.print(pixels[i][j] + " "); } System.out.println(); } } Pixel getPixel(int x, int y) { return new Pixel( x, y, pixels[x][y] ); } Pixel getTop(Pixel pixel) { // out of bound if (pixel.x - 1< 0) return null; return getPixel( pixel.x - 1, pixel.y); } Pixel getBottom(Pixel pixel) { // out of bound if (pixel.x + 1 >= pixels.length) return null; return getPixel( pixel.x + 1, pixel.y); } Pixel getRight(Pixel pixel) { // out of bound if (pixel.y + 1 >= pixels[0].length) return null; return getPixel( pixel.x , pixel.y + 1); } Pixel getLeft(Pixel pixel) { // out of bound if (pixel.y - 1 < 0 ) return null; return getPixel( pixel.x , pixel.y - 1); } ArrayList<Pixel> getAdjacentPixels(Pixel pixel) { ArrayList<Pixel> adjacentPixels = new ArrayList<Pixel>(); Pixel p = getLeft(pixel); if (p != null) adjacentPixels.add(p); p = getRight(pixel); if (p != null) adjacentPixels.add(p); p = getTop(pixel); if (p != null) adjacentPixels.add(p); p = getBottom(pixel); if (p != null) adjacentPixels.add(p); return adjacentPixels; } ArrayList<Pixel> getSameColorComponent(Pixel pixel) { int color = pixel.color; LinkedList<Pixel> pixels = new LinkedList<Pixel>(); ArrayList<Pixel> component = new ArrayList<Pixel>(); pixels.push(pixel); component.add(pixel); pixel.visit(); while (!pixels.isEmpty()) { Pixel current = pixels.pop(); ArrayList<Pixel> adjacentPixels = getAdjacentPixels(current); for (Pixel adjacentPixel: adjacentPixels) { if ( adjacentPixel != null && !adjacentPixel.isVisited() && adjacentPixel.color == color) { adjacentPixel.visit(); component.add(adjacentPixel); pixels.push(adjacentPixel); } } } return component; } void colorComponent( Pixel pixel, int color) { ArrayList<Pixel> component = getSameColorComponent(pixel); for (Pixel p: component) { colorPixel(p, color); } } void colorPixel(Pixel pixel, int color) { pixels[pixel.x][pixel.y] = color; } } static class Pixel { private int x; private int y; private int color; private boolean visited; private Pixel(int x, int y, int color) { this.x = x; this.y = y; setColor(color); } int getColor() { return color; } void setColor(int color) { this.color = color; } void visit() { visited = true; } boolean isVisited() { return visited; } } static ArrayList<String> getParentheses(int n) { ArrayList<String> permuts = new ArrayList<String>(); // empty if (n < 1) return permuts; // base case String s = "()"; if (n == 1) { permuts.add(s); return permuts; } // n > 1: recursive approach permuts = getParentheses( n -1 ); ArrayList<String> newPermuts = new ArrayList<String>(); for (String s2 : permuts) { String s3 = s + s2; newPermuts.add(s3); inner: for ( int i = 0; i < s2.length() - 1; i++) { char c = s2.charAt(i); if (c == '(' ) { s3 = s2.substring(0, i+1) + s + s2.substring(i + 1, s2.length()); newPermuts.add(s3); } else { break inner; } } } return newPermuts; } static ArrayList<String> getAllSubsets(char[] elements) { return getAllSubsets(elements, 0); } static ArrayList<String> getAllSubsets(char[] elements, int index) { ArrayList<String> subsets = new ArrayList<String>(); ArrayList<String> newSubsets = new ArrayList<String>(); if ( index < elements.length ) { subsets = getAllSubsets(elements, index + 1); for( String s: subsets) { String newString = s + elements[index]; newSubsets.add(newString); } subsets.add(String.valueOf(elements[index])); subsets.addAll(newSubsets); } return subsets; } static int getMagicIndex(int[] numbers) { // error if (numbers == null) { return -1; } //find magic number return getMagicIndex(numbers, 0, numbers.length -1); } static int getMagicIndex(int[] numbers, int lower, int upper) { // empty if (upper < lower) { return -1; } // if lower bound its too big a magic number cannot exist if (numbers[lower] > lower) return -1; int median = ((upper - lower) / 2) + lower; if ( numbers[median] == median ) { // found a magic index return median; } else if (numbers[median] > median) { // search on the left side return getMagicIndex(numbers, lower, median - 1); } else { // search on the right side return getMagicIndex(numbers, median + 1, upper); } } static int getNoOfPaths(int x, int y) { if (x < 0 || y < 0) return 0; if (x == 0 && y == 0) return 1; if (x == 1 && y == 0) return 1; if (x == 0 && y == 1) return 1; return getNoOfPaths( x-1, y) + getNoOfPaths(x, y -1); } static HashMap<Integer, Integer> cache = new HashMap<Integer, Integer>(); static Integer getNoOfWays(int n) { if ( n < 0) return 0; if (n == 0) return 1; // if (n== 2) return 2; // if (n== 3) return 4; Integer result = null; result = cache.get(n); if (result != null) return result; result = Integer.valueOf(0); // for ( int i = 1; i < n; i++) { result = getNoOfWays(n -1) + getNoOfWays(n -2) + getNoOfWays(n -3); // } cache.put(n, result); return result; } }
[ "chiljamaria@gmail.com" ]
chiljamaria@gmail.com
11aedbfcd5c3f33a216060ae5475ce920645f610
23359bc1568b408fdaf98bfdb3853f8b85377a52
/app/src/androidTest/java/com/example/dell/datapage/ExampleInstrumentedTest.java
1951ec493b52a118245f6336c8215aebda6aa5e2
[]
no_license
kentanvictor/DataPage
135e44b03ddd7a7b7d1d242030ad814bd55882d8
7e4b35ade52945711edd7c3113d235e68f0057c9
refs/heads/master
2021-01-15T23:50:30.350251
2017-08-17T03:27:12
2017-08-17T03:27:12
99,941,237
0
0
null
null
null
null
UTF-8
Java
false
false
754
java
package com.example.dell.datapage; import android.content.Context; import android.support.test.InstrumentationRegistry; import android.support.test.runner.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumentation test, which will execute on an Android device. * * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getTargetContext(); assertEquals("com.example.dell.datapage", appContext.getPackageName()); } }
[ "2030457926@qq.com" ]
2030457926@qq.com
2b3072698d1c3c12828871e9d20c5fec42a1e162
368a0a893d66da0571a75ebd9e64ee1b88c0e2ff
/twitter-crawler/src/main/java/pl/edu/agh/twitter/entities/ParoubekTweet.java
0908f3540afd100f6b9ac237aef9eb9722449575
[]
no_license
darekmydlarz/pracamgr
1d3cc29e73f5fceac92fc7e8eed3de1beb07bd43
0d32ac1f6a656b4fd497835c7cfc7b14c8174b8b
refs/heads/master
2022-11-08T13:54:51.654803
2018-03-25T21:10:27
2018-03-25T21:10:27
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,684
java
package pl.edu.agh.twitter.entities; import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import javax.persistence.*; /** * Mapped DB table */ @Entity @Table(schema = "mgr", name = "paroubek_tweets") public class ParoubekTweet { public static final double VALENCE_AVG = 0.4786984978198536; @Id private Long tweetId; @OneToOne @JoinColumn(name = "tweetId", referencedColumnName = "id", insertable = false, updatable = false) @NotFound(action = NotFoundAction.IGNORE) private Tweet tweet; private String text; private Double valence; public ParoubekTweet() { } public ParoubekTweet(Long tweetId, String text, Double valence) { this.tweetId = tweetId; this.text = text; this.valence = valence; } public Long getTweetId() { return tweetId; } public void setTweetId(Long tweetId) { this.tweetId = tweetId; } public String getText() { return text; } public void setText(String text) { this.text = text; } public Double getValence() { return valence; } public void setValence(Double valence) { this.valence = valence; } public Tweet getTweet() { return tweet; } public void setTweet(Tweet tweet) { this.tweet = tweet; } public boolean isPositive() { return valence > VALENCE_AVG; } @Override public String toString() { return "ParoubekTweet{" + "tweetId=" + tweetId + ", text='" + text + '\'' + ", valence=" + valence + '}'; } }
[ "dmydlarz@gmail.com" ]
dmydlarz@gmail.com
4b3b672154091ea52e5235da8f97af5acec78298
eb3a129479a5ea1bc722ffca10921c81b025f380
/cc-demo/src/main/java/cc/creativecomputing/demo/gl2/rendertotexture/CCShaderTextureTest.java
e17e72cadc17b10302700e4c54fc12678465a56c
[]
no_license
texone/creativecomputing
855fe4116322c17aff576020f7c1ba11c3dc30dd
c276d2060a878f115db29bb7d2e7419f5de33e0a
refs/heads/master
2022-01-25T09:36:11.280953
2022-01-11T19:51:48
2022-01-11T19:51:48
42,046,027
8
3
null
2019-11-02T15:04:26
2015-09-07T10:10:58
Java
UTF-8
Java
false
false
2,422
java
/* * Copyright (c) 2013 christianr. * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser Public License v3 * which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl-3.0.html * * Contributors: * christianr - initial API and implementation */ package cc.creativecomputing.demo.gl2.rendertotexture; import java.nio.FloatBuffer; import cc.creativecomputing.app.modules.CCAnimator; import cc.creativecomputing.graphics.CCGraphics; import cc.creativecomputing.graphics.app.CCGL2Adapter; import cc.creativecomputing.graphics.app.CCGL2Application; import cc.creativecomputing.graphics.shader.CCShaderBuffer; import cc.creativecomputing.math.CCMath; public class CCShaderTextureTest extends CCGL2Adapter { private CCShaderBuffer _myShaderTexture; public void init(CCGraphics g, CCAnimator theAnimator) { _myShaderTexture = new CCShaderBuffer(400, 400); g.pointSize(2); g.smooth(); // g.debug(); } public void display(CCGraphics g) { g.clearColor(0); g.clear(); _myShaderTexture.beginDraw(g); g.clearColor(255,0,0); g.clear(); g.color(255); CCMath.randomSeed(0); for(int i = 0; i < 200;i++) { g.color(CCMath.random(),CCMath.random(),CCMath.random()); g.ellipse(CCMath.random(400),CCMath.random(400),0,20,20); } g.rect(-200,-200, 50,50); _myShaderTexture.endDraw(g); FloatBuffer outputData0 = _myShaderTexture.getData(0); System.err.printf("toutput0\toutput1\toutput2\toutput3\n"); for (int i = 0; i < _myShaderTexture.width() * _myShaderTexture.height() * 3; i++) System.err.printf("t%.2f\t%.2f\t%.2f\n", outputData0.get(), outputData0.get(), outputData0.get()); g.color(255); g.image(_myShaderTexture.attachment(0), 0,0,200,200); // g.texture(_myRenderBuffer); // g.beginShape(CCDrawMode.QUADS); // g.vertex(-200, -200, 0, 0f); // g.vertex( 200, -200, 1, 0f); // g.vertex( 200, 200, 1, 1); // g.vertex(-200, 200, 0, 1); // g.endShape(); // g.noTexture(); } public static void main(String[] args) { CCShaderTextureTest demo = new CCShaderTextureTest(); CCGL2Application myAppManager = new CCGL2Application(demo); myAppManager.glcontext().size(1900, 1000); myAppManager.animator().framerate = 30; myAppManager.animator().animationMode = CCAnimator.CCAnimationMode.FRAMERATE_PRECISE; myAppManager.start(); } }
[ "info@texone.org" ]
info@texone.org
49604a51b247eaf6a200ca4f1425f27b1eea2864
731b4889743b0c32629c92e97f9aefef56bfd007
/project/src/main/java/kauhsa/compression/lzw/benchmarks/DataType.java
11f6fd18c8cd3a32d87a9b7aedc7e18b780a7da7
[]
no_license
Kauhsa/tiralabra-compression
ad13c96c347bbd3bb90693fed9857ed0411448b4
a6ec0b13167530d0c3357898722395d3da6e579c
refs/heads/master
2016-09-05T13:26:02.453147
2013-03-03T11:53:10
2013-03-03T11:53:10
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,341
java
package kauhsa.compression.lzw.benchmarks; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.util.Random; /** * Different types of binary data. Used for benchmarks, particularly because of * Caliper framework. */ public enum DataType { RANDOM { @Override byte[] getData(int bytes) { Random random = new Random(); byte[] data = new byte[bytes]; random.nextBytes(data); return data; } }, FINNISH_TEXT { @Override byte[] getData(int bytes) throws IOException { InputStream res = DataType.class.getResourceAsStream("/seitseman_veljesta.txt"); ByteArrayOutputStream out = new ByteArrayOutputStream(); while (out.size() < bytes) { int b = res.read(); if (b == -1) { throw new RuntimeException("Not enough data in file"); } out.write(b); } return out.toByteArray(); } }; /** * Get byte array of data appropriate for this enum. * * @param bytes how many bytes of data is wanted. * @return byte array of data * @throws IOException */ abstract byte[] getData(int bytes) throws IOException; }
[ "kauhsa@viuhka.fi" ]
kauhsa@viuhka.fi
2fa10a550fe453f55f10048bacc9d2290f79ad7d
26b7f30c6640b8017a06786e4a2414ad8a4d71dd
/src/number_of_direct_superinterfaces/i25878.java
9d533dcf4f4e7800395f655aeb3a21e1bef29ecf
[]
no_license
vincentclee/jvm-limits
b72a2f2dcc18caa458f1e77924221d585f23316b
2fd1c26d1f7984ea8163bc103ad14b6d72282281
refs/heads/master
2020-05-18T11:18:41.711400
2014-09-14T04:25:18
2014-09-14T04:25:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
69
java
package number_of_direct_superinterfaces; public interface i25878 {}
[ "vincentlee.dolbydigital@yahoo.com" ]
vincentlee.dolbydigital@yahoo.com
abaf1df244931e92a1af13d69974309804027caf
a9ef5e8940c0a63a4388595e8b0c09989b67fad8
/src/com/wangjt/calendar/service/CalendarEventReminderService.java
0c930e712fcffa9afc2accd86e39190e35b100c6
[]
no_license
wangjiangtao1986/calendar
1304072305112d11412757c2fb9dbe8aca701e6b
e6133b8cde0bfc28ab07be8e93d3c486f9f56eb5
refs/heads/master
2020-05-20T01:17:21.913770
2019-05-07T02:46:05
2019-05-07T02:46:05
185,307,510
0
0
null
null
null
null
UTF-8
Java
false
false
2,975
java
package com.wangjt.calendar.service; import java.util.List; import java.util.UUID; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.wangjt.calendar.mysql.dao.mapper.CalendarEventReminderMapper; import com.wangjt.calendar.mysql.dao.model.CalendarEvent; import com.wangjt.calendar.mysql.dao.model.CalendarEventReminder; import com.wangjt.calendar.mysql.dao.model.CalendarEventReminderExample; import com.wangjt.calendar.mysql.dao.model.CalendarEventReminderExample.Criteria; import com.wangjt.calendar.util.Constants; import com.wangjt.calendar.util.StringUtile; import com.wangjt.util.JsonHelper; @Transactional @Service public class CalendarEventReminderService { @Autowired private CalendarEventReminderMapper calendarEventReminderMapper; public void deleteCalendarEventReminder(String eventId) { if(eventId != null) { CalendarEventReminderExample example = new CalendarEventReminderExample(); Criteria criteria = example.createCriteria(); criteria.andEventIdEqualTo(eventId); calendarEventReminderMapper.deleteByExample(example); } } public String[] createEditCalendarEventReminder(CalendarEventReminder calendarEventReminder){ int i = calendarEventReminderMapper.insert(calendarEventReminder); String[] returnStr = new String[2]; if(i > 0){ returnStr[0] = Constants.SUCCESS; }else{ returnStr[0] = Constants.FALSE; } return returnStr; } /** * 加载简单事件 * @param calendarEvent * @return */ public String createEditCalendarEventReminder(CalendarEvent calendarEvent){ try { deleteCalendarEventReminder(calendarEvent.getId()); String alertFlag = calendarEvent.getAlertFlag(); if(!StringUtile.isNull(alertFlag) && alertFlag.startsWith("[")){ List<Object> jsonList = JsonHelper.Json2List(alertFlag,CalendarEventReminder.class); for(int j = 0; j < jsonList.size(); j ++){ CalendarEventReminder calendarEventReminder = (CalendarEventReminder) jsonList.get(j); calendarEventReminder.setEventId(calendarEvent.getId()); calendarEventReminder.setId(UUID.randomUUID().toString()); calendarEventReminder.setAlerted("false"); createEditCalendarEventReminder(calendarEventReminder); } } return Constants.SUCCESS; } catch(Exception e) { e.printStackTrace(); return Constants.FAILE; } } public List<CalendarEventReminder> loadCalendarEventReminder(String eventId){ if(!StringUtile.isNull(eventId)){ CalendarEventReminderExample example = new CalendarEventReminderExample(); Criteria criteria = example.createCriteria(); criteria.andEventIdEqualTo(eventId); return calendarEventReminderMapper.selectByExample(example); } else { return null; } } public void updateByPrimaryKey(CalendarEventReminder c){ calendarEventReminderMapper.updateByPrimaryKey(c); } }
[ "375410692@163.com" ]
375410692@163.com
0d15831d309765dee71050f9e24465b000f72716
8bdda30bbcea1990fb56c2a083ca2a5693ca9b13
/sources/com/google/android/gms/fitness/request/SessionRegistrationRequest.java
b53c8c6233adcc2e6cb39819b53d53377125e9ba
[]
no_license
yusato0378/aa
b14e247470efaf28efcc847433eff4aeb7790be6
ffc764c33c6f423d8dd6b1837446583d96a67e05
refs/heads/master
2021-01-10T01:10:49.084058
2016-01-09T12:02:01
2016-01-09T12:02:01
49,321,731
1
0
null
null
null
null
UTF-8
Java
false
false
2,503
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) package com.google.android.gms.fitness.request; import android.app.PendingIntent; import android.os.IBinder; import android.os.Parcel; import com.google.android.gms.common.internal.safeparcel.SafeParcelable; import com.google.android.gms.common.internal.zzu; import com.google.android.gms.internal.zzjm; // Referenced classes of package com.google.android.gms.fitness.request: // zzw public class SessionRegistrationRequest implements SafeParcelable { SessionRegistrationRequest(int i, PendingIntent pendingintent, IBinder ibinder, String s) { zzzH = i; mPendingIntent = pendingintent; if(ibinder == null) pendingintent = null; else pendingintent = com.google.android.gms.internal.zzjm.zza.zzaS(ibinder); zzaeH = pendingintent; zzJd = s; } public SessionRegistrationRequest(PendingIntent pendingintent, zzjm zzjm1, String s) { zzzH = 4; mPendingIntent = pendingintent; zzaeH = zzjm1; zzJd = s; } private boolean zzb(SessionRegistrationRequest sessionregistrationrequest) { return zzu.equal(mPendingIntent, sessionregistrationrequest.mPendingIntent); } public int describeContents() { return 0; } public boolean equals(Object obj) { return this == obj || (obj instanceof SessionRegistrationRequest) && zzb((SessionRegistrationRequest)obj); } public String getPackageName() { return zzJd; } int getVersionCode() { return zzzH; } public int hashCode() { return zzu.hashCode(new Object[] { mPendingIntent }); } public String toString() { return zzu.zzq(this).zzg("pendingIntent", mPendingIntent).toString(); } public void writeToParcel(Parcel parcel, int i) { zzw.zza(this, parcel, i); } public IBinder zzpf() { if(zzaeH == null) return null; else return zzaeH.asBinder(); } public PendingIntent zzpr() { return mPendingIntent; } public static final android.os.Parcelable.Creator CREATOR = new zzw(); private final PendingIntent mPendingIntent; private final String zzJd; private final zzjm zzaeH; private final int zzzH; }
[ "yu0378@gmail.com" ]
yu0378@gmail.com
f0acbe39e3adc413a7767cce1f96e7837ba1bb81
61ddbbe5dfbef43a88de8ea35f7a66a1cb880900
/src/main/java/com/xzm/springbootsecurity/controller/TestController.java
65a42b7455d578b4fd9f7f8eede697a8d173ad60
[]
no_license
icc0301/spring-boot-security
924e5cf5f677a569246619e0e6e48cf90bbd5ed2
b132fa2e98c4dd99ce46050c7b6fbdc6089b5159
refs/heads/master
2023-01-19T12:05:45.655829
2020-11-25T09:37:48
2020-11-25T09:37:48
315,587,645
1
0
null
null
null
null
UTF-8
Java
false
false
670
java
package com.xzm.springbootsecurity.controller; import com.xzm.springbootsecurity.service.UserService; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class TestController { private final UserService userService; public TestController(UserService userService) { this.userService = userService; } @GetMapping("/") public String index(){ System.out.println(userService.getOne("admin")); return "欢迎来到小猪迷Security"; } @GetMapping("/admin") public String admin(){ return "我是admin"; } }
[ "Lcc99010" ]
Lcc99010
d8f4d114dbd72ee14b108fa55b82a66da8c3dd45
7646f266107ef8d49e54c2ee7646933239bd5613
/Logging/src/main/LoggingAspectServices/LoggingAspect.java
1984f8861186554af3452200c30f96f26d1e5d55
[]
no_license
dilleshkondala/172224_Dillesh
a06d2c31e32ec05b7a1cf9e60b076959c29f61b7
c8b4ad10bf57a70546dfeb94e64c7956db657efe
refs/heads/master
2020-04-21T07:16:19.095393
2019-03-14T12:56:23
2019-03-14T12:56:23
169,388,521
0
0
null
null
null
null
UTF-8
Java
false
false
567
java
package com.org.springlog.LoggingAspectServices; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.annotation.Before; public class LoggingAspect { @Before=("") public void loggingAdvice(JoinPoint jointPoint ) { } @Around("@annotation(package com.org.springlog.myLoggable.Loggable)") public Object myLogging(ProceedinJoinPoint p) { Object returnValue=null; try{ returnValue = p.cfcxc(); } catch(Exception ex) { System.out.println("Exception raised due to: "+ex); } return returnValue; } }
[ "dkondala@DIN80044028.corp.capgemini.com" ]
dkondala@DIN80044028.corp.capgemini.com
229cb9cbd0c7f49071c244e1f0e50a75a19f1080
472cc37513fec87325d4abb22a4bf2883df265d2
/src/AST/NonAbstract/Node/PrimTypeBrackEnc.java
3b59902e24daa30ccc661c39b90cd14dde1a324f
[]
no_license
karljohan12/P4
2cf56795f911645d6b83f7d87b827253f9abe94c
1e5efc2e6fd8d9f6cdba04dc8f582d4eb1289127
refs/heads/master
2022-08-25T01:52:00.783914
2020-04-10T17:34:03
2020-04-10T17:34:03
250,519,282
0
0
null
null
null
null
UTF-8
Java
false
false
449
java
package AST.NonAbstract.Node; import AST.Abstract.*; import AST.Visitor.Visitor; public class PrimTypeBrackEnc extends AbstractArrayType { public AbstractPrimitiveType apt; public AbstractBracketEnclosure abe; public PrimTypeBrackEnc(AbstractPrimitiveType apt1, AbstractBracketEnclosure abe1, int ln){ super(ln); apt = apt1; abe = abe1; } public void accept(Visitor v) { v.visit(this); } }
[ "ebech18@student.aau.dk" ]
ebech18@student.aau.dk
5c26e67a217ea1886a5f2a4e8e9c372626572ebb
5432aee1665affbe200a6e8cfcb081fa66139bc9
/src/main/java/com/robertx22/mine_and_slash/items/gearitems/armor/leather/LeatherBootsItem.java
a1626f333aebda474d1cc6ee284a3eeaca071583
[]
no_license
saki-saki/Mine-and-Slash
9cc8587e5c082470847c7159223666cbc099c454
9fd77a6c661f821bf36e773cfbfb944b682020d7
refs/heads/1.14.4
2020-08-28T20:26:13.061684
2019-10-30T21:41:33
2019-10-30T21:41:33
217,811,792
0
1
null
2019-10-30T21:41:34
2019-10-27T05:57:39
Java
UTF-8
Java
false
false
809
java
package com.robertx22.mine_and_slash.items.gearitems.armor.leather; import com.robertx22.mine_and_slash.db_lists.Rarities; import com.robertx22.mine_and_slash.items.gearitems.bases.BaseDyableArmorItem; import com.robertx22.mine_and_slash.saveclasses.gearitem.gear_bases.Rarity; import net.minecraft.inventory.EquipmentSlotType; import net.minecraft.item.Item; import java.util.HashMap; public class LeatherBootsItem extends BaseDyableArmorItem { public static HashMap<Integer, Item> Items = new HashMap<Integer, Item>(); public LeatherBootsItem(int rarity) { super(Type.LEATHER, rarity, EquipmentSlotType.FEET); } @Override public String locNameForLangFile() { Rarity rar = Rarities.Items.get(rarity); return rar.textFormatColor() + "Leather Boots"; } }
[ "treborx555@gmail.com" ]
treborx555@gmail.com
4d701ad485c80533772348a687eb8b87ab3635dc
5b5cdb49f7d795a300a99844411228d3e32846d4
/ativiade 2/src/atividade2/pessoa.java
73518d4f78c681cd116b9dc0fc2e29f0c347e58c
[]
no_license
AllanL330/POObancoP
02419657acf3023fd434a71994f3a6f12edb7982
8cf01b93bf5d367bc034252cfe42c573b036ff77
refs/heads/main
2023-01-02T22:59:34.441620
2020-11-02T02:44:20
2020-11-02T02:44:20
303,511,765
0
0
null
null
null
null
UTF-8
Java
false
false
720
java
package atividade2; public class pessoa { protected String nome; protected String endereco ; protected String telefone; public pessoa(String p_nome, String p_endereco, String p_telefone){ nome = p_nome; endereco = p_endereco; telefone = p_telefone; } public pessoa() { this("","",""); } public String getNome() { return nome; } public void setNome(String nome) { this.nome = nome; } public String getEndereco() { return endereco; } public void setEndereco(String endereco) { this.endereco = endereco; } public String getTelefone() { return telefone; } public void setTelefone(String telefone) { this.telefone = telefone; } }
[ "Allan Lopes@DESKTOP-LQAPH2D" ]
Allan Lopes@DESKTOP-LQAPH2D
9be3c30524ec1bd7bb9967bf4fd5f8ef1cf233a5
133d77807f1f98fb2d329f92d0589b3e74ed03bd
/src/ru/mukhametzyanov/task3/Main.java
977ca0343ae577abaf3bda196202a9d68ced3d1b
[]
no_license
Rikitavi/homework-8
e85aee5e9b0d9ad3763722dcf01f34a95fb41ea6
641457a24e0c526e82b6e263d2dd6ef8f060a45e
refs/heads/master
2020-03-30T20:12:31.380636
2018-10-04T13:42:15
2018-10-04T13:42:15
151,578,089
0
0
null
null
null
null
UTF-8
Java
false
false
405
java
package ru.mukhametzyanov.task3; /**@author Ruslan Mukhametzyanov * Класс вызывает методы класса калькулятора{@link Calculator} */ public class Main { public static void main(String[] args) { System.out.println(Calculator.sum(5, 6)); System.out.println(Calculator.sum(5.5, 6.6)); System.out.println(Calculator.procent(5,100)); } }
[ "rikitavi777@yandex.ru" ]
rikitavi777@yandex.ru
044485a961497b76f59bd01eea8e87bfd5278ff8
fb552f93d4cb642b461979d813821161aa21cede
/src/main/java/com/skoneczny/SecurityConfiguration.java
c65330955d5918c7ec21f157b499c7bf511a6b24
[]
no_license
ksdragon/testGit
9f5e333df90fab45482f5d9a6d1e844a42c8a358
b48adc2b6be24c4317f596c58fd1a41fb29f5ade
refs/heads/master
2020-04-07T21:39:36.574783
2018-11-22T12:31:57
2018-11-22T12:31:57
158,736,106
0
0
null
null
null
null
UTF-8
Java
false
false
2,499
java
package com.skoneczny; import javax.sql.DataSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; import nz.net.ultraq.thymeleaf.LayoutDialect; @Configuration @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter{ @Autowired private DataSource dataSource; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource) .usersByUsernameQuery("select email as principal, password as credentails, true from user where email=?") .authoritiesByUsernameQuery("select user_email as principal, role_name as role from user_roles where user_email=?") .passwordEncoder(passwordEncoder()).rolePrefix("ROLE_"); } @Bean public PasswordEncoder passwordEncoder() { // TODO Auto-generated method stub return new BCryptPasswordEncoder(); } @Override protected void configure(HttpSecurity http) throws Exception{ // // http.authorizeRequests().antMatchers("/register", "/", "/about", "/login", "/css/**", "/webjars/**").permitAll() // .anyRequest().authenticated().and().formLogin().loginPage("/login").permitAll() // .defaultSuccessUrl("/profile").and().logout().logoutSuccessUrl("/login"); // http.authorizeRequests().antMatchers("/register", "/", "/about", "/login", "/css/**", "/webjars/**").permitAll() .antMatchers("/profile").hasAnyRole("USER,ADMIN") .antMatchers("/users","/addTask").hasRole("ADMIN") .and().formLogin().loginPage("/login").permitAll() .defaultSuccessUrl("/profile").and().logout().logoutSuccessUrl("/login"); // // http.authorizeRequests() // .anyRequest().permitAll(); } @Bean public LayoutDialect layoutDialect() { return new LayoutDialect(); } }
[ "ksdragon@poczta.pl" ]
ksdragon@poczta.pl
803f01f093edd1a0df4b57206a88e8dd58571a71
8a709489face302d886f3f4e6ad0a29bbd0ab8f7
/src/FlipCoin.java
f80b5b570619bbda3ab2e343f7a5c9a17ebf50a3
[]
no_license
gosavisomnath/BasicJavaProgram
a4e3848e115981067427a0a5641337d43ab85d0e
04fb626d4ef4e41d951682fb59b4074649a37df9
refs/heads/master
2023-06-23T15:34:07.719581
2021-07-14T05:41:25
2021-07-14T05:41:25
385,825,508
0
0
null
null
null
null
UTF-8
Java
false
false
225
java
public class FlipCoin { public static void main(String[] args) { if(Math.random()<0.5) System.out.println("Head"); else System.out.println("Tail"); } }
[ "somnathgosavi29.sg@gmail.com" ]
somnathgosavi29.sg@gmail.com
dac5158fb69f7bacb4c11710797eafdafa85791d
549d66f978f2dce52d7179a0304dc36e7859e165
/app/src/main/java/com/tdc/quanlythuoctay/model/MedicinesModel.java
31cddfc615468c9d1ef1b9327289afd17407a0d3
[]
no_license
NgoBaSi/QuanLyThuocTay
9ad2ba6828df332c7ba09fb14665b1027d363a65
12d232e6bdea2c1d8cae80ee077be480f6765945
refs/heads/master
2022-12-02T01:48:36.845167
2020-08-11T04:06:30
2020-08-11T04:06:30
285,748,926
0
1
null
null
null
null
UTF-8
Java
false
false
1,694
java
package com.tdc.quanlythuoctay.model; public class MedicinesModel { private int idthuoc; private String maThuoc; @Override public String toString() { return tenThuoc; } private String tenThuoc; private String donGia; private String donVi; private boolean chon; public MedicinesModel(int idthuoc, String maThuoc, String tenThuoc, String donGia, String donVi) { this.idthuoc = idthuoc; this.maThuoc = maThuoc; this.tenThuoc = tenThuoc; this.donGia = donGia; this.donVi = donVi; } public MedicinesModel(String maThuoc, String tenThuoc, String donGia, String donVi) { this.maThuoc = maThuoc; this.tenThuoc = tenThuoc; this.donGia = donGia; this.donVi = donVi; } public MedicinesModel() { } public int getIdthuoc() { return idthuoc; } public void setIdthuoc(int idthuoc) { this.idthuoc = idthuoc; } public String getMaThuoc() { return maThuoc; } public void setMaThuoc(String maThuoc) { this.maThuoc = maThuoc; } public String getTenThuoc() { return tenThuoc; } public void setTenThuoc(String tenThuoc) { this.tenThuoc = tenThuoc; } public String getDonGia() { return donGia ; } public void setDonGia(String donGia) { this.donGia = donGia; } public String getDonVi() { return donVi; } public void setDonVi(String donVi) { this.donVi = donVi; } public boolean isChon() { return chon; } public void setChon(boolean chon) { this.chon = chon; } }
[ "ngobasi0903@gmail.com" ]
ngobasi0903@gmail.com
cd199256a665b9050d7deaf75530d8acf8b11aea
07add6868779aab999797975422368c62dafe88e
/main/java/me/crafter/mc/healthbar/HealthBar.java
da4bada4f9a1fb622a59c0f7a2134a9ba13a2cba
[]
no_license
connection-lost/HealthBar
098135d4b8331d95496d2e30aee97a46e52a1d76
3cc6911930d94dbb9a0b9c77d9b501fd97701da9
refs/heads/master
2016-09-06T14:57:49.997368
2015-05-15T19:54:39
2015-05-15T19:54:39
35,497,499
8
2
null
null
null
null
UTF-8
Java
false
false
1,016
java
package me.crafter.mc.healthbar; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; @Mod(modid = HealthBar.MODID, version = HealthBar.VERSION, guiFactory = "me.crafter.mc.healthbar.ModGuiFactory") public class HealthBar { @Mod.Instance("healthbar") public static HealthBar instance; public static final String MODID = "healthbar"; public static final String VERSION = "1.7"; @Mod.EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new HealthBarMaker()); FMLCommonHandler.instance().bus().register(new HealthConfig()); } @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { HealthConfig.startConfig(event); } }
[ "frankwu1995@hotmail.com" ]
frankwu1995@hotmail.com
a011c2c2c51bf48cb30809a33abaca04a89d5805
4a55692a757cc5dcc6de7166638b0e5073e76c84
/app/src/main/java/com/korsolution/antif/VehicleColorDBClass.java
2e2b4556427e40c0b2cc703bebc812775eea9d8f
[]
no_license
Cutiesz/Antif
56843385dddcf6640316a2603ddd786683b4c8e0
f7ab2e0631a40c4cfe4eb645c77a83ac370c54a3
refs/heads/master
2021-08-31T12:17:02.617081
2017-12-21T08:18:27
2017-12-21T08:18:27
105,964,294
0
0
null
null
null
null
UTF-8
Java
false
false
6,441
java
package com.korsolution.antif; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteStatement; import android.util.Log; /** * Created by Kontin58 on 1/11/2559. */ public class VehicleColorDBClass extends SQLiteOpenHelper { // Database Version private static final int DATABASE_VERSION = 1; // Database Name private static final String DATABASE_NAME = "vehiclecolordb"; // Table Name private static final String TABLE_VEHICLE = "vehicle_color"; public VehicleColorDBClass(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); // TODO Auto-generated constructor stub } @Override public void onCreate(SQLiteDatabase sqLiteDatabase) { sqLiteDatabase.execSQL("CREATE TABLE " + TABLE_VEHICLE + "(ID INTEGER PRIMARY KEY AUTOINCREMENT," + " VEHICLE_COLOR_ID TEXT(100)," + " VEHICLE_COLOR_NAME TEXT(100)," + " VEHICLE_COLOR_CODE TEXT(100));"); Log.d("CREATE TABLE","Create Table Successfully."); } @Override public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { } // Insert Data public long Insert(String strVEHICLE_COLOR_ID, String strVEHICLE_COLOR_NAME, String strVEHICLE_COLOR_CODE) { // TODO Auto-generated method stub try { SQLiteDatabase db; db = this.getWritableDatabase(); // Write Data SQLiteStatement insertCmd; String strSQL = "INSERT INTO " + TABLE_VEHICLE + "(VEHICLE_COLOR_ID, VEHICLE_COLOR_NAME, VEHICLE_COLOR_CODE) VALUES (?, ?, ?)"; insertCmd = db.compileStatement(strSQL); insertCmd.bindString(1, strVEHICLE_COLOR_ID); insertCmd.bindString(2, strVEHICLE_COLOR_NAME); insertCmd.bindString(3, strVEHICLE_COLOR_CODE); return insertCmd.executeInsert(); } catch (Exception e) { return -1; } } // Select All Data Array 2 dimention public String[][] SelectAll() { // TODO Auto-generated method stub try { String arrData[][] = null; SQLiteDatabase db; db = this.getReadableDatabase(); // Read Data String strSQL = "SELECT * FROM " + TABLE_VEHICLE/* + " Where BlockId = '" + strBlockId + "'"*/; Cursor cursor = db.rawQuery(strSQL, null); if(cursor != null) { if (cursor.moveToFirst()) { arrData = new String[cursor.getCount()][cursor.getColumnCount()]; /*** * [x][0] = MemberID * [x][1] = Name * [x][2] = Tel */ int i= 0; do { arrData[i][0] = cursor.getString(0); arrData[i][1] = cursor.getString(1); arrData[i][2] = cursor.getString(2); arrData[i][3] = cursor.getString(3); i++; } while (cursor.moveToNext()); } } cursor.close(); return arrData; } catch (Exception e) { return null; } } public String[] SelectName() { // TODO Auto-generated method stub try { String arrData[] = null; SQLiteDatabase db; db = this.getReadableDatabase(); // Read Data String strSQL = "SELECT * FROM " + TABLE_VEHICLE/* + " Where BlockId = '" + strBlockId + "'"*/; Cursor cursor = db.rawQuery(strSQL, null); if(cursor != null) { if (cursor.moveToFirst()) { arrData = new String[cursor.getCount()]; /*** * [x][0] = MemberID * [x][1] = Name * [x][2] = Tel */ int i= 0; do { arrData[i] = cursor.getString(2); i++; } while (cursor.moveToNext()); } } cursor.close(); return arrData; } catch (Exception e) { return null; } } public String[][] SelectAllByName(String strVEHICLE_COLOR_NAME) { // TODO Auto-generated method stub try { String arrData[][] = null; SQLiteDatabase db; db = this.getReadableDatabase(); // Read Data String strSQL = "SELECT * FROM " + TABLE_VEHICLE + " Where strVEHICLE_COLOR_NAME = '" + strVEHICLE_COLOR_NAME + "'"; Cursor cursor = db.rawQuery(strSQL, null); if(cursor != null) { if (cursor.moveToFirst()) { arrData = new String[cursor.getCount()][cursor.getColumnCount()]; /*** * [x][0] = MemberID * [x][1] = Name * [x][2] = Tel */ int i= 0; do { arrData[i][0] = cursor.getString(0); arrData[i][1] = cursor.getString(1); arrData[i][2] = cursor.getString(2); arrData[i][3] = cursor.getString(3); i++; } while (cursor.moveToNext()); } } cursor.close(); return arrData; } catch (Exception e) { return null; } } // Delete Data public long Delete(/*String strMemberID*/) { // TODO Auto-generated method stub try { SQLiteDatabase db; db = this.getWritableDatabase(); // Write Data // for API 11 and above SQLiteStatement insertCmd; String strSQL = "DELETE FROM " + TABLE_VEHICLE/* + " WHERE MemberID = ? "*/; insertCmd = db.compileStatement(strSQL); /*insertCmd.bindString(1, strMemberID);*/ return insertCmd.executeUpdateDelete(); } catch (Exception e) { return -1; } } }
[ "sumeth.cute@gmail.com" ]
sumeth.cute@gmail.com
9a62e03f5b9961e11d7bfc17dae4524bc8ee351a
0b638670bce6d8dd9d39fad37e87a4b79914965f
/server/src/main/java/nl/svendubbeld/fontys/dao/jpa/ProfileRepositoryJPA.java
f90936fc736a921a4be9102231a942ce0aeb6e32
[]
no_license
SvenDub/kwetter
d3ae939fb5c8adb2e91f9a85186562282ce5643a
13b1d925f894ef0949eaedd403f767069e7e9736
refs/heads/develop
2021-03-22T03:30:13.607073
2018-05-22T09:54:51
2018-05-22T09:54:51
123,126,279
3
0
null
2018-05-15T06:47:49
2018-02-27T12:30:45
Java
UTF-8
Java
false
false
679
java
package nl.svendubbeld.fontys.dao.jpa; import nl.svendubbeld.fontys.dao.ProfileRepository; import nl.svendubbeld.fontys.model.Profile; import javax.persistence.TypedQuery; /** * A JPA repository for profiles. */ public class ProfileRepositoryJPA extends JPARepository<Profile, Long> implements ProfileRepository { protected ProfileRepositoryJPA() { super(Profile.class); } @Override public Profile findByUsername(String username) { TypedQuery<Profile> query = getEntityManager().createNamedQuery("profile.findByUsername", getEntityClass()); query.setParameter("username", username); return query.getSingleResult(); } }
[ "s.dubbeld@student.fontys.nl" ]
s.dubbeld@student.fontys.nl
b5e83088ab7b8f96c614d2a9e893f893df700cb3
e786a96ae42b1a3c16f955e7640fb219a678b471
/src/main/java/com/big/data/Service/UserService.java
0c6345b896672a2194111bee50e2280893487feb
[]
no_license
abderrahimtaleb/TechForum
1de5f36052125991001606a9ba28b7fb9c0cec30
4436bde4d86795f45e19fb1cced3126d8642b05f
refs/heads/master
2020-04-01T21:20:44.533849
2018-12-05T20:37:44
2018-12-05T20:37:44
153,650,553
0
0
null
null
null
null
UTF-8
Java
false
false
6,316
java
package com.big.data.Service; import com.big.data.Entity.User; import com.big.data.HbaseConfig.HbaseConnect; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.filter.CompareFilter; import org.apache.hadoop.hbase.filter.FilterList; import org.apache.hadoop.hbase.filter.SingleColumnValueFilter; import org.apache.hadoop.hbase.util.Bytes; import org.springframework.stereotype.Service; import java.io.IOException; import java.util.ArrayList; import java.util.List; import static org.apache.hadoop.hbase.util.Bytes.toBytes; @Service public class UserService { private Connection connection = HbaseConnect.getInstance(); private Table userTable; public Table getTable() { try { userTable = connection.getTable(TableName.valueOf("user")); } catch (IOException e) { e.printStackTrace(); } return userTable; } public List<User> findAll() { Scan scan = new Scan(); // Getting the scan result ResultScanner scanner; List<User> users = new ArrayList<>(); try { scanner = getTable().getScanner(scan); // Reading values from scan result for (Result result = scanner.next(); result != null; result = scanner.next()) { User user = new User(); user.setId(Bytes.toString(result.getRow())); user.setEmail(Bytes.toString(result.getValue(Bytes.toBytes("professional data"), Bytes.toBytes("email")))); user.setDateNaissance(Bytes.toString(result.getValue(Bytes.toBytes("personal data"), Bytes.toBytes("birthday")))); user.setNom(Bytes.toString(result.getValue(Bytes.toBytes("personal data"), Bytes.toBytes("nom")))); user.setPrenom(Bytes.toString(result.getValue(Bytes.toBytes("personal data"), Bytes.toBytes("prenom")))); user.setLogin(Bytes.toString(result.getValue(Bytes.toBytes("auth data"), Bytes.toBytes("login")))); user.setPassword(Bytes.toString(result.getValue(Bytes.toBytes("auth data"), Bytes.toBytes("password")))); user.setProfil(Bytes.toString(result.getValue(Bytes.toBytes("professional data"), Bytes.toBytes("profil")))); users.add(user); } //closing the scanner scanner.close(); } catch (IOException e) { e.printStackTrace(); } return users; } public User save(User user){ long id = findAll().size() + 1; user.setId(String.valueOf(id)); Put newUser = new Put(Bytes.toBytes(user.getId())); if (user.getNom() != null) newUser.addColumn(Bytes.toBytes("personal data"), Bytes.toBytes("nom"), Bytes.toBytes(user.getNom())); if (user.getPrenom() != null) newUser.addColumn(Bytes.toBytes("personal data"), Bytes.toBytes("prenom"), Bytes.toBytes(user.getPrenom())); if (user.getDateNaissance() != null) newUser.addColumn(Bytes.toBytes("personal data"), Bytes.toBytes("birthday"), Bytes.toBytes(user.getDateNaissance())); if (user.getEmail() != null) newUser.addColumn(Bytes.toBytes("professional data"), Bytes.toBytes("email"), Bytes.toBytes(user.getEmail())); if (user.getProfil() != null) newUser.addColumn(Bytes.toBytes("professional data"), Bytes.toBytes("profil"), Bytes.toBytes(user.getProfil())); if (user.getLogin() != null) newUser.addColumn(Bytes.toBytes("auth data"), Bytes.toBytes("login"), Bytes.toBytes(user.getLogin())); if (user.getPassword() != null) newUser.addColumn(Bytes.toBytes("auth data"), Bytes.toBytes("password"), Bytes.toBytes(user.getPassword())); try { getTable().put(newUser); } catch (IOException e) { e.printStackTrace(); } System.out.println("Inserted !"); return user; } //login public User findByLoginAndPwd(String login, String pwd) { Scan scan = new Scan(); FilterList list = new FilterList(FilterList.Operator.MUST_PASS_ALL); SingleColumnValueFilter filter1 = new SingleColumnValueFilter(Bytes.toBytes("auth data"), Bytes.toBytes("login"), CompareFilter.CompareOp.EQUAL, Bytes.toBytes(login)); list.addFilter(filter1); SingleColumnValueFilter filter2 = new SingleColumnValueFilter(Bytes.toBytes("auth data"), Bytes.toBytes("password"), CompareFilter.CompareOp.EQUAL, Bytes.toBytes(pwd)); list.addFilter(filter2); scan.setFilter(list); // Getting the scan result ResultScanner scanner; User user = null; try { user = new User(); scanner = getTable().getScanner(scan); // Reading values from scan result Result result = scanner.next(); if (result == null) return null; user.setId(Bytes.toString(result.getRow())); user.setEmail(Bytes.toString(result.getValue(Bytes.toBytes("professional data"), Bytes.toBytes("email")))); user.setDateNaissance(Bytes.toString(result.getValue(Bytes.toBytes("personal data"), Bytes.toBytes("birthday")))); user.setNom(Bytes.toString(result.getValue(Bytes.toBytes("personal data"), Bytes.toBytes("nom")))); user.setPrenom(Bytes.toString(result.getValue(Bytes.toBytes("personal data"), Bytes.toBytes("prenom")))); user.setLogin(Bytes.toString(result.getValue(Bytes.toBytes("auth data"), Bytes.toBytes("login")))); user.setPassword(Bytes.toString(result.getValue(Bytes.toBytes("auth data"), Bytes.toBytes("password")))); user.setProfil(Bytes.toString(result.getValue(Bytes.toBytes("professional data"), Bytes.toBytes("profil")))); //closing the scanner scanner.close(); } catch (IOException e) { e.printStackTrace(); } return user; } public void delete(String rowId) { Delete del = new Delete(toBytes(rowId)); try { getTable().delete(del); } catch (IOException e) { e.printStackTrace(); } System.out.println("Deleted !"); } }
[ "abderra.taleb@gmail.com" ]
abderra.taleb@gmail.com
8c43e18900eb6db4d0b0a4b9c675df35a3dcecbf
f3ee2e17787af4c79ff210cc3f762a6a082799b3
/app/src/androidTest/java/com/studyinghome/doublecircle/ExampleInstrumentedTest.java
4d4feca1e066623209daf93f122e7e8651c132dc
[ "Apache-2.0" ]
permissive
opensourcefamily/doublecircle
f8c6534b897166e52a56cb06d4e52e740480a25f
6594f059b351ee4c4b55bff201abcd91358483f1
refs/heads/master
2020-08-01T01:40:42.778710
2019-10-30T06:34:20
2019-10-30T06:34:20
210,816,463
0
0
null
null
null
null
UTF-8
Java
false
false
774
java
package com.studyinghome.doublecircle; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.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.getInstrumentation().getTargetContext(); assertEquals("com.studyinghome.doublecircle", appContext.getPackageName()); } }
[ "panxiang_work@163.com" ]
panxiang_work@163.com
8c3e8357f3926540bab9e176365b419750a94946
a8ff601aee81457c9b3ea56cb75bc2acfa07d635
/app/src/main/java/com/konusarakogren/twitterclone/activity/login/LoginActivity.java
5749e62eb5d5f1404a5fbd91b99971fce8a9b1ca
[]
no_license
dzeynept/twitter
427b229ebebbe4befd3c15d042e39853f6cbea8c
47e4d20cc0d1c53e18eec08af6315ecd4184a70d
refs/heads/master
2020-03-21T00:08:06.877958
2018-06-19T10:12:19
2018-06-19T10:12:19
137,879,093
0
0
null
null
null
null
UTF-8
Java
false
false
2,794
java
package com.konusarakogren.twitterclone.activity.login; import android.content.Context; import android.content.Intent; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; import com.konusarakogren.twitterclone.Util.OneShotClickListener; import com.konusarakogren.twitterclone.R; import com.konusarakogren.twitterclone.activity.base.BaseActivity; import com.konusarakogren.twitterclone.activity.signup.SignupActivity; import com.konusarakogren.twitterclone.activity.tweets.TweetsActivity; import com.parse.LogInCallback; import com.parse.ParseException; import com.parse.ParseUser; import butterknife.BindView; public class LoginActivity extends BaseActivity { private final String TAG = "BaseActivity"; @BindView(R.id.edit_email) EditText editEmail; @BindView(R.id.edit_password) EditText editPassword; @BindView(R.id.button_login) Button buttonLogin; @BindView(R.id.button_register) Button buttonRegister; @Override protected int getLayoutResourceId() { return R.layout.activity_login; } @Override protected Context getContext() { return this; } @Override protected void initViews() { buttonLogin.setOnClickListener(loginClickListener); buttonRegister.setOnClickListener(registerClickListener); } @Override protected void onResume() { super.onResume(); ParseUser currentUser = ParseUser.getCurrentUser(); if (currentUser != null && currentUser.isAuthenticated()) { startActivity(new Intent(LoginActivity.this, TweetsActivity.class)); finish(); } } private OneShotClickListener loginClickListener = new OneShotClickListener(200) { @Override public void onOneShotClick(View v) { ParseUser.logInInBackground(editEmail.getText().toString(), editPassword.getText().toString(), new LogInCallback() { public void done(ParseUser user, ParseException e) { if (user != null) { startActivity(new Intent(LoginActivity.this, TweetsActivity.class)); finish(); } else { Toast.makeText(LoginActivity.this, "Your E-mail or Password is invalid!", Toast.LENGTH_SHORT).show(); Log.e(TAG, String.valueOf(e)); } } }); } }; private OneShotClickListener registerClickListener = new OneShotClickListener(200) { @Override public void onOneShotClick(View v) { startActivity(new Intent(LoginActivity.this, SignupActivity.class)); finish(); } }; }
[ "buraksinankarabulut@gmail.com" ]
buraksinankarabulut@gmail.com
92dd8f3b414cb323038d84e16e4024487807f700
e89d45f9e6831afc054468cc7a6ec675867cd3d7
/src/main/java/com/microsoft/graph/models/generated/PrintScaling.java
718156528ee19428ed11fb2a29b2f4d421354585
[ "MIT" ]
permissive
isabella232/msgraph-beta-sdk-java
67d3b9251317f04a465042d273fe533ef1ace13e
7d2b929d5c99c01ec1af1a251f4bf5876ca95ed8
refs/heads/dev
2023-03-12T05:44:24.349020
2020-11-19T15:51:17
2020-11-19T15:51:17
318,158,544
0
0
MIT
2021-02-23T20:48:09
2020-12-03T10:37:46
null
UTF-8
Java
false
false
799
java
// ------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. // ------------------------------------------------------------------------------ package com.microsoft.graph.models.generated; /** * The Enum Print Scaling. */ public enum PrintScaling { /** * auto */ AUTO, /** * shrink To Fit */ SHRINK_TO_FIT, /** * fill */ FILL, /** * fit */ FIT, /** * none */ NONE, /** * unknown Future Value */ UNKNOWN_FUTURE_VALUE, /** * For PrintScaling values that were not expected from the service */ UNEXPECTED_VALUE }
[ "GraphTooling@service.microsoft.com" ]
GraphTooling@service.microsoft.com
1aee1f2d8be37429a7b341daf2dfef36b9b32452
0dfbbe5632988a022b27b1e91a2b65f72cb0fa69
/app/src/main/java/com/jiaoshizige/teacherexam/yy/fragment/BooksFragment.java
2f929df5bcfe8e23518be17fc5559d2c240fa0e8
[]
no_license
wch2219/Teacherstudent
b503faba86a2a7f86210d989402be996b26bd672
62f669f9b32a1567957eab6bc5a7861b88d84594
refs/heads/master
2020-03-28T07:13:37.348321
2018-09-10T10:49:07
2018-09-10T10:49:07
147,888,214
0
0
null
null
null
null
UTF-8
Java
false
false
11,288
java
package com.jiaoshizige.teacherexam.yy.fragment; import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.FrameLayout; import android.widget.ImageView; import com.bumptech.glide.Glide; import com.jwenfeng.library.pulltorefresh.BaseRefreshListener; import com.jwenfeng.library.pulltorefresh.ViewStatus; import com.umeng.analytics.MobclickAgent; import com.jiaoshizige.teacherexam.R; import com.jiaoshizige.teacherexam.activity.BookDetailActivity; import com.jiaoshizige.teacherexam.base.CommRecyclerViewAdapter; import com.jiaoshizige.teacherexam.base.GloableConstant; import com.jiaoshizige.teacherexam.base.MPBaseFragment; import com.jiaoshizige.teacherexam.base.ViewHolderZhy; import com.jiaoshizige.teacherexam.http.ApiUrl; import com.jiaoshizige.teacherexam.http.MyCallBack; import com.jiaoshizige.teacherexam.http.SupportResponse; import com.jiaoshizige.teacherexam.http.Xutil; import com.jiaoshizige.teacherexam.model.BookListResponse; import com.jiaoshizige.teacherexam.utils.AppLog; import com.jiaoshizige.teacherexam.utils.PullToRefreshLayoutRewrite; import com.jiaoshizige.teacherexam.utils.SPKeyValuesUtils; import com.jiaoshizige.teacherexam.utils.SPUtils; import com.jiaoshizige.teacherexam.utils.ToastUtil; import com.jiaoshizige.teacherexam.utils.ToolUtils; import com.jiaoshizige.teacherexam.widgets.SelfDialog; import com.zhy.adapter.recyclerview.CommonAdapter; import com.zhy.adapter.recyclerview.base.ViewHolder; import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.Subscribe; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import butterknife.BindView; /** * Created by Administrator on 2017/a1/7 0007. * 图书收藏 */ public class BooksFragment extends MPBaseFragment { @BindView(R.id.class_list) RecyclerView mRecyclerView; @BindView(R.id.pulltorefresh) PullToRefreshLayoutRewrite mPullToRefresh; private String user_id; private String pagesize = "10"; private int mPage = 1; private SelfDialog selfDialog; private String book_id; private Intent intent; View view; private CommRecyclerViewAdapter<BookListResponse.mData> mAdapter; @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { view = inflater.inflate(R.layout.class_fragment_layout, container, false); return view; } @Override public void onResume() { super.onResume(); mPage = 1; BookCollect(); MobclickAgent.onPageStart("图书收藏"); } @Override public void onPause() { super.onPause(); MobclickAgent.onPageEnd("图书收藏"); } @Override protected void onInitViews(Bundle savedInstanceState) { FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mRecyclerView.getLayoutParams(); lp.setMargins(0, ToolUtils.dip2px(getActivity(), 10), 0, 0); EventBus.getDefault().register(this); mRecyclerView.setLayoutParams(lp); user_id = (String) SPUtils.getSpValues(SPKeyValuesUtils.SP_USER_ID, SPUtils.TYPE_STRING); mPullToRefresh.setRefreshListener(new BaseRefreshListener() { @Override public void refresh() { mPage = 1; BookCollect(); } @Override public void loadMore() { mPage++; BookCollect(); } }); mPullToRefresh.setOnErrorListener(new PullToRefreshLayoutRewrite.onClickCallBackListener() { @Override public void onCallBackListener(View v) { mPage = 1; BookCollect(); } }); BookCollect();//访问网络请求数据 } @Override public void onDestroy() { super.onDestroy(); EventBus.getDefault().unregister(this); } @Subscribe public void getEventBus(String num) { if (num.equals("图书取消收藏")){ BookCollect(); } } private void BookCollect() { Map<String, Object> map = new HashMap<>(); // map.put("user_id",1); map.put("user_id", SPUtils.getSpValues(SPKeyValuesUtils.SP_USER_ID, SPUtils.TYPE_STRING)); map.put("type", "2"); map.put("page", mPage); map.put("page_size", pagesize); Log.e("*******map", map.toString()); GloableConstant.getInstance().startProgressDialog(getActivity()); Xutil.Post(ApiUrl.COLLECT, map, new MyCallBack<BookListResponse>() { @Override public void onSuccess(final BookListResponse result) { super.onSuccess(result); GloableConstant.getInstance().stopProgressDialog(); mPullToRefresh.finishRefresh(); mPullToRefresh.finishLoadMore(); mPullToRefresh.showView(ViewStatus.CONTENT_STATUS); if (result.getStatus_code().equals("200")) { if (result.getData() != null && result.getData().size() > 0) { if (mPage == 1) { getAdapter().updateData(result.getData()); } else { getAdapter().appendData(result.getData()); } } else { if (mPage > 1) { mPage--; ToastUtil.showShortToast("没有更多数据了"); } else { mPullToRefresh.showView(ViewStatus.EMPTY_STATUS); } } } else if (result.getStatus_code().equals("203")) { if (mPage > 1) { mPage--; ToastUtil.showShortToast("没有更多数据了"); } else { mPullToRefresh.showView(ViewStatus.EMPTY_STATUS); } } } @Override public void onError(Throwable ex, boolean isOnCallback) { super.onError(ex, isOnCallback); GloableConstant.getInstance().stopProgressDialog(); mPullToRefresh.finishRefresh(); mPullToRefresh.finishLoadMore(); mPullToRefresh.showView(ViewStatus.EMPTY_STATUS); } @Override public void onFinished() { super.onFinished(); GloableConstant.getInstance().stopProgressDialog(); } }); } /** * 取消收藏 */ private void delCollection(final BookListResponse.mData item) { Map<String, Object> map = new HashMap<>(); map.put("type", "2"); map.put("goods_id", item.getBook_id()); // map.put("user_id", 1); map.put("user_id", SPUtils.getSpValues(SPKeyValuesUtils.SP_USER_ID, SPUtils.TYPE_STRING)); Log.e("*******map", map.toString()); GloableConstant.getInstance().startProgressDialog(getActivity()); Xutil.Post(ApiUrl.DELCOLLECT, map, new MyCallBack<SupportResponse>() { @Override public void onSuccess(SupportResponse result) { super.onSuccess(result); Log.e("*********result", result.getStatus_code()); if (result.getStatus_code().equals("204")) { getAdapter().removeData(item); ToastUtil.showShortToast(result.getMessage()); } } @Override public void onFinished() { super.onFinished(); GloableConstant.getInstance().stopProgressDialog(); } @Override public void onError(Throwable ex, boolean isOnCallback) { super.onError(ex, isOnCallback); } }); } private CommRecyclerViewAdapter<BookListResponse.mData> getAdapter() { if (null == mAdapter) { mAdapter = new CommRecyclerViewAdapter<BookListResponse.mData>(getActivity(), R.layout.item_book_fragment_layout, null) { @Override protected void convert(ViewHolderZhy holder, final BookListResponse.mData s, final int position) { holder.setVisible(R.id.view, false); holder.setText(R.id.course_name, s.getBook_name()); holder.setText(R.id.course_price, "¥" + s.getPrice()); holder.setText(R.id.sell_num, s.getSale_num() + "人已购买"); ImageView mBookCover = (ImageView) holder.getConvertView().findViewById(R.id.book_cover); Glide.with(getActivity()).load(s.getImages()).apply(GloableConstant.getInstance().getDefaultOptionssmall()).into(mBookCover); holder.setOnClickListener(R.id.item_book, new View.OnClickListener() { @Override public void onClick(View v) { book_id = s.getBook_id(); Log.e("**********bookid", book_id); intent = new Intent(getActivity(), BookDetailActivity.class); intent.putExtra("book_id", book_id); startActivity(intent); } }); holder.setOnLongClickListener(R.id.item_book, new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { AppLog.instance().d("position:" + position); selfDialog = new SelfDialog(getActivity()); selfDialog.setTitle("是否取消收藏"); selfDialog.setYesOnclickListener("确定", new SelfDialog.onYesOnclickListener() { @Override public void onYesClick() { delCollection(s); selfDialog.dismiss(); } }); selfDialog.setNoOnclickListener("取消", new SelfDialog.onNoOnclickListener() { @Override public void onNoClick() { ToastUtil.showShortToast("取消"); selfDialog.dismiss(); } }); selfDialog.show(); return false; } }); } }; mRecyclerView.setLayoutManager(new LinearLayoutManager(getActivity())); mRecyclerView.setAdapter(mAdapter); } return mAdapter; } }
[ "wangchonghui2219@126.com" ]
wangchonghui2219@126.com
bbd4d42487a66bd94e9e0224e67fce325e64cc1b
6c3b1cdc8ff7d5b4deea67ac646148e689e988c9
/Supermarket/src/com/pb/action/Transitionaction.java
72110383e7d63ceeef3f0763878d262aa24982af
[]
no_license
XieGuangGe/duola
0e89a8b4f07b5ff13e86d47916f19990eb591f2e
64cd43140aee88be7e39c740b8a80cc0845d2978
refs/heads/master
2020-05-16T22:37:32.122826
2019-04-25T02:18:39
2019-04-25T02:18:39
183,338,738
0
0
null
null
null
null
GB18030
Java
false
false
1,346
java
package com.pb.action; import java.util.List; import java.util.Map; import org.apache.struts2.interceptor.RequestAware; import org.apache.struts2.interceptor.SessionAware; import com.opensymphony.xwork2.ActionSupport; import com.pb.entity.Supplier; import com.pb.entity.User; import com.pb.service.impl.BillServiceImpl; import com.pb.service.impl.UserServiceImpl; public class Transitionaction extends ActionSupport implements RequestAware,SessionAware{ private Map<String, Object> reuqest; private Map<String, Object> session; private List<Supplier> supplierlist; public List<Supplier> getSupplierlist() { return supplierlist; } public void setSupplierlist(List<Supplier> supplierlist) { this.supplierlist = supplierlist; } public String login() { System.out.println("=====正在查询所有供货商====="); BillServiceImpl service = new BillServiceImpl(); supplierlist = service.seachAllSupplier(); session.put("supplierlist", supplierlist); return "success"; } @Override public void setSession(Map<String, Object> session) { // TODO Auto-generated method stub this.session=session; } @Override public void setRequest(Map<String, Object> reuqest) { // TODO Auto-generated method stub this.reuqest=reuqest; } }
[ "XGuang@192.168.14.1" ]
XGuang@192.168.14.1
c867b798fdb2d608e575381cb4b249d33499aa35
65ac5eba5aacc935addd4164b50a8414d5c48350
/src/main/java/com/foodzie/foodzie/Controller/RestaurantOwnerController.java
239544e5ab084bd3e1a187c24e97fdbd84c357fb
[]
no_license
shalin1809/foodzie
8e1c3fc044e4095cfa74e489dd921f9b3095690c
e76288c0ba0c7f05dd2ce09a313869d1ce2f89f1
refs/heads/master
2021-05-06T10:56:53.259237
2017-12-12T15:15:34
2017-12-12T15:15:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
306
java
package com.foodzie.foodzie.Controller; import com.foodzie.foodzie.DAO.OutletDAO; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import com.foodzie.foodzie.Entities.Person; @Controller public class RestaurantOwnerController extends PageController { }
[ "noreply@github.com" ]
shalin1809.noreply@github.com
d6ce930ffd4c2773d288c1fdf0b1cbe6e5ac735c
7465dd869cc566c75877ae0b60b1051f4c7eeb84
/PPS-search/java/src/process/FixParams.java
6862ff6fee5b7db1987346cc528c4033e23abeb9
[]
no_license
jun-csbio/ATPdock-1
131616427bf46464983b75fee5c4a9d14031266d
9ac16aefc7f201008574f419a3b80a6d0d3487b2
refs/heads/main
2023-08-17T13:22:37.927403
2021-06-12T06:15:04
2021-06-12T06:15:04
390,239,097
0
0
null
2021-07-28T06:26:48
2021-07-28T06:26:48
null
UTF-8
Java
false
false
238
java
package process; public class FixParams { public static String PPSalign_exe = "../../../software/PPSalign"; public static String APoc_exe = "../../../software/apoc"; public static String LIBPOC_FATHER_FOLDER = "../../../database/"; }
[ "lrao_zjut@126.com" ]
lrao_zjut@126.com
c1f7d8a7d4665c6f65662a5511f4581f567cbbab
be4da161cc68e89176dce0d64d05b5fe335f9ce3
/src/main/java/thread/ThreadUtil.java
a060dfc8e84197851fcbcd2c6144303a535bcedd
[]
no_license
Bongss/ParallelGraphFramework
2cd5b6d631d0af5b40019d6d0e41bcf98bdaac72
fafdabff82edb6a8f2725bbd3552c05932022f11
refs/heads/master
2022-04-30T12:25:12.057936
2022-04-07T13:55:28
2022-04-07T13:55:28
93,016,514
1
1
null
null
null
null
UTF-8
Java
false
false
322
java
package thread; public class ThreadUtil { public static Thread[] createAndStartThreads(int num, Runnable runnable) { Thread[] threads = new Thread[num]; for (Thread thread : threads) { thread = new Thread(runnable); thread.start(); } return threads; } }
[ "bongki.cho07@gmail.com" ]
bongki.cho07@gmail.com
4cc692f25c0d1236f3aeb8a83e1a4ed6b3e17177
4247d2174a2d24b875ea5adb1e36ce8148943734
/app/src/androidTest/java/com/example/itunesremake/ExampleInstrumentedTest.java
91d0e66042c2dd1d32a794db364e059cc662e506
[]
no_license
Floran-mtte/itunes-remake
b6b8067ea3eeb04b7899174d8589780708c724a2
e182610dbb03d58806fec924a9bde051ff6f4071
refs/heads/master
2020-05-04T00:14:47.502115
2019-05-10T07:22:14
2019-05-10T07:22:14
178,880,392
0
0
null
null
null
null
UTF-8
Java
false
false
732
java
package com.example.itunesremake; 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.example.itunesremake", appContext.getPackageName()); } }
[ "floran.maitte@fnacdarty.com" ]
floran.maitte@fnacdarty.com
02dd451f031636c0d70173ab93f976bc6eae732a
8fcc622a557ad9f7a232df0c426430dcb8c6ef93
/app/src/main/java/mo/wall/org/headerimg/HeaderImgAct.java
3dca96df90c3160012a3f320f32ac77c03fa5173
[]
no_license
mosentest/WalleLibrary
cf7b7f45f553aaf7884b839b8386954d267cb986
bcdb89f4685213399b38f07a8262d57e042bc4cb
refs/heads/master
2023-05-04T21:42:10.729501
2019-12-16T07:20:55
2019-12-16T07:20:55
137,459,022
2
0
null
null
null
null
UTF-8
Java
false
false
481
java
package mo.wall.org.headerimg; import android.os.Message; import org.jetbrains.annotations.Nullable; import mo.wall.org.base.BaseAppCompatActivity; /** * Copyright (C), 2018-2019 * Author: ziqimo * Date: 2019-12-09 14:36 * Description: * History: * <author> <time> <version> <desc> * 作者姓名 修改时间 版本号 描述 */ public class HeaderImgAct extends BaseAppCompatActivity { @Override public void handleMessageAct(@Nullable Message msg) { } }
[ "709847739@qq.com" ]
709847739@qq.com
53fbe125330739c35a75ac30df5797c4868ef51c
28761743661de682ac654caaf6af6aa0d166911a
/demo03常用API/src/T1/demo04ArrayList/Demo02ArrayList.java
3a1ed4aab879ddfd12772e75e72a5f21a35c8a0a
[]
no_license
slTrust/java
795516b9fa9fcfb87fb92f504ba9767c9c54d682
8b5c8ffba970bd830506e895772512bb94ae88d4
refs/heads/master
2020-05-01T17:50:33.280345
2019-04-01T06:44:28
2019-04-01T06:44:28
177,610,053
1
0
null
null
null
null
UTF-8
Java
false
false
1,493
java
package T1.demo04ArrayList; import java.util.ArrayList; /* 数组的长度不可以发生改变。 但是ArrayList集合的长度是可以随意变化的。 对于ArrayList来说,有一个尖括号<E>代表泛型。 泛型:也就是装在集合当中的所有元素,全都是统一的什么类型。 注意:泛型只能是引用类型,不能是基本类型。 注意事项: 对于ArrayList集合来说,直接打印得到的不是地址值,而是内容。 如果内容是空,得到的是空的中括号:[] */ public class Demo02ArrayList { public static void main(String[] args) { // 创建了一个ArrayList集合,集合的名称是list,里面装的全都是String字符串类型的数据 // 备注:从JDK 1.7+开始,右侧的尖括号内部可以不写内容,但是<>本身还是要写的。 ArrayList<String> list = new ArrayList<>(); System.out.println(list); // [] // 向集合当中添加一些数据,需要用到add方法。 list.add("赵丽颖"); System.out.println(list); // [赵丽颖] list.add("迪丽热巴"); list.add("古力娜扎"); list.add("玛尔扎哈"); System.out.println(list); // [赵丽颖, 迪丽热巴, 古力娜扎, 玛尔扎哈] // list.add(100); // 错误写法!因为创建的时候尖括号泛型已经说了是字符串,添加进去的元素就必须都是字符串才行 } }
[ "trustfor@sina.cn" ]
trustfor@sina.cn
f863e900fb2557f0e19db80294354cd2872b0108
d3d8f55eecd1d8e606f448210def20e4d6764f17
/micro-common/src/main/java/com/hechihan/micro/common/util/jwt/JwtInfo.java
0cd475dd152db769b1903ff72261c91d05869e64
[]
no_license
itcloudy/micro
b30bd31f4c66e754688fcf9b3853f2705e769620
ee150f42908e0c2607c55f753355c65071ab1d25
refs/heads/master
2021-09-08T01:34:58.287918
2018-03-05T09:43:15
2018-03-05T09:43:15
122,907,266
0
1
null
null
null
null
UTF-8
Java
false
false
408
java
/** * @author: cloudy Date: 2018/1/30 Time: 16:07 * @email: 272685110@qq.com * @description: * @project: micro */ package com.hechihan.micro.common.util.jwt; import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; @Data @AllArgsConstructor public class JwtInfo implements Serializable{ private String username; private String userId; private String name; }
[ "272685110@qq.com" ]
272685110@qq.com
929216fd5dad779a621c7e12c4eccd9a4c341ecb
b2202c94a7a021e501289f6c84d63fcbcbc9a0ea
/Atvd1/src/main/java/br/com/cesed/facisa/si/arq/Atvd1/Atvd1Application.java
fbfeb72167f4edac6a2ec0d75fa58112ec2f450a
[]
no_license
Mysael/lesson1-arq
cec1db58af5066143ad1b606de62056a4d111755
e30d9b55304417ca50d6fd1542cf05ad8dab7116
refs/heads/master
2020-07-08T06:22:09.011222
2019-08-27T14:14:41
2019-08-27T14:14:41
203,591,660
0
0
null
null
null
null
UTF-8
Java
false
false
647
java
package br.com.cesed.facisa.si.arq.Atvd1; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import br.com.cesed.facisa.si.arq.Atvd1.repositories.ContaRepository; import br.com.cesed.facisa.si.arq.Atvd1.repositories.UsuarioRepository; @SpringBootApplication public class Atvd1Application { @Autowired private ContaRepository contaRepository; @Autowired private UsuarioRepository usuarioRepository; public static void main(String[] args) { SpringApplication.run(Atvd1Application.class, args); } }
[ "aluno@cesed.local" ]
aluno@cesed.local
edbbd3752fb94fc6f4218e12d8298397fa0c5a2e
682c5cac57296aa88c224b0c25958940401b16cf
/src/main/java/com/project/bootcamp/exceptions/ExceptionsHandler.java
c6ed370575e905d7956f9b24476aabd4d1812a5a
[]
no_license
fillipevaz/fiis-Acoes
c4e66696d5e006a4d5291e87fbb335bfad03ded0
5f7c57453d95a15039315e3366a34891c6271ea3
refs/heads/main
2023-06-10T13:48:41.804716
2021-06-28T16:37:56
2021-06-28T16:37:56
381,095,859
0
0
null
null
null
null
UTF-8
Java
false
false
959
java
package com.project.bootcamp.exceptions; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.servlet.mvc.method.annotation.ResponseEntityExceptionHandler; @ControllerAdvice public class ExceptionsHandler extends ResponseEntityExceptionHandler { @ExceptionHandler(BusinessException.class) protected ResponseEntity<ExceptionResponse> handleSecurity(BusinessException e) { return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(new ExceptionResponse(e.getMessage())); } @ExceptionHandler(NotFoundException.class) protected ResponseEntity<ExceptionResponse> handleSecurity(NotFoundException e) { return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new ExceptionResponse(e.getMessage())); } }
[ "fillipe_vaz@hotmail.com" ]
fillipe_vaz@hotmail.com
51f696d7076b7713f6f2b6512df2e3dfe22de2d5
77385a16dd57d3ec587963d20df2d275756591d6
/01-Design-Patterns/src/aula04_Decorator/TemplateDeImpostoCondicional.java
3b6cc682c1063f63de0ff03240a8dc605e6df7a0
[]
no_license
josemalcher/Curso-ALURA-Curso-Design-Patterns-Java-I
f7879d2a74f201742f9251c9e473a6fc244905e6
7939b21cbf45068945fc8bc0d8921aa86c52d528
refs/heads/master
2021-01-11T10:13:39.225266
2016-11-07T14:10:47
2016-11-07T14:10:47
72,580,511
0
0
null
null
null
null
UTF-8
Java
false
false
554
java
package aula04_Decorator; public abstract class TemplateDeImpostoCondicional extends Imposto{ @Override public double calcula(Orcamento orcamento) { if(deveUsarMaximaTaxacao(orcamento)){ return maximaTaxacao(orcamento) + calculoDoOutroImpostos(orcamento); }else{ return miniTaxacao(orcamento) + calculoDoOutroImpostos(orcamento); } } public abstract double miniTaxacao(Orcamento orcamento); public abstract double maximaTaxacao(Orcamento orcamento); public abstract boolean deveUsarMaximaTaxacao(Orcamento orcamento); }
[ "malcher.malch@gmail.com" ]
malcher.malch@gmail.com
1b271523fd015e9a3a9e464de283fb75197161ed
2bf469b292e9f49485697bbbc24d5580464835bd
/src/main/java/org/kualaftp/util/FtpFile.java
6650c0931c921f812829754200f198d8a541b32d
[]
no_license
lombritz/kualaftp
bf0c6cd45be536353582848c00834406987d234d
6f5a151f965e09b6f731013ec2775db62debb556
refs/heads/master
2020-05-01T16:53:42.744800
2019-03-25T13:37:47
2019-03-25T13:37:47
177,585,024
0
0
null
null
null
null
UTF-8
Java
false
false
381
java
package org.kualaftp.util; public class FtpFile { private String name; private boolean directory; public FtpFile() { } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isDirectory() { return directory; } public void setDirectory(boolean directory) { this.directory = directory; } }
[ "jaime_rojas@claro.com.do" ]
jaime_rojas@claro.com.do
5b3fa17c223f9efdbefeed81178e6abca4b91dbd
1e85fa11f308be4718232345e7c2473e5b4fd738
/kodilla-spring/src/test/java/com/kodilla/spring/library/LibraryTestSuite.java
8ce1704e26fa2c61b97f4614062d195e521c95ac
[]
no_license
Kubecko/Marcin-Kubecko-kodilla-java
9a270a2a4bb7774e55fcc3d60f0620c1004f7ca2
44faea20dc1334059a64a08d374d4ede1a018bd6
refs/heads/master
2021-08-08T02:16:50.995962
2018-10-09T08:14:41
2018-10-09T08:14:41
131,528,960
0
0
null
null
null
null
UTF-8
Java
false
false
1,393
java
package com.kodilla.spring.library; import org.junit.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import java.util.Arrays; @SpringBootTest public class LibraryTestSuite { @Test public void testLoadFromDb() { //Given ApplicationContext context = new AnnotationConfigApplicationContext("com.kodilla.spring"); Library library = context.getBean(Library.class); //When library.loadFromDb(); //Then //do nothing } @Test public void testSaveToDb() { //Given ApplicationContext context = new AnnotationConfigApplicationContext("com.kodilla.spring"); Library library = context.getBean(Library.class); //When library.saveToDb(); //Then //do nothing } @Test public void testContext() { //Given ApplicationContext context = new AnnotationConfigApplicationContext("com.kodilla.spring"); //When & Then System.out.println("===== Beans list: ==== >>"); Arrays.stream(context.getBeanDefinitionNames()) .forEach(System.out::println); System.out.println("<< ===== Beans list ===="); } }
[ "MKubecko@gmail.com" ]
MKubecko@gmail.com
454eaa5ce9b7f121b42db172b6b5597137443a10
983d2fc46a9e4b9a635e0ef2afcb0e3f1bbdb432
/app/src/main/java/com/yin/yzjcourse/DesignModel/P9_2组合模式_由迭代器模式演变而来/CompositeTest.java
91c3fab121eaf87612052718dfe1611f9b169e68
[]
no_license
yzjgogo/YZJCourse
96dc0bf8497c8f1bf5023b299dfb5c5f59e5c28b
ce1cea3e218b908651fb8dc44031467b0554cd86
refs/heads/master
2022-11-25T09:58:50.013395
2022-11-11T10:07:44
2022-11-11T10:07:44
72,610,014
0
1
null
null
null
null
UTF-8
Java
false
false
3,963
java
package com.yin.yzjcourse.DesignModel.P9_2组合模式_由迭代器模式演变而来; import com.yin.yzjcourse.DesignModel.P9_2组合模式_由迭代器模式演变而来.客户代码.Waitress; import com.yin.yzjcourse.DesignModel.P9_2组合模式_由迭代器模式演变而来.C4叶节点类_本身就是一个子元素不可以再有子元素.MenuItem; import com.yin.yzjcourse.DesignModel.P9_2组合模式_由迭代器模式演变而来.C1节点和叶节点的超类.MenuComponent; import com.yin.yzjcourse.DesignModel.P9_2组合模式_由迭代器模式演变而来.C2节点类_可以有子元素.Menu; /** * 组合模式: * 允许你将对象组合成树形结构来表现"整体/部分"层次结构。组合能让客户以一致的方式处理个别对象以及对象组合。 * 参考图片:composite_p_2.png composite_p_3.png * * 适用场景,当你的业务需要将对象设计成属性结构时,可以用组合模式,属性结构参考图片:composite_p_1.png * * 组合模式做到了客户代码对个别对象和组合对象一样对待,也就是对客户代码来说不区分叶节点和节点,都是抽象MenuComponent类型 */ public class CompositeTest { public static void main(String args[]) { MenuComponent pancakeHouseMenu = new Menu("PANCAKE HOUSE MENU", "Breakfast"); MenuComponent dinerMenu = new Menu("DINER MENU", "Lunch"); MenuComponent cafeMenu = new Menu("CAFE MENU", "Dinner"); MenuComponent dessertMenu = new Menu("DESSERT MENU", "Dessert of course!"); MenuComponent allMenus = new Menu("ALL MENUS", "All menus combined"); allMenus.add(pancakeHouseMenu); allMenus.add(dinerMenu); allMenus.add(cafeMenu); pancakeHouseMenu.add(new MenuItem( "K&B's Pancake Breakfast", "Pancakes with scrambled eggs, and toast", true, 2.99)); pancakeHouseMenu.add(new MenuItem( "Regular Pancake Breakfast", "Pancakes with fried eggs, sausage", false, 2.99)); pancakeHouseMenu.add(new MenuItem( "Blueberry Pancakes", "Pancakes made with fresh blueberries, and blueberry syrup", true, 3.49)); pancakeHouseMenu.add(new MenuItem( "Waffles", "Waffles, with your choice of blueberries or strawberries", true, 3.59)); dinerMenu.add(new MenuItem( "Vegetarian BLT", "(Fakin') Bacon with lettuce & tomato on whole wheat", true, 2.99)); dinerMenu.add(new MenuItem( "BLT", "Bacon with lettuce & tomato on whole wheat", false, 2.99)); dinerMenu.add(new MenuItem( "Soup of the day", "A bowl of the soup of the day, with a side of potato salad", false, 3.29)); dinerMenu.add(new MenuItem( "Hotdog", "A hot dog, with saurkraut, relish, onions, topped with cheese", false, 3.05)); dinerMenu.add(new MenuItem( "Steamed Veggies and Brown Rice", "A medly of steamed vegetables over brown rice", true, 3.99)); dinerMenu.add(new MenuItem( "Pasta", "Spaghetti with Marinara Sauce, and a slice of sourdough bread", true, 3.89)); dinerMenu.add(dessertMenu); dessertMenu.add(new MenuItem( "Apple Pie", "Apple pie with a flakey crust, topped with vanilla icecream", true, 1.59)); dessertMenu.add(new MenuItem( "Cheesecake", "Creamy New York cheesecake, with a chocolate graham crust", true, 1.99)); dessertMenu.add(new MenuItem( "Sorbet", "A scoop of raspberry and a scoop of lime", true, 1.89)); cafeMenu.add(new MenuItem( "Veggie Burger and Air Fries", "Veggie burger on a whole wheat bun, lettuce, tomato, and fries", true, 3.99)); cafeMenu.add(new MenuItem( "Soup of the day", "A cup of the soup of the day, with a side salad", false, 3.69)); cafeMenu.add(new MenuItem( "Burrito", "A large burrito, with whole pinto beans, salsa, guacamole", true, 4.29)); Waitress waitress = new Waitress(allMenus); waitress.printVegetarianMenu(); } }
[ "yinzhijiejie@126.com" ]
yinzhijiejie@126.com
259163b25aa9316c4816d997c8fee2028b939087
6b6d7a257784227fcde48fe169fc9a28c33da8e6
/app/src/main/java/com/wjx/android/wanandroidmvp/base/application/WanAndroidApplication.java
8119da77f98e0839f9d86929fe377df9b31eabf4
[ "Apache-2.0" ]
permissive
LillteZheng/WanAndroidMvp
66a0adc0ecbbb94f2997d11eaeb453b231024506
b31dda65fd0fcd16026a05f6ecf4d6f430ce2d54
refs/heads/master
2020-12-28T00:37:07.765991
2020-02-02T11:11:58
2020-02-02T11:11:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,225
java
package com.wjx.android.wanandroidmvp.base.application; import android.content.res.Configuration; import androidx.appcompat.app.AppCompatDelegate; import com.blankj.utilcode.util.SPUtils; import com.blankj.utilcode.util.Utils; import com.wjx.android.wanandroidmvp.base.utils.Constant; import org.litepal.LitePal; import org.litepal.LitePalApplication; /** * Created with Android Studio. * Description: Base Application * * @author: Wangjianxian * @date: 2019/12/18 * Time: 21:26 */ public class WanAndroidApplication extends LitePalApplication { @Override public void onCreate() { super.onCreate(); LitePal.initialize(this); Utils.init(this); changeMode(); } private void changeMode() { boolean isNightMode = SPUtils.getInstance(Constant.CONFIG_SETTINGS).getBoolean (Constant.KEY_NIGHT_MODE, false); int currentMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; boolean isSystemNightMode = currentMode == Configuration.UI_MODE_NIGHT_YES; AppCompatDelegate.setDefaultNightMode(isNightMode ? AppCompatDelegate.MODE_NIGHT_YES : AppCompatDelegate.MODE_NIGHT_NO); } }
[ "jianxianwang198@163.com" ]
jianxianwang198@163.com
ee401dc47e029e140de3abbc319f760d9b170d1c
81d7654b08c3f34be35351a5532348e455e5acd5
/java/projects/archfirst-common/afcommon-util/src/test/java/org/archfirst/common/quantity/test/DecimalQuantityXmlAdapterTest.java
1f1f9fb364a72144af914dd6e1558a531e02d9a2
[]
no_license
popbones/archfirst
832f036ab7c948e5b2fc70dd627374280d9f8f0e
89e6ed128a01cb7fe422fa8e5925a61a2edfdb5d
refs/heads/master
2021-01-10T06:18:26.497760
2014-03-02T06:53:37
2014-03-02T06:53:37
43,199,746
1
0
null
null
null
null
UTF-8
Java
false
false
3,169
java
/** * Copyright 2011 Archfirst * * 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.archfirst.common.quantity.test; import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; 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 org.archfirst.common.jaxb.DefaultSchemaOutputResolver; import org.archfirst.common.quantity.DecimalQuantity; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.testng.Assert; import org.testng.annotations.Test; /** * DecimalQuantityXmlAdapterTest * * @author Naresh Bhatia */ public class DecimalQuantityXmlAdapterTest { private static final Logger logger = LoggerFactory.getLogger(DecimalQuantityXmlAdapterTest.class); @Test public void testOrderMarshalUnmarshal() throws JAXBException, IOException { // Create an order Order order = new Order(new DecimalQuantity("10.2")); // Write it out as XML JAXBContext jaxbContext = JAXBContext.newInstance(Order.class); StringWriter writer = new StringWriter(); Marshaller marshaller = jaxbContext.createMarshaller(); marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); marshaller.marshal(order, writer); String orderString = writer.toString(); logger.debug("Order converted to XML:\n" + orderString); // Write out the schema (for debugging purposes) jaxbContext.generateSchema(new DefaultSchemaOutputResolver("target")); // Read it from XML Order orderRead = (Order)jaxbContext.createUnmarshaller().unmarshal( new StringReader(orderString)); // Compare quantities Assert.assertEquals(orderRead.getQuantity(), order.getQuantity()); } @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement(name = "Order") public static class Order { @XmlElement(name = "Quantity", required = true) private DecimalQuantity quantity; public Order() { } public Order(DecimalQuantity quantity) { this.quantity = quantity; } public DecimalQuantity getQuantity() { return quantity; } public void setQuantity(DecimalQuantity quantity) { this.quantity = quantity; } } }
[ "naresh.archfirst@gmail.com@5f1d654b-2d44-f8f1-813d-ae2f855fe689" ]
naresh.archfirst@gmail.com@5f1d654b-2d44-f8f1-813d-ae2f855fe689
bf38b0742589f91363050f932a480a0ac3668e4c
333f031638b9357162730551f5fece29de26f58e
/app/src/main/java/com/kinth/football/listener/ISaveListener.java
f9bfd60c4137fa4b155c8f8d97b9a0b75b4b22c3
[]
no_license
Solaning/cloud-football
19a21f0585989c639846f44bd30cdff8aff84f22
7e310daceb2694851c6a52c3a956a8bc4a7a3d2f
refs/heads/master
2021-01-10T15:43:08.658612
2015-10-24T08:52:55
2015-10-24T08:52:55
44,853,394
2
0
null
null
null
null
UTF-8
Java
false
false
146
java
package com.kinth.football.listener; public interface ISaveListener { public void onSuccess(); public void onFailure(int arg0, String arg1); }
[ "384276310@qq.com" ]
384276310@qq.com
5559d78f5b05082cfe5f65b0ce624a86b1627e1d
51d786338aa184d2cba665338ccb63b0708bbdc2
/spring-context/src/main/java/com/michael/context/event/ApplicationEventMulticaster.java
97b0f71b0a83fbf1baf89dad2010fe59a01ece18
[]
no_license
chudichen/spring
a5abca9db4906da3234a0545f6cbcccbd29ca229
2c30cc213e83fbdf67eba3acf69a8c948a3af3fd
refs/heads/master
2020-07-08T22:40:54.743746
2019-09-25T11:47:11
2019-09-25T11:47:11
203,800,077
0
0
null
null
null
null
UTF-8
Java
false
false
745
java
package com.michael.context.event; import com.michael.context.ApplicationEvent; import com.michael.context.ApplicationListener; import com.michael.core.ResolvableType; import com.michael.lang.Nullable; /** * @author Michael Chu * @since 2019-09-02 20:41 */ public interface ApplicationEventMulticaster { void addApplicationListener(ApplicationListener<?> listener); void addApplicationListenerBean(String listenerBeanName); void removeApplicationListener(ApplicationListener<?> listener); void removeApplicationListenerBean(String listenerBeanName); void removeAllListeners(); void multicastEvent(ApplicationEvent event); void multicastEvent(ApplicationEvent event, @Nullable ResolvableType eventType); }
[ "chudichen.foxmail.com" ]
chudichen.foxmail.com
714014d3c3243a6b2b5d2b6804d2d6f6a48cc56a
7ec10f6400c5728e4fc3651dcd217a85a0f91b5e
/src/main/java/com/example/afpoo/dto/VeiculoDTO.java
922f9cceeebe56e3366d9e3aa9d74f30fdd53ad6
[]
no_license
henriqueakao/AF_POO
348f53e3cf29443d4735c4d714be44f60625bbf3
a4a7232d0a1ff6bf59e7cddb98fa6b8dace6acb8
refs/heads/master
2023-01-20T04:37:20.814067
2020-12-02T23:16:08
2020-12-02T23:16:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
430
java
package com.example.afpoo.dto; public class VeiculoDTO { private String modelo; private float valorDiaria; public float getValorDiaria() { return valorDiaria; } public void setValorDiaria(float valorDiaria) { this.valorDiaria = valorDiaria; } public String getModelo() { return modelo; } public void setModelo(String modelo) { this.modelo = modelo; } }
[ "vini-brisola@hotmail.com" ]
vini-brisola@hotmail.com
1822a8da36ef0ce5540a10259bc5583a915aef40
c29e663008056a821bc30048eaa66dec12f8a7a4
/org/cq2/delegator/test/ExperimentTest.java
6e274fe2ff45b8acfb0784427ae29b0169b4109a
[]
no_license
vanschelven/delegator
bd10ba82a3aaa8ef053beddcdee1fd7dc4affa80
ff010efb90c46166b9b1ad9b8bf0e370c01b7864
refs/heads/master
2020-03-18T15:59:56.133411
2005-12-28T10:00:00
2005-12-28T10:00:00
134,941,313
1
0
null
null
null
null
UTF-8
Java
false
false
579
java
package org.cq2.delegator.test; import org.cq2.delegator.Self; import junit.framework.TestCase; public class ExperimentTest extends TestCase { final public static class FinalClass { public void method() { } } public void testFinalClass() { try { new Self(FinalClass.class); fail(); } catch (VerifyError e) {} } public void testArray() { try { new Self(Object[].class); fail(); } catch (ClassFormatError e) {} } }
[ "klaas@vanschelven.com" ]
klaas@vanschelven.com
9ae9601edc7ae5be49b266392dac704812f960e1
2b29284083083c84e7a6ae69466a0e2802e4545f
/src/test/java/org/fasttrackit/pages/LostPasswordPage.java
3e5b0fbdfbf8d9b0c7a5072f1719dd9e0c9db68d
[]
no_license
ivonaionita/MySerenityProject
882bb6dc547c14d8be02510f6c5224c8409c1190
bb70e2838ead530e7671bbf2571261a40d6b79ed
refs/heads/master
2023-03-28T14:26:28.869879
2021-03-23T13:06:29
2021-03-23T13:06:29
339,674,343
0
0
null
null
null
null
UTF-8
Java
false
false
790
java
package org.fasttrackit.pages; import net.serenitybdd.core.pages.PageObject; import net.serenitybdd.core.pages.WebElementFacade; import org.openqa.selenium.support.FindBy; public class LostPasswordPage extends PageObject { @FindBy (css="#user_login") private WebElementFacade userNameField; @FindBy (css=".woocommerce-Button") private WebElementFacade resetPasswordButton; @FindBy (css=".woocommerce-message ") private WebElementFacade resetPassMessage; public void setUserNameField(String email){ typeInto(userNameField,email); } public void clickResetButoon(){ clickOn(resetPasswordButton); } public void resetPasswordMessage(){ resetPassMessage.shouldContainText("Password reset email has been sent."); } }
[ "75522357+ivonaionita@users.noreply.github.com" ]
75522357+ivonaionita@users.noreply.github.com
6f16620d42500a7730a6a7129e3b9fcbf90d643f
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
/src/chosun/ciis/ad/tax/dao/AdTax1000DAO.java
e538b7a873de7080c5e94c8c749ab972cf7c175d
[]
no_license
nosmoon/misdevteam
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
1829d5bd489eb6dd307ca244f0e183a31a1de773
refs/heads/master
2020-04-15T15:57:05.480056
2019-01-10T01:12:01
2019-01-10T01:12:01
164,812,547
1
0
null
null
null
null
UHC
Java
false
false
7,738
java
/*************************************************************************************************** * 파일명 : AdTax1000DAO.java * 기능 : * 작성일자 : * 작성자 : ***************************************************************************************************/ /*************************************************************************************************** * 수정내역 : * 수정자 : * 수정일자 : * 백업 : ***************************************************************************************************/ package chosun.ciis.ad.tax.dao; import somo.framework.db.DBManager; import somo.framework.expt.AppException; import chosun.ciis.ad.common.dm.AD_CO_9004_SDM; import chosun.ciis.ad.common.ds.AD_CO_9004_SDataSet; import chosun.ciis.ad.tax.dm.AD_TAX_1000_MDM; import chosun.ciis.ad.tax.dm.AD_TAX_1010_LDM; import chosun.ciis.ad.tax.dm.AD_TAX_1020_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1021_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1022_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1023_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1030_SDM; import chosun.ciis.ad.tax.dm.AD_TAX_1040_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1041_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1050_LDM; import chosun.ciis.ad.tax.dm.AD_TAX_1060_LDM; import chosun.ciis.ad.tax.dm.AD_TAX_1070_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1071_ADM; import chosun.ciis.ad.tax.dm.AD_TAX_1011_SDM; import chosun.ciis.ad.tax.ds.AD_TAX_1000_MDataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1010_LDataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1020_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1021_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1022_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1023_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1030_SDataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1040_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1041_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1050_LDataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1060_LDataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1070_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1071_ADataSet; import chosun.ciis.ad.tax.ds.AD_TAX_1011_SDataSet; /** * */ public class AdTax1000DAO { public AD_TAX_1000_MDataSet ad_tax_1000_m(AD_TAX_1000_MDM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1000_MDataSet ds = (AD_TAX_1000_MDataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1010_LDataSet ad_tax_1010_l(AD_TAX_1010_LDM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1010_LDataSet ds = (AD_TAX_1010_LDataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1011_SDataSet ad_tax_1011_s(AD_TAX_1011_SDM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1011_SDataSet ds = (AD_TAX_1011_SDataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_CO_9004_SDataSet ad_tax_1012_s(AD_CO_9004_SDM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_CO_9004_SDataSet ds = (AD_CO_9004_SDataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1020_ADataSet ad_tax_1020_a(AD_TAX_1020_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1020_ADataSet ds = (AD_TAX_1020_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1021_ADataSet ad_tax_1021_a(AD_TAX_1021_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1021_ADataSet ds = (AD_TAX_1021_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1022_ADataSet ad_tax_1022_a(AD_TAX_1022_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1022_ADataSet ds = (AD_TAX_1022_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1023_ADataSet ad_tax_1023_a(AD_TAX_1023_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1023_ADataSet ds = (AD_TAX_1023_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1030_SDataSet ad_tax_1030_s(AD_TAX_1030_SDM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1030_SDataSet ds = (AD_TAX_1030_SDataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1040_ADataSet ad_tax_1040_a(AD_TAX_1040_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1040_ADataSet ds = (AD_TAX_1040_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1041_ADataSet ad_tax_1041_a(AD_TAX_1041_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1041_ADataSet ds = (AD_TAX_1041_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1050_LDataSet ad_tax_1050_l(AD_TAX_1050_LDM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1050_LDataSet ds = (AD_TAX_1050_LDataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1060_LDataSet ad_tax_1060_l(AD_TAX_1060_LDM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1060_LDataSet ds = (AD_TAX_1060_LDataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1070_ADataSet ad_tax_1070_a(AD_TAX_1070_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1070_ADataSet ds = (AD_TAX_1070_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } public AD_TAX_1071_ADataSet ad_tax_1071_a(AD_TAX_1071_ADM dm) throws AppException { DBManager manager = new DBManager("MISADV"); AD_TAX_1071_ADataSet ds = (AD_TAX_1071_ADataSet) manager.executeCall(dm); if (!"".equals(ds.errcode)) { throw new AppException(ds.errcode, ds.errmsg); } return ds; } }
[ "DLCOM000@172.16.30.11" ]
DLCOM000@172.16.30.11
59ac0e91dafaaf44610fcb97481bd9e8ef859935
bb5a1cdadd6d8dce24117dc19242151fc43ff708
/JavaEx/src/com/javaex/jdbc/oracle/HRSearchEmployeesPSTMT.java
affe579f88b0710bf50101e2f8733466939bd2e5
[]
no_license
cloudbigdata-21q2/JavaEx
93e4f3c78544e61d79e2339a5b10febac1f6f7f3
45db14f58b3c2f7c4f641244566a68e3bb11f775
refs/heads/master
2023-05-10T03:12:03.875017
2021-05-31T00:45:37
2021-05-31T00:45:37
363,072,431
1
0
null
null
null
null
UTF-8
Java
false
false
2,205
java
package com.javaex.jdbc.oracle; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Date; import java.util.Scanner; // Scanner로 키워드 입력 // first_name, last_name 필드 대상 부분 검색 // 이름 성, Email, 전화번호, 입사일 출력 public class HRSearchEmployeesPSTMT { public static void main(String[] args) { Connection conn = null; // 커넥션 // Statement stmt = null; // 문맥 PreparedStatement pstmt = null; ResultSet rs = null; // 결과 셋 Scanner scanner = new Scanner(System.in); try { conn = DBConfig.getConnection(); System.out.print("검색어:"); String keyword = scanner.next(); // // String sql = "SELECT first_name, last_name, " + // "email, phone_number, hire_date " + // " FROM employees " + // " WHERE lower(first_name) LIKE '%" + keyword.toLowerCase() + "%' OR " + // " lower(last_name) LIKE '%" + keyword.toLowerCase() + "%'"; String sql = "SELECT first_name, last_name, email, phone_number, hire_date " + " FROM employees " + " WHERE lower(first_name) LIKE ? OR lower(last_name) LIKE ?"; System.out.println("Template:" + sql); // 실행 계획 마련 -> LIKE 검색시의 Tip pstmt = conn.prepareStatement(sql); pstmt.setString(1, "%" + keyword.toLowerCase() + "%"); // 바인딩할 값에 와일드 카드를 포함 전달 pstmt.setString(2, "%" + keyword.toLowerCase() + "%"); // 쿼리 수행 // rs = pstmt.executeQuery(sql); rs = pstmt.executeQuery(); // Loop while(rs.next()) { String firstName = rs.getString(1); String lastName = rs.getString(2); String email = rs.getString("email"); String phoneNumber = rs.getString("phone_number"); String hireDate = rs.getString("hire_date"); // 출력 System.out.printf("%s %s: %s, %s, %s%n", firstName, lastName, email, phoneNumber, hireDate); } scanner.close(); } catch (SQLException e) { e.printStackTrace(); } finally { try { rs.close(); pstmt.close(); conn.close(); } catch (Exception e) { } } } }
[ "skyun.nam@gmail.com" ]
skyun.nam@gmail.com
7e1041f1f88a80def22bab6b44947728517f55de
415f555d5c0e1cea3120755b240ee2d86c0c1e4d
/algo/src/com/zjutkz/leetcode/android/pm/deque/Producer.java
fc179fbc7a0426f78c90b71f8ec17be7895e1e9e
[]
no_license
zjutkz/LeetCodeAlgo
c945b0de4b6ef576c40dfcac0ef1af5e326b72e6
f027cdecf512c8f8040e15db66bd982167020119
refs/heads/master
2023-02-04T11:31:42.290313
2020-12-09T10:58:03
2020-12-09T10:58:03
189,007,231
0
0
null
null
null
null
UTF-8
Java
false
false
480
java
package com.zjutkz.leetcode.android.pm.deque; import java.util.concurrent.BlockingDeque; public enum Producer { INSTANCE; private BlockingDeque<Integer> blockingDeque; public void setQueue(BlockingDeque<Integer> blockingDeque) { this.blockingDeque = blockingDeque; } public void produce(int value) { try { blockingDeque.put(value); } catch (InterruptedException e) { e.printStackTrace(); } } }
[ "kangzhe.kz@alibaba-inc.com" ]
kangzhe.kz@alibaba-inc.com
869fca288b55ebcb0e3e0a1ea2c27d4d606d7ff1
79b0ce4804eb953ef4ebafda7bdf09362f513b72
/src/main/java/de/xbook/services/WebSecurityConfig.java
fc14ff2cb9d02f9791ca2344b8e5e897e3cad268
[]
no_license
vivekmore/xbook
fba1e93cbe725686026a7ce6b770ad614111cebf
4618d4c7d1c8fe170ed5e03b63e09c072979f796
refs/heads/master
2020-05-03T22:15:25.531874
2019-03-30T19:34:51
2019-03-30T19:34:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,102
java
package de.xbook.services; import de.xbook.services.user.XbookUserDetailsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.authentication.dao.DaoAuthenticationProvider; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @Configuration @EnableWebSecurity public class WebSecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/", "/home").permitAll() .anyRequest().authenticated() .and() .formLogin() .loginPage("/login") .permitAll() .and() .logout() .permitAll(); } @Autowired public void configureGlobal(AuthenticationManagerBuilder auth, XbookUserDetailsService xbookUserDetailsService) throws Exception { auth.authenticationProvider(authenticationProvider(xbookUserDetailsService)); } @Bean public DaoAuthenticationProvider authenticationProvider(XbookUserDetailsService xbookUserDetailsService) { BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); System.out.println("Encrypted Password: " + encoder.encode("12345")); DaoAuthenticationProvider authProvider = new DaoAuthenticationProvider(); authProvider.setUserDetailsService(xbookUserDetailsService); authProvider.setPasswordEncoder(encoder); return authProvider; } }
[ "k@ksfx.de" ]
k@ksfx.de
50d92751be0364bcd352077ce9f14479c9fa6d6d
4d8265c59bc37d9ef7a6f73cfc381b98ac980d28
/smalljava-core/src/com/smalljava/core/l5_expression/eval/plugin/two/LogicGreaterOperEvalPlugin.java
fde9087cc616ac4a985947e17bb5f5f31dbbf114
[ "Apache-2.0" ]
permissive
liujunsong68922/smalljava-v2
61b8d076a94eb8cb685e7e268c366e552d992c73
7d078e879e6d748fa08a2f0a02fc24fc97ea6f8c
refs/heads/main
2023-08-16T03:21:38.996010
2021-10-13T10:20:57
2021-10-13T10:20:57
415,445,930
0
0
null
null
null
null
GB18030
Java
false
false
3,926
java
package com.smalljava.core.l5_expression.eval.plugin.two; import com.smalljava.core.common.VarValue; import com.smalljava.core.common.logging.Logger; import com.smalljava.core.common.logging.LoggerFactory; import com.smalljava.core.l5_expression.eval.ExpressionEval; import com.smalljava.core.l5_expression.eval.IExpressionEval; import com.smalljava.core.l5_expression.eval.operelement.DoubleValue; import com.smalljava.core.l5_expression.eval.operelement.FloatValue; import com.smalljava.core.l5_expression.eval.operelement.IntegerValue; import com.smalljava.core.l5_expression.eval.operelement.LongValue; import com.smalljava.core.l5_expression.vo.RootAST; import com.smalljava.core.l5_expression.vo.two.DualOperDataOperElement; import com.smalljava.core.l9_space.classtable.IClassTable; import com.smalljava.core.l9_space.vartable.IVarTable; /** * MEMO 执行加法运算 * @author liujunsong * */ public class LogicGreaterOperEvalPlugin implements IExpressionEval { private Logger logger = LoggerFactory.getLogger(LogicGreaterOperEvalPlugin.class); @Override public VarValue eval(RootAST root, IVarTable vartable, IClassTable classtable) { if (root == null || vartable == null || classtable == null) { return null; } if (root instanceof DualOperDataOperElement) { DualOperDataOperElement oper = (DualOperDataOperElement) root; // 加法计算 if (oper.getOpercode().equals(">")) { RootAST leftelement = oper.getChildren().get(0); RootAST rightelement = oper.getChildren().get(1); // 生成一个新的评估器 ExpressionEval eeval = new ExpressionEval(); VarValue leftvar = eeval.eval(leftelement, vartable, classtable); VarValue rightvar = eeval.eval(rightelement, vartable, classtable); if (leftvar == null || rightvar == null) { logger.error("加法计算失败,参数为null"); return null; } if (leftvar.getVartype() == null) { logger.error("程序逻辑错误,左操作对象类型为null"); return null; } if (leftvar.getVartype().equals("int")) { IntegerValue intoper = new IntegerValue(leftvar.getVarsvalue()); boolean b1 = intoper.doGreater(rightvar.getVarsvalue()); VarValue varvalue1 = new VarValue(); varvalue1.setVarname(""); varvalue1.setVartype("boolean"); varvalue1.setVarsvalue("" + b1); return varvalue1; } if (leftvar.getVartype().equals("long")) { LongValue longoper = new LongValue(leftvar.getVarsvalue()); // 把第二个节点的字符串传进去 logger.error("Long右面操作数:" + rightvar.getVarsvalue()); boolean b2 = longoper.doGreater(rightvar.getVarsvalue()); VarValue varvalue2 = new VarValue(); varvalue2.setVarname(""); varvalue2.setVartype("boolean"); varvalue2.setVarsvalue("" + b2); return varvalue2; } if (leftvar.getVartype().equals("float")) { FloatValue floatoper = new FloatValue(leftvar.getVarsvalue()); logger.error("Float右面操作数:" + rightvar.getVarsvalue()); boolean b3 = floatoper.doGreater(rightvar.getVarsvalue()); VarValue varvalue3 = new VarValue(); varvalue3.setVarname(""); varvalue3.setVartype("boolean"); varvalue3.setVarsvalue("" + b3); return varvalue3; } if (leftvar.getVartype().equals("double")) { DoubleValue doubleoper = new DoubleValue(leftvar.getVarsvalue()); ; // 把第二个节点的字符串传进去 logger.error("Double右面操作数:" + rightvar.getVarsvalue()); boolean b4 = doubleoper.doGreater(rightvar.getVarsvalue()); VarValue varvalue4 = new VarValue(); varvalue4.setVarname(""); varvalue4.setVartype("boolean"); varvalue4.setVarsvalue("" + b4); return varvalue4; } logger.error("【ERROR】GE操作遇到了不支持的数据类型:" + leftvar.getVartype()); return null; } } return null; } }
[ "liujunsong@aliyun.com" ]
liujunsong@aliyun.com
dee264903c1108cfe8bab11b88023ba171a82a0d
ad3e9fa6e6f580d6f8179c32c7963e053dda477a
/sql-template/src/main/java/ru/rosbank/javaschool/util/SQLTemplate.java
a5b83a75beaff8b5f695840af2394900b7932517
[]
no_license
ChronTan/multimodule-starter
1254143ec4b597297a3525a1141eaac11a9f5962
cde115d381e6c4cb1227725f2b2de12463f37759
refs/heads/master
2023-05-28T15:22:56.726928
2019-11-20T17:49:01
2019-11-20T17:49:01
222,992,223
0
0
null
2023-05-23T20:12:21
2019-11-20T17:32:08
Java
UTF-8
Java
false
false
5,395
java
package ru.rosbank.javaschool.util; import javax.sql.DataSource; import java.sql.*; import java.util.LinkedList; import java.util.List; import java.util.Optional; public class SQLTemplate { public <T> List<T> queryForList(DataSource dataSource, String query, RowMapper<T> mapper) throws SQLException { // нужно cast'ить, т.к. в противном случае компилятор не догадается, какой из методов мы вызваем return execute(dataSource, query, (Executable<List<T>>) resultSet -> { List<T> list = new LinkedList<>(); while (resultSet.next()) { list.add(mapper.map(resultSet)); } return list; }); } public <T> List<T> queryForList(DataSource dataSource, String query, RowMapper<T> mapper, PreparedStatementSetter setter) throws SQLException { return execute(dataSource, query, setter, resultSet -> { List<T> list = new LinkedList<>(); while (resultSet.next()) { list.add(mapper.map(resultSet)); } return list; }); } public <T> Optional<T> queryForObject(DataSource dataSource, String query, RowMapper<T> mapper) throws SQLException { return execute(dataSource, query, (Executable<Optional<T>>) resultSet -> { if (resultSet.next()) { return Optional.of(mapper.map(resultSet)); } return Optional.empty(); }); } public <T> Optional<T> queryForObject(DataSource dataSource, String query, PreparedStatementSetter setter, RowMapper<T> mapper) throws SQLException { return execute(dataSource, query, setter, resultSet -> { if (resultSet.next()) { return Optional.of(mapper.map(resultSet)); } return Optional.empty(); }); } public int update(DataSource dataSource, String query) throws SQLException { return execute(dataSource, query); } public int update(DataSource dataSource, String query, PreparedStatementSetter setter) throws SQLException { // а тут не надо, т.к. он и так видит тип return execute(dataSource, query, setter); } public <T> T updateForId(DataSource dataSource, String query) throws SQLException { return executeWitId(dataSource, query); } public <T> T updateForId(DataSource dataSource, String query, PreparedStatementSetter setter) throws SQLException { return executeWithId(dataSource, query, setter); } private int execute(DataSource dataSource, String query) throws SQLException { try ( Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement(); ) { return statement.executeUpdate(query); } } private int execute(DataSource dataSource, String query, PreparedStatementSetter setter) throws SQLException { try ( Connection connection = dataSource.getConnection(); PreparedStatement statement = setter.set(connection.prepareStatement(query)); ) { return statement.executeUpdate(); } } private <T> T execute(DataSource dataSource, String query, Executable<T> function) throws SQLException { try ( Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(query); ) { return function.execute(resultSet); } } private <T> T execute(DataSource dataSource, String query, PreparedStatementSetter setter, Executable<T> function) throws SQLException { try ( Connection connection = dataSource.getConnection(); PreparedStatement statement = setter.set(connection.prepareStatement(query)); ResultSet resultSet = statement.executeQuery(query); ) { return function.execute(resultSet); } } private <T> T executeWitId(DataSource dataSource, String query) throws SQLException { try ( Connection connection = dataSource.getConnection(); PreparedStatement statement = connection.prepareStatement(query, Statement.RETURN_GENERATED_KEYS); ) { statement.executeUpdate(); ResultSet generatedKeys = statement.getGeneratedKeys(); if (generatedKeys.next()) { return (T) generatedKeys.getObject(1); } throw new SQLException("No keys generated"); } } private <T> T executeWithId(DataSource dataSource, String query, PreparedStatementSetter setter) throws SQLException { try ( Connection connection = dataSource.getConnection(); PreparedStatement statement = setter.set(connection.prepareStatement(query, Statement.RETURN_GENERATED_KEYS)); ) { statement.executeUpdate(); ResultSet generatedKeys = statement.getGeneratedKeys(); if (generatedKeys.next()) { return (T) generatedKeys.getObject(1); } throw new SQLException("No keys generated"); } } }
[ "coursar@gmail.com" ]
coursar@gmail.com
cba82ec65516e6407cb4cb63768dbf81955864dd
5dce6873448f6f3f64f44dfde871b384c5c598b0
/src/expressõesLambda/experienciaComparator/application/MyComparator.java
03c5780aea05d8fd7660c682b4339d34b96e6ae5
[]
no_license
MuriloRibeiroFloripa/projeto-murilo
16d4e782515f14b0893009237291fac9175519d1
fce9e086c5faba312f9dd688eb620e60fc081639
refs/heads/main
2023-05-05T00:47:45.521346
2021-05-21T16:50:15
2021-05-21T16:50:15
357,019,818
0
0
null
null
null
null
ISO-8859-1
Java
false
false
354
java
package expressõesLambda.experienciaComparator.application; import java.util.Comparator; import expressõesLambda.experienciaComparator.entities.Product; public class MyComparator implements Comparator<Product> { @Override public int compare(Product p1, Product p2) { return p1.getName().toUpperCase().compareTo(p2.getName().toUpperCase()); } }
[ "murilo_ribeiro1@estudante.sc.senai.br" ]
murilo_ribeiro1@estudante.sc.senai.br
0dcc982bb064b2fade7245cec50739437c0cd8e9
26b7f30c6640b8017a06786e4a2414ad8a4d71dd
/src/number_of_direct_superinterfaces/i748.java
fe1b959c7caf08bf67b0ba72268d138771a93fd1
[]
no_license
vincentclee/jvm-limits
b72a2f2dcc18caa458f1e77924221d585f23316b
2fd1c26d1f7984ea8163bc103ad14b6d72282281
refs/heads/master
2020-05-18T11:18:41.711400
2014-09-14T04:25:18
2014-09-14T04:25:18
null
0
0
null
null
null
null
UTF-8
Java
false
false
67
java
package number_of_direct_superinterfaces; public interface i748 {}
[ "vincentlee.dolbydigital@yahoo.com" ]
vincentlee.dolbydigital@yahoo.com
f9655c8af641ba351125fd2394b4b412d5613a91
ae69317fab04b9e3144a3c1b6d22a747aaa1f832
/ItzChat/ItzChat/ItzChat/app/src/main/java/com/example/aayushsingh/itzchat/RegisterActivity.java
8e02a549fe23c29b49f8bf331e8e1e44179bb9be
[]
no_license
aayush0208/ChatApp
77caf5722be1c55f23daa5233f48576c3a352a43
b2b9ab4859e55a02f012bd53e4fa520b32ba39e9
refs/heads/master
2021-05-10T22:14:49.980756
2018-01-29T18:32:28
2018-01-29T18:32:28
118,252,320
0
0
null
null
null
null
UTF-8
Java
false
false
4,933
java
package com.example.aayushsingh.itzchat; import android.app.ProgressDialog; import android.content.Intent; import android.support.annotation.NonNull; import android.support.design.widget.TextInputLayout; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.support.v7.widget.Toolbar; import android.text.TextUtils; import android.view.View; import android.widget.Button; import android.widget.ProgressBar; import android.widget.Toast; import com.google.android.gms.tasks.OnCompleteListener; import com.google.android.gms.tasks.Task; import com.google.firebase.auth.AuthResult; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import java.util.HashMap; public class RegisterActivity extends AppCompatActivity { private TextInputLayout reg_name, reg_email, reg_password; private Button bcreate_account; private FirebaseAuth mAuth; private Toolbar register_toolbar; //progress bar private ProgressDialog reg_progressdialog; private DatabaseReference databaseReference; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_register); //toolbar register_toolbar=(Toolbar)findViewById(R.id.register_app_bar); setSupportActionBar(register_toolbar); getSupportActionBar().setTitle("Create Account"); getSupportActionBar().setDisplayHomeAsUpEnabled(true); reg_progressdialog=new ProgressDialog(this); // firebase mAuth = FirebaseAuth.getInstance(); //regsiter activity reg_name = (TextInputLayout) findViewById(R.id.textInput_name); reg_email = (TextInputLayout) findViewById(R.id.textInput_email); reg_password = (TextInputLayout) findViewById(R.id.textInput_password); bcreate_account = (Button) findViewById(R.id.bcreate_account); bcreate_account.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { String name = reg_name.getEditText().getText().toString(); String email = reg_email.getEditText().getText().toString(); String password = reg_password.getEditText().getText().toString(); if (!TextUtils.isEmpty(name)|| !TextUtils.isEmpty(email)|| !TextUtils.isEmpty(password)){ //progressbar reg_progressdialog.setTitle("Registering User"); reg_progressdialog.setMessage("Please wait while we create your account!"); reg_progressdialog.setCanceledOnTouchOutside(false); reg_progressdialog.show(); register_user(name, email, password); } } }); } //Get the user name ,email and password to create a database private void register_user(final String name, String email, String password) { mAuth.createUserWithEmailAndPassword(email, password).addOnCompleteListener(RegisterActivity.this, new OnCompleteListener<AuthResult>() { @Override public void onComplete(@NonNull Task<AuthResult> task) { if (task.isSuccessful()) { FirebaseUser current_user=FirebaseAuth.getInstance().getCurrentUser(); String uid=current_user.getUid(); databaseReference=FirebaseDatabase.getInstance().getReference().child("Users").child(uid); HashMap<String,String> userMap=new HashMap<>(); userMap.put("name",name); userMap.put("status","Hi there! I'm using ItzChat"); userMap.put("image","default"); userMap.put("thumb_image","default"); databaseReference.setValue(userMap).addOnCompleteListener(new OnCompleteListener<Void>() { @Override public void onComplete(@NonNull Task<Void> task) { if (task.isSuccessful()){ reg_progressdialog.dismiss(); Intent mainIntent = new Intent(RegisterActivity.this, MainActivity.class); mainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK |Intent.FLAG_ACTIVITY_CLEAR_TASK); startActivity(mainIntent); finish(); } } }); } else { reg_progressdialog.hide(); Toast.makeText(RegisterActivity.this, "Can't Sign In.Please try again!", Toast.LENGTH_LONG).show(); } } }); } }
[ "aayush0208@users.noreply.github.com" ]
aayush0208@users.noreply.github.com
701c6152009ef76536cf2f97c7fb799a37f3a871
e2ed2e75083c57c06b27d013f7c837ad5cf2edec
/app/src/main/java/com/example/ggxiaozhi/yotucomponent/manager/DialogManager.java
5b78ab269ad51113856e2d07dfdf6850b1dc7609
[ "Apache-2.0" ]
permissive
guzhigang001/YotuComponent
6fa785d43718eb433efdec4ae61f10de0cdd88bf
e819fb5945a6ac258ad0e5e5b4770842914a8120
refs/heads/master
2021-05-15T13:30:10.488897
2017-11-03T05:08:26
2017-11-03T05:08:26
106,413,011
3
0
null
null
null
null
UTF-8
Java
false
false
1,098
java
package com.example.ggxiaozhi.yotucomponent.manager; import android.app.ProgressDialog; import android.content.Context; import com.example.ggxiaozhi.yotucomponent.R; /** * Created by renzhiqiang on 16/8/15. */ public class DialogManager { private static DialogManager mInstnce = null; private ProgressDialog mDialog; public static DialogManager getInstnce() { if (mInstnce == null) { synchronized (DialogManager.class) { if (mInstnce == null) { mInstnce = new DialogManager(); } } } return mInstnce; } public void showProgressDialog(Context context) { if (mDialog == null) { mDialog = new ProgressDialog(context); mDialog.setMessage(context.getResources().getString(R.string.please_wait)); mDialog.setCanceledOnTouchOutside(false); } mDialog.show(); } public void dismissProgressDialog() { if (mDialog != null) { mDialog.dismiss(); } mDialog = null; } }
[ "22830154@qq.com" ]
22830154@qq.com
0aed1cd87f0502081f1d91db3d12ac55e9000390
951a2cebfb3b742a0b9da0dee787f4610505292c
/toq/Misc/JavaSrc/org/apache/log4j/pattern/ThreadPatternConverter.java
e99b2b98e2019d94e97f57a917d29b9da8ac01fc
[]
no_license
marciallus/mytoqmanager
eca30683508878b712e9c1c6642f39f34c2e257b
65fe1d54e8593900262d5b263d75feb646c015e6
refs/heads/master
2020-05-17T01:03:44.121469
2014-12-10T07:22:14
2014-12-10T07:22:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
863
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) fieldsfirst noctor space package org.apache.log4j.pattern; import org.apache.log4j.spi.LoggingEvent; // Referenced classes of package org.apache.log4j.pattern: // LoggingEventPatternConverter public class ThreadPatternConverter extends LoggingEventPatternConverter { private static final ThreadPatternConverter INSTANCE = new ThreadPatternConverter(); private ThreadPatternConverter() { super("Thread", "thread"); } public static ThreadPatternConverter newInstance(String as[]) { return INSTANCE; } public void format(LoggingEvent loggingevent, StringBuffer stringbuffer) { stringbuffer.append(loggingevent.getThreadName()); } }
[ "marc.lanouiller@gmail.com" ]
marc.lanouiller@gmail.com
d080b7033df269d31172374f1ead42b7e4783c5c
72011e1f9dbf8acccfc07d9c1d4f214960dfec2b
/.metadata/.plugins/org.eclipse.core.resources/.history/59/30c07788a9a3001810e6805a3eece7a0
0430b3514cf4ecd2c06f2823ca2a72e2f1604d7f
[]
no_license
ManavDawar/JavaDataStructures
ad04fe0ed15804d04c3e2792f652f339a996c210
e8d1b71f9a74ae4cd7b0a655480f386c52b5b7d8
refs/heads/master
2020-03-29T11:43:45.072558
2018-09-29T10:24:14
2018-09-29T10:24:14
149,867,583
0
2
null
2019-10-20T22:37:34
2018-09-22T10:40:58
Java
UTF-8
Java
false
false
208
package test; public class HelloWorld { public static void main(String[] args) { int p =1000; int r = 10; int t = 2; int si = p*r*t/100; System.out.println("Simple Interest is "+si); } }
[ "manavdawar5@gmail.com" ]
manavdawar5@gmail.com
b51d458db2767cbee62c8dc4a51b3609a0d01293
d00619bf5c66177cc6a6cb2843f67de8a882a5e7
/VRU_Automate_SCAFramework_Segment/src/com/ibm/ivr/eus/handler/VRU_Automate.java
2c42c9954ea360f2443d136f2731dad2d3774df1
[]
no_license
gmarrufo/VRU_Automate_SCAFramework_Segment
c325efad7c344f6b6d17f4b027c7e4f235531340
0ddfb87e8cc454593f128f41b22fe9d5bf6eec73
refs/heads/master
2021-08-14T15:24:51.889348
2017-11-16T03:51:43
2017-11-16T03:51:43
110,920,298
0
0
null
null
null
null
UTF-8
Java
false
false
9,197
java
/* * Created on 30 Nov 2010 * */ package com.ibm.ivr.eus.handler; import java.io.IOException; import javax.servlet.Servlet; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import com.ibm.ivr.eus.websv.Socket_Connection; import org.apache.log4j.Logger; /** * @author McDonley * */ /************************************************************************ * - VRU_AUTOMATE - * * Handler called by IBMHELP sub-menus to process automation * * using Socket connection * * Parameters needing to be defined in session include: * * - automation_port * * - automation_server * * - automation_timeout * * - automation_string * * - serial * * - serial_cc * * - automation_rc - returned * * - automation_status - returned * * - automation_data - returned * * - stopwatch_time - returned * * * NOT IMPLEMENTED * * Optional Failover ports * * - automation_port.0 Set this paramter to and positive integer * * greater than 2 to enable automated failover * * to additional ports. * * - automation_port.X "Where is the 1 to t the value set in * * automation_port.0 but stem value is set to * * port to be used in order." * ************************************************************************/ public class VRU_Automate extends HttpServlet implements Servlet{ private static final long serialVersionUID = 1L; @SuppressWarnings("unused") private static final String fileversion = " %1.14% "; private static Logger LOGGER = Logger.getLogger(VRU_Automate.class); public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { // get session from Servlet request, created if not existed yet HttpSession session = req.getSession(true); String callid = (String) session.getAttribute("callid"); boolean testCall = ((Boolean) session.getAttribute("testCall")).booleanValue(); //create the log Token for later use, use StringBuffer to reduce number // of String objects String logToken = new StringBuffer("[").append(callid).append("] ").toString(); if (testCall) LOGGER.debug(new StringBuffer(logToken).append("Entering VRU_Automate handler")); // GMC - 01/24/12 - Addition because of MACYS - Discussed with Brian Irvin String automation_password=""; // Get attributes from the request String automation_data = (String) session.getAttribute("automation_data"); String automation_port = (String) session.getAttribute("automation_port"); String automation_rc = (String) session.getAttribute("automation_rc"); String automation_server = (String) session.getAttribute("automation_server"); String automation_status = (String) session.getAttribute("automation_status"); String automation_string = (String) session.getAttribute("automation_string"); String automation_timeout = (String) session.getAttribute("automation_timeout"); String serial = (String) session.getAttribute("serial"); String serial_cc = (String) session.getAttribute("serial_cc"); String strRequest = null; String strResponse = null; Socket_Connection sc = null; int iAutomation_port; int iAutomation_timeout; long startTime = System.currentTimeMillis(); // Debug Logging if (testCall){ LOGGER.info(new StringBuffer(logToken).append("automation_data = ").append(automation_data)); LOGGER.info(new StringBuffer(logToken).append("automation_port = ").append(automation_port)); LOGGER.info(new StringBuffer(logToken).append("automation_rc = ").append(automation_rc)); LOGGER.info(new StringBuffer(logToken).append("automation_server = ").append(automation_server)); LOGGER.info(new StringBuffer(logToken).append("automation_status = ").append(automation_status)); LOGGER.info(new StringBuffer(logToken).append("automation_string = ").append(automation_string)); LOGGER.info(new StringBuffer(logToken).append("serial = ").append(serial)); LOGGER.info(new StringBuffer(logToken).append("serial_cc = ").append(serial_cc)); LOGGER.info(new StringBuffer(logToken).append("automation_timeout = ").append(automation_timeout)); } automation_rc = null; if (automation_port != null) { iAutomation_port = Integer.parseInt(automation_port); } else { iAutomation_port = 9999; } if (automation_timeout != null) { iAutomation_timeout = Integer.parseInt(automation_timeout); } else { iAutomation_timeout = 60; } // if automation_string is null or empty or default then set return code if ((automation_string == null) || automation_string.length() == 0 || (automation_string.equals("AUTOMATION_STRING"))) { automation_data = "RC=53|Missing Automation_String"; automation_rc = "53"; automation_status = "Missing Automation_String"; } else { strRequest= automation_string; strResponse = null; // in test mode can set session variable automation_test to "true" // session variable automation_test_data is parsed to get the returned values String automation_test = (String) session.getAttribute("automation_test"); if(automation_test == null || !automation_test.equalsIgnoreCase("true")) { sc = new Socket_Connection(); strResponse = sc.vru_automate(automation_server,iAutomation_port,strRequest,iAutomation_timeout, testCall, callid); } else { strResponse = (String) session.getAttribute("automation_test_data"); if (testCall) LOGGER.info(new StringBuffer(logToken).append("automation_test is true, using automation_test_data = ").append(strResponse)); } //RSA att global, UM voicemail, // sim RSAPW Reset SUCCESS //strResponse = "RC=0,PASSWORD=NewPassword"; // sim VMPW Reset SUCCESS //strResponse = "RC=0,(Successful,HOSTPASSWORD,Application=HOSTUSA,Serial=653006,Country=897)"; // sim VMPW Reset FAIL //strResponse = "RC=100,CAUSE=(GetBluePagesFailed,HOSTPASSWORD,Application=HOSTUSA,Serial=653006,Country=xxx)"; //strResponse = "RC=200,CAUSE=(NoIdLocated,HOSTPASSWORD,Application=HOSTUSA,Serial=653006,Country=897)"; automation_data = strResponse; if (strResponse != null && strResponse.length() >= 4) { int iRC = strResponse.indexOf("RC="); int iComma=strResponse.indexOf(","); if (iComma != -1) { automation_rc = strResponse.substring(iRC+3,iComma); } else if (iRC != -1) { // GMC - 01/24/12 - Addition because of MACYS - Discussed with Brian Irvin // GMC - 01/24/12 - Only RC=xxx , nothing else - THERE IS A DIFFERENCE BECAUSE OF MACYS - int iPole=strResponse.indexOf("|"); if(iPole != -1){ automation_rc = strResponse.substring(iRC+3,iPole); String[] strTemp = strResponse.split("="); automation_password = strTemp[2]; }else{ // GMC - 01/24/12 - Addition because of MACYS - Discussed with Brian Irvin // Now for sure - ONLY RC=XXX, nothing else automation_rc = strResponse.substring(iRC+3); } } } else { automation_rc = new String("99"); } } // Set session variables needed for reply session.setAttribute("automation_rc", automation_rc); session.setAttribute("automation_status", automation_status); session.setAttribute("automation_data", automation_data); // GMC - 01/24/12 - Addition because of MACYS - Discussed with Brian Irvin session.setAttribute("automation_password", automation_password); long endTime = System.currentTimeMillis(); Float seconds = (endTime - startTime) / 1000F; session.setAttribute("stopwatch_time", seconds.toString()); // Set session variables needed for reply if (testCall) { LOGGER.info(new StringBuffer(logToken).append("returning automation_rc:").append(automation_rc)); LOGGER.info(new StringBuffer(logToken).append("returning automation_status:").append(automation_status)); LOGGER.info(new StringBuffer(logToken).append("returning automation_data:").append(automation_data)); LOGGER.info(new StringBuffer(logToken).append("returning stopwatch_time:").append(seconds.toString())); LOGGER.info(new StringBuffer(logToken).append("Leaving VRU_Automate handler")); } return; } }
[ "gmarrufo@gmdsconsulting.com" ]
gmarrufo@gmdsconsulting.com
a348166f068ddcd72a7f8661cb595520686714c4
87d38fbfea31f23054aef81ef981864188dc0609
/app/src/main/java/com/deepak/posts/ui/base/BaseViewModel.java
83a6ffd5d6b5e0e1f80b5674fc8e480287e9693e
[]
no_license
deepaksachdeva/VideoPosts
bcad7ff15e0dc2ccc95274c6f6220aa1c4d19d95
d12381d5cf60a9153ac5ae111883b8b42bd78c78
refs/heads/master
2020-03-27T21:14:07.992251
2018-09-02T22:37:19
2018-09-02T22:37:19
147,126,794
0
0
null
null
null
null
UTF-8
Java
false
false
613
java
package com.deepak.posts.ui.base; import android.arch.lifecycle.ViewModel; import java.lang.ref.WeakReference; /** * Module of SplashActivity * Created by deepak sachdeva on 14/08/17. * * version 1.0 */ public abstract class BaseViewModel<N> extends ViewModel { private WeakReference<N> mNavigator; public BaseViewModel() { } @Override protected void onCleared() { super.onCleared(); } protected N getNavigator() { return mNavigator.get(); } public void setNavigator(N navigator) { this.mNavigator = new WeakReference<>(navigator); } }
[ "deepak.sachdeva@trantorinc.com" ]
deepak.sachdeva@trantorinc.com
e44ab60268d65982657ead691a84ead6008e2de4
64facd8d925908aae1367b8ed9a8f74eca4b7b16
/microservices/composite/revenue-composite-service/src/main/java/de/hawhamburg/microservices/composite/revenue/service/RevenueCompositeIntegration.java
0ae8a241451eac927f46a3b00a6b25dadeeecae5
[]
no_license
liksita/AI
9fd9e475d2b6a7654005477fb5c040c6da095072
67d61f541e56de74d7ae18d326de352f9e245476
refs/heads/master
2021-01-10T08:43:07.967274
2015-11-11T11:20:00
2015-11-11T11:20:00
45,780,962
0
0
null
null
null
null
UTF-8
Java
false
false
4,060
java
package de.hawhamburg.microservices.composite.revenue.service; import de.hawhamburg.microservices.composite.price.model.CalculatedPrice; import de.hawhamburg.microservices.composite.revenue.util.ResponseHelper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.web.client.RestTemplate; import se.callista.microservices.util.ServiceUtils; import java.util.UUID; /** * Created by Ole on 07.11.2015. */ @Service public class RevenueCompositeIntegration { @Autowired private ServiceUtils utils; @Autowired private LoadBalancerClient loadBalancer; @Autowired private RestTemplate restTemplate; //OF TODO add @HystrixCommand(fallbackMethod = "defaultPrice") public ResponseEntity<CalculatedPrice> getCalculatedPrice(UUID flightID){ //OF TODO use this later // URI uri = utils.getServiceUrl("price"); // String url = uri.toString() + "/price/" + flightID; //OF TODO remove this later! String urlToPriceService = "http://localhost:8081"; String url =urlToPriceService + "/price/" + flightID; ResponseEntity<String> resultStr = restTemplate.getForEntity(url,String.class); CalculatedPrice calcPrice = ResponseHelper.response2Revenue(resultStr); return utils.createOkResponse(calcPrice); } // // //OF TODO add @HystrixCommand(fallbackMethod = "defaultPrice") // public ResponseEntity<Price> createPrice(Price price){ // //OF TODO use this later //// URI uri = utils.getServiceUrl("price"); //// String url = uri.toString() + "/price"; // // //OF TODO remove this later! // String urlToPriceService = "http://localhost:8080"; // String url =urlToPriceService + "/price"; // ResponseEntity<Price> resultStr = restTemplate.postForEntity(url, price, Price.class); // return utils.createOkResponse(resultStr.getBody()); // } // // //OF TODO add @HystrixCommand(fallbackMethod = "defaultPrice") // public ResponseEntity<Price> deletePrice(Price price){ // //OF TODO implement // //OF TODO use this later //// URI uri = utils.getServiceUrl("price"); //// String url = uri.toString() + "/price"; // // //OF TODO remove this later! // String urlToPriceService = "http://localhost:8080"; // String url =urlToPriceService + "/price"; // ResponseEntity<Price> resultStr = restTemplate.postForEntity(url, price, Price.class); // return utils.createOkResponse(resultStr.getBody()); // } // // //OF TODO add @HystrixCommand(fallbackMethod = "defaultPrice") // public ResponseEntity<Price> patchPrice(Price price){ // //OF TODO use this later //// URI uri = utils.getServiceUrl("price"); //// String url = uri.toString() + "/price"; // // //OF TODO remove this later! // String urlToPriceService = "http://localhost:8080"; // String url =urlToPriceService + "/price"; // ResponseEntity<Price> resultStr = restTemplate.postForEntity(url, price, Price.class); // return utils.createOkResponse(resultStr.getBody()); // } // // //OF TODO add @HystrixCommand(fallbackMethod = "defaultPrice") // public ResponseEntity<Price> putPrice(Price price){ // //OF TODO use this later //// URI uri = utils.getServiceUrl("price"); //// String url = uri.toString() + "/price"; // // //OF TODO remove this later! // String urlToPriceService = "http://localhost:8080"; // String url =urlToPriceService + "/price"; // ResponseEntity<Price> resultStr = restTemplate.postForEntity(url, price, Price.class); // return utils.createOkResponse(resultStr.getBody()); // } // // public ResponseEntity<Price> defaultProduct(UUID flightId) { // return utils.createResponse(null, HttpStatus.BAD_GATEWAY); // } }
[ "sebastian.ewert@googlemail.com" ]
sebastian.ewert@googlemail.com
7c7f7e52b81e415ee907df9472dbdb06f5d7dbdb
4ad80da425e767ee9858d0a5211cd1fe0f3925ae
/rsocket-test/src/main/java/io/rsocket/test/BaseClientServerTest.java
5dfa0ad04c842e41b4c86fe238432bb20b8e3348
[ "Apache-2.0" ]
permissive
phoad/rsocket-java
a4131b4a564c2a37a1ad5a2c3aa2fbcb543d8e6c
0bacf8546962f3cd9f95be0a9e6fa8ea31fbf19f
refs/heads/1.0.x
2020-12-30T11:39:31.888587
2017-06-26T19:20:03
2017-06-26T19:20:03
91,509,410
0
0
null
2017-05-16T22:18:47
2017-05-16T22:18:46
null
UTF-8
Java
false
false
5,039
java
/* * Copyright 2016 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.rsocket.test; import static org.junit.Assert.assertEquals; import io.rsocket.Payload; import io.rsocket.util.PayloadImpl; import java.nio.charset.StandardCharsets; import org.junit.Rule; import org.junit.Test; import reactor.core.publisher.Flux; public abstract class BaseClientServerTest<T extends ClientSetupRule<?, ?>> { @Rule public final T setup = createClientServer(); protected abstract T createClientServer(); @Test(timeout = 10000) public void testFireNForget10() { long outputCount = Flux.range(1, 10) .flatMap(i -> setup.getRSocket().fireAndForget(new PayloadImpl("hello", "metadata"))) .doOnError(Throwable::printStackTrace) .count() .block(); assertEquals(0, outputCount); } @Test(timeout = 10000) public void testPushMetadata10() { long outputCount = Flux.range(1, 10) .flatMap(i -> setup.getRSocket().metadataPush(new PayloadImpl("", "metadata"))) .doOnError(Throwable::printStackTrace) .count() .block(); assertEquals(0, outputCount); } @Test(timeout = 10000) public void testRequestResponse1() { long outputCount = Flux.range(1, 1) .flatMap( i -> setup .getRSocket() .requestResponse(new PayloadImpl("hello", "metadata")) .map( payload -> StandardCharsets.UTF_8.decode(payload.getData()).toString())) .doOnError(Throwable::printStackTrace) .count() .block(); assertEquals(1, outputCount); } @Test(timeout = 10000) public void testRequestResponse10() { long outputCount = Flux.range(1, 10) .flatMap( i -> setup .getRSocket() .requestResponse(new PayloadImpl("hello", "metadata")) .map( payload -> StandardCharsets.UTF_8.decode(payload.getData()).toString())) .doOnError(Throwable::printStackTrace) .count() .block(); assertEquals(10, outputCount); } @Test(timeout = 10000) public void testRequestResponse100() { long outputCount = Flux.range(1, 100) .flatMap( i -> setup .getRSocket() .requestResponse(new PayloadImpl("hello", "metadata")) .map( payload -> StandardCharsets.UTF_8.decode(payload.getData()).toString())) .doOnError(Throwable::printStackTrace) .count() .block(); assertEquals(100, outputCount); } @Test(timeout = 20000) public void testRequestResponse10_000() { long outputCount = Flux.range(1, 10_000) .flatMap( i -> setup .getRSocket() .requestResponse(new PayloadImpl("hello", "metadata")) .map( payload -> StandardCharsets.UTF_8.decode(payload.getData()).toString())) .doOnError(Throwable::printStackTrace) .count() .block(); assertEquals(10_000, outputCount); } @Test(timeout = 10000) public void testRequestStream() { Flux<Payload> publisher = setup.getRSocket().requestStream(new PayloadImpl("hello", "metadata")); long count = publisher.take(5).count().block(); assertEquals(5, count); } @Test(timeout = 10000) public void testRequestStreamWithRequestN() { CountdownBaseSubscriber ts = new CountdownBaseSubscriber(); ts.expect(5); setup.getRSocket().requestStream(new PayloadImpl("hello", "metadata")).subscribe(ts); ts.await(); assertEquals(5, ts.count()); ts.expect(5); ts.await(); ts.cancel(); assertEquals(10, ts.count()); } @Test(timeout = 10000) public void testRequestStreamWithDelayedRequestN() { CountdownBaseSubscriber ts = new CountdownBaseSubscriber(); setup.getRSocket().requestStream(new PayloadImpl("hello", "metadata")).subscribe(ts); ts.expect(5); ts.await(); assertEquals(5, ts.count()); ts.expect(5); ts.await(); ts.cancel(); assertEquals(10, ts.count()); } }
[ "noreply@github.com" ]
phoad.noreply@github.com
e24544817157903f18da6b693312fd4155bc16c9
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/19/19_59df3e5fd25aac4a7f81fd22e04743d71530df7d/ChecksumExtractor/19_59df3e5fd25aac4a7f81fd22e04743d71530df7d_ChecksumExtractor_s.java
7cad54d3cae97d244bc2da7cf248f6a50bee5520
[]
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
7,011
java
/* * #%L * Bitrepository Reference Pillar * %% * Copyright (C) 2010 - 2012 The State and University Library, The Royal Library and The State Archives, Denmark * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 2.1 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Lesser Public License for more details. * * You should have received a copy of the GNU General Lesser Public * License along with this program. If not, see * <http://www.gnu.org/licenses/lgpl-2.1.html>. * #L% */ package org.bitrepository.pillar.cache.database; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; import java.util.Date; import java.util.List; import org.bitrepository.service.database.DBConnector; import org.bitrepository.service.database.DatabaseUtils; import org.bitrepository.pillar.cache.ChecksumEntry; import static org.bitrepository.pillar.cache.database.DatabaseConstants.CHECKSUM_TABLE; import static org.bitrepository.pillar.cache.database.DatabaseConstants.CS_CHECKSUM; import static org.bitrepository.pillar.cache.database.DatabaseConstants.CS_DATE; import static org.bitrepository.pillar.cache.database.DatabaseConstants.CS_FILE_ID; /** * Extracts data from the checksum database. */ public class ChecksumExtractor { /** The connector for the database.*/ private final DBConnector connector; /** * Constructor. * @param connector The connector for the database. */ public ChecksumExtractor(DBConnector connector) { this.connector = connector; } /** * Extracts the date for a given file. * @param fileId The id of the file to extract the date for. * @return The date for the given file. */ public Date extractDateForFile(String fileId) { String sql = "SELECT " + CS_DATE + " FROM " + CHECKSUM_TABLE + " WHERE " + CS_FILE_ID + " = ?"; return DatabaseUtils.selectDateValue(connector, sql, fileId); } /** * Extracts the checksum for a given file. * @param fileId The id of the file to extract the checksum for. * @return The checksum for the given file. */ public String extractChecksumForFile(String fileId) { String sql = "SELECT " + CS_CHECKSUM + " FROM " + CHECKSUM_TABLE + " WHERE " + CS_FILE_ID + " = ?"; return DatabaseUtils.selectStringValue(connector, sql, fileId); } /** * Extracts whether a given file exists. * @param fileId The id of the file to extract whose existence is in question. * @return Whether the given file exists. */ public boolean hasFile(String fileId) { String sql = "SELECT COUNT(*) FROM " + CHECKSUM_TABLE + " WHERE " + CS_FILE_ID + " = ?"; return DatabaseUtils.selectIntValue(connector, sql, fileId) != 0; } /** * Extracts all the file ids in the table. * @return The list of file ids. */ public List<String> getAllFileIDs() { String sql = "SELECT " + CS_FILE_ID + " FROM " + CHECKSUM_TABLE; return DatabaseUtils.selectStringList(connector, sql, new Object[0]); } /** * Extracts the checksum entry for a single file. * @param fileId The id of the file whose checksum entry should be extracted. * @return The checksum entry for the file. */ public ChecksumEntry extractSingleEntry(String fileId) { String sql = "SELECT " + CS_FILE_ID + " , " + CS_CHECKSUM + " , " + CS_DATE + " FROM " + CHECKSUM_TABLE + " WHERE " + CS_FILE_ID + " = ?"; try { PreparedStatement ps = null; ResultSet res = null; Connection conn = null; try { conn = connector.getConnection(); ps = DatabaseUtils.createPreparedStatement(conn, sql, fileId); res = ps.executeQuery(); if(!res.next()) { throw new IllegalStateException("No entry for the file '" + fileId + "'."); } return extractChecksumEntry(res); } finally { if(res != null) { res.close(); } if(ps != null) { ps.close(); } if(conn != null) { conn.close(); } } } catch (SQLException e) { throw new IllegalStateException("Cannot extract the ChecksumEntry for '" + fileId + "'", e); } } /** * Extracts all the checksum entries in the database. * @return The checksum entry for the file. */ public List<ChecksumEntry> extractAllEntries() { String sql = "SELECT " + CS_FILE_ID + " , " + CS_CHECKSUM + " , " + CS_DATE + " FROM " + CHECKSUM_TABLE; try { PreparedStatement ps = null; ResultSet resultSet = null; Connection conn = null; List<ChecksumEntry> res = new ArrayList<ChecksumEntry>(); try { conn = connector.getConnection(); ps = DatabaseUtils.createPreparedStatement(conn, sql, new Object[0]); resultSet = ps.executeQuery(); while(resultSet.next()) { res.add(extractChecksumEntry(resultSet)); } return res; } finally { if(res != null) { resultSet.close(); } if(ps != null) { ps.close(); } if(conn != null) { conn.close(); } } } catch (SQLException e) { throw new IllegalStateException("Cannot extract all the ChecksumEntries", e); } } /** * Extracts a checksum entry from a result set. * The result set needs to have requested the elements in the right order: * - File id. * - Checksum. * - Date. * * @param resSet The resultset from the database. * @return The checksum entry extracted from the result set. */ private ChecksumEntry extractChecksumEntry(ResultSet resSet) throws SQLException { String fileId = resSet.getString(1); String checksum = resSet.getString(2); Date date = resSet.getTimestamp(3); return new ChecksumEntry(fileId, checksum, date); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
87154d83ab40c807f31d7487fa0ccb5fc039b937
c327f4bea4caf9ad360b2a51ee35dde7bca518fd
/android/app/src/debug/java/com/inventory/ReactNativeFlipper.java
0dcbf4995080acb31c9adc5cdf26bdfadc942751
[ "MIT" ]
permissive
jennayey/home-inventory-rn
0a360d67d2909c29190cc327f7754708e0e417b7
e78281345fddc4623d5d362447eb244a8110da06
refs/heads/master
2023-02-06T03:25:51.416855
2020-12-18T16:55:09
2020-12-18T16:55:09
286,075,133
2
0
null
null
null
null
UTF-8
Java
false
false
3,264
java
/** * Copyright (c) Facebook, Inc. and its affiliates. * * <p>This source code is licensed under the MIT license found in the LICENSE file in the root * directory of this source tree. */ package com.inventory; import android.content.Context; import com.facebook.flipper.android.AndroidFlipperClient; import com.facebook.flipper.android.utils.FlipperUtils; import com.facebook.flipper.core.FlipperClient; import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; import com.facebook.flipper.plugins.inspector.DescriptorMapping; import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; import com.facebook.flipper.plugins.react.ReactFlipperPlugin; import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; import com.facebook.react.ReactInstanceManager; import com.facebook.react.bridge.ReactContext; import com.facebook.react.modules.network.NetworkingModule; import okhttp3.OkHttpClient; public class ReactNativeFlipper { public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { if (FlipperUtils.shouldEnableFlipper(context)) { final FlipperClient client = AndroidFlipperClient.getInstance(context); client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); client.addPlugin(new ReactFlipperPlugin()); client.addPlugin(new DatabasesFlipperPlugin(context)); client.addPlugin(new SharedPreferencesFlipperPlugin(context)); client.addPlugin(CrashReporterPlugin.getInstance()); NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); NetworkingModule.setCustomClientBuilder( new NetworkingModule.CustomClientBuilder() { @Override public void apply(OkHttpClient.Builder builder) { builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); } }); client.addPlugin(networkFlipperPlugin); client.start(); // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized // Hence we run if after all native modules have been initialized ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); if (reactContext == null) { reactInstanceManager.addReactInstanceEventListener( new ReactInstanceManager.ReactInstanceEventListener() { @Override public void onReactContextInitialized(ReactContext reactContext) { reactInstanceManager.removeReactInstanceEventListener(this); reactContext.runOnNativeModulesQueueThread( new Runnable() { @Override public void run() { client.addPlugin(new FrescoFlipperPlugin()); } }); } }); } else { client.addPlugin(new FrescoFlipperPlugin()); } } } }
[ "jennayey@gmail.com" ]
jennayey@gmail.com
48a8295eaf07619ae66e269aaa5e053b7466832f
0e82c25599316debe4e1e54a3a88f996ff11225b
/v1/code/java/example/src/main/java/jvmgo/book/ch06/Circle.java
54e37460bdff433b1481ca79056bacd6a0219177
[ "MIT" ]
permissive
hiei17/jvmgo-book
c8d524413ec6503a745f7567f416eb3830839cdf
3a272a49acc78944d9a1a5a5941c9d857c3538f8
refs/heads/master
2020-03-28T20:56:33.751103
2019-02-15T07:14:04
2019-02-15T07:14:04
149,115,768
1
0
MIT
2018-10-12T12:49:53
2018-09-17T11:36:54
Go
UTF-8
Java
false
false
336
java
package jvmgo.book.ch06; public class Circle { public static float PI; public float r; public static void main(String[] args) { Circle.PI = 3.14f; Circle c = new Circle(); c.r = 5.5f; float area = Circle.PI * c.r * c.r; System.out.println(area); } }
[ "zhangxiuhong2013@gmail.com" ]
zhangxiuhong2013@gmail.com
48af598bc97da6b8226b61948684b378661b04d4
93caa1d07c219815864873acb9017e56aa2aeb7e
/src/main/java/com/jk/vo/Item.java
1c958e97a5472c3c63ce3451317b60966e325dbd
[]
no_license
ayqayq/freemarker
9b5077a0c10d1f118df7f9013c6ecea9cbc0c5f5
75e0df920af42ba13440d8745ae8b4e1f8b5e15a
refs/heads/master
2020-12-06T20:35:26.210122
2017-06-27T11:20:45
2017-06-27T11:20:45
95,550,336
0
0
null
null
null
null
UTF-8
Java
false
false
3,675
java
package com.jk.vo; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.Date; public class Item implements Serializable{ private static final long serialVersionUID = -8060632046633201825L; private Integer id; private String title; private String sellPoint; private Integer price; private Integer num; private String barcode; private String image; private Integer cid; private Integer status; private Date created; private Date updated; private ItemCat cat; private String sort; private String order; private Integer start; private Integer end; private String showCreated; private String showUpdated; public String getShowCreated() { if(this.created!=null){ SimpleDateFormat sp=new SimpleDateFormat("yyyy-MM-dd"); return sp.format(this.created); } return ""; } public void setShowCreated(String showCreated) { this.showCreated = showCreated; } public String getShowUpdated() { if(this.updated!=null){ SimpleDateFormat sp=new SimpleDateFormat("yyyy-MM-dd HH-mm-ss"); return sp.format(this.updated); } return ""; } public void setShowUpdated(String showUpdated) { this.showUpdated = showUpdated; } public ItemCat getCat() { return cat; } public void setCat(ItemCat cat) { this.cat = cat; } public String getSort() { return sort; } public void setSort(String sort) { this.sort = sort; } public String getOrder() { return order; } public void setOrder(String order) { this.order = order; } public Integer getStart() { return start; } public void setStart(Integer start) { this.start = start; } public Integer getEnd() { return end; } public void setEnd(Integer end) { this.end = end; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title == null ? null : title.trim(); } public String getSellPoint() { return sellPoint; } public void setSellPoint(String sellPoint) { this.sellPoint = sellPoint == null ? null : sellPoint.trim(); } public Integer getPrice() { return price; } public void setPrice(Integer price) { this.price = price; } public Integer getNum() { return num; } public void setNum(Integer num) { this.num = num; } public String getBarcode() { return barcode; } public void setBarcode(String barcode) { this.barcode = barcode == null ? null : barcode.trim(); } public String getImage() { return image; } public void setImage(String image) { this.image = image == null ? null : image.trim(); } public Integer getCid() { return cid; } public void setCid(Integer cid) { this.cid = cid; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public Date getCreated() { return created; } public void setCreated(Date created) { this.created = created; } public Date getUpdated() { return updated; } public void setUpdated(Date updated) { this.updated = updated; } }
[ "934693278@qq.com" ]
934693278@qq.com