blob_id
stringlengths
40
40
__id__
int64
225
39,780B
directory_id
stringlengths
40
40
path
stringlengths
6
313
content_id
stringlengths
40
40
detected_licenses
list
license_type
stringclasses
2 values
repo_name
stringlengths
6
132
repo_url
stringlengths
25
151
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
70
visit_date
timestamp[ns]
revision_date
timestamp[ns]
committer_date
timestamp[ns]
github_id
int64
7.28k
689M
star_events_count
int64
0
131k
fork_events_count
int64
0
48k
gha_license_id
stringclasses
23 values
gha_fork
bool
2 classes
gha_event_created_at
timestamp[ns]
gha_created_at
timestamp[ns]
gha_updated_at
timestamp[ns]
gha_pushed_at
timestamp[ns]
gha_size
int64
0
40.4M
gha_stargazers_count
int32
0
112k
gha_forks_count
int32
0
39.4k
gha_open_issues_count
int32
0
11k
gha_language
stringlengths
1
21
gha_archived
bool
2 classes
gha_disabled
bool
1 class
content
stringlengths
7
4.37M
src_encoding
stringlengths
3
16
language
stringclasses
1 value
length_bytes
int64
7
4.37M
extension
stringclasses
24 values
filename
stringlengths
4
174
language_id
stringclasses
1 value
entities
list
contaminating_dataset
stringclasses
0 values
malware_signatures
list
redacted_content
stringlengths
7
4.37M
redacted_length_bytes
int64
7
4.37M
alphanum_fraction
float32
0.25
0.94
alpha_fraction
float32
0.25
0.94
num_lines
int32
1
84k
avg_line_length
float32
0.76
99.9
std_line_length
float32
0
220
max_line_length
int32
5
998
is_vendor
bool
2 classes
is_generated
bool
1 class
max_hex_length
int32
0
319
hex_fraction
float32
0
0.38
max_unicode_length
int32
0
408
unicode_fraction
float32
0
0.36
max_base64_length
int32
0
506
base64_fraction
float32
0
0.5
avg_csv_sep_count
float32
0
4
is_autogen_header
bool
1 class
is_empty_html
bool
1 class
shard
stringclasses
16 values
696ed4bce4903ade08f8984fdea8682d2f60fdfc
25,125,558,688,290
907a538f2a0e38817d7c2c4619309c102d03532d
/ShadowMapTest/Properties/src/edu/isocial/shadowmap/properties/Properties.java
9a445b57a6170ec2cd9d7a3007712549d068b8a2
[]
no_license
JustinTB/Justin-s-Repo
https://github.com/JustinTB/Justin-s-Repo
cfb055f2f058a75de12f6606de383ba40da621a8
86a1d531e2fba0ff00c77ced1871c1d4b1b19f7f
refs/heads/master
2021-01-20T12:00:15.822000
2012-12-06T15:55:07
2012-12-06T15:55:07
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.isocial.shadowmap.properties; /** * * @author justin */ public class Properties { private float xTranslation; private float yTranslation; private float zTranslation; private float xRotation; private float yRotation; private float zRotation; private float wRotation; public float getyRotation() { return yRotation; } public void setyRotation(float yRotation) { this.yRotation = yRotation; } public Properties() { } public void setScale(float scale) { this.scale = scale; } public void setwRotation(float wRotation) { this.wRotation = wRotation; } public void setxRotation(float xRotation) { this.xRotation = xRotation; } public void setxTranslation(float xTranslation) { this.xTranslation = xTranslation; } public void setyTranslation(float yTranslation) { this.yTranslation = yTranslation; } public void setzRotation(float zRotation) { this.zRotation = zRotation; } public void setzTranslation(float zTranslation) { this.zTranslation = zTranslation; } public float getScale() { return scale; } public float getwRotation() { return wRotation; } public float getxRotation() { return xRotation; } public float getxTranslation() { return xTranslation; } public float getyTranslation() { return yTranslation; } public float getzRotation() { return zRotation; } public float getzTranslation() { return zTranslation; } private float scale; }
UTF-8
Java
1,764
java
Properties.java
Java
[ { "context": "u.isocial.shadowmap.properties;\n\n/**\n *\n * @author justin\n */\npublic class Properties {\n private float x", "end": 167, "score": 0.6752716302871704, "start": 161, "tag": "NAME", "value": "justin" } ]
null
[]
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package edu.isocial.shadowmap.properties; /** * * @author justin */ public class Properties { private float xTranslation; private float yTranslation; private float zTranslation; private float xRotation; private float yRotation; private float zRotation; private float wRotation; public float getyRotation() { return yRotation; } public void setyRotation(float yRotation) { this.yRotation = yRotation; } public Properties() { } public void setScale(float scale) { this.scale = scale; } public void setwRotation(float wRotation) { this.wRotation = wRotation; } public void setxRotation(float xRotation) { this.xRotation = xRotation; } public void setxTranslation(float xTranslation) { this.xTranslation = xTranslation; } public void setyTranslation(float yTranslation) { this.yTranslation = yTranslation; } public void setzRotation(float zRotation) { this.zRotation = zRotation; } public void setzTranslation(float zTranslation) { this.zTranslation = zTranslation; } public float getScale() { return scale; } public float getwRotation() { return wRotation; } public float getxRotation() { return xRotation; } public float getxTranslation() { return xTranslation; } public float getyTranslation() { return yTranslation; } public float getzRotation() { return zRotation; } public float getzTranslation() { return zTranslation; } private float scale; }
1,764
0.637755
0.637755
87
19.275862
17.290413
53
false
false
0
0
0
0
0
0
0.310345
false
false
3
dbe9457fa543d6f2b15b886a5b408439e79f4c4a
30,322,469,118,532
1fb78de3c906363eb1ebe2a596e802ef96ba4593
/compra-22/src/main/java/br/com/gesplan/infrastructure/repository/document/CompraPorClienteDocument.java
76eb380fe8913cd18c045aac526132d03646a896
[]
no_license
seimongrando/gesplan
https://github.com/seimongrando/gesplan
ae12476eded13f73d683d2134056799cce81d82b
93de32a293fc5cfd59ca01bb79db4368dfa9c307
refs/heads/main
2022-12-26T21:45:57.131000
2020-10-14T13:04:50
2020-10-14T13:04:50
303,996,528
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.com.gesplan.infrastructure.repository.document; import org.springframework.data.annotation.Id; import lombok.Data; @Data public class CompraPorClienteDocument { @Id private String cliente; private Double total; }
UTF-8
Java
233
java
CompraPorClienteDocument.java
Java
[]
null
[]
package br.com.gesplan.infrastructure.repository.document; import org.springframework.data.annotation.Id; import lombok.Data; @Data public class CompraPorClienteDocument { @Id private String cliente; private Double total; }
233
0.798283
0.798283
14
15.642858
18.972187
58
false
false
0
0
0
0
0
0
0.642857
false
false
3
89782f1727088dcd4498bd2fa605260f96c4245f
343,597,395,601
4ebf494f5b855e8d14b7aeefc957dd97bf347821
/platir-commons/src/main/java/io/platir/commons/AccountCore.java
8d9ecfc7fecf7462ae8641da097ef0d41f16e26e
[]
no_license
chenhongbao/platir
https://github.com/chenhongbao/platir
ba8cccc114d92feacf067a4e807b13fef2d4b826
7a03b6de40e6f4bf2ce09a09bee8cc82473276c5
refs/heads/main
2023-08-24T00:09:44.712000
2021-10-28T12:20:44
2021-10-28T12:20:44
408,068,978
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package io.platir.commons; import com.google.gson.annotations.Expose; import io.platir.Account; import io.platir.Contract; import io.platir.Strategy; import io.platir.setting.AccountSetting; import java.util.Collection; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; public class AccountCore implements Account { private String accountId; private Double openingMargin; private Double openingCommission; private Double closingCommission; private Double balance; private Double margin; private Double commission; private Double available; private Double positionProfit; private Double closeProfit; private Double ydBalance; private String tradingDay; private String settleDatetime; private String state; private AccountSettingCore accountSetting; private final Map<String, StrategyCore> strategies = new ConcurrentHashMap<>(); private final Map<String, ContractCore> contracts = new ConcurrentHashMap<>(); @Expose(serialize = false, deserialize = false) private UserCore user; private final Object syncObject = new Object(); public Object syncObject() { return syncObject; } @Override public String getState() { return state; } public void setState(String state) { this.state = state; } public AccountSettingCore getAccountSetting() { return accountSetting; } public void setAccountRule(AccountSetting accountSetting) { this.accountSetting = new AccountSettingCore((AccountSettingCore) accountSetting); } @Override public String getAccountId() { return accountId; } public void setAccountId(String accountId) { this.accountId = accountId; } @Override public Double getOpeningMargin() { return openingMargin; } public void setOpeningMargin(Double openingMargin) { this.openingMargin = openingMargin; } @Override public Double getOpeningCommission() { return openingCommission; } public void setOpeningCommission(Double openingCommission) { this.openingCommission = openingCommission; } @Override public Double getClosingCommission() { return closingCommission; } public void setClosingCommission(Double closingCommission) { this.closingCommission = closingCommission; } @Override public Double getBalance() { return balance; } public void setBalance(Double balance) { this.balance = balance; } @Override public Double getMargin() { return margin; } public void setMargin(Double margin) { this.margin = margin; } @Override public Double getCommission() { return commission; } public void setCommission(Double commission) { this.commission = commission; } @Override public Double getAvailable() { return available; } public void setAvailable(Double available) { this.available = available; } @Override public Double getPositionProfit() { return positionProfit; } public void setPositionProfit(Double positionProfit) { this.positionProfit = positionProfit; } @Override public Double getCloseProfit() { return closeProfit; } public void setCloseProfit(Double closeProfit) { this.closeProfit = closeProfit; } @Override public Double getYdBalance() { return ydBalance; } public void setYdBalance(Double ydBalance) { this.ydBalance = ydBalance; } @Override public String getTradingDay() { return tradingDay; } public void setTradingDay(String tradingDay) { this.tradingDay = tradingDay; } @Override public String getSettleDatetime() { return settleDatetime; } public void setSettleDatetime(String datetime) { this.settleDatetime = datetime; } @Override public UserCore getUser() { return user; } @Override public Collection<Strategy> getStrategies() { return strategies.values().stream().map(core -> { return (Strategy) core; }).collect(Collectors.toSet()); } @Override public Collection<Contract> getContracts() { return contracts.values().stream().map(core -> { return (Contract) core; }).collect(Collectors.toSet()); } public Map<String, StrategyCore> strategies() { return strategies; } public Map<String, ContractCore> contracts() { return contracts; } public void setUser(UserCore user) { this.user = user; } }
UTF-8
Java
4,788
java
AccountCore.java
Java
[]
null
[]
package io.platir.commons; import com.google.gson.annotations.Expose; import io.platir.Account; import io.platir.Contract; import io.platir.Strategy; import io.platir.setting.AccountSetting; import java.util.Collection; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; public class AccountCore implements Account { private String accountId; private Double openingMargin; private Double openingCommission; private Double closingCommission; private Double balance; private Double margin; private Double commission; private Double available; private Double positionProfit; private Double closeProfit; private Double ydBalance; private String tradingDay; private String settleDatetime; private String state; private AccountSettingCore accountSetting; private final Map<String, StrategyCore> strategies = new ConcurrentHashMap<>(); private final Map<String, ContractCore> contracts = new ConcurrentHashMap<>(); @Expose(serialize = false, deserialize = false) private UserCore user; private final Object syncObject = new Object(); public Object syncObject() { return syncObject; } @Override public String getState() { return state; } public void setState(String state) { this.state = state; } public AccountSettingCore getAccountSetting() { return accountSetting; } public void setAccountRule(AccountSetting accountSetting) { this.accountSetting = new AccountSettingCore((AccountSettingCore) accountSetting); } @Override public String getAccountId() { return accountId; } public void setAccountId(String accountId) { this.accountId = accountId; } @Override public Double getOpeningMargin() { return openingMargin; } public void setOpeningMargin(Double openingMargin) { this.openingMargin = openingMargin; } @Override public Double getOpeningCommission() { return openingCommission; } public void setOpeningCommission(Double openingCommission) { this.openingCommission = openingCommission; } @Override public Double getClosingCommission() { return closingCommission; } public void setClosingCommission(Double closingCommission) { this.closingCommission = closingCommission; } @Override public Double getBalance() { return balance; } public void setBalance(Double balance) { this.balance = balance; } @Override public Double getMargin() { return margin; } public void setMargin(Double margin) { this.margin = margin; } @Override public Double getCommission() { return commission; } public void setCommission(Double commission) { this.commission = commission; } @Override public Double getAvailable() { return available; } public void setAvailable(Double available) { this.available = available; } @Override public Double getPositionProfit() { return positionProfit; } public void setPositionProfit(Double positionProfit) { this.positionProfit = positionProfit; } @Override public Double getCloseProfit() { return closeProfit; } public void setCloseProfit(Double closeProfit) { this.closeProfit = closeProfit; } @Override public Double getYdBalance() { return ydBalance; } public void setYdBalance(Double ydBalance) { this.ydBalance = ydBalance; } @Override public String getTradingDay() { return tradingDay; } public void setTradingDay(String tradingDay) { this.tradingDay = tradingDay; } @Override public String getSettleDatetime() { return settleDatetime; } public void setSettleDatetime(String datetime) { this.settleDatetime = datetime; } @Override public UserCore getUser() { return user; } @Override public Collection<Strategy> getStrategies() { return strategies.values().stream().map(core -> { return (Strategy) core; }).collect(Collectors.toSet()); } @Override public Collection<Contract> getContracts() { return contracts.values().stream().map(core -> { return (Contract) core; }).collect(Collectors.toSet()); } public Map<String, StrategyCore> strategies() { return strategies; } public Map<String, ContractCore> contracts() { return contracts; } public void setUser(UserCore user) { this.user = user; } }
4,788
0.660819
0.660819
207
22.130434
19.737833
90
false
false
0
0
0
0
0
0
0.352657
false
false
3
3e613b0fe6e351bf2e8e131d92c6b01f7313d387
9,912,784,529,788
2bc73294e35706b7d198101524414671ce841871
/src/vistas/frmPrincipal.java
75a390e7228bf6744696e70814accd8b7bb11699
[]
no_license
YoooBrayan/ACT
https://github.com/YoooBrayan/ACT
e9264e1cb4af4b8d4cf788fb775c287de9d0eda1
54283bc1036328614579a08371d07a9a9e1a4e63
refs/heads/master
2022-12-03T05:32:37.841000
2020-08-28T06:14:17
2020-08-28T06:14:17
290,966,017
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 vistas; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDesktopPane; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JTable; import javax.swing.JTextField; /** * * @author YO */ public class frmPrincipal extends javax.swing.JFrame { /** * Creates new form frmPrincipal */ public frmPrincipal() { initComponents(); //setIconImage(new ImageIcon(getClass().getResource("../img/CONFECCION.png")).getImage()); } public JDesktopPane getJdpEscritorio() { return jdpEscritorio; } public void setJdpEscritorio(JDesktopPane jdpEscritorio) { this.jdpEscritorio = jdpEscritorio; } public JLabel getLblFecha() { return lblFecha; } public void setLblFecha(JLabel lblFecha) { this.lblFecha = lblFecha; } public JMenuBar getMenu() { return Menu; } public void setMenu(JMenuBar Menu) { this.Menu = Menu; } /** * 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() { jdpEscritorio = new javax.swing.JDesktopPane(); jToolBar1 = new javax.swing.JToolBar(); lblFecha = new javax.swing.JLabel(); Menu = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); opmNuevo = new javax.swing.JMenuItem(); opmConsultar = new javax.swing.JMenuItem(); opmAsignarTareas = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); opmNominaC = new javax.swing.JMenuItem(); opmNominaU = new javax.swing.JMenuItem(); jMenu3 = new javax.swing.JMenu(); opmRegProveedor = new javax.swing.JMenuItem(); opmRegOperario = new javax.swing.JMenuItem(); jMenu6 = new javax.swing.JMenu(); opmProveedor = new javax.swing.JMenuItem(); jMenu4 = new javax.swing.JMenu(); opmSalir = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); jdpEscritorio.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 255))); jdpEscritorio.setPreferredSize(new java.awt.Dimension(715, 732)); jToolBar1.setRollover(true); lblFecha.setFont(new java.awt.Font("Perpetua Titling MT", 0, 12)); // NOI18N lblFecha.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102))); jToolBar1.add(lblFecha); jdpEscritorio.setLayer(jToolBar1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout jdpEscritorioLayout = new javax.swing.GroupLayout(jdpEscritorio); jdpEscritorio.setLayout(jdpEscritorioLayout); jdpEscritorioLayout.setHorizontalGroup( jdpEscritorioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jdpEscritorioLayout.createSequentialGroup() .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 598, Short.MAX_VALUE)) ); jdpEscritorioLayout.setVerticalGroup( jdpEscritorioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jdpEscritorioLayout.createSequentialGroup() .addGap(0, 653, Short.MAX_VALUE) .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) ); Menu.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N jMenu1.setText("Corte"); jMenu1.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmNuevo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); opmNuevo.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmNuevo.setText("Nuevo"); opmNuevo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { opmNuevoActionPerformed(evt); } }); jMenu1.add(opmNuevo); opmConsultar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK)); opmConsultar.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmConsultar.setText("Consultar"); jMenu1.add(opmConsultar); opmAsignarTareas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK)); opmAsignarTareas.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmAsignarTareas.setText("Asignar Tareas"); jMenu1.add(opmAsignarTareas); Menu.add(jMenu1); jMenu2.setText("Nomina"); jMenu2.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmNominaC.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmNominaC.setText("Nomina Completa"); opmNominaC.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { opmNominaCActionPerformed(evt); } }); jMenu2.add(opmNominaC); opmNominaU.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmNominaU.setText("Nomina Unica"); jMenu2.add(opmNominaU); Menu.add(jMenu2); jMenu3.setText("Registrar"); jMenu3.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmRegProveedor.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmRegProveedor.setText("Proveedor"); jMenu3.add(opmRegProveedor); opmRegOperario.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmRegOperario.setText("Operario"); jMenu3.add(opmRegOperario); Menu.add(jMenu3); jMenu6.setText("Proveedor"); jMenu6.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmProveedor.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK)); opmProveedor.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmProveedor.setText("Buscar"); jMenu6.add(opmProveedor); Menu.add(jMenu6); jMenu4.setText("Salir"); jMenu4.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmSalir.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmSalir.setText("Salir"); jMenu4.add(opmSalir); Menu.add(jMenu4); setJMenuBar(Menu); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jdpEscritorio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jdpEscritorio, javax.swing.GroupLayout.PREFERRED_SIZE, 680, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void opmNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_opmNuevoActionPerformed // TODO add your handling code here: }//GEN-LAST:event_opmNuevoActionPerformed private void opmNominaCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_opmNominaCActionPerformed // TODO add your handling code here: }//GEN-LAST:event_opmNominaCActionPerformed public JMenuItem getOpmAsignarTareas() { return opmAsignarTareas; } public void setOpmAsignarTareas(JMenuItem opmAsignarTareas) { this.opmAsignarTareas = opmAsignarTareas; } public JMenuItem getOpmConsultar() { return opmConsultar; } public void setOpmConsultar(JMenuItem opmConsultar) { this.opmConsultar = opmConsultar; } public JMenuItem getOpmNominaC() { return opmNominaC; } public void setOpmNominaC(JMenuItem opmNominaC) { this.opmNominaC = opmNominaC; } public JMenuItem getOpmNominaU() { return opmNominaU; } public void setOpmNominaU(JMenuItem opmNominaU) { this.opmNominaU = opmNominaU; } public JMenuItem getOpmNuevo() { return opmNuevo; } public void setOpmNuevo(JMenuItem opmNuevo) { this.opmNuevo = opmNuevo; } public JMenuItem getOpmProveedor() { return opmProveedor; } public void setOpmProveedor(JMenuItem opmProveedor) { this.opmProveedor = opmProveedor; } public JMenuItem getOpmRegOperario() { return opmRegOperario; } public void setOpmRegOperario(JMenuItem opmRegOperario) { this.opmRegOperario = opmRegOperario; } public JMenuItem getOpmRegProveedor() { return opmRegProveedor; } public void setOpmRegProveedor(JMenuItem opmRegProveedor) { this.opmRegProveedor = opmRegProveedor; } public JMenuItem getOpmSalir() { return opmSalir; } public void setOpmSalir(JMenuItem opmSalir) { this.opmSalir = opmSalir; } public JMenu getjMenu6() { return jMenu6; } public void setjMenu6(JMenu jMenu6) { this.jMenu6 = jMenu6; } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuBar Menu; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenu jMenu6; private javax.swing.JToolBar jToolBar1; private javax.swing.JDesktopPane jdpEscritorio; private javax.swing.JLabel lblFecha; private javax.swing.JMenuItem opmAsignarTareas; private javax.swing.JMenuItem opmConsultar; private javax.swing.JMenuItem opmNominaC; private javax.swing.JMenuItem opmNominaU; private javax.swing.JMenuItem opmNuevo; private javax.swing.JMenuItem opmProveedor; private javax.swing.JMenuItem opmRegOperario; private javax.swing.JMenuItem opmRegProveedor; private javax.swing.JMenuItem opmSalir; // End of variables declaration//GEN-END:variables }
UTF-8
Java
11,388
java
frmPrincipal.java
Java
[ { "context": "\nimport javax.swing.JTextField;\n\n/**\n *\n * @author YO\n */\npublic class frmPrincipal extends javax.swi", "end": 484, "score": 0.7928246259689331, "start": 482, "tag": "USERNAME", "value": "YO" } ]
null
[]
/* * 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 vistas; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JDesktopPane; import javax.swing.JLabel; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JTable; import javax.swing.JTextField; /** * * @author YO */ public class frmPrincipal extends javax.swing.JFrame { /** * Creates new form frmPrincipal */ public frmPrincipal() { initComponents(); //setIconImage(new ImageIcon(getClass().getResource("../img/CONFECCION.png")).getImage()); } public JDesktopPane getJdpEscritorio() { return jdpEscritorio; } public void setJdpEscritorio(JDesktopPane jdpEscritorio) { this.jdpEscritorio = jdpEscritorio; } public JLabel getLblFecha() { return lblFecha; } public void setLblFecha(JLabel lblFecha) { this.lblFecha = lblFecha; } public JMenuBar getMenu() { return Menu; } public void setMenu(JMenuBar Menu) { this.Menu = Menu; } /** * 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() { jdpEscritorio = new javax.swing.JDesktopPane(); jToolBar1 = new javax.swing.JToolBar(); lblFecha = new javax.swing.JLabel(); Menu = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); opmNuevo = new javax.swing.JMenuItem(); opmConsultar = new javax.swing.JMenuItem(); opmAsignarTareas = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); opmNominaC = new javax.swing.JMenuItem(); opmNominaU = new javax.swing.JMenuItem(); jMenu3 = new javax.swing.JMenu(); opmRegProveedor = new javax.swing.JMenuItem(); opmRegOperario = new javax.swing.JMenuItem(); jMenu6 = new javax.swing.JMenu(); opmProveedor = new javax.swing.JMenuItem(); jMenu4 = new javax.swing.JMenu(); opmSalir = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); jdpEscritorio.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 255))); jdpEscritorio.setPreferredSize(new java.awt.Dimension(715, 732)); jToolBar1.setRollover(true); lblFecha.setFont(new java.awt.Font("Perpetua Titling MT", 0, 12)); // NOI18N lblFecha.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(102, 102, 102))); jToolBar1.add(lblFecha); jdpEscritorio.setLayer(jToolBar1, javax.swing.JLayeredPane.DEFAULT_LAYER); javax.swing.GroupLayout jdpEscritorioLayout = new javax.swing.GroupLayout(jdpEscritorio); jdpEscritorio.setLayout(jdpEscritorioLayout); jdpEscritorioLayout.setHorizontalGroup( jdpEscritorioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jdpEscritorioLayout.createSequentialGroup() .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 598, Short.MAX_VALUE)) ); jdpEscritorioLayout.setVerticalGroup( jdpEscritorioLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jdpEscritorioLayout.createSequentialGroup() .addGap(0, 653, Short.MAX_VALUE) .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)) ); Menu.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N jMenu1.setText("Corte"); jMenu1.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmNuevo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK)); opmNuevo.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmNuevo.setText("Nuevo"); opmNuevo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { opmNuevoActionPerformed(evt); } }); jMenu1.add(opmNuevo); opmConsultar.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK)); opmConsultar.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmConsultar.setText("Consultar"); jMenu1.add(opmConsultar); opmAsignarTareas.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK)); opmAsignarTareas.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmAsignarTareas.setText("Asignar Tareas"); jMenu1.add(opmAsignarTareas); Menu.add(jMenu1); jMenu2.setText("Nomina"); jMenu2.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmNominaC.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmNominaC.setText("Nomina Completa"); opmNominaC.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { opmNominaCActionPerformed(evt); } }); jMenu2.add(opmNominaC); opmNominaU.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmNominaU.setText("Nomina Unica"); jMenu2.add(opmNominaU); Menu.add(jMenu2); jMenu3.setText("Registrar"); jMenu3.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmRegProveedor.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmRegProveedor.setText("Proveedor"); jMenu3.add(opmRegProveedor); opmRegOperario.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmRegOperario.setText("Operario"); jMenu3.add(opmRegOperario); Menu.add(jMenu3); jMenu6.setText("Proveedor"); jMenu6.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmProveedor.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK)); opmProveedor.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmProveedor.setText("Buscar"); jMenu6.add(opmProveedor); Menu.add(jMenu6); jMenu4.setText("Salir"); jMenu4.setFont(new java.awt.Font("Perpetua Titling MT", 1, 13)); // NOI18N opmSalir.setFont(new java.awt.Font("Perpetua Titling MT", 1, 12)); // NOI18N opmSalir.setText("Salir"); jMenu4.add(opmSalir); Menu.add(jMenu4); setJMenuBar(Menu); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jdpEscritorio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jdpEscritorio, javax.swing.GroupLayout.PREFERRED_SIZE, 680, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, 0)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void opmNuevoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_opmNuevoActionPerformed // TODO add your handling code here: }//GEN-LAST:event_opmNuevoActionPerformed private void opmNominaCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_opmNominaCActionPerformed // TODO add your handling code here: }//GEN-LAST:event_opmNominaCActionPerformed public JMenuItem getOpmAsignarTareas() { return opmAsignarTareas; } public void setOpmAsignarTareas(JMenuItem opmAsignarTareas) { this.opmAsignarTareas = opmAsignarTareas; } public JMenuItem getOpmConsultar() { return opmConsultar; } public void setOpmConsultar(JMenuItem opmConsultar) { this.opmConsultar = opmConsultar; } public JMenuItem getOpmNominaC() { return opmNominaC; } public void setOpmNominaC(JMenuItem opmNominaC) { this.opmNominaC = opmNominaC; } public JMenuItem getOpmNominaU() { return opmNominaU; } public void setOpmNominaU(JMenuItem opmNominaU) { this.opmNominaU = opmNominaU; } public JMenuItem getOpmNuevo() { return opmNuevo; } public void setOpmNuevo(JMenuItem opmNuevo) { this.opmNuevo = opmNuevo; } public JMenuItem getOpmProveedor() { return opmProveedor; } public void setOpmProveedor(JMenuItem opmProveedor) { this.opmProveedor = opmProveedor; } public JMenuItem getOpmRegOperario() { return opmRegOperario; } public void setOpmRegOperario(JMenuItem opmRegOperario) { this.opmRegOperario = opmRegOperario; } public JMenuItem getOpmRegProveedor() { return opmRegProveedor; } public void setOpmRegProveedor(JMenuItem opmRegProveedor) { this.opmRegProveedor = opmRegProveedor; } public JMenuItem getOpmSalir() { return opmSalir; } public void setOpmSalir(JMenuItem opmSalir) { this.opmSalir = opmSalir; } public JMenu getjMenu6() { return jMenu6; } public void setjMenu6(JMenu jMenu6) { this.jMenu6 = jMenu6; } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JMenuBar Menu; private javax.swing.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenu jMenu6; private javax.swing.JToolBar jToolBar1; private javax.swing.JDesktopPane jdpEscritorio; private javax.swing.JLabel lblFecha; private javax.swing.JMenuItem opmAsignarTareas; private javax.swing.JMenuItem opmConsultar; private javax.swing.JMenuItem opmNominaC; private javax.swing.JMenuItem opmNominaU; private javax.swing.JMenuItem opmNuevo; private javax.swing.JMenuItem opmProveedor; private javax.swing.JMenuItem opmRegOperario; private javax.swing.JMenuItem opmRegProveedor; private javax.swing.JMenuItem opmSalir; // End of variables declaration//GEN-END:variables }
11,388
0.674833
0.659905
321
34.476635
32.192669
143
false
false
0
0
0
0
0
0
0.64486
false
false
3
d6d3007fc79edfa76563c987e50520ff83c527a0
31,765,578,134,687
f2ea2865b583af1ab8e47feb62fc6af93c6d471c
/capa-adapter/src/main/java/group/rxcloud/capa/addons/adapter/package-info.java
3ea33aab3bcf155a317aff0194e99d74a1737b62
[]
no_license
Huijing-Xu/capa-addons
https://github.com/Huijing-Xu/capa-addons
cd9f63903fcfa9f1b86c5140270aadd6d629322c
c48670474526504d683e8e48a28b2b69cc743716
refs/heads/master
2023-08-13T07:33:44.573000
2021-09-27T13:03:28
2021-09-27T13:03:28
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * @apiNote https://github.com/spring-projects/spring-framework/tree/main/spring-core/src/main/java/org/springframework/util/concurrent */ package group.rxcloud.capa.addons.adapter;
UTF-8
Java
186
java
package-info.java
Java
[ { "context": "/**\n * @apiNote https://github.com/spring-projects/spring-framework/tree/main/spring-core/src/main/j", "end": 50, "score": 0.9992830157279968, "start": 35, "tag": "USERNAME", "value": "spring-projects" } ]
null
[]
/** * @apiNote https://github.com/spring-projects/spring-framework/tree/main/spring-core/src/main/java/org/springframework/util/concurrent */ package group.rxcloud.capa.addons.adapter;
186
0.790323
0.790323
4
45.75
53.932251
135
false
false
0
0
0
0
0
0
0.25
false
false
3
0e53bec3e7ebb9f6cca5633565ad014946aa2f42
1,322,849,941,826
a67323d29a31de370b3caa84b636f0e3e7b55270
/src/main/java/api/Module.java
e143b7eb8a4cfaa418c0f9fe54465451d98c3652
[]
no_license
technostar98/TCBot-Core
https://github.com/technostar98/TCBot-Core
dd4cb17b61189b4637f39514fa380d05317de872
44ff0598790f4a7fb633979cd8cf5a1815cedec0
refs/heads/master
2021-01-20T15:38:56.939000
2015-07-20T02:02:23
2015-07-20T02:02:23
31,696,786
3
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package api; import java.lang.annotation.*; /** * <p>Used to indicate a module's main class that will be used to load up stuff from the module. * Once a class with this has been found, any methods annotated with {@link AssetLoader} will be called.</p> * * <p>Created by Bret 'Horfius' Dusseault in 2015. * All code in this file is open-source and * may be used with permission of Bret Dusseault. * Any violations of this violate the terms of * the license of TCBot-Core.</p> * * @author Bret 'Horfius' Dusseault */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE_USE) @Inherited @Documented public @interface Module { /** * The name of a module * @return */ String name(); /** * The version of a module * @return an integer version */ int version(); /** * ID of a module, which should be static * @return */ String id(); }
UTF-8
Java
920
java
Module.java
Java
[ { "context": "setLoader} will be called.</p>\n *\n * <p>Created by Bret 'Horfius' Dusseault in 2015.\n * All code in this ", "end": 280, "score": 0.9997953176498413, "start": 276, "tag": "NAME", "value": "Bret" }, { "context": "er} will be called.</p>\n *\n * <p>Created by Bret 'Horfius' Dusseault in 2015.\n * All code in this file is o", "end": 289, "score": 0.9982320666313171, "start": 282, "tag": "NAME", "value": "Horfius" }, { "context": " be called.</p>\n *\n * <p>Created by Bret 'Horfius' Dusseault in 2015.\n * All code in this file is open-source ", "end": 300, "score": 0.9885285496711731, "start": 291, "tag": "NAME", "value": "Dusseault" }, { "context": " open-source and\n * may be used with permission of Bret Dusseault.\n * Any violations of this violate the terms of\n ", "end": 402, "score": 0.9775760769844055, "start": 388, "tag": "NAME", "value": "Bret Dusseault" }, { "context": "of\n * the license of TCBot-Core.</p>\n *\n * @author Bret 'Horfius' Dusseault\n */\n@Retention(RetentionPolic", "end": 503, "score": 0.999840259552002, "start": 499, "tag": "NAME", "value": "Bret" }, { "context": "he license of TCBot-Core.</p>\n *\n * @author Bret 'Horfius' Dusseault\n */\n@Retention(RetentionPolicy.RUNTIME", "end": 512, "score": 0.9965870976448059, "start": 505, "tag": "NAME", "value": "Horfius" }, { "context": "se of TCBot-Core.</p>\n *\n * @author Bret 'Horfius' Dusseault\n */\n@Retention(RetentionPolicy.RUNTIME)\n@Target(E", "end": 523, "score": 0.9953427314758301, "start": 514, "tag": "NAME", "value": "Dusseault" } ]
null
[]
package api; import java.lang.annotation.*; /** * <p>Used to indicate a module's main class that will be used to load up stuff from the module. * Once a class with this has been found, any methods annotated with {@link AssetLoader} will be called.</p> * * <p>Created by Bret 'Horfius' Dusseault in 2015. * All code in this file is open-source and * may be used with permission of <NAME>. * Any violations of this violate the terms of * the license of TCBot-Core.</p> * * @author Bret 'Horfius' Dusseault */ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.TYPE_USE) @Inherited @Documented public @interface Module { /** * The name of a module * @return */ String name(); /** * The version of a module * @return an integer version */ int version(); /** * ID of a module, which should be static * @return */ String id(); }
912
0.651087
0.646739
39
22.589743
24.032797
108
false
false
0
0
0
0
0
0
0.179487
false
false
3
0c4c84991e21ecb0acef9b4ea5136de7aaa29ae1
14,499,809,600,971
7d47a18d47cd0335fb3fe0bdb982fb288a028336
/vip/src/main/java/com/structis/vip/server/util/CatalinaPropertiesUtil.java
5546f0a1980b3ede0e96a826edf9a6e0e954b6d6
[]
no_license
ndlongit/longnd-projects
https://github.com/ndlongit/longnd-projects
7f56d6e2f840caee5d55c32ab555e0cc16b45bcc
a21b0c4e65ab9eb2f2274f72a991ef72a926227d
refs/heads/master
2018-03-10T15:04:53.818000
2015-01-31T03:17:29
2015-01-31T03:17:29
32,324,765
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.structis.vip.server.util; import java.io.File; import org.apache.log4j.Logger; import com.structis.vip.server.core.ServerConstant; public class CatalinaPropertiesUtil { public static final String RUBIS_ADDRESS_BY_ID_BYCN_URL = "http://bcnsweb088.bouygues-construction.com:9000/hr-appli-externe/services/adresse?idbycn="; public static final String RUBIS_SOCIETE_ETDE_URL = "http://bcnsweb088.bouygues-construction.com:9000/hr-appli-externe/services/societe?type=etde&code="; public static final String RUBIS_ETDE_CODES_NAMES = "043<>ETDE,473<>MARC FAVRE,548<>EXPRIMM,779<>COGEMEX,788<>AXIONE,812<>ETDE LS,896<>ETDE FONDATIONS,925<>SERMA"; public static final String RUBIS_BYEFE_CODES_NAMES = "022<>DV Construction,015<>GFC Construction,628<>MIRAGLIA,051<>NORPAC,027<>PERTUY Construction,024<>QUILLE Construction,404<>RICHELMI,371<>CIRMAD Centre Sud Ouest,323<>CIRMAD Est,332<>CIRMAD Grand Sud,175<>CIRMAD Nord,121<>CIRMAD Prospectives"; private static final String RUBIS_BYTP_CODES_NAMES = "633<>BCSN,703<>BYTP,327<>BYTP RF,566<>NOVI"; public static final String RUBIS_SERVER_USERNAME = "VIP"; public static final String RUBIS_SERVER_PASSWORD = "VIP"; public static final String ARGOS_URL = "http://argoswsauth.bouygues-construction.com:8082/Argos/services/wsArgosPortAuth"; public static final String ARGOS_SERVER_USERNAME = "Vip"; public static final String ARGOS_SERVER_PASSWORD = "xYLdaE"; private static final Logger LOGGER = Logger.getLogger(CatalinaPropertiesUtil.class); public static String getRubisEtdeUrl() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_SOCIETE_ETDE); LOGGER.info("RUBIS ETDE URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_SOCIETE_ETDE_URL; } return strResult; } public static String getRubisCodesNamesEtde() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_CODES_NAMES_ETDE); LOGGER.info("RUBIS CODES NAMES ETDE:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_ETDE_CODES_NAMES; } return strResult; } public static String getRubisIdBycnUrl() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_ADDRESS_BY_ID_BYCN); LOGGER.info("RUBIS ID BYCN URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_ADDRESS_BY_ID_BYCN_URL; } return strResult; } public static String getRubisUsername() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_USERNAME); LOGGER.info("RUBIS USERNAME:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_SERVER_USERNAME; } return strResult; } public static String getRubisPassword() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_PASSWORD); LOGGER.info("RUBIS PASSWORD:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_SERVER_PASSWORD; } return strResult; } public static String getArgosUrl() { String strResult = System.getProperty(ServerConstant.CATALINA_ARGOS_URL); LOGGER.info("ARGOS URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ARGOS_URL; } return strResult; } public static String getArgosUsername() { String strResult = System.getProperty(ServerConstant.CATALINA_ARGOS_USERNAME); LOGGER.info("ARGOS USERNAME:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ARGOS_SERVER_USERNAME; } return strResult; } public static String getArgosPassword() { String strResult = System.getProperty(ServerConstant.CATALINA_ARGOS_PASSWORD); LOGGER.info("ARGOS PASSWORD:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ARGOS_SERVER_PASSWORD; } return strResult; } public static String getReport1Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_1_URL); LOGGER.info("REPORT 1 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport2Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_2_URL); LOGGER.info("REPORT 2 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport3Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_3_URL); LOGGER.info("REPORT 3 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport4Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_4_URL); LOGGER.info("REPORT 4 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport5Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_5_URL); LOGGER.info("REPORT 5 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport6Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_6_URL); LOGGER.info("REPORT 6 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport7Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_7_URL); LOGGER.info("REPORT 7 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport8Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_8_URL); LOGGER.info("REPORT 8 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getVipDirectory(String pathContext) { String strResult = System.getProperty(ServerConstant.CATALINA_VIP_DIRECTORY); LOGGER.info("VIP DIRECTORY:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { if (pathContext != null) { strResult = pathContext; } else { strResult = ""; } } if ((strResult != null) && (!"".equals(strResult)) && (!strResult.endsWith(File.separator))) { strResult = strResult + File.separator; } return strResult; } public static String getRubisCodesNamesByefe() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_CODES_NAMES_BYEFE); LOGGER.info("RUBIS CODES NAMES BYTP:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_BYEFE_CODES_NAMES; } return strResult; } public static String getRubisCodesNamesBytp() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_CODES_NAMES_BYTP); LOGGER.info("RUBIS CODES NAMES ETDE:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_BYTP_CODES_NAMES; } return strResult; } }
UTF-8
Java
8,407
java
CatalinaPropertiesUtil.java
Java
[ { "context": "blic static final String RUBIS_SERVER_PASSWORD = \"VIP\";\r\n\r\n public static final String ARGOS_URL = \"", "end": 1212, "score": 0.49689120054244995, "start": 1209, "tag": "PASSWORD", "value": "VIP" }, { "context": "blic static final String ARGOS_SERVER_USERNAME = \"Vip\";\r\n public static final String ARGOS_SERVER_PA", "end": 1405, "score": 0.9983630180358887, "start": 1402, "tag": "USERNAME", "value": "Vip" }, { "context": "blic static final String ARGOS_SERVER_PASSWORD = \"xYLdaE\";\r\n\r\n private static final Logger LOGGER = Log", "end": 1471, "score": 0.9991617202758789, "start": 1465, "tag": "PASSWORD", "value": "xYLdaE" } ]
null
[]
package com.structis.vip.server.util; import java.io.File; import org.apache.log4j.Logger; import com.structis.vip.server.core.ServerConstant; public class CatalinaPropertiesUtil { public static final String RUBIS_ADDRESS_BY_ID_BYCN_URL = "http://bcnsweb088.bouygues-construction.com:9000/hr-appli-externe/services/adresse?idbycn="; public static final String RUBIS_SOCIETE_ETDE_URL = "http://bcnsweb088.bouygues-construction.com:9000/hr-appli-externe/services/societe?type=etde&code="; public static final String RUBIS_ETDE_CODES_NAMES = "043<>ETDE,473<>MARC FAVRE,548<>EXPRIMM,779<>COGEMEX,788<>AXIONE,812<>ETDE LS,896<>ETDE FONDATIONS,925<>SERMA"; public static final String RUBIS_BYEFE_CODES_NAMES = "022<>DV Construction,015<>GFC Construction,628<>MIRAGLIA,051<>NORPAC,027<>PERTUY Construction,024<>QUILLE Construction,404<>RICHELMI,371<>CIRMAD Centre Sud Ouest,323<>CIRMAD Est,332<>CIRMAD Grand Sud,175<>CIRMAD Nord,121<>CIRMAD Prospectives"; private static final String RUBIS_BYTP_CODES_NAMES = "633<>BCSN,703<>BYTP,327<>BYTP RF,566<>NOVI"; public static final String RUBIS_SERVER_USERNAME = "VIP"; public static final String RUBIS_SERVER_PASSWORD = "VIP"; public static final String ARGOS_URL = "http://argoswsauth.bouygues-construction.com:8082/Argos/services/wsArgosPortAuth"; public static final String ARGOS_SERVER_USERNAME = "Vip"; public static final String ARGOS_SERVER_PASSWORD = "<PASSWORD>"; private static final Logger LOGGER = Logger.getLogger(CatalinaPropertiesUtil.class); public static String getRubisEtdeUrl() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_SOCIETE_ETDE); LOGGER.info("RUBIS ETDE URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_SOCIETE_ETDE_URL; } return strResult; } public static String getRubisCodesNamesEtde() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_CODES_NAMES_ETDE); LOGGER.info("RUBIS CODES NAMES ETDE:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_ETDE_CODES_NAMES; } return strResult; } public static String getRubisIdBycnUrl() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_ADDRESS_BY_ID_BYCN); LOGGER.info("RUBIS ID BYCN URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_ADDRESS_BY_ID_BYCN_URL; } return strResult; } public static String getRubisUsername() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_USERNAME); LOGGER.info("RUBIS USERNAME:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_SERVER_USERNAME; } return strResult; } public static String getRubisPassword() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_PASSWORD); LOGGER.info("RUBIS PASSWORD:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_SERVER_PASSWORD; } return strResult; } public static String getArgosUrl() { String strResult = System.getProperty(ServerConstant.CATALINA_ARGOS_URL); LOGGER.info("ARGOS URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ARGOS_URL; } return strResult; } public static String getArgosUsername() { String strResult = System.getProperty(ServerConstant.CATALINA_ARGOS_USERNAME); LOGGER.info("ARGOS USERNAME:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ARGOS_SERVER_USERNAME; } return strResult; } public static String getArgosPassword() { String strResult = System.getProperty(ServerConstant.CATALINA_ARGOS_PASSWORD); LOGGER.info("ARGOS PASSWORD:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ARGOS_SERVER_PASSWORD; } return strResult; } public static String getReport1Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_1_URL); LOGGER.info("REPORT 1 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport2Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_2_URL); LOGGER.info("REPORT 2 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport3Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_3_URL); LOGGER.info("REPORT 3 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport4Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_4_URL); LOGGER.info("REPORT 4 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport5Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_5_URL); LOGGER.info("REPORT 5 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport6Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_6_URL); LOGGER.info("REPORT 6 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport7Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_7_URL); LOGGER.info("REPORT 7 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getReport8Url() { String strResult = System.getProperty(ServerConstant.CATALINA_REPORT_8_URL); LOGGER.info("REPORT 8 URL:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = ""; } return strResult; } public static String getVipDirectory(String pathContext) { String strResult = System.getProperty(ServerConstant.CATALINA_VIP_DIRECTORY); LOGGER.info("VIP DIRECTORY:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { if (pathContext != null) { strResult = pathContext; } else { strResult = ""; } } if ((strResult != null) && (!"".equals(strResult)) && (!strResult.endsWith(File.separator))) { strResult = strResult + File.separator; } return strResult; } public static String getRubisCodesNamesByefe() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_CODES_NAMES_BYEFE); LOGGER.info("RUBIS CODES NAMES BYTP:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_BYEFE_CODES_NAMES; } return strResult; } public static String getRubisCodesNamesBytp() { String strResult = System.getProperty(ServerConstant.CATALINA_RUBIS_CODES_NAMES_BYTP); LOGGER.info("RUBIS CODES NAMES ETDE:" + strResult); if ((strResult == null) || ("".equals(strResult.trim()))) { strResult = RUBIS_BYTP_CODES_NAMES; } return strResult; } }
8,411
0.609492
0.595813
203
39.413792
37.499638
301
false
false
0
0
0
0
0
0
0.748768
false
false
3
5a748d4305e2fb7e1630034025ef7da07d9b9ebc
13,116,830,137,719
9a91fa4000b911143a93f1a8161746bb9662d495
/framelibrary/src/main/java/com/tcoj/framelibrary/DefaultNavigationBar.java
2cc309b63af1ed0828dea1f55cd3e19e0eecabdf
[]
no_license
fuxiaoyuandroid/SunSaiEr
https://github.com/fuxiaoyuandroid/SunSaiEr
db953d1143edfacb90199ae64041c39cf399cf8a
eceec24335fe05f1cadfc0ea3d2591c196464b6d
refs/heads/master
2021-08-29T21:17:49.929000
2017-12-15T02:14:37
2017-12-15T02:14:37
112,281,994
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.tcoj.framelibrary; import android.app.Activity; import android.content.Context; import android.view.View; import android.view.ViewGroup; import com.tcoj.baselibrary.navigationbar.BasicNavigationBar; /** * Created by Administrator on 2017/11/28 0028. * 基本NavigationBar */ public class DefaultNavigationBar extends BasicNavigationBar<DefaultNavigationBar.DefaultBuilder.DefaultNavigationParams> { public DefaultNavigationBar(DefaultNavigationBar.DefaultBuilder.DefaultNavigationParams params) { super(params); } @Override public int bindLayoutId() { return R.layout.title_bar; } @Override public void applyView() { //设置文本 setText(R.id.title_tv,getParams().mTitle); setText(R.id.right_tv,getParams().mRightText); /* setImageResource(R.id.right_iv, getParams().mResId);*/ //设置点击事件 setOnClickListener(R.id.right_tv,getParams().mRightClickListener); //左边的点击事件都是默认的 setOnClickListener(R.id.left_tv,getParams().mLeftClickListener); } public static class DefaultBuilder extends BasicNavigationBar.Builder{ DefaultNavigationParams P; public DefaultBuilder(Context context) { super(context, null); P = new DefaultNavigationParams(context,null); } public DefaultBuilder(Context context, ViewGroup parent) { super(context, parent); P = new DefaultNavigationParams(context,parent); } @Override public DefaultNavigationBar builder() { DefaultNavigationBar defaultNavigationBar = new DefaultNavigationBar(P); return defaultNavigationBar; } //设置效果 public DefaultBuilder setTitle(String title){ P.mTitle = title; return this; } public DefaultBuilder setRightText(String rightText){ P.mRightText = rightText; return this; } public DefaultBuilder setRightIcon(int resId){ P.mResId = resId; return this; } public DefaultBuilder setRightClickListener(View.OnClickListener rightListener){ P.mRightClickListener = rightListener; return this; } public DefaultBuilder setLeftClickListener(View.OnClickListener leftListener){ P.mLeftClickListener = leftListener; return this; } public static class DefaultNavigationParams extends BasicNavigationParams{ //标题 public String mTitle; //右侧内容 public String mRightText; //右侧图片 public int mResId; //右边的点击事件 public View.OnClickListener mRightClickListener; //默认左边的点击事件 public View.OnClickListener mLeftClickListener = new View.OnClickListener() { @Override public void onClick(View v) { //关闭当前activity ((Activity)mContext).finish(); } }; //实现效果 public DefaultNavigationParams(Context context, ViewGroup parent) { super(context, parent); } } } }
UTF-8
Java
3,367
java
DefaultNavigationBar.java
Java
[ { "context": "vigationbar.BasicNavigationBar;\n\n/**\n * Created by Administrator on 2017/11/28 0028.\n * 基本NavigationBar\n */\n\npubli", "end": 245, "score": 0.8876801133155823, "start": 232, "tag": "NAME", "value": "Administrator" } ]
null
[]
package com.tcoj.framelibrary; import android.app.Activity; import android.content.Context; import android.view.View; import android.view.ViewGroup; import com.tcoj.baselibrary.navigationbar.BasicNavigationBar; /** * Created by Administrator on 2017/11/28 0028. * 基本NavigationBar */ public class DefaultNavigationBar extends BasicNavigationBar<DefaultNavigationBar.DefaultBuilder.DefaultNavigationParams> { public DefaultNavigationBar(DefaultNavigationBar.DefaultBuilder.DefaultNavigationParams params) { super(params); } @Override public int bindLayoutId() { return R.layout.title_bar; } @Override public void applyView() { //设置文本 setText(R.id.title_tv,getParams().mTitle); setText(R.id.right_tv,getParams().mRightText); /* setImageResource(R.id.right_iv, getParams().mResId);*/ //设置点击事件 setOnClickListener(R.id.right_tv,getParams().mRightClickListener); //左边的点击事件都是默认的 setOnClickListener(R.id.left_tv,getParams().mLeftClickListener); } public static class DefaultBuilder extends BasicNavigationBar.Builder{ DefaultNavigationParams P; public DefaultBuilder(Context context) { super(context, null); P = new DefaultNavigationParams(context,null); } public DefaultBuilder(Context context, ViewGroup parent) { super(context, parent); P = new DefaultNavigationParams(context,parent); } @Override public DefaultNavigationBar builder() { DefaultNavigationBar defaultNavigationBar = new DefaultNavigationBar(P); return defaultNavigationBar; } //设置效果 public DefaultBuilder setTitle(String title){ P.mTitle = title; return this; } public DefaultBuilder setRightText(String rightText){ P.mRightText = rightText; return this; } public DefaultBuilder setRightIcon(int resId){ P.mResId = resId; return this; } public DefaultBuilder setRightClickListener(View.OnClickListener rightListener){ P.mRightClickListener = rightListener; return this; } public DefaultBuilder setLeftClickListener(View.OnClickListener leftListener){ P.mLeftClickListener = leftListener; return this; } public static class DefaultNavigationParams extends BasicNavigationParams{ //标题 public String mTitle; //右侧内容 public String mRightText; //右侧图片 public int mResId; //右边的点击事件 public View.OnClickListener mRightClickListener; //默认左边的点击事件 public View.OnClickListener mLeftClickListener = new View.OnClickListener() { @Override public void onClick(View v) { //关闭当前activity ((Activity)mContext).finish(); } }; //实现效果 public DefaultNavigationParams(Context context, ViewGroup parent) { super(context, parent); } } } }
3,367
0.61918
0.615479
107
29.308411
26.8855
123
false
false
0
0
0
0
0
0
0.457944
false
false
3
1d2a6234b70ed62b657664f4964ea873762fc5d8
25,735,444,047,827
71246bc8e0d0d475bac27274ff0597dfc83178bc
/easy-tuples/src/main/java/io/github/easytuples/_6.java
f05478c93fbff1369863f32daffda6675eecb515
[ "Apache-2.0" ]
permissive
easytuples/easy-tuples
https://github.com/easytuples/easy-tuples
c524e611f1b1b8766a7dfb63179d1ea7476c21ef
d93295da6301362fa0495c233d5b66ca9c30c94c
refs/heads/main
2023-04-25T01:37:29.918000
2021-05-09T11:55:33
2021-05-09T11:55:33
362,597,937
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package io.github.easytuples; /** * Tuple with 6 fields. */ public record _6<A, B, C, D, E, F>(A _1, B _2, C _3, D _4, E _5, F _6) { /** * The number of fields stored within the tuple. */ public static final int SIZE = 6; /* ******************************************************************************** * Factories * Create instances of the tuple. * ********************************************************************************/ /** * {@return 6-tuple instance containing the objects passed in as arguments. } */ public static <A, B, C, D, E, F> _6<A, B, C, D, E, F> of(A _1, B _2, C _3, D _4, E _5, F _6) { return new _6<>(_1, _2, _3, _4, _5, _6); } /* ******************************************************************************** * Setters * Generate a new tuple with the element at the given index in the tuple replaced. * ********************************************************************************/ /** * {@return New instance of a 6-tuple with the object at index 1 set to the given argument. } */ public <T1> _6<T1, B, C, D, E, F> set1(T1 arg) { return new _6<>(arg, _2, _3, _4, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 2 set to the given argument. } */ public <T2> _6<A, T2, C, D, E, F> set2(T2 arg) { return new _6<>(_1, arg, _3, _4, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 3 set to the given argument. } */ public <T3> _6<A, B, T3, D, E, F> set3(T3 arg) { return new _6<>(_1, _2, arg, _4, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 4 set to the given argument. } */ public <T4> _6<A, B, C, T4, E, F> set4(T4 arg) { return new _6<>(_1, _2, _3, arg, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 5 set to the given argument. } */ public <T5> _6<A, B, C, D, T5, F> set5(T5 arg) { return new _6<>(_1, _2, _3, _4, arg, _6); } /** * {@return New instance of a 6-tuple with the object at index 6 set to the given argument. } */ public <T6> _6<A, B, C, D, E, T6> set6(T6 arg) { return new _6<>(_1, _2, _3, _4, _5, arg); } /* ******************************************************************************** * Appender * Generate a new tuple of size = (current size + 1) with an additional item at the last index. * ********************************************************************************/ /** * {@return New instance of a 7-tuple with all fields the same and * an additional field at the last index set to the argument. } */ public <T> _7<A, B, C, D, E, F, T> append(T arg) { return new _7<>(_1, _2, _3, _4, _5, _6, arg); } }
UTF-8
Java
2,939
java
_6.java
Java
[]
null
[]
package io.github.easytuples; /** * Tuple with 6 fields. */ public record _6<A, B, C, D, E, F>(A _1, B _2, C _3, D _4, E _5, F _6) { /** * The number of fields stored within the tuple. */ public static final int SIZE = 6; /* ******************************************************************************** * Factories * Create instances of the tuple. * ********************************************************************************/ /** * {@return 6-tuple instance containing the objects passed in as arguments. } */ public static <A, B, C, D, E, F> _6<A, B, C, D, E, F> of(A _1, B _2, C _3, D _4, E _5, F _6) { return new _6<>(_1, _2, _3, _4, _5, _6); } /* ******************************************************************************** * Setters * Generate a new tuple with the element at the given index in the tuple replaced. * ********************************************************************************/ /** * {@return New instance of a 6-tuple with the object at index 1 set to the given argument. } */ public <T1> _6<T1, B, C, D, E, F> set1(T1 arg) { return new _6<>(arg, _2, _3, _4, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 2 set to the given argument. } */ public <T2> _6<A, T2, C, D, E, F> set2(T2 arg) { return new _6<>(_1, arg, _3, _4, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 3 set to the given argument. } */ public <T3> _6<A, B, T3, D, E, F> set3(T3 arg) { return new _6<>(_1, _2, arg, _4, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 4 set to the given argument. } */ public <T4> _6<A, B, C, T4, E, F> set4(T4 arg) { return new _6<>(_1, _2, _3, arg, _5, _6); } /** * {@return New instance of a 6-tuple with the object at index 5 set to the given argument. } */ public <T5> _6<A, B, C, D, T5, F> set5(T5 arg) { return new _6<>(_1, _2, _3, _4, arg, _6); } /** * {@return New instance of a 6-tuple with the object at index 6 set to the given argument. } */ public <T6> _6<A, B, C, D, E, T6> set6(T6 arg) { return new _6<>(_1, _2, _3, _4, _5, arg); } /* ******************************************************************************** * Appender * Generate a new tuple of size = (current size + 1) with an additional item at the last index. * ********************************************************************************/ /** * {@return New instance of a 7-tuple with all fields the same and * an additional field at the last index set to the argument. } */ public <T> _7<A, B, C, D, E, F, T> append(T arg) { return new _7<>(_1, _2, _3, _4, _5, _6, arg); } }
2,939
0.420551
0.382443
82
34.841465
34.992149
102
false
false
0
0
0
0
0
0
1.365854
false
false
3
0309dd7fbd49d9b1a70b71f727c8f7dbe61d347b
12,575,664,257,045
5a7e2f2101faaa52a7b81b73e7c64d23f4fe95e4
/pattern/singleton/HayStorage.java
934c6eba1045486856420ba92a42d793cba27a34
[]
no_license
ksy903/OCP-Training
https://github.com/ksy903/OCP-Training
cd717f4bc16d4abf69b73b1d937b60eb664e2dd0
f816737fd1b585dbac13189e3017b529bdc7fcf5
refs/heads/master
2021-05-19T16:19:28.841000
2020-04-03T02:56:57
2020-04-03T02:56:57
252,022,848
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package pattern.singleton; public class HayStorage { private int quantity = 0; private HayStorage() {} private static final HayStorage instance = new HayStorage(); public static HayStorage getInstance() { return instance; } public synchronized void addHay(int amountToAdd) { System.out.println("CurrentHay: " + quantity + " | Adding: " + amountToAdd); quantity += amountToAdd; } public synchronized boolean removeHay(int amountToRemove) { System.out.println("CurrentHay: " + quantity + " | Removing: " + amountToRemove); if(amountToRemove > quantity) return false; else quantity -= amountToRemove; return true; } public synchronized int getHayQuantity() { return quantity; } }
UTF-8
Java
816
java
HayStorage.java
Java
[]
null
[]
package pattern.singleton; public class HayStorage { private int quantity = 0; private HayStorage() {} private static final HayStorage instance = new HayStorage(); public static HayStorage getInstance() { return instance; } public synchronized void addHay(int amountToAdd) { System.out.println("CurrentHay: " + quantity + " | Adding: " + amountToAdd); quantity += amountToAdd; } public synchronized boolean removeHay(int amountToRemove) { System.out.println("CurrentHay: " + quantity + " | Removing: " + amountToRemove); if(amountToRemove > quantity) return false; else quantity -= amountToRemove; return true; } public synchronized int getHayQuantity() { return quantity; } }
816
0.631127
0.629902
29
27.137932
25.255554
89
false
false
0
0
0
0
0
0
0.448276
false
false
3
4b2aa8fc17a8a13847cd222da0be97ad19018963
18,502,719,142,407
0f68e790aa8895fe39bc27f9331cc33929ec98be
/raw_dataset/73294274@reroot@OK.java
d1ac7fbeca43070702fa817ea7ee23632ce2faf0
[ "MIT" ]
permissive
ruanyuan115/code2vec_treelstm
https://github.com/ruanyuan115/code2vec_treelstm
c50b784cbe2a576905c372675270e95e64908575
0c5f98d280b506317738ba603b719cac6036896f
refs/heads/master
2023-04-09T14:11:02.992000
2020-04-16T08:29:59
2020-04-16T08:29:59
256,151,081
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
public static void reroot(int curr, boolean[] seen, LinkedList<Integer>[] edges, int[] dp, int[] arr) { seen[curr] = true; res[curr] = dp[curr]; for (int next : edges[curr]) if (!seen[next]) { int val = dp[next]; int val2 = dp[curr]; // set down if (val >= 0) dp[curr] -= val; dp[next] += Math.max(0, dp[curr]); reroot(next, seen, edges, dp, arr); dp[curr] = val2; dp[next] = val; } }
UTF-8
Java
476
java
73294274@reroot@OK.java
Java
[]
null
[]
public static void reroot(int curr, boolean[] seen, LinkedList<Integer>[] edges, int[] dp, int[] arr) { seen[curr] = true; res[curr] = dp[curr]; for (int next : edges[curr]) if (!seen[next]) { int val = dp[next]; int val2 = dp[curr]; // set down if (val >= 0) dp[curr] -= val; dp[next] += Math.max(0, dp[curr]); reroot(next, seen, edges, dp, arr); dp[curr] = val2; dp[next] = val; } }
476
0.497899
0.489496
15
30.799999
22.996231
103
false
false
0
0
0
0
0
0
1.2
false
false
3
02ac35d6d88e2c14bdded965e26314926c4b5df8
9,543,417,373,613
d7fe548ed7878e18bda5d1d1f610e75b9443da90
/PerformIt/src/com/llc/performit/UncompleteAchievementActivity.java
5933a3319b957d852c3ee1de3ae811b1988192cd
[]
no_license
Joket-Dev/PerformitforAndroid
https://github.com/Joket-Dev/PerformitforAndroid
328f8e4cca833a03db85d1b7f523e1c31c564974
e02b91f1249234d24ae5f8f098611998cf6db1ff
refs/heads/master
2021-01-19T02:29:25.971000
2017-04-14T10:43:17
2017-04-14T10:43:17
87,283,767
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.llc.performit; import com.llc.performit.common.Constants; import android.app.Activity; import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; public class UncompleteAchievementActivity extends Activity { private TextView tvLabelProgress; private TextView tvProgress; private TextView tvName; private TextView tvAchievement; private ImageView achieveImageView; private TextView tvDescription; private TextView tvCoins; private LinearLayout btnClose; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.uncomplete_achievement_layout); tvLabelProgress = (TextView) findViewById(R.id.progress_label_textView); tvProgress = (TextView) findViewById(R.id.progress_textView); tvName = (TextView) findViewById(R.id.name_textView); tvAchievement = (TextView) findViewById(R.id.achieve_textView); achieveImageView = (ImageView) findViewById(R.id.achieve_imageView); tvDescription = (TextView) findViewById(R.id.description_textView); tvCoins = (TextView) findViewById(R.id.coin_textView); btnClose = (LinearLayout) findViewById(R.id.close_linearLayout); Typeface btnFont = Typeface.createFromAsset(getAssets(), "marvin.ttf"); tvLabelProgress.setTypeface(btnFont); tvProgress.setTypeface(btnFont); tvName.setTypeface(btnFont); tvAchievement.setTypeface(btnFont); tvDescription.setTypeface(btnFont); tvCoins.setTypeface(btnFont); Intent intent = getIntent(); tvProgress.setText(intent.getStringExtra(Constants.KEY_PROGRESS)); tvName.setText(intent.getStringExtra(Constants.KEY_NAME)); tvCoins.setText(intent.getIntExtra(Constants.KEY_COINS, 0) + ""); tvDescription.setText(intent.getStringExtra(Constants.KEY_DESCRIPTION)); initListener(); } private void initListener() { btnClose.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub finish(); } }); } }
UTF-8
Java
2,270
java
UncompleteAchievementActivity.java
Java
[]
null
[]
package com.llc.performit; import com.llc.performit.common.Constants; import android.app.Activity; import android.content.Intent; import android.graphics.Typeface; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; public class UncompleteAchievementActivity extends Activity { private TextView tvLabelProgress; private TextView tvProgress; private TextView tvName; private TextView tvAchievement; private ImageView achieveImageView; private TextView tvDescription; private TextView tvCoins; private LinearLayout btnClose; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.uncomplete_achievement_layout); tvLabelProgress = (TextView) findViewById(R.id.progress_label_textView); tvProgress = (TextView) findViewById(R.id.progress_textView); tvName = (TextView) findViewById(R.id.name_textView); tvAchievement = (TextView) findViewById(R.id.achieve_textView); achieveImageView = (ImageView) findViewById(R.id.achieve_imageView); tvDescription = (TextView) findViewById(R.id.description_textView); tvCoins = (TextView) findViewById(R.id.coin_textView); btnClose = (LinearLayout) findViewById(R.id.close_linearLayout); Typeface btnFont = Typeface.createFromAsset(getAssets(), "marvin.ttf"); tvLabelProgress.setTypeface(btnFont); tvProgress.setTypeface(btnFont); tvName.setTypeface(btnFont); tvAchievement.setTypeface(btnFont); tvDescription.setTypeface(btnFont); tvCoins.setTypeface(btnFont); Intent intent = getIntent(); tvProgress.setText(intent.getStringExtra(Constants.KEY_PROGRESS)); tvName.setText(intent.getStringExtra(Constants.KEY_NAME)); tvCoins.setText(intent.getIntExtra(Constants.KEY_COINS, 0) + ""); tvDescription.setText(intent.getStringExtra(Constants.KEY_DESCRIPTION)); initListener(); } private void initListener() { btnClose.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub finish(); } }); } }
2,270
0.755507
0.755066
68
31.382353
22.892992
74
false
false
0
0
0
0
0
0
2.205882
false
false
3
29d5afebfba1c7af39fe1b615db29d473fdaba30
24,257,975,321,057
38d2a90c8e2b14245088bd9d7b5e84c9b2a8f1dd
/app/src/main/java/com/example/fairuz/AssistUsApp/Activities/SilentMainActivity.java
97f8b291b358b699629d0302c639bd5d6731512f
[]
no_license
FairuzNawer/AssistUs
https://github.com/FairuzNawer/AssistUs
1b1afa0f1527628cf5bf82af798c0892a5360ffa
c8f1ab481183f8e81bf5861ad545e65d1e564611
refs/heads/master
2020-06-24T05:37:48.649000
2019-07-25T18:10:51
2019-07-25T18:10:51
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.fairuz.AssistUsApp.Activities; import android.Manifest; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.support.annotation.IdRes; import android.support.design.widget.NavigationView; import android.support.v4.app.ActivityCompat; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.example.fairuz.AssistUsApp.Adapters.MyAdapterSilent; import com.example.fairuz.AssistUsApp.BackgroundServices.DisableSilentService; import com.example.fairuz.AssistUsApp.BackgroundServices.SilentService; import com.example.fairuz.AssistUsApp.R; import com.example.fairuz.AssistUsApp.Receivers.Disable_Silent_Receiver; import com.example.fairuz.AssistUsApp.Receivers.Silent_Receiver; import com.example.fairuz.AssistUsApp.Utility.RecyclerItem; import com.example.fairuz.AssistUsApp.Utility.SilentAdd; import com.google.firebase.auth.FirebaseUser; import java.io.File; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import static com.example.fairuz.AssistUsApp.Activities.MainOption.firebaseAuth; import static com.example.fairuz.AssistUsApp.Activities.MainOption.theme; import static com.example.fairuz.AssistUsApp.Activities.SignupActivity.ThemeFlagDir; import static com.example.fairuz.AssistUsApp.Activities.SignupActivity.ThemeFlagParentDir; import static com.example.fairuz.AssistUsApp.Activities.SignupActivity.themeFlag; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.Load; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.Save; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.generateCode; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.updateCalendarFromTo; /** * Created by anika on 9/6/17. */ public class SilentMainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { public static int SilentFlag = 0, dltSilentFlag = 0; private RecyclerView recyclerView; private MyAdapterSilent adapter; private ImageButton floatButton; private RelativeLayout mainback; DrawerLayout drawerLayout; NavigationView navigation; ActionBarDrawerToggle actionBarDrawerToggle; public static List<RecyclerItem> listItemsSilent = new ArrayList<>(); public static File SilentTitleDir = new File(Environment.getExternalStorageDirectory(), "/AppData/MyDataBase/SilentTitles.txt"); File SilentTitleParentDir = SilentTitleDir.getParentFile(); public static File SilentTimeDir = new File(Environment.getExternalStorageDirectory(), "/AppData/MyDataBase/SilentTimes.txt"); File SilentTimeParentDir = SilentTimeDir.getParentFile(); public static Map<Integer, Calendar> silentMap = new HashMap<Integer, Calendar>(); public static ArrayList<String> savedDataTitleSilent = new ArrayList<String>(); public static ArrayList<String> savedDataSilentTime = new ArrayList<String>(); public void initializer() { isStoragePermissionGranted(); if (SilentTitleParentDir != null) SilentTitleParentDir.mkdirs(); if (SilentTimeParentDir != null) SilentTimeParentDir.mkdirs(); try { if (isStoragePermissionGranted() == true) { savedDataTitleSilent = Load(SilentTitleDir); savedDataSilentTime = Load(SilentTimeDir); listItemsSilent.clear(); for (int j = 0; j < savedDataTitleSilent.size(); j++) { String[] splited = savedDataSilentTime.get(j).trim().split("\\s+"); int sp1 = Integer.parseInt(splited[0]); int sp2 = Integer.parseInt(splited[1]); int sp3 = Integer.parseInt(splited[2]); int sp4 = Integer.parseInt(splited[3]); SimpleDateFormat date12Format = new SimpleDateFormat("h:mm a",Locale.ENGLISH); SimpleDateFormat date24Format = new SimpleDateFormat("H m", Locale.ENGLISH); String TimeStart = date12Format.format(date24Format.parse(sp1+" "+sp2)); String TimeEnd = date12Format.format(date24Format.parse(sp3+" "+sp4)); listItemsSilent.add(new RecyclerItem(savedDataTitleSilent.get(j), TimeStart + " to " + TimeEnd)); } adapter = new MyAdapterSilent(listItemsSilent, this); recyclerView.setAdapter(adapter); } } catch (Exception e) { e.printStackTrace(); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 200) { String silentTitle = data.getExtras().getString("key"); String sitentTimeLayoutFormat = data.getExtras().getString("key2"); String sitentTimeFileFormat = data.getExtras().getString("key3"); try { ArrayList<Calendar> list = updateCalendarFromTo(sitentTimeFileFormat); Calendar calFrom = list.get(0); Calendar calTo = list.get(1); int codeFrom = generateCode(calFrom); int codeTo = generateCode(calTo); SilentAt(calFrom, codeFrom); DisableSilentAt(calTo, codeTo); savedDataTitleSilent.add(silentTitle); savedDataSilentTime.add(sitentTimeFileFormat); Save(SilentTitleDir, savedDataTitleSilent); Save(SilentTimeDir, savedDataSilentTime); if (!silentTitle.equals("") || !sitentTimeLayoutFormat.equals("")) { listItemsSilent.add(new RecyclerItem(silentTitle, sitentTimeLayoutFormat)); } } catch (Exception e) { Toast.makeText(this, "Add: " + e.toString(), Toast.LENGTH_LONG).show(); } } } public void onDestroy() { super.onDestroy(); if (isStoragePermissionGranted() == true) { Save(SilentTitleDir, savedDataTitleSilent); Save(SilentTimeDir, savedDataSilentTime); } else { Toast.makeText(getApplicationContext(), "permission not granted", Toast.LENGTH_SHORT).show(); } } public void onStart() { super.onStart(); initializer(); if( theme ==1 ) setColor(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); navigation = (NavigationView) findViewById(R.id.nav); navigation.setNavigationItemSelectedListener(this); mainback = (RelativeLayout) findViewById(R.id.mainback); FirebaseUser user = firebaseAuth.getCurrentUser(); TextView txtProfileName = (TextView) navigation.getHeaderView(0).findViewById(R.id.gmail); txtProfileName.setText(""+user.getEmail()); if( theme ==1 ) setColor(); setUpToolBar(); if (SilentFlag == 1) { try { Intent intent = getIntent(); String EditedTitle = intent.getExtras().getString("EditedTitle"); String EditedTimeFileFormat = intent.getExtras().getString("EditedTimeFileFormat"); String PreviousTime = intent.getExtras().getString("PreviousTime"); ArrayList<Calendar> prevList = updateCalendarFromTo(PreviousTime); Calendar prevCalFrom = prevList.get(0); Calendar prevCalTo = prevList.get(1); int prevCodeFrom = generateCode(prevCalFrom); int prevCodeTo = generateCode(prevCalTo); cancelSilent(prevCodeFrom); cancelDisableSilent(prevCodeTo); ArrayList<Calendar> list = updateCalendarFromTo(EditedTimeFileFormat); Calendar calFrom = list.get(0); Calendar calTo = list.get(1); int codeFrom = generateCode(calFrom); int codeTo = generateCode(calTo); SilentAt(calFrom, codeFrom); DisableSilentAt(calTo, codeTo); SilentFlag = 0; finish(); } catch (Exception e) { Toast.makeText(this, "edit: " + e.toString(), Toast.LENGTH_SHORT).show(); } } if (dltSilentFlag == 1) { try { Intent intent = getIntent(); String deletedTime = intent.getExtras().getString("deletedTime"); ArrayList<Calendar> list = updateCalendarFromTo(deletedTime); Calendar calFrom = list.get(0); Calendar calTo = list.get(1); int codeFrom = generateCode(calFrom); int codeTo = generateCode(calTo); cancelSilent(codeFrom); cancelDisableSilent(codeTo); dltSilentFlag = 0; finish(); } catch (Exception e) { Toast.makeText(this, "dlt: " + e.toString(), Toast.LENGTH_LONG).show(); } } recyclerView = (RecyclerView) findViewById(R.id.recyclerView); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(this)); initializer(); floatButton = (ImageButton) findViewById(R.id.imageButton); floatButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(SilentMainActivity.this, SilentAdd.class); startActivityForResult(intent, 200); } }); } public boolean isStoragePermissionGranted() { if (Build.VERSION.SDK_INT >= 23) { if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { //Log.v(TAG,"Permission is granted"); return true; } else { // Log.v(TAG,"Permission is revoked"); ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); return false; } } else { //permission is automatically granted on sdk<23 upon installation // Log.v(TAG,"Permission is granted"); return true; } } public void SilentAt(Calendar cal, int notificationID) { Intent silentServiceIntent = new Intent(getApplicationContext(), SilentService.class); silentServiceIntent.putExtra("cal", cal); silentServiceIntent.putExtra("notificationID", notificationID); startService(silentServiceIntent); } public void cancelSilent(int notificationID) { AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(getApplicationContext(), Silent_Receiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), notificationID, intent, 0); alarmManager.cancel(pendingIntent); } public void DisableSilentAt(Calendar cal, int notificationID) { Intent disableSilentServiceIntent = new Intent(getApplicationContext(), DisableSilentService.class); disableSilentServiceIntent.putExtra("cal", cal); disableSilentServiceIntent.putExtra("notificationID", notificationID); startService(disableSilentServiceIntent); } public void cancelDisableSilent(int notificationID) { AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(getApplicationContext(), Disable_Silent_Receiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), notificationID, intent, 0); alarmManager.cancel(pendingIntent); } private void setUpToolBar() { drawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout); actionBarDrawerToggle = new ActionBarDrawerToggle(this,drawerLayout, R.string.app_name, R.string.app_name); drawerLayout.addDrawerListener(actionBarDrawerToggle); actionBarDrawerToggle.syncState(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(actionBarDrawerToggle.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); switch(id) { case R.id.task: Intent intent = new Intent(SilentMainActivity.this,TaskMainActivity.class); startActivity(intent); finish(); break; case R.id.Ssilent: //Intent intent2 = new Intent(TaskMainActivity.this,SilentMainActivity.class); // startActivity(intent2); break; case R.id.location: Intent intent3 = new Intent(SilentMainActivity.this,MapsActivity.class); startActivity(intent3); finish(); break; case R.id.logout: firebaseAuth.signOut(); finish(); Intent intent4 = new Intent(SilentMainActivity.this, LoginActivity.class); startActivity(intent4); break; case R.id.setting: // Intent intent5 = new Intent(SilentMainActivity.this, settings.class); // startActivity(intent5); AlertDialog.Builder mBuilder = new AlertDialog.Builder(SilentMainActivity.this); final View mView = getLayoutInflater().inflate(R.layout.theme_selector, null); RadioGroup rg = (RadioGroup) mView.findViewById(R.id.rg); Button done = (Button) mView.findViewById(R.id.done); RadioButton light = (RadioButton) mView.findViewById(R.id.light); RadioButton dark = (RadioButton) mView.findViewById(R.id.dark); mBuilder.setView(mView); final AlertDialog dialog = mBuilder.create(); dialog.show(); if(theme==1) light.setChecked(true); else dark.setChecked(true); rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup radioGroup, @IdRes int i) { // rb = (RadioButton) findViewById(i); switch(i) { case R.id.light: theme = 1; if (ThemeFlagParentDir != null) { ThemeFlagParentDir.mkdirs(); if(themeFlag.size()==0) themeFlag.add("1"); } themeFlag.set(0,""+theme); if (isStoragePermissionGranted() == true) { Save(ThemeFlagDir,themeFlag); Toast.makeText(getApplicationContext(), theme+"", Toast.LENGTH_SHORT).show(); } break; case R.id.dark: theme =0; if (ThemeFlagParentDir != null) { ThemeFlagParentDir.mkdirs(); if(themeFlag.size()==0) themeFlag.add("1"); } themeFlag.set(0,""+theme); if (isStoragePermissionGranted() == true) { Save(ThemeFlagDir,themeFlag); Toast.makeText(getApplicationContext(), theme+"", Toast.LENGTH_SHORT).show(); } break; } } }); done.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(SilentMainActivity.this, SilentMainActivity.class); startActivity(intent); finish(); dialog.dismiss(); } }); break; } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawerlayout); drawer.closeDrawer(GravityCompat.START); return true; } public void setColor() { mainback.setBackgroundResource(R.color.lightAsh); } }
UTF-8
Java
18,492
java
SilentMainActivity.java
Java
[ { "context": "ndLoad.updateCalendarFromTo;\r\n\r\n/**\r\n * Created by anika on 9/6/17.\r\n */\r\n\r\npublic class SilentMainActivit", "end": 2672, "score": 0.9954649209976196, "start": 2667, "tag": "USERNAME", "value": "anika" } ]
null
[]
package com.example.fairuz.AssistUsApp.Activities; import android.Manifest; import android.app.AlarmManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.os.Environment; import android.support.annotation.IdRes; import android.support.design.widget.NavigationView; import android.support.v4.app.ActivityCompat; import android.support.v4.view.GravityCompat; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarDrawerToggle; import android.support.v7.app.AlertDialog; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.MenuItem; import android.view.View; import android.widget.Button; import android.widget.ImageButton; import android.widget.RadioButton; import android.widget.RadioGroup; import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; import com.example.fairuz.AssistUsApp.Adapters.MyAdapterSilent; import com.example.fairuz.AssistUsApp.BackgroundServices.DisableSilentService; import com.example.fairuz.AssistUsApp.BackgroundServices.SilentService; import com.example.fairuz.AssistUsApp.R; import com.example.fairuz.AssistUsApp.Receivers.Disable_Silent_Receiver; import com.example.fairuz.AssistUsApp.Receivers.Silent_Receiver; import com.example.fairuz.AssistUsApp.Utility.RecyclerItem; import com.example.fairuz.AssistUsApp.Utility.SilentAdd; import com.google.firebase.auth.FirebaseUser; import java.io.File; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; import static com.example.fairuz.AssistUsApp.Activities.MainOption.firebaseAuth; import static com.example.fairuz.AssistUsApp.Activities.MainOption.theme; import static com.example.fairuz.AssistUsApp.Activities.SignupActivity.ThemeFlagDir; import static com.example.fairuz.AssistUsApp.Activities.SignupActivity.ThemeFlagParentDir; import static com.example.fairuz.AssistUsApp.Activities.SignupActivity.themeFlag; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.Load; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.Save; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.generateCode; import static com.example.fairuz.AssistUsApp.Utility.SaveAndLoad.updateCalendarFromTo; /** * Created by anika on 9/6/17. */ public class SilentMainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener { public static int SilentFlag = 0, dltSilentFlag = 0; private RecyclerView recyclerView; private MyAdapterSilent adapter; private ImageButton floatButton; private RelativeLayout mainback; DrawerLayout drawerLayout; NavigationView navigation; ActionBarDrawerToggle actionBarDrawerToggle; public static List<RecyclerItem> listItemsSilent = new ArrayList<>(); public static File SilentTitleDir = new File(Environment.getExternalStorageDirectory(), "/AppData/MyDataBase/SilentTitles.txt"); File SilentTitleParentDir = SilentTitleDir.getParentFile(); public static File SilentTimeDir = new File(Environment.getExternalStorageDirectory(), "/AppData/MyDataBase/SilentTimes.txt"); File SilentTimeParentDir = SilentTimeDir.getParentFile(); public static Map<Integer, Calendar> silentMap = new HashMap<Integer, Calendar>(); public static ArrayList<String> savedDataTitleSilent = new ArrayList<String>(); public static ArrayList<String> savedDataSilentTime = new ArrayList<String>(); public void initializer() { isStoragePermissionGranted(); if (SilentTitleParentDir != null) SilentTitleParentDir.mkdirs(); if (SilentTimeParentDir != null) SilentTimeParentDir.mkdirs(); try { if (isStoragePermissionGranted() == true) { savedDataTitleSilent = Load(SilentTitleDir); savedDataSilentTime = Load(SilentTimeDir); listItemsSilent.clear(); for (int j = 0; j < savedDataTitleSilent.size(); j++) { String[] splited = savedDataSilentTime.get(j).trim().split("\\s+"); int sp1 = Integer.parseInt(splited[0]); int sp2 = Integer.parseInt(splited[1]); int sp3 = Integer.parseInt(splited[2]); int sp4 = Integer.parseInt(splited[3]); SimpleDateFormat date12Format = new SimpleDateFormat("h:mm a",Locale.ENGLISH); SimpleDateFormat date24Format = new SimpleDateFormat("H m", Locale.ENGLISH); String TimeStart = date12Format.format(date24Format.parse(sp1+" "+sp2)); String TimeEnd = date12Format.format(date24Format.parse(sp3+" "+sp4)); listItemsSilent.add(new RecyclerItem(savedDataTitleSilent.get(j), TimeStart + " to " + TimeEnd)); } adapter = new MyAdapterSilent(listItemsSilent, this); recyclerView.setAdapter(adapter); } } catch (Exception e) { e.printStackTrace(); } } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == 200) { String silentTitle = data.getExtras().getString("key"); String sitentTimeLayoutFormat = data.getExtras().getString("key2"); String sitentTimeFileFormat = data.getExtras().getString("key3"); try { ArrayList<Calendar> list = updateCalendarFromTo(sitentTimeFileFormat); Calendar calFrom = list.get(0); Calendar calTo = list.get(1); int codeFrom = generateCode(calFrom); int codeTo = generateCode(calTo); SilentAt(calFrom, codeFrom); DisableSilentAt(calTo, codeTo); savedDataTitleSilent.add(silentTitle); savedDataSilentTime.add(sitentTimeFileFormat); Save(SilentTitleDir, savedDataTitleSilent); Save(SilentTimeDir, savedDataSilentTime); if (!silentTitle.equals("") || !sitentTimeLayoutFormat.equals("")) { listItemsSilent.add(new RecyclerItem(silentTitle, sitentTimeLayoutFormat)); } } catch (Exception e) { Toast.makeText(this, "Add: " + e.toString(), Toast.LENGTH_LONG).show(); } } } public void onDestroy() { super.onDestroy(); if (isStoragePermissionGranted() == true) { Save(SilentTitleDir, savedDataTitleSilent); Save(SilentTimeDir, savedDataSilentTime); } else { Toast.makeText(getApplicationContext(), "permission not granted", Toast.LENGTH_SHORT).show(); } } public void onStart() { super.onStart(); initializer(); if( theme ==1 ) setColor(); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); navigation = (NavigationView) findViewById(R.id.nav); navigation.setNavigationItemSelectedListener(this); mainback = (RelativeLayout) findViewById(R.id.mainback); FirebaseUser user = firebaseAuth.getCurrentUser(); TextView txtProfileName = (TextView) navigation.getHeaderView(0).findViewById(R.id.gmail); txtProfileName.setText(""+user.getEmail()); if( theme ==1 ) setColor(); setUpToolBar(); if (SilentFlag == 1) { try { Intent intent = getIntent(); String EditedTitle = intent.getExtras().getString("EditedTitle"); String EditedTimeFileFormat = intent.getExtras().getString("EditedTimeFileFormat"); String PreviousTime = intent.getExtras().getString("PreviousTime"); ArrayList<Calendar> prevList = updateCalendarFromTo(PreviousTime); Calendar prevCalFrom = prevList.get(0); Calendar prevCalTo = prevList.get(1); int prevCodeFrom = generateCode(prevCalFrom); int prevCodeTo = generateCode(prevCalTo); cancelSilent(prevCodeFrom); cancelDisableSilent(prevCodeTo); ArrayList<Calendar> list = updateCalendarFromTo(EditedTimeFileFormat); Calendar calFrom = list.get(0); Calendar calTo = list.get(1); int codeFrom = generateCode(calFrom); int codeTo = generateCode(calTo); SilentAt(calFrom, codeFrom); DisableSilentAt(calTo, codeTo); SilentFlag = 0; finish(); } catch (Exception e) { Toast.makeText(this, "edit: " + e.toString(), Toast.LENGTH_SHORT).show(); } } if (dltSilentFlag == 1) { try { Intent intent = getIntent(); String deletedTime = intent.getExtras().getString("deletedTime"); ArrayList<Calendar> list = updateCalendarFromTo(deletedTime); Calendar calFrom = list.get(0); Calendar calTo = list.get(1); int codeFrom = generateCode(calFrom); int codeTo = generateCode(calTo); cancelSilent(codeFrom); cancelDisableSilent(codeTo); dltSilentFlag = 0; finish(); } catch (Exception e) { Toast.makeText(this, "dlt: " + e.toString(), Toast.LENGTH_LONG).show(); } } recyclerView = (RecyclerView) findViewById(R.id.recyclerView); recyclerView.setHasFixedSize(true); recyclerView.setLayoutManager(new LinearLayoutManager(this)); initializer(); floatButton = (ImageButton) findViewById(R.id.imageButton); floatButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(SilentMainActivity.this, SilentAdd.class); startActivityForResult(intent, 200); } }); } public boolean isStoragePermissionGranted() { if (Build.VERSION.SDK_INT >= 23) { if (checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { //Log.v(TAG,"Permission is granted"); return true; } else { // Log.v(TAG,"Permission is revoked"); ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1); return false; } } else { //permission is automatically granted on sdk<23 upon installation // Log.v(TAG,"Permission is granted"); return true; } } public void SilentAt(Calendar cal, int notificationID) { Intent silentServiceIntent = new Intent(getApplicationContext(), SilentService.class); silentServiceIntent.putExtra("cal", cal); silentServiceIntent.putExtra("notificationID", notificationID); startService(silentServiceIntent); } public void cancelSilent(int notificationID) { AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(getApplicationContext(), Silent_Receiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), notificationID, intent, 0); alarmManager.cancel(pendingIntent); } public void DisableSilentAt(Calendar cal, int notificationID) { Intent disableSilentServiceIntent = new Intent(getApplicationContext(), DisableSilentService.class); disableSilentServiceIntent.putExtra("cal", cal); disableSilentServiceIntent.putExtra("notificationID", notificationID); startService(disableSilentServiceIntent); } public void cancelDisableSilent(int notificationID) { AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent intent = new Intent(getApplicationContext(), Disable_Silent_Receiver.class); PendingIntent pendingIntent = PendingIntent.getBroadcast(getApplicationContext(), notificationID, intent, 0); alarmManager.cancel(pendingIntent); } private void setUpToolBar() { drawerLayout = (DrawerLayout) findViewById(R.id.drawerlayout); actionBarDrawerToggle = new ActionBarDrawerToggle(this,drawerLayout, R.string.app_name, R.string.app_name); drawerLayout.addDrawerListener(actionBarDrawerToggle); actionBarDrawerToggle.syncState(); getSupportActionBar().setDisplayHomeAsUpEnabled(true); } @Override public boolean onOptionsItemSelected(MenuItem item) { if(actionBarDrawerToggle.onOptionsItemSelected(item)) { return true; } return super.onOptionsItemSelected(item); } @Override public boolean onNavigationItemSelected(MenuItem item) { int id = item.getItemId(); switch(id) { case R.id.task: Intent intent = new Intent(SilentMainActivity.this,TaskMainActivity.class); startActivity(intent); finish(); break; case R.id.Ssilent: //Intent intent2 = new Intent(TaskMainActivity.this,SilentMainActivity.class); // startActivity(intent2); break; case R.id.location: Intent intent3 = new Intent(SilentMainActivity.this,MapsActivity.class); startActivity(intent3); finish(); break; case R.id.logout: firebaseAuth.signOut(); finish(); Intent intent4 = new Intent(SilentMainActivity.this, LoginActivity.class); startActivity(intent4); break; case R.id.setting: // Intent intent5 = new Intent(SilentMainActivity.this, settings.class); // startActivity(intent5); AlertDialog.Builder mBuilder = new AlertDialog.Builder(SilentMainActivity.this); final View mView = getLayoutInflater().inflate(R.layout.theme_selector, null); RadioGroup rg = (RadioGroup) mView.findViewById(R.id.rg); Button done = (Button) mView.findViewById(R.id.done); RadioButton light = (RadioButton) mView.findViewById(R.id.light); RadioButton dark = (RadioButton) mView.findViewById(R.id.dark); mBuilder.setView(mView); final AlertDialog dialog = mBuilder.create(); dialog.show(); if(theme==1) light.setChecked(true); else dark.setChecked(true); rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() { @Override public void onCheckedChanged(RadioGroup radioGroup, @IdRes int i) { // rb = (RadioButton) findViewById(i); switch(i) { case R.id.light: theme = 1; if (ThemeFlagParentDir != null) { ThemeFlagParentDir.mkdirs(); if(themeFlag.size()==0) themeFlag.add("1"); } themeFlag.set(0,""+theme); if (isStoragePermissionGranted() == true) { Save(ThemeFlagDir,themeFlag); Toast.makeText(getApplicationContext(), theme+"", Toast.LENGTH_SHORT).show(); } break; case R.id.dark: theme =0; if (ThemeFlagParentDir != null) { ThemeFlagParentDir.mkdirs(); if(themeFlag.size()==0) themeFlag.add("1"); } themeFlag.set(0,""+theme); if (isStoragePermissionGranted() == true) { Save(ThemeFlagDir,themeFlag); Toast.makeText(getApplicationContext(), theme+"", Toast.LENGTH_SHORT).show(); } break; } } }); done.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent intent = new Intent(SilentMainActivity.this, SilentMainActivity.class); startActivity(intent); finish(); dialog.dismiss(); } }); break; } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawerlayout); drawer.closeDrawer(GravityCompat.START); return true; } public void setColor() { mainback.setBackgroundResource(R.color.lightAsh); } }
18,492
0.596907
0.592256
476
36.84874
31.646654
132
false
false
0
0
0
0
0
0
0.686975
false
false
3
72bf2c6725ce09d2c845a13cbba91249c4cd8452
25,383,256,749,529
b95e2fe13ef89d16879e27c71e445b2fe29ee28b
/cn/otfurniture/client/renderer/RenderTVShelf.java
510b23d15412a98be7096214103bbffc28ea1324
[]
no_license
Mrkwtkr/HorrorFurniture
https://github.com/Mrkwtkr/HorrorFurniture
e305a607b938686e029066af435238f47ac6a136
83128e995fcb7bb3e10d4724b143e866c393cc70
refs/heads/master
2020-12-11T01:39:32.210000
2014-09-21T14:54:32
2014-09-21T14:54:32
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ package cn.otfurniture.client.renderer; import cn.liutils.api.client.model.ITileEntityModel; import cn.liutils.api.client.model.TileEntityModelCustom; import cn.liutils.api.client.render.RenderTileModelSided; import cn.otfurniture.proxy.OFClientProps; /** * @author FolD * */ public class RenderTVShelf extends RenderTileModelSided { /** * @param mdl */ public RenderTVShelf() { super(new TileEntityModelCustom(OFClientProps.MDL_TVSHELF)); setScale(0.07F); } }
UTF-8
Java
491
java
RenderTVShelf.java
Java
[ { "context": "n.otfurniture.proxy.OFClientProps;\n\n/**\n * @author FolD\n *\n */\npublic class RenderTVShelf extends RenderT", "end": 285, "score": 0.9995101690292358, "start": 281, "tag": "USERNAME", "value": "FolD" } ]
null
[]
/** * */ package cn.otfurniture.client.renderer; import cn.liutils.api.client.model.ITileEntityModel; import cn.liutils.api.client.model.TileEntityModelCustom; import cn.liutils.api.client.render.RenderTileModelSided; import cn.otfurniture.proxy.OFClientProps; /** * @author FolD * */ public class RenderTVShelf extends RenderTileModelSided { /** * @param mdl */ public RenderTVShelf() { super(new TileEntityModelCustom(OFClientProps.MDL_TVSHELF)); setScale(0.07F); } }
491
0.749491
0.743381
25
18.639999
22.225895
62
false
false
0
0
0
0
0
0
0.64
false
false
3
2d498386d009a864e29a477aeba4467ddd2223fb
20,701,742,411,023
8fa99147d4acb87b0e1e979c439bc171588a7209
/Assignment4/src/org/test/EvenNumber.java
b22560dccc3aaad0caa1a532f1a5684a66232992
[]
no_license
anarseakki07/Java_Assignments
https://github.com/anarseakki07/Java_Assignments
4e979a8f06a500ee9ab734753c07875e55be3942
73d4c33016cb017df93820d7ada750825729a729
refs/heads/master
2023-08-01T07:49:07.802000
2021-09-15T17:11:12
2021-09-15T17:11:12
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * QUESTION 3: ------------ Description: Write a program to print even number from 1 to 100 Example: --------- Output = 2,4,....100 */ package org.test; public class EvenNumber { public static void main(String[] args) { for (int i = 1; i <= 100; i ++) { if (i%2 == 0) { System.out.println(i); } } } }
UTF-8
Java
356
java
EvenNumber.java
Java
[]
null
[]
/* * QUESTION 3: ------------ Description: Write a program to print even number from 1 to 100 Example: --------- Output = 2,4,....100 */ package org.test; public class EvenNumber { public static void main(String[] args) { for (int i = 1; i <= 100; i ++) { if (i%2 == 0) { System.out.println(i); } } } }
356
0.5
0.455056
23
13.478261
15.71449
64
false
false
0
0
0
0
0
0
1.217391
false
false
3
fa8977cd2be4962031d2bbeb101c0fd8dc17932b
4,552,665,380,046
589eebe2a6b591757bee477236010dec81360e1b
/BookingService/src/main/java/com/entities/entity/install/InstallCompanyUserDMO.java
a54a6311a8137799c8110258be5a32b82c004447
[]
no_license
ecalderonpinto/BookingService
https://github.com/ecalderonpinto/BookingService
f515f7d293c8578ff95d21c50cd7ea8881fd7d3d
b4f340798af750d6ae42fda3a5bf2c5618483668
refs/heads/master
2021-01-19T04:08:35.341000
2016-06-30T09:16:48
2016-06-30T09:16:48
62,296,457
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.entities.entity.install; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.security.authentication.encoding.Md5PasswordEncoder; import com.entities.dao.reportingtool.CompanyDAO; import com.entities.dao.reportingtool.DepartmentDAO; import com.entities.dao.usermanager.UserDAO; import com.entities.dao.usermanager.UserRolDAO; import com.entities.entity.reportingtool.Company; import com.entities.entity.reportingtool.Department; import com.entities.entity.usermanager.User; import com.entities.utilities.hibernate.VersionAuditor; public class InstallCompanyUserDMO implements InstallAdapter { private ApplicationContext applicationContext; private static final Logger logger = LoggerFactory .getLogger(InstallCompanyUserDMO.class); public InstallCompanyUserDMO(ApplicationContext applicationContext) { this.applicationContext = applicationContext; } public void install() { VersionAuditor versionAdmin = new VersionAuditor("admin"); try { // DMO Company Company company = new Company("AMLCheck Software", "Spain", "AML", "", versionAdmin); Department department = new Department(company, "Anti Money Laundry ", "AML", "", "Spain", new VersionAuditor("admin")); // ///////////////////////////////////////////////////////////////// // DAO CompanyDAO companyDAO = (CompanyDAO) applicationContext .getBean("companyDAO"); companyDAO.create(company); DepartmentDAO departmentDAO = (DepartmentDAO) applicationContext .getBean("departmentDAO"); departmentDAO.create(department); // USERS Md5PasswordEncoder md5 = new Md5PasswordEncoder(); String userPass1 = md5.encodePassword("super", null); User user1 = new User("amlcheck.super", "userName", "userLastName", "user@company.com", userPass1); user1.setCompany(company); UserDAO userDAO = (UserDAO) applicationContext.getBean("userDAO"); userDAO.create(user1); // USER_ROLE UserRolDAO userRolDAO = (UserRolDAO) applicationContext .getBean("userRolDAO"); List<String> userRoles = new ArrayList<String>(); userRoles .add("Insert into T_USER_ROLE (ROLENAME,USERNAME) values ('ROLE_USER','amlcheck.super') "); userRolDAO.insertUserRoles(userRoles); } catch (Exception e) { logger.error("Error in InstallCompanyUserDMO: " + e.getMessage()); } } }
UTF-8
Java
2,567
java
InstallCompanyUserDMO.java
Java
[ { "context": "word(\"super\", null);\r\n\r\n\t\t\tUser user1 = new User(\"amlcheck.super\", \"userName\", \"userLastName\",\r\n\t\t\t\t\t\"u", "end": 1919, "score": 0.7269003987312317, "start": 1916, "tag": "USERNAME", "value": "aml" }, { "context": ");\r\n\r\n\t\t\tUser user1 = new User(\"amlcheck.super\", \"userName\", \"userLastName\",\r\n\t\t\t\t\t\"user@company.com\", userP", "end": 1942, "score": 0.9969532489776611, "start": 1934, "tag": "USERNAME", "value": "userName" }, { "context": "r user1 = new User(\"amlcheck.super\", \"userName\", \"userLastName\",\r\n\t\t\t\t\t\"user@company.com\", userPass1);\r\n\t\t\tuser1", "end": 1958, "score": 0.9731584787368774, "start": 1946, "tag": "USERNAME", "value": "userLastName" }, { "context": "lcheck.super\", \"userName\", \"userLastName\",\r\n\t\t\t\t\t\"user@company.com\", userPass1);\r\n\t\t\tuser1.setCompany(company);\r\n\r\n\t", "end": 1984, "score": 0.9999243021011353, "start": 1968, "tag": "EMAIL", "value": "user@company.com" } ]
null
[]
package com.entities.entity.install; import java.util.ArrayList; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; import org.springframework.security.authentication.encoding.Md5PasswordEncoder; import com.entities.dao.reportingtool.CompanyDAO; import com.entities.dao.reportingtool.DepartmentDAO; import com.entities.dao.usermanager.UserDAO; import com.entities.dao.usermanager.UserRolDAO; import com.entities.entity.reportingtool.Company; import com.entities.entity.reportingtool.Department; import com.entities.entity.usermanager.User; import com.entities.utilities.hibernate.VersionAuditor; public class InstallCompanyUserDMO implements InstallAdapter { private ApplicationContext applicationContext; private static final Logger logger = LoggerFactory .getLogger(InstallCompanyUserDMO.class); public InstallCompanyUserDMO(ApplicationContext applicationContext) { this.applicationContext = applicationContext; } public void install() { VersionAuditor versionAdmin = new VersionAuditor("admin"); try { // DMO Company Company company = new Company("AMLCheck Software", "Spain", "AML", "", versionAdmin); Department department = new Department(company, "Anti Money Laundry ", "AML", "", "Spain", new VersionAuditor("admin")); // ///////////////////////////////////////////////////////////////// // DAO CompanyDAO companyDAO = (CompanyDAO) applicationContext .getBean("companyDAO"); companyDAO.create(company); DepartmentDAO departmentDAO = (DepartmentDAO) applicationContext .getBean("departmentDAO"); departmentDAO.create(department); // USERS Md5PasswordEncoder md5 = new Md5PasswordEncoder(); String userPass1 = md5.encodePassword("super", null); User user1 = new User("amlcheck.super", "userName", "userLastName", "<EMAIL>", userPass1); user1.setCompany(company); UserDAO userDAO = (UserDAO) applicationContext.getBean("userDAO"); userDAO.create(user1); // USER_ROLE UserRolDAO userRolDAO = (UserRolDAO) applicationContext .getBean("userRolDAO"); List<String> userRoles = new ArrayList<String>(); userRoles .add("Insert into T_USER_ROLE (ROLENAME,USERNAME) values ('ROLE_USER','amlcheck.super') "); userRolDAO.insertUserRoles(userRoles); } catch (Exception e) { logger.error("Error in InstallCompanyUserDMO: " + e.getMessage()); } } }
2,558
0.709388
0.704714
84
28.559525
25.868877
96
false
false
0
0
0
0
65
0.025321
2.107143
false
false
3
5b44cf12cc3bf24eed1e68eecc72a1e74dea0470
18,382,460,085,337
93fbdf16b0ab8da221b8960baf7d85d056760fb8
/src/dev/vbms/autopilot/core/Application.java
e655655dfcced97196ae91fb49516baa907dc718
[]
no_license
vbms11/vbmsautopilot
https://github.com/vbms11/vbmsautopilot
0bab922b02fa8c81e6ca8e04dfefad9b5744dd58
de9ce8d91e3df676a1f14f1a6eb422af78aa6f80
refs/heads/master
2021-01-15T13:18:16.933000
2013-06-30T08:14:43
2013-06-30T08:14:43
37,533,794
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package dev.vbms.autopilot.core; import dev.vbms.autopilot.gui.ApplicationFrame; import javax.swing.JFrame; public class Application { public static void main(String args[]) { initEnv(); java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run () { new ApplicationFrame().setVisible(true); } }); } public static void initEnv () { JFrame.setDefaultLookAndFeelDecorated(true); try { //UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel()); } catch (Exception e) { } } }
UTF-8
Java
684
java
Application.java
Java
[]
null
[]
package dev.vbms.autopilot.core; import dev.vbms.autopilot.gui.ApplicationFrame; import javax.swing.JFrame; public class Application { public static void main(String args[]) { initEnv(); java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run () { new ApplicationFrame().setVisible(true); } }); } public static void initEnv () { JFrame.setDefaultLookAndFeelDecorated(true); try { //UIManager.setLookAndFeel(new SubstanceBusinessBlackSteelLookAndFeel()); } catch (Exception e) { } } }
684
0.565789
0.565789
25
25.360001
21.786015
85
false
false
0
0
0
0
0
0
0.32
false
false
3
d138a3d8c7b9b931182f6b14a25905becd154ae1
17,858,474,067,780
f161aee2c9c95d49d38427c222af78534e427763
/MyShop/src/main/java/kr/daoko/service/GoodsServiceImpl.java
4e8bc6abae2def43eeb813d78547d935c324b7d8
[]
no_license
macarpig/MyShop-BO
https://github.com/macarpig/MyShop-BO
e41ba58e850abf523e444570510674cf062974da
b2a610e35ee276fbb289d290e5099a985a4edce1
refs/heads/master
2023-02-27T15:40:05.309000
2021-02-10T15:32:17
2021-02-10T15:32:17
309,918,397
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package kr.daoko.service; import java.util.List; import javax.inject.Inject; import org.springframework.stereotype.Service; import kr.daoko.dao.GoodsDAO; import kr.daoko.dto.GoodsDTO; @Service public class GoodsServiceImpl implements GoodsService { @Inject private GoodsDAO dao; //상품 관리 목록 @Override public List<GoodsDTO> goodsManage() throws Exception { return dao.goodsManage(); } @Override //상품 조회 public GoodsDTO goodsView(String gdsCode) throws Exception { return dao.goodsView(gdsCode); } // 상품 추가 @Override public void addProduct(GoodsDTO dto) throws Exception { dao.addProduct(dto); } @Override //상품 수정 public void modifyGoods(GoodsDTO dto) throws Exception { dao.modifyGoods(dto); } //상품 삭제 @Override public void deleteGoods(String gdsCode) throws Exception { dao.deleteGoods(gdsCode); } //상품 총 개수 @Override public int productCount() throws Exception { return dao.productCount(); } }
UTF-8
Java
1,003
java
GoodsServiceImpl.java
Java
[]
null
[]
package kr.daoko.service; import java.util.List; import javax.inject.Inject; import org.springframework.stereotype.Service; import kr.daoko.dao.GoodsDAO; import kr.daoko.dto.GoodsDTO; @Service public class GoodsServiceImpl implements GoodsService { @Inject private GoodsDAO dao; //상품 관리 목록 @Override public List<GoodsDTO> goodsManage() throws Exception { return dao.goodsManage(); } @Override //상품 조회 public GoodsDTO goodsView(String gdsCode) throws Exception { return dao.goodsView(gdsCode); } // 상품 추가 @Override public void addProduct(GoodsDTO dto) throws Exception { dao.addProduct(dto); } @Override //상품 수정 public void modifyGoods(GoodsDTO dto) throws Exception { dao.modifyGoods(dto); } //상품 삭제 @Override public void deleteGoods(String gdsCode) throws Exception { dao.deleteGoods(gdsCode); } //상품 총 개수 @Override public int productCount() throws Exception { return dao.productCount(); } }
1,003
0.736565
0.736565
52
17.25
18.593708
61
false
false
0
0
0
0
0
0
1.096154
false
false
3
42e69e7a7c8eacff2cfd75b1d200340f8987d171
22,101,901,748,985
b3358c19e766c3f788c9445c892addc776269f46
/src/main/java/com/wsterling/util/FileFilters.java
620963752fecf267a972a331a023e399d3471bd7
[]
no_license
wsterling34/PhotoOrganizer
https://github.com/wsterling34/PhotoOrganizer
1519c8973f1192f125e0209d451790c9c4facf36
db5b75037a169fc1ec14ebccc4050f32797d0f7b
refs/heads/master
2020-07-30T10:41:02.928000
2019-09-24T01:48:51
2019-09-24T01:48:51
210,197,219
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.wsterling.util; import com.google.common.collect.Sets; import com.wsterling.photos2.FolderParsers; import java.io.FileFilter; import java.util.Set; public class FileFilters { static FileFilter all() { return file -> true; } public static final Set<String> photoExtensions = Sets.newHashSet("jpg", "png", "mov", "raw", "mts", "arw", "heic"); public static FileFilter startsWithFilter(final String s) { return file -> file.getName().startsWith(s); } public static FileFilter notDirectory() { return file -> !file.isDirectory(); } public static FileFilter dirFilter() { return file -> file.isDirectory(); } public static final FileFilter photoFileFilter = file -> { if (file.getName().startsWith(".") || file.isDirectory()) { return false; } String[] tokenedName = file.getName().split("\\."); if (tokenedName.length < 2) { return false; } String ext = tokenedName[tokenedName.length-1].toLowerCase(); if (photoExtensions.contains(ext)) { return true; } else { return false; } }; public static FileFilter getPhotoFolderFilter() { return pathname -> { if (FolderParsers.getFolderBasedDate(pathname) != null) { return true; } else { return false; } }; } }
UTF-8
Java
1,585
java
FileFilters.java
Java
[]
null
[]
package com.wsterling.util; import com.google.common.collect.Sets; import com.wsterling.photos2.FolderParsers; import java.io.FileFilter; import java.util.Set; public class FileFilters { static FileFilter all() { return file -> true; } public static final Set<String> photoExtensions = Sets.newHashSet("jpg", "png", "mov", "raw", "mts", "arw", "heic"); public static FileFilter startsWithFilter(final String s) { return file -> file.getName().startsWith(s); } public static FileFilter notDirectory() { return file -> !file.isDirectory(); } public static FileFilter dirFilter() { return file -> file.isDirectory(); } public static final FileFilter photoFileFilter = file -> { if (file.getName().startsWith(".") || file.isDirectory()) { return false; } String[] tokenedName = file.getName().split("\\."); if (tokenedName.length < 2) { return false; } String ext = tokenedName[tokenedName.length-1].toLowerCase(); if (photoExtensions.contains(ext)) { return true; } else { return false; } }; public static FileFilter getPhotoFolderFilter() { return pathname -> { if (FolderParsers.getFolderBasedDate(pathname) != null) { return true; } else { return false; } }; } }
1,585
0.535016
0.533123
55
27.818182
24.853821
120
false
false
0
0
0
0
0
0
0.509091
false
false
3
c76e0486e82dd366df0481eedc57cd5678d36288
2,439,541,469,974
9ed919eba5314c8496e1babf24194645b356e9d0
/src/main/java/com/checkers/domain/vo/InOutObjectStreams.java
d30af5006b54e18b86e5e12d51695270e993c226
[]
no_license
wepp/CheckersServer
https://github.com/wepp/CheckersServer
f2b5d76587c8a10a5bc9357ac9643a3e014a0c4e
c51352f47756721bb9f99375f3e631b8fcf77115
refs/heads/master
2021-01-10T01:39:05.017000
2015-12-03T20:24:16
2015-12-03T20:24:16
43,509,793
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.checkers.domain.vo; import java.io.EOFException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.Socket; /** * Created by Eugene on 07.11.2015. */ public class InOutObjectStreams { private Socket white; private ObjectOutputStream outObjWhite; private ObjectInputStream inObjectWhite; public InOutObjectStreams(Socket white) throws IOException { this.white = white; this.outObjWhite = new ObjectOutputStream(white.getOutputStream()); this.inObjectWhite = new ObjectInputStream(white.getInputStream()); } public void setWhite(Socket white) { this.white = white; } public ObjectOutputStream getOutObjWhite() { return outObjWhite; } public ObjectInputStream getInObjectWhite() { return inObjectWhite; } public void writeObject(Object currentField) throws IOException { outObjWhite.writeObject(currentField); } public Object readObject() throws IOException, ClassNotFoundException { try { return inObjectWhite.readObject(); }catch (EOFException ex1){ return null; } } public void close() throws IOException { inObjectWhite.close(); outObjWhite.close(); } public String waitForName() throws IOException, ClassNotFoundException { return (String) readObject(); } }
UTF-8
Java
1,452
java
InOutObjectStreams.java
Java
[ { "context": "Stream;\nimport java.net.Socket;\n\n/**\n * Created by Eugene on 07.11.2015.\n */\npublic class InOutObjectStream", "end": 208, "score": 0.6859471201896667, "start": 202, "tag": "NAME", "value": "Eugene" } ]
null
[]
package com.checkers.domain.vo; import java.io.EOFException; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.Socket; /** * Created by Eugene on 07.11.2015. */ public class InOutObjectStreams { private Socket white; private ObjectOutputStream outObjWhite; private ObjectInputStream inObjectWhite; public InOutObjectStreams(Socket white) throws IOException { this.white = white; this.outObjWhite = new ObjectOutputStream(white.getOutputStream()); this.inObjectWhite = new ObjectInputStream(white.getInputStream()); } public void setWhite(Socket white) { this.white = white; } public ObjectOutputStream getOutObjWhite() { return outObjWhite; } public ObjectInputStream getInObjectWhite() { return inObjectWhite; } public void writeObject(Object currentField) throws IOException { outObjWhite.writeObject(currentField); } public Object readObject() throws IOException, ClassNotFoundException { try { return inObjectWhite.readObject(); }catch (EOFException ex1){ return null; } } public void close() throws IOException { inObjectWhite.close(); outObjWhite.close(); } public String waitForName() throws IOException, ClassNotFoundException { return (String) readObject(); } }
1,452
0.683884
0.677686
56
24.928572
22.95248
76
false
false
0
0
0
0
0
0
0.410714
false
false
3
5c4d5da24ebc9faf58b352991dc7b428601183ac
11,819,750,056,941
2b6801f1df459b604fc48ff3e874387dcf84eda7
/src/main/java/sg/gov/csit/knowledgeGraph/domain/Unused/Edge.java
02f59efb5b9bfbcc43758e7020549da8829bfe9b
[]
no_license
thadjunyi/knowledge-graph-backend
https://github.com/thadjunyi/knowledge-graph-backend
0432dd5afb8393fe122719ef1d26aeb9212cc13c
6af097bc07c6185b53f29a9345660851dd61763a
refs/heads/main
2023-06-21T13:44:46.626000
2021-06-25T03:17:14
2021-06-25T03:17:14
380,107,539
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package sg.gov.csit.knowledgeGraph.domain.Unused; import org.springframework.data.neo4j.core.schema.GeneratedValue; import org.springframework.data.neo4j.core.schema.Id; public class Edge { @Id @GeneratedValue private Long id; private String label; private Long from; private Long to; private String value; public Long getId() { return this.id; } public void setLabel(String label) { this.label = label; } public String getLabel() { return this.label; } public void setFrom(Long from) { this.from = from; } public Long getFrom() { return this.from; } public void setTo(Long to) { this.to = to; } public Long getTo() { return this.to; } public void setValue(String value) { this.value = value; } public String getValue() { return this.value; } public Edge() { } public Edge(String label, Long from, Long to) { this.label = label; this.from = from; this.to = to; } public Edge(String label, Long from, Long to, String value) { this.label = label; this.from = from; this.to = to; this.value = value; } }
UTF-8
Java
1,269
java
Edge.java
Java
[]
null
[]
package sg.gov.csit.knowledgeGraph.domain.Unused; import org.springframework.data.neo4j.core.schema.GeneratedValue; import org.springframework.data.neo4j.core.schema.Id; public class Edge { @Id @GeneratedValue private Long id; private String label; private Long from; private Long to; private String value; public Long getId() { return this.id; } public void setLabel(String label) { this.label = label; } public String getLabel() { return this.label; } public void setFrom(Long from) { this.from = from; } public Long getFrom() { return this.from; } public void setTo(Long to) { this.to = to; } public Long getTo() { return this.to; } public void setValue(String value) { this.value = value; } public String getValue() { return this.value; } public Edge() { } public Edge(String label, Long from, Long to) { this.label = label; this.from = from; this.to = to; } public Edge(String label, Long from, Long to, String value) { this.label = label; this.from = from; this.to = to; this.value = value; } }
1,269
0.576832
0.575256
72
16.625
15.460018
65
false
false
0
0
0
0
0
0
0.736111
false
false
3
e37328a9816222dd13313d5b5eeae4493ce4d046
11,768,210,433,177
80e8979b9bc22a2e0acfba8024eb9819fafe156d
/circle_web/src/com/circle/service/goodtype/IGoodTypeService.java
7fd438d9e3683edcbe128ab9deed5f0711d1496b
[]
no_license
liyq1406/circle_web
https://github.com/liyq1406/circle_web
ba97a1056e9f63e71e7e870349220759f835615f
41cb7b7975fb36859d857b1fa154c1fb73b81307
refs/heads/master
2021-01-21T18:57:47.577000
2015-08-28T02:58:22
2015-08-28T02:58:22
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.circle.service.goodtype; import java.util.List; import java.util.Map; import com.circle.pojo.goodtype.GoodType; import com.xwtec.xwserver.exception.SPTException; public interface IGoodTypeService { /** * 查询商品类型列表数据 * @return * @throws SPTException */ public List<Map<String, Object>> queryGoodTypes() throws SPTException; /**保存商品类型信息 * @param goodType * @param argStr * @param attrStr * @return */ public boolean save(GoodType goodType, String argStr, String attrStr); /** * 查询商品类型 * @param id * @return */ public GoodType getGoodType(String id) throws SPTException; /** * 查询商品类型参数 * @param id * @return */ public List<Map<String, Object>> getGoodTypeArg(String type_id) throws SPTException; /** * 查询商品类型属性 * @param id * @return */ public List<Map<String, Object>> getGoodTypeAttr(String type_id) throws SPTException; }
UTF-8
Java
977
java
IGoodTypeService.java
Java
[]
null
[]
package com.circle.service.goodtype; import java.util.List; import java.util.Map; import com.circle.pojo.goodtype.GoodType; import com.xwtec.xwserver.exception.SPTException; public interface IGoodTypeService { /** * 查询商品类型列表数据 * @return * @throws SPTException */ public List<Map<String, Object>> queryGoodTypes() throws SPTException; /**保存商品类型信息 * @param goodType * @param argStr * @param attrStr * @return */ public boolean save(GoodType goodType, String argStr, String attrStr); /** * 查询商品类型 * @param id * @return */ public GoodType getGoodType(String id) throws SPTException; /** * 查询商品类型参数 * @param id * @return */ public List<Map<String, Object>> getGoodTypeArg(String type_id) throws SPTException; /** * 查询商品类型属性 * @param id * @return */ public List<Map<String, Object>> getGoodTypeAttr(String type_id) throws SPTException; }
977
0.696767
0.696767
47
18.085106
22.596205
86
false
false
0
0
0
0
0
0
1.06383
false
false
3
6361953345399c7c493b140e11667edcc8126d7d
6,064,493,880,482
72db41fd75ba7dff9219fa90f8d64099305c955c
/OOP/MyOOP_1.java
05edd873aa0e1737bd911df8aa52d687f5809ce5
[]
no_license
yhlee002/Open_tutorials_Java
https://github.com/yhlee002/Open_tutorials_Java
727e09f5136854d1a24e8540c9e25d177ce01022
d1660e7186befdc3bc9d7fb735ea617c869faff5
refs/heads/master
2022-11-24T16:45:00.152000
2020-08-04T06:55:37
2020-08-04T06:55:37
284,865,548
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package OOP; public class MyOOP_1 { public static String delimiter = ""; //참조하는 클래스 안의 변수는 가져온 곳에서 사용할 수 없으므로 클래스 변수에 선언하여 클래스에 속하는 여러 메소드에서 사용할 수 있다. public static void main(String[] args) { delimiter = "----"; printA(); printA(); printB(); printB(); printA(); printA(); printB(); printB(); } public static void printA() { System.out.println(delimiter); System.out.println("A"); System.out.println("A"); } public static void printB() { System.out.println(delimiter); System.out.println("B"); System.out.println("B"); } //-->첫번째 방법 // //아래 네 줄은 구분자로서----을 넣고 싶은 경우 // printA("----"); // printA("----"); // printB("----"); // printB("----"); // // //아래 네 줄은 구분자로서 ****을 넣고 싶은 경우 // printA("****"); // printA("****"); // printB("****"); // printB("****"); // } // public static void printA(String delimiter) { // System.out.println(delimiter); // System.out.println("A"); // System.out.println("A"); // } // public static void printB(String delimiter) { // System.out.println(delimiter); // System.out.println("B"); // System.out.println("B"); // } //-->두번째 방법 // String delimiter2 = "-----"; //-->인자로 변수를 주는 방법 // printA1(delimiter2); // printA1(delimiter2); // printB1(delimiter2); // printB1(delimiter2); // // delimiter2 = "****"; // printA1(delimiter2); // printA1(delimiter2); // printB1(delimiter2); // printB1(delimiter2); //} //public static void printA1() { // System.out.println(delimiter2); // System.out.println("A1"); // System.out.println("A1"); // } //public static void printB1() { // System.out.println(delimiter2); // System.out.println("B1"); // System.out.println("B1"); }
UTF-8
Java
1,901
java
MyOOP_1.java
Java
[]
null
[]
package OOP; public class MyOOP_1 { public static String delimiter = ""; //참조하는 클래스 안의 변수는 가져온 곳에서 사용할 수 없으므로 클래스 변수에 선언하여 클래스에 속하는 여러 메소드에서 사용할 수 있다. public static void main(String[] args) { delimiter = "----"; printA(); printA(); printB(); printB(); printA(); printA(); printB(); printB(); } public static void printA() { System.out.println(delimiter); System.out.println("A"); System.out.println("A"); } public static void printB() { System.out.println(delimiter); System.out.println("B"); System.out.println("B"); } //-->첫번째 방법 // //아래 네 줄은 구분자로서----을 넣고 싶은 경우 // printA("----"); // printA("----"); // printB("----"); // printB("----"); // // //아래 네 줄은 구분자로서 ****을 넣고 싶은 경우 // printA("****"); // printA("****"); // printB("****"); // printB("****"); // } // public static void printA(String delimiter) { // System.out.println(delimiter); // System.out.println("A"); // System.out.println("A"); // } // public static void printB(String delimiter) { // System.out.println(delimiter); // System.out.println("B"); // System.out.println("B"); // } //-->두번째 방법 // String delimiter2 = "-----"; //-->인자로 변수를 주는 방법 // printA1(delimiter2); // printA1(delimiter2); // printB1(delimiter2); // printB1(delimiter2); // // delimiter2 = "****"; // printA1(delimiter2); // printA1(delimiter2); // printB1(delimiter2); // printB1(delimiter2); //} //public static void printA1() { // System.out.println(delimiter2); // System.out.println("A1"); // System.out.println("A1"); // } //public static void printB1() { // System.out.println(delimiter2); // System.out.println("B1"); // System.out.println("B1"); }
1,901
0.585961
0.569899
78
20.551283
16.69688
116
false
false
0
0
0
0
0
0
2.089744
false
false
3
611ab1f806a83b279afdd6a0afdbc447912d9f9f
2,894,808,015,706
de2e77a2d79fd6599b718f3bc6b5b93b2341d1d7
/hfut-fr/src/main/java/edu/hfut/fr/image/processing/face/recognition/benchmarking/dataset/TextFileDataset.java
2fa917774a25a73c526c995462ab2ed3d667d8d1
[]
no_license
education-service/hfut-face-plate
https://github.com/education-service/hfut-face-plate
0100c91c401d7cb72c3cd11f9ae4aa87e1ee172f
094d865d060f8a10ba6f162ff35d4ec5d9a012d1
refs/heads/master
2016-09-11T07:07:15.740000
2015-11-29T13:40:51
2015-11-29T13:40:51
30,165,805
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.hfut.fr.image.processing.face.recognition.benchmarking.dataset; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.AbstractList; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import org.openimaj.data.dataset.ListBackedDataset; import org.openimaj.data.dataset.ListDataset; import org.openimaj.data.dataset.MapBackedDataset; import org.openimaj.image.FImage; import org.openimaj.image.ImageUtilities; /** * 目标人物与他们对应的图片的数据集 * *@author jimbo */ public class TextFileDataset extends MapBackedDataset<String, ListDataset<FImage>, FImage> { private class LazyImageList extends AbstractList<FImage> { List<File> files = new ArrayList<File>(); @Override public FImage get(int index) { File f = files.get(index); if (f.isAbsolute()) { try { return ImageUtilities.readF(f); } catch (IOException e) { logger.warn(e); return null; } } else { try { return ImageUtilities.readF(new File(file.getParentFile(), f.toString())); } catch (IOException e) { logger.warn(e); return null; } } } @Override public int size() { return files.size(); } @Override public String toString() { return files.toString(); } } private static final Logger logger = Logger.getLogger(TextFileDataset.class); private String separator = ","; File file; BufferedWriter writer; /** * 使用指定文件进行初始化 */ public TextFileDataset(File file) throws IOException { this(file, ","); } /** * 构造函数 */ public TextFileDataset(File file, String separator) throws IOException { this.file = file; this.separator = separator; if (file.exists()) read(); else openWriter(); } @Override protected void finalize() throws Throwable { if (writer != null) { try { writer.close(); } catch (IOException e) { } } super.finalize(); } private void read() throws IOException { BufferedReader br = null; try { br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { String[] parts = line.split(separator); addInternal(parts[0].trim(), new File(parts[1].trim())); } } finally { if (br != null) try { br.close(); } catch (IOException e) { } } } private void addInternal(String person, File file) { ListBackedDataset<FImage> list = (ListBackedDataset<FImage>) map.get(person); if (list == null) map.put(person, list = new ListBackedDataset<FImage>(new LazyImageList())); ((LazyImageList) list.getList()).files.add(file); } /** * 向数据集中添加一个实例 */ public void add(String person, File file) throws IOException { if (writer == null) openWriter(); writer.write(person + separator + file.getAbsolutePath() + "\n"); writer.flush(); addInternal(person, file); } private void openWriter() throws IOException { try { writer = new BufferedWriter(new FileWriter(file, true)); } catch (IOException e) { writer = null; throw e; } } @Override public String toString() { return "Text File Dataset (" + file + ")"; } }
UTF-8
Java
3,312
java
TextFileDataset.java
Java
[ { "context": "geUtilities;\n\n/**\n * 目标人物与他们对应的图片的数据集\n *\n *@author jimbo\n */\npublic class TextFileDataset extends MapBacke", "end": 625, "score": 0.9993934035301208, "start": 620, "tag": "USERNAME", "value": "jimbo" } ]
null
[]
package edu.hfut.fr.image.processing.face.recognition.benchmarking.dataset; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.AbstractList; import java.util.ArrayList; import java.util.List; import org.apache.log4j.Logger; import org.openimaj.data.dataset.ListBackedDataset; import org.openimaj.data.dataset.ListDataset; import org.openimaj.data.dataset.MapBackedDataset; import org.openimaj.image.FImage; import org.openimaj.image.ImageUtilities; /** * 目标人物与他们对应的图片的数据集 * *@author jimbo */ public class TextFileDataset extends MapBackedDataset<String, ListDataset<FImage>, FImage> { private class LazyImageList extends AbstractList<FImage> { List<File> files = new ArrayList<File>(); @Override public FImage get(int index) { File f = files.get(index); if (f.isAbsolute()) { try { return ImageUtilities.readF(f); } catch (IOException e) { logger.warn(e); return null; } } else { try { return ImageUtilities.readF(new File(file.getParentFile(), f.toString())); } catch (IOException e) { logger.warn(e); return null; } } } @Override public int size() { return files.size(); } @Override public String toString() { return files.toString(); } } private static final Logger logger = Logger.getLogger(TextFileDataset.class); private String separator = ","; File file; BufferedWriter writer; /** * 使用指定文件进行初始化 */ public TextFileDataset(File file) throws IOException { this(file, ","); } /** * 构造函数 */ public TextFileDataset(File file, String separator) throws IOException { this.file = file; this.separator = separator; if (file.exists()) read(); else openWriter(); } @Override protected void finalize() throws Throwable { if (writer != null) { try { writer.close(); } catch (IOException e) { } } super.finalize(); } private void read() throws IOException { BufferedReader br = null; try { br = new BufferedReader(new FileReader(file)); String line; while ((line = br.readLine()) != null) { String[] parts = line.split(separator); addInternal(parts[0].trim(), new File(parts[1].trim())); } } finally { if (br != null) try { br.close(); } catch (IOException e) { } } } private void addInternal(String person, File file) { ListBackedDataset<FImage> list = (ListBackedDataset<FImage>) map.get(person); if (list == null) map.put(person, list = new ListBackedDataset<FImage>(new LazyImageList())); ((LazyImageList) list.getList()).files.add(file); } /** * 向数据集中添加一个实例 */ public void add(String person, File file) throws IOException { if (writer == null) openWriter(); writer.write(person + separator + file.getAbsolutePath() + "\n"); writer.flush(); addInternal(person, file); } private void openWriter() throws IOException { try { writer = new BufferedWriter(new FileWriter(file, true)); } catch (IOException e) { writer = null; throw e; } } @Override public String toString() { return "Text File Dataset (" + file + ")"; } }
3,312
0.671004
0.670074
156
19.692308
20.947008
92
false
false
0
0
0
0
0
0
2.00641
false
false
3
a2fee30ab48fea0f898316771c76cbc1a990e41a
16,939,351,070,265
9757bbb318fa245dcdb099ce356ddbeff5f2fbaf
/src/main/java/g2001_2100/s2100_find_good_days_to_rob_the_bank/Solution.java
91caf9354fee52267a824ab757244197f8c08287
[ "MIT" ]
permissive
javadev/LeetCode-in-Java
https://github.com/javadev/LeetCode-in-Java
181aebf56caa51a4442f07466e89b869aa217424
413de2cb56123d3844a1b142eec7e9a8182c78fb
refs/heads/main
2023-08-31T01:46:52.740000
2023-08-30T08:45:06
2023-08-30T08:45:06
426,947,282
103
57
MIT
false
2023-09-14T08:08:08
2021-11-11T09:46:12
2023-09-12T18:14:49
2023-09-14T08:08:07
8,748
91
44
0
Java
false
false
package g2001_2100.s2100_find_good_days_to_rob_the_bank; // #Medium #Array #Dynamic_Programming #Prefix_Sum // #2022_05_17_Time_13_ms_(46.46%)_Space_99.4_MB_(51.27%) import java.util.ArrayList; import java.util.List; public class Solution { public List<Integer> goodDaysToRobBank(int[] security, int time) { int n = security.length; // dec: # of non-increasing elements before [i] // inc: # of non-decreasing elements after [i] int[] dec = new int[n]; int[] inc = new int[n]; for (int i = 1; i < n; i++) { if (security[i] <= security[i - 1]) { dec[i] = dec[i - 1] + 1; } // no need for else, because array elements are inited as 0 } for (int i = n - 2; i >= 0; i--) { if (security[i] <= security[i + 1]) { inc[i] = inc[i + 1] + 1; } // no need for else, because array elements are inited as 0 } List<Integer> res = new ArrayList<>(); for (int i = 0; i < n; i++) { if (dec[i] >= time && inc[i] >= time) { res.add(i); } } return res; } }
UTF-8
Java
1,195
java
Solution.java
Java
[]
null
[]
package g2001_2100.s2100_find_good_days_to_rob_the_bank; // #Medium #Array #Dynamic_Programming #Prefix_Sum // #2022_05_17_Time_13_ms_(46.46%)_Space_99.4_MB_(51.27%) import java.util.ArrayList; import java.util.List; public class Solution { public List<Integer> goodDaysToRobBank(int[] security, int time) { int n = security.length; // dec: # of non-increasing elements before [i] // inc: # of non-decreasing elements after [i] int[] dec = new int[n]; int[] inc = new int[n]; for (int i = 1; i < n; i++) { if (security[i] <= security[i - 1]) { dec[i] = dec[i - 1] + 1; } // no need for else, because array elements are inited as 0 } for (int i = n - 2; i >= 0; i--) { if (security[i] <= security[i + 1]) { inc[i] = inc[i + 1] + 1; } // no need for else, because array elements are inited as 0 } List<Integer> res = new ArrayList<>(); for (int i = 0; i < n; i++) { if (dec[i] >= time && inc[i] >= time) { res.add(i); } } return res; } }
1,195
0.488703
0.451046
36
32.194443
21.258749
71
false
false
0
0
0
0
0
0
0.555556
false
false
3
d214b1e86c9e54db5e9ce2f7903bfdfbcb32ba12
8,804,683,007,542
93f6d4a351c4f2eb653c922a8981f7ccca06b330
/backend/src/main/java/com/softwarewithpassion/nrgyinvoicr/backend/plans/control/expression/lines/ExpressionLineRangeException.java
b5234a15b6bf1d541509061e3ba5fdd7c296a58a
[]
no_license
bkaminnski/NrgyInvoicR
https://github.com/bkaminnski/NrgyInvoicR
019d6c7bccc81c82a99e848383615355115b533a
288b3411426e3cea52e206f69319d73dd5297947
refs/heads/master
2023-01-13T02:58:13.111000
2021-10-03T19:56:39
2021-10-03T19:56:39
159,068,055
1
1
null
false
2023-01-07T02:36:41
2018-11-25T19:45:40
2021-10-03T19:59:24
2023-01-07T02:36:38
2,701
0
0
16
Java
false
false
package com.softwarewithpassion.nrgyinvoicr.backend.plans.control.expression.lines; import com.softwarewithpassion.nrgyinvoicr.backend.plans.control.expression.buckets.LineError; import com.softwarewithpassion.nrgyinvoicr.backend.plans.control.expression.buckets.LineException; public class ExpressionLineRangeException extends LineException { private final int lineNumber; private final String range; ExpressionLineRangeException(int lineNumber, String range) { this.lineNumber = lineNumber; this.range = range; } public LineError toLineError() { return new LineError(lineNumber, "Invalid range: \"" + range + "\". Range expression should match a pattern \"<start inclusive>-<end inclusive>\"."); } }
UTF-8
Java
754
java
ExpressionLineRangeException.java
Java
[]
null
[]
package com.softwarewithpassion.nrgyinvoicr.backend.plans.control.expression.lines; import com.softwarewithpassion.nrgyinvoicr.backend.plans.control.expression.buckets.LineError; import com.softwarewithpassion.nrgyinvoicr.backend.plans.control.expression.buckets.LineException; public class ExpressionLineRangeException extends LineException { private final int lineNumber; private final String range; ExpressionLineRangeException(int lineNumber, String range) { this.lineNumber = lineNumber; this.range = range; } public LineError toLineError() { return new LineError(lineNumber, "Invalid range: \"" + range + "\". Range expression should match a pattern \"<start inclusive>-<end inclusive>\"."); } }
754
0.761273
0.761273
18
40.888889
43.269039
157
false
false
0
0
0
0
0
0
0.555556
false
false
3
b2b34ed486909c24e049eb95e01e67c5db618e12
8,804,683,006,995
42d51ca047504c5129cbbf46e56b3c18b4202e4c
/spring-cloud-user/src/main/java/com/xingling/cloud/mapper/MenuMapper.java
19d36615ad161f9341e1864532f59955f2dbbf7d
[]
no_license
cckmit/spring-cloud-koala
https://github.com/cckmit/spring-cloud-koala
3ef5f58137e5305dbb03d142458e8a01534d3ce8
2fb5c9014af9119f2608ac359dd3309854a4818a
refs/heads/master
2023-03-18T01:43:39.536000
2018-05-14T02:23:20
2018-05-14T02:23:20
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.xingling.cloud.mapper; import com.xingling.cloud.model.domain.Menu; import com.xingling.mapper.MyMapper; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; import java.util.List; /** * The interface Menu mapper. */ @Mapper @Component public interface MenuMapper extends MyMapper<Menu> { /** * Select all menu list. * * @return the list */ List<Menu> selectAllMenu(); }
UTF-8
Java
458
java
MenuMapper.java
Java
[]
null
[]
package com.xingling.cloud.mapper; import com.xingling.cloud.model.domain.Menu; import com.xingling.mapper.MyMapper; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Component; import java.util.List; /** * The interface Menu mapper. */ @Mapper @Component public interface MenuMapper extends MyMapper<Menu> { /** * Select all menu list. * * @return the list */ List<Menu> selectAllMenu(); }
458
0.716157
0.716157
24
18.125
17.498363
52
false
false
0
0
0
0
0
0
0.291667
false
false
3
486b9257e830a55f478ae52738f76c483f790f1a
30,562,987,336,606
861edd966c655ca77130da7f7dbc2c564bee4e04
/src/main/java/com/blaise2s/packagemaster/persistence/PersistenceService.java
9c1a1d7e4e4eac0435079c7fc05da97fca0d857a
[]
no_license
BlaiseSSchaeffer/PackageMaster
https://github.com/BlaiseSSchaeffer/PackageMaster
f16d74b3fed1445f120e5bd4825d2697a44495df
a269cadc7fa41ebe8badfe8c5049c77e71394ee9
refs/heads/master
2021-05-11T20:56:48.937000
2018-01-17T18:09:08
2018-01-17T18:09:08
117,453,252
0
0
null
false
2018-01-17T18:09:10
2018-01-14T17:55:17
2018-01-14T19:56:56
2018-01-17T18:09:09
19
0
0
0
Java
false
null
package com.blaise2s.packagemaster.persistence; import java.lang.reflect.Method; import java.util.List; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Id; import javax.persistence.Query; import javax.persistence.TypedQuery; public class PersistenceService { private static Context ctx; private static EntityManagerFactory emf; private PersistenceService() { // Intentionally left empty. } static { try { ctx = new InitialContext(); emf = (EntityManagerFactory) ctx.lookup("java:comp/env/jdbc/emf"); } catch (NamingException e) { System.out.println("Failed to create entity manager factory."); e.printStackTrace(); } } public static <T> T search(Class<T> entityClass, Object primaryKey) { EntityManager em = emf.createEntityManager(); T object = em.find(entityClass, primaryKey); em.close(); return object; } public static <T> List<T> search(String namedQueryName, Class<T> resultClass) { EntityManager em = emf.createEntityManager(); List<T> results = em.createNamedQuery(namedQueryName, resultClass).getResultList(); em.close(); return results; } public static <T> List<T> search(String namedQueryName, Class<T> resultClass, Object... params) { EntityManager em = emf.createEntityManager(); TypedQuery<T> query = em.createNamedQuery(namedQueryName, resultClass); for (int i = 0; i < params.length; i++) { query.setParameter(i + 1, params[i]); } List<T> results = query.getResultList(); em.close(); return results; } public static boolean persist(Object o) { boolean success = false; try { EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.persist(o); em.flush(); em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to persist data."); e.printStackTrace(); } return success; } public static Object persist(Object o, Class<?> objectClass) { Object id = null; try { Method method = null; Class<?> clazz = Class.forName(objectClass.getName()); for (Method m : clazz.getMethods()) { if (m.isAnnotationPresent(Id.class)) { method = m; break; } } EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.persist(o); em.flush(); if (method != null) { id = method.invoke(o); } em.getTransaction().commit(); em.close(); } catch (Exception e) { System.out.println("Failed to persist data."); e.printStackTrace(); } return id; } public static boolean update(String namedQueryName, Object... params) { boolean success = false; try { EntityManager em = emf.createEntityManager(); Query query = em.createNamedQuery(namedQueryName); for (int i = 0; i < params.length; i++) { query.setParameter(i + 1, params[i]); } em.getTransaction().begin(); query.executeUpdate(); em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to update data."); e.printStackTrace(); } return success; } public static boolean update(Object o) { boolean success = false; try { EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.merge(o); em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to update data."); e.printStackTrace(); } return success; } public static boolean delete(Class<?> entityClass, Object primaryKey) { boolean success = false; try { Object object = search(entityClass, primaryKey); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); if (!em.contains(object)) { em.remove(em.merge(object)); } em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to remove data."); e.printStackTrace(); } return success; } public static boolean delete(Object o) { boolean success = false; try { EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); if (!em.contains(o)) { em.remove(em.merge(o)); } em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to remove data."); e.printStackTrace(); } return success; } }
UTF-8
Java
4,514
java
PersistenceService.java
Java
[]
null
[]
package com.blaise2s.packagemaster.persistence; import java.lang.reflect.Method; import java.util.List; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.Id; import javax.persistence.Query; import javax.persistence.TypedQuery; public class PersistenceService { private static Context ctx; private static EntityManagerFactory emf; private PersistenceService() { // Intentionally left empty. } static { try { ctx = new InitialContext(); emf = (EntityManagerFactory) ctx.lookup("java:comp/env/jdbc/emf"); } catch (NamingException e) { System.out.println("Failed to create entity manager factory."); e.printStackTrace(); } } public static <T> T search(Class<T> entityClass, Object primaryKey) { EntityManager em = emf.createEntityManager(); T object = em.find(entityClass, primaryKey); em.close(); return object; } public static <T> List<T> search(String namedQueryName, Class<T> resultClass) { EntityManager em = emf.createEntityManager(); List<T> results = em.createNamedQuery(namedQueryName, resultClass).getResultList(); em.close(); return results; } public static <T> List<T> search(String namedQueryName, Class<T> resultClass, Object... params) { EntityManager em = emf.createEntityManager(); TypedQuery<T> query = em.createNamedQuery(namedQueryName, resultClass); for (int i = 0; i < params.length; i++) { query.setParameter(i + 1, params[i]); } List<T> results = query.getResultList(); em.close(); return results; } public static boolean persist(Object o) { boolean success = false; try { EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.persist(o); em.flush(); em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to persist data."); e.printStackTrace(); } return success; } public static Object persist(Object o, Class<?> objectClass) { Object id = null; try { Method method = null; Class<?> clazz = Class.forName(objectClass.getName()); for (Method m : clazz.getMethods()) { if (m.isAnnotationPresent(Id.class)) { method = m; break; } } EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.persist(o); em.flush(); if (method != null) { id = method.invoke(o); } em.getTransaction().commit(); em.close(); } catch (Exception e) { System.out.println("Failed to persist data."); e.printStackTrace(); } return id; } public static boolean update(String namedQueryName, Object... params) { boolean success = false; try { EntityManager em = emf.createEntityManager(); Query query = em.createNamedQuery(namedQueryName); for (int i = 0; i < params.length; i++) { query.setParameter(i + 1, params[i]); } em.getTransaction().begin(); query.executeUpdate(); em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to update data."); e.printStackTrace(); } return success; } public static boolean update(Object o) { boolean success = false; try { EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.merge(o); em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to update data."); e.printStackTrace(); } return success; } public static boolean delete(Class<?> entityClass, Object primaryKey) { boolean success = false; try { Object object = search(entityClass, primaryKey); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); if (!em.contains(object)) { em.remove(em.merge(object)); } em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to remove data."); e.printStackTrace(); } return success; } public static boolean delete(Object o) { boolean success = false; try { EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); if (!em.contains(o)) { em.remove(em.merge(o)); } em.getTransaction().commit(); em.close(); success = true; } catch (Exception e) { System.out.println("Failed to remove data."); e.printStackTrace(); } return success; } }
4,514
0.678556
0.677448
175
24.794285
19.949736
98
false
false
0
0
0
0
0
0
2.691429
false
false
3
f0f850d8bd2010b1c339fbdd02ac5dedacc37269
29,102,698,458,888
44f4f4c67481a23bacdb8bce9de02b42e98fb8d3
/test/com/podcastcatalog/model/podcastcatalog/PodCastEpisodeDurationTest.java
cf6a22b818ebeaa7e75bfd165945040177728206
[]
no_license
MiguelK/PodStore
https://github.com/MiguelK/PodStore
1b0cb6b5259ca8b84566f34c11135e2f028da0fd
fca5d3a531d99b2dab9d085d7c0e9c7a742ea07d
refs/heads/master
2022-04-29T01:21:00.666000
2022-03-08T17:30:38
2022-03-08T17:30:38
68,623,689
3
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.podcastcatalog.model.podcastcatalog; import com.google.gson.Gson; import org.testng.Assert; import org.testng.annotations.Test; public class PodCastEpisodeDurationTest { private final Gson gson = new Gson(); @Test public void toJSON() { PodCastEpisodeDuration duration1 = PodCastEpisodeDuration.parse("1:00:02"); PodCastEpisodeDuration duration2 = PodCastEpisodeDuration.parse("3:44"); PodCastEpisodeDuration duration3 = PodCastEpisodeDuration.parse("103:06"); Assert.assertNotNull(gson.toJson(duration1)); Assert.assertNotNull(gson.toJson(duration2)); Assert.assertNotNull(gson.toJson(duration3)); } @Test public void parse_valid_duration_seconds1() { Assert.assertTrue(PodCastEpisodeDuration.parse("1044").getMinutes()==17); Assert.assertTrue(PodCastEpisodeDuration.parse("185").getMinutes()==3); Assert.assertTrue(PodCastEpisodeDuration.parse("185").getHour()==0); Assert.assertTrue(PodCastEpisodeDuration.parse("185").getSeconds()==5); Assert.assertTrue(PodCastEpisodeDuration.parse("60").getMinutes()==1); } @Test public void parse_valid_duration_1() { PodCastEpisodeDuration podCastEpisodeDuration = PodCastEpisodeDuration.parse("01:24:15"); Assert.assertTrue((podCastEpisodeDuration != null ? podCastEpisodeDuration.getTotalTimeInSeconds() : 0) ==5055," was=" + podCastEpisodeDuration.getTotalTimeInSeconds()); Assert.assertTrue(podCastEpisodeDuration.getHour()==1); Assert.assertTrue(podCastEpisodeDuration.getMinutes()==24); Assert.assertTrue(podCastEpisodeDuration.getSeconds()==15); } @Test public void parse_valid_duration_2() { PodCastEpisodeDuration s = PodCastEpisodeDuration.parse("1:00:02"); Assert.assertNotNull(s); Assert.assertTrue(s.getHour()==1); Assert.assertTrue(s.getMinutes()==0); Assert.assertTrue(s.getSeconds()==2); } @Test public void parse_valid_duration_3() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("02:23:12"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour()==2); Assert.assertTrue(duration.getMinutes()==23); Assert.assertTrue(duration.getSeconds()==12); } @Test public void parse_valid_duration_4() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("00:4:50"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour()==0); Assert.assertTrue(duration.getMinutes()==4); Assert.assertTrue(duration.getSeconds()==50); } @Test public void parse_valid_duration_seconds() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("45:34"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour() == 0); Assert.assertTrue(duration.getMinutes() == 45); Assert.assertTrue(duration.getSeconds() == 34); } @Test public void parse_valid_duration_seconds2() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("100:34"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour() == 1); Assert.assertTrue(duration.getMinutes() == 40); Assert.assertTrue(duration.getSeconds() == 34); } @Test public void parse_display_value() { // Assert.assertEquals(PodCastEpisodeDuration.parse("02:23:12").getDisplayValue(),"2h 23m"); // Assert.assertEquals(PodCastEpisodeDuration.parse("01:03:12").getDisplayValue(),"1h 3m"); // Assert.assertEquals(PodCastEpisodeDuration.parse("01:25:56").getDisplayValue(),"1h 25m"); // Assert.assertEquals(PodCastEpisodeDuration.parse("01:25:60").getDisplayValue(),"1h 25m"); // Assert.assertEquals(PodCastEpisodeDuration.parse(" 00:58:60 ").getDisplayValue(),"58m"); Assert.assertEquals(PodCastEpisodeDuration.parse(" 1044 ").getDisplayValue(),"17m"); } @Test public void invalid_duration_null() { Assert.assertNull(PodCastEpisodeDuration.parse("01::15")); Assert.assertNull(PodCastEpisodeDuration.parse(" 01::15")); Assert.assertNull(PodCastEpisodeDuration.parse("")); Assert.assertNull(PodCastEpisodeDuration.parse(null)); } }
UTF-8
Java
4,350
java
PodCastEpisodeDurationTest.java
Java
[ { "context": " Assert.assertNull(PodCastEpisodeDuration.parse(\"01::15\"));\n Assert.assertNull(PodCastEpisodeDurat", "end": 4146, "score": 0.8400381207466125, "start": 4140, "tag": "IP_ADDRESS", "value": "01::15" }, { "context": "Assert.assertNull(PodCastEpisodeDuration.parse(\" 01::15\"));\n Assert.assertNull(PodCastEpisodeDurat", "end": 4214, "score": 0.6189936399459839, "start": 4209, "tag": "IP_ADDRESS", "value": "1::15" } ]
null
[]
package com.podcastcatalog.model.podcastcatalog; import com.google.gson.Gson; import org.testng.Assert; import org.testng.annotations.Test; public class PodCastEpisodeDurationTest { private final Gson gson = new Gson(); @Test public void toJSON() { PodCastEpisodeDuration duration1 = PodCastEpisodeDuration.parse("1:00:02"); PodCastEpisodeDuration duration2 = PodCastEpisodeDuration.parse("3:44"); PodCastEpisodeDuration duration3 = PodCastEpisodeDuration.parse("103:06"); Assert.assertNotNull(gson.toJson(duration1)); Assert.assertNotNull(gson.toJson(duration2)); Assert.assertNotNull(gson.toJson(duration3)); } @Test public void parse_valid_duration_seconds1() { Assert.assertTrue(PodCastEpisodeDuration.parse("1044").getMinutes()==17); Assert.assertTrue(PodCastEpisodeDuration.parse("185").getMinutes()==3); Assert.assertTrue(PodCastEpisodeDuration.parse("185").getHour()==0); Assert.assertTrue(PodCastEpisodeDuration.parse("185").getSeconds()==5); Assert.assertTrue(PodCastEpisodeDuration.parse("60").getMinutes()==1); } @Test public void parse_valid_duration_1() { PodCastEpisodeDuration podCastEpisodeDuration = PodCastEpisodeDuration.parse("01:24:15"); Assert.assertTrue((podCastEpisodeDuration != null ? podCastEpisodeDuration.getTotalTimeInSeconds() : 0) ==5055," was=" + podCastEpisodeDuration.getTotalTimeInSeconds()); Assert.assertTrue(podCastEpisodeDuration.getHour()==1); Assert.assertTrue(podCastEpisodeDuration.getMinutes()==24); Assert.assertTrue(podCastEpisodeDuration.getSeconds()==15); } @Test public void parse_valid_duration_2() { PodCastEpisodeDuration s = PodCastEpisodeDuration.parse("1:00:02"); Assert.assertNotNull(s); Assert.assertTrue(s.getHour()==1); Assert.assertTrue(s.getMinutes()==0); Assert.assertTrue(s.getSeconds()==2); } @Test public void parse_valid_duration_3() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("02:23:12"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour()==2); Assert.assertTrue(duration.getMinutes()==23); Assert.assertTrue(duration.getSeconds()==12); } @Test public void parse_valid_duration_4() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("00:4:50"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour()==0); Assert.assertTrue(duration.getMinutes()==4); Assert.assertTrue(duration.getSeconds()==50); } @Test public void parse_valid_duration_seconds() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("45:34"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour() == 0); Assert.assertTrue(duration.getMinutes() == 45); Assert.assertTrue(duration.getSeconds() == 34); } @Test public void parse_valid_duration_seconds2() { PodCastEpisodeDuration duration = PodCastEpisodeDuration.parse("100:34"); Assert.assertNotNull(duration); Assert.assertTrue(duration.getHour() == 1); Assert.assertTrue(duration.getMinutes() == 40); Assert.assertTrue(duration.getSeconds() == 34); } @Test public void parse_display_value() { // Assert.assertEquals(PodCastEpisodeDuration.parse("02:23:12").getDisplayValue(),"2h 23m"); // Assert.assertEquals(PodCastEpisodeDuration.parse("01:03:12").getDisplayValue(),"1h 3m"); // Assert.assertEquals(PodCastEpisodeDuration.parse("01:25:56").getDisplayValue(),"1h 25m"); // Assert.assertEquals(PodCastEpisodeDuration.parse("01:25:60").getDisplayValue(),"1h 25m"); // Assert.assertEquals(PodCastEpisodeDuration.parse(" 00:58:60 ").getDisplayValue(),"58m"); Assert.assertEquals(PodCastEpisodeDuration.parse(" 1044 ").getDisplayValue(),"17m"); } @Test public void invalid_duration_null() { Assert.assertNull(PodCastEpisodeDuration.parse("fdf8:f53e:61e4::18")); Assert.assertNull(PodCastEpisodeDuration.parse(" 0fd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b")); Assert.assertNull(PodCastEpisodeDuration.parse("")); Assert.assertNull(PodCastEpisodeDuration.parse(null)); } }
4,396
0.687126
0.648966
103
41.242718
33.954128
177
false
false
0
0
0
0
0
0
0.61165
false
false
3
8dbf164e748ae67b86f542074f990fd09b7d9a88
7,670,811,602,840
6e44cf547e745806ff7c5e7368096c633fe79cf5
/src/com/simple/链表/删除排序链表中的重复元素.java
1cb7f707256b2860b71a89960d65dc712c7c2fb9
[]
no_license
614756773/leetcode
https://github.com/614756773/leetcode
f8dca37497a1aba1b0427908a6e6a78b0dc07116
3da308e5c2f2e2d2129adb78de076a4cc70755dc
refs/heads/master
2021-06-18T16:53:06.132000
2021-03-23T14:50:12
2021-03-23T14:50:12
190,371,100
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.simple.链表; import datastructure.ListNode; /** * @author qinzhu * @since 2021/2/5 * 思路:迭代 双指针 * 使用cur记录当前节点,nextNode为我们要找的下一个节点,使用temp记录当前节点的值。 * 只要nextNode的值等于当前值,那就是重复的, * 所以nextNode继续往后移动,最后将cur.next指向nextNode, * 然后还需要更新cur = cur.next;temp = cur.val; */ public class 删除排序链表中的重复元素 { public ListNode deleteDuplicates(ListNode head) { if (head == null) { return head; } int temp = head.val; ListNode cur = head; while (cur != null) { ListNode nextNode = cur.next; while (nextNode != null && nextNode.val == temp) { nextNode = nextNode.next; } if (nextNode != null) { temp = nextNode.val; } cur.next = nextNode; cur = cur.next; } return head; } }
UTF-8
Java
1,046
java
删除排序链表中的重复元素.java
Java
[ { "context": "表;\n\nimport datastructure.ListNode;\n\n/**\n * @author qinzhu\n * @since 2021/2/5\n * 思路:迭代 双指针\n * 使用cur记录当前节点,ne", "end": 77, "score": 0.9971950650215149, "start": 71, "tag": "USERNAME", "value": "qinzhu" } ]
null
[]
package com.simple.链表; import datastructure.ListNode; /** * @author qinzhu * @since 2021/2/5 * 思路:迭代 双指针 * 使用cur记录当前节点,nextNode为我们要找的下一个节点,使用temp记录当前节点的值。 * 只要nextNode的值等于当前值,那就是重复的, * 所以nextNode继续往后移动,最后将cur.next指向nextNode, * 然后还需要更新cur = cur.next;temp = cur.val; */ public class 删除排序链表中的重复元素 { public ListNode deleteDuplicates(ListNode head) { if (head == null) { return head; } int temp = head.val; ListNode cur = head; while (cur != null) { ListNode nextNode = cur.next; while (nextNode != null && nextNode.val == temp) { nextNode = nextNode.next; } if (nextNode != null) { temp = nextNode.val; } cur.next = nextNode; cur = cur.next; } return head; } }
1,046
0.546512
0.539535
35
23.571428
16.05221
62
false
false
0
0
0
0
0
0
0.371429
false
false
3
2bcceb7c1d887244c6be4b67682d9c511059717d
14,267,881,405,503
9e3e82346feebf5581c957cbfa128865958e0350
/src/Article2/OverridingError.java
7a9c78b95ffeef1f1325cc5bd4bfecdd109c9110
[]
no_license
Student4everandever/exeptions
https://github.com/Student4everandever/exeptions
c2cf8c80db401bf711242d1fff0838e78c0751d7
cd39ec9081a9566ba5f43a6880748d1117670988
refs/heads/master
2020-04-23T21:53:52.778000
2019-02-19T14:04:40
2019-02-19T14:04:40
171,484,171
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Article2; import java.io.IOException; /** * Created by Alex on 19.02.2019 */ public class OverridingError { public void f() throws IOException, InterruptedException {} } class ChildB extends OverridingError { // @Override //public void f() throws Exception {} }
UTF-8
Java
286
java
OverridingError.java
Java
[ { "context": "2;\n\nimport java.io.IOException;\n\n/**\n * Created by Alex on 19.02.2019\n */\npublic class OverridingError {\n", "end": 70, "score": 0.9984506368637085, "start": 66, "tag": "NAME", "value": "Alex" } ]
null
[]
package Article2; import java.io.IOException; /** * Created by Alex on 19.02.2019 */ public class OverridingError { public void f() throws IOException, InterruptedException {} } class ChildB extends OverridingError { // @Override //public void f() throws Exception {} }
286
0.706294
0.674825
15
18.066668
18.947178
63
false
false
0
0
0
0
0
0
0.2
false
false
3
2143bb0656ff6496b50958484bb4e4c09bf3722a
31,911,607,032,771
2523e3460c2612cb6c889d6d4e2395aa7d765431
/ProcedureLab/src/ast/If.java
b800f67690a4c12ba635577f7a6f569a4e1ba3e5
[]
no_license
hemantkunda/Compilers
https://github.com/hemantkunda/Compilers
4cfbc14967132d62e8969dbe693c703e51725027
5aeebf9c8c140a8caf7b69aa6b19bf7f7c8bfda8
refs/heads/master
2020-12-24T13:17:18.209000
2015-05-09T20:06:28
2015-05-09T20:06:28
35,342,747
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ast; import environment.Environment; /** * The If class encapsulates a Condition object and a Statement object. Using * these objects, an If object emulates an if statement by executing its * stored Statement if its Condition evaluated to 1 (true). * * @author hkunda * @date March 18, 2015 */ public class If extends Statement { private Condition condition; private Statement statement; /** * Creates a new instance of the If class with the specified condition * statement and the statement to execute if the condition is true. * * @param condition the if statement's condition * @param statement the statement to execute if the condition is true */ public If (Condition condition, Statement statement) { this.condition = condition; this.statement = statement; } /** * Executes the stored Statement if the If's Condition evaluates to * 1 (true). * * @param env the Environment in which the If is to be executed */ public void exec(Environment env) { if (condition.eval(env) == 1) { statement.exec(env); } } }
UTF-8
Java
1,202
java
If.java
Java
[ { "context": "ts Condition evaluated to 1 (true).\n * \n * @author hkunda\n * @date March 18, 2015\n */\npublic class If exten", "end": 283, "score": 0.9996364116668701, "start": 277, "tag": "USERNAME", "value": "hkunda" } ]
null
[]
package ast; import environment.Environment; /** * The If class encapsulates a Condition object and a Statement object. Using * these objects, an If object emulates an if statement by executing its * stored Statement if its Condition evaluated to 1 (true). * * @author hkunda * @date March 18, 2015 */ public class If extends Statement { private Condition condition; private Statement statement; /** * Creates a new instance of the If class with the specified condition * statement and the statement to execute if the condition is true. * * @param condition the if statement's condition * @param statement the statement to execute if the condition is true */ public If (Condition condition, Statement statement) { this.condition = condition; this.statement = statement; } /** * Executes the stored Statement if the If's Condition evaluates to * 1 (true). * * @param env the Environment in which the If is to be executed */ public void exec(Environment env) { if (condition.eval(env) == 1) { statement.exec(env); } } }
1,202
0.638935
0.631448
45
25.711111
25.229279
77
false
false
0
0
0
0
0
0
0.222222
false
false
3
ed454581da02ea33af7699a1d6b91e3eab0cc978
23,871,428,235,563
d3c987d74057e8bff524dcc19fe7dd114b474610
/AtividadeAvaliativa1/Locadora/src/java/br/ufscar/dc/dsw/locadora/util/AppSecurityInitializer.java
124ed6614b3cadeb442b228f00a1db303729ca14
[]
no_license
divao/DSW
https://github.com/divao/DSW
3957e1000d895b46d0efd2e371e0813bace9e3c8
92d6f324f29562d7e9b877d259eeb90f53f8d105
refs/heads/master
2020-05-09T12:54:50.913000
2019-06-02T02:10:37
2019-06-02T02:10:37
181,128,482
1
2
null
false
2019-06-01T21:40:39
2019-04-13T06:05:24
2019-06-01T20:35:27
2019-06-01T21:40:39
27,732
1
2
0
Java
false
false
package br.ufscar.dc.dsw.locadora.util; import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; public class AppSecurityInitializer extends AbstractSecurityWebApplicationInitializer { public AppSecurityInitializer() { super(AppConfig.class); } }
UTF-8
Java
293
java
AppSecurityInitializer.java
Java
[]
null
[]
package br.ufscar.dc.dsw.locadora.util; import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer; public class AppSecurityInitializer extends AbstractSecurityWebApplicationInitializer { public AppSecurityInitializer() { super(AppConfig.class); } }
293
0.829352
0.829352
9
31.555555
33.836571
90
false
false
0
0
0
0
0
0
0.333333
false
false
3
f611e71642d9c9f545e61c8e52e1bd7bb3b8e36e
1,924,145,354,165
055041a5e5100d395267cb56cb00a5ed6c48b708
/app/src/main/java/com/lisn/swipelayout/MainActivity.java
af60d00dbebcd02f98d752fd1e1fe6e87f6073a8
[]
no_license
cnlisn/SwipeLayout
https://github.com/cnlisn/SwipeLayout
41fc4080615d2ab6268f3d4b68c1515bd3d3ac1c
93ba15e1ab847cfad5d4280bb1a10f848286127a
refs/heads/master
2021-01-16T00:48:03.250000
2017-08-11T01:41:35
2017-08-11T01:41:35
99,980,048
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.lisn.swipelayout; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.AdapterView; import android.widget.ListView; public class MainActivity extends AppCompatActivity { private ListView mListView; private MyAdapter mAdapter; private AdapterView.OnItemClickListener mListener; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mListView = (ListView) findViewById(R.id.listview); mAdapter = new MyAdapter(MainActivity.this); mListView.setAdapter(mAdapter); } }
UTF-8
Java
677
java
MainActivity.java
Java
[]
null
[]
package com.lisn.swipelayout; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.AdapterView; import android.widget.ListView; public class MainActivity extends AppCompatActivity { private ListView mListView; private MyAdapter mAdapter; private AdapterView.OnItemClickListener mListener; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mListView = (ListView) findViewById(R.id.listview); mAdapter = new MyAdapter(MainActivity.this); mListView.setAdapter(mAdapter); } }
677
0.747415
0.745938
26
25.038462
21.775923
59
false
false
0
0
0
0
0
0
0.5
false
false
3
6b811847d85d56ed3799500edd894a6d33261c22
14,671,608,304,453
59a90cc2afcbbaded6a6b7f8398aa70979be13bc
/task-utils/src/main/java/es/molabs/task/base/AbstractTask.java
cc3aba4fa46074e2d9aecb188d48a98d2baece88
[ "Apache-2.0" ]
permissive
luis-moral/task-utils
https://github.com/luis-moral/task-utils
957978451a5cb45759467155d5af132e802c045c
6cd90399b32d804a524be3282f7a67853fb859e0
refs/heads/master
2021-01-20T18:44:36.388000
2016-08-04T12:00:00
2016-08-04T12:00:00
63,487,196
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * Copyright (C) 2016 Luis Moral Guerrero <luis.moral@gmail.com> * * 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 es.molabs.task.base; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import es.molabs.task.Task; public abstract class AbstractTask implements Task { private final Logger logger = LoggerFactory.getLogger(getClass()); private Exception error = null; private Task next = null; protected AbstractTask() { this(null); } protected AbstractTask(AbstractTask next) { this.next = next; } public void reset() { error = null; } public void execute(float delta) { try { beforeProcess(); doExecute(delta); afterProcess(); } catch (Exception e) { error = e; logger.error(e.getLocalizedMessage(), e); onError(e); } } public Task getNext() { return next; } public void setNext(Task next) { this.next = next; } public void added() { onCreate(); } public void removed() { onDispose(); } /** * Returns the last error thrown after calling process(). Null if there was no error. * * @return The last error thrown after calling process(). */ public Exception getError() { return error; } protected Logger getLogger() { return logger; } /** * Hook that will be called once the task is all set. */ protected void onCreate() { } /** * Hook that will be called once the task is finished and removed from the queue. */ protected void onDispose() { } /** * Hook that will be called before the process() call is made. * * @throws Exception if an error occurs. */ protected void beforeProcess() throws Exception { } /** * Hook that will be called after the process() call is made. * * @throws Exception if an error occurs. */ protected void afterProcess() throws Exception { } /** * Hook that will be called if an error occurs in the loop. * * @param e exception thrown. */ protected void onError(Exception e) { } /** * Main method where this task logic should be executed. * * @param delta time passed in seconds. * * @throws Exception if an error occurs. */ protected abstract void doExecute(float delta) throws Exception; }
UTF-8
Java
2,774
java
AbstractTask.java
Java
[ { "context": "/**\n * Copyright (C) 2016 Luis Moral Guerrero <luis.moral@gmail.com>\n *\n * Licensed under the A", "end": 45, "score": 0.9998744130134583, "start": 26, "tag": "NAME", "value": "Luis Moral Guerrero" }, { "context": "/**\n * Copyright (C) 2016 Luis Moral Guerrero <luis.moral@gmail.com>\n *\n * Licensed under the Apache License, Version", "end": 67, "score": 0.9999317526817322, "start": 47, "tag": "EMAIL", "value": "luis.moral@gmail.com" } ]
null
[]
/** * Copyright (C) 2016 <NAME> <<EMAIL>> * * 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 es.molabs.task.base; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import es.molabs.task.Task; public abstract class AbstractTask implements Task { private final Logger logger = LoggerFactory.getLogger(getClass()); private Exception error = null; private Task next = null; protected AbstractTask() { this(null); } protected AbstractTask(AbstractTask next) { this.next = next; } public void reset() { error = null; } public void execute(float delta) { try { beforeProcess(); doExecute(delta); afterProcess(); } catch (Exception e) { error = e; logger.error(e.getLocalizedMessage(), e); onError(e); } } public Task getNext() { return next; } public void setNext(Task next) { this.next = next; } public void added() { onCreate(); } public void removed() { onDispose(); } /** * Returns the last error thrown after calling process(). Null if there was no error. * * @return The last error thrown after calling process(). */ public Exception getError() { return error; } protected Logger getLogger() { return logger; } /** * Hook that will be called once the task is all set. */ protected void onCreate() { } /** * Hook that will be called once the task is finished and removed from the queue. */ protected void onDispose() { } /** * Hook that will be called before the process() call is made. * * @throws Exception if an error occurs. */ protected void beforeProcess() throws Exception { } /** * Hook that will be called after the process() call is made. * * @throws Exception if an error occurs. */ protected void afterProcess() throws Exception { } /** * Hook that will be called if an error occurs in the loop. * * @param e exception thrown. */ protected void onError(Exception e) { } /** * Main method where this task logic should be executed. * * @param delta time passed in seconds. * * @throws Exception if an error occurs. */ protected abstract void doExecute(float delta) throws Exception; }
2,748
0.667628
0.664023
149
17.624161
22.027889
86
false
false
0
0
0
0
0
0
1.355705
false
false
3
7c56e5739ebcb984b7024a546e8ed78456e420de
24,610,162,631,448
b76f051087a67451e6e260188f486ad5cbb06de7
/src/Member/Member.java
cfad9d9c7e320d9d26136b74fc88c5e6bc388218
[]
no_license
FrederikWVB/Project_Dolphin
https://github.com/FrederikWVB/Project_Dolphin
0960ec917beed1af5babfdd6669666eb5815d47d
09bc67107e2a88fcb39c5b21782f1e2567376fdc
refs/heads/master
2023-08-21T13:36:46.059000
2021-05-27T14:25:05
2021-05-27T14:25:05
368,162,744
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Member; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; /** * @author Frederik Wandall von Benzon * @author Jens Christian Lund Jørgensen */ public class Member { int id; String name; int age; boolean active; boolean competitive; public Member(int id, String name, int age, boolean active, boolean competitive) { this.id = id; this.name = name; this.age = age; this.active = active; this.competitive = competitive; } public int getId() { return id; } public String getName() { return name; } public int getAge() { return age; } public boolean isActive() { return active; } public boolean isCompetitive() { return competitive; } public static ArrayList<Member> createMemberList() { try { File memberFile = new File("resources/MemberList.csv"); Scanner fileScanner = new Scanner(memberFile); fileScanner.nextLine(); ArrayList<Member> memberArrayList = new ArrayList<>(); while (fileScanner.hasNext()) { String currentLine = fileScanner.nextLine(); String[] lineAsArray = currentLine.split(";"); int id = Integer.parseInt(lineAsArray[0].strip()); String name = lineAsArray[1].strip(); int age = Integer.parseInt(lineAsArray[2].strip()); boolean active = Boolean.parseBoolean(lineAsArray[3].strip()); boolean competitive = Boolean.parseBoolean(lineAsArray[4].strip()); Member tempMember = new Member(id, name, age, active, competitive); memberArrayList.add(tempMember); } return memberArrayList; } catch (FileNotFoundException e){ e.printStackTrace(); System.out.println("File Not Found"); return new ArrayList<Member>(); } } public static int tryParse(String text) { try { return Integer.parseInt(text); } catch (NumberFormatException e) { return 0; } } public static void printMemberlist(ArrayList<Member> memberArrayList){ for (int i = 0; i < memberArrayList.size(); i++){ System.out.print("ID: " + memberArrayList.get(i).getId() + " - "); System.out.print("Age: " + memberArrayList.get(i).getAge() + " - "); System.out.print("Name: " + memberArrayList.get(i).getName() + " "); if (memberArrayList.get(i).isCompetitive()){ System.out.print(" ⭐ "); } System.out.println(" "); } } }
UTF-8
Java
2,796
java
Member.java
Java
[ { "context": "rayList;\nimport java.util.Scanner;\n\n/**\n * @author Frederik Wandall von Benzon\n * @author Jens Christian Lund Jørgensen\n */\n\npub", "end": 172, "score": 0.9998689293861389, "start": 145, "tag": "NAME", "value": "Frederik Wandall von Benzon" }, { "context": "\n * @author Frederik Wandall von Benzon\n * @author Jens Christian Lund Jørgensen\n */\n\npublic class Member {\n int id;\n String", "end": 213, "score": 0.9998610615730286, "start": 184, "tag": "NAME", "value": "Jens Christian Lund Jørgensen" } ]
null
[]
package Member; import java.io.File; import java.io.FileNotFoundException; import java.util.ArrayList; import java.util.Scanner; /** * @author <NAME> * @author <NAME> */ public class Member { int id; String name; int age; boolean active; boolean competitive; public Member(int id, String name, int age, boolean active, boolean competitive) { this.id = id; this.name = name; this.age = age; this.active = active; this.competitive = competitive; } public int getId() { return id; } public String getName() { return name; } public int getAge() { return age; } public boolean isActive() { return active; } public boolean isCompetitive() { return competitive; } public static ArrayList<Member> createMemberList() { try { File memberFile = new File("resources/MemberList.csv"); Scanner fileScanner = new Scanner(memberFile); fileScanner.nextLine(); ArrayList<Member> memberArrayList = new ArrayList<>(); while (fileScanner.hasNext()) { String currentLine = fileScanner.nextLine(); String[] lineAsArray = currentLine.split(";"); int id = Integer.parseInt(lineAsArray[0].strip()); String name = lineAsArray[1].strip(); int age = Integer.parseInt(lineAsArray[2].strip()); boolean active = Boolean.parseBoolean(lineAsArray[3].strip()); boolean competitive = Boolean.parseBoolean(lineAsArray[4].strip()); Member tempMember = new Member(id, name, age, active, competitive); memberArrayList.add(tempMember); } return memberArrayList; } catch (FileNotFoundException e){ e.printStackTrace(); System.out.println("File Not Found"); return new ArrayList<Member>(); } } public static int tryParse(String text) { try { return Integer.parseInt(text); } catch (NumberFormatException e) { return 0; } } public static void printMemberlist(ArrayList<Member> memberArrayList){ for (int i = 0; i < memberArrayList.size(); i++){ System.out.print("ID: " + memberArrayList.get(i).getId() + " - "); System.out.print("Age: " + memberArrayList.get(i).getAge() + " - "); System.out.print("Name: " + memberArrayList.get(i).getName() + " "); if (memberArrayList.get(i).isCompetitive()){ System.out.print(" ⭐ "); } System.out.println(" "); } } }
2,751
0.565342
0.562836
98
27.5
24.92325
86
false
false
0
0
0
0
0
0
0.561224
false
false
3
e6eed9b5cec71d54b8d479c5b6182048d7b4f745
1,520,418,466,016
1c44a8a813fc1eeb01db16b1034a441db9d7c680
/app/src/main/java/com/ics/newapp/fregment/MyActivity_fragment.java
6110e98ce126326cb645ee0cf52ea6bc6a5a8fa2
[]
no_license
raghsahu/MileyApp
https://github.com/raghsahu/MileyApp
16f1f8af137d74a04d5adcc0db4acd039d1673e2
db6110ddff84f0eeeaee84d39fcb9ff5b61a0f85
refs/heads/master
2020-05-01T16:15:23.401000
2019-03-30T06:02:25
2019-03-30T06:02:25
177,567,579
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ics.newapp.fregment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.Toast; import com.ics.newapp.R; public class MyActivity_fragment extends Fragment { LinearLayout btnn; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { //returning our layout file //change R.layout.yourlayoutfilename for each of your fragments return inflater.inflate(R.layout.my_activity_fragment, container, false); } @Override public void onPrepareOptionsMenu(Menu menu) { MenuItem item=menu.findItem(R.id.action_search); MenuItem item1=menu.findItem(R.id.action_share); MenuItem item2=menu.findItem(R.id.action_create); item.setVisible(false); item1.setVisible(false); item2.setVisible(true); item2.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { Fragment view_creat=new Create_Activity(); FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.content_frame,view_creat); fragmentTransaction.commit(); return false; } }); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); //you can set the title for your toolbar here for different fragments different titles setHasOptionsMenu(true); getActivity().setTitle("My Activity"); } }
UTF-8
Java
2,285
java
MyActivity_fragment.java
Java
[]
null
[]
package com.ics.newapp.fregment; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; import android.support.v4.app.FragmentTransaction; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.widget.LinearLayout; import android.widget.Toast; import com.ics.newapp.R; public class MyActivity_fragment extends Fragment { LinearLayout btnn; @Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { //returning our layout file //change R.layout.yourlayoutfilename for each of your fragments return inflater.inflate(R.layout.my_activity_fragment, container, false); } @Override public void onPrepareOptionsMenu(Menu menu) { MenuItem item=menu.findItem(R.id.action_search); MenuItem item1=menu.findItem(R.id.action_share); MenuItem item2=menu.findItem(R.id.action_create); item.setVisible(false); item1.setVisible(false); item2.setVisible(true); item2.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { Fragment view_creat=new Create_Activity(); FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction(); fragmentTransaction.replace(R.id.content_frame,view_creat); fragmentTransaction.commit(); return false; } }); } @Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); //you can set the title for your toolbar here for different fragments different titles setHasOptionsMenu(true); getActivity().setTitle("My Activity"); } }
2,285
0.698031
0.693654
66
33.621212
29.055727
123
false
false
0
0
0
0
0
0
0.621212
false
false
3
1fbf33eb381c85bae4e24984929b7503b0672b50
9,646,496,548,436
3ef61f2a7d5f990dba721ed6d540492b2e2857be
/src/main/java/com/kiesoft/sstarter/jpa/repository/LanguageRepository.java
55b536104ccb7fe44c0158f7df25ebf1c126fb2f
[ "Apache-2.0" ]
permissive
pedrogonzalezgutierrez/spring-starter
https://github.com/pedrogonzalezgutierrez/spring-starter
6afb7bc2232a10e7cb6320f2822538d8787a19da
39de0ce61b255385a6aa33d667ef6a42749feb57
refs/heads/master
2020-02-26T13:47:02.538000
2017-11-25T20:07:08
2017-11-25T20:07:08
65,485,999
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.kiesoft.sstarter.jpa.repository; import com.kiesoft.sstarter.jpa.entity.language.LanguageEntity; import org.springframework.data.repository.PagingAndSortingRepository; public interface LanguageRepository extends PagingAndSortingRepository<LanguageEntity, Long> { LanguageEntity findByCode(String code); }
UTF-8
Java
329
java
LanguageRepository.java
Java
[]
null
[]
package com.kiesoft.sstarter.jpa.repository; import com.kiesoft.sstarter.jpa.entity.language.LanguageEntity; import org.springframework.data.repository.PagingAndSortingRepository; public interface LanguageRepository extends PagingAndSortingRepository<LanguageEntity, Long> { LanguageEntity findByCode(String code); }
329
0.835866
0.835866
10
31.9
33.661404
94
false
false
0
0
0
0
0
0
0.5
false
false
3
e0469aac6d5aae319e9784dbb0351bc3d59f2540
7,413,113,561,819
47cc547f9c95a16d65185f5f727eb6f9cb766a4f
/registrationIntegration-master/tcp-server/src/test/java/com/hsm/StudentServiceTest.java
fc3dfceb3a4fbd157e0d3e95f67ce267ce50f285
[]
no_license
jinyyash/StudentRegistration
https://github.com/jinyyash/StudentRegistration
f747a28e86b9c4b23f4574a1a0dc6eb9f3f8215a
49c99e506554ce1dca8812df4f81ce1e9a5483ad
refs/heads/master
2022-12-21T06:48:23.364000
2019-09-20T02:59:12
2019-09-20T02:59:12
207,069,292
2
0
null
false
2022-12-16T00:39:27
2019-09-08T06:03:05
2020-04-13T08:22:08
2022-12-16T00:39:25
123
2
0
14
Java
false
false
package com.hsm; import com.google.gson.JsonObject; import com.hsm.codette.DecodeJson; import com.hsm.models.Student; import com.hsm.repository.StudentRepository; import com.hsm.service.StudentService; import com.hsm.service.impl.StudentServiceImpl; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; import java.sql.SQLException; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) public class StudentServiceTest { @TestConfiguration static class StudentServiceImplTestContextConfiguration { @Bean public StudentService studentService() { return new StudentServiceImpl(); } @Bean public DecodeJson decodeJson(){ return new DecodeJson(); } } @Autowired private StudentService studentService; //used to bypass the call to the actual Repository: @MockBean private StudentRepository studentRepository; @Test public void testSave() throws SQLException, IOException, ClassNotFoundException { boolean sucess; Student student=new Student(); student.setNic("9007201423V"); student.setName("jinadi"); student.setAddress("matara"); student.setTel("0715886767"); Mockito.when(studentRepository.save(student)).thenReturn(true); sucess=studentService.save(student); System.out.println(sucess); assertThat(sucess).isEqualTo(true); } @Test public void testProcessMessage() throws SQLException, IOException, ClassNotFoundException { JsonObject studentJson = new JsonObject(); studentJson.addProperty("nic", "957201423v"); studentJson.addProperty("name","jinadee"); studentJson.addProperty("address", "matara"); studentJson.addProperty("tel", "0715883767"); String response=new String(studentService.processMessage(studentJson.toString().getBytes())); assertThat(response).isEqualTo("oops something wrong"); } }
UTF-8
Java
2,391
java
StudentServiceTest.java
Java
[ { "context": "t.setNic(\"9007201423V\");\n student.setName(\"jinadi\");\n student.setAddress(\"matara\");\n ", "end": 1561, "score": 0.9994555711746216, "start": 1555, "tag": "NAME", "value": "jinadi" }, { "context": "01423v\");\n studentJson.addProperty(\"name\",\"jinadee\");\n studentJson.addProperty(\"address\", \"ma", "end": 2103, "score": 0.9995971322059631, "start": 2096, "tag": "NAME", "value": "jinadee" } ]
null
[]
package com.hsm; import com.google.gson.JsonObject; import com.hsm.codette.DecodeJson; import com.hsm.models.Student; import com.hsm.repository.StudentRepository; import com.hsm.service.StudentService; import com.hsm.service.impl.StudentServiceImpl; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mockito; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.TestConfiguration; import org.springframework.boot.test.mock.mockito.MockBean; import org.springframework.context.annotation.Bean; import org.springframework.test.context.junit4.SpringRunner; import java.io.IOException; import java.sql.SQLException; import static org.assertj.core.api.Assertions.assertThat; @RunWith(SpringRunner.class) public class StudentServiceTest { @TestConfiguration static class StudentServiceImplTestContextConfiguration { @Bean public StudentService studentService() { return new StudentServiceImpl(); } @Bean public DecodeJson decodeJson(){ return new DecodeJson(); } } @Autowired private StudentService studentService; //used to bypass the call to the actual Repository: @MockBean private StudentRepository studentRepository; @Test public void testSave() throws SQLException, IOException, ClassNotFoundException { boolean sucess; Student student=new Student(); student.setNic("9007201423V"); student.setName("jinadi"); student.setAddress("matara"); student.setTel("0715886767"); Mockito.when(studentRepository.save(student)).thenReturn(true); sucess=studentService.save(student); System.out.println(sucess); assertThat(sucess).isEqualTo(true); } @Test public void testProcessMessage() throws SQLException, IOException, ClassNotFoundException { JsonObject studentJson = new JsonObject(); studentJson.addProperty("nic", "957201423v"); studentJson.addProperty("name","jinadee"); studentJson.addProperty("address", "matara"); studentJson.addProperty("tel", "0715883767"); String response=new String(studentService.processMessage(studentJson.toString().getBytes())); assertThat(response).isEqualTo("oops something wrong"); } }
2,391
0.726474
0.709745
71
32.676056
24.005735
101
false
false
0
0
0
0
0
0
0.676056
false
false
3
f8810baa54969615b3a210c609492b3c6b1d9915
32,031,866,155,854
9ece443ff651726d820b3c8b1fad2e2f4cec41c6
/11BetterMaze/FrontierStack.java
461eb4ea8a5338446d98da5aaf3fce56e6ff2311
[]
no_license
singhpardeep01/MKS22X-HW
https://github.com/singhpardeep01/MKS22X-HW
5c25e3289a29ec97602ffc716fe1117650573cd0
76e0620631133d08910cc6a5760cf8207755127a
refs/heads/master
2021-01-21T13:17:31.180000
2016-05-10T17:09:17
2016-05-10T17:09:17
51,338,785
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.*; public class FrontierStack<T> implements Frontier<T>{ private Stack s = new Stack(); public void add(T element) { s.push(element); } public T next() { return (T) s.pop(); } public boolean hasNext() { try { s.peek(); return true; } catch (EmptyStackException e) { return false; } } }
UTF-8
Java
361
java
FrontierStack.java
Java
[]
null
[]
import java.util.*; public class FrontierStack<T> implements Frontier<T>{ private Stack s = new Stack(); public void add(T element) { s.push(element); } public T next() { return (T) s.pop(); } public boolean hasNext() { try { s.peek(); return true; } catch (EmptyStackException e) { return false; } } }
361
0.576177
0.576177
21
16.190475
13.872272
53
false
false
0
0
0
0
0
0
0.714286
false
false
3
0c2d11453b426baa6d831a502370570de1cb3aea
30,880,814,911,084
03c24693df99f119bea527fe249dda74351cd9ab
/Volley/Volley_01/Volley_01/app/src/main/java/com/example/pckosek/volley_01/MainActivity.java
487fe3cd1f06eedde4a93fd540da388803622636
[]
no_license
CoolPalmTree/Android_Examples
https://github.com/CoolPalmTree/Android_Examples
2b589b1d70fea1d7731061cff74027d56e4c0a83
a23ba62b6c3e1e45d33b909d2b8a34e8d932d9c1
refs/heads/master
2022-02-24T17:18:12.451000
2019-10-22T14:48:37
2019-10-22T14:48:37
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.pckosek.volley_01; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import com.android.volley.NetworkResponse; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonRequest; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import java.lang.ref.ReferenceQueue; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String url = "https://user.tjhsst.edu/pckosek/"; StringRequest stringRequest = new StringRequest( Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { Toast.makeText(getApplicationContext(), response, Toast.LENGTH_LONG).show(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(getApplicationContext(), error.toString(), Toast.LENGTH_LONG).show(); } } ); RequestQueue requestQueue = Volley.newRequestQueue(this); requestQueue.add(stringRequest); } }
UTF-8
Java
1,730
java
MainActivity.java
Java
[]
null
[]
package com.example.pckosek.volley_01; import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.widget.Toast; import com.android.volley.NetworkResponse; import com.android.volley.Request; import com.android.volley.RequestQueue; import com.android.volley.Response; import com.android.volley.VolleyError; import com.android.volley.toolbox.JsonRequest; import com.android.volley.toolbox.StringRequest; import com.android.volley.toolbox.Volley; import java.lang.ref.ReferenceQueue; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); String url = "https://user.tjhsst.edu/pckosek/"; StringRequest stringRequest = new StringRequest( Request.Method.GET, url, new Response.Listener<String>() { @Override public void onResponse(String response) { Toast.makeText(getApplicationContext(), response, Toast.LENGTH_LONG).show(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(getApplicationContext(), error.toString(), Toast.LENGTH_LONG).show(); } } ); RequestQueue requestQueue = Volley.newRequestQueue(this); requestQueue.add(stringRequest); } }
1,730
0.630058
0.628324
50
33.619999
21.759495
96
false
false
0
0
0
0
0
0
0.6
false
false
3
32bd219eef49caa36d5faa405a65c0fed51ecfbc
30,880,814,911,781
2bade2d4c236d5a6c8da79aeec82d0355679d91f
/TravellingSalesmanProb.java
e4b8fb0243385dd7e2a4eb35c8f8ea47d166ef6b
[]
no_license
vivekvt56/Learning
https://github.com/vivekvt56/Learning
e60d8ce05b7cbd907e93c833868c72a0ec7598b6
ecf57cb833caf356887e0324e07d27da862f2dfd
refs/heads/master
2021-01-21T16:04:22.941000
2019-08-19T16:25:39
2019-08-19T16:25:39
91,871,122
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; public class TravSalesProb { static Set<String> sets=new LinkedHashSet<>(); static int[][] dist; static Set<String> trav=new LinkedHashSet<>(); static Map<String, Integer> map=new LinkedHashMap<>(); static Map<String, Integer> mapparent=new LinkedHashMap<>(); public static void main(String[] args) { // TODO Auto-generated method stub //no of vertex int n=4; createSubset(n-1); dist=new int[n][n]; //start vertes : s int startVertex=0; createDisMatrix(); System.out.println("Min cost Hamiltonian Circuit : "+eval_Trav(n, startVertex)); findPath(); } static void createSubset(int n){ int l=(int)Math.pow(2, n); for(int i=0;i<l;i++){ String s=""; int j=1; int k=1; s=s+"["; while(j<l){ int t=j&i; if(t!=0){ s=s+k+" "; } k++; j=j<<1; } s=s+"]"; sets.add(s); } } static void createDisMatrix(){ dist[0][1]=1; dist[0][2]=15; dist[0][3]=6; dist[1][0]=2; dist[1][2]=7; dist[1][3]=3; dist[2][0]=9; dist[2][1]=6; dist[2][3]=12; dist[3][0]=10; dist[3][1]=4; dist[3][2]=8; } static int eval_Trav(int n,int startVertex){ int hamiltonian=0; for(String s:sets){ String k=""; if(!s.equals("[]")){ String t=s.substring(1,s.length()-2); boolean b=false; for(int j=1;j<n;j++){ if(!t.contains(String.valueOf(j))){ k="["+j+","+s+"]"; trav.add(k); //System.out.println("["+j+","+s+"]"); b=true; } } if(!b){ k="["+startVertex+","+s+"]"; trav.add(k); //System.out.println("["+startVertex+","+s+"]"); } }else{ for(int j=1;j<n;j++){ k="["+j+",[$]"+"]"; trav.add(k); //System.out.println("["+j+",$"+"]"); } } //trav.add(k); } for(String j:trav){ System.out.println(j); String a=j.substring(1,2).trim(); String t=j.substring(j.indexOf("[", 1)+1,j.length()-2).trim(); //System.out.println(a+"-->"+t); if(t.equals("$")){ map.put(j, dist[0][Integer.parseInt(a)]); mapparent.put(j, 0); System.out.println("cost : "+dist[0][Integer.parseInt(a)]); }else if(t.length()==1){ map.put(j, (dist[0][Integer.parseInt(t)] +dist[Integer.parseInt(t)][Integer.parseInt(a)])); mapparent.put(j, Integer.parseInt(t)); System.out.println("cost is : "+(dist[0][Integer.parseInt(t)] +dist[Integer.parseInt(t)][Integer.parseInt(a)])); }else{ String[] k=t.split(" "); int min=Integer.MAX_VALUE; int parent=0; String e="["; for(String s:k){ e=e+s+",["; for(String s1:k){ if(!s1.equals(s)){ e=e+s1+" "; } } e=e+"]]"; //System.out.println("e : "+e); int temp=(dist[Integer.parseInt(s)][Integer.parseInt(a)]+map.get(e)); if(temp<min){ min=temp; parent=Integer.parseInt(s); } //System.out.println("cost is : "+); //map.put(j, (dist[Integer.parseInt(s)][Integer.parseInt(a)]+map.get(e))); e="["; //System.out.println("cost is : "+(dist[0][Integer.parseInt(s)] // +" "+dist[Integer.parseInt(s)][Integer.parseInt(a)])); } map.put(j, min); mapparent.put(j, parent); System.out.println("cost is : "+min+" : "+parent); hamiltonian=min; } } return hamiltonian; } static void findPath(){ String s="[0,[1 2 3 ]]"; int p=mapparent.get(s); System.out.println("Route is : "); System.out.print("0<--"+p+"<--"); while(true){ s=s.substring(s.indexOf("[",1)+1,s.length()-2).trim(); //System.out.println("s : "+s); String t1="["+p+","; if(s.length()==1){ t1=t1+"[$]"; }else{ t1=t1+"["; for(String t:s.split(" ")){ if(!t.equals(String.valueOf(p))){ t1=t1+t+" "; } } t1=t1+"]"; } t1=t1+"]"; //System.out.println("t1 : "+t1); p=mapparent.get(t1); System.out.print(p+"<--"); s=t1; if(p==0) break; } } } //Output /* [1,[$]] cost : 1 [2,[$]] cost : 15 [3,[$]] cost : 6 [2,[1 ]] cost is : 8 [3,[1 ]] cost is : 4 [1,[2 ]] cost is : 21 [3,[2 ]] cost is : 27 [3,[1 2 ]] cost is : 20 : 2 [1,[3 ]] cost is : 10 [2,[3 ]] cost is : 14 [2,[1 3 ]] cost is : 12 : 3 [1,[2 3 ]] cost is : 20 : 2 [0,[1 2 3 ]] cost is : 21 : 2 Min cost Hamiltonian Circuit : 21 Route is : 0<--2<--3<--1<--0<-- */
UTF-8
Java
4,324
java
TravellingSalesmanProb.java
Java
[]
null
[]
package com; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; public class TravSalesProb { static Set<String> sets=new LinkedHashSet<>(); static int[][] dist; static Set<String> trav=new LinkedHashSet<>(); static Map<String, Integer> map=new LinkedHashMap<>(); static Map<String, Integer> mapparent=new LinkedHashMap<>(); public static void main(String[] args) { // TODO Auto-generated method stub //no of vertex int n=4; createSubset(n-1); dist=new int[n][n]; //start vertes : s int startVertex=0; createDisMatrix(); System.out.println("Min cost Hamiltonian Circuit : "+eval_Trav(n, startVertex)); findPath(); } static void createSubset(int n){ int l=(int)Math.pow(2, n); for(int i=0;i<l;i++){ String s=""; int j=1; int k=1; s=s+"["; while(j<l){ int t=j&i; if(t!=0){ s=s+k+" "; } k++; j=j<<1; } s=s+"]"; sets.add(s); } } static void createDisMatrix(){ dist[0][1]=1; dist[0][2]=15; dist[0][3]=6; dist[1][0]=2; dist[1][2]=7; dist[1][3]=3; dist[2][0]=9; dist[2][1]=6; dist[2][3]=12; dist[3][0]=10; dist[3][1]=4; dist[3][2]=8; } static int eval_Trav(int n,int startVertex){ int hamiltonian=0; for(String s:sets){ String k=""; if(!s.equals("[]")){ String t=s.substring(1,s.length()-2); boolean b=false; for(int j=1;j<n;j++){ if(!t.contains(String.valueOf(j))){ k="["+j+","+s+"]"; trav.add(k); //System.out.println("["+j+","+s+"]"); b=true; } } if(!b){ k="["+startVertex+","+s+"]"; trav.add(k); //System.out.println("["+startVertex+","+s+"]"); } }else{ for(int j=1;j<n;j++){ k="["+j+",[$]"+"]"; trav.add(k); //System.out.println("["+j+",$"+"]"); } } //trav.add(k); } for(String j:trav){ System.out.println(j); String a=j.substring(1,2).trim(); String t=j.substring(j.indexOf("[", 1)+1,j.length()-2).trim(); //System.out.println(a+"-->"+t); if(t.equals("$")){ map.put(j, dist[0][Integer.parseInt(a)]); mapparent.put(j, 0); System.out.println("cost : "+dist[0][Integer.parseInt(a)]); }else if(t.length()==1){ map.put(j, (dist[0][Integer.parseInt(t)] +dist[Integer.parseInt(t)][Integer.parseInt(a)])); mapparent.put(j, Integer.parseInt(t)); System.out.println("cost is : "+(dist[0][Integer.parseInt(t)] +dist[Integer.parseInt(t)][Integer.parseInt(a)])); }else{ String[] k=t.split(" "); int min=Integer.MAX_VALUE; int parent=0; String e="["; for(String s:k){ e=e+s+",["; for(String s1:k){ if(!s1.equals(s)){ e=e+s1+" "; } } e=e+"]]"; //System.out.println("e : "+e); int temp=(dist[Integer.parseInt(s)][Integer.parseInt(a)]+map.get(e)); if(temp<min){ min=temp; parent=Integer.parseInt(s); } //System.out.println("cost is : "+); //map.put(j, (dist[Integer.parseInt(s)][Integer.parseInt(a)]+map.get(e))); e="["; //System.out.println("cost is : "+(dist[0][Integer.parseInt(s)] // +" "+dist[Integer.parseInt(s)][Integer.parseInt(a)])); } map.put(j, min); mapparent.put(j, parent); System.out.println("cost is : "+min+" : "+parent); hamiltonian=min; } } return hamiltonian; } static void findPath(){ String s="[0,[1 2 3 ]]"; int p=mapparent.get(s); System.out.println("Route is : "); System.out.print("0<--"+p+"<--"); while(true){ s=s.substring(s.indexOf("[",1)+1,s.length()-2).trim(); //System.out.println("s : "+s); String t1="["+p+","; if(s.length()==1){ t1=t1+"[$]"; }else{ t1=t1+"["; for(String t:s.split(" ")){ if(!t.equals(String.valueOf(p))){ t1=t1+t+" "; } } t1=t1+"]"; } t1=t1+"]"; //System.out.println("t1 : "+t1); p=mapparent.get(t1); System.out.print(p+"<--"); s=t1; if(p==0) break; } } } //Output /* [1,[$]] cost : 1 [2,[$]] cost : 15 [3,[$]] cost : 6 [2,[1 ]] cost is : 8 [3,[1 ]] cost is : 4 [1,[2 ]] cost is : 21 [3,[2 ]] cost is : 27 [3,[1 2 ]] cost is : 20 : 2 [1,[3 ]] cost is : 10 [2,[3 ]] cost is : 14 [2,[1 3 ]] cost is : 12 : 3 [1,[2 3 ]] cost is : 20 : 2 [0,[1 2 3 ]] cost is : 21 : 2 Min cost Hamiltonian Circuit : 21 Route is : 0<--2<--3<--1<--0<-- */
4,324
0.533765
0.497919
199
20.733669
16.504131
82
false
false
0
0
0
0
0
0
3.246231
false
false
3
8d5044202be5e17a45069cc811a518032eda4907
17,566,416,241,569
26842fad54674df3da107910a0b1a7819d094b8e
/extension/user/rpc/src/main/java/org/gwtapp/extension/user/client/data/ReCaptchaUserImpl.java
48fd374b0eaa04fee2f24dba7c400a7542571de3
[]
no_license
radekolesiak/gwtapp
https://github.com/radekolesiak/gwtapp
6f1967f1712045160d91c37d5d9fc649bf5b5f1c
b89601e1795cd1272ec4e103af2b0c2a3cf57b94
refs/heads/master
2016-09-05T16:41:14.923000
2011-10-06T14:12:11
2011-10-06T14:12:11
2,518,901
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.gwtapp.extension.user.client.data; @SuppressWarnings("serial") public class ReCaptchaUserImpl extends UserPasswordImpl implements ReCaptchaUser { private String passwordVerify = PASSWORD_VERIFY.add(this).def(); private String response = RESPONSE.add(this).def(); private String challenge = CHALLENGE.add(this).def(); public ReCaptchaUserImpl() { } public ReCaptchaUserImpl(String login, String email) { super(login, email); } @Override public void setResponse(String response) { this.response = response; } @Override public String getResponse() { return response; } @Override public void setChallenge(String challenge) { this.challenge = challenge; } @Override public String getChallenge() { return challenge; } @Override public void setPasswordVerify(String passwordVerify) { this.passwordVerify = passwordVerify; } @Override public String getPasswordVerify() { return passwordVerify; } }
UTF-8
Java
1,000
java
ReCaptchaUserImpl.java
Java
[]
null
[]
package org.gwtapp.extension.user.client.data; @SuppressWarnings("serial") public class ReCaptchaUserImpl extends UserPasswordImpl implements ReCaptchaUser { private String passwordVerify = PASSWORD_VERIFY.add(this).def(); private String response = RESPONSE.add(this).def(); private String challenge = CHALLENGE.add(this).def(); public ReCaptchaUserImpl() { } public ReCaptchaUserImpl(String login, String email) { super(login, email); } @Override public void setResponse(String response) { this.response = response; } @Override public String getResponse() { return response; } @Override public void setChallenge(String challenge) { this.challenge = challenge; } @Override public String getChallenge() { return challenge; } @Override public void setPasswordVerify(String passwordVerify) { this.passwordVerify = passwordVerify; } @Override public String getPasswordVerify() { return passwordVerify; } }
1,000
0.715
0.715
47
19.276596
20.24394
66
false
false
0
0
0
0
0
0
1.148936
false
false
3
4af8ebefab4d3feb9a16edcbae7a9fae9678361f
16,338,055,633,559
9bb4e413b223b3397c598287c85c8dc595ece46d
/src/multiThreading/threadedMultiplier.java
19449451a44239eef943eecc0a4d528d301cce4b
[]
no_license
HimanshuSingal/githubPract
https://github.com/HimanshuSingal/githubPract
4cd5edd72e215f08828db03440b89475a47594f7
821fadefeadf9ddd2d7df45ac294abe4fae39c23
refs/heads/master
2021-08-11T11:18:44.076000
2017-11-13T16:23:12
2017-11-13T16:23:12
110,219,273
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package multiThreading; import java.util.LinkedList; class MultiplicationThread extends Thread { int arr1[][]; int arr2[][]; int ans[][]; int start; int end; int size; public MultiplicationThread(int arr1[][],int arr2[][],int ans[][], int start,int end,int size) { super(); this.arr1=arr1; this.arr2=arr2; this.ans=ans; this.start=start; this.end=end; this.size=size; } int multrow(int i,int j) { int ans=0; for(int k=0;k<size;k++) ans+=arr1[i][k]*arr2[k][j]; return ans; } public void run() { try { for(int i=start;i<=end;i++) { if(i>=size) break; for(int j=0;j<size;j++) { ans[i][j]=multrow(i,j); } } } catch (Exception e) { // Throwing an exception System.out.println ("Exception is caught"); } } } public class threadedMultiplier extends Multiplier { public threadedMultiplier(int n) { super(n); // TODO Auto-generated constructor stub } public threadedMultiplier(Multiplier n) { super(n); // TODO Auto-generated constructor stub } @Override int[][] multiply() { // TODO Auto-generated method stub int ans[][]=new int[size][size]; int threads=4; int interval=size/4; int start=0; LinkedList<Thread> threadCollect=new LinkedList<Thread>(); for(int i=0;i<threads;i++) { int end=start+interval; if(i==threads-1) end=size-1; Thread object = new Thread(new MultiplicationThread(a,b,ans,start,end,size)); threadCollect.add(object); object.start(); start=end+1; if(start>=size) break; } for (Thread thread : threadCollect) { try { thread.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return ans; } }
UTF-8
Java
1,884
java
threadedMultiplier.java
Java
[]
null
[]
package multiThreading; import java.util.LinkedList; class MultiplicationThread extends Thread { int arr1[][]; int arr2[][]; int ans[][]; int start; int end; int size; public MultiplicationThread(int arr1[][],int arr2[][],int ans[][], int start,int end,int size) { super(); this.arr1=arr1; this.arr2=arr2; this.ans=ans; this.start=start; this.end=end; this.size=size; } int multrow(int i,int j) { int ans=0; for(int k=0;k<size;k++) ans+=arr1[i][k]*arr2[k][j]; return ans; } public void run() { try { for(int i=start;i<=end;i++) { if(i>=size) break; for(int j=0;j<size;j++) { ans[i][j]=multrow(i,j); } } } catch (Exception e) { // Throwing an exception System.out.println ("Exception is caught"); } } } public class threadedMultiplier extends Multiplier { public threadedMultiplier(int n) { super(n); // TODO Auto-generated constructor stub } public threadedMultiplier(Multiplier n) { super(n); // TODO Auto-generated constructor stub } @Override int[][] multiply() { // TODO Auto-generated method stub int ans[][]=new int[size][size]; int threads=4; int interval=size/4; int start=0; LinkedList<Thread> threadCollect=new LinkedList<Thread>(); for(int i=0;i<threads;i++) { int end=start+interval; if(i==threads-1) end=size-1; Thread object = new Thread(new MultiplicationThread(a,b,ans,start,end,size)); threadCollect.add(object); object.start(); start=end+1; if(start>=size) break; } for (Thread thread : threadCollect) { try { thread.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return ans; } }
1,884
0.582272
0.571656
99
18.030304
17.031435
95
false
false
0
0
0
0
0
0
2
false
false
3
399e0f724aabd6536c405b29ea7ccd13e6995270
8,529,805,052,683
06ddc67d3ddd48eccabbd2c74f7ac407749aaa59
/Lesson2/src/edu/galileo/PlaySong.java
13a7fe10bedbd1fa8979b0c9e757ebd295e3a6d8
[]
no_license
eborghi10/Java-edX
https://github.com/eborghi10/Java-edX
846ca96d44db0f31d9000d1c668b77309ce0113a
4ac65087547a7f6e0c8def7402da0b34c749589b
refs/heads/master
2021-01-11T17:38:16.356000
2017-03-08T09:50:41
2017-03-08T09:50:41
79,809,996
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package edu.galileo; /** * Created by emiliano on 30/01/17. * * playSong() can be defined here because it has * a "default" modifier. * * The "public" modifier is redundant * */ public interface PlaySong { default void playSong(String songName) { System.out.println("Playing " + songName); } }
UTF-8
Java
320
java
PlaySong.java
Java
[ { "context": "package edu.galileo;\n\n/**\n * Created by emiliano on 30/01/17.\n *\n * playSong() can be defined here", "end": 48, "score": 0.8814018368721008, "start": 40, "tag": "USERNAME", "value": "emiliano" } ]
null
[]
package edu.galileo; /** * Created by emiliano on 30/01/17. * * playSong() can be defined here because it has * a "default" modifier. * * The "public" modifier is redundant * */ public interface PlaySong { default void playSong(String songName) { System.out.println("Playing " + songName); } }
320
0.653125
0.634375
17
17.82353
18.302155
50
false
false
0
0
0
0
0
0
0.117647
false
false
3
bf7bee028736e2000839a100352d341465ef68ba
14,139,032,402,894
859ea5b9d8bec90e07df04b81f486ea1790af0ef
/seleniummaven/src/main/java/org/h2k/findPatient.java
d6783bce65419b36b36a4779fedf1775588498b1
[]
no_license
Aurodeepa/CheckingWales
https://github.com/Aurodeepa/CheckingWales
bbcda132d852feb69a8715b9767029afea8b6126
b1dffb23cb9701e65df58fb58a0aad8cb15d1379
refs/heads/master
2022-12-27T12:16:01.273000
2020-05-23T00:04:19
2020-05-23T00:04:19
266,231,095
0
0
null
false
2020-10-13T22:13:18
2020-05-23T00:05:37
2020-05-23T00:54:19
2020-10-13T22:13:17
1,509
0
0
1
Java
false
false
package org.h2k; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import io.github.bonigarcia.wdm.WebDriverManager; public class findPatient { WebDriver driver; @BeforeTest public void login() throws Exception{ WebDriverManager.firefoxdriver().setup(); driver = new FirefoxDriver(); driver.get("https://demo.openmrs.org/openmrs/login.htm"); driver.findElement(By.id("username")).sendKeys("Admin"); driver.findElement(By.id("password")).sendKeys("Admin123"); driver.findElement(By.xpath("//ul/li[@id='Inpatient Ward']")).click(); driver.findElement(By.id("loginButton")).click(); //boolean result = true; //return result; } @Test(priority = 5) public void findPatient() throws Exception{ String findPatient = "//a[contains(@id,'activeVisitsHomepage')][1]"; driver.findElement(By.xpath(findPatient)).click(); String patientName = "//input[@id='patient-search']"; driver.findElement(By.xpath(patientName)).sendKeys("John White"); String patientResult = "(//*[@id='patient-search-results-table']//tr/td[1])[1]"; driver.findElement(By.xpath(patientResult)).click(); } }
UTF-8
Java
1,344
java
findPatient.java
Java
[ { "context": " org.testng.annotations.Test;\r\n\r\nimport io.github.bonigarcia.wdm.WebDriverManager;\r\n\r\n\r\n\r\npublic class findPat", "end": 251, "score": 0.9864364862442017, "start": 241, "tag": "USERNAME", "value": "bonigarcia" }, { "context": "\t\tdriver.findElement(By.id(\"username\")).sendKeys(\"Admin\");\r\n\t\tdriver.findElement(By.id(\"password\")).sendK", "end": 593, "score": 0.9817717671394348, "start": 588, "tag": "USERNAME", "value": "Admin" }, { "context": "\t\tdriver.findElement(By.id(\"password\")).sendKeys(\"Admin123\");\r\n\r\n\t\tdriver.findElement(By.xpath(\"//ul/li[@id=", "end": 656, "score": 0.9992295503616333, "start": 648, "tag": "PASSWORD", "value": "Admin123" }, { "context": "iver.findElement(By.xpath(patientName)).sendKeys(\"John White\");\r\n\t\t \r\n\t\t String patientResult = \"(//*[@id='pat", "end": 1173, "score": 0.9997435212135315, "start": 1163, "tag": "NAME", "value": "John White" } ]
null
[]
package org.h2k; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import io.github.bonigarcia.wdm.WebDriverManager; public class findPatient { WebDriver driver; @BeforeTest public void login() throws Exception{ WebDriverManager.firefoxdriver().setup(); driver = new FirefoxDriver(); driver.get("https://demo.openmrs.org/openmrs/login.htm"); driver.findElement(By.id("username")).sendKeys("Admin"); driver.findElement(By.id("password")).sendKeys("<PASSWORD>"); driver.findElement(By.xpath("//ul/li[@id='Inpatient Ward']")).click(); driver.findElement(By.id("loginButton")).click(); //boolean result = true; //return result; } @Test(priority = 5) public void findPatient() throws Exception{ String findPatient = "//a[contains(@id,'activeVisitsHomepage')][1]"; driver.findElement(By.xpath(findPatient)).click(); String patientName = "//input[@id='patient-search']"; driver.findElement(By.xpath(patientName)).sendKeys("<NAME>"); String patientResult = "(//*[@id='patient-search-results-table']//tr/td[1])[1]"; driver.findElement(By.xpath(patientResult)).click(); } }
1,342
0.684524
0.678571
49
25.428572
25.238455
83
false
false
0
0
0
0
0
0
1.632653
false
false
3
e5354a437f81279f8b19a3547071967bd068183b
24,008,867,199,166
7b191cda42441df916acc5ea5a34497daf2f5ad4
/src/main/java/com/rakesh/geektrust/backend/meetfamily/exceptions/InvalidInputException.java
59cb3c623e0b785ca423a41bd7decc50528efff1
[]
no_license
rakeswain/GeektrustChallenge-MeetTheFamily
https://github.com/rakeswain/GeektrustChallenge-MeetTheFamily
719926ba9f8d84298d44ccc1fb54dae8455d23c8
5ee0e14eb1668ac97f9c2d204cd0f69fcc0c68a8
refs/heads/master
2022-12-19T20:30:36.416000
2020-10-05T09:03:44
2020-10-05T09:03:44
301,201,065
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.rakesh.geektrust.backend.meetfamily.exceptions; import com.rakesh.geektrust.backend.meetfamily.constants.ErrorMessage; /** * This is a custom exception thrown for invalid user inputs. */ public class InvalidInputException extends RuntimeException{ /** * Default serial version ID */ private static final long serialVersionUID = 1L; public InvalidInputException() { super(); } public InvalidInputException(ErrorMessage exception) { super(exception.message); } public InvalidInputException(String msg) { super(msg); } }
UTF-8
Java
558
java
InvalidInputException.java
Java
[]
null
[]
package com.rakesh.geektrust.backend.meetfamily.exceptions; import com.rakesh.geektrust.backend.meetfamily.constants.ErrorMessage; /** * This is a custom exception thrown for invalid user inputs. */ public class InvalidInputException extends RuntimeException{ /** * Default serial version ID */ private static final long serialVersionUID = 1L; public InvalidInputException() { super(); } public InvalidInputException(ErrorMessage exception) { super(exception.message); } public InvalidInputException(String msg) { super(msg); } }
558
0.759857
0.758065
26
20.5
24.054825
70
false
false
0
0
0
0
0
0
0.961538
false
false
3
27b0cfd83e4aba5cec6046b6833d3011f86d4ab9
19,988,777,796,413
9db472c488e6a1f060846e70ef97eced3e7df6be
/JAVASE/2_Object-oriented/demo/src/demo3/Test.java
e4a902179128ff188086dea10e6be8ebc24dca9d
[]
no_license
BloodyWolf233/JAVALearning
https://github.com/BloodyWolf233/JAVALearning
07044895e7db6acd9a76231beb00e5af64d23672
2d2382142460e52975165f3a25204f5affcdaa2a
refs/heads/master
2022-12-19T21:22:21.717000
2020-06-10T07:36:30
2020-06-10T07:36:30
236,447,371
1
0
null
false
2022-12-16T04:26:04
2020-01-27T08:30:42
2020-06-13T09:16:19
2022-12-16T04:26:00
452,570
0
0
53
HTML
false
false
package demo3; import java.io.File; public class Test { public static void main(String[] args) { RedPacket rp = new RedPacket("红包"); rp.setOwnerName("我是群主"); rp.setOpenWay(new Common()); //rp.setOpenWay(new Lucky()); } }
UTF-8
Java
275
java
Test.java
Java
[ { "context": "p = new RedPacket(\"红包\");\n rp.setOwnerName(\"我是群主\");\n rp.setOpenWay(new Common());\n /", "end": 176, "score": 0.8644176125526428, "start": 172, "tag": "USERNAME", "value": "我是群主" } ]
null
[]
package demo3; import java.io.File; public class Test { public static void main(String[] args) { RedPacket rp = new RedPacket("红包"); rp.setOwnerName("我是群主"); rp.setOpenWay(new Common()); //rp.setOpenWay(new Lucky()); } }
275
0.596958
0.593156
12
20.916666
16.34757
44
false
false
0
0
0
0
0
0
0.5
false
false
3
e02517855e385e49244f7d29a19baead4809066a
9,113,920,632,941
3c227629d10f0a9091a2b522086b2951ea58b303
/UI/UI_Main.java
4affaa8aac90d31987fefa6b1a601df408866311
[]
no_license
chuminhtan-main/do-an-java
https://github.com/chuminhtan-main/do-an-java
98413057879a8f58cb845b3b6dab12b970ed7e57
2782d7a8ff598cebc95077900a362c0fd4e7db4a
refs/heads/master
2022-09-13T03:13:13.289000
2020-06-04T08:50:21
2020-06-04T08:50:21
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 UI; import DTO.dto_DangNhap; import UI.ChuongTrinhUI.UI_ChuongTrinh; import UI.LopHocUI.UI_LopHoc; import UI.KhachHangUI.UI_KhachHang; import UI.DangNhapUI.UI_DangNhap; import UI.TaiKhoan.UI_TaiKhoan; import java.awt.Color; public class UI_Main extends javax.swing.JFrame { public UI_Main() { initComponents(); } /* =====================Khu vực của Tân======*/ //method giao diện cho nhân viên ghi danh public void showGhiDanh(){ ui_lop.hideBtnLop(); btnTaiKhoan.setVisible(false); ui_ct.hideBtnCt(); } //method giao diện cho nhân viên học vụ public void showHocVu(){ ui_kh.hideBtnKh(); btnTaiKhoan.setVisible(false); ui_ct.hideBtnCt(); } //method hiển thị thông tin người dùng bên góc phải phía trên UI_Main public void setThongTinDangNhap(dto_DangNhap dn){ txtThongTinDangNhap.setText(dn.getMa() + " | " + dn.getHoTen()); } /* ====================Hết khu vực của Tân */ /** * 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(); btnDangXuat = new javax.swing.JButton(); btnThongKe = new javax.swing.JButton(); lblThongKe = new javax.swing.JLabel(); btnKhachHang = new javax.swing.JButton(); lblKhachHang = new javax.swing.JLabel(); btnLopHoc = new javax.swing.JButton(); lblLopHoc = new javax.swing.JLabel(); btnCTHoc = new javax.swing.JButton(); lblCTHoc = new javax.swing.JLabel(); btnTaiKhoan = new javax.swing.JButton(); lblTaiKhoan = new javax.swing.JLabel(); pnBody = new javax.swing.JPanel(); pnThongKe = new javax.swing.JPanel(); txtThongTinDangNhap = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Quản Lý Trung Tâm Anh Ngữ"); setSize(new java.awt.Dimension(1200, 700)); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); btnDangXuat.setBackground(new java.awt.Color(51, 153, 0)); btnDangXuat.setForeground(new java.awt.Color(255, 255, 255)); btnDangXuat.setText("Đăng Xuất"); btnDangXuat.setBorder(null); btnDangXuat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDangXuatActionPerformed(evt); } }); btnThongKe.setBackground(new java.awt.Color(153, 255, 153)); btnThongKe.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/thong k3.png"))); // NOI18N btnThongKe.setText("THỐNG KÊ"); btnThongKe.setContentAreaFilled(false); btnThongKe.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnThongKe.setFocusable(false); btnThongKe.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnThongKeActionPerformed(evt); } }); lblThongKe.setBackground(new java.awt.Color(0, 204, 106)); lblThongKe.setOpaque(true); btnKhachHang.setBackground(new java.awt.Color(153, 255, 153)); btnKhachHang.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnKhachHang.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/khach hang 2.png"))); // NOI18N btnKhachHang.setText("KHÁCH HÀNG"); btnKhachHang.setContentAreaFilled(false); btnKhachHang.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnKhachHang.setFocusable(false); btnKhachHang.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnKhachHangActionPerformed(evt); } }); lblKhachHang.setBackground(new java.awt.Color(255, 255, 255)); lblKhachHang.setOpaque(true); btnLopHoc.setBackground(new java.awt.Color(153, 255, 153)); btnLopHoc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnLopHoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/class2.png"))); // NOI18N btnLopHoc.setText("LỚP HỌC"); btnLopHoc.setContentAreaFilled(false); btnLopHoc.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnLopHoc.setFocusable(false); btnLopHoc.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLopHocActionPerformed(evt); } }); lblLopHoc.setBackground(new java.awt.Color(255, 255, 255)); lblLopHoc.setOpaque(true); btnCTHoc.setBackground(new java.awt.Color(153, 255, 153)); btnCTHoc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnCTHoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/chuong trinh hoc 1.png"))); // NOI18N btnCTHoc.setText("CHƯƠNG TRÌNH HỌC"); btnCTHoc.setContentAreaFilled(false); btnCTHoc.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnCTHoc.setFocusable(false); btnCTHoc.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCTHocActionPerformed(evt); } }); lblCTHoc.setBackground(new java.awt.Color(255, 255, 255)); lblCTHoc.setOpaque(true); btnTaiKhoan.setBackground(new java.awt.Color(153, 255, 153)); btnTaiKhoan.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tai khoan 1.png"))); // NOI18N btnTaiKhoan.setText("TÀI KHOẢN"); btnTaiKhoan.setContentAreaFilled(false); btnTaiKhoan.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnTaiKhoan.setFocusable(false); btnTaiKhoan.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnTaiKhoanActionPerformed(evt); } }); lblTaiKhoan.setBackground(new java.awt.Color(255, 255, 255)); lblTaiKhoan.setOpaque(true); pnBody.setBackground(new java.awt.Color(204, 255, 255)); pnBody.setLayout(new java.awt.CardLayout()); pnThongKe.setBackground(new java.awt.Color(255, 255, 255)); javax.swing.GroupLayout pnThongKeLayout = new javax.swing.GroupLayout(pnThongKe); pnThongKe.setLayout(pnThongKeLayout); pnThongKeLayout.setHorizontalGroup( pnThongKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1200, Short.MAX_VALUE) ); pnThongKeLayout.setVerticalGroup( pnThongKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); pnBody.add(pnThongKe, "card4"); txtThongTinDangNhap.setEditable(false); txtThongTinDangNhap.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N txtThongTinDangNhap.setHorizontalAlignment(javax.swing.JTextField.CENTER); txtThongTinDangNhap.setText("<Tên Nhân Viên>-<Mã NV>"); txtThongTinDangNhap.setBorder(null); txtThongTinDangNhap.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtThongTinDangNhapActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(lblThongKe, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(btnThongKe)) .addGap(20, 20, 20) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnKhachHang) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(lblKhachHang, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(btnLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(24, 24, 24))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(btnCTHoc)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblCTHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(12, 12, 12))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(btnTaiKhoan)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(lblTaiKhoan, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(14, 14, 14))) .addGap(20, 20, 20) .addComponent(txtThongTinDangNhap) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnDangXuat, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(pnBody, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnKhachHang) .addComponent(btnLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnCTHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnTaiKhoan, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(txtThongTinDangNhap, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(btnThongKe) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(btnDangXuat, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(lblCTHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblTaiKhoan, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblKhachHang, javax.swing.GroupLayout.DEFAULT_SIZE, 7, Short.MAX_VALUE) .addComponent(lblThongKe, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(52, 52, 52) .addComponent(pnBody, javax.swing.GroupLayout.PREFERRED_SIZE, 612, javax.swing.GroupLayout.PREFERRED_SIZE)) ); 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.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); setSize(new java.awt.Dimension(1216, 745)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void btnThongKeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnThongKeActionPerformed lblThongKe.setBackground(new Color(0, 204, 106)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.add(pnThongKe); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnThongKeActionPerformed private void btnKhachHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKhachHangActionPerformed lblKhachHang.setBackground(new Color(255,0,151)); lblThongKe.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_kh); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnKhachHangActionPerformed private void btnLopHocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLopHocActionPerformed lblLopHoc.setBackground(new Color(96,60,186)); lblThongKe.setBackground(new Color(255, 255, 255)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_lop); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnLopHocActionPerformed private void btnCTHocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCTHocActionPerformed lblCTHoc.setBackground(new Color(0,171,169)); lblThongKe.setBackground(new Color(255, 255, 255)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_ct); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnCTHocActionPerformed private void btnTaiKhoanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTaiKhoanActionPerformed lblTaiKhoan.setBackground(new Color(255,196,13)); lblThongKe.setBackground(new Color(255, 255, 255)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_tk); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnTaiKhoanActionPerformed private void txtThongTinDangNhapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtThongTinDangNhapActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtThongTinDangNhapActionPerformed private void btnDangXuatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDangXuatActionPerformed dispose(); new UI_DangNhap().show(); }//GEN-LAST:event_btnDangXuatActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Windows".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new UI_Main().setVisible(true); } }); } //Biến tự định nghĩa private UI_LopHoc ui_lop = new UI_LopHoc(); private UI_KhachHang ui_kh = new UI_KhachHang(); private UI_ChuongTrinh ui_ct = new UI_ChuongTrinh(); private UI_TaiKhoan ui_tk = new UI_TaiKhoan(); //Kết thúc biến tự định nghĩa // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCTHoc; private javax.swing.JButton btnDangXuat; private javax.swing.JButton btnKhachHang; private javax.swing.JButton btnLopHoc; private javax.swing.JButton btnTaiKhoan; private javax.swing.JButton btnThongKe; private javax.swing.JPanel jPanel1; private javax.swing.JLabel lblCTHoc; private javax.swing.JLabel lblKhachHang; private javax.swing.JLabel lblLopHoc; private javax.swing.JLabel lblTaiKhoan; private javax.swing.JLabel lblThongKe; private javax.swing.JPanel pnBody; private javax.swing.JPanel pnThongKe; private javax.swing.JTextField txtThongTinDangNhap; // End of variables declaration//GEN-END:variables }
UTF-8
Java
21,720
java
UI_Main.java
Java
[]
null
[]
/* * 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 UI; import DTO.dto_DangNhap; import UI.ChuongTrinhUI.UI_ChuongTrinh; import UI.LopHocUI.UI_LopHoc; import UI.KhachHangUI.UI_KhachHang; import UI.DangNhapUI.UI_DangNhap; import UI.TaiKhoan.UI_TaiKhoan; import java.awt.Color; public class UI_Main extends javax.swing.JFrame { public UI_Main() { initComponents(); } /* =====================Khu vực của Tân======*/ //method giao diện cho nhân viên ghi danh public void showGhiDanh(){ ui_lop.hideBtnLop(); btnTaiKhoan.setVisible(false); ui_ct.hideBtnCt(); } //method giao diện cho nhân viên học vụ public void showHocVu(){ ui_kh.hideBtnKh(); btnTaiKhoan.setVisible(false); ui_ct.hideBtnCt(); } //method hiển thị thông tin người dùng bên góc phải phía trên UI_Main public void setThongTinDangNhap(dto_DangNhap dn){ txtThongTinDangNhap.setText(dn.getMa() + " | " + dn.getHoTen()); } /* ====================Hết khu vực của Tân */ /** * 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(); btnDangXuat = new javax.swing.JButton(); btnThongKe = new javax.swing.JButton(); lblThongKe = new javax.swing.JLabel(); btnKhachHang = new javax.swing.JButton(); lblKhachHang = new javax.swing.JLabel(); btnLopHoc = new javax.swing.JButton(); lblLopHoc = new javax.swing.JLabel(); btnCTHoc = new javax.swing.JButton(); lblCTHoc = new javax.swing.JLabel(); btnTaiKhoan = new javax.swing.JButton(); lblTaiKhoan = new javax.swing.JLabel(); pnBody = new javax.swing.JPanel(); pnThongKe = new javax.swing.JPanel(); txtThongTinDangNhap = new javax.swing.JTextField(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Quản Lý Trung Tâm Anh Ngữ"); setSize(new java.awt.Dimension(1200, 700)); jPanel1.setBackground(new java.awt.Color(255, 255, 255)); btnDangXuat.setBackground(new java.awt.Color(51, 153, 0)); btnDangXuat.setForeground(new java.awt.Color(255, 255, 255)); btnDangXuat.setText("Đăng Xuất"); btnDangXuat.setBorder(null); btnDangXuat.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnDangXuatActionPerformed(evt); } }); btnThongKe.setBackground(new java.awt.Color(153, 255, 153)); btnThongKe.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnThongKe.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/thong k3.png"))); // NOI18N btnThongKe.setText("THỐNG KÊ"); btnThongKe.setContentAreaFilled(false); btnThongKe.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnThongKe.setFocusable(false); btnThongKe.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnThongKeActionPerformed(evt); } }); lblThongKe.setBackground(new java.awt.Color(0, 204, 106)); lblThongKe.setOpaque(true); btnKhachHang.setBackground(new java.awt.Color(153, 255, 153)); btnKhachHang.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnKhachHang.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/khach hang 2.png"))); // NOI18N btnKhachHang.setText("KHÁCH HÀNG"); btnKhachHang.setContentAreaFilled(false); btnKhachHang.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnKhachHang.setFocusable(false); btnKhachHang.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnKhachHangActionPerformed(evt); } }); lblKhachHang.setBackground(new java.awt.Color(255, 255, 255)); lblKhachHang.setOpaque(true); btnLopHoc.setBackground(new java.awt.Color(153, 255, 153)); btnLopHoc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnLopHoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/class2.png"))); // NOI18N btnLopHoc.setText("LỚP HỌC"); btnLopHoc.setContentAreaFilled(false); btnLopHoc.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnLopHoc.setFocusable(false); btnLopHoc.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnLopHocActionPerformed(evt); } }); lblLopHoc.setBackground(new java.awt.Color(255, 255, 255)); lblLopHoc.setOpaque(true); btnCTHoc.setBackground(new java.awt.Color(153, 255, 153)); btnCTHoc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnCTHoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/chuong trinh hoc 1.png"))); // NOI18N btnCTHoc.setText("CHƯƠNG TRÌNH HỌC"); btnCTHoc.setContentAreaFilled(false); btnCTHoc.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnCTHoc.setFocusable(false); btnCTHoc.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCTHocActionPerformed(evt); } }); lblCTHoc.setBackground(new java.awt.Color(255, 255, 255)); lblCTHoc.setOpaque(true); btnTaiKhoan.setBackground(new java.awt.Color(153, 255, 153)); btnTaiKhoan.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N btnTaiKhoan.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/tai khoan 1.png"))); // NOI18N btnTaiKhoan.setText("TÀI KHOẢN"); btnTaiKhoan.setContentAreaFilled(false); btnTaiKhoan.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); btnTaiKhoan.setFocusable(false); btnTaiKhoan.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnTaiKhoanActionPerformed(evt); } }); lblTaiKhoan.setBackground(new java.awt.Color(255, 255, 255)); lblTaiKhoan.setOpaque(true); pnBody.setBackground(new java.awt.Color(204, 255, 255)); pnBody.setLayout(new java.awt.CardLayout()); pnThongKe.setBackground(new java.awt.Color(255, 255, 255)); javax.swing.GroupLayout pnThongKeLayout = new javax.swing.GroupLayout(pnThongKe); pnThongKe.setLayout(pnThongKeLayout); pnThongKeLayout.setHorizontalGroup( pnThongKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 1200, Short.MAX_VALUE) ); pnThongKeLayout.setVerticalGroup( pnThongKeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGap(0, 0, Short.MAX_VALUE) ); pnBody.add(pnThongKe, "card4"); txtThongTinDangNhap.setEditable(false); txtThongTinDangNhap.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N txtThongTinDangNhap.setHorizontalAlignment(javax.swing.JTextField.CENTER); txtThongTinDangNhap.setText("<Tên Nhân Viên>-<Mã NV>"); txtThongTinDangNhap.setBorder(null); txtThongTinDangNhap.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtThongTinDangNhapActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(lblThongKe, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(btnThongKe)) .addGap(20, 20, 20) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnKhachHang) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(10, 10, 10) .addComponent(lblKhachHang, javax.swing.GroupLayout.PREFERRED_SIZE, 127, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(btnLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(24, 24, 24))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(btnCTHoc)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(lblCTHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(12, 12, 12))) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(20, 20, 20) .addComponent(btnTaiKhoan)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addComponent(lblTaiKhoan, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(14, 14, 14))) .addGap(20, 20, 20) .addComponent(txtThongTinDangNhap) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnDangXuat, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(pnBody, javax.swing.GroupLayout.DEFAULT_SIZE, 0, Short.MAX_VALUE) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnKhachHang) .addComponent(btnLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnCTHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnTaiKhoan, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(txtThongTinDangNhap, javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(btnThongKe) .addGap(0, 0, Short.MAX_VALUE)) .addComponent(btnDangXuat, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(lblCTHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblLopHoc, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblTaiKhoan, javax.swing.GroupLayout.PREFERRED_SIZE, 6, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblKhachHang, javax.swing.GroupLayout.DEFAULT_SIZE, 7, Short.MAX_VALUE) .addComponent(lblThongKe, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(52, 52, 52) .addComponent(pnBody, javax.swing.GroupLayout.PREFERRED_SIZE, 612, javax.swing.GroupLayout.PREFERRED_SIZE)) ); 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.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) ); setSize(new java.awt.Dimension(1216, 745)); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void btnThongKeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnThongKeActionPerformed lblThongKe.setBackground(new Color(0, 204, 106)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.add(pnThongKe); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnThongKeActionPerformed private void btnKhachHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnKhachHangActionPerformed lblKhachHang.setBackground(new Color(255,0,151)); lblThongKe.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_kh); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnKhachHangActionPerformed private void btnLopHocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLopHocActionPerformed lblLopHoc.setBackground(new Color(96,60,186)); lblThongKe.setBackground(new Color(255, 255, 255)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_lop); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnLopHocActionPerformed private void btnCTHocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCTHocActionPerformed lblCTHoc.setBackground(new Color(0,171,169)); lblThongKe.setBackground(new Color(255, 255, 255)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblTaiKhoan.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_ct); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnCTHocActionPerformed private void btnTaiKhoanActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnTaiKhoanActionPerformed lblTaiKhoan.setBackground(new Color(255,196,13)); lblThongKe.setBackground(new Color(255, 255, 255)); lblKhachHang.setBackground(new Color(255, 255, 255)); lblLopHoc.setBackground(new Color(255, 255, 255)); lblCTHoc.setBackground(new Color(255, 255, 255)); pnBody.removeAll(); pnBody.repaint(); pnBody.revalidate(); pnBody.add(ui_tk); pnBody.repaint(); pnBody.revalidate(); }//GEN-LAST:event_btnTaiKhoanActionPerformed private void txtThongTinDangNhapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtThongTinDangNhapActionPerformed // TODO add your handling code here: }//GEN-LAST:event_txtThongTinDangNhapActionPerformed private void btnDangXuatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDangXuatActionPerformed dispose(); new UI_DangNhap().show(); }//GEN-LAST:event_btnDangXuatActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Windows".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(UI_Main.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new UI_Main().setVisible(true); } }); } //Biến tự định nghĩa private UI_LopHoc ui_lop = new UI_LopHoc(); private UI_KhachHang ui_kh = new UI_KhachHang(); private UI_ChuongTrinh ui_ct = new UI_ChuongTrinh(); private UI_TaiKhoan ui_tk = new UI_TaiKhoan(); //Kết thúc biến tự định nghĩa // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnCTHoc; private javax.swing.JButton btnDangXuat; private javax.swing.JButton btnKhachHang; private javax.swing.JButton btnLopHoc; private javax.swing.JButton btnTaiKhoan; private javax.swing.JButton btnThongKe; private javax.swing.JPanel jPanel1; private javax.swing.JLabel lblCTHoc; private javax.swing.JLabel lblKhachHang; private javax.swing.JLabel lblLopHoc; private javax.swing.JLabel lblTaiKhoan; private javax.swing.JLabel lblThongKe; private javax.swing.JPanel pnBody; private javax.swing.JPanel pnThongKe; private javax.swing.JTextField txtThongTinDangNhap; // End of variables declaration//GEN-END:variables }
21,720
0.654801
0.629328
436
48.612385
35.04216
152
false
false
0
0
0
0
0
0
0.933486
false
false
3
674b4b8247419087ea0114c4cb3ce886b770f1ce
8,358,006,402,856
603ead2d04f176db08d24f224b0f0a9bf103fa41
/AjaxDropDown/src/main/java/com/cjc/main/model/State.java
a93d791bb1251989e8b755ccd468a594058f439c
[]
no_license
Ninadk007/Ganesh
https://github.com/Ninadk007/Ganesh
1f530e34ddc566695bd8f46edf72b1d139b54f29
4d96f3c403a5374706a03cce71a23fe21ae39516
refs/heads/master
2022-07-08T00:09:19.706000
2019-06-01T17:20:58
2019-06-01T17:20:58
189,758,540
0
0
null
false
2022-06-21T01:12:35
2019-06-01T17:11:00
2019-06-01T17:21:00
2022-06-21T01:12:32
58
0
0
2
Java
false
false
package com.cjc.main.model; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class State { @Id private int sid; private String sname; private int cid; public int getSid() { return sid; } public void setSid(int sid) { this.sid = sid; } public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname; } public int getCid() { return cid; } public void setCid(int cid) { this.cid = cid; } }
UTF-8
Java
522
java
State.java
Java
[]
null
[]
package com.cjc.main.model; import javax.persistence.Entity; import javax.persistence.Id; @Entity public class State { @Id private int sid; private String sname; private int cid; public int getSid() { return sid; } public void setSid(int sid) { this.sid = sid; } public String getSname() { return sname; } public void setSname(String sname) { this.sname = sname; } public int getCid() { return cid; } public void setCid(int cid) { this.cid = cid; } }
522
0.628352
0.628352
34
13.352942
11.476017
37
false
false
0
0
0
0
0
0
1.264706
false
false
3
8138dbdbc482694982b23216149a051e6516fb04
17,841,294,174,256
93262adbdddf20be472e2410798cb1cfec75bea4
/PlantsVsZombies/PlantsVsZombies/src/plant/Sunflower.java
527e47507fecaf32117dc6ad19ee7511063b6fb0
[ "MIT" ]
permissive
lyccccs/Plant-Vs-Zombies
https://github.com/lyccccs/Plant-Vs-Zombies
109fd27868501f480e6497ddda95e7f64f050cce
a3a3dc9fdea5f96df2b379a3866e85c42e140fad
refs/heads/main
2023-06-23T12:00:35.452000
2021-06-10T10:35:15
2021-06-10T10:35:15
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package plant; import javafx.scene.canvas.GraphicsContext; import javafx.scene.image.Image; import main.Game; import utility.Constant; import utility.Sun; /** * <p> * <code>Sunflower</code>类为植物<code>Sunflower</code>的具体实现类。 * </p> */ public class Sunflower extends Plant { /** * 是否是生产出的第一个太阳 */ public boolean isFirstSun = true; public final Image SUNFLOWER_IMAGE_1 = createImage("/resources/Plants/SunFlower/SunFlower_0.png"); public final Image SUNFLOWER_IMAGE_2 = createImage("/resources/Plants/SunFlower/SunFlower_1.png"); public final Image SUNFLOWER_IMAGE_3 = createImage("/resources/Plants/SunFlower/SunFlower_2.png"); public final Image SUNFLOWER_IMAGE_4 = createImage("/resources/Plants/SunFlower/SunFlower_3.png"); public final Image SUNFLOWER_IMAGE_5 = createImage("/resources/Plants/SunFlower/SunFlower_4.png"); public final Image SUNFLOWER_IMAGE_6 = createImage("/resources/Plants/SunFlower/SunFlower_5.png"); public final Image SUNFLOWER_IMAGE_7 = createImage("/resources/Plants/SunFlower/SunFlower_6.png"); public final Image SUNFLOWER_IMAGE_8 = createImage("/resources/Plants/SunFlower/SunFlower_7.png"); public final Image SUNFLOWER_IMAGE_9 = createImage("/resources/Plants/SunFlower/SunFlower_8.png"); public final Image SUNFLOWER_IMAGE_10 = createImage("/resources/Plants/SunFlower/SunFlower_9.png"); public final Image SUNFLOWER_IMAGE_11 = createImage("/resources/Plants/SunFlower/SunFlower_10.png"); public final Image SUNFLOWER_IMAGE_12 = createImage("/resources/Plants/SunFlower/SunFlower_11.png"); public final Image SUNFLOWER_IMAGE_13 = createImage("/resources/Plants/SunFlower/SunFlower_12.png"); public final Image SUNFLOWER_IMAGE_14 = createImage("/resources/Plants/SunFlower/SunFlower_13.png"); public final Image SUNFLOWER_IMAGE_15 = createImage("/resources/Plants/SunFlower/SunFlower_14.png"); public final Image SUNFLOWER_IMAGE_16 = createImage("/resources/Plants/SunFlower/SunFlower_15.png"); public final Image SUNFLOWER_IMAGE_17 = createImage("/resources/Plants/SunFlower/SunFlower_16.png"); public final Image[] SUNFLOWER_IMAGE = { SUNFLOWER_IMAGE_1, SUNFLOWER_IMAGE_2, SUNFLOWER_IMAGE_3, SUNFLOWER_IMAGE_4, SUNFLOWER_IMAGE_5, SUNFLOWER_IMAGE_6, SUNFLOWER_IMAGE_7, SUNFLOWER_IMAGE_8, SUNFLOWER_IMAGE_9, SUNFLOWER_IMAGE_10, SUNFLOWER_IMAGE_11, SUNFLOWER_IMAGE_12, SUNFLOWER_IMAGE_13, SUNFLOWER_IMAGE_14, SUNFLOWER_IMAGE_15, SUNFLOWER_IMAGE_16, SUNFLOWER_IMAGE_17 }; /** * <p> * 根据传入的格子编号,在对应的格子上创建<code>Sunflower</code>对象。 * </p> * <p> * 创建<code>Sunflower</code>对象时,会对<code>Sunflower</code>的一些成员变量对应地进行初始化。 * </p> * @param tileNumber 欲种下的<code>Sunflower</code>所在的格子编号 * @see Plant */ public Sunflower(int tileNumber) { super(tileNumber); sunCost = Constant.SUNFLOWER_SUNCOST; health = Constant.SUNFLOWER_HEALTH; damage = Constant.SUNFLOWER_DAMAGE; attackSpeed = Constant.SUNFLOWER_ATTACK_SPEED; cooldownTime = Constant.SUNFLOWER_COOLDOWN_TIME; firstPurchaseNoCooldown = true; setImage(SUNFLOWER_IMAGE[0]); setVelocity(0, 0); } /** * <p> * 根据传入的格子编号以及指定的图片长宽,在对应的格子上创建<code>Sunflower</code>对象。 * </p> * <p> * 创建<code>Sunflower</code>对象时,会对<code>Sunflower</code>的一些成员变量对应地进行初始化。 * 此对象的图片长宽为传入的参数中指定的长宽。 * </p> * @param tileNumber 欲种下的<code>Sunflower</code>所在的格子编号 * @param width 指定的图片宽度 * @param height 指定的图片长度 * @see Plant */ public Sunflower(int tileNumber, double width, double height) { this(tileNumber); setImage("/resources/Plants/SunFlower/SunFlower_0.png", width, height); } /** * <p> * 更新<code>Sunflower</code>对象的属性及状态,也对<code>Sunflower</code>的太阳生产进行更新与判定。 * </p> * <p> * 此方法也把<code>Sunflower</code>对象渲染到屏幕上。 * <code>Sunflower</code>每隔一段时间就会生产太阳。 * 太阳可以点击获取,要是一段时间内没被点击掉则会消失。 * </p> * @param time 时间 * @param context <code>GraphicsContext</code>对象 */ @Override public void update(long time, GraphicsContext context) { int i = (int) ((System.currentTimeMillis() - createdTime) / SUNFLOWER_IMAGE.length / 6 % SUNFLOWER_IMAGE.length); setImage(SUNFLOWER_IMAGE[i]); elapsedTime = System.currentTimeMillis() - recordedTime; if (elapsedTime > attackSpeed * 1000 || (elapsedTime > 5000 && isFirstSun)) { Sun sun = new Sun(this); Game.sunList.add(sun); recordedTime = System.currentTimeMillis(); isFirstSun = false; } if (health <= 0) { Game.plantList.remove(this); Game.tileHasPlant.remove(tile); } this.render(context); } }
UTF-8
Java
5,395
java
Sunflower.java
Java
[]
null
[]
package plant; import javafx.scene.canvas.GraphicsContext; import javafx.scene.image.Image; import main.Game; import utility.Constant; import utility.Sun; /** * <p> * <code>Sunflower</code>类为植物<code>Sunflower</code>的具体实现类。 * </p> */ public class Sunflower extends Plant { /** * 是否是生产出的第一个太阳 */ public boolean isFirstSun = true; public final Image SUNFLOWER_IMAGE_1 = createImage("/resources/Plants/SunFlower/SunFlower_0.png"); public final Image SUNFLOWER_IMAGE_2 = createImage("/resources/Plants/SunFlower/SunFlower_1.png"); public final Image SUNFLOWER_IMAGE_3 = createImage("/resources/Plants/SunFlower/SunFlower_2.png"); public final Image SUNFLOWER_IMAGE_4 = createImage("/resources/Plants/SunFlower/SunFlower_3.png"); public final Image SUNFLOWER_IMAGE_5 = createImage("/resources/Plants/SunFlower/SunFlower_4.png"); public final Image SUNFLOWER_IMAGE_6 = createImage("/resources/Plants/SunFlower/SunFlower_5.png"); public final Image SUNFLOWER_IMAGE_7 = createImage("/resources/Plants/SunFlower/SunFlower_6.png"); public final Image SUNFLOWER_IMAGE_8 = createImage("/resources/Plants/SunFlower/SunFlower_7.png"); public final Image SUNFLOWER_IMAGE_9 = createImage("/resources/Plants/SunFlower/SunFlower_8.png"); public final Image SUNFLOWER_IMAGE_10 = createImage("/resources/Plants/SunFlower/SunFlower_9.png"); public final Image SUNFLOWER_IMAGE_11 = createImage("/resources/Plants/SunFlower/SunFlower_10.png"); public final Image SUNFLOWER_IMAGE_12 = createImage("/resources/Plants/SunFlower/SunFlower_11.png"); public final Image SUNFLOWER_IMAGE_13 = createImage("/resources/Plants/SunFlower/SunFlower_12.png"); public final Image SUNFLOWER_IMAGE_14 = createImage("/resources/Plants/SunFlower/SunFlower_13.png"); public final Image SUNFLOWER_IMAGE_15 = createImage("/resources/Plants/SunFlower/SunFlower_14.png"); public final Image SUNFLOWER_IMAGE_16 = createImage("/resources/Plants/SunFlower/SunFlower_15.png"); public final Image SUNFLOWER_IMAGE_17 = createImage("/resources/Plants/SunFlower/SunFlower_16.png"); public final Image[] SUNFLOWER_IMAGE = { SUNFLOWER_IMAGE_1, SUNFLOWER_IMAGE_2, SUNFLOWER_IMAGE_3, SUNFLOWER_IMAGE_4, SUNFLOWER_IMAGE_5, SUNFLOWER_IMAGE_6, SUNFLOWER_IMAGE_7, SUNFLOWER_IMAGE_8, SUNFLOWER_IMAGE_9, SUNFLOWER_IMAGE_10, SUNFLOWER_IMAGE_11, SUNFLOWER_IMAGE_12, SUNFLOWER_IMAGE_13, SUNFLOWER_IMAGE_14, SUNFLOWER_IMAGE_15, SUNFLOWER_IMAGE_16, SUNFLOWER_IMAGE_17 }; /** * <p> * 根据传入的格子编号,在对应的格子上创建<code>Sunflower</code>对象。 * </p> * <p> * 创建<code>Sunflower</code>对象时,会对<code>Sunflower</code>的一些成员变量对应地进行初始化。 * </p> * @param tileNumber 欲种下的<code>Sunflower</code>所在的格子编号 * @see Plant */ public Sunflower(int tileNumber) { super(tileNumber); sunCost = Constant.SUNFLOWER_SUNCOST; health = Constant.SUNFLOWER_HEALTH; damage = Constant.SUNFLOWER_DAMAGE; attackSpeed = Constant.SUNFLOWER_ATTACK_SPEED; cooldownTime = Constant.SUNFLOWER_COOLDOWN_TIME; firstPurchaseNoCooldown = true; setImage(SUNFLOWER_IMAGE[0]); setVelocity(0, 0); } /** * <p> * 根据传入的格子编号以及指定的图片长宽,在对应的格子上创建<code>Sunflower</code>对象。 * </p> * <p> * 创建<code>Sunflower</code>对象时,会对<code>Sunflower</code>的一些成员变量对应地进行初始化。 * 此对象的图片长宽为传入的参数中指定的长宽。 * </p> * @param tileNumber 欲种下的<code>Sunflower</code>所在的格子编号 * @param width 指定的图片宽度 * @param height 指定的图片长度 * @see Plant */ public Sunflower(int tileNumber, double width, double height) { this(tileNumber); setImage("/resources/Plants/SunFlower/SunFlower_0.png", width, height); } /** * <p> * 更新<code>Sunflower</code>对象的属性及状态,也对<code>Sunflower</code>的太阳生产进行更新与判定。 * </p> * <p> * 此方法也把<code>Sunflower</code>对象渲染到屏幕上。 * <code>Sunflower</code>每隔一段时间就会生产太阳。 * 太阳可以点击获取,要是一段时间内没被点击掉则会消失。 * </p> * @param time 时间 * @param context <code>GraphicsContext</code>对象 */ @Override public void update(long time, GraphicsContext context) { int i = (int) ((System.currentTimeMillis() - createdTime) / SUNFLOWER_IMAGE.length / 6 % SUNFLOWER_IMAGE.length); setImage(SUNFLOWER_IMAGE[i]); elapsedTime = System.currentTimeMillis() - recordedTime; if (elapsedTime > attackSpeed * 1000 || (elapsedTime > 5000 && isFirstSun)) { Sun sun = new Sun(this); Game.sunList.add(sun); recordedTime = System.currentTimeMillis(); isFirstSun = false; } if (health <= 0) { Game.plantList.remove(this); Game.tileHasPlant.remove(tile); } this.render(context); } }
5,395
0.670023
0.651942
116
40.956898
37.24115
128
false
false
0
0
0
0
0
0
0.603448
false
false
3
a1820ae7221633c55b9cfab615f68cad1be35ed7
12,000,138,664,991
f378ddd47c8b7de6e9cf1d4228c84f73e9dc59f1
/projetos/heroku-jenkins-plugin/src/test/java/com/heroku/ConfigAddTest.java
388cb2e7920a1f97a0ea4001ee4a7a36965c5799
[]
no_license
charles-marques/dataset-375
https://github.com/charles-marques/dataset-375
29e2f99ac1ba323f8cb78bf80107963fc180487c
51583daaf58d5669c69d8208b8c4ed4e009001a5
refs/heads/master
2023-01-20T07:23:09.445000
2020-11-27T22:35:49
2020-11-27T22:35:49
283,315,149
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.heroku; import com.heroku.api.App; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import org.apache.commons.io.FileUtils; import java.util.Map; import java.util.Set; /** * @author Ryan Brainard */ public class ConfigAddTest extends BaseHerokuBuildStepTest { public void testPerform() throws Exception { runWithNewApp(new AppRunnable() { public void run(App app) throws Exception { // clean up config for (Map.Entry<String, String> c : api.listConfig(app.getName()).entrySet()) { api.removeConfig(app.getName(), c.getKey()); } assertTrue(api.listConfig(app.getName()).isEmpty()); FreeStyleProject project = createFreeStyleProject(); project.getBuildersList().add(new ConfigAdd(apiKey, app.getName(), "A=a")); project.scheduleBuild2(0).get(); final Map<String, String> configAfter = api.listConfig(app.getName()); assertEquals("a", configAfter.get("A")); } }); } }
UTF-8
Java
1,122
java
ConfigAddTest.java
Java
[ { "context": "va.util.Map;\nimport java.util.Set;\n\n/**\n * @author Ryan Brainard\n */\npublic class ConfigAddTest extends BaseHeroku", "end": 236, "score": 0.999834418296814, "start": 223, "tag": "NAME", "value": "Ryan Brainard" } ]
null
[]
package com.heroku; import com.heroku.api.App; import hudson.model.FreeStyleBuild; import hudson.model.FreeStyleProject; import org.apache.commons.io.FileUtils; import java.util.Map; import java.util.Set; /** * @author <NAME> */ public class ConfigAddTest extends BaseHerokuBuildStepTest { public void testPerform() throws Exception { runWithNewApp(new AppRunnable() { public void run(App app) throws Exception { // clean up config for (Map.Entry<String, String> c : api.listConfig(app.getName()).entrySet()) { api.removeConfig(app.getName(), c.getKey()); } assertTrue(api.listConfig(app.getName()).isEmpty()); FreeStyleProject project = createFreeStyleProject(); project.getBuildersList().add(new ConfigAdd(apiKey, app.getName(), "A=a")); project.scheduleBuild2(0).get(); final Map<String, String> configAfter = api.listConfig(app.getName()); assertEquals("a", configAfter.get("A")); } }); } }
1,115
0.609626
0.607843
34
32
28.42948
94
false
false
0
0
0
0
0
0
0.617647
false
false
3
741bc21bed805d9faf9fb914660e16bf3b6b941a
10,548,439,727,770
4344574d8becc504f7d908abadf1d66b46a6c5ed
/app/src/main/java/br/com/trees/NovaAmostra.java
69588fa4c8ea83634888cc331b0ba15a894fbcfd
[]
no_license
Beleboni/androidstudio
https://github.com/Beleboni/androidstudio
4f4f46fec9fd81622a25cfa482e5d66a8df5e8c7
ef174b212cf453e0797ad79d747728913cd0cadb
refs/heads/master
2021-05-15T14:20:25.942000
2017-10-20T02:25:42
2017-10-20T02:25:42
107,200,666
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package br.com.trees; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.Toast; import java.util.Date; import br.com.dao.AmostraDAO; import br.com.dao.ProjetoAmostrasDAO; import br.com.model.Amostra; import br.com.model.ProjetoAmostras; import br.com.enums.Status; /** * Created by Fernando on 28/07/2016. */ public class NovaAmostra extends Activity { //PEGANDO AS VARIAVEIS EditText txtNomeAmostra, txtTamanhoAmostra; String idProjeto; ProjetoAmostrasDAO dao; ProjetoAmostras projetoAmostras; AmostraDAO amostraDAO; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_amostra); dao = new ProjetoAmostrasDAO(this); amostraDAO = new AmostraDAO(this); txtNomeAmostra = (EditText)findViewById(R.id.tv_nome_amostra); txtTamanhoAmostra = (EditText)findViewById(R.id.tv_tamanho_amostra); //PEGANDO O ID VINDO DA OUTRA TELA Bundle extras = getIntent().getExtras(); idProjeto = extras.getString("idProjetoAmostra"); projetoAmostras = dao.buscar(idProjeto); // Toast.makeText(this, idProjeto, Toast.LENGTH_SHORT).show(); Toast.makeText(this, projetoAmostras.getNome(), Toast.LENGTH_SHORT).show(); } public void inserirNovaAmostra(View v){ //CADASTRANDO UMA NOVA AMOSTRA Amostra amostra = new Amostra(); amostra.setProjetoAmostra(new ProjetoAmostras(idProjeto)); amostra.setNome(txtNomeAmostra.getText().toString()); amostra.setTamanho(Double.parseDouble(txtTamanhoAmostra.getText().toString())); amostra.setDataCadastro(new Date()); amostra.setStatus(Status.EM_PROGRESSO.toString()); //SALVANDO O PROJETO CENSO amostraDAO.salvar(amostra); //MENSAGEM DE SUCESSO Toast.makeText(this, "Amostra criada com sucesso", Toast.LENGTH_LONG).show(); //ENCERANDO A ACTIVITY finish(); Intent it = new Intent(this, TodasAmostras.class); it.putExtra("idProjetoAmostra", idProjeto); startActivity(it); } }
UTF-8
Java
2,344
java
NovaAmostra.java
Java
[ { "context": "\nimport br.com.enums.Status;\r\n\r\n/**\r\n * Created by Fernando on 28/07/2016.\r\n */\r\npublic class NovaAmostra ext", "end": 428, "score": 0.999599277973175, "start": 420, "tag": "NAME", "value": "Fernando" } ]
null
[]
package br.com.trees; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.EditText; import android.widget.Toast; import java.util.Date; import br.com.dao.AmostraDAO; import br.com.dao.ProjetoAmostrasDAO; import br.com.model.Amostra; import br.com.model.ProjetoAmostras; import br.com.enums.Status; /** * Created by Fernando on 28/07/2016. */ public class NovaAmostra extends Activity { //PEGANDO AS VARIAVEIS EditText txtNomeAmostra, txtTamanhoAmostra; String idProjeto; ProjetoAmostrasDAO dao; ProjetoAmostras projetoAmostras; AmostraDAO amostraDAO; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_amostra); dao = new ProjetoAmostrasDAO(this); amostraDAO = new AmostraDAO(this); txtNomeAmostra = (EditText)findViewById(R.id.tv_nome_amostra); txtTamanhoAmostra = (EditText)findViewById(R.id.tv_tamanho_amostra); //PEGANDO O ID VINDO DA OUTRA TELA Bundle extras = getIntent().getExtras(); idProjeto = extras.getString("idProjetoAmostra"); projetoAmostras = dao.buscar(idProjeto); // Toast.makeText(this, idProjeto, Toast.LENGTH_SHORT).show(); Toast.makeText(this, projetoAmostras.getNome(), Toast.LENGTH_SHORT).show(); } public void inserirNovaAmostra(View v){ //CADASTRANDO UMA NOVA AMOSTRA Amostra amostra = new Amostra(); amostra.setProjetoAmostra(new ProjetoAmostras(idProjeto)); amostra.setNome(txtNomeAmostra.getText().toString()); amostra.setTamanho(Double.parseDouble(txtTamanhoAmostra.getText().toString())); amostra.setDataCadastro(new Date()); amostra.setStatus(Status.EM_PROGRESSO.toString()); //SALVANDO O PROJETO CENSO amostraDAO.salvar(amostra); //MENSAGEM DE SUCESSO Toast.makeText(this, "Amostra criada com sucesso", Toast.LENGTH_LONG).show(); //ENCERANDO A ACTIVITY finish(); Intent it = new Intent(this, TodasAmostras.class); it.putExtra("idProjetoAmostra", idProjeto); startActivity(it); } }
2,344
0.672782
0.669369
73
30.109589
23.78244
87
false
false
0
0
0
0
0
0
0.684932
false
false
3
055593bb2d0c26609905c54082924faceade4575
17,128,329,581,081
180656cc0db8f3b0b0b08510e3e0a58a47bea846
/src/Ch02_Operator/Exercise/Exercise3.java
4eff10471fb2de13b57bcb155bcf3931f2df0def
[]
no_license
HBhakunamatata/TiJ
https://github.com/HBhakunamatata/TiJ
eca8e5dc5f1aa0a1663dc2ab2fbeac4d18aa873f
82da59a3aff2bdf600e5055e979100d47923a239
refs/heads/master
2021-12-15T18:54:21.068000
2021-12-08T13:23:43
2021-12-08T13:23:43
232,248,386
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package Ch02_Operator.Exercise; /* * Exercise 3: * Target : see the aliasing of an object when calling the methods * (1) Create a class containing a float * and use it to demonstrate aliasing during method calls. */ import static net.mindview.util.Print.*; class Tank{ float level; } public class Exercise3 { static void f(Tank tank){ tank.level = 2f; } public static void main(String[] args) { Tank tank = new Tank(); tank.level = 1f; print("1. tank:level = " + tank.level); f(tank); print("2. tank:level = " + tank.level); } }
UTF-8
Java
607
java
Exercise3.java
Java
[]
null
[]
package Ch02_Operator.Exercise; /* * Exercise 3: * Target : see the aliasing of an object when calling the methods * (1) Create a class containing a float * and use it to demonstrate aliasing during method calls. */ import static net.mindview.util.Print.*; class Tank{ float level; } public class Exercise3 { static void f(Tank tank){ tank.level = 2f; } public static void main(String[] args) { Tank tank = new Tank(); tank.level = 1f; print("1. tank:level = " + tank.level); f(tank); print("2. tank:level = " + tank.level); } }
607
0.61285
0.598023
27
21.481482
19.482889
66
false
false
0
0
0
0
0
0
0.333333
false
false
3
8015fc0fdec8e4d77a8ef8296a5ca3abf8e69f03
17,128,329,583,324
60c83fdf295f00e4fd72b18b5300d48f6c07652c
/src/main/java/helPet/dao/mappers/TherapyMapper.java
aba4e687beb88e97e6fb4819c9a901ce72386ff7
[ "MIT" ]
permissive
igor-trbic/helPet
https://github.com/igor-trbic/helPet
09b5ef3d4edba7aa7f115d52d182449855c9cd1d
cfa6840e5f2a7efd4da50c4effc436aaa60341fa
refs/heads/master
2023-04-19T21:02:39.861000
2021-05-14T08:36:22
2021-05-14T08:36:22
291,260,978
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package helPet.dao.mappers; import helPet.entity.Therapy; import helPet.entity.util.EntityStatus; import org.jdbi.v3.core.mapper.RowMapper; import org.jdbi.v3.core.statement.StatementContext; import java.sql.ResultSet; import java.sql.SQLException; public class TherapyMapper implements RowMapper<Therapy> { @Override public Therapy map(ResultSet rs, StatementContext ctx) throws SQLException { Therapy therapy = new Therapy(); therapy.setId(rs.getLong("id")); therapy.setCreatedBy(rs.getString("created_by")); therapy.setCreatedOn(rs.getDate("created_on")); therapy.setUpdatedBy(rs.getString("updated_by")); therapy.setUpdatedOn(rs.getDate("updated_on")); therapy.setStatus(EntityStatus.get(rs.getInt("status"))); return therapy; } }
UTF-8
Java
816
java
TherapyMapper.java
Java
[]
null
[]
package helPet.dao.mappers; import helPet.entity.Therapy; import helPet.entity.util.EntityStatus; import org.jdbi.v3.core.mapper.RowMapper; import org.jdbi.v3.core.statement.StatementContext; import java.sql.ResultSet; import java.sql.SQLException; public class TherapyMapper implements RowMapper<Therapy> { @Override public Therapy map(ResultSet rs, StatementContext ctx) throws SQLException { Therapy therapy = new Therapy(); therapy.setId(rs.getLong("id")); therapy.setCreatedBy(rs.getString("created_by")); therapy.setCreatedOn(rs.getDate("created_on")); therapy.setUpdatedBy(rs.getString("updated_by")); therapy.setUpdatedOn(rs.getDate("updated_on")); therapy.setStatus(EntityStatus.get(rs.getInt("status"))); return therapy; } }
816
0.718137
0.715686
25
31.639999
23.936382
80
false
false
0
0
0
0
0
0
0.64
false
false
3
9415a33f8998926dece534e8be20b3817e3b219b
5,231,270,173,992
45ead427eb5f0a64f46741d2a6b3c8a66647729a
/flyfox-portal/src/main/java/com/flyfox/portal/service/impl/SearchServiceImpl.java
b79d4c0acaa40a3d99fa572bd20608d9fb16f84b
[]
no_license
afoxafu/flyfox
https://github.com/afoxafu/flyfox
191cca839edcb730661277989c2b420117efc0ce
a2bbfe00c00a96dec6e9697a5671a102deeead87
refs/heads/master
2020-04-02T08:53:14.465000
2018-10-23T09:40:06
2018-10-23T09:40:06
154,265,875
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.flyfox.portal.service.impl; import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.flyfox.common.pojo.FlyfoxResult; import com.flyfox.common.utils.HttpClientUtil; import com.flyfox.portal.pojo.SearchResult; import com.flyfox.portal.service.SearchService; /** * 商品搜索Service * <p>Title: SearchServiceImpl</p> */ @Service public class SearchServiceImpl implements SearchService { @Value("${SEARCH_BASE_URL}") private String SEARCH_BASE_URL; @Override public SearchResult search(String queryString, int page) { // 调用flyfox-search的服务 //查询参数 Map<String, String> param = new HashMap<>(); param.put("q", queryString); param.put("page", page + ""); try { //调用服务 String json = HttpClientUtil.doGet(SEARCH_BASE_URL, param); //把字符串转换成java对象 FlyfoxResult flyfoxResult = FlyfoxResult.formatToPojo(json, SearchResult.class); if (flyfoxResult.getStatus() == 200) { SearchResult result = (SearchResult) flyfoxResult.getData(); return result; } } catch (Exception e) { e.printStackTrace(); } return null; } }
UTF-8
Java
1,281
java
SearchServiceImpl.java
Java
[]
null
[]
package com.flyfox.portal.service.impl; import java.util.HashMap; import java.util.Map; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import com.flyfox.common.pojo.FlyfoxResult; import com.flyfox.common.utils.HttpClientUtil; import com.flyfox.portal.pojo.SearchResult; import com.flyfox.portal.service.SearchService; /** * 商品搜索Service * <p>Title: SearchServiceImpl</p> */ @Service public class SearchServiceImpl implements SearchService { @Value("${SEARCH_BASE_URL}") private String SEARCH_BASE_URL; @Override public SearchResult search(String queryString, int page) { // 调用flyfox-search的服务 //查询参数 Map<String, String> param = new HashMap<>(); param.put("q", queryString); param.put("page", page + ""); try { //调用服务 String json = HttpClientUtil.doGet(SEARCH_BASE_URL, param); //把字符串转换成java对象 FlyfoxResult flyfoxResult = FlyfoxResult.formatToPojo(json, SearchResult.class); if (flyfoxResult.getStatus() == 200) { SearchResult result = (SearchResult) flyfoxResult.getData(); return result; } } catch (Exception e) { e.printStackTrace(); } return null; } }
1,281
0.701383
0.698942
48
23.604166
21.757891
83
false
false
0
0
0
0
0
0
1.6875
false
false
3
b68af77e8c3904074c987e80c3d56d660818b161
14,431,090,122,680
028b3cc878a49d878c217eb29740a35322a1a24f
/sso/src/main/java/org/fsr/sso/web/form/user/UserForm.java
20871c83dddbefb495774a4159c17240df06cfae
[]
no_license
fuaokai/sso
https://github.com/fuaokai/sso
ee7d058cd000bc60a3f0f95c17e50381f1a5c473
230a462767064a109ef3d148e2377171126243ca
refs/heads/master
2021-01-20T04:22:04.372000
2017-04-28T07:42:28
2017-04-28T07:42:28
89,661,313
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.fsr.sso.web.form.user; /** * Created with UserForm * * @author fuaokai * @version 1.0 * @description * @date 2017/4/25 16:00 */ public class UserForm { private String userName; private String userPasswd; public UserForm() { } public UserForm(String userName, String userPasswd) { this.userName = userName; this.userPasswd = userPasswd; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPasswd() { return userPasswd; } public void setUserPasswd(String userPasswd) { this.userPasswd = userPasswd; } }
UTF-8
Java
723
java
UserForm.java
Java
[ { "context": ".user;\n\n/**\n * Created with UserForm\n *\n * @author fuaokai\n * @version 1.0\n * @description\n * @date 2017/4/2", "end": 86, "score": 0.999414324760437, "start": 79, "tag": "USERNAME", "value": "fuaokai" }, { "context": "Name, String userPasswd) {\n this.userName = userName;\n this.userPasswd = userPasswd;\n }\n\n ", "end": 355, "score": 0.9981251358985901, "start": 347, "tag": "USERNAME", "value": "userName" }, { "context": "his.userName = userName;\n this.userPasswd = userPasswd;\n }\n\n public String getUserName() {\n ", "end": 393, "score": 0.9751908779144287, "start": 383, "tag": "PASSWORD", "value": "userPasswd" }, { "context": "serName(String userName) {\n this.userName = userName;\n }\n\n public String getUserPasswd() {\n ", "end": 547, "score": 0.9751890897750854, "start": 539, "tag": "USERNAME", "value": "userName" }, { "context": "swd(String userPasswd) {\n this.userPasswd = userPasswd;\n }\n}\n", "end": 713, "score": 0.9885106682777405, "start": 703, "tag": "PASSWORD", "value": "userPasswd" } ]
null
[]
package org.fsr.sso.web.form.user; /** * Created with UserForm * * @author fuaokai * @version 1.0 * @description * @date 2017/4/25 16:00 */ public class UserForm { private String userName; private String userPasswd; public UserForm() { } public UserForm(String userName, String userPasswd) { this.userName = userName; this.userPasswd = <PASSWORD>; } public String getUserName() { return userName; } public void setUserName(String userName) { this.userName = userName; } public String getUserPasswd() { return userPasswd; } public void setUserPasswd(String userPasswd) { this.userPasswd = <PASSWORD>; } }
723
0.629322
0.611342
39
17.538462
16.288813
57
false
false
0
0
0
0
0
0
0.25641
false
false
3
90a922e1602a2e3c04b6d6303ee98683873ba52f
22,926,535,433,363
69dee73e49c54854fbabf265907548276ad206c3
/android课堂/android_fragment/src/com/example/android_fragment/ContentFragment.java
826d02322abc9193f47ff672f85946a690b9f89a
[]
no_license
VampaireAndy/notes_ForAndroid
https://github.com/VampaireAndy/notes_ForAndroid
858390b4ebee61bbd98d743ae4b6dbad9c18023d
29fabed3f40dcc65814ad3c550a1742436eadcef
HEAD
2016-09-13T17:09:27.533000
2016-08-13T00:59:36
2016-08-13T00:59:36
65,546,632
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.example.android_fragment; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class ContentFragment extends Fragment{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View view =inflater.inflate(R.layout.content, null); return view; } }
UTF-8
Java
480
java
ContentFragment.java
Java
[]
null
[]
package com.example.android_fragment; import android.os.Bundle; import android.support.v4.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class ContentFragment extends Fragment{ @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // TODO Auto-generated method stub View view =inflater.inflate(R.layout.content, null); return view; } }
480
0.785417
0.783333
20
23
20.40098
71
false
false
0
0
0
0
0
0
1.35
false
false
3
aaf4414aa9a018de9e53393ffdd6ce04f67c3a7f
23,046,794,518,252
abfb0cbc864c26bea5c4810e891ef71950a9bdd4
/src/main/java/cc/fatenetwork/kcrates/gui/CrateGui.java
bec3caa02f21c91890d50ad3df1e0cef78babc67
[]
no_license
HackusatePvP/kCrates
https://github.com/HackusatePvP/kCrates
e8168ed253def1512d89349828e0656036d1b37e
9e744dfa8d7a2ef3faf413ac6b4b16acb5507109
refs/heads/master
2022-12-05T15:04:24.012000
2020-09-01T21:41:14
2020-09-01T21:41:14
291,158,883
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package cc.fatenetwork.kcrates.gui; import cc.fatenetwork.kbase.utils.StringUtil; import cc.fatenetwork.kcrates.Crate; import cc.fatenetwork.kcrates.crates.Keys; import cc.fatenetwork.kcrates.profile.Profile; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import java.util.logging.Logger; public class CrateGui implements Listener { private final Crate plugin; public CrateGui(Crate plugin) { this.plugin = plugin; } public Inventory getCrateInv(Profile profile) { Inventory i = Bukkit.createInventory(null, 27, StringUtil.format("&7* &e&lCrates")); //todo setup all crate shops here i.setItem(2, getCrate("Kill", profile)); i.setItem(4, getCrate("Vote", profile)); //once we set all the crate items we now need to add the borders. We can use a for statement instead of doing i.setItem() for each one //make a counter that will stop once we reach the end of the inventory for (int counter = 0; counter <= 26; counter++) { //this if statement makes sure the inventory isn't full if (i.firstEmpty() != -1) { //checks to see if the current slot has an item, if not it will be identified as air if (i.getItem(counter) == null || i.getItem(counter).getType() == Material.AIR) { //if its air lets add our border item i.setItem(counter, getBorder()); } } } return i; } /** * * @param crate This is the string identifier of the crate, they can viewed in Keys.class * @param profile The profile object where all they keys are stored * @return ItemStack */ private ItemStack getCrate(String crate, Profile profile) { Keys keys = Keys.getByName(crate); return keys.getCrateItem(profile); } /** * To view dyes numbers refer to this https://minecraft.gamepedia.com/Dye * @return ItemStack */ private ItemStack getBorder() { ItemStack itemStack = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 11); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(StringUtil.format("&7")); itemStack.setItemMeta(itemMeta); return itemStack; } @EventHandler public void onClick(InventoryClickEvent event) { if (event.getWhoClicked() == null) { return; } if (event.getInventory() == null && event.getClickedInventory() == null) { return; } Player player = (Player) event.getWhoClicked(); Profile profile = plugin.getProfileManager().getProfile(player.getUniqueId()); if (!event.getClickedInventory().getName().equals(getCrateInv(profile).getName())) { return; } event.setCancelled(true); if (event.getCurrentItem() == null) { return; } ItemStack itemStack = event.getCurrentItem(); if (itemStack.getItemMeta().getDisplayName().equals(getCrate("Kill", profile).getItemMeta().getDisplayName())) { Keys key = Keys.getByName("Kill"); if (!key.isEnabled()) { player.sendMessage(StringUtil.format("&cThis crate is not available at this time.")); return; } /* They have just clicked on the kill crate so now if they have a key lets give them their rewards */ int keys = profile.getKillKeys(); if (keys == 0) { player.sendMessage(StringUtil.format("&cYou do not have any keys to use on this crate.")); return; } plugin.getCrateInterface().useCrate(profile, key); player.openInventory(getCrateInv(profile)); } if (itemStack.getItemMeta().getDisplayName().equals(getCrate("Vote", profile).getItemMeta().getDisplayName())) { Keys key = Keys.getByName("Vote"); if (!key.isEnabled()) { player.sendMessage(StringUtil.format("&cThis crate is not available at this time.")); return; } int keys = profile.getVoteKeys(); if (keys == 0) { player.sendMessage(StringUtil.format("&cYou do not have any keys to use on this crate.")); return; } plugin.getCrateInterface().useCrate(profile, key); player.openInventory(getCrateInv(profile)); } } }
UTF-8
Java
4,805
java
CrateGui.java
Java
[]
null
[]
package cc.fatenetwork.kcrates.gui; import cc.fatenetwork.kbase.utils.StringUtil; import cc.fatenetwork.kcrates.Crate; import cc.fatenetwork.kcrates.crates.Keys; import cc.fatenetwork.kcrates.profile.Profile; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; import java.util.logging.Logger; public class CrateGui implements Listener { private final Crate plugin; public CrateGui(Crate plugin) { this.plugin = plugin; } public Inventory getCrateInv(Profile profile) { Inventory i = Bukkit.createInventory(null, 27, StringUtil.format("&7* &e&lCrates")); //todo setup all crate shops here i.setItem(2, getCrate("Kill", profile)); i.setItem(4, getCrate("Vote", profile)); //once we set all the crate items we now need to add the borders. We can use a for statement instead of doing i.setItem() for each one //make a counter that will stop once we reach the end of the inventory for (int counter = 0; counter <= 26; counter++) { //this if statement makes sure the inventory isn't full if (i.firstEmpty() != -1) { //checks to see if the current slot has an item, if not it will be identified as air if (i.getItem(counter) == null || i.getItem(counter).getType() == Material.AIR) { //if its air lets add our border item i.setItem(counter, getBorder()); } } } return i; } /** * * @param crate This is the string identifier of the crate, they can viewed in Keys.class * @param profile The profile object where all they keys are stored * @return ItemStack */ private ItemStack getCrate(String crate, Profile profile) { Keys keys = Keys.getByName(crate); return keys.getCrateItem(profile); } /** * To view dyes numbers refer to this https://minecraft.gamepedia.com/Dye * @return ItemStack */ private ItemStack getBorder() { ItemStack itemStack = new ItemStack(Material.STAINED_GLASS_PANE, 1, (short) 11); ItemMeta itemMeta = itemStack.getItemMeta(); itemMeta.setDisplayName(StringUtil.format("&7")); itemStack.setItemMeta(itemMeta); return itemStack; } @EventHandler public void onClick(InventoryClickEvent event) { if (event.getWhoClicked() == null) { return; } if (event.getInventory() == null && event.getClickedInventory() == null) { return; } Player player = (Player) event.getWhoClicked(); Profile profile = plugin.getProfileManager().getProfile(player.getUniqueId()); if (!event.getClickedInventory().getName().equals(getCrateInv(profile).getName())) { return; } event.setCancelled(true); if (event.getCurrentItem() == null) { return; } ItemStack itemStack = event.getCurrentItem(); if (itemStack.getItemMeta().getDisplayName().equals(getCrate("Kill", profile).getItemMeta().getDisplayName())) { Keys key = Keys.getByName("Kill"); if (!key.isEnabled()) { player.sendMessage(StringUtil.format("&cThis crate is not available at this time.")); return; } /* They have just clicked on the kill crate so now if they have a key lets give them their rewards */ int keys = profile.getKillKeys(); if (keys == 0) { player.sendMessage(StringUtil.format("&cYou do not have any keys to use on this crate.")); return; } plugin.getCrateInterface().useCrate(profile, key); player.openInventory(getCrateInv(profile)); } if (itemStack.getItemMeta().getDisplayName().equals(getCrate("Vote", profile).getItemMeta().getDisplayName())) { Keys key = Keys.getByName("Vote"); if (!key.isEnabled()) { player.sendMessage(StringUtil.format("&cThis crate is not available at this time.")); return; } int keys = profile.getVoteKeys(); if (keys == 0) { player.sendMessage(StringUtil.format("&cYou do not have any keys to use on this crate.")); return; } plugin.getCrateInterface().useCrate(profile, key); player.openInventory(getCrateInv(profile)); } } }
4,805
0.613528
0.610406
122
38.385246
31.695385
142
false
false
0
0
0
0
0
0
0.598361
false
false
3
bb7b87853ba4358c2fba13b93433d57bdfa39f67
28,913,719,844,809
de50aad763a2c6879b7871f2d4a801f718a533d0
/tdd-practice/src/main/java/com/vailter/standard/ddd/fizzbuzz/NumberGame.java
a7e9c83461d9d538a67f44bfef2d5840e760e65f
[ "Apache-2.0" ]
permissive
vailter/vailter-project-standard
https://github.com/vailter/vailter-project-standard
d9ebf531a4d3ad2717e4204a95d4d980bb732298
60b1c7e28d9002f8623a4104b1265093094bc825
refs/heads/master
2021-11-08T06:15:51.887000
2021-10-11T09:26:51
2021-10-11T09:26:51
202,441,542
1
0
Apache-2.0
false
2021-10-08T05:59:12
2019-08-14T23:41:59
2021-10-08T05:53:49
2021-10-08T05:57:54
10,373
1
0
0
Java
false
false
package com.vailter.standard.ddd.fizzbuzz; import com.vailter.standard.utils.CommonUtil; public class NumberGame { public String print(int num) { String res = printFizzBuzz(num) + printFizz(num) + printBuzz(num); return CommonUtil.isNotBlank(res) ? res : String.valueOf(num); } private String printFizz(int num) { if (isDivisibleBy(num, 3) || String.valueOf(num).contains("3")) { return "Fizz"; } return ""; } private String printBuzz(int num) { if (isDivisibleBy(num, 5) || String.valueOf(num).contains("5")) { return "Buzz"; } return ""; } private String printFizzBuzz(int num) { if (String.valueOf(num).contains("5") && String.valueOf(num).contains("3")) { return "FizzBuzz"; } return ""; } private boolean isDivisibleBy(int num, int dividedNum) { return num % dividedNum == 0; } }
UTF-8
Java
964
java
NumberGame.java
Java
[]
null
[]
package com.vailter.standard.ddd.fizzbuzz; import com.vailter.standard.utils.CommonUtil; public class NumberGame { public String print(int num) { String res = printFizzBuzz(num) + printFizz(num) + printBuzz(num); return CommonUtil.isNotBlank(res) ? res : String.valueOf(num); } private String printFizz(int num) { if (isDivisibleBy(num, 3) || String.valueOf(num).contains("3")) { return "Fizz"; } return ""; } private String printBuzz(int num) { if (isDivisibleBy(num, 5) || String.valueOf(num).contains("5")) { return "Buzz"; } return ""; } private String printFizzBuzz(int num) { if (String.valueOf(num).contains("5") && String.valueOf(num).contains("3")) { return "FizzBuzz"; } return ""; } private boolean isDivisibleBy(int num, int dividedNum) { return num % dividedNum == 0; } }
964
0.582988
0.575726
36
25.777779
25.473419
85
false
false
0
0
0
0
0
0
0.5
false
false
3
057910d9482fdab949bcd2fcfb6851802e96eea9
32,873,679,688,414
d4b365b6296601f87c24819ff6676920c42906f5
/Graphic.java
0cab85e76e144ab443afd4730a86c0a16f271322
[]
no_license
gitXelix/java-gallery-gui
https://github.com/gitXelix/java-gallery-gui
437cb9ab8d58a81a0ff7857c575be3ccf374bb77
e1b0a99a36866117d49a2dbd62ca3174d6b35059
refs/heads/master
2020-03-22T03:06:41.645000
2018-07-02T09:15:39
2018-07-02T09:15:39
139,413,792
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* * 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 gallery; import javax.swing.JFrame; /** * * @author KacperMajczak */ public class Graphic { rPainter r; Graphic(){ JFrame frame = new JFrame("Grafika w aplikacji"); frame.setSize(300,200); r = new rPainter(); r.setDoubleBuffered(true); frame.add(r); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }
UTF-8
Java
607
java
Graphic.java
Java
[ { "context": "ry;\n\nimport javax.swing.JFrame;\n\n/**\n *\n * @author KacperMajczak\n */\npublic class Graphic {\n rPainter r;\n Gr", "end": 262, "score": 0.9953859448432922, "start": 249, "tag": "NAME", "value": "KacperMajczak" } ]
null
[]
/* * 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 gallery; import javax.swing.JFrame; /** * * @author KacperMajczak */ public class Graphic { rPainter r; Graphic(){ JFrame frame = new JFrame("Grafika w aplikacji"); frame.setSize(300,200); r = new rPainter(); r.setDoubleBuffered(true); frame.add(r); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } }
607
0.640857
0.630972
26
22.346153
21.289112
79
false
false
0
0
0
0
0
0
0.538462
false
false
3
bb2d9f9dfe1ad8578af0827ec688d3cf40aa7196
29,901,562,384,922
89d99103fe97fd86e9f8aeb1fca84db909b5332a
/Project04-DatabaseEmulator/src/main/java/hr/fer/zemris/java/hw04/db/QueryParser.java
5fb5c3ad29597d8aab014152d3e8e5da7762d487
[]
no_license
luka002/Java-16-Projects-Collection
https://github.com/luka002/Java-16-Projects-Collection
efcb8853b8ddbe794bc9c234413f8fbbd4af6c35
90e9ce3850bfbb4f5e7b78809195f0270498b9e4
refs/heads/master
2020-03-24T05:57:07.429000
2018-08-01T09:47:59
2018-08-01T09:47:59
142,510,278
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package hr.fer.zemris.java.hw04.db; import java.util.ArrayList; import java.util.List; /** * Class which represents a parser of query statement. * * @author Luka Grgić * @version 1.0 */ public class QueryParser { /** Provided data */ private char[] data; /** Current index */ private int currentIndex; /** List of queries */ private List<ConditionalExpression> queries; /** * Constructor. * * @param string Provided data. */ public QueryParser(String string) { this.data = string.toCharArray(); this.currentIndex = 0; this.queries = new ArrayList<>(); parse(); } /** * Checks if it is direct query. * * @return true if query is direct, else false. */ public boolean isDirectQuery() { if (queries.size() == 1 && queries.get(0).getFieldValue() == FieldValueGetters.JMBAG && queries.get(0).getComparisonOperator() == ComparisonOperators.EQUALS) { return true; } return false; } /** * @return Jmbag if query is direct. * @throws IllegalStateException if not direct query. */ public String getQueriedJMBAG() { if (isDirectQuery()) { return queries.get(0).getStringLiteral(); } throw new IllegalStateException("Can not querie jmbag for non direct querie."); } /** * @return List of queries. */ public List<ConditionalExpression> getQuery() { return queries; } /** * Method that parses data into queries. */ private void parse() { skipBlanks(); while (currentIndex < data.length) { IFieldValueGetter fieldValue = getFieldValue(); IComparisonOperator comparisonOperator = getComparisonOperator(); String stringLiteral = getStringLiteral(); ConditionalExpression expression = new ConditionalExpression(fieldValue, stringLiteral, comparisonOperator); queries.add(expression); if (isLastExpression()) break; checkForAND(); } } /** * Method that checks if fieldValue is correct. * * @return Correct FieldValueGetter. * @throws IllegalArgumentException if fieldValue is invalid. */ private IFieldValueGetter getFieldValue() { StringBuilder fieldValue = new StringBuilder(); char c = getNextChar(); while (Character.isLetter(c) && c != 'L') { fieldValue.append(c); c = getNextChar(); } switch (fieldValue.toString()) { case "jmbag": return FieldValueGetters.JMBAG; case "lastName": return FieldValueGetters.LAST_NAME; case "firstName": return FieldValueGetters.FIRST_NAME; } throw new IllegalArgumentException("Field value not provided correctly."); } /** * Method that checks if comparison operator is correct. * * @return Correct ComparisonOperator. * @throws IllegalArgumentException if comparison operator is invalid. */ private IComparisonOperator getComparisonOperator() { skipBlanks(); StringBuilder operator = new StringBuilder(); char c = getNextChar(); while (c != '"') { operator.append(c); c = getNextChar(); } switch (operator.toString().trim()) { case "LIKE": return ComparisonOperators.LIKE; case ">": return ComparisonOperators.GREATER; case "<": return ComparisonOperators.LESS; case ">=": return ComparisonOperators.GREATER_OR_EQUALS; case "<=": return ComparisonOperators.LESS_OR_EQUALS; case "=": return ComparisonOperators.EQUALS; case "!=": return ComparisonOperators.NOT_EQUALS; } throw new IllegalArgumentException("Incorrect operator."); } /** * Method that checks if string literal is correct. * * @return Correct string literal. * @throws IllegalArgumentException if string literal is invalid. */ private String getStringLiteral() { StringBuilder stringLiteral = new StringBuilder(); char c = getNextChar(); while (c != '"') { stringLiteral.append(c); c = getNextChar(); } return stringLiteral.toString(); } /** * Method that checks if it is last expression in data. * * @return true if it is last expression, else false. */ private boolean isLastExpression() { if (endOfFile()) return true; char c = getNextChar(); if (c != ' ' && c != '\t' && c != '\r' && c != '\n') { throw new IllegalArgumentException("Before AND comes space."); } skipBlanks(); if (endOfFile()) return true; return false; } /** * Is it end of data. * * @return true if end of data, else false. */ private boolean endOfFile() { currentIndex++; if (currentIndex >= data.length) return true; currentIndex--; return false; } /** * Checks for "AND" keyword. */ private void checkForAND() { char c = getNextChar(); if (c == 'a' || c == 'A') { c = getNextChar(); if (c == 'n' || c == 'N') { c = getNextChar(); if (c == 'd' || c == 'D') { c = getNextChar(); if (c == ' ' || c == '\t' || c == '\r' || c == '\n') { skipBlanks(); return; } } } } throw new IllegalArgumentException("After expresion comes \"AND\" and after \"AND\" comes space."); } /** * Gets next character from data. * * @return Next character from data. * @throws IndexOutOfBoundsException if index is out of bounds. */ private char getNextChar() { currentIndex++; if (currentIndex < data.length) { return data[currentIndex]; } throw new IndexOutOfBoundsException("Can't get character at specified index."); } /** * Skips blanks in data. */ private void skipBlanks() { while (currentIndex < data.length) { char c = data[currentIndex]; if (c == ' ' || c == '\t' || c == '\r' || c == '\n') { currentIndex++; continue; } currentIndex--; break; } } }
UTF-8
Java
5,634
java
QueryParser.java
Java
[ { "context": "esents a parser of query statement.\n * \n * @author Luka Grgić\n * @version 1.0\n */\npublic class QueryParser {\n\t/", "end": 173, "score": 0.9998007416725159, "start": 163, "tag": "NAME", "value": "Luka Grgić" } ]
null
[]
package hr.fer.zemris.java.hw04.db; import java.util.ArrayList; import java.util.List; /** * Class which represents a parser of query statement. * * @author <NAME> * @version 1.0 */ public class QueryParser { /** Provided data */ private char[] data; /** Current index */ private int currentIndex; /** List of queries */ private List<ConditionalExpression> queries; /** * Constructor. * * @param string Provided data. */ public QueryParser(String string) { this.data = string.toCharArray(); this.currentIndex = 0; this.queries = new ArrayList<>(); parse(); } /** * Checks if it is direct query. * * @return true if query is direct, else false. */ public boolean isDirectQuery() { if (queries.size() == 1 && queries.get(0).getFieldValue() == FieldValueGetters.JMBAG && queries.get(0).getComparisonOperator() == ComparisonOperators.EQUALS) { return true; } return false; } /** * @return Jmbag if query is direct. * @throws IllegalStateException if not direct query. */ public String getQueriedJMBAG() { if (isDirectQuery()) { return queries.get(0).getStringLiteral(); } throw new IllegalStateException("Can not querie jmbag for non direct querie."); } /** * @return List of queries. */ public List<ConditionalExpression> getQuery() { return queries; } /** * Method that parses data into queries. */ private void parse() { skipBlanks(); while (currentIndex < data.length) { IFieldValueGetter fieldValue = getFieldValue(); IComparisonOperator comparisonOperator = getComparisonOperator(); String stringLiteral = getStringLiteral(); ConditionalExpression expression = new ConditionalExpression(fieldValue, stringLiteral, comparisonOperator); queries.add(expression); if (isLastExpression()) break; checkForAND(); } } /** * Method that checks if fieldValue is correct. * * @return Correct FieldValueGetter. * @throws IllegalArgumentException if fieldValue is invalid. */ private IFieldValueGetter getFieldValue() { StringBuilder fieldValue = new StringBuilder(); char c = getNextChar(); while (Character.isLetter(c) && c != 'L') { fieldValue.append(c); c = getNextChar(); } switch (fieldValue.toString()) { case "jmbag": return FieldValueGetters.JMBAG; case "lastName": return FieldValueGetters.LAST_NAME; case "firstName": return FieldValueGetters.FIRST_NAME; } throw new IllegalArgumentException("Field value not provided correctly."); } /** * Method that checks if comparison operator is correct. * * @return Correct ComparisonOperator. * @throws IllegalArgumentException if comparison operator is invalid. */ private IComparisonOperator getComparisonOperator() { skipBlanks(); StringBuilder operator = new StringBuilder(); char c = getNextChar(); while (c != '"') { operator.append(c); c = getNextChar(); } switch (operator.toString().trim()) { case "LIKE": return ComparisonOperators.LIKE; case ">": return ComparisonOperators.GREATER; case "<": return ComparisonOperators.LESS; case ">=": return ComparisonOperators.GREATER_OR_EQUALS; case "<=": return ComparisonOperators.LESS_OR_EQUALS; case "=": return ComparisonOperators.EQUALS; case "!=": return ComparisonOperators.NOT_EQUALS; } throw new IllegalArgumentException("Incorrect operator."); } /** * Method that checks if string literal is correct. * * @return Correct string literal. * @throws IllegalArgumentException if string literal is invalid. */ private String getStringLiteral() { StringBuilder stringLiteral = new StringBuilder(); char c = getNextChar(); while (c != '"') { stringLiteral.append(c); c = getNextChar(); } return stringLiteral.toString(); } /** * Method that checks if it is last expression in data. * * @return true if it is last expression, else false. */ private boolean isLastExpression() { if (endOfFile()) return true; char c = getNextChar(); if (c != ' ' && c != '\t' && c != '\r' && c != '\n') { throw new IllegalArgumentException("Before AND comes space."); } skipBlanks(); if (endOfFile()) return true; return false; } /** * Is it end of data. * * @return true if end of data, else false. */ private boolean endOfFile() { currentIndex++; if (currentIndex >= data.length) return true; currentIndex--; return false; } /** * Checks for "AND" keyword. */ private void checkForAND() { char c = getNextChar(); if (c == 'a' || c == 'A') { c = getNextChar(); if (c == 'n' || c == 'N') { c = getNextChar(); if (c == 'd' || c == 'D') { c = getNextChar(); if (c == ' ' || c == '\t' || c == '\r' || c == '\n') { skipBlanks(); return; } } } } throw new IllegalArgumentException("After expresion comes \"AND\" and after \"AND\" comes space."); } /** * Gets next character from data. * * @return Next character from data. * @throws IndexOutOfBoundsException if index is out of bounds. */ private char getNextChar() { currentIndex++; if (currentIndex < data.length) { return data[currentIndex]; } throw new IndexOutOfBoundsException("Can't get character at specified index."); } /** * Skips blanks in data. */ private void skipBlanks() { while (currentIndex < data.length) { char c = data[currentIndex]; if (c == ' ' || c == '\t' || c == '\r' || c == '\n') { currentIndex++; continue; } currentIndex--; break; } } }
5,629
0.640866
0.639269
265
20.256603
21.181921
111
false
false
0
0
0
0
0
0
2.003774
false
false
3
8ae3bbb8a03ec2294d1ff57230ca7fb35175fdc9
7,129,645,741,924
e1c749b55195548d2d0c3baffaff0850e611a640
/src/org/meta/gwtworld/client/db/TbDevice.java
83a554a0d3d3165b0194d30d34419da096f8d3a2
[]
no_license
veltzer/myworld-gwt
https://github.com/veltzer/myworld-gwt
a2b7f6a237478ea1a4474c03a2a8f11c87607b4c
da8d523668d330254830ae28d3d99d80455ee038
refs/heads/master
2023-07-09T10:39:43.018000
2023-07-01T14:39:12
2023-07-01T14:39:12
38,682,651
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package org.meta.gwtworld.client.db; import java.io.Serializable; import javax.persistence.*; /** * The persistent class for the TbDevice database table. * */ @Entity @Table(name="TbDevice") public class TbDevice implements Serializable { private static final long serialVersionUID = 1L; @Id private int id; private String description; private Boolean isAudio; private Boolean isBrowser; private Boolean isText; private Boolean isVideo; private String name; private String slug; public TbDevice() { } public int getId() { return this.id; } public void setId(int id) { this.id = id; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public Boolean getIsAudio() { return this.isAudio; } public void setIsAudio(Boolean isAudio) { this.isAudio = isAudio; } public Boolean getIsBrowser() { return this.isBrowser; } public void setIsBrowser(Boolean isBrowser) { this.isBrowser = isBrowser; } public Boolean getIsText() { return this.isText; } public void setIsText(Boolean isText) { this.isText = isText; } public Boolean getIsVideo() { return this.isVideo; } public void setIsVideo(Boolean isVideo) { this.isVideo = isVideo; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getSlug() { return this.slug; } public void setSlug(String slug) { this.slug = slug; } }
UTF-8
Java
1,628
java
TbDevice.java
Java
[]
null
[]
package org.meta.gwtworld.client.db; import java.io.Serializable; import javax.persistence.*; /** * The persistent class for the TbDevice database table. * */ @Entity @Table(name="TbDevice") public class TbDevice implements Serializable { private static final long serialVersionUID = 1L; @Id private int id; private String description; private Boolean isAudio; private Boolean isBrowser; private Boolean isText; private Boolean isVideo; private String name; private String slug; public TbDevice() { } public int getId() { return this.id; } public void setId(int id) { this.id = id; } public String getDescription() { return this.description; } public void setDescription(String description) { this.description = description; } public Boolean getIsAudio() { return this.isAudio; } public void setIsAudio(Boolean isAudio) { this.isAudio = isAudio; } public Boolean getIsBrowser() { return this.isBrowser; } public void setIsBrowser(Boolean isBrowser) { this.isBrowser = isBrowser; } public Boolean getIsText() { return this.isText; } public void setIsText(Boolean isText) { this.isText = isText; } public Boolean getIsVideo() { return this.isVideo; } public void setIsVideo(Boolean isVideo) { this.isVideo = isVideo; } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getSlug() { return this.slug; } public void setSlug(String slug) { this.slug = slug; } }
1,628
0.664619
0.664005
100
14.3
15.305882
56
false
false
0
0
0
0
0
0
1.04
false
false
3
6eafa8eacc4691543595492bafe0c809b2aae626
8,504,035,302,323
32dded5cfce0e8b7f485ec834326493b3886b9e0
/src/main/java/co/g2academy/indoapril_1/model/ModelOrderDetail.java
cc65d72709ecb8c5817c9b8f1a1b5e167fa3eef1
[]
no_license
anggabaguspratama/backend_project2
https://github.com/anggabaguspratama/backend_project2
3e6919ee7e164b30dd13bffec041011e221cfd6f
8fb5782dd21f9f046a7691c18d30b625d34f7046
refs/heads/master
2022-06-12T06:53:56.940000
2020-05-09T02:48:12
2020-05-09T02:48:12
262,474,358
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package co.g2academy.indoapril_1.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import javax.persistence.*; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor @Table(name = "tb_order_detail") @Entity @EntityListeners(AuditingEntityListener.class) public class ModelOrderDetail implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) private int No; private String Id_Order; private Integer Id_Barang; private Integer Qty_Detail; private String Tgl_Order; private String Nama_Barang; private String Alamat_Penempatan; }
UTF-8
Java
762
java
ModelOrderDetail.java
Java
[]
null
[]
package co.g2academy.indoapril_1.model; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.data.jpa.domain.support.AuditingEntityListener; import javax.persistence.*; import java.io.Serializable; @Data @Builder @NoArgsConstructor @AllArgsConstructor @Table(name = "tb_order_detail") @Entity @EntityListeners(AuditingEntityListener.class) public class ModelOrderDetail implements Serializable { @Id @GeneratedValue(strategy = GenerationType.SEQUENCE) private int No; private String Id_Order; private Integer Id_Barang; private Integer Qty_Detail; private String Tgl_Order; private String Nama_Barang; private String Alamat_Penempatan; }
762
0.787402
0.784777
31
23.612904
18.336773
74
false
false
0
0
0
0
0
0
0.483871
false
false
3
445bef654171c33e54a88cbf89e9fac67d419602
2,396,591,772,360
281db588a6b93fec0fa8f453a5571e14b81967ff
/Messanger/src/main/java/com/pradeep/rs/Messanger/model/Message.java
c2f22a9943825e4a785f99bce983ecccfa529c48
[]
no_license
pradeepkumarmishra/codinginlive
https://github.com/pradeepkumarmishra/codinginlive
219ad2fdc06d7438b0c4d4339cf8e70c16912e52
ada0eda8fbcbc193c2b5be75c3a90e755371be9e
refs/heads/master
2021-01-23T09:14:22.111000
2019-01-22T09:34:45
2019-01-22T09:34:45
102,571,731
0
0
null
false
2018-03-21T09:29:19
2017-09-06T06:33:30
2018-01-06T14:16:41
2018-03-02T09:22:57
3,152
0
0
1
TypeScript
false
null
package com.pradeep.rs.Messanger.model; import java.util.Date; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Message { private int id; private String name; private Date createDate; private String comments; public Message() { } public Message(int id,String name,String comments) { this.id=id; this.name=name; this.createDate=new Date(); this.comments=comments; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public String getComments() { return comments; } public void setComments(String comments) { this.comments = comments; } }
UTF-8
Java
931
java
Message.java
Java
[]
null
[]
package com.pradeep.rs.Messanger.model; import java.util.Date; import javax.xml.bind.annotation.XmlRootElement; @XmlRootElement public class Message { private int id; private String name; private Date createDate; private String comments; public Message() { } public Message(int id,String name,String comments) { this.id=id; this.name=name; this.createDate=new Date(); this.comments=comments; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Date getCreateDate() { return createDate; } public void setCreateDate(Date createDate) { this.createDate = createDate; } public String getComments() { return comments; } public void setComments(String comments) { this.comments = comments; } }
931
0.668099
0.668099
50
16.620001
14.595739
55
false
false
0
0
0
0
0
0
1.46
false
false
3
1cd2d7ae68ddb45b6b7790ed9c869411581e4790
8,186,207,707,450
3023717d37fb7b7fd5559c7e6da84cd6bebffb5f
/logreader/src/mak/triPart/MsTransPkgSerializer.java
570d07695fcce3a47037e333f21e0393e05a561e
[]
no_license
iatmakdotcx/logreader
https://github.com/iatmakdotcx/logreader
3c79ceea0bd254df2c5060f4c699f0c1a1f2b5fe
b7cd69bb96f66a913223708ab0248377b9f16210
refs/heads/master
2020-06-06T12:46:19.327000
2019-06-19T14:02:30
2019-06-19T14:02:30
192,743,418
11
5
null
null
null
null
null
null
null
null
null
null
null
null
null
package mak.triPart; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import mak.capture.mssql.MsTransPkg; public class MsTransPkgSerializer implements org.apache.kafka.common.serialization.Serializer<MsTransPkg> { private static Logger logger = LoggerFactory.getLogger(MsTransPkgSerializer.class); @Override public void close() { // TODO Auto-generated method stub } @Override public void configure(Map<String, ?> arg0, boolean arg1) { // TODO Auto-generated method stub } @Override public byte[] serialize(String arg0, MsTransPkg arg1) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream( bos); o.writeObject(arg1); //写入数据 o.flush(); o.close(); byte[] b = bos.toByteArray(); bos.close(); return b; } catch (IOException e) { logger.error("序列化失败!", e); } return new byte[0]; } }
GB18030
Java
1,109
java
MsTransPkgSerializer.java
Java
[]
null
[]
package mak.triPart; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import mak.capture.mssql.MsTransPkg; public class MsTransPkgSerializer implements org.apache.kafka.common.serialization.Serializer<MsTransPkg> { private static Logger logger = LoggerFactory.getLogger(MsTransPkgSerializer.class); @Override public void close() { // TODO Auto-generated method stub } @Override public void configure(Map<String, ?> arg0, boolean arg1) { // TODO Auto-generated method stub } @Override public byte[] serialize(String arg0, MsTransPkg arg1) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream o = new ObjectOutputStream( bos); o.writeObject(arg1); //写入数据 o.flush(); o.close(); byte[] b = bos.toByteArray(); bos.close(); return b; } catch (IOException e) { logger.error("序列化失败!", e); } return new byte[0]; } }
1,109
0.689624
0.682277
44
22.75
23.603857
107
false
false
0
0
0
0
0
0
1.727273
false
false
3
c3018712773671a38656facad91d10b36ba28e86
19,825,569,056,320
69470bf163dfaae679f583df059c5257bfe2d4ca
/src/cs410/parser/properties/twoValue/PositionProp.java
e1d5bc1e62e051da85e110552dc38c1273010ed5
[]
no_license
davidkarchynski/LilShapes
https://github.com/davidkarchynski/LilShapes
8fa97a9767b01e2fa2ab5913e6d90b864e40cb03
2247af5328cc49ade55d4ed48b16cf9974e7a66a
refs/heads/master
2020-03-30T20:38:10.929000
2018-10-16T20:49:03
2018-10-16T20:49:03
151,596,739
2
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package cs410.parser.properties.twoValue; import cs410.Lexer; public class PositionProp extends TwoValuePropNode { public static final String TOKEN_NAME = "pos"; public PositionProp(Lexer lexer) { super(lexer); } @Override public String name() { return PositionProp.TOKEN_NAME; } @Override public String evaluate() { return String.format("x=\"%s\" y=\"%s\"", Double.toString(this.first), Double.toString(this.second)); } }
UTF-8
Java
488
java
PositionProp.java
Java
[]
null
[]
package cs410.parser.properties.twoValue; import cs410.Lexer; public class PositionProp extends TwoValuePropNode { public static final String TOKEN_NAME = "pos"; public PositionProp(Lexer lexer) { super(lexer); } @Override public String name() { return PositionProp.TOKEN_NAME; } @Override public String evaluate() { return String.format("x=\"%s\" y=\"%s\"", Double.toString(this.first), Double.toString(this.second)); } }
488
0.653689
0.641393
21
22.238094
25.946657
109
false
false
0
0
0
0
0
0
0.380952
false
false
3
ad9bda379e0a4fc0b3167e97f4e262d01d417de3
2,233,383,049,640
d381c2a5f45541777d055520489c39cf45f5dc3e
/src/main/java/at/yawk/fimfiction/api/SearchRequest.java
a5254147b619b6905fe2adf502e3334d4a5a4011
[]
no_license
yawkat/FimFictionAPI
https://github.com/yawkat/FimFictionAPI
b3a6949ee1077db58f990b4e11665c133f752a02
95578d7662f6bead41b69162e6af602cd9bf2fe8
refs/heads/master
2020-03-31T10:04:23.420000
2013-11-02T19:18:03
2013-11-02T19:18:03
7,377,642
1
0
null
false
2013-01-09T21:11:21
2012-12-30T15:39:00
2013-01-09T21:11:20
2013-01-09T21:11:20
160
null
1
1
Java
null
null
package at.yawk.fimfiction.api; import java.util.Map; import at.yawk.fimfiction.api.util.SearchUtil; /** * A GET search request * * @see SearchUtil#getSearchGet(SearchRequest) * * @author Yawkat * */ public interface SearchRequest { /** * @return The search term */ public String getSearchTerm(); /** * @return The search order */ public SearchOrder getSearchOrder(); /** * Map with given categories and whether they should be used. * <code>null</code> or not in map means that it should be ignored, * <code>false</code> means that it may not appear, <code>true</code> means * it must appear. * * @return The search categories */ public Map<Category, Boolean> getCategories(); /** * @return The content rating */ public ContentRating getContentRating(); /** * @return The mature category */ public MatureCategory getMatureCategory(); /** * @return Whether the story must be completed to be displayed. */ public boolean getCompleted(); /** * @return Minimum word amount or <code>null</code> if it should be ignored. */ public Integer getMinimumWords(); /** * @return Maximum word amount or <code>null</code> if it should be ignored. */ public Integer getMaximumWords(); /** * Map with given characters and whether they must appear in the story. * <code>null</code> or not in map means that it should be ignored, * <code>false</code> means that it may not appear, <code>true</code> means * * @return The search characters */ public Map<Character, Boolean> getCharacters(); /** * @return Whether the story must have unread chapters (only useful when * using a logged in connection) */ public boolean getUnread(); /** * @return Whether the story must be marked as favorite (only useful when * using a logged in connection) */ public boolean getFavorite(); /** * @return Whether the story must be marked as read later (only useful when * using a logged in connection) */ public boolean getReadLater(); }
UTF-8
Java
2,269
java
SearchRequest.java
Java
[ { "context": "rchUtil#getSearchGet(SearchRequest)\n * \n * @author Yawkat\n * \n */\npublic interface SearchRequest {\n /**\n", "end": 204, "score": 0.7224122881889343, "start": 198, "tag": "USERNAME", "value": "Yawkat" } ]
null
[]
package at.yawk.fimfiction.api; import java.util.Map; import at.yawk.fimfiction.api.util.SearchUtil; /** * A GET search request * * @see SearchUtil#getSearchGet(SearchRequest) * * @author Yawkat * */ public interface SearchRequest { /** * @return The search term */ public String getSearchTerm(); /** * @return The search order */ public SearchOrder getSearchOrder(); /** * Map with given categories and whether they should be used. * <code>null</code> or not in map means that it should be ignored, * <code>false</code> means that it may not appear, <code>true</code> means * it must appear. * * @return The search categories */ public Map<Category, Boolean> getCategories(); /** * @return The content rating */ public ContentRating getContentRating(); /** * @return The mature category */ public MatureCategory getMatureCategory(); /** * @return Whether the story must be completed to be displayed. */ public boolean getCompleted(); /** * @return Minimum word amount or <code>null</code> if it should be ignored. */ public Integer getMinimumWords(); /** * @return Maximum word amount or <code>null</code> if it should be ignored. */ public Integer getMaximumWords(); /** * Map with given characters and whether they must appear in the story. * <code>null</code> or not in map means that it should be ignored, * <code>false</code> means that it may not appear, <code>true</code> means * * @return The search characters */ public Map<Character, Boolean> getCharacters(); /** * @return Whether the story must have unread chapters (only useful when * using a logged in connection) */ public boolean getUnread(); /** * @return Whether the story must be marked as favorite (only useful when * using a logged in connection) */ public boolean getFavorite(); /** * @return Whether the story must be marked as read later (only useful when * using a logged in connection) */ public boolean getReadLater(); }
2,269
0.612164
0.612164
87
25.08046
24.88928
80
false
false
0
0
0
0
0
0
0.241379
false
false
3
cae82e0ed4360ffcd462a82a09e2e15c1649386a
16,020,228,060,058
510d4618204395cbf41b826a3926bd600651ee19
/Hackathon/app/src/main/java/com/villa/deimer/hackathon/presenters/products/network/ProductNetworkPresenter.java
8e7b2e6b42d0838b72864a94097d1329be9a12a0
[]
no_license
jstivenbernal94/hackColpatria
https://github.com/jstivenbernal94/hackColpatria
68f2d6f9fd5a7cd3da926f9fd605341ce920737b
c6aab3f911d5c1b27c167276706d10e447a7ae56
refs/heads/master
2020-03-28T19:03:51.318000
2018-09-16T16:42:32
2018-09-16T16:42:32
148,940,663
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.villa.deimer.hackathon.presenters.products.network; import java.util.List; import com.villa.deimer.hackathon.models.entities.Product; public interface ProductNetworkPresenter { void getProducts(String baseUrl, int option); void susccessProducts(List<Product> products); void getDataError(String error); }
UTF-8
Java
334
java
ProductNetworkPresenter.java
Java
[]
null
[]
package com.villa.deimer.hackathon.presenters.products.network; import java.util.List; import com.villa.deimer.hackathon.models.entities.Product; public interface ProductNetworkPresenter { void getProducts(String baseUrl, int option); void susccessProducts(List<Product> products); void getDataError(String error); }
334
0.790419
0.790419
13
24.692308
24.577616
63
false
false
0
0
0
0
0
0
0.538462
false
false
3
270f749d45b3dd8a5b01843ac547350d069d0ac9
32,873,679,726,933
f538b56104c45e04f70ef3473a971d4a67e1b089
/java/netxms-eclipse/FileManager/src/org/netxms/ui/eclipse/filemanager/dialogs/helpers/ServerFileComparator.java
34d4f92678f78d5aa0c302a5a85aee047745bf59
[]
no_license
phongtran0715/SpiderClient
https://github.com/phongtran0715/SpiderClient
85d5d0559c6af0393cd058c25584074d80f8df9a
fdc264a85b7ff52c5dc2b6bb3cc83da62aad2aff
refs/heads/master
2020-03-20T20:07:12.075000
2018-08-10T08:37:10
2018-08-10T08:37:10
137,671,006
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
/** * */ package org.netxms.ui.eclipse.filemanager.dialogs.helpers; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.TableColumn; import org.netxms.client.server.ServerFile; import org.netxms.ui.eclipse.filemanager.dialogs.SelectServerFileDialog; /** * Comparator for ServerFile objects * */ public class ServerFileComparator extends ViewerComparator { /* * (non-Javadoc) * * @see * org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface. * viewers.Viewer, java.lang.Object, java.lang.Object) */ @Override public int compare(Viewer viewer, Object e1, Object e2) { TableColumn sortColumn = ((TableViewer) viewer).getTable() .getSortColumn(); if (sortColumn == null) return 0; int rc; switch ((Integer) sortColumn.getData("ID")) //$NON-NLS-1$ { case SelectServerFileDialog.COLUMN_NAME: rc = ((ServerFile) e1).getName().compareToIgnoreCase( ((ServerFile) e2).getName()); break; case SelectServerFileDialog.COLUMN_SIZE: rc = Long.signum(((ServerFile) e1).getSize() - ((ServerFile) e2).getSize()); break; case SelectServerFileDialog.COLUMN_MODTIME: rc = ((ServerFile) e1).getModifyicationTime().compareTo( ((ServerFile) e2).getModifyicationTime()); break; default: rc = 0; break; } int dir = ((TableViewer) viewer).getTable().getSortDirection(); return (dir == SWT.UP) ? rc : -rc; } }
UTF-8
Java
1,539
java
ServerFileComparator.java
Java
[]
null
[]
/** * */ package org.netxms.ui.eclipse.filemanager.dialogs.helpers; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.TableColumn; import org.netxms.client.server.ServerFile; import org.netxms.ui.eclipse.filemanager.dialogs.SelectServerFileDialog; /** * Comparator for ServerFile objects * */ public class ServerFileComparator extends ViewerComparator { /* * (non-Javadoc) * * @see * org.eclipse.jface.viewers.ViewerComparator#compare(org.eclipse.jface. * viewers.Viewer, java.lang.Object, java.lang.Object) */ @Override public int compare(Viewer viewer, Object e1, Object e2) { TableColumn sortColumn = ((TableViewer) viewer).getTable() .getSortColumn(); if (sortColumn == null) return 0; int rc; switch ((Integer) sortColumn.getData("ID")) //$NON-NLS-1$ { case SelectServerFileDialog.COLUMN_NAME: rc = ((ServerFile) e1).getName().compareToIgnoreCase( ((ServerFile) e2).getName()); break; case SelectServerFileDialog.COLUMN_SIZE: rc = Long.signum(((ServerFile) e1).getSize() - ((ServerFile) e2).getSize()); break; case SelectServerFileDialog.COLUMN_MODTIME: rc = ((ServerFile) e1).getModifyicationTime().compareTo( ((ServerFile) e2).getModifyicationTime()); break; default: rc = 0; break; } int dir = ((TableViewer) viewer).getTable().getSortDirection(); return (dir == SWT.UP) ? rc : -rc; } }
1,539
0.710201
0.703054
55
26.981817
23.238285
73
false
false
0
0
0
0
0
0
1.909091
false
false
3
9501402a08875899fd5fbcad043851a458aa15f8
8,452,495,683,779
bdd02ae704fbb020aefba5e000abc2685c68584d
/src/main/java/com/jsonmack/datastructures/doubly_linkedlist/DoublyLinkedList.java
87082c2d7fa0905b54be84a79551c120d77149c0
[]
no_license
JsonMack/learning-data-structures
https://github.com/JsonMack/learning-data-structures
94070458eb11c112bfef204932e46a45689b2364
48a1e9933305df5436b195c202419650a69955ac
refs/heads/master
2023-06-03T13:01:12.872000
2021-06-12T18:31:24
2021-06-12T18:31:24
369,657,650
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.jsonmack.datastructures.doubly_linkedlist; import java.util.ListIterator; import java.util.NoSuchElementException; /** * @author Jason MacKeigan */ public class DoublyLinkedList<T> implements Iterable<T> { private DoublyLinkedNode<T> head; private DoublyLinkedNode<T> tail; private int size; private DoublyLinkedList(DoublyLinkedNode<T> head, DoublyLinkedNode<T> tail, int size) { if (size < 0) { throw new IllegalArgumentException("Size cannot be less than zero."); } this.head = head; this.tail = tail; this.size = size; } private DoublyLinkedList(DoublyLinkedNode<T> node) { this(node, node, 1); } public DoublyLinkedList() { this(null, null, 0); } public DoublyLinkedList(T value) { this(new DoublyLinkedNode<>(value)); } /** * Attempts to add a node to the tail end of the list. If the head is null, this value becomes * the head. * * @param value * the value we want to add to the linked list. Duplicates can exists. This method should * never fail. I won't say 'wont'. Oh. */ public void add(T value) { DoublyLinkedNode<T> node = new DoublyLinkedNode<>(value); if (head == null) { head = node; } else if (size == 1) { head.setNext(node); } if (tail != null) { node.setPrevious(tail); tail.setNext(node); } tail = node; size++; } /** * Removes the value from the linked list by stitching together the previous node, if any, * and the next node, if any. This effectively seek for the node, and rips it out of the * doubly linked list. * * @param value * the value to remove, which may not exist. * @return true if the value can be removed, meaning it exists. Otherwise, false if it does * not exist and cannot be removed. */ public boolean remove(T value) { DoublyLinkedNode<T> node = find(head, value); if (node == null) { return false; } removeNode(node); return true; } /** * Removes the node from the linked list. This assumes that the node is not null and is * intended to only be used internally when this is the case since a node can be null. * * @param node * the node to remove. */ private void removeNode(DoublyLinkedNode<T> node) { DoublyLinkedNode<T> previous = node.previous(); DoublyLinkedNode<T> next = node.next(); if (previous != null) { previous.setNext(next); } if (next != null) { next.setPrevious(previous); } if (node == head) { head = null; tail = null; } else if (node == tail) { tail = null; if (head != null && size == 1) { head.setNext(null); } } size--; } /** * Determines if the value can be found anywhere in the list, starting at the head * node. * * @param value * the value we're determining exists or not. * @return true if the value exists, otherwise false. */ public boolean contains(T value) { return find(head, value) != null; } /** * Compares the current nodes value against the parameter, and seeks to the next * node, if not null, comparing values again. This continues until next is null. * * @param node * the current node we're comparing the value against. this may be null. * @param value * the value we're seeking for, to check if it exists. * @return the node if it can be found, or null if it cannot. */ private DoublyLinkedNode<T> find(DoublyLinkedNode<T> node, T value) { if (node == null) { return null; } if (node.value() == value) { return node; } return find(node.next(), value); } public int getSize() { return size; } public T getHead() { return head == null ? null : head.value(); } public T getTail() { return tail == null ? null : tail.value(); } @Override public ListIterator<T> iterator() { return new DoublyLinkedListIterator(head, size); } private final class DoublyLinkedListIterator implements ListIterator<T> { private final int size; private DoublyLinkedNode<T> node; private DoublyLinkedNode<T> previousReference; private int index; private DoublyLinkedListIterator(DoublyLinkedNode<T> node, int size) { this.node = node; this.size = size; } @Override public boolean hasNext() { return index < size; } @Override public T next() { if (!hasNext()) { throw new NoSuchElementException(); } DoublyLinkedNode<T> next = node; previousReference = node; node = node.next(); index++; return next.value(); } @Override public boolean hasPrevious() { return index > 0; } @Override public T previous() { if (!hasPrevious()) { throw new NoSuchElementException(); } DoublyLinkedNode<T> previous = node; previousReference = node; node = node.previous(); index--; return previous.value(); } @Override public int nextIndex() { return Math.min(size, index + 1); } @Override public int previousIndex() { return Math.max(-1, index - 1); } //TODO remove logical issue //TODO on next/prev, node has already changed. Need to account for current. //TODO maybe store current as node removed or? @Override public void remove() { if (previousReference == null) { throw new IllegalStateException(); } removeNode(previousReference); previousReference = null; } @Override public void set(T tDoublyLinkedNode) { throw new UnsupportedOperationException(); } @Override public void add(T tDoublyLinkedNode) { throw new UnsupportedOperationException(); } } }
UTF-8
Java
6,648
java
DoublyLinkedList.java
Java
[ { "context": " java.util.NoSuchElementException;\n\n/**\n * @author Jason MacKeigan\n */\npublic class DoublyLinkedList<T> implements I", "end": 159, "score": 0.999859094619751, "start": 144, "tag": "NAME", "value": "Jason MacKeigan" } ]
null
[]
package com.jsonmack.datastructures.doubly_linkedlist; import java.util.ListIterator; import java.util.NoSuchElementException; /** * @author <NAME> */ public class DoublyLinkedList<T> implements Iterable<T> { private DoublyLinkedNode<T> head; private DoublyLinkedNode<T> tail; private int size; private DoublyLinkedList(DoublyLinkedNode<T> head, DoublyLinkedNode<T> tail, int size) { if (size < 0) { throw new IllegalArgumentException("Size cannot be less than zero."); } this.head = head; this.tail = tail; this.size = size; } private DoublyLinkedList(DoublyLinkedNode<T> node) { this(node, node, 1); } public DoublyLinkedList() { this(null, null, 0); } public DoublyLinkedList(T value) { this(new DoublyLinkedNode<>(value)); } /** * Attempts to add a node to the tail end of the list. If the head is null, this value becomes * the head. * * @param value * the value we want to add to the linked list. Duplicates can exists. This method should * never fail. I won't say 'wont'. Oh. */ public void add(T value) { DoublyLinkedNode<T> node = new DoublyLinkedNode<>(value); if (head == null) { head = node; } else if (size == 1) { head.setNext(node); } if (tail != null) { node.setPrevious(tail); tail.setNext(node); } tail = node; size++; } /** * Removes the value from the linked list by stitching together the previous node, if any, * and the next node, if any. This effectively seek for the node, and rips it out of the * doubly linked list. * * @param value * the value to remove, which may not exist. * @return true if the value can be removed, meaning it exists. Otherwise, false if it does * not exist and cannot be removed. */ public boolean remove(T value) { DoublyLinkedNode<T> node = find(head, value); if (node == null) { return false; } removeNode(node); return true; } /** * Removes the node from the linked list. This assumes that the node is not null and is * intended to only be used internally when this is the case since a node can be null. * * @param node * the node to remove. */ private void removeNode(DoublyLinkedNode<T> node) { DoublyLinkedNode<T> previous = node.previous(); DoublyLinkedNode<T> next = node.next(); if (previous != null) { previous.setNext(next); } if (next != null) { next.setPrevious(previous); } if (node == head) { head = null; tail = null; } else if (node == tail) { tail = null; if (head != null && size == 1) { head.setNext(null); } } size--; } /** * Determines if the value can be found anywhere in the list, starting at the head * node. * * @param value * the value we're determining exists or not. * @return true if the value exists, otherwise false. */ public boolean contains(T value) { return find(head, value) != null; } /** * Compares the current nodes value against the parameter, and seeks to the next * node, if not null, comparing values again. This continues until next is null. * * @param node * the current node we're comparing the value against. this may be null. * @param value * the value we're seeking for, to check if it exists. * @return the node if it can be found, or null if it cannot. */ private DoublyLinkedNode<T> find(DoublyLinkedNode<T> node, T value) { if (node == null) { return null; } if (node.value() == value) { return node; } return find(node.next(), value); } public int getSize() { return size; } public T getHead() { return head == null ? null : head.value(); } public T getTail() { return tail == null ? null : tail.value(); } @Override public ListIterator<T> iterator() { return new DoublyLinkedListIterator(head, size); } private final class DoublyLinkedListIterator implements ListIterator<T> { private final int size; private DoublyLinkedNode<T> node; private DoublyLinkedNode<T> previousReference; private int index; private DoublyLinkedListIterator(DoublyLinkedNode<T> node, int size) { this.node = node; this.size = size; } @Override public boolean hasNext() { return index < size; } @Override public T next() { if (!hasNext()) { throw new NoSuchElementException(); } DoublyLinkedNode<T> next = node; previousReference = node; node = node.next(); index++; return next.value(); } @Override public boolean hasPrevious() { return index > 0; } @Override public T previous() { if (!hasPrevious()) { throw new NoSuchElementException(); } DoublyLinkedNode<T> previous = node; previousReference = node; node = node.previous(); index--; return previous.value(); } @Override public int nextIndex() { return Math.min(size, index + 1); } @Override public int previousIndex() { return Math.max(-1, index - 1); } //TODO remove logical issue //TODO on next/prev, node has already changed. Need to account for current. //TODO maybe store current as node removed or? @Override public void remove() { if (previousReference == null) { throw new IllegalStateException(); } removeNode(previousReference); previousReference = null; } @Override public void set(T tDoublyLinkedNode) { throw new UnsupportedOperationException(); } @Override public void add(T tDoublyLinkedNode) { throw new UnsupportedOperationException(); } } }
6,639
0.545427
0.544073
247
25.91498
24.204361
104
false
false
0
0
0
0
0
0
0.396761
false
false
3
7ce21374350a993d02b53127a9e7c6d2fa718437
20,426,864,513,794
dd6680b05d1dce6dcf3d4743a051df708d9c71ea
/src/main/java/nick/umn/vocabulary/infrastructure/externalapi/YandexTranslatorApiImpl.java
3996af471c30994156f2553010f0f68814d4b10d
[]
no_license
Nickqwer/vocabulary
https://github.com/Nickqwer/vocabulary
925d350790b84fb404b0b42fe4af09caff742c61
dd8c54308ef67b27267a60bfb3fdd91ffb47159e
refs/heads/master
2016-05-16T08:08:44.416000
2016-05-16T04:37:29
2016-05-16T04:37:29
50,438,481
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package nick.umn.vocabulary.infrastructure.externalapi; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.JsonNode; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; import com.mashape.unirest.request.HttpRequest; import org.json.JSONArray; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; /** * Created by Nick on 4/8/2016. */ @Service public class YandexTranslatorApiImpl implements YandexTranslatorApi { private static Logger log = LoggerFactory.getLogger(YandexTranslatorApiImpl.class); public List<String> translate(List<String> words) throws UnirestException { HttpRequest httpRequest = Unirest .get("https://translate.yandex.net/api/v1.5/tr.json/translate") .queryString("key", "trnsl.1.1.20160316T180006Z.1343326797b25a69.9d78005c205a1cb655446a818622ec8422cafa53") .queryString("lang", "en-ru") .header("Accept", "application/json"); for (String word : words) { httpRequest = httpRequest.queryString("text", word); } HttpResponse<JsonNode> translateResponse = httpRequest.asJson(); JSONArray jsonArray = translateResponse.getBody().getObject().getJSONArray("text"); List<String> result = new ArrayList<>(); for (int i = 0; i < jsonArray.length(); ++i) { result.add(jsonArray.getString(i)); } return result; } @Override @Async public CompletableFuture<YandexTranslatorApiResponse> translateAsync(List<String> words) { CompletableFuture<YandexTranslatorApiResponse> resultFuture = new CompletableFuture<>(); try { YandexTranslatorApiResponse response = new YandexTranslatorApiResponse(translate(words)); resultFuture.complete(response); } catch (UnirestException e) { log.error("YandexTranslatorApi error", e); resultFuture.completeExceptionally(e); } return resultFuture; } }
UTF-8
Java
2,258
java
YandexTranslatorApiImpl.java
Java
[ { "context": "l.concurrent.CompletableFuture;\n\n/**\n * Created by Nick on 4/8/2016.\n */\n@Service\npublic class YandexTran", "end": 604, "score": 0.9938284158706665, "start": 600, "tag": "NAME", "value": "Nick" }, { "context": "/translate\")\n .queryString(\"key\", \"trnsl.1.1.20160316T180006Z.1343326797b25a69.9d78005c205a1cb655446a818622ec8422cafa53\")\n .queryString(\"lang\", \"en-ru\")\n ", "end": 1115, "score": 0.9995477795600891, "start": 1031, "tag": "KEY", "value": "trnsl.1.1.20160316T180006Z.1343326797b25a69.9d78005c205a1cb655446a818622ec8422cafa53" } ]
null
[]
package nick.umn.vocabulary.infrastructure.externalapi; import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.JsonNode; import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; import com.mashape.unirest.request.HttpRequest; import org.json.JSONArray; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.concurrent.CompletableFuture; /** * Created by Nick on 4/8/2016. */ @Service public class YandexTranslatorApiImpl implements YandexTranslatorApi { private static Logger log = LoggerFactory.getLogger(YandexTranslatorApiImpl.class); public List<String> translate(List<String> words) throws UnirestException { HttpRequest httpRequest = Unirest .get("https://translate.yandex.net/api/v1.5/tr.json/translate") .queryString("key", "trnsl.1.1.20160316T180006Z.1343326797b25a69.9d78005c205a1cb655446a818622ec8422cafa53") .queryString("lang", "en-ru") .header("Accept", "application/json"); for (String word : words) { httpRequest = httpRequest.queryString("text", word); } HttpResponse<JsonNode> translateResponse = httpRequest.asJson(); JSONArray jsonArray = translateResponse.getBody().getObject().getJSONArray("text"); List<String> result = new ArrayList<>(); for (int i = 0; i < jsonArray.length(); ++i) { result.add(jsonArray.getString(i)); } return result; } @Override @Async public CompletableFuture<YandexTranslatorApiResponse> translateAsync(List<String> words) { CompletableFuture<YandexTranslatorApiResponse> resultFuture = new CompletableFuture<>(); try { YandexTranslatorApiResponse response = new YandexTranslatorApiResponse(translate(words)); resultFuture.complete(response); } catch (UnirestException e) { log.error("YandexTranslatorApi error", e); resultFuture.completeExceptionally(e); } return resultFuture; } }
2,258
0.704163
0.673605
57
38.614037
30.473316
123
false
false
0
0
0
0
0
0
0.614035
false
false
3
664c6d8341cdad0e2533a7d849ef2a4ebc58842a
3,659,312,142,735
e626e774cfd94fdcfa4b66f0bc83cc7375e6a7fe
/A/swe/swe6719/SWE6719.java
6c68606f86745f03ae956c83db54c1deb5b8b6ca
[]
no_license
feral913/Algorithm_Study_AB
https://github.com/feral913/Algorithm_Study_AB
46af54c3d4d6ca7ecd1653d0fabf0a8ddb832f56
f4d41b2d2118a1aa75b6c1e22e73ec010a821b3a
refs/heads/master
2020-04-11T15:04:13.735000
2019-06-10T03:16:50
2019-06-10T03:16:50
161,878,589
0
0
null
false
2018-12-29T14:09:57
2018-12-15T06:50:47
2018-12-29T11:51:13
2018-12-29T14:09:57
138
0
0
0
Java
false
null
/* * 성수가 오늘 들을 수 있는 강좌들의 수준이 주어진다. * 이 중 성수가 오늘 들을 수 있는 강좌의 개수가 주어진다. * ( 성수의 기존 실력 + 강좌 수준 ) / 2 의 공식에 따라 성수의 실력이 변한다. * 들을 수 있는 강좌 수와 강좌 레벨을 고려하여 성수의 최종 실력이 최대값이 되게 하자. */ package swe.swe6719; import java.util.Scanner; class Sungsoo{ private float codingLevel; // 최초 성수의 프로그래밍 실력은 0 public Sungsoo() { this.codingLevel = 0; } public float getCodingLevel() { return this.codingLevel; } // 강좌를 들을 때마다 '(기존 실력 + 강좌 수준) / 2' 만큼 실력 변화 public void setCodingLevel(int classLevel) { codingLevel = (codingLevel + classLevel) / 2; } } class TodayClass{ // 모든 강좌의 수, 오늘 들을 수 있는 강좌의 수 int allClassNum; int selectedClassNum; // 모든 강좌의 수준 리스트, 오늘 들을 수 있는 강좌의 수준 리스트 int[] allClass; int[] selectedClass; // 객체 생성 시 강좌 수 먼저 받아오고 수준은 배열 객체 생성만 public TodayClass(int allClassNum, int selectedClassNum) { this.allClassNum = allClassNum; this.selectedClassNum = selectedClassNum; this.allClass = new int[allClassNum]; this.selectedClass = new int[selectedClassNum]; } // 모든 강좌 수준 저장 public void setAllClass(int[] allClass) { this.allClass = allClass; } public int getSelectedClass(int i) { return this.selectedClass[i]; } // 내림차순으로 정렬된 모든 강좌 중 오늘 들을 수 있는 강좌 개수만큼 다시 오늘차순으로 저장 // - 낮은 수준부터 들어야 계산했을 때 최종 결과가 점점 높아지기 때문 public void setSelectedClass() { for(int i = 0; i < selectedClassNum; i++) { selectedClass[i] = allClass[selectedClassNum - i - 1]; } } // 모든 강좌 내림차순 정렬 // - 강좌가 높은 수업들만 골라듣기 위해서 public void sortAllClass() { for(int i = 0; i < allClassNum; i++) { for(int j = i + 1; j < allClassNum; j++) { if(this.allClass[i] < this.allClass[j]) { int temp = this.allClass[i]; this.allClass[i] = this.allClass[j]; this.allClass[j] = temp; } } } } } public class SWE6719 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); // Test case 수 int T = sc.nextInt(); for(int testCase = 1; testCase <= T; testCase++) { // 오늘의 총 강좌 수 int N = sc.nextInt(); // 오늘 들을 수 있는 강좌 수 int K = sc.nextInt(); Sungsoo ss = new Sungsoo(); TodayClass tc = new TodayClass(N, K); int[] allClass = new int[N]; for(int i = 0; i < N; i++) { allClass[i] = sc.nextInt(); } tc.setAllClass(allClass); tc.sortAllClass(); tc.setSelectedClass(); for(int i = 0; i < K; i++) { ss.setCodingLevel(tc.getSelectedClass(i)); } System.out.printf("#%d %.6f\n", testCase, ss.getCodingLevel()); } sc.close(); } }
UTF-8
Java
3,264
java
SWE6719.java
Java
[]
null
[]
/* * 성수가 오늘 들을 수 있는 강좌들의 수준이 주어진다. * 이 중 성수가 오늘 들을 수 있는 강좌의 개수가 주어진다. * ( 성수의 기존 실력 + 강좌 수준 ) / 2 의 공식에 따라 성수의 실력이 변한다. * 들을 수 있는 강좌 수와 강좌 레벨을 고려하여 성수의 최종 실력이 최대값이 되게 하자. */ package swe.swe6719; import java.util.Scanner; class Sungsoo{ private float codingLevel; // 최초 성수의 프로그래밍 실력은 0 public Sungsoo() { this.codingLevel = 0; } public float getCodingLevel() { return this.codingLevel; } // 강좌를 들을 때마다 '(기존 실력 + 강좌 수준) / 2' 만큼 실력 변화 public void setCodingLevel(int classLevel) { codingLevel = (codingLevel + classLevel) / 2; } } class TodayClass{ // 모든 강좌의 수, 오늘 들을 수 있는 강좌의 수 int allClassNum; int selectedClassNum; // 모든 강좌의 수준 리스트, 오늘 들을 수 있는 강좌의 수준 리스트 int[] allClass; int[] selectedClass; // 객체 생성 시 강좌 수 먼저 받아오고 수준은 배열 객체 생성만 public TodayClass(int allClassNum, int selectedClassNum) { this.allClassNum = allClassNum; this.selectedClassNum = selectedClassNum; this.allClass = new int[allClassNum]; this.selectedClass = new int[selectedClassNum]; } // 모든 강좌 수준 저장 public void setAllClass(int[] allClass) { this.allClass = allClass; } public int getSelectedClass(int i) { return this.selectedClass[i]; } // 내림차순으로 정렬된 모든 강좌 중 오늘 들을 수 있는 강좌 개수만큼 다시 오늘차순으로 저장 // - 낮은 수준부터 들어야 계산했을 때 최종 결과가 점점 높아지기 때문 public void setSelectedClass() { for(int i = 0; i < selectedClassNum; i++) { selectedClass[i] = allClass[selectedClassNum - i - 1]; } } // 모든 강좌 내림차순 정렬 // - 강좌가 높은 수업들만 골라듣기 위해서 public void sortAllClass() { for(int i = 0; i < allClassNum; i++) { for(int j = i + 1; j < allClassNum; j++) { if(this.allClass[i] < this.allClass[j]) { int temp = this.allClass[i]; this.allClass[i] = this.allClass[j]; this.allClass[j] = temp; } } } } } public class SWE6719 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); // Test case 수 int T = sc.nextInt(); for(int testCase = 1; testCase <= T; testCase++) { // 오늘의 총 강좌 수 int N = sc.nextInt(); // 오늘 들을 수 있는 강좌 수 int K = sc.nextInt(); Sungsoo ss = new Sungsoo(); TodayClass tc = new TodayClass(N, K); int[] allClass = new int[N]; for(int i = 0; i < N; i++) { allClass[i] = sc.nextInt(); } tc.setAllClass(allClass); tc.sortAllClass(); tc.setSelectedClass(); for(int i = 0; i < K; i++) { ss.setCodingLevel(tc.getSelectedClass(i)); } System.out.printf("#%d %.6f\n", testCase, ss.getCodingLevel()); } sc.close(); } }
3,264
0.598704
0.590701
113
21.238937
17.879772
66
false
false
0
0
0
0
0
0
2.00885
false
false
3
31a95ae35ce9e2cdbfabe89d27f7c9bb06ba58b9
12,575,664,248,536
9e2685ab760c796b66f0fdccfbcad1041727c058
/app/src/main/java/ml/medyas/bakingapp/Classes/UtilsClass.java
c396b78d99fb02e508e93ba4841fa675449e6023
[]
no_license
medyas/Baking-App
https://github.com/medyas/Baking-App
a3f830ebbd1a25bd6233068d07a102f52b342309
338456f4ee2a5aa268d8303cacd35de20e15414d
refs/heads/master
2020-04-01T07:53:16.449000
2018-10-22T19:54:56
2018-10-22T19:54:56
153,008,391
3
2
null
null
null
null
null
null
null
null
null
null
null
null
null
package ml.medyas.bakingapp.Classes; import android.content.Context; import android.content.res.Resources; import android.support.v7.widget.Toolbar; import android.text.TextUtils; import android.util.DisplayMetrics; import android.view.View; import java.util.ArrayList; public class UtilsClass { public static View getNavigationIconView(Toolbar toolbar) { String previousContentDescription = (String) toolbar.getNavigationContentDescription(); // Check if contentDescription previously was set boolean hadContentDescription = !TextUtils.isEmpty(previousContentDescription); String contentDescription = hadContentDescription ? previousContentDescription : "navigationIcon"; toolbar.setNavigationContentDescription(contentDescription); ArrayList<View> potentialViews = new ArrayList<>(); // Find the view based on it's content description, set programmatically or with // android:contentDescription toolbar.findViewsWithText(potentialViews, contentDescription, View.FIND_VIEWS_WITH_CONTENT_DESCRIPTION); // Nav icon is always instantiated at this point because calling // setNavigationContentDescription ensures its existence View navIcon = null; if (potentialViews.size() > 0) { navIcon = potentialViews.get(0); //navigation icon is ImageButton } // Clear content description if not previously present if (!hadContentDescription) toolbar.setNavigationContentDescription(previousContentDescription); return navIcon; } public static int getScreenWidth() { return Resources.getSystem().getDisplayMetrics().widthPixels; } public static int getScreenHeight() { return Resources.getSystem().getDisplayMetrics().heightPixels; } public static int calculateNoOfColumns(Context context) { DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); float dpWidth = displayMetrics.widthPixels / displayMetrics.density; int noOfColumns = (int) (dpWidth / 250); return noOfColumns; } }
UTF-8
Java
2,173
java
UtilsClass.java
Java
[]
null
[]
package ml.medyas.bakingapp.Classes; import android.content.Context; import android.content.res.Resources; import android.support.v7.widget.Toolbar; import android.text.TextUtils; import android.util.DisplayMetrics; import android.view.View; import java.util.ArrayList; public class UtilsClass { public static View getNavigationIconView(Toolbar toolbar) { String previousContentDescription = (String) toolbar.getNavigationContentDescription(); // Check if contentDescription previously was set boolean hadContentDescription = !TextUtils.isEmpty(previousContentDescription); String contentDescription = hadContentDescription ? previousContentDescription : "navigationIcon"; toolbar.setNavigationContentDescription(contentDescription); ArrayList<View> potentialViews = new ArrayList<>(); // Find the view based on it's content description, set programmatically or with // android:contentDescription toolbar.findViewsWithText(potentialViews, contentDescription, View.FIND_VIEWS_WITH_CONTENT_DESCRIPTION); // Nav icon is always instantiated at this point because calling // setNavigationContentDescription ensures its existence View navIcon = null; if (potentialViews.size() > 0) { navIcon = potentialViews.get(0); //navigation icon is ImageButton } // Clear content description if not previously present if (!hadContentDescription) toolbar.setNavigationContentDescription(previousContentDescription); return navIcon; } public static int getScreenWidth() { return Resources.getSystem().getDisplayMetrics().widthPixels; } public static int getScreenHeight() { return Resources.getSystem().getDisplayMetrics().heightPixels; } public static int calculateNoOfColumns(Context context) { DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics(); float dpWidth = displayMetrics.widthPixels / displayMetrics.density; int noOfColumns = (int) (dpWidth / 250); return noOfColumns; } }
2,173
0.717441
0.71468
58
36.465519
29.624207
95
false
false
0
0
0
0
0
0
0.465517
false
false
3
6c6f30a0fb1ac8206bccf537236b919f7419ce6c
17,300,128,274,876
c26304a54824faa7c1b34bb7882ee7a335a8e7fb
/flink-runtime/src/main/java/org/apache/flink/runtime/state/heap/StateMap.java
814a265c7163b64fd46246853c658959ed36102a
[ "BSD-3-Clause", "OFL-1.1", "ISC", "MIT", "Apache-2.0" ]
permissive
apache/flink
https://github.com/apache/flink
905e0709de6389fc9212a7c48a82669706c70b4a
fbef3c22757a2352145599487beb84e02aaeb389
refs/heads/master
2023-09-04T08:11:07.253000
2023-09-04T01:33:25
2023-09-04T01:33:25
20,587,599
23,573
14,781
Apache-2.0
false
2023-09-14T21:49:04
2014-06-07T07:00:10
2023-09-14T11:23:39
2023-09-14T21:49:03
509,428
21,946
12,627
1,090
Java
false
false
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.runtime.state.heap; import org.apache.flink.annotation.VisibleForTesting; import org.apache.flink.runtime.state.StateEntry; import org.apache.flink.runtime.state.StateTransformationFunction; import org.apache.flink.runtime.state.internal.InternalKvState; import javax.annotation.Nonnull; import java.util.stream.Stream; /** * Base class for state maps. * * @param <K> type of key * @param <N> type of namespace * @param <S> type of state */ public abstract class StateMap<K, N, S> implements Iterable<StateEntry<K, N, S>> { // Main interface methods of StateMap ------------------------------------------------------- /** * Returns whether this {@link StateMap} is empty. * * @return {@code true} if this {@link StateMap} has no elements, {@code false} otherwise. * @see #size() */ public boolean isEmpty() { return size() == 0; } /** * Returns the total number of entries in this {@link StateMap}. * * @return the number of entries in this {@link StateMap}. */ public abstract int size(); /** * Returns the state for the composite of active key and given namespace. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @return the state of the mapping with the specified key/namespace composite key, or {@code * null} if no mapping for the specified key is found. */ public abstract S get(K key, N namespace); /** * Returns whether this map contains the specified key/namespace composite key. * * @param key the key in the composite key to search for. Not null. * @param namespace the namespace in the composite key to search for. Not null. * @return {@code true} if this map contains the specified key/namespace composite key, {@code * false} otherwise. */ public abstract boolean containsKey(K key, N namespace); /** * Maps the specified key/namespace composite key to the specified value. This method should be * preferred over {@link #putAndGetOld(K, N, S)} (key, Namespace, State) when the caller is not * interested in the old state. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @param state the state. Can be null. */ public abstract void put(K key, N namespace, S state); /** * Maps the composite of active key and given namespace to the specified state. Returns the * previous state that was registered under the composite key. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @param state the state. Can be null. * @return the state of any previous mapping with the specified key or {@code null} if there was * no such mapping. */ public abstract S putAndGetOld(K key, N namespace, S state); /** * Removes the mapping for the composite of active key and given namespace. This method should * be preferred over {@link #removeAndGetOld(K, N)} when the caller is not interested in the old * state. * * @param key the key of the mapping to remove. Not null. * @param namespace the namespace of the mapping to remove. Not null. */ public abstract void remove(K key, N namespace); /** * Removes the mapping for the composite of active key and given namespace, returning the state * that was found under the entry. * * @param key the key of the mapping to remove. Not null. * @param namespace the namespace of the mapping to remove. Not null. * @return the state of the removed mapping or {@code null} if no mapping for the specified key * was found. */ public abstract S removeAndGetOld(K key, N namespace); /** * Applies the given {@link StateTransformationFunction} to the state (1st input argument), * using the given value as second input argument. The result of {@link * StateTransformationFunction#apply(Object, Object)} is then stored as the new state. This * function is basically an optimization for get-update-put pattern. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @param value the value to use in transforming the state. Can be null. * @param transformation the transformation function. * @throws Exception if some exception happens in the transformation function. */ public abstract <T> void transform( K key, N namespace, T value, StateTransformationFunction<S, T> transformation) throws Exception; // For queryable state ------------------------------------------------------------------------ public abstract Stream<K> getKeys(N namespace); public abstract InternalKvState.StateIncrementalVisitor<K, N, S> getStateIncrementalVisitor( int recommendedMaxNumberOfReturnedRecords); /** * Creates a snapshot of this {@link StateMap}, to be written in checkpointing. Users should * call {@link #releaseSnapshot(StateMapSnapshot)} after using the returned object. * * @return a snapshot from this {@link StateMap}, for checkpointing. */ @Nonnull public abstract StateMapSnapshot<K, N, S, ? extends StateMap<K, N, S>> stateSnapshot(); /** * Releases a snapshot for this {@link StateMap}. This method should be called once a snapshot * is no more needed. * * @param snapshotToRelease the snapshot to release, which was previously created by this state * map. */ public void releaseSnapshot( StateMapSnapshot<K, N, S, ? extends StateMap<K, N, S>> snapshotToRelease) {} // For testing -------------------------------------------------------------------------------- @VisibleForTesting public abstract int sizeOfNamespace(Object namespace); }
UTF-8
Java
6,722
java
StateMap.java
Java
[]
null
[]
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.runtime.state.heap; import org.apache.flink.annotation.VisibleForTesting; import org.apache.flink.runtime.state.StateEntry; import org.apache.flink.runtime.state.StateTransformationFunction; import org.apache.flink.runtime.state.internal.InternalKvState; import javax.annotation.Nonnull; import java.util.stream.Stream; /** * Base class for state maps. * * @param <K> type of key * @param <N> type of namespace * @param <S> type of state */ public abstract class StateMap<K, N, S> implements Iterable<StateEntry<K, N, S>> { // Main interface methods of StateMap ------------------------------------------------------- /** * Returns whether this {@link StateMap} is empty. * * @return {@code true} if this {@link StateMap} has no elements, {@code false} otherwise. * @see #size() */ public boolean isEmpty() { return size() == 0; } /** * Returns the total number of entries in this {@link StateMap}. * * @return the number of entries in this {@link StateMap}. */ public abstract int size(); /** * Returns the state for the composite of active key and given namespace. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @return the state of the mapping with the specified key/namespace composite key, or {@code * null} if no mapping for the specified key is found. */ public abstract S get(K key, N namespace); /** * Returns whether this map contains the specified key/namespace composite key. * * @param key the key in the composite key to search for. Not null. * @param namespace the namespace in the composite key to search for. Not null. * @return {@code true} if this map contains the specified key/namespace composite key, {@code * false} otherwise. */ public abstract boolean containsKey(K key, N namespace); /** * Maps the specified key/namespace composite key to the specified value. This method should be * preferred over {@link #putAndGetOld(K, N, S)} (key, Namespace, State) when the caller is not * interested in the old state. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @param state the state. Can be null. */ public abstract void put(K key, N namespace, S state); /** * Maps the composite of active key and given namespace to the specified state. Returns the * previous state that was registered under the composite key. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @param state the state. Can be null. * @return the state of any previous mapping with the specified key or {@code null} if there was * no such mapping. */ public abstract S putAndGetOld(K key, N namespace, S state); /** * Removes the mapping for the composite of active key and given namespace. This method should * be preferred over {@link #removeAndGetOld(K, N)} when the caller is not interested in the old * state. * * @param key the key of the mapping to remove. Not null. * @param namespace the namespace of the mapping to remove. Not null. */ public abstract void remove(K key, N namespace); /** * Removes the mapping for the composite of active key and given namespace, returning the state * that was found under the entry. * * @param key the key of the mapping to remove. Not null. * @param namespace the namespace of the mapping to remove. Not null. * @return the state of the removed mapping or {@code null} if no mapping for the specified key * was found. */ public abstract S removeAndGetOld(K key, N namespace); /** * Applies the given {@link StateTransformationFunction} to the state (1st input argument), * using the given value as second input argument. The result of {@link * StateTransformationFunction#apply(Object, Object)} is then stored as the new state. This * function is basically an optimization for get-update-put pattern. * * @param key the key. Not null. * @param namespace the namespace. Not null. * @param value the value to use in transforming the state. Can be null. * @param transformation the transformation function. * @throws Exception if some exception happens in the transformation function. */ public abstract <T> void transform( K key, N namespace, T value, StateTransformationFunction<S, T> transformation) throws Exception; // For queryable state ------------------------------------------------------------------------ public abstract Stream<K> getKeys(N namespace); public abstract InternalKvState.StateIncrementalVisitor<K, N, S> getStateIncrementalVisitor( int recommendedMaxNumberOfReturnedRecords); /** * Creates a snapshot of this {@link StateMap}, to be written in checkpointing. Users should * call {@link #releaseSnapshot(StateMapSnapshot)} after using the returned object. * * @return a snapshot from this {@link StateMap}, for checkpointing. */ @Nonnull public abstract StateMapSnapshot<K, N, S, ? extends StateMap<K, N, S>> stateSnapshot(); /** * Releases a snapshot for this {@link StateMap}. This method should be called once a snapshot * is no more needed. * * @param snapshotToRelease the snapshot to release, which was previously created by this state * map. */ public void releaseSnapshot( StateMapSnapshot<K, N, S, ? extends StateMap<K, N, S>> snapshotToRelease) {} // For testing -------------------------------------------------------------------------------- @VisibleForTesting public abstract int sizeOfNamespace(Object namespace); }
6,722
0.660518
0.659625
168
39.011906
34.194645
100
false
false
0
0
0
0
0
0
0.39881
false
false
3
c26dc32a4d5cbd320c87710b324f09925f38d0ae
18,528,488,923,369
dbc00a8bcf2b54eb4edb03d113a3e70b44aabfbd
/Servlet2/src/listener/MyHttpSessionListener.java
2c5e915f6d7d725af9cf5e1e80a45f08c0bb906f
[]
no_license
qiao-zhi/AllProject
https://github.com/qiao-zhi/AllProject
daad9829a6064e1448275677b2cf20f31604b682
9e7da0ed7b351cddfb62080873952ea34ed90ea1
refs/heads/master
2020-03-12T04:02:15.640000
2018-04-21T03:33:02
2018-04-21T03:33:02
130,436,459
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package listener; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class MyHttpSessionListener implements HttpSessionListener { @Override public void sessionCreated(HttpSessionEvent se) { // TODO Auto-generated method stub System.out.println("这是创建session`````````"+se.getSession().getId()); } @Override public void sessionDestroyed(HttpSessionEvent se) { // TODO Auto-generated method stub System.out.println("这是销毁session`````````"+se.getSession().getId()); } }
UTF-8
Java
546
java
MyHttpSessionListener.java
Java
[]
null
[]
package listener; import javax.servlet.http.HttpSessionEvent; import javax.servlet.http.HttpSessionListener; public class MyHttpSessionListener implements HttpSessionListener { @Override public void sessionCreated(HttpSessionEvent se) { // TODO Auto-generated method stub System.out.println("这是创建session`````````"+se.getSession().getId()); } @Override public void sessionDestroyed(HttpSessionEvent se) { // TODO Auto-generated method stub System.out.println("这是销毁session`````````"+se.getSession().getId()); } }
546
0.75283
0.75283
20
25.5
25.753641
69
false
false
0
0
0
0
0
0
0.95
false
false
3
ba7a16f9a3315054fe865121f17f8c22fa120990
18,674,517,811,222
847fcbf367f822f5f8e5ef79868b363007829ac9
/src/main/java/com/LMS/LMS/Classes/BLL/BLLClasses/UpdateProfile.java
9f390ae3c338d973e6aea33cd842fc7c1acb592c
[]
no_license
Ahmad-Mukhtar/LMS_in_Spring
https://github.com/Ahmad-Mukhtar/LMS_in_Spring
0f6489e3adbba4aa6cefc2c920f7c8ce7a191ac2
142342d8a1635a1b96820107e3ebabf58a6b78cb
refs/heads/master
2023-06-24T14:14:29.122000
2021-07-29T16:59:02
2021-07-29T16:59:02
380,453,211
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.LMS.LMS.Classes.BLL.BLLClasses; import com.LMS.LMS.Classes.BLL.Interfaces.IUpdateProfile; import java.sql.SQLException; public class UpdateProfile { private IUpdateProfile updateProfile; private String FirstName; private String LastName; //Getters and Setters public void setFirstName(String firstName) { FirstName = firstName; } public void setLastName(String lastName) { LastName = lastName; } public void setPassWord(String passWord) { PassWord = passWord; } public void setEmail(String email) { Email = email; } public void setDob(String dob) { Dob = dob; } private String PassWord; private String Email; private String Dob; public String getFirstName() { return FirstName; } public String getLastName() { return LastName; } public String getPassWord() { return PassWord; } public String getEmail() { return Email; } public String getDob() { return Dob; } //Get the Profile Info From DataBase public UpdateProfile() throws SQLException { updateProfile=DataAccessFactory.getProfileUpdateDal(); } //Update the Profile public Boolean updateProfile(String Firstname, String Lastname, String Password, String Email, String Dob,String username) throws SQLException { return updateProfile.updateProfile(Firstname,Lastname,Password,Email,Dob,username); } }
UTF-8
Java
1,512
java
UpdateProfile.java
Java
[]
null
[]
package com.LMS.LMS.Classes.BLL.BLLClasses; import com.LMS.LMS.Classes.BLL.Interfaces.IUpdateProfile; import java.sql.SQLException; public class UpdateProfile { private IUpdateProfile updateProfile; private String FirstName; private String LastName; //Getters and Setters public void setFirstName(String firstName) { FirstName = firstName; } public void setLastName(String lastName) { LastName = lastName; } public void setPassWord(String passWord) { PassWord = passWord; } public void setEmail(String email) { Email = email; } public void setDob(String dob) { Dob = dob; } private String PassWord; private String Email; private String Dob; public String getFirstName() { return FirstName; } public String getLastName() { return LastName; } public String getPassWord() { return PassWord; } public String getEmail() { return Email; } public String getDob() { return Dob; } //Get the Profile Info From DataBase public UpdateProfile() throws SQLException { updateProfile=DataAccessFactory.getProfileUpdateDal(); } //Update the Profile public Boolean updateProfile(String Firstname, String Lastname, String Password, String Email, String Dob,String username) throws SQLException { return updateProfile.updateProfile(Firstname,Lastname,Password,Email,Dob,username); } }
1,512
0.665344
0.665344
70
20.6
24.464201
148
false
false
0
0
0
0
0
0
0.442857
false
false
3
7379170fdb838dbfdf5c039e75887c1a1c6fba40
32,263,794,334,405
d66616a85d97c478d8de6df20bcc7e64e1798c05
/src/main/java/com/joseph/Jaspring/ListBasedDatabase.java
be96b1a40f480aafead387f3e0aaa6aba467a29a
[]
no_license
YousefEmadi/Java_on_Spring
https://github.com/YousefEmadi/Java_on_Spring
5b1b75c2bf2eeace836a5792651e5d393ae880ba
e3b55666ed5e8af2713a43e62e679363a1803e06
refs/heads/master
2023-04-09T16:46:32.578000
2021-04-21T03:50:45
2021-04-21T03:50:45
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.joseph.Jaspring; import java.util.ArrayList; import java.util.List; public class ListBasedDatabase implements CustomerDatabase{ private List<Customer> customerList; public ListBasedDatabase() { customerList = new ArrayList<Customer>(); } @Override public boolean save(Customer customer) { return customerList.add(customer); } @Override public Customer findCustomerById(int id) { try { for (Customer customer : customerList) { if (customer.id == id) { return customer; } } }catch (NullPointerException npe){ System.out.println("Your customer list is empty"); }catch (IndexOutOfBoundsException iobe){ System.out.println("This id does not exist in our database"); } return null; } @Override public boolean removeUserById(int id){ try { customerList.remove(customerList.indexOf(findCustomerById(id))); return true; } catch (Exception e){ System.out.println("oops! sth is wrong with your entered data !!!"); return false; } } /** Pst... Joseph, example of a method that is not part of the CustomerDatabase interface **/ public void myOtherMethod() { System.out.println("Another method for implemented class from an interface"); } }
UTF-8
Java
1,452
java
ListBasedDatabase.java
Java
[ { "context": "eturn false;\n }\n\n }\n\n /** Pst... Joseph, example of a method that is not part of the Cust", "end": 1247, "score": 0.9908813238143921, "start": 1241, "tag": "NAME", "value": "Joseph" } ]
null
[]
package com.joseph.Jaspring; import java.util.ArrayList; import java.util.List; public class ListBasedDatabase implements CustomerDatabase{ private List<Customer> customerList; public ListBasedDatabase() { customerList = new ArrayList<Customer>(); } @Override public boolean save(Customer customer) { return customerList.add(customer); } @Override public Customer findCustomerById(int id) { try { for (Customer customer : customerList) { if (customer.id == id) { return customer; } } }catch (NullPointerException npe){ System.out.println("Your customer list is empty"); }catch (IndexOutOfBoundsException iobe){ System.out.println("This id does not exist in our database"); } return null; } @Override public boolean removeUserById(int id){ try { customerList.remove(customerList.indexOf(findCustomerById(id))); return true; } catch (Exception e){ System.out.println("oops! sth is wrong with your entered data !!!"); return false; } } /** Pst... Joseph, example of a method that is not part of the CustomerDatabase interface **/ public void myOtherMethod() { System.out.println("Another method for implemented class from an interface"); } }
1,452
0.602617
0.602617
54
25.888889
25.449053
98
false
false
0
0
0
0
0
0
0.296296
false
false
3
4caa43065925a6463f04ece6e136c45f2299c8e5
10,651
628f07b5bea68c8b034cf490142aaeea1d58368e
/src/main/java/com/MultiSafepay/classes/Pickup.java
e4419fed4e3aa864933c9eb586f9b00f875e5ed6
[ "MIT" ]
permissive
AmazingDreams/MultiSafepay
https://github.com/AmazingDreams/MultiSafepay
7be8a085b29197c6a826d49fc7d45fc53bc152be
b67378bcd3db0196b8bba56384a56ad0ee07f3db
refs/heads/master
2021-08-31T22:54:43.585000
2017-12-23T08:08:26
2017-12-23T08:08:26
114,875,595
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.MultiSafepay.classes; public class Pickup { public String name = null; public String price = null; }
UTF-8
Java
120
java
Pickup.java
Java
[]
null
[]
package com.MultiSafepay.classes; public class Pickup { public String name = null; public String price = null; }
120
0.725
0.725
6
19
13.576941
33
false
false
0
0
0
0
0
0
1.166667
false
false
3
add3b870f2846bcfaa6838ad4001ac7dd27126f2
7,000,796,705,158
3192b7a984ed59da652221d11bc2bdfaa1aede00
/code/src/main/java/com/cmcu/mcc/finance/service/FiveFinanceInvoiceDetailService.java
c4dca4884e9781cd0f02a4d69363d9c3f0cb1088
[]
no_license
shanghaif/-wz-
https://github.com/shanghaif/-wz-
e6f5eca1511f6d68c0cd6eb3c0f118e340d9ff50
c7d6e8a000fbc4b6d8fed44cd5ffe483be45440c
refs/heads/main
2023-06-08T22:35:30.125000
2021-04-30T07:03:21
2021-04-30T07:03:21
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cmcu.mcc.finance.service; import com.cmcu.act.service.TaskHandleService; import com.cmcu.common.service.BaseService; import com.cmcu.common.service.CommonCodeService; import com.cmcu.common.util.BeanValidator; import com.cmcu.common.util.ModelUtil; import com.cmcu.common.util.NumberChangeUtils; import com.cmcu.mcc.act.service.MyActService; import com.cmcu.mcc.act.service.MyHistoryService; import com.cmcu.mcc.business.dao.BusinessCustomerMapper; import com.cmcu.mcc.business.dao.FiveBusinessContractLibraryMapper; import com.cmcu.mcc.business.dao.FiveBusinessContractLibrarySubpackageMapper; import com.cmcu.mcc.finance.dao.FiveFinanceInvoiceDetailMapper; import com.cmcu.mcc.finance.dto.FiveFinanceInvoiceDetailDto; import com.cmcu.mcc.finance.entity.FiveFinanceInvoiceDetail; import com.cmcu.mcc.hr.service.HrDeptService; import com.cmcu.mcc.hr.service.HrEmployeeService; import com.cmcu.mcc.hr.service.HrEmployeeSysService; import com.cmcu.mcc.hr.service.SelectEmployeeService; import com.cmcu.mcc.service.impl.HandleFormService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.Assert; import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @Service public class FiveFinanceInvoiceDetailService extends BaseService { @Resource FiveFinanceInvoiceDetailMapper fiveFinanceInvoiceDetailMapper; @Resource CommonCodeService commonCodeService; @Autowired HrEmployeeSysService hrEmployeeSysService; @Autowired SelectEmployeeService selectEmployeeService; @Autowired HrDeptService hrDeptService; @Autowired MyActService myActService; @Autowired MyHistoryService myHistoryService; @Autowired BusinessCustomerMapper businessCustomerMapper; @Autowired TaskHandleService taskHandleService; @Autowired HrEmployeeService hrEmployeeService; @Autowired FiveBusinessContractLibraryMapper fiveBusinessContractLibraryMapper; @Autowired FiveBusinessContractLibrarySubpackageMapper fiveBusinessContractLibrarySubpackageMapper; @Resource HandleFormService handleFormService; public void remove(int id, String userLogin) { FiveFinanceInvoiceDetail item = fiveFinanceInvoiceDetailMapper.selectByPrimaryKey(id); Assert.state(item.getCreator().equalsIgnoreCase(userLogin), "只允许创建人删除!"); handleFormService.removeProcessInstance(item.getBusinessKey(),userLogin); } public void update(FiveFinanceInvoiceDetailDto dto) { FiveFinanceInvoiceDetail item = fiveFinanceInvoiceDetailMapper.selectByPrimaryKey(dto.getId()); item.setRemark(dto.getRemark()); item.setGmtModified(new Date()); BeanValidator.check(item); fiveFinanceInvoiceDetailMapper.updateByPrimaryKey(item); } public FiveFinanceInvoiceDetailDto getModelById(int id) { return getDto(fiveFinanceInvoiceDetailMapper.selectByPrimaryKey(id)); } public int getNewModel(String userLogin,String uiSref) { FiveFinanceInvoiceDetail item = new FiveFinanceInvoiceDetail(); item.setCreator(userLogin); item.setCreatorName(hrEmployeeService.getModelByUserLogin(userLogin).getUserName()); item.setGmtCreate(new Date()); item.setGmtModified(new Date()); item.setDeleted(false); ModelUtil.setNotNullFields(item); fiveFinanceInvoiceDetailMapper.insert(item); return item.getId(); } public FiveFinanceInvoiceDetailDto getDto(Object item) { FiveFinanceInvoiceDetail model= (FiveFinanceInvoiceDetail) item; FiveFinanceInvoiceDetailDto dto=FiveFinanceInvoiceDetailDto.adapt(model); return dto; } public List<FiveFinanceInvoiceDetail> selectAll(String userLogin, String uiSref) { Map params=Maps.newHashMap(); params.put("deleted",false); List<Integer> deptIdList=hrEmployeeSysService.getMyDeptList(userLogin,uiSref); params.put("deptIdList",deptIdList); return fiveFinanceInvoiceDetailMapper.selectAll(params); } public PageInfo<Object> listPagedData(Map<String,Object> params, String userLogin, String uiSref,int pageNum, int pageSize) { params.put("deleted",false); //如果有数据权限判断数据权限 myDeptData true查看当前部门 false查看创建人 Map map =new HashMap(); map.put("myDeptData",true); map.put("uiSref",uiSref); map.put("enLogin",userLogin); params.putAll(getDefaultRightParams(map)); PageInfo<Object> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> fiveFinanceInvoiceDetailMapper.selectAll(params)); List<Object> list = Lists.newArrayList(); pageInfo.getList().forEach(p -> { FiveFinanceInvoiceDetail item=(FiveFinanceInvoiceDetail)p; list.add(getDto(item)); }); pageInfo.setList(list); return pageInfo; } /** * 收入金额转中文大写 * @param money * @return */ public String moneyTurnCapital(Double money){ return NumberChangeUtils.moneyToChinese(money*10000); } }
UTF-8
Java
5,457
java
FiveFinanceInvoiceDetailService.java
Java
[]
null
[]
package com.cmcu.mcc.finance.service; import com.cmcu.act.service.TaskHandleService; import com.cmcu.common.service.BaseService; import com.cmcu.common.service.CommonCodeService; import com.cmcu.common.util.BeanValidator; import com.cmcu.common.util.ModelUtil; import com.cmcu.common.util.NumberChangeUtils; import com.cmcu.mcc.act.service.MyActService; import com.cmcu.mcc.act.service.MyHistoryService; import com.cmcu.mcc.business.dao.BusinessCustomerMapper; import com.cmcu.mcc.business.dao.FiveBusinessContractLibraryMapper; import com.cmcu.mcc.business.dao.FiveBusinessContractLibrarySubpackageMapper; import com.cmcu.mcc.finance.dao.FiveFinanceInvoiceDetailMapper; import com.cmcu.mcc.finance.dto.FiveFinanceInvoiceDetailDto; import com.cmcu.mcc.finance.entity.FiveFinanceInvoiceDetail; import com.cmcu.mcc.hr.service.HrDeptService; import com.cmcu.mcc.hr.service.HrEmployeeService; import com.cmcu.mcc.hr.service.HrEmployeeSysService; import com.cmcu.mcc.hr.service.SelectEmployeeService; import com.cmcu.mcc.service.impl.HandleFormService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.Assert; import javax.annotation.Resource; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @Service public class FiveFinanceInvoiceDetailService extends BaseService { @Resource FiveFinanceInvoiceDetailMapper fiveFinanceInvoiceDetailMapper; @Resource CommonCodeService commonCodeService; @Autowired HrEmployeeSysService hrEmployeeSysService; @Autowired SelectEmployeeService selectEmployeeService; @Autowired HrDeptService hrDeptService; @Autowired MyActService myActService; @Autowired MyHistoryService myHistoryService; @Autowired BusinessCustomerMapper businessCustomerMapper; @Autowired TaskHandleService taskHandleService; @Autowired HrEmployeeService hrEmployeeService; @Autowired FiveBusinessContractLibraryMapper fiveBusinessContractLibraryMapper; @Autowired FiveBusinessContractLibrarySubpackageMapper fiveBusinessContractLibrarySubpackageMapper; @Resource HandleFormService handleFormService; public void remove(int id, String userLogin) { FiveFinanceInvoiceDetail item = fiveFinanceInvoiceDetailMapper.selectByPrimaryKey(id); Assert.state(item.getCreator().equalsIgnoreCase(userLogin), "只允许创建人删除!"); handleFormService.removeProcessInstance(item.getBusinessKey(),userLogin); } public void update(FiveFinanceInvoiceDetailDto dto) { FiveFinanceInvoiceDetail item = fiveFinanceInvoiceDetailMapper.selectByPrimaryKey(dto.getId()); item.setRemark(dto.getRemark()); item.setGmtModified(new Date()); BeanValidator.check(item); fiveFinanceInvoiceDetailMapper.updateByPrimaryKey(item); } public FiveFinanceInvoiceDetailDto getModelById(int id) { return getDto(fiveFinanceInvoiceDetailMapper.selectByPrimaryKey(id)); } public int getNewModel(String userLogin,String uiSref) { FiveFinanceInvoiceDetail item = new FiveFinanceInvoiceDetail(); item.setCreator(userLogin); item.setCreatorName(hrEmployeeService.getModelByUserLogin(userLogin).getUserName()); item.setGmtCreate(new Date()); item.setGmtModified(new Date()); item.setDeleted(false); ModelUtil.setNotNullFields(item); fiveFinanceInvoiceDetailMapper.insert(item); return item.getId(); } public FiveFinanceInvoiceDetailDto getDto(Object item) { FiveFinanceInvoiceDetail model= (FiveFinanceInvoiceDetail) item; FiveFinanceInvoiceDetailDto dto=FiveFinanceInvoiceDetailDto.adapt(model); return dto; } public List<FiveFinanceInvoiceDetail> selectAll(String userLogin, String uiSref) { Map params=Maps.newHashMap(); params.put("deleted",false); List<Integer> deptIdList=hrEmployeeSysService.getMyDeptList(userLogin,uiSref); params.put("deptIdList",deptIdList); return fiveFinanceInvoiceDetailMapper.selectAll(params); } public PageInfo<Object> listPagedData(Map<String,Object> params, String userLogin, String uiSref,int pageNum, int pageSize) { params.put("deleted",false); //如果有数据权限判断数据权限 myDeptData true查看当前部门 false查看创建人 Map map =new HashMap(); map.put("myDeptData",true); map.put("uiSref",uiSref); map.put("enLogin",userLogin); params.putAll(getDefaultRightParams(map)); PageInfo<Object> pageInfo = PageHelper.startPage(pageNum, pageSize).doSelectPageInfo(() -> fiveFinanceInvoiceDetailMapper.selectAll(params)); List<Object> list = Lists.newArrayList(); pageInfo.getList().forEach(p -> { FiveFinanceInvoiceDetail item=(FiveFinanceInvoiceDetail)p; list.add(getDto(item)); }); pageInfo.setList(list); return pageInfo; } /** * 收入金额转中文大写 * @param money * @return */ public String moneyTurnCapital(Double money){ return NumberChangeUtils.moneyToChinese(money*10000); } }
5,457
0.755163
0.754233
155
33.677418
28.868095
149
false
false
0
0
0
0
0
0
0.664516
false
false
3
fffd2877b08ae217add7e9135a4ff9a34dae326d
18,425,409,704,602
7b790bfab220e69a2f1897d1ae54f864814d1e51
/src/main/java/de/tlongo/dbc/Name.java
74e7e103846e37c1e43b130ea2f0c7777c8b92c9
[]
no_license
TomasLongo/dynamicbeancreation
https://github.com/TomasLongo/dynamicbeancreation
dc71c8e276bae13bc515fd77cfa24744ef014738
36ad651f1bece9768bb5da8f8f0721db14e7971a
refs/heads/master
2021-01-17T18:50:40.283000
2016-07-20T15:01:55
2016-07-20T15:01:55
63,789,240
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package de.tlongo.dbc; import javax.annotation.PostConstruct; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; /** * * This guy here should */ @RequestScoped public class Name { @Inject @GreetersName private String name; public String getName() { return this.name; } }
UTF-8
Java
335
java
Name.java
Java
[]
null
[]
package de.tlongo.dbc; import javax.annotation.PostConstruct; import javax.enterprise.context.RequestScoped; import javax.inject.Inject; /** * * This guy here should */ @RequestScoped public class Name { @Inject @GreetersName private String name; public String getName() { return this.name; } }
335
0.683582
0.683582
21
14.952381
13.321934
46
false
false
0
0
0
0
0
0
0.285714
false
false
3
a943a7fdc46a521277175448bebc74572f1a463b
23,055,384,491,932
ef50dc459e00616acfba6206ce2f574745ebe50a
/src/test/java/com/cesgroup/dongbixi/jpa/JpaApplicationTests.java
4e80a6ba1c501e24e8f00999901563396d0419de
[]
no_license
Codingdbx/jpa
https://github.com/Codingdbx/jpa
c7e76b95170f2093f536d29e81d52a46ba705562
70b2d90a5228699de14128454fd607b902046023
refs/heads/master
2020-04-16T12:45:28.086000
2019-04-19T14:50:57
2019-04-19T14:50:57
165,595,058
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.cesgroup.dongbixi.jpa; import com.cesgroup.dongbixi.jpa.bean.UserDO; import com.cesgroup.dongbixi.jpa.dao.UserDao; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.Sort; import org.springframework.test.context.junit4.SpringRunner; import java.util.List; import java.util.Optional; @RunWith(SpringRunner.class) @SpringBootTest public class JpaApplicationTests { @Autowired private UserDao userDao; @Test public void contextLoads() { } @Before public void before() { /*UserDO userDO = new UserDO(); userDO.setId(1L); userDO.setName("风清扬"); userDO.setAccount("fengqy"); userDO.setPwd("123456"); userDao.save(userDO); userDO = new UserDO(); userDO.setId(3L); userDO.setName("东方不败"); userDO.setAccount("bubai"); userDO.setPwd("123456"); userDao.save(userDO); userDO.setId(5L); userDO.setName("向问天"); userDO.setAccount("wentian"); userDO.setPwd("123456"); userDao.save(userDO);*/ } @Test public void testAdd() { UserDO userDO = new UserDO(); userDO.setId(2L); userDO.setName("任我行"); userDO.setAccount("renwox"); userDO.setPwd("123456"); userDao.save(userDO); userDO = new UserDO(); userDO.setId(4L); userDO.setName("令狐冲"); userDO.setAccount("linghuc"); userDO.setPwd("123456"); userDao.save(userDO); } @After public void after() { /*userDao.deleteById(1L); userDao.deleteById(3L); userDao.deleteById(5L);*/ } /** * 查询 */ @Test public void testLocate() { Optional<UserDO> userDOOptional = userDao.findById(1L); if (userDOOptional.isPresent()) { UserDO userDO = userDOOptional.get(); System.out.println("name = " + userDO.getName()); System.out.println("account = " + userDO.getAccount()); } } /** * 排序 */ @Test public void testFindAll() { List<UserDO> userDOList = userDao.findAll(new Sort(Sort.Direction.DESC,"account")); for (UserDO userDO : userDOList) { System.out.println("name = " + userDO.getName()); System.out.println("account = " + userDO.getAccount()); } } /** * 自定义查询 */ @Test public void testFindByAccount() { UserDO userDO = userDao.findByAccount("wentian"); if (userDO != null) { System.out.println("name = " + userDO.getName()); System.out.println("account = " + userDO.getAccount()); } } }
UTF-8
Java
2,541
java
JpaApplicationTests.java
Java
[ { "context": " UserDO();\n\n\t\tuserDO.setId(1L);\n\t\tuserDO.setName(\"风清扬\");\n\t\tuserDO.setAccount(\"fengqy\");\n\t\tuserDO.setPwd", "end": 785, "score": 0.880746603012085, "start": 782, "tag": "NAME", "value": "风清扬" }, { "context": ");\n\t\tuserDO.setName(\"风清扬\");\n\t\tuserDO.setAccount(\"fengqy\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(user", "end": 816, "score": 0.6535914540290833, "start": 811, "tag": "USERNAME", "value": "engqy" }, { "context": ";\n\t\tuserDO.setAccount(\"fengqy\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(userDO);\n\n\t\tuserDO = new UserDO", "end": 843, "score": 0.9993755221366882, "start": 837, "tag": "PASSWORD", "value": "123456" }, { "context": "w UserDO();\n\t\tuserDO.setId(3L);\n\t\tuserDO.setName(\"东方不败\");\n\t\tuserDO.setAccount(\"bubai\");\n\t\tuserDO.setPwd", "end": 938, "score": 0.5744801163673401, "start": 935, "tag": "NAME", "value": "东方不" }, { "context": "serDO();\n\t\tuserDO.setId(3L);\n\t\tuserDO.setName(\"东方不败\");\n\t\tuserDO.setAccount(\"bubai\");\n\t\tuserDO.setPwd(", "end": 939, "score": 0.49720510840415955, "start": 938, "tag": "USERNAME", "value": "败" }, { "context": ");\n\t\tuserDO.setAccount(\"bubai\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(userDO);\n\n\t\tuserDO.setId(5L);\n\t", "end": 996, "score": 0.9993886947631836, "start": 990, "tag": "PASSWORD", "value": "123456" }, { "context": "e(userDO);\n\n\t\tuserDO.setId(5L);\n\t\tuserDO.setName(\"向问天\");\n\t\tuserDO.setAccount(\"wentian\");\n\t\tuserDO.set", "end": 1064, "score": 0.5612386465072632, "start": 1063, "tag": "USERNAME", "value": "向" }, { "context": "(userDO);\n\n\t\tuserDO.setId(5L);\n\t\tuserDO.setName(\"向问天\");\n\t\tuserDO.setAccount(\"wentian\");\n\t\tuserDO.setPw", "end": 1066, "score": 0.5918469429016113, "start": 1064, "tag": "NAME", "value": "问天" }, { "context": ");\n\t\tuserDO.setName(\"向问天\");\n\t\tuserDO.setAccount(\"wentian\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(user", "end": 1098, "score": 0.8101410269737244, "start": 1092, "tag": "USERNAME", "value": "entian" }, { "context": "\n\t\tuserDO.setAccount(\"wentian\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(userDO);*/\n\t}\n\n\t@Test\n\tpublic v", "end": 1125, "score": 0.999396026134491, "start": 1119, "tag": "PASSWORD", "value": "123456" }, { "context": "w UserDO();\n\t\tuserDO.setId(2L);\n\t\tuserDO.setName(\"任我行\");\n\t\tuserDO.setAccount(\"renwox\");\n\t\tuserDO.setPwd", "end": 1265, "score": 0.7669466137886047, "start": 1262, "tag": "USERNAME", "value": "任我行" }, { "context": ";\n\t\tuserDO.setAccount(\"renwox\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(userDO);\n\n\t\tuserDO = new UserDO", "end": 1323, "score": 0.9994019865989685, "start": 1317, "tag": "PASSWORD", "value": "123456" }, { "context": "w UserDO();\n\t\tuserDO.setId(4L);\n\t\tuserDO.setName(\"令狐冲\");\n\t\tuserDO.setAccount(\"linghuc\");\n\t\tuserDO.setPw", "end": 1418, "score": 0.9887973070144653, "start": 1415, "tag": "USERNAME", "value": "令狐冲" }, { "context": "L);\n\t\tuserDO.setName(\"令狐冲\");\n\t\tuserDO.setAccount(\"linghuc\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(user", "end": 1450, "score": 0.7871553897857666, "start": 1443, "tag": "KEY", "value": "linghuc" }, { "context": "\n\t\tuserDO.setAccount(\"linghuc\");\n\t\tuserDO.setPwd(\"123456\");\n\t\tuserDao.save(userDO);\n\t}\n\n\t@After\n\tpublic vo", "end": 1477, "score": 0.9990527033805847, "start": 1471, "tag": "PASSWORD", "value": "123456" }, { "context": "ount() {\n\t\tUserDO userDO = userDao.findByAccount(\"wentian\");\n\t\tif (userDO != null) {\n\t\t\tSystem.out.println(", "end": 2339, "score": 0.9984145164489746, "start": 2332, "tag": "USERNAME", "value": "wentian" } ]
null
[]
package com.cesgroup.dongbixi.jpa; import com.cesgroup.dongbixi.jpa.bean.UserDO; import com.cesgroup.dongbixi.jpa.dao.UserDao; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.data.domain.Sort; import org.springframework.test.context.junit4.SpringRunner; import java.util.List; import java.util.Optional; @RunWith(SpringRunner.class) @SpringBootTest public class JpaApplicationTests { @Autowired private UserDao userDao; @Test public void contextLoads() { } @Before public void before() { /*UserDO userDO = new UserDO(); userDO.setId(1L); userDO.setName("风清扬"); userDO.setAccount("fengqy"); userDO.setPwd("<PASSWORD>"); userDao.save(userDO); userDO = new UserDO(); userDO.setId(3L); userDO.setName("东方不败"); userDO.setAccount("bubai"); userDO.setPwd("<PASSWORD>"); userDao.save(userDO); userDO.setId(5L); userDO.setName("向问天"); userDO.setAccount("wentian"); userDO.setPwd("<PASSWORD>"); userDao.save(userDO);*/ } @Test public void testAdd() { UserDO userDO = new UserDO(); userDO.setId(2L); userDO.setName("任我行"); userDO.setAccount("renwox"); userDO.setPwd("<PASSWORD>"); userDao.save(userDO); userDO = new UserDO(); userDO.setId(4L); userDO.setName("令狐冲"); userDO.setAccount("linghuc"); userDO.setPwd("<PASSWORD>"); userDao.save(userDO); } @After public void after() { /*userDao.deleteById(1L); userDao.deleteById(3L); userDao.deleteById(5L);*/ } /** * 查询 */ @Test public void testLocate() { Optional<UserDO> userDOOptional = userDao.findById(1L); if (userDOOptional.isPresent()) { UserDO userDO = userDOOptional.get(); System.out.println("name = " + userDO.getName()); System.out.println("account = " + userDO.getAccount()); } } /** * 排序 */ @Test public void testFindAll() { List<UserDO> userDOList = userDao.findAll(new Sort(Sort.Direction.DESC,"account")); for (UserDO userDO : userDOList) { System.out.println("name = " + userDO.getName()); System.out.println("account = " + userDO.getAccount()); } } /** * 自定义查询 */ @Test public void testFindByAccount() { UserDO userDO = userDao.findByAccount("wentian"); if (userDO != null) { System.out.println("name = " + userDO.getName()); System.out.println("account = " + userDO.getAccount()); } } }
2,561
0.690887
0.674829
115
20.652174
18.213728
85
false
false
0
0
0
0
0
0
1.669565
false
false
3
370b164784f71782f08e516a4ff3ca03df231e05
24,567,212,966,695
35e8d2a3c447293e8472d42e38b3f4ebd34c8bc8
/csc1301/lab 9/p3.java
990e3ffffe4e7513054d9a7dac6feae14a9da913
[]
no_license
hakancangunerli/gsu_code
https://github.com/hakancangunerli/gsu_code
4f906978ad2b2858324899fd5551ad4f8c9e2b03
5f7105be15dcfd0fdb57cc659349bcb190e5cc33
refs/heads/main
2023-05-28T11:50:06.101000
2021-05-26T04:17:52
2021-05-26T04:17:52
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
/* Hakan (John) Gunerli lab9 FR 3PM #002504797 */ import java.util.Scanner; public class p3 { public static void main(String[] args) { Scanner sc= new Scanner(System.in); System.out.print("initial number "); int numfirst=sc.nextInt(); System.out.print("final number "); int numsec=sc.nextInt(); System.out.print("increment number "); for (int numthird=sc.nextInt(); numfirst <= numsec;numfirst+=numthird) { /// if num1 is less than num2, add num3 to num1 and print the new num1 System.out.println(numfirst); } } }
UTF-8
Java
642
java
p3.java
Java
[ { "context": "/*\r\nHakan (John) Gunerli\r\nlab9 FR 3PM\r\n#002504797\r\n*/\r\nimpo", "end": 9, "score": 0.9997704029083252, "start": 4, "tag": "NAME", "value": "Hakan" }, { "context": "/*\r\nHakan (John) Gunerli\r\nlab9 FR 3PM\r\n#002504797\r\n*/\r\nimport java.util.Sc", "end": 24, "score": 0.9859601855278015, "start": 11, "tag": "NAME", "value": "John) Gunerli" } ]
null
[]
/* Hakan (<NAME> lab9 FR 3PM #002504797 */ import java.util.Scanner; public class p3 { public static void main(String[] args) { Scanner sc= new Scanner(System.in); System.out.print("initial number "); int numfirst=sc.nextInt(); System.out.print("final number "); int numsec=sc.nextInt(); System.out.print("increment number "); for (int numthird=sc.nextInt(); numfirst <= numsec;numfirst+=numthird) { /// if num1 is less than num2, add num3 to num1 and print the new num1 System.out.println(numfirst); } } }
635
0.579439
0.55296
25
23.76
31.554752
154
false
false
0
0
0
0
0
0
0.44
false
false
3
6dde98b4e3d396ed3fdb78c9fe9acf40292e4a5a
24,910,810,348,252
e8b341aafd7f81283aef3bb8d6bc3532993c38a8
/prc2/src/Main.java
3cfb4458bf0f31e69793c6241d268d55d869d35b
[]
no_license
uziless/Everything
https://github.com/uziless/Everything
c4ecc52e87241772d57c145e775f67302ed41d91
9064ba1113bba5a23d92b37703fb57d0b0e19b86
refs/heads/master
2022-12-28T21:03:49.166000
2020-10-18T15:01:05
2020-10-18T15:01:05
297,065,368
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
class Main { public static void main(String[] args) { Author author1 = new Author("Dmitriy", "dima@domain.url", 'M'); Author author2 = new Author("Egor", "egor@domain.url", 'M'); System.out.println(author1); System.out.println(); System.out.println(author2); } } // Output: /* Author: Name = Dmitriy Email = dima@domain.url Gender = M Author: Name = Egor Email = egor@domain.url Gender = M */
UTF-8
Java
451
java
Main.java
Java
[ { "context": " args)\n {\n Author author1 = new Author(\"Dmitriy\", \"dima@domain.url\", 'M');\n Author author2", "end": 107, "score": 0.9996562004089355, "start": 100, "tag": "NAME", "value": "Dmitriy" }, { "context": "{\n Author author1 = new Author(\"Dmitriy\", \"dima@domain.url\", 'M');\n Author author2 = new Author(\"Egor", "end": 126, "score": 0.9999181628227234, "start": 111, "tag": "EMAIL", "value": "dima@domain.url" }, { "context": ".url\", 'M');\n Author author2 = new Author(\"Egor\", \"egor@domain.url\", 'M');\n\n System.out.pr", "end": 176, "score": 0.9987097978591919, "start": 172, "tag": "NAME", "value": "Egor" }, { "context": "M');\n Author author2 = new Author(\"Egor\", \"egor@domain.url\", 'M');\n\n System.out.println(author1);\n ", "end": 195, "score": 0.9999139904975891, "start": 180, "tag": "EMAIL", "value": "egor@domain.url" }, { "context": "n(author2);\n }\n}\n\n// Output:\n\n/*\nAuthor:\nName = Dmitriy\nEmail = dima@domain.url\nGender = M\n\nAuthor:\nName ", "end": 355, "score": 0.999610424041748, "start": 348, "tag": "NAME", "value": "Dmitriy" }, { "context": "}\n}\n\n// Output:\n\n/*\nAuthor:\nName = Dmitriy\nEmail = dima@domain.url\nGender = M\n\nAuthor:\nName = Egor\nEmail = egor@doma", "end": 379, "score": 0.9999005198478699, "start": 364, "tag": "EMAIL", "value": "dima@domain.url" }, { "context": "Email = dima@domain.url\nGender = M\n\nAuthor:\nName = Egor\nEmail = egor@domain.url\nGender = M\n */\n", "end": 411, "score": 0.9994240403175354, "start": 407, "tag": "NAME", "value": "Egor" }, { "context": "domain.url\nGender = M\n\nAuthor:\nName = Egor\nEmail = egor@domain.url\nGender = M\n */\n", "end": 435, "score": 0.9999138712882996, "start": 420, "tag": "EMAIL", "value": "egor@domain.url" } ]
null
[]
class Main { public static void main(String[] args) { Author author1 = new Author("Dmitriy", "<EMAIL>", 'M'); Author author2 = new Author("Egor", "<EMAIL>", 'M'); System.out.println(author1); System.out.println(); System.out.println(author2); } } // Output: /* Author: Name = Dmitriy Email = <EMAIL> Gender = M Author: Name = Egor Email = <EMAIL> Gender = M */
419
0.600887
0.592018
26
16.307692
19.499052
71
false
false
0
0
0
0
0
0
0.346154
false
false
3
2e943c0ec2a47d9005814e7129ec947c293f1bad
24,910,810,347,102
4a159a7c7c21a9bb288af48eda368c2fde1c027e
/src/main/java/net/venturetech/event_api/support/ui/CustomCKEditorConfig.java
47d952023e9291286c51b3802ea3bc7b457b0319
[]
no_license
jpiperventuretech/event-api
https://github.com/jpiperventuretech/event-api
822cf5683642c69bd7b03255f8ea6a3ba72b5a83
8d7888a882ddbc656a75d1eaf7ae50c58f53dd92
refs/heads/master
2021-01-23T11:34:20.028000
2017-08-23T20:04:58
2017-08-23T20:04:58
102,629,821
0
0
null
true
2017-09-06T16:03:51
2017-09-06T16:03:51
2017-08-25T16:34:12
2017-09-06T16:03:12
1,617
0
0
0
null
null
null
/* * Copyright (c) Interactive Information R & D (I2RD) LLC. * All Rights Reserved. * * This software is confidential and proprietary information of * I2RD LLC ("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 I2RD. */ package net.venturetech.event_api.support.ui; import javax.annotation.Nonnull; /** * Rich editor config types. * * @author Alan Holt (aholt@venturetech.net) * @since 12/16/15 9:59 AM */ public enum CustomCKEditorConfig { /** Standard ck editor configuration */ standard("standard-custom.js"), /** Minimal ck editor configuration */ minimal("minimal-custom.js"); private final String _jsFile; CustomCKEditorConfig(@Nonnull String jsFile) { _jsFile = jsFile; } @Override public String toString() { return _jsFile; } }
UTF-8
Java
957
java
CustomCKEditorConfig.java
Java
[ { "context": "l;\n\n/**\n * Rich editor config types.\n *\n * @author Alan Holt (aholt@venturetech.net)\n * @since 12/16/15 9:59 A", "end": 503, "score": 0.9998877048492432, "start": 494, "tag": "NAME", "value": "Alan Holt" }, { "context": "ich editor config types.\n *\n * @author Alan Holt (aholt@venturetech.net)\n * @since 12/16/15 9:59 AM\n */\npublic enum Custo", "end": 526, "score": 0.9999310374259949, "start": 505, "tag": "EMAIL", "value": "aholt@venturetech.net" } ]
null
[]
/* * Copyright (c) Interactive Information R & D (I2RD) LLC. * All Rights Reserved. * * This software is confidential and proprietary information of * I2RD LLC ("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 I2RD. */ package net.venturetech.event_api.support.ui; import javax.annotation.Nonnull; /** * Rich editor config types. * * @author <NAME> (<EMAIL>) * @since 12/16/15 9:59 AM */ public enum CustomCKEditorConfig { /** Standard ck editor configuration */ standard("standard-custom.js"), /** Minimal ck editor configuration */ minimal("minimal-custom.js"); private final String _jsFile; CustomCKEditorConfig(@Nonnull String jsFile) { _jsFile = jsFile; } @Override public String toString() { return _jsFile; } }
940
0.684431
0.671891
42
21.785715
21.190222
65
false
false
0
0
0
0
0
0
0.166667
false
false
3
616ab23d301640c36467fc4482beaa3b9d291411
19,396,072,335,225
4af1fd02bf810742dd649df9561b85f0888a0bf3
/Monitores/Ejercicio2/GestorSala.java
e6437dcd349635ad79886b430e70f49850b719a0
[]
no_license
danteGiuliano/concurrente-2.0
https://github.com/danteGiuliano/concurrente-2.0
fbc2660b08d58b4944ab8b7764ad696875147639
e04665d14f96da24605cede8f183ea2dd309831a
refs/heads/master
2023-02-02T04:26:54.500000
2020-12-07T19:13:30
2020-12-07T19:13:30
310,342,307
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; public class GestorSala { private int cantidadPersonas; private int cantidadMaximaDePersonasPermitidas; private int temperaturaUmbral; private ReentrantLock mutex; private Condition temperatura; private Condition prioridadJubilado; private Condition esperaAtencion; public GestorSala(){ this.cantidadPersonas=0; this.cantidadMaximaDePersonasPermitidas=50; this.temperaturaUmbral=30; this.mutex=new ReentrantLock(); this.prioridadJubilado=mutex.newCondition(); this.esperaAtencion=mutex.newCondition(); this.temperatura=mutex.newCondition(); } public void entrarSala(boolean esJubilado)throws Exception{ this.mutex.lock(); this.puertaEntrada(); this.cantidadPersonas++; if(esJubilado){ this.prioridadJubilado.awaitNanos(1000);//Deberia liberar el lock otro hilo como por ejemplo personal. }else{ this.esperaAtencion.awaitNanos(4000); } this.mutex.unlock(); } public void salirSala()throws Exception{ this.mutex.lock(); this.cantidadPersonas--; this.temperatura.signal(); this.mutex.unlock(); } public void notificarTemperatura(int temperatura)throws Exception{ this.mutex.lock(); this.cantidadMaximaDePersonasPermitidas=(temperatura>this.temperaturaUmbral)?35:50; System.out.println("CANTIDAD MAXIMA -------------------------->"+this.cantidadMaximaDePersonasPermitidas); this.temperatura.signalAll(); //Correccion del 13-11. this.mutex.unlock(); } private void puertaEntrada()throws Exception{ if(this.cantidadPersonas>=this.cantidadMaximaDePersonasPermitidas){ this.temperatura.await(); } } }
UTF-8
Java
1,901
java
GestorSala.java
Java
[]
null
[]
import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; public class GestorSala { private int cantidadPersonas; private int cantidadMaximaDePersonasPermitidas; private int temperaturaUmbral; private ReentrantLock mutex; private Condition temperatura; private Condition prioridadJubilado; private Condition esperaAtencion; public GestorSala(){ this.cantidadPersonas=0; this.cantidadMaximaDePersonasPermitidas=50; this.temperaturaUmbral=30; this.mutex=new ReentrantLock(); this.prioridadJubilado=mutex.newCondition(); this.esperaAtencion=mutex.newCondition(); this.temperatura=mutex.newCondition(); } public void entrarSala(boolean esJubilado)throws Exception{ this.mutex.lock(); this.puertaEntrada(); this.cantidadPersonas++; if(esJubilado){ this.prioridadJubilado.awaitNanos(1000);//Deberia liberar el lock otro hilo como por ejemplo personal. }else{ this.esperaAtencion.awaitNanos(4000); } this.mutex.unlock(); } public void salirSala()throws Exception{ this.mutex.lock(); this.cantidadPersonas--; this.temperatura.signal(); this.mutex.unlock(); } public void notificarTemperatura(int temperatura)throws Exception{ this.mutex.lock(); this.cantidadMaximaDePersonasPermitidas=(temperatura>this.temperaturaUmbral)?35:50; System.out.println("CANTIDAD MAXIMA -------------------------->"+this.cantidadMaximaDePersonasPermitidas); this.temperatura.signalAll(); //Correccion del 13-11. this.mutex.unlock(); } private void puertaEntrada()throws Exception{ if(this.cantidadPersonas>=this.cantidadMaximaDePersonasPermitidas){ this.temperatura.await(); } } }
1,901
0.67596
0.664913
55
33.563637
26.001234
114
false
false
0
0
0
0
0
0
0.581818
false
false
3
62ccf199c9fdd3b6578a05e6720fcf40b3cbedfe
15,573,551,463,640
b071851b3c7add242c14e627c59c955de8a1b5c1
/aspti/src/main/java/com/railwayopt/model/mco/CriteriaComparator.java
3fa5dd1343de06370909b1722927238753b96261
[]
no_license
AuthorSkN/railwayopt
https://github.com/AuthorSkN/railwayopt
e2407af8ee80e5e33db333f6b00fbfed98e51153
e7e7493ede4a9393e3cba63806a8b14855ff2425
refs/heads/master
2020-03-18T09:01:52.913000
2018-09-24T04:10:16
2018-09-24T04:10:16
134,541,407
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.railwayopt.model.mco; import com.railwayopt.model.mco.unconditional.*; import java.util.*; public class CriteriaComparator implements Comparator<Optimizable>{ private class CycleCriteria implements Iterable<Criterion>{ private List<Criterion> criteria; private int idx = 0; private int initialIdx; public CycleCriteria(List<Criterion> criteria, Criterion initialCriterion){ this.criteria = new ArrayList<>(criteria); while(criteria.get(idx).getId() != initialCriterion.getId()){ idx++; } initialIdx = idx; } @Override public Iterator<Criterion> iterator() { return new Iterator<Criterion>() { private boolean isStart = true; @Override public boolean hasNext() { if(isStart) { isStart = false; return true; }else { return (idx != initialIdx); } } @Override public void remove() {} @Override public Criterion next() { Criterion criterion = criteria.get(idx); idx = ((idx + 1) == criteria.size())? 0 : idx + 1; return criterion; } }; } } private List<Criterion> criteria; /** * Конструктор * @param criteria критерии сравнения */ public CriteriaComparator(List<Criterion> criteria){ this.criteria = criteria; } /** * Выполняет абсолютное сравнение по всем критериям * @param o1 первый объект * @param o2 второй объект * @return 1 - если первый объект абсолютно больше, -1 - если первый объект абсолютно меньше, 0 если равны или несравнимы */ @Override public int compare(Optimizable o1, Optimizable o2) { int criteriaSize = criteria.size(); Map<Criterion, Double> objCriteriaVals1 = o1.parametersMapping(criteria); Map<Criterion, Double> objCriteriaVals2 = o2.parametersMapping(criteria); int moreCount = 0, lessCount = 0, equalsCount = 0; for(Criterion criteria: criteria){ if(objCriteriaVals1.get(criteria) > objCriteriaVals2.get(criteria)){ moreCount++; } else if(objCriteriaVals1.get(criteria) < objCriteriaVals2.get(criteria)){ lessCount++; } else { equalsCount++; } } if (((moreCount+equalsCount) == criteriaSize)&&(moreCount > 0)) return 1; if (((lessCount+equalsCount) == criteriaSize)&&(lessCount > 0)) return -1; return 0; } /** * Определяет, является ли второй объект абсолютно хуже первого * @param object базовый объект * @param compareObject сравниваемый объект * @return true - если второй объект безусловно хуже первого */ public boolean definitelyWorse(Optimizable object, Optimizable compareObject){ return (compare(compareObject, object) < 0); } /** * Сравнивает объекты по конкетному критерию * @param o1 первый объект * @param o2 второй объект * @param compareCriterion критерий сравнения * @return 1 - если первый объект больше второго по критерию, -1 - если первый объект меньше второго по критерию, 0 - если абсолютно равны */ public int compareByCriterion(Optimizable o1, Optimizable o2, Criterion compareCriterion){ int result = 0; Map<Criterion, Double> objCriteriaVals1 = o1.parametersMapping(criteria); Map<Criterion, Double> objCriteriaVals2 = o2.parametersMapping(criteria); boolean hasTheBest = false; Iterator<Criterion> criteriaIterator = (new CycleCriteria(criteria, compareCriterion)).iterator(); while(criteriaIterator.hasNext() && !hasTheBest){ Criterion criterion = criteriaIterator.next(); if(objCriteriaVals1.get(criterion) > objCriteriaVals2.get(criterion)){ hasTheBest = true; result = 1; }else if (objCriteriaVals1.get(criterion) < objCriteriaVals2.get(criterion)){ hasTheBest = true; result = -1; } } return result; } }
UTF-8
Java
4,878
java
CriteriaComparator.java
Java
[]
null
[]
package com.railwayopt.model.mco; import com.railwayopt.model.mco.unconditional.*; import java.util.*; public class CriteriaComparator implements Comparator<Optimizable>{ private class CycleCriteria implements Iterable<Criterion>{ private List<Criterion> criteria; private int idx = 0; private int initialIdx; public CycleCriteria(List<Criterion> criteria, Criterion initialCriterion){ this.criteria = new ArrayList<>(criteria); while(criteria.get(idx).getId() != initialCriterion.getId()){ idx++; } initialIdx = idx; } @Override public Iterator<Criterion> iterator() { return new Iterator<Criterion>() { private boolean isStart = true; @Override public boolean hasNext() { if(isStart) { isStart = false; return true; }else { return (idx != initialIdx); } } @Override public void remove() {} @Override public Criterion next() { Criterion criterion = criteria.get(idx); idx = ((idx + 1) == criteria.size())? 0 : idx + 1; return criterion; } }; } } private List<Criterion> criteria; /** * Конструктор * @param criteria критерии сравнения */ public CriteriaComparator(List<Criterion> criteria){ this.criteria = criteria; } /** * Выполняет абсолютное сравнение по всем критериям * @param o1 первый объект * @param o2 второй объект * @return 1 - если первый объект абсолютно больше, -1 - если первый объект абсолютно меньше, 0 если равны или несравнимы */ @Override public int compare(Optimizable o1, Optimizable o2) { int criteriaSize = criteria.size(); Map<Criterion, Double> objCriteriaVals1 = o1.parametersMapping(criteria); Map<Criterion, Double> objCriteriaVals2 = o2.parametersMapping(criteria); int moreCount = 0, lessCount = 0, equalsCount = 0; for(Criterion criteria: criteria){ if(objCriteriaVals1.get(criteria) > objCriteriaVals2.get(criteria)){ moreCount++; } else if(objCriteriaVals1.get(criteria) < objCriteriaVals2.get(criteria)){ lessCount++; } else { equalsCount++; } } if (((moreCount+equalsCount) == criteriaSize)&&(moreCount > 0)) return 1; if (((lessCount+equalsCount) == criteriaSize)&&(lessCount > 0)) return -1; return 0; } /** * Определяет, является ли второй объект абсолютно хуже первого * @param object базовый объект * @param compareObject сравниваемый объект * @return true - если второй объект безусловно хуже первого */ public boolean definitelyWorse(Optimizable object, Optimizable compareObject){ return (compare(compareObject, object) < 0); } /** * Сравнивает объекты по конкетному критерию * @param o1 первый объект * @param o2 второй объект * @param compareCriterion критерий сравнения * @return 1 - если первый объект больше второго по критерию, -1 - если первый объект меньше второго по критерию, 0 - если абсолютно равны */ public int compareByCriterion(Optimizable o1, Optimizable o2, Criterion compareCriterion){ int result = 0; Map<Criterion, Double> objCriteriaVals1 = o1.parametersMapping(criteria); Map<Criterion, Double> objCriteriaVals2 = o2.parametersMapping(criteria); boolean hasTheBest = false; Iterator<Criterion> criteriaIterator = (new CycleCriteria(criteria, compareCriterion)).iterator(); while(criteriaIterator.hasNext() && !hasTheBest){ Criterion criterion = criteriaIterator.next(); if(objCriteriaVals1.get(criterion) > objCriteriaVals2.get(criterion)){ hasTheBest = true; result = 1; }else if (objCriteriaVals1.get(criterion) < objCriteriaVals2.get(criterion)){ hasTheBest = true; result = -1; } } return result; } }
4,878
0.585244
0.574801
129
33.147285
29.805859
142
false
false
0
0
0
0
0
0
0.457364
false
false
3
e0fe05a94c8c72c908396747528d92e236db936d
26,671,746,932,343
f878b10d7cdb48eeb504f904bed017b0507968e3
/src/main/java/com/umbrella/worker/dao/WSupplierWorkerMapper.java
ad6275af87a35a4eb6b80138fdb643880f778488
[]
no_license
reaganjava/worker
https://github.com/reaganjava/worker
ba8f441dd2aa260c3f6a6388653a44f797c213bc
2bb6a48abbf2e087ca913acebec919ce0683035f
refs/heads/master
2020-05-21T18:09:54.601000
2017-03-29T05:31:59
2017-03-29T05:31:59
64,297,892
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.umbrella.worker.dao; import com.umbrella.worker.entity.WSupplierWorker; import com.umbrella.worker.entity.WSupplierWorkerExample; import java.util.List; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @Repository public interface WSupplierWorkerMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int countByExample(WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int deleteByExample(WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int deleteByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int insert(WSupplierWorker record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int insertSelective(WSupplierWorker record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ List<WSupplierWorker> selectByExample(WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ WSupplierWorker selectByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByExampleSelective(@Param("record") WSupplierWorker record, @Param("example") WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByExample(@Param("record") WSupplierWorker record, @Param("example") WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByPrimaryKeySelective(WSupplierWorker record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByPrimaryKey(WSupplierWorker record); }
UTF-8
Java
3,236
java
WSupplierWorkerMapper.java
Java
[]
null
[]
package com.umbrella.worker.dao; import com.umbrella.worker.entity.WSupplierWorker; import com.umbrella.worker.entity.WSupplierWorkerExample; import java.util.List; import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Repository; @Repository public interface WSupplierWorkerMapper { /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int countByExample(WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int deleteByExample(WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int deleteByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int insert(WSupplierWorker record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int insertSelective(WSupplierWorker record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ List<WSupplierWorker> selectByExample(WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ WSupplierWorker selectByPrimaryKey(Integer id); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByExampleSelective(@Param("record") WSupplierWorker record, @Param("example") WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByExample(@Param("record") WSupplierWorker record, @Param("example") WSupplierWorkerExample example); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByPrimaryKeySelective(WSupplierWorker record); /** * This method was generated by MyBatis Generator. * This method corresponds to the database table w_supplier_worker * * @mbggenerated Fri Aug 12 13:52:58 CST 2016 */ int updateByPrimaryKey(WSupplierWorker record); }
3,236
0.693758
0.652967
97
32.371136
28.687912
124
false
false
0
0
0
0
0
0
0.195876
false
false
3
bac9be75c31d2e3c2e601383f1cacde625bd24dd
5,463,198,443,764
1e1fea9851522501222f328883bed0bd2e160686
/Purchases/src/main/java/ar/edu/unp/madryn/livremarket/purchases/utils/LocalDefinitions.java
aec78fb2fa474447e3c98a025e1ce5b0612ec835
[]
no_license
Lucas2993/SD-Laboratorio-LucasAbella
https://github.com/Lucas2993/SD-Laboratorio-LucasAbella
348a4dafa5f8301f11e37fc62d79c154591eaf18
61ca1085e6efdf24580696195ee6e9aff0975da7
refs/heads/master
2020-09-12T23:16:12.236000
2019-11-22T19:03:12
2019-11-22T19:03:12
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package ar.edu.unp.madryn.livremarket.purchases.utils; public class LocalDefinitions { public static String PRODUCT_RESERVATION_REQUESTED_FIELD = "product_reservation_requested"; public static String INFRACTIONS_REQUESTED_FIELD = "infractions_requested"; public static String SHIPPING_SCHEDULE_REQUESTED_FIELD = "shipping_requested_requested"; }
UTF-8
Java
359
java
LocalDefinitions.java
Java
[]
null
[]
package ar.edu.unp.madryn.livremarket.purchases.utils; public class LocalDefinitions { public static String PRODUCT_RESERVATION_REQUESTED_FIELD = "product_reservation_requested"; public static String INFRACTIONS_REQUESTED_FIELD = "infractions_requested"; public static String SHIPPING_SCHEDULE_REQUESTED_FIELD = "shipping_requested_requested"; }
359
0.799443
0.799443
7
50.285713
37.621098
95
false
false
0
0
0
0
0
0
0.571429
false
false
3
7f361a9289088aacf448ab6963ea6d71c8218ecd
17,935,783,492,783
20178a3821f3e3b9aa0653648d5c10fb4699fc3b
/src/main/java/com/crossover/trial/weather/data/DataPointType.java
0a12635ea97be39e6bc8d1c51eee2835a9403cb3
[]
no_license
AnotherSava/weather
https://github.com/AnotherSava/weather
a460d7a81094878241a244720cd273b81cee4633
fc0fb112f2f6259b96a937d7b76654ab611e9da0
refs/heads/master
2021-01-22T11:27:38.827000
2017-05-29T01:04:17
2017-05-29T01:04:17
92,695,714
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.crossover.trial.weather.data; /** * The various types of data points we can collect. * * @author code test administrator */ public enum DataPointType { WIND, TEMPERATURE, HUMIDITY, PRESSURE, CLOUDCOVER, PRECIPITATION }
UTF-8
Java
242
java
DataPointType.java
Java
[ { "context": "types of data points we can collect.\n *\n * @author code test administrator\n */\npublic enum DataPointType\n{\n\tWIND,\n\tTEMPERATU", "end": 136, "score": 0.8394775390625, "start": 113, "tag": "USERNAME", "value": "code test administrator" } ]
null
[]
package com.crossover.trial.weather.data; /** * The various types of data points we can collect. * * @author code test administrator */ public enum DataPointType { WIND, TEMPERATURE, HUMIDITY, PRESSURE, CLOUDCOVER, PRECIPITATION }
242
0.735537
0.735537
16
14.125
15.082585
51
false
false
0
0
0
0
0
0
0.75
false
false
3
9501fd7406a87933d3c28e0104a569e716f30dc2
1,692,217,136,389
8082a93555ab885b1afe6440379864849899263b
/lucky-noxml/src/main/java/com/lucky/jacklamb/rest/Attr.java
7e11d87e5928c01d908a756811198880dfeec20c
[ "WTFPL" ]
permissive
FK7075/lucky-noxml
https://github.com/FK7075/lucky-noxml
4a58f1a16e24a9ebdc405a20de141ace1d77241f
9f2f479d88732c92bb16f4194759c5fd39eb6464
refs/heads/master
2022-06-17T11:04:44.389000
2020-11-20T09:26:37
2020-11-20T09:26:37
251,662,939
3
1
WTFPL
false
2022-05-20T21:56:13
2020-03-31T16:25:40
2022-03-24T14:58:47
2022-05-20T21:56:12
53,030
1
1
10
Java
false
false
package com.lucky.jacklamb.rest; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * 用于配置Json和Xml映射名 * @author fk-7075 * */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Attr { /** * 配置Json或Xml映射名 * @return */ String value() default ""; }
UTF-8
Java
487
java
Attr.java
Java
[ { "context": "otation.Target;\n\n/**\n * 用于配置Json和Xml映射名\n * @author fk-7075\n *\n */\n@Target(ElementType.FIELD)\n@Retention(Rete", "end": 277, "score": 0.999509334564209, "start": 270, "tag": "USERNAME", "value": "fk-7075" } ]
null
[]
package com.lucky.jacklamb.rest; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** * 用于配置Json和Xml映射名 * @author fk-7075 * */ @Target(ElementType.FIELD) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface Attr { /** * 配置Json或Xml映射名 * @return */ String value() default ""; }
487
0.749455
0.740741
25
17.360001
15.043616
44
false
false
0
0
0
0
0
0
0.56
false
false
3
cb0f17e73c4b2d8c9b5b508f3479affebc35006a
32,822,140,121,511
150b5b82d449825687871d4a62d2d93e65fba367
/src/com/class11/ForEachLoop.java
14bfdcf2c66179de43ae81bef3d79afd32caba8e
[]
no_license
DenisIvancioglo/First-code-commit
https://github.com/DenisIvancioglo/First-code-commit
1d168c45c2aa7785467473694dcf9327776a8e52
0bf808cb355e54abd4599cce68fe652dc443a8bb
refs/heads/master
2020-05-03T00:16:56.262000
2020-04-01T14:50:48
2020-04-01T14:50:48
178,305,330
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.class11; public class ForEachLoop { public static void main(String[] args) { // TODO Auto-generated method stub int[] numbers= {11,12,13,14}; for(int num:numbers) { System.out.print(num+" "); } String[] cars= {"Civic", "Honda", "EX","Ford", "Explorer","Jeep"}; for(String brands:cars) { System.out.println(brands); }for(int i=0; i<cars.length; i++) { System.out.println(cars[i]); } } }
UTF-8
Java
436
java
ForEachLoop.java
Java
[]
null
[]
package com.class11; public class ForEachLoop { public static void main(String[] args) { // TODO Auto-generated method stub int[] numbers= {11,12,13,14}; for(int num:numbers) { System.out.print(num+" "); } String[] cars= {"Civic", "Honda", "EX","Ford", "Explorer","Jeep"}; for(String brands:cars) { System.out.println(brands); }for(int i=0; i<cars.length; i++) { System.out.println(cars[i]); } } }
436
0.612385
0.587156
22
18.818182
18.164991
68
false
false
0
0
0
0
0
0
2.181818
false
false
3
5314f631c3c29a89c72de6f2a7c1af9c363a116d
33,208,687,162,389
d02c02e0dc181030f3728c319e439f9db724b69c
/Game bases/src/com/main/Game.java
64593f4822aa86cd272a8425a20ae1cd6b9dd561
[]
no_license
Niorb/Jeux-2
https://github.com/Niorb/Jeux-2
dba6738a88f8acc63431f3d2ee21240686f65369
401fdd23f8d9fa4dac2b2f82bcdb5f8e3699f55b
refs/heads/master
2020-12-20T10:38:05.416000
2020-02-08T13:54:40
2020-02-08T13:54:40
236,044,866
2
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.main; import java.awt.Canvas; import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Random; import javax.imageio.ImageIO; public class Game extends Canvas implements Runnable{ private static final long serialVersionUID = 4088146271165387233L; public static final int WIDTH = 640, HEIGHT= WIDTH /12*9; private Thread thread; private Handler handler; private HUD hud; private Menus menus; private int i = 0; private Spawner spawner; private Random r; private boolean running = false; enum STATE { Game, Pause, Help, Shop, Menu; } public static STATE gameState = STATE.Menu; public static STATE getGameState() { return gameState; } public static void setGameState(STATE gameState) { Game.gameState = gameState; } public static BufferedImage sprite_sheet; public Game() { handler= new Handler(); menus = new Menus(handler); hud = new HUD(); spawner = new Spawner(handler, hud); this.addMouseListener(menus); this.addKeyListener(new KeyInput(handler) ); //AudioPlayer.load(); new Window(WIDTH, HEIGHT, "Let's build a Game !", this); BufferedImageLoader loader = new BufferedImageLoader(); sprite_sheet=loader.loadImage("/sprite_sheet.png"); System.out.println("Done"); r = new Random(); } private void tick() { if(gameState==STATE.Game) { hud.tick(); spawner.tick(); handler.tick(); }else if(gameState==STATE.Menu||gameState==STATE.Help) { handler.tick(); try { for(;i<15;i++) { handler.addObject(new MenuParticle(r.nextInt(Game.WIDTH),r.nextInt(Game.HEIGHT), ID.MenuParticle, handler)); } } catch (Exception e) { // TODO: handle exception }menus.tick(); }else { i=0; menus.tick(); } } private void render() { BufferStrategy bs = this.getBufferStrategy(); if(bs==null) { this.createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics(); g.setColor(Color.black); g.fillRect(0,0, WIDTH,HEIGHT); handler.render(g); if(gameState==STATE.Game) { hud.render(g); } else { menus.render(g); } g.dispose(); bs.show(); } public static float limits(float var, int max, int min) { if(var<=min) return min; else if(var>= max) return max; else return var; } public static void main(String[] args) { new Game(); } public synchronized void start() { thread = new Thread(this); thread.start(); running=true; } public synchronized void stop() { try { thread.join(); running=false; } catch (Exception e) { e.printStackTrace(); } } @Override public void run() { this.requestFocus(); long lastTime= System.nanoTime(); double amountOfTicks = 60.0; double ns = 1000000000 / amountOfTicks; double delta = 0; long timer = System.currentTimeMillis(); int frames = 0; while(running) { long now = System.nanoTime(); delta+= ( now-lastTime)/ns; lastTime=now; while(delta>=1) { tick(); delta--; } if(running) render(); frames++; if(System.currentTimeMillis()-timer > 1000) { timer+=1000; System.out.println("FPS: " + frames); frames = 0; } } } }
UTF-8
Java
3,478
java
Game.java
Java
[]
null
[]
package com.main; import java.awt.Canvas; import java.awt.Color; import java.awt.Graphics; import java.awt.image.BufferStrategy; import java.awt.image.BufferedImage; import java.io.IOException; import java.util.Random; import javax.imageio.ImageIO; public class Game extends Canvas implements Runnable{ private static final long serialVersionUID = 4088146271165387233L; public static final int WIDTH = 640, HEIGHT= WIDTH /12*9; private Thread thread; private Handler handler; private HUD hud; private Menus menus; private int i = 0; private Spawner spawner; private Random r; private boolean running = false; enum STATE { Game, Pause, Help, Shop, Menu; } public static STATE gameState = STATE.Menu; public static STATE getGameState() { return gameState; } public static void setGameState(STATE gameState) { Game.gameState = gameState; } public static BufferedImage sprite_sheet; public Game() { handler= new Handler(); menus = new Menus(handler); hud = new HUD(); spawner = new Spawner(handler, hud); this.addMouseListener(menus); this.addKeyListener(new KeyInput(handler) ); //AudioPlayer.load(); new Window(WIDTH, HEIGHT, "Let's build a Game !", this); BufferedImageLoader loader = new BufferedImageLoader(); sprite_sheet=loader.loadImage("/sprite_sheet.png"); System.out.println("Done"); r = new Random(); } private void tick() { if(gameState==STATE.Game) { hud.tick(); spawner.tick(); handler.tick(); }else if(gameState==STATE.Menu||gameState==STATE.Help) { handler.tick(); try { for(;i<15;i++) { handler.addObject(new MenuParticle(r.nextInt(Game.WIDTH),r.nextInt(Game.HEIGHT), ID.MenuParticle, handler)); } } catch (Exception e) { // TODO: handle exception }menus.tick(); }else { i=0; menus.tick(); } } private void render() { BufferStrategy bs = this.getBufferStrategy(); if(bs==null) { this.createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics(); g.setColor(Color.black); g.fillRect(0,0, WIDTH,HEIGHT); handler.render(g); if(gameState==STATE.Game) { hud.render(g); } else { menus.render(g); } g.dispose(); bs.show(); } public static float limits(float var, int max, int min) { if(var<=min) return min; else if(var>= max) return max; else return var; } public static void main(String[] args) { new Game(); } public synchronized void start() { thread = new Thread(this); thread.start(); running=true; } public synchronized void stop() { try { thread.join(); running=false; } catch (Exception e) { e.printStackTrace(); } } @Override public void run() { this.requestFocus(); long lastTime= System.nanoTime(); double amountOfTicks = 60.0; double ns = 1000000000 / amountOfTicks; double delta = 0; long timer = System.currentTimeMillis(); int frames = 0; while(running) { long now = System.nanoTime(); delta+= ( now-lastTime)/ns; lastTime=now; while(delta>=1) { tick(); delta--; } if(running) render(); frames++; if(System.currentTimeMillis()-timer > 1000) { timer+=1000; System.out.println("FPS: " + frames); frames = 0; } } } }
3,478
0.618171
0.601783
181
17.215469
16.908037
112
false
false
0
0
0
0
0
0
2.353591
false
false
3
05501ffded83fe792202e0b534807354691ce641
22,832,046,190,597
539520ead314d179bfb29f3dc354a53a10d0cca1
/mutator/src/main/java/com/fteotini/Xavier/mutator/Visitors/ForMethod.java
951f57e2c10ceebc28b99646ef4f458124c5cf7a
[]
no_license
Fed03/xavier-fit
https://github.com/Fed03/xavier-fit
b971313fdfffa3a05bc767b496aff79f0af6fc03
dbe607546dec890ed18d81e8b7335e712bbb65df
refs/heads/master
2022-11-20T01:01:01.519000
2021-12-14T22:22:01
2021-12-14T22:22:01
206,094,320
0
1
null
false
2022-11-15T23:51:37
2019-09-03T14:14:05
2021-12-14T22:22:04
2022-11-15T23:51:37
293
0
1
4
Java
false
false
package com.fteotini.Xavier.mutator.Visitors; import com.fteotini.Xavier.mutator.Visitors.AnnotationVisitors.AnnotationVisitorWrapper; import net.bytebuddy.description.field.FieldDescription; import net.bytebuddy.description.field.FieldList; import net.bytebuddy.description.method.MethodDescription; import net.bytebuddy.description.method.MethodList; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.implementation.Implementation; import net.bytebuddy.jar.asm.AnnotationVisitor; import net.bytebuddy.jar.asm.ClassVisitor; import net.bytebuddy.jar.asm.MethodVisitor; import net.bytebuddy.matcher.ElementMatcher; import net.bytebuddy.pool.TypePool; import static net.bytebuddy.matcher.ElementMatchers.*; public class ForMethod extends BaseClassVisitorWrapper { private final ElementMatcher<? super MethodDescription> matcher; public ForMethod(AnnotationVisitorWrapper annotationVisitorWrapper, ElementMatcher<? super MethodDescription> matcher) { super(annotationVisitorWrapper); this.matcher = matcher; } @Override public ClassVisitor wrap(TypeDescription instrumentedType, ClassVisitor classVisitor, Implementation.Context implementationContext, TypePool typePool, FieldList<FieldDescription.InDefinedShape> fields, MethodList<?> methods, int writerFlags, int readerFlags) { return new DispatchingVisitor(classVisitor, methods); } private class DispatchingVisitor extends ClassVisitor { private final MethodList<?> methods; DispatchingVisitor(ClassVisitor classVisitor, MethodList<?> methods) { super(AsmConfig.ASM_VERSION, classVisitor); this.methods = methods; } @SuppressWarnings("DuplicatedCode") @Override public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { var visitor = super.visitMethod(access, name, descriptor, signature, exceptions); var currentMethod = getCurrentVisitedMethod(name, descriptor); if (visitor != null && matcher.matches(currentMethod)) { visitor = new MethodVisitor(AsmConfig.ASM_VERSION, visitor) { @Override public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { return annotationVisitorWrapper.wrap(() -> super.visitAnnotation(descriptor, visible), descriptor, visible); } }; } return visitor; } private MethodDescription getCurrentVisitedMethod(String name, String descriptor) { MethodList<?> filtered; if (name.equals("<init>")) { filtered = methods.filter(isConstructor().and(hasDescriptor(descriptor))); } else { filtered = methods.filter(named(name).and(hasDescriptor(descriptor))); } return filtered.getOnly(); } } }
UTF-8
Java
3,005
java
ForMethod.java
Java
[]
null
[]
package com.fteotini.Xavier.mutator.Visitors; import com.fteotini.Xavier.mutator.Visitors.AnnotationVisitors.AnnotationVisitorWrapper; import net.bytebuddy.description.field.FieldDescription; import net.bytebuddy.description.field.FieldList; import net.bytebuddy.description.method.MethodDescription; import net.bytebuddy.description.method.MethodList; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.implementation.Implementation; import net.bytebuddy.jar.asm.AnnotationVisitor; import net.bytebuddy.jar.asm.ClassVisitor; import net.bytebuddy.jar.asm.MethodVisitor; import net.bytebuddy.matcher.ElementMatcher; import net.bytebuddy.pool.TypePool; import static net.bytebuddy.matcher.ElementMatchers.*; public class ForMethod extends BaseClassVisitorWrapper { private final ElementMatcher<? super MethodDescription> matcher; public ForMethod(AnnotationVisitorWrapper annotationVisitorWrapper, ElementMatcher<? super MethodDescription> matcher) { super(annotationVisitorWrapper); this.matcher = matcher; } @Override public ClassVisitor wrap(TypeDescription instrumentedType, ClassVisitor classVisitor, Implementation.Context implementationContext, TypePool typePool, FieldList<FieldDescription.InDefinedShape> fields, MethodList<?> methods, int writerFlags, int readerFlags) { return new DispatchingVisitor(classVisitor, methods); } private class DispatchingVisitor extends ClassVisitor { private final MethodList<?> methods; DispatchingVisitor(ClassVisitor classVisitor, MethodList<?> methods) { super(AsmConfig.ASM_VERSION, classVisitor); this.methods = methods; } @SuppressWarnings("DuplicatedCode") @Override public MethodVisitor visitMethod(int access, String name, String descriptor, String signature, String[] exceptions) { var visitor = super.visitMethod(access, name, descriptor, signature, exceptions); var currentMethod = getCurrentVisitedMethod(name, descriptor); if (visitor != null && matcher.matches(currentMethod)) { visitor = new MethodVisitor(AsmConfig.ASM_VERSION, visitor) { @Override public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { return annotationVisitorWrapper.wrap(() -> super.visitAnnotation(descriptor, visible), descriptor, visible); } }; } return visitor; } private MethodDescription getCurrentVisitedMethod(String name, String descriptor) { MethodList<?> filtered; if (name.equals("<init>")) { filtered = methods.filter(isConstructor().and(hasDescriptor(descriptor))); } else { filtered = methods.filter(named(name).and(hasDescriptor(descriptor))); } return filtered.getOnly(); } } }
3,005
0.707488
0.707488
69
42.550724
43.355469
264
false
false
0
0
0
0
0
0
0.811594
false
false
3
38c49026ff63aebb7b2cbe4fc58ddea857c6f508
22,694,607,229,846
58aebfa21b81a038a2c65c409ea5d0c5bcd9b87a
/EV3/TrabajoFINAL/src/main/Main.java
4015c8955b52255885649f709d60dc0401bf0ea4
[]
no_license
chemecador/Programacion1
https://github.com/chemecador/Programacion1
7c6b01b43bb1625779b89bbc56432b88e281f46e
5c9b5e63d20716292e129d21bd54948c1e0c9243
refs/heads/master
2023-05-06T00:23:08.102000
2021-05-27T08:01:52
2021-05-27T08:01:52
367,123,658
0
1
null
null
null
null
null
null
null
null
null
null
null
null
null
package main; import java.util.ArrayList; import entidades.Persona; import entidades.Torneo; public class Main { /** * Programa para trabajar con datos relacionados con el mundo del tenis * * @param args Argumentos * @author Alejandro Gata * @since 1.8 */ public static void main(String[] args) { ArrayList<Persona> personas = new ArrayList<Persona>(); ArrayList<Torneo> torneos = new ArrayList<Torneo>(); BBDD tenistasBBDD = new BBDD(); Operaciones.operacionesPrevias(tenistasBBDD, personas); Menu.menuCompleto(personas, torneos, tenistasBBDD); tenistasBBDD.cerrarConexion(); } }
UTF-8
Java
617
java
Main.java
Java
[ { "context": " tenis\n\t * \n\t * @param args Argumentos\n\t * @author Alejandro Gata\n\t * @since 1.8\n\t */\n\tpublic static void main(Stri", "end": 252, "score": 0.999897837638855, "start": 238, "tag": "NAME", "value": "Alejandro Gata" } ]
null
[]
package main; import java.util.ArrayList; import entidades.Persona; import entidades.Torneo; public class Main { /** * Programa para trabajar con datos relacionados con el mundo del tenis * * @param args Argumentos * @author <NAME> * @since 1.8 */ public static void main(String[] args) { ArrayList<Persona> personas = new ArrayList<Persona>(); ArrayList<Torneo> torneos = new ArrayList<Torneo>(); BBDD tenistasBBDD = new BBDD(); Operaciones.operacionesPrevias(tenistasBBDD, personas); Menu.menuCompleto(personas, torneos, tenistasBBDD); tenistasBBDD.cerrarConexion(); } }
609
0.727715
0.724473
29
20.275862
21.447445
72
false
false
0
0
0
0
0
0
1.172414
false
false
3
3f4e37ecb95d5a8aca640a88702a6959be356081
22,110,491,692,900
1f1e1ca9c1c50993ca28618889e6a031016be440
/MobileBase/src/main/java/com/ek/mobileapp/demo/DemoData.java
6a2e282302ed28463e2d9c98f976cc6085c0127b
[ "Apache-2.0" ]
permissive
yangjiandong/MobileBase.G
https://github.com/yangjiandong/MobileBase.G
9d49bd306ee9321cac875af03605d0f93d95a342
71ecbae44d8d09b9f26a643f11f195b9f7732ed2
refs/heads/master
2020-05-18T00:44:08.808000
2013-09-12T03:31:43
2013-09-12T03:31:43
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.ek.mobileapp.demo; import com.ek.mobileapp.model.UserDTO; import com.ek.mobileapp.utils.GlobalCache; public class DemoData { public static final String DEMO = "demo"; public static void setUserDTO(){ UserDTO u = new UserDTO(); u.setId(1L); u.setName("演示用户"); u.setLoginName("demo"); u.setPassword("demo"); GlobalCache.getCache().setLoginuser(u); } }
UTF-8
Java
433
java
DemoData.java
Java
[ { "context": "serDTO();\n u.setId(1L);\n u.setName(\"演示用户\");\n u.setLoginName(\"demo\");\n u.setP", "end": 302, "score": 0.9951183199882507, "start": 298, "tag": "USERNAME", "value": "演示用户" }, { "context": " u.setName(\"演示用户\");\n u.setLoginName(\"demo\");\n u.setPassword(\"demo\");\n GlobalC", "end": 334, "score": 0.9941864013671875, "start": 330, "tag": "USERNAME", "value": "demo" }, { "context": " u.setLoginName(\"demo\");\n u.setPassword(\"demo\");\n GlobalCache.getCache().setLoginuser(u)", "end": 365, "score": 0.9993863105773926, "start": 361, "tag": "PASSWORD", "value": "demo" } ]
null
[]
package com.ek.mobileapp.demo; import com.ek.mobileapp.model.UserDTO; import com.ek.mobileapp.utils.GlobalCache; public class DemoData { public static final String DEMO = "demo"; public static void setUserDTO(){ UserDTO u = new UserDTO(); u.setId(1L); u.setName("演示用户"); u.setLoginName("demo"); u.setPassword("<PASSWORD>"); GlobalCache.getCache().setLoginuser(u); } }
439
0.64
0.637647
17
24
16.258934
47
false
false
0
0
0
0
0
0
0.588235
false
false
3
3343f9d4b3a76590643b7ed8e0292e972dc47057
2,534,030,747,671
3a9759027faeb220fb0ca6d389eeb8d318f1678c
/src/main/java/io/github/alexescalonafernandez/filesplit/task/split/BlockSplitTask.java
6e18321d932a7504d6d27d1e6bf1ea966d11f84d
[ "MIT" ]
permissive
alexescalonafernandez/FileSplit
https://github.com/alexescalonafernandez/FileSplit
074c0978abc5b3da80a3f417342d0a14d18e81d6
68847c398aade3b8382d2949072f6e52c6e651ff
refs/heads/master
2020-03-28T13:08:46.514000
2018-09-25T16:15:10
2018-09-25T16:15:10
148,370,122
1
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package io.github.alexescalonafernandez.filesplit.task.split; import io.github.alexescalonafernandez.filesplit.task.BaseTask; import io.github.alexescalonafernandez.filesplit.task.data.Line; import io.github.alexescalonafernandez.filesplit.task.data.SplitContext; import org.apache.commons.io.FilenameUtils; import java.io.File; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; /** * Created by alexander.escalona on 11/09/2018. */ public class BlockSplitTask extends BaseTask { private boolean isFirstLine; private final String outputFilePath; public BlockSplitTask(SplitContext splitContext, CountDownLatch countDownLatch, Consumer<Line> writeNotifier, Consumer<Integer> progressNotifier, AtomicBoolean stopPopulate) { super(splitContext, countDownLatch, writeNotifier, progressNotifier, stopPopulate); this.isFirstLine = true; String index = String.valueOf(splitContext.getTaskIndex()); int maxCharacters = String.valueOf(splitContext.getTaskCount()).length(); while (index.length() < maxCharacters) { index = "0" + index; } File fileToSplit = new File(splitContext.getFilePath()); outputFilePath = new File(splitContext.getFolderPath(), String.format("%s-%s.%s", FilenameUtils.getBaseName(fileToSplit.getAbsolutePath()), index, FilenameUtils.getExtension(fileToSplit.getAbsolutePath()) ) ).getAbsolutePath(); } @Override protected void processLine(long beginLineOffset, long endLineOffset, String line) { if(isFirstLine && splitContext.isAppendFirstLine() && splitContext.getFileHeader() != null) { if(beginLineOffset != 0) { writeNotifier.accept(new Line(outputFilePath, splitContext.getFileHeader())); } } writeNotifier.accept(new Line(outputFilePath, line)); isFirstLine = false; } }
UTF-8
Java
2,120
java
BlockSplitTask.java
Java
[ { "context": "package io.github.alexescalonafernandez.filesplit.task.split;\n\nimport io.github.alexescal", "end": 39, "score": 0.9996203780174255, "start": 18, "tag": "USERNAME", "value": "alexescalonafernandez" }, { "context": "fernandez.filesplit.task.split;\n\nimport io.github.alexescalonafernandez.filesplit.task.BaseTask;\nimport io.github.alexesc", "end": 101, "score": 0.9996739029884338, "start": 80, "tag": "USERNAME", "value": "alexescalonafernandez" }, { "context": "rnandez.filesplit.task.BaseTask;\nimport io.github.alexescalonafernandez.filesplit.task.data.Line;\nimport io.github.alexes", "end": 165, "score": 0.9996815323829651, "start": 144, "tag": "USERNAME", "value": "alexescalonafernandez" }, { "context": "nandez.filesplit.task.data.Line;\nimport io.github.alexescalonafernandez.filesplit.task.data.SplitContext;\nimport org.apac", "end": 230, "score": 0.9996655583381653, "start": 209, "tag": "USERNAME", "value": "alexescalonafernandez" }, { "context": "rt java.util.function.Consumer;\n\n/**\n * Created by alexander.escalona on 11/09/2018.\n */\npublic class BlockSplitT", "end": 492, "score": 0.8964754343032837, "start": 480, "tag": "USERNAME", "value": "alexander.es" }, { "context": "function.Consumer;\n\n/**\n * Created by alexander.escalona on 11/09/2018.\n */\npublic class BlockSplitTask ex", "end": 498, "score": 0.5756792426109314, "start": 492, "tag": "NAME", "value": "calona" } ]
null
[]
package io.github.alexescalonafernandez.filesplit.task.split; import io.github.alexescalonafernandez.filesplit.task.BaseTask; import io.github.alexescalonafernandez.filesplit.task.data.Line; import io.github.alexescalonafernandez.filesplit.task.data.SplitContext; import org.apache.commons.io.FilenameUtils; import java.io.File; import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; /** * Created by alexander.escalona on 11/09/2018. */ public class BlockSplitTask extends BaseTask { private boolean isFirstLine; private final String outputFilePath; public BlockSplitTask(SplitContext splitContext, CountDownLatch countDownLatch, Consumer<Line> writeNotifier, Consumer<Integer> progressNotifier, AtomicBoolean stopPopulate) { super(splitContext, countDownLatch, writeNotifier, progressNotifier, stopPopulate); this.isFirstLine = true; String index = String.valueOf(splitContext.getTaskIndex()); int maxCharacters = String.valueOf(splitContext.getTaskCount()).length(); while (index.length() < maxCharacters) { index = "0" + index; } File fileToSplit = new File(splitContext.getFilePath()); outputFilePath = new File(splitContext.getFolderPath(), String.format("%s-%s.%s", FilenameUtils.getBaseName(fileToSplit.getAbsolutePath()), index, FilenameUtils.getExtension(fileToSplit.getAbsolutePath()) ) ).getAbsolutePath(); } @Override protected void processLine(long beginLineOffset, long endLineOffset, String line) { if(isFirstLine && splitContext.isAppendFirstLine() && splitContext.getFileHeader() != null) { if(beginLineOffset != 0) { writeNotifier.accept(new Line(outputFilePath, splitContext.getFileHeader())); } } writeNotifier.accept(new Line(outputFilePath, line)); isFirstLine = false; } }
2,120
0.67783
0.673113
51
40.568626
30.474197
101
false
false
0
0
0
0
0
0
0.72549
false
false
3
5b3c16a31aee18179e47eda4d1ceba203fd2acd7
2,534,030,748,400
ae09699dddd66b36fef24ca73381f7572849f138
/core/src/utm/ad/spaceImpact/Level.java
6b1876d6fcceb0df17cbd51ca21b1fa68a63a4b1
[]
no_license
Space-Impact-Pro/Space-Impact-Pro-2014
https://github.com/Space-Impact-Pro/Space-Impact-Pro-2014
d8a6156d9392fddc90beb3132c31339da74fa63c
044124b5c3843a75dbbd24e95b9207b9373b48fa
refs/heads/master
2020-03-29T20:14:59.029000
2014-12-10T17:26:20
2014-12-10T17:26:20
null
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package utm.ad.spaceImpact; import java.util.Random; import java.util.List; import java.util.ArrayList; public class Level { private List<Enemy> enemyList; public final Random rand; public Boss boss; float y; public Level(){ enemyList = new ArrayList<Enemy>(); rand = new Random(); } public void generateLevel () { y = 5f; float maxDistance = 0.5f; while (y < World.WORLD_HEIGHT - World.WORLD_WIDTH / 2) { int type = rand.nextFloat() > 0.8f ? Enemy.ENEMY_TYPE_MOVING : Enemy.ENEMY_TYPE_STATIC; float x = rand.nextFloat() * (World.WORLD_WIDTH - Enemy.ENEMY_WIDTH) + Enemy.ENEMY_WIDTH / 2; Enemy enemy = new Enemy(type, x, y); enemyList.add(enemy); y += 2.5f; y -= rand.nextFloat() * (maxDistance / 3); } boss = new Boss(World.WORLD_WIDTH / 2, y); } public float getBossLocationY(){ return y; } public Boss getBoss(){ return boss; } public List<Enemy> getEnemy(){ return enemyList; } }
UTF-8
Java
1,004
java
Level.java
Java
[]
null
[]
package utm.ad.spaceImpact; import java.util.Random; import java.util.List; import java.util.ArrayList; public class Level { private List<Enemy> enemyList; public final Random rand; public Boss boss; float y; public Level(){ enemyList = new ArrayList<Enemy>(); rand = new Random(); } public void generateLevel () { y = 5f; float maxDistance = 0.5f; while (y < World.WORLD_HEIGHT - World.WORLD_WIDTH / 2) { int type = rand.nextFloat() > 0.8f ? Enemy.ENEMY_TYPE_MOVING : Enemy.ENEMY_TYPE_STATIC; float x = rand.nextFloat() * (World.WORLD_WIDTH - Enemy.ENEMY_WIDTH) + Enemy.ENEMY_WIDTH / 2; Enemy enemy = new Enemy(type, x, y); enemyList.add(enemy); y += 2.5f; y -= rand.nextFloat() * (maxDistance / 3); } boss = new Boss(World.WORLD_WIDTH / 2, y); } public float getBossLocationY(){ return y; } public Boss getBoss(){ return boss; } public List<Enemy> getEnemy(){ return enemyList; } }
1,004
0.62251
0.611554
48
18.916666
21.344236
96
false
false
0
0
0
0
0
0
1.770833
false
false
3
836810ed870a28486c30ed68e1974e1a3db1582b
15,341,623,236,819
e8a9959dd91003b53ab4a3f4068d306e9e893c86
/src/test/java/org/starchartlabs/flare/plugins/test/plugin/MetaDataBasePluginIntegrationTest.java
ef6f2cdea98a44a34f2e6d77be0a05efb37cf6d8
[ "MIT" ]
permissive
StarChart-Labs/flare-plugins
https://github.com/StarChart-Labs/flare-plugins
5d69883f245ece39dca31f11d74a1f894bceae7d
212d6355672ddaace294dde50e3f77aa81d97805
refs/heads/master
2023-08-31T07:55:05.444000
2023-08-17T02:01:00
2023-08-17T02:01:00
196,309,052
0
0
MIT
false
2023-08-12T16:52:21
2019-07-11T02:53:50
2020-10-05T18:15:54
2023-08-12T16:52:20
298
0
0
8
Java
false
false
/* * Copyright (C) 2019 StarChart-Labs@github.com Authors * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ package org.starchartlabs.flare.plugins.test.plugin; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.GradleRunner; import org.gradle.testkit.runner.TaskOutcome; import org.starchartlabs.alloy.core.Strings; import org.starchartlabs.flare.plugins.test.IntegrationTestListener; import org.starchartlabs.flare.plugins.test.TestGradleProject; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Listeners; import org.testng.annotations.Test; @Listeners(value = { IntegrationTestListener.class }) public class MetaDataBasePluginIntegrationTest { private static final Path BUILD_FILE_DIRECTORY = Paths.get("org", "starchartlabs", "flare", "plugins", "test", "metadata", "base"); private static final Path STANDARD_SETUP_FILE = BUILD_FILE_DIRECTORY.resolve("standardSetup.gradle"); private static final Path GITHUB_SETUP_FILE = BUILD_FILE_DIRECTORY.resolve("githubSetup.gradle"); private Path standardSetupProjectPath; private Path githubSetupProjectPath; @BeforeClass public void setup() throws Exception { standardSetupProjectPath = TestGradleProject.builder(STANDARD_SETUP_FILE) .build() .getProjectDirectory(); githubSetupProjectPath = TestGradleProject.builder(GITHUB_SETUP_FILE) .addFile(BUILD_FILE_DIRECTORY.resolve("developers.properties"), Paths.get("developers.properties")) .addFile(BUILD_FILE_DIRECTORY.resolve("contributors.properties"), Paths.get("contributors.properties")) .build() .getProjectDirectory(); } @Test public void standardSetup() throws Exception { BuildResult result = GradleRunner.create() .withPluginClasspath() .withProjectDir(standardSetupProjectPath.toFile()) .withArguments("metaDataPrintout") .withGradleVersion("5.0") .build(); Collection<String> expectedLines = new ArrayList<>(); expectedLines.add("url: http://url"); expectedLines.add("scm.vcsUrl: http://scm/url"); expectedLines.add("scm.connection: scm/connection"); expectedLines.add("scm.developerConnection: scm/developerConnection"); expectedLines.add("developer: developer/id:developer/name:developer/url"); expectedLines.add("contributor: contributor/name:contributor/url"); expectedLines.add("license: license/name:license/tag:license/url:license/distribution"); expectedLines.add("license: The Apache Software License, Version 2.0:Apache 2.0" + ":http://www.apache.org/licenses/LICENSE-2.0.txt:repo"); expectedLines.add("license: The MIT License:MIT:https://opensource.org/licenses/MIT:mit/distribution"); expectedLines.add( "license: Eclipse Public License 1.0:EPL:https://opensource.org/licenses/EPL-1.0:epl/distribution"); for (String expectedLine : expectedLines) { Assert.assertTrue(result.getOutput().contains(expectedLine), Strings.format("Did not find expected line '%s'", expectedLine)); } TaskOutcome outcome = result.task(":metaDataPrintout").getOutcome(); Assert.assertTrue(TaskOutcome.SUCCESS.equals(outcome)); } @Test public void githubSetup() throws Exception { BuildResult result = GradleRunner.create() .withPluginClasspath() .withProjectDir(githubSetupProjectPath.toFile()) .withArguments("metaDataPrintout") .withGradleVersion("5.0") .build(); Collection<String> expectedLines = new ArrayList<>(); expectedLines.add("url: https://github.com/owner/repository"); expectedLines.add("scm.vcsUrl: https://github.com/owner/repository"); expectedLines.add("scm.connection: scm:git:git://github.com/owner/repository.git"); expectedLines.add("scm.developerConnection: scm:git:ssh://github.com/owner/repository.git"); expectedLines.add("developer: dev-usernameonly:dev-usernameonly:https://github.com/dev-usernameonly"); expectedLines.add("developer: dev-username:dev-name:https://github.com/dev-username"); expectedLines .add("developer: dev-file-usernameonly:dev-file-usernameonly:https://github.com/dev-file-usernameonly"); expectedLines.add("developer: dev-file-username:dev-file-name:https://github.com/dev-file-username"); expectedLines.add("contributor: contrib-usernameonly:https://github.com/contrib-usernameonly"); expectedLines.add("contributor: contrib-name:https://github.com/contrib-username"); expectedLines.add("contributor: contrib-file-usernameonly:https://github.com/contrib-file-usernameonly"); expectedLines.add("contributor: contrib-file-name:https://github.com/contrib-file-username"); expectedLines.add("license: license/name:license/tag:license/url:license/distribution"); expectedLines.add("license: The Apache Software License, Version 2.0:Apache 2.0" + ":http://www.apache.org/licenses/LICENSE-2.0.txt:repo"); expectedLines.add("license: The MIT License:MIT:https://opensource.org/licenses/MIT:mit/distribution"); expectedLines.add( "license: Eclipse Public License 1.0:EPL:https://opensource.org/licenses/EPL-1.0:epl/distribution"); for (String expectedLine : expectedLines) { Assert.assertTrue(result.getOutput().contains(expectedLine), Strings.format("Did not find expected line '%s'", expectedLine)); } TaskOutcome outcome = result.task(":metaDataPrintout").getOutcome(); Assert.assertTrue(TaskOutcome.SUCCESS.equals(outcome)); } }
UTF-8
Java
6,150
java
MetaDataBasePluginIntegrationTest.java
Java
[ { "context": "/*\n * Copyright (C) 2019 StarChart-Labs@github.com Authors\n *\n * This software may be modified and d", "end": 50, "score": 0.9999096393585205, "start": 25, "tag": "EMAIL", "value": "StarChart-Labs@github.com" }, { "context": " expectedLines.add(\"url: https://github.com/owner/repository\");\n\n expectedLines.add(\"scm.vcs", "end": 4107, "score": 0.9629557728767395, "start": 4102, "tag": "USERNAME", "value": "owner" }, { "context": "expectedLines.add(\"scm.vcsUrl: https://github.com/owner/repository\");\n expectedLines.add(\"scm.conn", "end": 4186, "score": 0.8908229470252991, "start": 4181, "tag": "USERNAME", "value": "owner" }, { "context": "nes.add(\"scm.connection: scm:git:git://github.com/owner/repository.git\");\n expectedLines.add(\"scm.", "end": 4274, "score": 0.9099943041801453, "start": 4269, "tag": "USERNAME", "value": "owner" }, { "context": "scm.developerConnection: scm:git:ssh://github.com/owner/repository.git\");\n\n expectedLines.add(\"dev", "end": 4375, "score": 0.8945534825325012, "start": 4370, "tag": "USERNAME", "value": "owner" }, { "context": "tory.git\");\n\n expectedLines.add(\"developer: dev-usernameonly:dev-usernameonly:https://github.com/dev-usernameo", "end": 4449, "score": 0.7173889875411987, "start": 4433, "tag": "USERNAME", "value": "dev-usernameonly" }, { "context": " expectedLines.add(\"developer: dev-usernameonly:dev-usernameonly:https://github.com/dev-usernameonly\");\n ex", "end": 4466, "score": 0.8391650915145874, "start": 4450, "tag": "USERNAME", "value": "dev-usernameonly" }, { "context": "-usernameonly:dev-usernameonly:https://github.com/dev-usernameonly\");\n expectedLines.add(\"developer: dev-user", "end": 4502, "score": 0.9984093308448792, "start": 4486, "tag": "USERNAME", "value": "dev-usernameonly" }, { "context": "rnameonly\");\n expectedLines.add(\"developer: dev-username:dev-name:https://github.com/dev-username\"", "end": 4547, "score": 0.6525046825408936, "start": 4544, "tag": "USERNAME", "value": "dev" }, { "context": "veloper: dev-username:dev-name:https://github.com/dev-username\");\n expectedLines\n .add(\"developer:", "end": 4597, "score": 0.9983384609222412, "start": 4585, "tag": "USERNAME", "value": "dev-username" }, { "context": "nameonly:dev-file-usernameonly:https://github.com/dev-file-usernameonly\");\n expectedLines.add(\"developer: dev-file", "end": 4732, "score": 0.9941737055778503, "start": 4711, "tag": "USERNAME", "value": "dev-file-usernameonly" }, { "context": "ev-file-username:dev-file-name:https://github.com/dev-file-username\");\n\n expectedLines.add(\"contributor: contr", "end": 4842, "score": 0.9425590634346008, "start": 4825, "tag": "USERNAME", "value": "dev-file-username" }, { "context": "tributor: contrib-usernameonly:https://github.com/contrib-usernameonly\");\n expectedLines.add(\"contributor: contri", "end": 4947, "score": 0.9956710338592529, "start": 4927, "tag": "USERNAME", "value": "contrib-usernameonly" }, { "context": "add(\"contributor: contrib-name:https://github.com/contrib-username\");\n expectedLines.add(\"contributor: contri", "end": 5039, "score": 0.9926106333732605, "start": 5023, "tag": "USERNAME", "value": "contrib-username" }, { "context": "tor: contrib-file-usernameonly:https://github.com/contrib-file-usernameonly\");\n expectedLines.add(\"contributor: contri", "end": 5153, "score": 0.9918920397758484, "start": 5128, "tag": "USERNAME", "value": "contrib-file-usernameonly" }, { "context": "contributor: contrib-file-name:https://github.com/contrib-file-username\");\n\n expectedLines.add(\"license: license/n", "end": 5255, "score": 0.912263035774231, "start": 5234, "tag": "USERNAME", "value": "contrib-file-username" } ]
null
[]
/* * Copyright (C) 2019 <EMAIL> Authors * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. */ package org.starchartlabs.flare.plugins.test.plugin; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import org.gradle.testkit.runner.BuildResult; import org.gradle.testkit.runner.GradleRunner; import org.gradle.testkit.runner.TaskOutcome; import org.starchartlabs.alloy.core.Strings; import org.starchartlabs.flare.plugins.test.IntegrationTestListener; import org.starchartlabs.flare.plugins.test.TestGradleProject; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Listeners; import org.testng.annotations.Test; @Listeners(value = { IntegrationTestListener.class }) public class MetaDataBasePluginIntegrationTest { private static final Path BUILD_FILE_DIRECTORY = Paths.get("org", "starchartlabs", "flare", "plugins", "test", "metadata", "base"); private static final Path STANDARD_SETUP_FILE = BUILD_FILE_DIRECTORY.resolve("standardSetup.gradle"); private static final Path GITHUB_SETUP_FILE = BUILD_FILE_DIRECTORY.resolve("githubSetup.gradle"); private Path standardSetupProjectPath; private Path githubSetupProjectPath; @BeforeClass public void setup() throws Exception { standardSetupProjectPath = TestGradleProject.builder(STANDARD_SETUP_FILE) .build() .getProjectDirectory(); githubSetupProjectPath = TestGradleProject.builder(GITHUB_SETUP_FILE) .addFile(BUILD_FILE_DIRECTORY.resolve("developers.properties"), Paths.get("developers.properties")) .addFile(BUILD_FILE_DIRECTORY.resolve("contributors.properties"), Paths.get("contributors.properties")) .build() .getProjectDirectory(); } @Test public void standardSetup() throws Exception { BuildResult result = GradleRunner.create() .withPluginClasspath() .withProjectDir(standardSetupProjectPath.toFile()) .withArguments("metaDataPrintout") .withGradleVersion("5.0") .build(); Collection<String> expectedLines = new ArrayList<>(); expectedLines.add("url: http://url"); expectedLines.add("scm.vcsUrl: http://scm/url"); expectedLines.add("scm.connection: scm/connection"); expectedLines.add("scm.developerConnection: scm/developerConnection"); expectedLines.add("developer: developer/id:developer/name:developer/url"); expectedLines.add("contributor: contributor/name:contributor/url"); expectedLines.add("license: license/name:license/tag:license/url:license/distribution"); expectedLines.add("license: The Apache Software License, Version 2.0:Apache 2.0" + ":http://www.apache.org/licenses/LICENSE-2.0.txt:repo"); expectedLines.add("license: The MIT License:MIT:https://opensource.org/licenses/MIT:mit/distribution"); expectedLines.add( "license: Eclipse Public License 1.0:EPL:https://opensource.org/licenses/EPL-1.0:epl/distribution"); for (String expectedLine : expectedLines) { Assert.assertTrue(result.getOutput().contains(expectedLine), Strings.format("Did not find expected line '%s'", expectedLine)); } TaskOutcome outcome = result.task(":metaDataPrintout").getOutcome(); Assert.assertTrue(TaskOutcome.SUCCESS.equals(outcome)); } @Test public void githubSetup() throws Exception { BuildResult result = GradleRunner.create() .withPluginClasspath() .withProjectDir(githubSetupProjectPath.toFile()) .withArguments("metaDataPrintout") .withGradleVersion("5.0") .build(); Collection<String> expectedLines = new ArrayList<>(); expectedLines.add("url: https://github.com/owner/repository"); expectedLines.add("scm.vcsUrl: https://github.com/owner/repository"); expectedLines.add("scm.connection: scm:git:git://github.com/owner/repository.git"); expectedLines.add("scm.developerConnection: scm:git:ssh://github.com/owner/repository.git"); expectedLines.add("developer: dev-usernameonly:dev-usernameonly:https://github.com/dev-usernameonly"); expectedLines.add("developer: dev-username:dev-name:https://github.com/dev-username"); expectedLines .add("developer: dev-file-usernameonly:dev-file-usernameonly:https://github.com/dev-file-usernameonly"); expectedLines.add("developer: dev-file-username:dev-file-name:https://github.com/dev-file-username"); expectedLines.add("contributor: contrib-usernameonly:https://github.com/contrib-usernameonly"); expectedLines.add("contributor: contrib-name:https://github.com/contrib-username"); expectedLines.add("contributor: contrib-file-usernameonly:https://github.com/contrib-file-usernameonly"); expectedLines.add("contributor: contrib-file-name:https://github.com/contrib-file-username"); expectedLines.add("license: license/name:license/tag:license/url:license/distribution"); expectedLines.add("license: The Apache Software License, Version 2.0:Apache 2.0" + ":http://www.apache.org/licenses/LICENSE-2.0.txt:repo"); expectedLines.add("license: The MIT License:MIT:https://opensource.org/licenses/MIT:mit/distribution"); expectedLines.add( "license: Eclipse Public License 1.0:EPL:https://opensource.org/licenses/EPL-1.0:epl/distribution"); for (String expectedLine : expectedLines) { Assert.assertTrue(result.getOutput().contains(expectedLine), Strings.format("Did not find expected line '%s'", expectedLine)); } TaskOutcome outcome = result.task(":metaDataPrintout").getOutcome(); Assert.assertTrue(TaskOutcome.SUCCESS.equals(outcome)); } }
6,132
0.69122
0.686667
131
45.946564
37.149647
119
false
false
0
0
0
0
0
0
0.549618
false
false
3
a0cef9975b309b8de887a3d12035416a37047bce
2,937,757,684,176
b157a3f73bf10aa46cbfe29a6aa77c66c31cd5f4
/news_cms/src/main/java/com/meirengu/news/dao/IpWhiteListDao.java
3d0c91a086ce711f00f6f9a760a2c644c0e38644
[]
no_license
JasonZhangSx/meirengu
https://github.com/JasonZhangSx/meirengu
dd53faa9e5a06f03e561c23b5806d9104e9e0bab
bf06289a1f3b3645db320b7b68dd6299e3a391ab
refs/heads/master
2021-01-19T18:46:43.082000
2017-08-21T04:22:04
2017-08-21T04:22:04
101,160,314
0
0
null
null
null
null
null
null
null
null
null
null
null
null
null
package com.meirengu.news.dao; import com.meirengu.news.model.IpWhiteList; import com.meirengu.dao.BaseDao; /** * IpWhiteListDao * @author 建新 * @create Tue Jul 18 15:08:25 CST 2017 */ public interface IpWhiteListDao extends BaseDao<IpWhiteList>{ }
UTF-8
Java
257
java
IpWhiteListDao.java
Java
[ { "context": "gu.dao.BaseDao;\n/**\n * IpWhiteListDao \n * @author 建新\n * @create Tue Jul 18 15:08:25 CST 2017\n */\npubli", "end": 144, "score": 0.7925000786781311, "start": 142, "tag": "USERNAME", "value": "建新" } ]
null
[]
package com.meirengu.news.dao; import com.meirengu.news.model.IpWhiteList; import com.meirengu.dao.BaseDao; /** * IpWhiteListDao * @author 建新 * @create Tue Jul 18 15:08:25 CST 2017 */ public interface IpWhiteListDao extends BaseDao<IpWhiteList>{ }
257
0.758893
0.711462
10
24.299999
19.031815
61
false
false
0
0
0
0
0
0
0.3
false
false
3