blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
89caa566d96cb908f4dd56d200450d732ca5c94d | 3ab81011e2a2ccaba772936e86f1fb417f0b73c9 | /src/main/java/cliente/es/deusto/spq/gui/AnadirUsuario.java | c4dd0128bc77347f5e1d4845894f4b6cf05fa52e | [] | no_license | BSPQ18-19/BSPQ19-S4 | b1e95c3de3b795e81255eec01d20b71cd7996103 | 1ed5a91b9fd19c448dcd5a8db63c60a84ac854ca | refs/heads/master | 2022-07-01T06:10:51.116519 | 2020-07-27T11:13:12 | 2020-07-27T11:13:12 | 177,606,672 | 0 | 2 | null | 2020-10-13T13:06:10 | 2019-03-25T14:49:59 | Java | UTF-8 | Java | false | false | 16,525 | java | package cliente.es.deusto.spq.gui;
import java.awt.CardLayout;
import java.awt.EventQueue;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.sql.DriverManager;
import java.sql.Statement;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
import cliente.es.deusto.spq.controller.AnadirUsuarioController;
import servidor.es.deusto.spq.jdo.Cuenta;
public class AnadirUsuario extends JPanel {
private static final long serialVersionUID = 674330126384087764L;
private JLabel lblUsuario;
private JTextField textFieldUsuario;
private JLabel lblContrasea1;
private JPasswordField passwordFieldContrasea1;
private JLabel lblContrasea2;
private JPasswordField passwordFieldContrasea2;
private JLabel lblCorreo1;
private JTextField textFieldCorreo1;
private JLabel lblCorreo2;
private JTextField textFieldCorreo2;
private JLabel lblPaypal1;
private JTextField textFieldPaypal1;
private JLabel lblPaypal2;
private JTextField textFieldPaypal2;
private JCheckBox chckbxAdministrador;
private JPanel panel;
private JLabel lblAdminSiONo;
private JTextField textFieldAdminSiONo;
private JButton btnAnadirUsuario;
private JButton btnAtras;
String usuario = null;
String contrasenya1 = null;
String correo1 = null;
String paypal1 = null;
boolean administrador = false;
public AnadirUsuario(AnadirUsuarioController anadirUsuarioController, CardLayout cardLayout) {
GridBagLayout gbl_contentPane = new GridBagLayout();
gbl_contentPane.columnWidths = new int[] { 0, 0, 0 };
gbl_contentPane.rowHeights = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, 0};
gbl_contentPane.columnWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE };
gbl_contentPane.rowWeights = new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
setLayout(gbl_contentPane);
lblUsuario = new JLabel("Introducir nombre de usuario: ");
GridBagConstraints gbc_lblUsuario = new GridBagConstraints();
gbc_lblUsuario.insets = new Insets(0, 0, 5, 5);
gbc_lblUsuario.gridx = 0;
gbc_lblUsuario.gridy = 0;
add(lblUsuario, gbc_lblUsuario);
textFieldUsuario = new JTextField();
GridBagConstraints gbc_textFieldUsuario = new GridBagConstraints();
gbc_textFieldUsuario.insets = new Insets(0, 0, 5, 0);
gbc_textFieldUsuario.gridx = 1;
gbc_textFieldUsuario.gridy = 0;
add(textFieldUsuario, gbc_textFieldUsuario);
textFieldUsuario.setColumns(20);
textFieldUsuario.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
usuario = textFieldUsuario.getText();
boolean disponible = true;
// TODO: comprobar en la BD si el nombre de usuario esta disponible
if (disponible == false) {
JOptionPane.showMessageDialog(null, "Este nombre de usuario no esta disponible");
} else {
lblContrasea1.setEnabled(true);
passwordFieldContrasea1.setEnabled(true);
textFieldUsuario.setEditable(false);
passwordFieldContrasea1.requestFocus();
}
}
}
});
lblContrasea1 = new JLabel("Introducir contraseña:");
lblContrasea1.setEnabled(false);
GridBagConstraints gbc_lblContrasea1 = new GridBagConstraints();
gbc_lblContrasea1.insets = new Insets(0, 0, 5, 5);
gbc_lblContrasea1.gridx = 0;
gbc_lblContrasea1.gridy = 1;
add(lblContrasea1, gbc_lblContrasea1);
passwordFieldContrasea1 = new JPasswordField();
passwordFieldContrasea1.setEnabled(false);
passwordFieldContrasea1.setColumns(20);
GridBagConstraints gbc_passwordFieldContrasea1 = new GridBagConstraints();
gbc_passwordFieldContrasea1.insets = new Insets(0, 0, 5, 0);
gbc_passwordFieldContrasea1.gridx = 1;
gbc_passwordFieldContrasea1.gridy = 1;
add(passwordFieldContrasea1, gbc_passwordFieldContrasea1);
passwordFieldContrasea1.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
contrasenya1 = new String(passwordFieldContrasea1.getPassword());
lblContrasea2.setEnabled(true);
passwordFieldContrasea2.setEnabled(true);
passwordFieldContrasea1.setEditable(false);
passwordFieldContrasea2.requestFocus();
}
}
});
lblContrasea2 = new JLabel("Repetir contraseña: ");
lblContrasea2.setEnabled(false);
GridBagConstraints gbc_lblContrasea2 = new GridBagConstraints();
gbc_lblContrasea2.insets = new Insets(0, 0, 5, 5);
gbc_lblContrasea2.gridx = 0;
gbc_lblContrasea2.gridy = 2;
add(lblContrasea2, gbc_lblContrasea2);
passwordFieldContrasea2 = new JPasswordField();
passwordFieldContrasea2.setEnabled(false);
passwordFieldContrasea2.setColumns(20);
GridBagConstraints gbc_passwordFieldContrasea2 = new GridBagConstraints();
gbc_passwordFieldContrasea2.insets = new Insets(0, 0, 5, 0);
gbc_passwordFieldContrasea2.gridx = 1;
gbc_passwordFieldContrasea2.gridy = 2;
add(passwordFieldContrasea2, gbc_passwordFieldContrasea2);
passwordFieldContrasea2.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
String contrasenya2 = new String(passwordFieldContrasea2.getPassword());
if (!contrasenya2.equals(contrasenya1)) {
JOptionPane.showMessageDialog(null,
"La contraseña repetida no es igual a la contraseña introducida");
} else {
lblCorreo1.setEnabled(true);
textFieldCorreo1.setEnabled(true);
passwordFieldContrasea2.setEditable(false);
textFieldCorreo1.requestFocus();
}
}
}
});
lblCorreo1 = new JLabel("Introducir correo electronico:");
lblCorreo1.setEnabled(false);
GridBagConstraints gbc_lblCorreo1 = new GridBagConstraints();
gbc_lblCorreo1.insets = new Insets(0, 0, 5, 5);
gbc_lblCorreo1.gridx = 0;
gbc_lblCorreo1.gridy = 3;
add(lblCorreo1, gbc_lblCorreo1);
textFieldCorreo1 = new JTextField();
textFieldCorreo1.setEnabled(false);
GridBagConstraints gbc_textFieldCorreo1 = new GridBagConstraints();
gbc_textFieldCorreo1.insets = new Insets(0, 0, 5, 0);
gbc_textFieldCorreo1.gridx = 1;
gbc_textFieldCorreo1.gridy = 3;
add(textFieldCorreo1, gbc_textFieldCorreo1);
textFieldCorreo1.setColumns(20);
textFieldCorreo1.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
correo1 = textFieldCorreo1.getText();
lblCorreo2.setEnabled(true);
textFieldCorreo2.setEnabled(true);
textFieldCorreo1.setEditable(false);
textFieldCorreo2.requestFocus();
}
}
});
lblCorreo2 = new JLabel("Repetir correo electronico:");
lblCorreo2.setEnabled(false);
GridBagConstraints gbc_lblCorreo2 = new GridBagConstraints();
gbc_lblCorreo2.insets = new Insets(0, 0, 5, 5);
gbc_lblCorreo2.gridx = 0;
gbc_lblCorreo2.gridy = 4;
add(lblCorreo2, gbc_lblCorreo2);
textFieldCorreo2 = new JTextField();
textFieldCorreo2.setEnabled(false);
GridBagConstraints gbc_textFieldCorreo2 = new GridBagConstraints();
gbc_textFieldCorreo2.insets = new Insets(0, 0, 5, 0);
gbc_textFieldCorreo2.gridx = 1;
gbc_textFieldCorreo2.gridy = 4;
add(textFieldCorreo2, gbc_textFieldCorreo2);
textFieldCorreo2.setColumns(20);
textFieldCorreo2.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
String correo2 = textFieldCorreo2.getText();
if (!correo2.equals(correo1)) {
JOptionPane.showMessageDialog(null, "El correo repetido no es igual al correo introducido");
} else {
lblPaypal1.setEnabled(true);
textFieldPaypal1.setEnabled(true);
textFieldCorreo2.setEditable(false);
textFieldPaypal1.requestFocus();
}
}
}
});
lblPaypal1 = new JLabel("Introducir cuenta de Paypal:");
lblPaypal1.setEnabled(false);
GridBagConstraints gbc_lblPaypal1 = new GridBagConstraints();
gbc_lblPaypal1.insets = new Insets(0, 0, 5, 5);
gbc_lblPaypal1.gridx = 0;
gbc_lblPaypal1.gridy = 5;
add(lblPaypal1, gbc_lblPaypal1);
textFieldPaypal1 = new JTextField();
textFieldPaypal1.setEnabled(false);
GridBagConstraints gbc_textFieldPaypal1 = new GridBagConstraints();
gbc_textFieldPaypal1.insets = new Insets(0, 0, 5, 0);
gbc_textFieldPaypal1.gridx = 1;
gbc_textFieldPaypal1.gridy = 5;
add(textFieldPaypal1, gbc_textFieldPaypal1);
textFieldPaypal1.setColumns(20);
textFieldPaypal1.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
paypal1 = textFieldPaypal1.getText();
lblPaypal2.setEnabled(true);
textFieldPaypal2.setEnabled(true);
textFieldPaypal1.setEditable(false);
textFieldPaypal2.requestFocus();
}
}
});
lblPaypal2 = new JLabel("Repetir cuenta de Paypal:");
lblPaypal2.setEnabled(false);
GridBagConstraints gbc_lblPaypal2 = new GridBagConstraints();
gbc_lblPaypal2.insets = new Insets(0, 0, 5, 5);
gbc_lblPaypal2.gridx = 0;
gbc_lblPaypal2.gridy = 6;
add(lblPaypal2, gbc_lblPaypal2);
textFieldPaypal2 = new JTextField();
textFieldPaypal2.setEnabled(false);
GridBagConstraints gbc_textFieldPaypal2 = new GridBagConstraints();
gbc_textFieldPaypal2.insets = new Insets(0, 0, 5, 0);
gbc_textFieldPaypal2.gridx = 1;
gbc_textFieldPaypal2.gridy = 6;
add(textFieldPaypal2, gbc_textFieldPaypal2);
textFieldPaypal2.setColumns(20);
textFieldPaypal2.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
String paypal2 = textFieldPaypal2.getText();
if (!paypal2.equals(paypal1)) {
JOptionPane.showMessageDialog(null, "La cuenta repetida no es igual a la cuenta introducida");
} else {
chckbxAdministrador.setEnabled(true);
btnAnadirUsuario.setEnabled(true);
textFieldPaypal2.setEditable(false);
}
}
}
});
chckbxAdministrador = new JCheckBox("Administrador");
chckbxAdministrador.setEnabled(false);
GridBagConstraints gbc_chckbxAdministrador = new GridBagConstraints();
gbc_chckbxAdministrador.insets = new Insets(0, 0, 5, 5);
gbc_chckbxAdministrador.gridx = 0;
gbc_chckbxAdministrador.gridy = 7;
add(chckbxAdministrador, gbc_chckbxAdministrador);
chckbxAdministrador.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
if (chckbxAdministrador.isSelected()) {
btnAnadirUsuario.setEnabled(false);
lblAdminSiONo.setEnabled(true);
textFieldAdminSiONo.setEnabled(true);
textFieldAdminSiONo.requestFocus();
} else {
lblAdminSiONo.setEnabled(false);
textFieldAdminSiONo.setEnabled(false);
btnAnadirUsuario.setEnabled(true);
}
}
});
panel = new JPanel();
GridBagConstraints gbc_panel = new GridBagConstraints();
gbc_panel.insets = new Insets(0, 0, 5, 0);
gbc_panel.gridx = 1;
gbc_panel.gridy = 7;
add(panel, gbc_panel);
GridBagLayout gbl_panel = new GridBagLayout();
gbl_panel.columnWidths = new int[] { 0, 0, 0 };
gbl_panel.rowHeights = new int[] { 0, 0 };
gbl_panel.columnWeights = new double[] { 1.0, 1.0, Double.MIN_VALUE };
gbl_panel.rowWeights = new double[] { 1.0, Double.MIN_VALUE };
panel.setLayout(gbl_panel);
lblAdminSiONo = new JLabel("Introducir cuenta de administrador:");
lblAdminSiONo.setEnabled(false);
GridBagConstraints gbc_lblAdminSiONo = new GridBagConstraints();
gbc_lblAdminSiONo.insets = new Insets(0, 0, 0, 5);
gbc_lblAdminSiONo.gridx = 0;
gbc_lblAdminSiONo.gridy = 0;
panel.add(lblAdminSiONo, gbc_lblAdminSiONo);
textFieldAdminSiONo = new JTextField();
textFieldAdminSiONo.setEnabled(false);
GridBagConstraints gbc_textFieldAdminSiONo = new GridBagConstraints();
gbc_textFieldAdminSiONo.gridx = 1;
gbc_textFieldAdminSiONo.gridy = 0;
panel.add(textFieldAdminSiONo, gbc_textFieldAdminSiONo);
textFieldAdminSiONo.setColumns(15);
textFieldAdminSiONo.addKeyListener(new KeyAdapter() {
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
String codigo = textFieldAdminSiONo.getText();
if (codigo.equals("123456789")) {
administrador = true;
btnAnadirUsuario.setEnabled(true);
textFieldAdminSiONo.setEditable(false);
} else {
JOptionPane.showMessageDialog(null, "El codigo introducido no es correcto");
btnAnadirUsuario.setEnabled(false);
}
}
}
});
btnAnadirUsuario = new JButton("Añadir");
btnAnadirUsuario.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (administrador == true) {
// TODO: guardar usuario en la BD como administrador
} else {
// TODO: guardar usuario en la BD como usuario
}
reinicio();
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
String nombre = textFieldUsuario.getText();
String contrasenna = passwordFieldContrasea1.getText();
String correo = textFieldCorreo1.getText();
String paypal = textFieldPaypal1.getText();
int privilegio = Integer.parseInt(textFieldAdminSiONo.getText());
double gasto = 0.0;
Cuenta c = new Cuenta(nombre, contrasenna, correo, paypal, privilegio, gasto);
/*
Class.forName("com.mysql.jdbc.Driver");
java.sql.Connection conexion = DriverManager.getConnection("jdbc:mysql://localhost:3306/bspq19-s4", "spq", "spq");
String query = "INSERT INTO cuenta (CORREO, CONTRASENNA, GASTO, NOMBRE, PAYPAL, PRIVILEGIO) values ('"+correo+"','"+contrasenna+"','"+gasto+"','"+nombre+"','"+paypal+"','"+privilegio+"')";
Statement stmt = conexion.createStatement();
stmt.executeUpdate(query);
*/
anadirUsuarioController.almacenarUsuario(c);
cardLayout.show(getParent(), VentanaPrincipal.USUARIOS);
JOptionPane.showMessageDialog(null, "Nuevo usuario añadido");
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
});
btnAnadirUsuario.setEnabled(false);
GridBagConstraints gbc_btnAnadirUsuario = new GridBagConstraints();
gbc_btnAnadirUsuario.insets = new Insets(0, 0, 0, 5);
gbc_btnAnadirUsuario.gridx = 1;
gbc_btnAnadirUsuario.gridy = 8;
add(btnAnadirUsuario, gbc_btnAnadirUsuario);
btnAtras = new JButton("Atras");
btnAtras.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
reinicio();
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
cardLayout.show(getParent(), VentanaPrincipal.USUARIOS);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
});
GridBagConstraints gbc_btnAtras = new GridBagConstraints();
gbc_btnAtras.gridx = 0;
gbc_btnAtras.gridy = 8;
add(btnAtras, gbc_btnAtras);
}
public void reinicio() {
textFieldUsuario.setText(null);
textFieldUsuario.setEnabled(true);
textFieldUsuario.setEditable(true);
lblUsuario.setEnabled(true);
passwordFieldContrasea1.setText(null);
passwordFieldContrasea1.setEnabled(false);
passwordFieldContrasea1.setEditable(true);
lblContrasea1.setEnabled(false);
passwordFieldContrasea2.setText(null);
passwordFieldContrasea2.setEnabled(false);
passwordFieldContrasea2.setEditable(true);
lblContrasea2.setEnabled(false);
textFieldCorreo1.setText(null);
textFieldCorreo1.setEnabled(false);
textFieldCorreo1.setEditable(true);
lblCorreo1.setEnabled(false);
textFieldCorreo2.setText(null);
textFieldCorreo2.setEnabled(false);
textFieldCorreo2.setEditable(true);
lblCorreo2.setEnabled(false);
textFieldPaypal1.setText(null);
textFieldPaypal1.setEnabled(false);
textFieldPaypal1.setEditable(true);
lblPaypal1.setEnabled(false);
textFieldPaypal2.setText(null);
textFieldPaypal2.setEnabled(false);
textFieldPaypal2.setEditable(true);
lblPaypal2.setEnabled(false);
chckbxAdministrador.setEnabled(false);
chckbxAdministrador.setSelected(false);
lblAdminSiONo.setEnabled(false);
textFieldAdminSiONo.setText(null);
textFieldAdminSiONo.setEnabled(false);
textFieldAdminSiONo.setEditable(true);
btnAnadirUsuario.setEnabled(false);
}
}
| [
"koldo.urrosolo@opendeusto.es"
] | koldo.urrosolo@opendeusto.es |
7f63ce1ebe2c42850c060490c417fd52d8f3714f | b761a4fd15fdebb6fad5476137257900b18c7ec1 | /src/predicates/Negation.java | 0fb52e46e4c2931c2cd8b684d8194940fb713ec2 | [] | no_license | rappetteluca/Exploring-Languages-Java-Generics | aa2a150f8c456430f4f654dec88735bc566fc833 | f7a0b02a716aa5696c387932f624c010c1989915 | refs/heads/master | 2021-04-09T10:24:02.207199 | 2018-03-16T08:05:31 | 2018-03-16T08:05:31 | 125,482,826 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 341 | java | package predicates;
public class Negation<T> implements Predicate<T>
{
private Predicate<T> reference;
public Negation(Predicate<T> a)
{
reference = a;
}
@Override
public boolean accepts(T t)
{
if (t == null || this.reference == null)
{
return false;
}
return (this.reference.accepts(t) ? false : true);
}
}
| [
"rappette.luca@uwlax.edu"
] | rappette.luca@uwlax.edu |
e5763a73a3368fd2a58b954dd4d20296c0cab80b | b944be11d3eeeecf0ae6c2b7d7fffc338da5ac0a | /src/main/java/com/xx/test/Service/MenuService.java | bdd845e4df350195a2168bb09580ca43e0d54106 | [] | no_license | xbeginner/test | c8e9fa19ed1a004c3eda79efca491fbdc81ca2ba | ef202e16a3a730794a75ad741ef08e1dbb49880d | refs/heads/master | 2021-01-01T16:11:48.051831 | 2017-10-26T09:17:15 | 2017-10-26T09:17:15 | 97,785,694 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 864 | java | package com.xx.test.Service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.xx.test.Dao.MenuDao;
import com.xx.test.Dao.OrgDao;
import com.xx.test.IService.IMenuService;
import com.xx.test.IService.IOrgService;
import com.xx.test.Model.Menu;
import com.xx.test.Model.Org;
@Service
public class MenuService implements IMenuService{
@Autowired
MenuDao menuDao;
@Override
public List<Menu> findAllMenuList() {
// TODO Auto-generated method stub
return (List<Menu>) menuDao.findAll();
}
@Override
public Menu findMenuById(Long id) {
// TODO Auto-generated method stub
return menuDao.findOne(id);
}
@Override
public List<Menu> findMenuByRoleId(Long id) {
// TODO Auto-generated method stub
return menuDao.findMenuByRoleId(id);
}
}
| [
"internet_408@126.com"
] | internet_408@126.com |
127bf69460a7f275ec51da9bd56542a081c5c5f9 | 94d45bc48388bbb0272b5c0b9c5865000a74c763 | /Vd69_DialogCustom/app/src/androidTest/java/hathienvan/firstapplication/dialogcustom/ExampleInstrumentedTest.java | 76e6565e443cd1902c507a4f0a20ab7e020d52f0 | [] | no_license | hathienvan58770769/AppMobile-A-Z- | c18352039a616db63170b8f51fa2fa14e276fc5a | 6179d89b0b69e62b1edcd8e104574631105b6683 | refs/heads/master | 2022-12-13T16:02:36.600503 | 2019-11-12T08:15:56 | 2019-11-12T08:15:56 | 217,442,440 | 0 | 0 | null | 2022-12-11T12:57:47 | 2019-10-25T03:20:45 | Java | UTF-8 | Java | false | false | 796 | java | package hathienvan.firstapplication.dialogcustom;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("hathienvan.firstapplication.dialogcustom", appContext.getPackageName());
}
}
| [
"hathienvan@MacBook-Pro-cua-Ha.local"
] | hathienvan@MacBook-Pro-cua-Ha.local |
37d32724ec088d2880f97b6edea5b58905c6cbf4 | f94265e0cc5b24694f3df748a8dea428848606db | /src/main/java/com/scpfoundation/psybotic/server/firebase/fcm/model/AIMessage.java | b947f2a37cf8fc159853b224386bf66f52f44d6c | [] | no_license | BIL496-SCPFoundation/psybotic-server | f8f92380038661f39598ee7cea329ed9f1179154 | 7868e25706be557e18db627aeac6bae93b086bff | refs/heads/master | 2023-04-09T00:55:58.082300 | 2021-04-18T15:28:49 | 2021-04-18T15:28:49 | 338,596,411 | 2 | 0 | null | 2021-04-17T13:51:47 | 2021-02-13T14:48:18 | Java | UTF-8 | Java | false | false | 435 | java | package com.scpfoundation.psybotic.server.firebase.fcm.model;
public class AIMessage {
private String message;
private String sender;
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getSender() {
return sender;
}
public void setSender(String sender) {
this.sender = sender;
}
}
| [
"muhammedemredurdu@gmail.com"
] | muhammedemredurdu@gmail.com |
51dfd01659a65f7a93ff75981bdd5b3fb4eada9e | 99da1626426b75d7487ca7efc28b8dabe834512d | /HebrewNLP4J/src/il/co/hebrewnlp/morphology/HebrewMorphology.java | 5e94ff4fc5e48aa1bf033577dc4d2ff67d8035e8 | [
"MIT"
] | permissive | danielihazkel/HebrewNLP4J | 6cb094111021db5b4df6cab29109ee5e330d80f5 | cc63665e3649e6ba105c2eb38066435f9e83e40c | refs/heads/master | 2023-03-17T00:38:21.501757 | 2018-08-12T06:13:39 | 2018-08-12T06:13:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,123 | java | package il.co.hebrewnlp.morphology;
import java.io.Serializable;
import java.util.Collection;
import org.json.JSONArray;
import org.json.JSONObject;
import il.co.hebrewnlp.HebrewNLP;
import il.co.hebrewnlp.HttpUtils;
public class HebrewMorphology {
public static final String MORPH_NORMALIZE_ENDPOINT = "/service/morphology/normalize";
public static final String MORPH_ANALYZE_ENDPOINT = "/service/morphology/analyze";
public enum NormalizationType implements Serializable, Cloneable {
SEARCH,
INDEX,
}
public static String[][] normalizeText(String text) throws Exception {
return normalizeText(text, NormalizationType.SEARCH);
}
public static String[][] normalizeText(String text, NormalizationType type) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("type", type);
request.put("text", text);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_NORMALIZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected String[][], got: " + object.toString()));
}
return HttpUtils.toDoubleStringArray(new JSONArray(responseJson));
}
public static String[][] normalizeSentences(Collection<String> sentences) throws Exception {
return normalizeSentences(sentences, NormalizationType.SEARCH);
}
public static String[][] normalizeSentences(Collection<String> sentences, NormalizationType type) throws Exception {
return normalizeSentences(sentences.toArray(new String[sentences.size()]), type);
}
public static String[][] normalizeSentences(String[] sentences) throws Exception {
return normalizeSentences(sentences, NormalizationType.SEARCH);
}
public static String[][] normalizeSentences(String[] sentences, NormalizationType type) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("type", type);
request.put("sentences", sentences);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_NORMALIZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected String[][], got: " + object.toString()));
}
return HttpUtils.toDoubleStringArray(new JSONArray(responseJson));
}
public static String[] normalizeSentence(String sentence) throws Exception {
return normalizeSentence(sentence, NormalizationType.SEARCH);
}
public static String[] normalizeSentence(String sentence, NormalizationType type) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("type", type);
request.put("sentence", sentence);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_NORMALIZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected String[], got: " + object.toString()));
}
return HttpUtils.toStringArray(new JSONArray(responseJson));
}
public static String[] normalizeWords(Collection<String> words) throws Exception {
return normalizeWords(words, NormalizationType.SEARCH);
}
public static String[] normalizeWords(Collection<String> words, NormalizationType type) throws Exception {
return normalizeWords(words.toArray(new String[words.size()]), type);
}
public static String[] normalizeWords(String[] words) throws Exception {
return normalizeWords(words, NormalizationType.SEARCH);
}
public static String[] normalizeWords(String[] words, NormalizationType type) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("type", type);
request.put("words", words);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_NORMALIZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected String[], got: " + object.toString()));
}
return HttpUtils.toStringArray(new JSONArray(responseJson));
}
public static String normalizeWord(String word) throws Exception {
return normalizeWord(word, NormalizationType.SEARCH)[0];
}
public static String[] normalizeWord(String word, NormalizationType type) throws Exception {
return normalizeWords(new String[] { word }, type);
}
/*----------------------------------------------------------------------------*/
public static MorphInfo[][][] analyzeText(String text) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("text", text);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_ANALYZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected MorphInfo[][][], got: " + object.toString()));
}
return HttpUtils.toTrippleMorphInfoArray(new JSONArray(responseJson));
}
public static MorphInfo[][][] analyzeSentences(Collection<String> sentences) throws Exception {
return analyzeSentences(sentences.toArray(new String[sentences.size()]));
}
public static MorphInfo[][][] analyzeSentences(String[] sentences) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("sentences", sentences);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_ANALYZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected MorphInfo[][][], got: " + object.toString()));
}
return HttpUtils.toTrippleMorphInfoArray(new JSONArray(responseJson));
}
public static MorphInfo[][] analyzeSentence(String sentence) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("sentence", sentence);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_ANALYZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected MorphInfo[][], got: " + object.toString()));
}
return HttpUtils.toDoubleMorphInfoArray(new JSONArray(responseJson));
}
public static MorphInfo[][] analyzeWords(Collection<String> words) throws Exception {
return analyzeWords(words.toArray(new String[words.size()]));
}
public static MorphInfo[][] analyzeWords(String[] words) throws Exception {
if(HebrewNLP.getPassword() == null) {
throw new IllegalStateException("Please set HebrewNLP.setPassword() method with your password before using this method. To get a password register at https://hebrew-nlp.co.il/registration.");
}
JSONObject request = new JSONObject();
request.put("token", HebrewNLP.getPassword());
request.put("words", words);
String requestJson = request.toString();
String responseJson = HttpUtils.postJSONData(MORPH_ANALYZE_ENDPOINT, requestJson);
if(!responseJson.startsWith("[")) {
JSONObject object = new JSONObject(responseJson);
throw new Exception(object.optString("error", "Expected MorphInfo[][], got: " + object.toString()));
}
return HttpUtils.toDoubleMorphInfoArray(new JSONArray(responseJson));
}
public static MorphInfo[] analyzeWord(String word) throws Exception {
return analyzeWords(new String[] { word })[0];
}
}
| [
"itay2805@protonmail.com"
] | itay2805@protonmail.com |
1baeb8aaadbdb256e8a94f3ebd10bbd56193a5a3 | af06d0343d5967c303cd85064b1dd758690284f7 | /src/main/java/uoc/ded/practica/exception/DEDException.java | dc38c9906e20df149f030af74660d61e52975fa6 | [] | no_license | alohalberto/EP2 | cc5b94ac770136208039dd0aaef9ba0a6b8f33c4 | 3f744cba5772be07436520723144b1c996c67362 | refs/heads/master | 2020-09-19T18:13:05.076996 | 2019-11-26T18:59:16 | 2019-11-26T18:59:16 | 224,260,848 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 135 | java | package uoc.ded.practica.exception;
public class DEDException extends Exception {
public DEDException(String msg) { super(msg); }
}
| [
"aggarcia_85@hotmail.com"
] | aggarcia_85@hotmail.com |
0a977175f261a80186d43c657eb0ee2d8f134c6f | 5adc7bd35964c3dd929b9f87ff16fad5e97d2243 | /src/org/zqt/ui/holder/CategoryTitleHolder.java | e0de3b32652cd1688507b75704e5613b0c7c3e29 | [] | no_license | QQiTong/qtmarket | 7090780e5627710aec840bda3ce84e0c10afbfd9 | 8bfec7dd36b02708eb3a1acd25051d553ee5b584 | refs/heads/master | 2022-12-25T17:49:29.544789 | 2022-12-14T14:23:23 | 2022-12-14T14:23:23 | 32,377,187 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 614 | java | package org.zqt.ui.holder;
import android.view.View;
import android.widget.TextView;
import org.zqt.R;
import org.zqt.bean.CategoryInfo;
import org.zqt.ui.activity.BaseActivity;
import org.zqt.utils.UIUtils;
/**
* Created by zqt on 2014/6/7.
*/
public class CategoryTitleHolder extends BaseHolder<CategoryInfo> {
private TextView mTextView;
@Override
protected View initView() {
View view = UIUtils.inflate(R.layout.category_item_title);
mTextView = (TextView) view.findViewById(R.id.tv_title);
return view;
}
@Override
public void refreshView() {
mTextView.setText(getData().getTitle());
}
}
| [
"sfs"
] | sfs |
e3a13e060b6b4b017685bfe3d5b7c64f34f7cf1d | 786d48794a9957d377aca967b8d95f80c5fa2120 | /jp.ac.nagoya_u.is.nces.a_rte.model/src/jp/ac/nagoya_u/is/nces/a_rte/model/rte/module/impl/ModeQueuedVariableImpl.java | a322126a7f9b7bf26be12d482287444863ffcf51 | [] | no_license | PizzaFactory/a-workflow-demo | 590dec0c1c3bed38394fca686cd798aebad60e7d | e98d95236bf78b7fe3ad8b64681b8594f3bdd4eb | refs/heads/master | 2020-06-13T17:47:15.225297 | 2016-12-05T00:30:24 | 2016-12-05T00:30:24 | 75,572,426 | 0 | 1 | null | 2016-12-05T00:30:26 | 2016-12-04T23:51:29 | Java | UTF-8 | Java | false | false | 5,321 | java | /*
* TOPPERS/A-RTEGEN
* Automotive Runtime Environment Generator
*
* Copyright (C) 2013-2016 by Eiwa System Management, Inc., JAPAN
*
* 上記著作権者は,以下の(1)〜(4)の条件を満たす場合に限り,本ソフトウェ
* ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
* 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
* (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
* 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
* スコード中に含まれていること.
* (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
* 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
* 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
* の無保証規定を掲載すること.
* (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
* 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
* と.
* (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
* 作権表示,この利用条件および下記の無保証規定を掲載すること.
* (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
* 報告すること.
* (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
* 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
* また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
* 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
* 免責すること.
*
* 本ソフトウェアは,AUTOSAR(AUTomotive Open System ARchitecture)仕
* 様に基づいている.上記の許諾は,AUTOSARの知的財産権を許諾するもので
* はない.AUTOSARは,AUTOSAR仕様に基づいたソフトウェアを商用目的で利
* 用する者に対して,AUTOSARパートナーになることを求めている.
*
* 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
* よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
* に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
* アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
* の責任を負わない.
*
* $Id $
*/
/**
*/
package jp.ac.nagoya_u.is.nces.a_rte.model.rte.module.impl;
import jp.ac.nagoya_u.is.nces.a_rte.model.rte.module.ModeQueueType;
import jp.ac.nagoya_u.is.nces.a_rte.model.rte.module.ModeQueuedVariable;
import jp.ac.nagoya_u.is.nces.a_rte.model.rte.module.ModulePackage;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Mode Queued Variable</b></em>'.
* <!-- end-user-doc -->
* <p>
* The following features are implemented:
* <ul>
* <li>{@link jp.ac.nagoya_u.is.nces.a_rte.model.rte.module.impl.ModeQueuedVariableImpl#getQueueType <em>Queue Type</em>}</li>
* </ul>
* </p>
*
* @generated
*/
public class ModeQueuedVariableImpl extends GlobalVariableImpl implements ModeQueuedVariable {
/**
* The cached setting delegate for the '{@link #getQueueType() <em>Queue Type</em>}' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getQueueType()
* @generated
* @ordered
*/
protected EStructuralFeature.Internal.SettingDelegate QUEUE_TYPE__ESETTING_DELEGATE = ((EStructuralFeature.Internal)ModulePackage.Literals.MODE_QUEUED_VARIABLE__QUEUE_TYPE).getSettingDelegate();
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ModeQueuedVariableImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return ModulePackage.Literals.MODE_QUEUED_VARIABLE;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public ModeQueueType getQueueType() {
return (ModeQueueType)QUEUE_TYPE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
case ModulePackage.MODE_QUEUED_VARIABLE__QUEUE_TYPE:
return getQueueType();
}
return super.eGet(featureID, resolve, coreType);
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
case ModulePackage.MODE_QUEUED_VARIABLE__QUEUE_TYPE:
return QUEUE_TYPE__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
}
return super.eIsSet(featureID);
}
} //ModeQueuedVariableImpl
| [
"monaka@monami-ya.com"
] | monaka@monami-ya.com |
bd753e9bd31812604ede2146d587b0494891bc4d | 1f634e822f0a0a3f3fc3ea06f9e6eb98a07d6f95 | /app/src/main/java/com/example/daytwo/MainActivity.java | 39f54a26a775997d3804ca242ce8671475ff74aa | [] | no_license | shubhangidk/DayTwo | 6cff5872158209ff5504ea2d5663c1e65722d0fc | b283744d9c62f565e20de9fc3c07799bbddd05e9 | refs/heads/master | 2020-07-28T03:11:57.682080 | 2019-09-18T11:19:03 | 2019-09-18T11:19:03 | 209,289,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 739 | java | package com.example.daytwo;
import androidx.appcompat.app.AppCompatActivity;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.RelativeLayout;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
RelativeLayout relativeLayout =findViewById(R.id.Layout_parent);
AnimationDrawable animationDrawable = (AnimationDrawable) relativeLayout.getBackground();
animationDrawable.setEnterFadeDuration(3000);
animationDrawable.setExitFadeDuration(1000);
animationDrawable.start();
}
}
| [
"payalvarade@gmail.com"
] | payalvarade@gmail.com |
6e1edfb3e99f37926e1461263a12ae9fe326b1ae | c9becf552b0612c533e421fae9daadf93031e843 | /green-service/src/main/java/com/yajun/green/repository/xiaoshou/XiaoShouForCarrierDao.java | 65279def9f390e66addaa7b9ddd2d68e54b3bd37 | [] | no_license | ChanceSpace/yunliplatform | 55eee6a58ee08ab17158f22629868bb36f98d571 | a643597c9f9d5dba689f3238e6e587addcb3f39f | refs/heads/master | 2020-05-21T09:08:11.030576 | 2019-04-11T14:11:48 | 2019-04-11T14:11:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 662 | java | package com.yajun.green.repository.xiaoshou;
import com.yajun.green.domain.xiaoshou.XiaoShouContact;
import com.yajun.green.repository.EntityObjectDao;
import java.util.List;
/**
* Created by LiuMengKe on 2018/1/2.
*/
public interface XiaoShouForCarrierDao extends EntityObjectDao {
List<XiaoShouContact> findOverviewZuPinContact(String keyWords, String userUuid, String startTime, String endTime, String sortBy, String sortWay, String contactStatus, int startPosition, int pageSize);
int findOverviewXiaoShouContactSize(String keyWords, String userUuid, String startTime, String endTime, String sortBy, String sortWay, String contactStatus);
}
| [
"376952632@qq.com"
] | 376952632@qq.com |
fbf8577100022d5bf10360b41904e66e0cd674c3 | 849b2146edd686cb97b0d4a69e5d57a64bec4766 | /app/src/main/java/com/zhuoren/aveditor/common/Logger.java | d3f449753be2157061639c91602c61940ec3c0c0 | [] | no_license | wuwuhuai/FFmpeg | 32c584f42942a784147c9c78e2cea331c10ace22 | a8921d4b3122512b45a22f1b465a60e1f3663a12 | refs/heads/master | 2023-06-02T13:47:59.579647 | 2021-06-22T10:25:25 | 2021-06-22T10:25:25 | 241,993,101 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 552 | java | package com.zhuoren.aveditor.common;
import android.util.Log;
public class Logger {
private static final String TAG = "aveditor_Logger";
public static void d(String tag, String message) {
Log.d(tag, message);
}
public static void e(String tag, String message, Throwable throwable) {
Log.e(tag, message, throwable);
}
public static void d(String message) {
Log.d(TAG, message);
}
public static void e(String message, Throwable throwable) {
Log.e(TAG, message, throwable);
}
}
| [
"wuwuhuai@163.com"
] | wuwuhuai@163.com |
30f15a78116e59b5cba8acf9d272d448665ecea7 | b70f3e0c52daf98aabadc02e3acaeede727f1ab9 | /src/mctsbot/actions/RaiseAction.java | cd8feab6f0bc18823d78cc27c776192c237a753d | [
"MIT",
"CC-BY-4.0"
] | permissive | jinyiabc/mctsbot | 552fed79fed0e91d34932cd58d3297599fc7f184 | e942a70d0f72cf6763b26bf5a0bde67c8af20025 | refs/heads/master | 2020-12-21T07:19:29.110375 | 2018-04-29T18:50:54 | 2018-04-29T18:52:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 363 | java | package mctsbot.actions;
public class RaiseAction implements Action {
private static final long serialVersionUID = 1L;
private final double amount;
public RaiseAction(double amount) {
this.amount = amount;
}
public double getAmount() {
return amount;
}
public String getDescription() {
return "Raise_" + amount;
}
}
| [
"david@davidxmoody.com"
] | david@davidxmoody.com |
f4e03dafec902be61eaaf52967bd2707e123cee4 | 4013870a9fb395c4ac272f8cc77c8d4f69a148fc | /src/main/java/com/hashmap/exception/InSufficientBalance.java | e73fa0451eb67f49c307ab6b063b5e38183e31bd | [] | no_license | VikashSingh94/auction-management-system | 193dacb767d9696288400f8a4b70978ac0c66dd0 | 4db3660ca0b62e5f665690ed7ebb2cb7409345f0 | refs/heads/master | 2021-05-09T13:50:36.818132 | 2018-02-12T09:09:51 | 2018-02-12T09:09:51 | 119,048,954 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 152 | java | package com.hashmap.exception;
public class InSufficientBalance extends Exception{
public InSufficientBalance(String s){
super(s);
}
}
| [
"singhvikash301094@gmail.com"
] | singhvikash301094@gmail.com |
a64059bf4e13bc88ed7fe2846d226ee4a7814212 | 5e06293b1702e3bcd204fb55b59e3e8106b5cc37 | /app/src/main/java/com/sophiaxiang/wanderlust/GenderSetUpActivity.java | 61058dfa47f23d7ae0c6aa43dc57ab66ad17e380 | [] | no_license | huntermonk/Wanderlust | c972c5313542a7365e469e5de57be97908b36492 | 4d548dfd1b2ff40780ecf8e1e835def01e4bc168 | refs/heads/master | 2023-07-04T19:25:34.646586 | 2021-08-05T00:07:18 | 2021-08-05T00:07:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,900 | java | package com.sophiaxiang.wanderlust;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.sophiaxiang.wanderlust.databinding.ActivityGenderSetUpBinding;
public class GenderSetUpActivity extends AppCompatActivity {
public static final String TAG = "GenderSetUpActivity";
private static final String[] GENDER_CHOICES = {"select a gender...", "female", "male", "other"};
private ActivityGenderSetUpBinding mBinding;
private DatabaseReference mDatabase;
private String mUserId;
private String mGender;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_gender_set_up);
mDatabase = FirebaseDatabase.getInstance().getReference();
mUserId = getIntent().getStringExtra("user id");
setUpSpinner();
mBinding.btnContinue.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mGender.equals("")) {
Toast.makeText(GenderSetUpActivity.this, "Please select a gender!", Toast.LENGTH_SHORT).show();
return;
}
saveGender();
goHometownSetUp();
}
});
}
private void setUpSpinner() {
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
R.layout.item_spinner, GENDER_CHOICES) {
@Override
public View getDropDownView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
View view = super.getDropDownView(position, convertView, parent);
TextView tv = (TextView) view;
if (position == 0) {
// Set the hint text color gray
tv.setTextColor(Color.GRAY);
} else {
tv.setTextColor(Color.BLACK);
}
return view;
}
};
adapter.setDropDownViewResource(R.layout.item_spinner);
mBinding.spinnerGenderSetUp.setAdapter(adapter);
mBinding.spinnerGenderSetUp.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
String selectedItemText;
switch (position) {
case 0:
mGender = "";
break;
case 1:
case 2:
case 3:
selectedItemText = (String) parent.getItemAtPosition(position);
mGender = selectedItemText;
break;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {
mGender = "";
}
});
}
private void saveGender() {
mDatabase.child("users").child(mUserId).child("gender").setValue(mGender);
}
private void goHometownSetUp() {
Intent intent = new Intent(GenderSetUpActivity.this, FromSetUpActivity.class);
intent.putExtra("user id", mUserId);
startActivity(intent);
overridePendingTransition(R.anim.fadein, R.anim.fadeout);
}
} | [
"sophiatxiang@gmail.com"
] | sophiatxiang@gmail.com |
c5e8a482b64b846dc6504a6e8f0ab52698672927 | c33cc79cfdbcb9a4f8e9d86328fe3a41d2e64773 | /app/src/main/java/org/android/wilis/LaporKecelakaan.java | ca8527a19ed93fbe00ae9c7aadfe70f132533bfc | [] | no_license | radinaldn/AR-LocationBased | 8e71b2f4eac2dce70e14512252552e91c82a7308 | 8587fee1e376f793de2d160450fcd7a0c8d887ca | refs/heads/master | 2021-07-17T22:11:48.964215 | 2017-10-26T00:45:52 | 2017-10-26T00:45:52 | 107,912,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 14,212 | java | package org.android.wilis;
import android.app.Activity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.Matrix;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.location.LocationProvider;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.StrictMode;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.Date;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Random;
/**
* Created by Rian on 06/10/2017.
*/
public class LaporKecelakaan extends Activity {
String id_user, username, email;
SharedPreferences sharedpreferences;
public static final String TAG_ID = "id_user";
public static final String TAG_USERNAME = "username";
public static final String TAG_EMAIL = "email";
// end of session
LocationManager lm;
LocationListener locationListener;
// object class LaporKecelakaanAction
LaporKecelakaanAction laporKecelakaan = new LaporKecelakaanAction();
// Variable
EditText alamat, foto, detail;
Button submit, clear, btnCamera;
TextView tvlat, tvlng;
String lat, lng;
// initiate capt cam
private ImageView ivImage;
private ConnectionDetector cd;
private Boolean upflag = false;
private Uri selectedImage = null;
private Bitmap bitmap, bitmapRotate;
private ProgressDialog pDialog;
String imagepath = "";
String fname;
File file;
// class for get current location
private class MyLocationListener implements LocationListener {
@Override
public void onLocationChanged(Location loc) {
if (loc != null){
lat = String.valueOf(loc.getLatitude());
tvlat.setText(lat);
lng = String.valueOf(loc.getLongitude());
tvlng.setText(lng);
}
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
String statusString = "";
switch (status){
case LocationProvider.AVAILABLE:
statusString = "available";
case LocationProvider.OUT_OF_SERVICE:
statusString = "out of service";
case LocationProvider.TEMPORARILY_UNAVAILABLE:
statusString = "temporarily unavailable";
}
Toast.makeText(getBaseContext(),
provider+ " " +statusString,
Toast.LENGTH_SHORT).show();
}
@Override
public void onProviderEnabled(String provider) {
Toast.makeText(getBaseContext(),
"Provider: " +provider+ " enabled",
Toast.LENGTH_SHORT).show();
}
@Override
public void onProviderDisabled(String provider) {
Toast.makeText(getBaseContext(),
"Provider: " +provider+ " disabled",
Toast.LENGTH_SHORT).show();
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//-use the LocationManager class to obtain location data
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
locationListener = new MyLocationListener();
// Object initialization
cd = new ConnectionDetector(LaporKecelakaan.this);
cd = new ConnectionDetector(getApplicationContext());
showLayout();
}
@Override
protected void onResume(){
super.onResume();
//-request for location update using GPS
lm.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
//LocationManager.GPS_PROVIDER,
0,
0,
locationListener);
}
@Override
public void onBackPressed() {
// TODO Auto-generated method stub
super.onBackPressed();
// session
sharedpreferences = getSharedPreferences(Login.my_shared_preferences, Context.MODE_PRIVATE);
id_user = getIntent().getStringExtra(TAG_ID);
username = getIntent().getStringExtra(TAG_USERNAME);
email = getIntent().getStringExtra(TAG_EMAIL);
Intent intent = new Intent(LaporKecelakaan.this, MainActivity.class);
intent.putExtra(TAG_ID, id_user);
intent.putExtra(TAG_USERNAME, username);
intent.putExtra(TAG_EMAIL, email);
finish();
startActivity(intent);
}
@Override
protected void onDestroy() {
super.onDestroy();
//--remove the location listener--
lm.removeUpdates(locationListener);
}
private void showLayout() {
setContentView(R.layout.layout);
// tambahan agar bisa insert data ke server
if (android.os.Build.VERSION.SDK_INT > 9) {
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder()
.permitAll().build();
StrictMode.setThreadPolicy(policy);
}
// end of tambahan
alamat = (EditText) findViewById(R.id.etalamat);
detail = (EditText) findViewById(R.id.etdetail);
submit = (Button) findViewById(R.id.btsubmit);
clear = (Button) findViewById(R.id.btclear);
tvlat = (TextView) findViewById(R.id.tvlat);
tvlng = (TextView) findViewById(R.id.tvlng);
ivImage = (ImageView) findViewById(R.id.ivImage);
btnCamera = (Button) findViewById(R.id.btnCamera);
btnCamera.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent cameraintent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraintent, 101);
}
});
submit.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
tambahKecelaakaan();
}
});
clear.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
showLayout();
}
});
}
private void tambahKecelaakaan() {
// get datetime
Date currentTime = Calendar.getInstance().getTime();
// convert to dateTime format
SimpleDateFormat date24Format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//
if (cd.isConnectingToInternet()) {
if (!upflag) {
Toast.makeText(getApplicationContext(), "Image Not Captured..!", Toast.LENGTH_LONG).show();
} else {
saveFile(bitmapRotate, file);
}
} else {
Toast.makeText(getApplicationContext(), "No Internet Connection !", Toast.LENGTH_LONG).show();
}
// session
sharedpreferences = getSharedPreferences(Login.my_shared_preferences, Context.MODE_PRIVATE);
id_user = getIntent().getStringExtra(TAG_ID);
username = getIntent().getStringExtra(TAG_USERNAME);
String etalamat = alamat.getText().toString();
//String etfoto = foto.getText().toString();
String etfoto = fname;
String etdetail = detail.getText().toString();
String waktupelaporan = date24Format.format(currentTime);
System.out.println("ID User : " +id_user+ " Alamat : " +etalamat+ " Foto : " +etfoto+ " Tanggal Waktu : " +waktupelaporan+ " Detail : " +etdetail+ " Lat : " +lat+ " Lng : " +lng);
// pengecekkan form tidak boleh kosong
if ((etalamat).equals("") || (etfoto).equals("") || (etdetail).equals("") || (lat).equals("") || (lng).equals("")){
Toast.makeText(LaporKecelakaan.this, "Data kecelakaan tidak boleh kosong", Toast.LENGTH_SHORT).show();
} else {
String laporan = laporKecelakaan.insertKecelakaan(id_user, etalamat, etfoto, waktupelaporan, etdetail, lat, lng);
Toast.makeText(LaporKecelakaan.this, laporan, Toast.LENGTH_SHORT).show();
finish();
startActivity(getIntent());
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
try {
switch (requestCode) {
case 101:
if (resultCode == Activity.RESULT_OK) {
if (data != null) {
selectedImage = data.getData(); // the uri of the image taken
if (String.valueOf((Bitmap) data.getExtras().get("data")).equals("null")) {
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImage);
} else {
bitmap = (Bitmap) data.getExtras().get("data");
}
if (Float.valueOf(getImageOrientation()) >= 0) {
bitmapRotate = rotateImage(bitmap, Float.valueOf(getImageOrientation()));
} else {
bitmapRotate = bitmap;
bitmap.recycle();
}
ivImage.setVisibility(View.VISIBLE);
ivImage.setImageBitmap(bitmapRotate);
// Saving image to mobile internal memory for sometime
String root = getApplicationContext().getFilesDir().toString();
File myDir = new File(root + "/androidlift");
myDir.mkdirs();
Random generator = new Random();
int n = 10000;
n = generator.nextInt(n);
// Give the file name that u want
fname = "laka" + n + ".png";
imagepath = root + "/androidlift/" + fname;
file = new File(myDir, fname);
upflag = true;
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
super.onActivityResult(requestCode, resultCode, data);
}
public static Bitmap rotateImage(Bitmap source, float angle) {
Bitmap retVal;
Matrix matrix = new Matrix();
matrix.postRotate(angle);
retVal = Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true);
return retVal;
}
// In some mobiles image will get rotate so to correting that this code will help us
private int getImageOrientation() {
final String[] imageColumns = {MediaStore.Images.Media._ID, MediaStore.Images.ImageColumns.ORIENTATION};
final String imageOrderBy = MediaStore.Images.Media._ID + " DESC";
Cursor cursor = getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
imageColumns, null, null, imageOrderBy);
if (cursor.moveToFirst()) {
int orientation = cursor.getInt(cursor.getColumnIndex(MediaStore.Images.ImageColumns.ORIENTATION));
System.out.println("orientation===" + orientation);
cursor.close();
return orientation;
} else {
return 0;
}
}
// Saving file to the mobile internal memory
private void saveFile(Bitmap sourceUri, File destination) {
if (destination.exists()) destination.delete();
try {
FileOutputStream out = new FileOutputStream(destination);
sourceUri.compress(Bitmap.CompressFormat.PNG, 100, out);
out.flush();
out.close();
if (cd.isConnectingToInternet()) {
new DoFileUpload().execute();
} else {
Toast.makeText(LaporKecelakaan.this, "No Internet Connection..", Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}
}
class DoFileUpload extends AsyncTask<String, String, String> {
@Override
protected void onPreExecute() {
pDialog = new ProgressDialog(LaporKecelakaan.this);
pDialog.setMessage("wait uploading Image..");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
@Override
protected String doInBackground(String... params) {
try {
// Set your file path here
FileInputStream fstrm = new FileInputStream(imagepath);
// Set your server page url (and the file title/description)
HttpFileUpload hfu = new HttpFileUpload("http://192.168.1.101/ar2/file_upload.php", "ftitle", "fdescription", fname);
upflag = hfu.Send_Now(fstrm);
} catch (FileNotFoundException e) {
// Error: File not found
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(String file_url) {
if (pDialog.isShowing()) {
pDialog.dismiss();
}
if (upflag) {
Toast.makeText(getApplicationContext(), "Uploading Complete", Toast.LENGTH_LONG).show();
} else {
Toast.makeText(getApplicationContext(), "Unfortunately file is not Uploaded..", Toast.LENGTH_LONG).show();
}
}
}
}
| [
"radinal.dwiki.novendra@students.uin-suska.ac.id"
] | radinal.dwiki.novendra@students.uin-suska.ac.id |
f7890a8438a50061908e130ac28ea196a70c3ed5 | 42132df67e3e50c3d0b62fd9d024b6b5660510a8 | /src/main/java/store/BasketBean.java | 7f316be05a2adf876e575655afce833ff049827a | [] | no_license | spr15bd/webstore | 788ad3de3c114a56adeefb5ee31570da404e5d56 | 2500118cf5007d8f79a080b2580e5dc7f954b8d8 | refs/heads/master | 2020-09-27T16:27:35.016441 | 2016-08-24T21:01:56 | 2016-08-24T21:01:56 | 66,499,363 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,786 | java | /* BasketBean.java - this class is used to create the shopping basket object. It uses an ArrayList to hold the ItemBean objects (items). */
package store;
import java.util.ArrayList;
public class BasketBean {
private double totalPrice=0;
private ItemBean item=new ItemBean();
private ArrayList <ItemBean> itemsInBasket=new ArrayList<ItemBean>();
boolean containsItem=false;
// Add an item to the basket.
public void setItemBean(ItemBean item) {
for (int i=0; i<itemsInBasket.size(); i++) {
// First, find out if the item has already been added to the basket.
ItemBean alreadyAddedItem=getItemBean(i);
// If it has, update the quantity of the item.
if (alreadyAddedItem.getProductid()==item.getProductid()) {
alreadyAddedItem.increaseQuantity(item.getQuantity());
// (This increases quantity by the number of identical items you're adding).
containsItem=true;
}
}
if (!containsItem) {
// If it hasn't, add the item to the basket and reset the boolean for next time.
itemsInBasket.add(item);
containsItem=false;
}
}
// Retrieve an item from the specified position in the basket.
public ItemBean getItemBean(int position) {
return (ItemBean)itemsInBasket.get(position);
}
// Retrieve the number of different product types in the basket.
public int getSize() {
return itemsInBasket.size();
}
// Remove an item type.
public void removeItemBean(int position) {
item = getItemBean(position);
totalPrice=totalPrice-item.getTotalPrice();
itemsInBasket.remove(position);
}
// Retrieve the total price.
public double getTotalPrice() {
totalPrice=0;
for (int x=0; x<itemsInBasket.size(); x++) {
item=(ItemBean)itemsInBasket.get(x);
totalPrice=totalPrice+item.getTotalPrice();
}
return totalPrice;
}
}
| [
"bevandady@gmail.com"
] | bevandady@gmail.com |
2c348d3490ad15d1bb59306010700752a4140a37 | e83f2b77913910a00c8db30c2210163f8bbf51a1 | /src/main/java/pl/coderslab/charity/HomeController.java | 293117fe5f70bf1e06606c076c13b2adbeb094a4 | [] | no_license | PiotrBoKar/charity | 4498e8016b24cf3332826adac22edc0360284073 | 82819f0390f2356291ea1bce76c6a540e2f00344 | refs/heads/master | 2022-11-20T12:49:14.094817 | 2020-07-15T18:33:27 | 2020-07-15T18:33:27 | 278,954,189 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,180 | java | package pl.coderslab.charity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import pl.coderslab.charity.donation.DonationRepository;
import pl.coderslab.charity.institution.InstitutionDao;
import pl.coderslab.charity.institution.InstitutionRepository;
@Controller
public class HomeController {
@Autowired
DonationRepository donationRepository;
@Autowired
InstitutionRepository institutionRepository;
private final InstitutionDao institutionDao;
public HomeController(InstitutionDao institutionDao) {
this.institutionDao = institutionDao;
}
@RequestMapping("/")
public String homeAction(Model model) {
model.addAttribute("institution", institutionRepository.findAll());
model.addAttribute("donations", donationRepository.count());
model.addAttribute("sum", donationRepository.selectTotals());
return "index";
}
@RequestMapping("/confirmation")
public String confirmation(){
return "confirmation";
}
}
| [
"piotr.bober0@gmail.com"
] | piotr.bober0@gmail.com |
5d7049debd531917ebfc51405915235bd66a2ed8 | e59b7bdce6171a903cbb331d81308c47f5829c1f | /Other/src/com/apcompsci/Club/CreateAccount.java | ff8955952a1bcafa94698fbc073a8639ec8e185b | [] | no_license | indianpoptart/ApCompSciProjects | 4f783ab6cf8545b2be3220770e8c97345d58a313 | 7354f2740dda97393f89f17e115620d5e31b172c | refs/heads/master | 2020-04-11T03:03:03.046350 | 2014-04-06T02:06:20 | 2014-04-06T02:06:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,045 | java | package com.apcompsci.Club;
import java.util.Scanner;
public class CreateAccount {
private String username, password;
private Scanner scan;
private double bal;
private int psLength;
public CreateAccount (String u , String pass , double balance){
username = u;
password = pass;
bal = balance;
}
public CreateAccount(double balance){
scan =new Scanner(System.in);
String epass, name;
String regex = "^(?=.*?\\p{Lu})(?=.*?[\\p{L}&&[^\\p{Lu}]])(?=.*?\\d)" + "(?=.*?[`~!@#$%^&*()\\-_=+\\\\\\|\\[{\\]};:'\",<.>/?]).*$";
boolean n = true;
while(n) {
System.out.println("What is your name");
name= scan.next();
System.out.println("Type in a username you want " + name);
username= scan.next();
System.out.println("Type in a password for your account");
password= scan.next();
if(!password.contains(regex)){
System.out.println("Your password is unsecure, please try to add numbers, symbols, and case sensitive letters");
System.out.println(regex);
password = scan.next();
if(!password.contains(regex)){
System.out.println("Your password is unsecure, please try to add numbers, symbols, and case sensitive letters");
System.out.println(regex);
password = scan.next();
}
}
epass= ""+password.charAt(0);
for(int i = 0; i<password.length()-2; i++){
epass += "*";
}
String woah = null;
String regFind = null;
//epass += password.charAt(password.length()-1);
psLength = password.length();
if(password.equalsIgnoreCase(regex)){
regFind = "Wow, just using my regex string";
System.out.println(regFind);
}
if(password.length() > 50){
woah = "What is with the long password bro";
}
System.out.println("Verify that this is correct, " + name +" =======>"+ " Username: " + " "+ username + " Password: " +" "+ epass);
System.out.println("Your password is " + psLength + " units long");
System.out.println(woah);
System.out.println("If this is correct press y, if not n");
String line1= scan.next();
if (line1.equalsIgnoreCase("y")){
n=false;
}
}
System.out.println("Continue to add your deposit");
System.out.println("Type in how much balance you would like, THESE ARE LOANS DONOT ENTER LARGE AMOUNTS");
initialbal ();
}
private void initialbal(){
try{
bal = Double.parseDouble(scan.next());
if (bal < 0){
System.out.println("This is an illegal operation");
initialbal ();
}
else if(bal > 10000000){
}
else{
System.out.println("Okay, your account is set-up, you have: "+ "$" + bal + " in your account, please proceed f or validation");
}
}
catch(Exception e){
System.out.println("Please enter valid number!");
initialbal ();
}
}
public void setBal(double bal1){
bal= bal1;
}
public double getBal(){
return bal;
}
public String getUsername(){
return username;
}
public String getPassword(){
return password;
}
public String accinfo(){
return username + " " + password + " " + bal + "\n";
}
} | [
"nikhil1.paranjape@gmail.com"
] | nikhil1.paranjape@gmail.com |
b660b859397b68cd5b28a2f160ccd3e1de986dd5 | 8239091c8c9cf73b080f1be0bf428df871411d33 | /src/telas/Deletar.java | 0a36133da196e864b01ecfa705b1bbb45820efcf | [] | no_license | dhLra/CRUD-Java | 73d488f6581e1d3326d77ca3c74927f67d433a76 | 5b6c2430342089588a60b111a7c5dec2a23e2adf | refs/heads/master | 2022-11-26T20:47:50.520314 | 2020-08-08T18:33:50 | 2020-08-08T18:33:50 | 283,393,428 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 42 | java | package telas;
public class Deletar {
}
| [
"dhiegolira11@gmail.com"
] | dhiegolira11@gmail.com |
64442bd1b2a405078868af695e6ebb48a151afca | 53f18124d8e7f24cc497b1f953d9b96f8bc4f74c | /Java-Eclipse/List/Prog5.java | 135cf33b60bf77c6b92c4ea3310da47c299beead | [] | no_license | aakashvarma/java | 603e52744ed3d0ba56ee6ea532ea7cfba0f3e487 | 1c1a2ef77cc94b93ddce26702d761fe911eb6956 | refs/heads/master | 2020-04-19T19:38:02.593498 | 2019-06-26T16:20:27 | 2019-06-26T16:20:27 | 168,393,751 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 633 | java | import java.util.LinkedList;
import java.util.Vector;
class Prog5{
public static void main(String[] args){
LinkedList<String> months = new LinkedList<>();
months.add("January");
months.add("February");
months.add("March");
months.add("April");
months.add("May");
months.add("June");
months.add("July");
months.add("August");
months.add("September");
months.add("October");
months.add("November");
months.add("December");
for(int i = 0; i < months.size(); i++)
System.out.println(months.get(i));
}
} | [
"aakashvarma18@gmail.com"
] | aakashvarma18@gmail.com |
53ce609f979cc3becc2b8741eb1dfd2f5e81c3c8 | 725b0c33af8b93b557657d2a927be1361256362b | /com/planet_ink/coffee_mud/WebMacros/WebServerPort.java | 0cb4f60e8cd4cf306b4f3c3c37fc32726c000906 | [
"Apache-2.0"
] | permissive | mcbrown87/CoffeeMud | 7546434750d1ae0418ac2c76d27f872106d2df97 | 0d4403d466271fe5d75bfae8f33089632ac1ddd6 | refs/heads/master | 2020-12-30T19:23:07.758257 | 2014-06-25T00:01:20 | 2014-06-25T00:01:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,184 | java | package com.planet_ink.coffee_mud.WebMacros;
import com.planet_ink.miniweb.interfaces.*;
import com.planet_ink.miniweb.util.MWThread;
import com.planet_ink.miniweb.util.MiniWebConfig;
import com.planet_ink.coffee_mud.core.interfaces.*;
import com.planet_ink.coffee_mud.core.*;
import com.planet_ink.coffee_mud.core.collections.*;
import com.planet_ink.coffee_mud.Abilities.interfaces.*;
import com.planet_ink.coffee_mud.Areas.interfaces.*;
import com.planet_ink.coffee_mud.Behaviors.interfaces.*;
import com.planet_ink.coffee_mud.CharClasses.interfaces.*;
import com.planet_ink.coffee_mud.Libraries.interfaces.*;
import com.planet_ink.coffee_mud.Common.interfaces.*;
import com.planet_ink.coffee_mud.Exits.interfaces.*;
import com.planet_ink.coffee_mud.Items.interfaces.*;
import com.planet_ink.coffee_mud.Locales.interfaces.*;
import com.planet_ink.coffee_mud.MOBS.interfaces.*;
import com.planet_ink.coffee_mud.Races.interfaces.*;
import java.util.*;
/*
Copyright 2000-2014 Bo Zimmerman
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.
*/
public class WebServerPort extends StdWebMacro
{
@Override public String name() {return "WebServerPort";}
@Override
public String runMacro(HTTPRequest httpReq, String parm)
{
final java.util.Map<String,String> parms=parseParms(parm);
if(parms.containsKey("CURRENT"))
return Integer.toString(httpReq.getClientPort());
if(Thread.currentThread() instanceof MWThread)
{
final MiniWebConfig config=((MWThread)Thread.currentThread()).getConfig();
return CMParms.toStringList(config.getHttpListenPorts());
}
return Integer.toString(httpReq.getClientPort());
}
}
| [
"bo@0d6f1817-ed0e-0410-87c9-987e46238f29"
] | bo@0d6f1817-ed0e-0410-87c9-987e46238f29 |
842cf041eb410a712844e680070b1e5f4a6c8dbc | 3f6074b00037a4166406f78355a29f5dd55c05bb | /Practice/src/com/nit/Inheritance/S1.java | 22422fd73a5ca1a1473a0b0bcc238b2041d620d6 | [] | no_license | Satish-BaldiReddi/javaprograms | deba5fa694c30b1d20ed97aa98fabb4a06a1a988 | 44faa2ca10e9fdc508ccfcb0b74aaddee18b0f45 | refs/heads/master | 2023-05-03T04:20:37.058510 | 2023-04-14T05:34:42 | 2023-04-14T05:34:42 | 258,198,590 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 459 | java | package com.nit.Inheritance;
public class S1 {
static int a=10;
static {
System.out.println("S SB");
}
static void m1(){
System.out.println("S m1");
}
}
class L extends S1 {
static int b=20;
static {
System.out.println("L SB");
}
}
class Test05{
public static void main(String[] args) {
System.out.println(L.class);
System.out.println(L.a);
System.out.println(L.b);
}
}
| [
"satishsatya7997@gmail.com"
] | satishsatya7997@gmail.com |
5b896c07e8a1fd6fb5622c6ec1309713cc8103e3 | 2a526499beb986f9b00a65b7d5604fa335a393c3 | /src/main/java/com/axibase/tsd/driver/jdbc/strategies/storage/FileChannelIterator.java | 6e3f9e94cd1909a8a8bd9496281eda3cb1d8f51a | [
"Apache-2.0"
] | permissive | gitreal/atsd-jdbc | b6967d1340657d86c98382ddc2de174d7c825200 | 2335a15c121b34cf4e0773abfb34a8c21e813488 | refs/heads/master | 2021-01-12T21:05:08.905579 | 2016-03-29T16:08:10 | 2016-03-29T16:08:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,385 | java | /*
* Copyright 2016 Axibase Corporation or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* https://www.axibase.com/atsd/axibase-apache-2.0.pdf
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.axibase.tsd.driver.jdbc.strategies.storage;
import java.io.IOException;
import java.nio.channels.AsynchronousFileChannel;
import java.nio.channels.FileLock;
import java.nio.channels.OverlappingFileLockException;
import java.util.Iterator;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.locks.ReentrantLock;
import com.axibase.tsd.driver.jdbc.content.StatementContext;
import com.axibase.tsd.driver.jdbc.ext.AtsdException;
import com.axibase.tsd.driver.jdbc.logging.LoggingFacade;
import com.axibase.tsd.driver.jdbc.strategies.IteratorData;
import com.axibase.tsd.driver.jdbc.strategies.StrategyStatus;
public class FileChannelIterator<T> implements Iterator<String[]>, AutoCloseable {
private static final LoggingFacade logger = LoggingFacade.getLogger(FileChannelIterator.class);
private static final int PART_LENGTH = 1 * 1024 * 1024;
private final ReentrantLock lock = new ReentrantLock();
private final AsynchronousFileChannel readChannel;
private final StrategyStatus status;
private final IteratorData data;
public FileChannelIterator(final AsynchronousFileChannel readChannel, final StatementContext context,
final StrategyStatus status) {
this.readChannel = readChannel;
this.status = status;
data = new IteratorData(context);
}
@Override
public boolean hasNext() {
if (status.isInProgress() || data.getPosition() < status.getCurrentSize())
return true;
if (logger.isDebugEnabled())
logger.debug("[hasNext->false] comments: " + data.getComments().length());
return false;
}
@Override
public String[] next() {
String[] found = data.getNext(false);
if (found != null) {
return found;
}
while (true) {
if (!status.isInProgress() && status.getCurrentSize() <= data.getPosition()) {
if (logger.isDebugEnabled())
logger.debug("[next] stop iterating with " + status.isInProgress() + ' ' + status.getCurrentSize()
+ ' ' + data.getPosition());
return null;
}
while (status.getLockPosition() <= data.getPosition()) {
if (logger.isDebugEnabled())
logger.debug("[next] waiting for the next section: " + data.getPosition());
try {
Thread.sleep(100);
} catch (InterruptedException e) {
logger.error(e.getMessage(), e);
}
if (!status.isInProgress()) {
break;
}
}
if (logger.isTraceEnabled())
logger.trace("[next] try read lock: " + data.getPosition());
Future<FileLock> fileLock;
try {
fileLock = readChannel.lock(data.getPosition(), PART_LENGTH, true);
while (!fileLock.isDone()) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
logger.error(e.getMessage(), e);
}
}
} catch (OverlappingFileLockException e) {
if (logger.isTraceEnabled())
logger.trace("[next] overlapped");
try {
Thread.sleep(500);
} catch (InterruptedException e1) {
logger.error(e1.getMessage(), e1);
}
continue;
}
if (logger.isTraceEnabled())
logger.trace("[next] locked on read: " + data.getPosition());
Future<Integer> operation = readChannel.read(data.getBuffer(), data.getPosition());
while (!operation.isDone()) {
try {
Thread.sleep(1);
} catch (InterruptedException e) {
logger.error(e.getMessage(), e);
}
}
lock.lock();
try {
if (operation.get() == -1) {
data.processComments();
status.setInProgress(false);
return data.getNext(true);
}
} catch (ExecutionException | InterruptedException | IOException e) {
if (logger.isDebugEnabled())
logger.debug("[next] ExecutionInterruptedException: " + e.getMessage());
return data.getNext(true);
} finally {
releaseFileLock(fileLock);
lock.unlock();
}
try {
data.bufferOperations();
} catch (final AtsdException e) {
if (logger.isDebugEnabled())
logger.debug("[bufferOperations] " + e.getMessage());
status.setInProgress(false);
return null;
}
found = data.getNext(false);
if (found != null)
return found;
}
}
@Override
public void remove() {
throw new UnsupportedOperationException();
}
@Override
public void close() throws IOException {
if (readChannel != null) {
lock.lock();
try {
readChannel.close();
if (logger.isTraceEnabled())
logger.trace("[close]");
} finally {
lock.unlock();
}
}
}
private void releaseFileLock(final Future<FileLock> fileLock) {
if (fileLock == null)
return;
try {
final FileLock lock = fileLock.get();
lock.release();
lock.close();
} catch (final IOException | InterruptedException | ExecutionException e) {
if (logger.isDebugEnabled())
logger.debug("[releaseFileLock] " + e.getMessage());
} finally {
fileLock.cancel(true);
}
}
} | [
"alexey.reztsov@axibase.com"
] | alexey.reztsov@axibase.com |
22aad1d5bea11072a6552cef3ce17079b15d97a9 | 7350883b7e7853595e986fc59cb4e1a0ca0982e2 | /app/src/test/java/kr/hs/emirim/nahyeonkim/slidingdrawertest/ExampleUnitTest.java | c365cb39261a057dabd578ffa3c0af38832dce4a | [] | no_license | nahyeonkim/SlidingDrawer | 9f1d3a6fe5beeb4014e037252760d463dddd3eac | 9b3c858981ec07df09c807944d76a861d8ba7882 | refs/heads/master | 2016-09-13T13:12:18.540434 | 2016-05-23T11:49:32 | 2016-05-23T11:49:32 | 59,478,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package kr.hs.emirim.nahyeonkim.slidingdrawertest;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
} | [
"nah0722@naver.com"
] | nah0722@naver.com |
fe0831ff8c01fc5242555b934494f662fea67de3 | 0e2a1a0a4f176f08093d996fe62347c739ce9598 | /trunk/mis/src/main/java/com/px/mis/purc/service/SellOutWhsService.java | 9899901405b833127996a3c1a1d35d9cf21ee340 | [] | no_license | LIHUIJAVA/JOB | 21dc3979b57d2923da9a0f6f33a9f0919b617b4d | 3142faf6045696e8c932d1a2139bdd17a40378e7 | refs/heads/master | 2022-12-21T01:56:05.451002 | 2020-03-01T12:04:32 | 2020-03-01T12:04:32 | 244,107,727 | 0 | 1 | null | 2022-12-16T07:52:27 | 2020-03-01T07:42:17 | JavaScript | GB18030 | Java | false | false | 1,070 | java | package com.px.mis.purc.service;
import java.util.List;
import java.util.Map;
import org.springframework.web.multipart.MultipartFile;
import com.px.mis.purc.entity.SellOutWhs;
import com.px.mis.purc.entity.SellOutWhsSub;
public interface SellOutWhsService {
public String addSellOutWhs(String userId,SellOutWhs sellOutWhs,List<SellOutWhsSub> sellOutWhsSubList,String loginTime);
public String editSellOutWhs(SellOutWhs sellOutWhs,List<SellOutWhsSub> sellOutWhsSubList);
public String deleteSellOutWhs(String outWhsId);
public String querySellOutWhs(String outWhsId);
public String querySellOutWhsList(Map map);
String deleteSellOutWhsList(String outWhsId);
Map<String,Object> updateSellOutWhsIsNtChk(SellOutWhs sellOutWhs) throws Exception;
String printingSellOutWhsList(Map map);
//导入销售出库单
public String uploadFileAddDb(MultipartFile file,int i);
//出库明细查询
String querySellOutWhsByInvtyEncd(Map map);
String querySellOutWhsListOrderBy(Map map);
public String querySellOutWhsByInvtyEncdPrint(Map map);
}
| [
"lh"
] | lh |
f439079f2d3299426847d0948e890c35f75d8baa | e6e0b32026355ef4ac34b16e96134fb5d8bd8246 | /5_Builder_Pattern/src/com/example/java/VeganHamburgerBuilder.java | a4fcc71c59c8a04a4d0b98b4d56ebdef81b7ee5c | [] | no_license | ystvan/Design-Patterns-with-JAVA | c34256347fbef009c4297cdd9937a1cf0c58ec5b | df13c43b8b6b4114ec392b29b3519f8ff7e4cb38 | refs/heads/master | 2021-04-30T13:05:25.860244 | 2018-05-19T13:36:19 | 2018-05-19T13:36:19 | 121,287,512 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 335 | java | package com.example.java;
class VeganHamburgerBuilder extends HamburgerBuilder {
public void buildBun() {
hamburger.setBun("poppy seed");
}
public void buildPatty() {
hamburger.setPatty("veggie patty");
}
public void buildSeasoning() {
hamburger.setSeasoning("ketchup and mayo");
}
}
| [
"istv0050@stud.kea.dk"
] | istv0050@stud.kea.dk |
5ee767233170f7dfe636286c49808382094a168b | 53e55126f9f4d731bf8963ad49db97b803f1c7d3 | /sprintboot_demo-master/src/main/java/com/wacai/springboot_demo/model/Course.java | acbd355ca4f66cde3934c7cea701cffd950f49de | [] | no_license | jonyhy96/course_demo | 433c1a9fa58afe8000fc580b254dad6670944d8d | 12301b10f75fc1ab3dea0104b138681b7c5eeae0 | refs/heads/master | 2020-03-15T17:30:38.156740 | 2018-06-02T09:46:40 | 2018-06-02T09:46:40 | 132,263,125 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 894 | java | package com.wacai.springboot_demo.model;
/**
* @author pojun
*/
public class Course {
private Integer id;
private String name;
private Integer teacherId;
private Integer num;
private Short state;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getTeacherId() {
return teacherId;
}
public void setTeacherId(Integer teacherId) {
this.teacherId = teacherId;
}
public Integer getNum() {
return num;
}
public void setNum(Integer num) {
this.num = num;
}
public Short getState() {
return state;
}
public void setState(Short state) {
this.state = state;
}
}
| [
"haoyun@ghostcloud.cn"
] | haoyun@ghostcloud.cn |
8deec712fc54caea70e6e2835391e254add0d21b | ebdcaff90c72bf9bb7871574b25602ec22e45c35 | /modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201809/mcm/ManagedCustomerServiceInterfacemutateLabelResponse.java | 444d8e9213e00d0f56d718b2560a34c4bfcb460d | [
"Apache-2.0"
] | permissive | ColleenKeegan/googleads-java-lib | 3c25ea93740b3abceb52bb0534aff66388d8abd1 | 3d38daadf66e5d9c3db220559f099fd5c5b19e70 | refs/heads/master | 2023-04-06T16:16:51.690975 | 2018-11-15T20:50:26 | 2018-11-15T20:50:26 | 158,986,306 | 1 | 0 | Apache-2.0 | 2023-04-04T01:42:56 | 2018-11-25T00:56:39 | Java | UTF-8 | Java | false | false | 2,283 | java | // Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.api.ads.adwords.jaxws.v201809.mcm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for mutateLabelResponse element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="mutateLabelResponse">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="rval" type="{https://adwords.google.com/api/adwords/mcm/v201809}ManagedCustomerLabelReturnValue" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"rval"
})
@XmlRootElement(name = "mutateLabelResponse")
public class ManagedCustomerServiceInterfacemutateLabelResponse {
protected ManagedCustomerLabelReturnValue rval;
/**
* Gets the value of the rval property.
*
* @return
* possible object is
* {@link ManagedCustomerLabelReturnValue }
*
*/
public ManagedCustomerLabelReturnValue getRval() {
return rval;
}
/**
* Sets the value of the rval property.
*
* @param value
* allowed object is
* {@link ManagedCustomerLabelReturnValue }
*
*/
public void setRval(ManagedCustomerLabelReturnValue value) {
this.rval = value;
}
}
| [
"jradcliff@users.noreply.github.com"
] | jradcliff@users.noreply.github.com |
7375d560f629345b0ca1c163d28162519d2ecf4d | cb415da83080326737ca98d04854d8705a36cdba | /app/src/main/java/mpip/finki/ukim/googlenearbyplaces/models/GoogleGeometryItem.java | d4e3b5cca67db977e23bee5fd4da07089f8a30f0 | [] | no_license | kostadinljatkoski/GoogleNearbyPlacesMobileApp | 7faa527773e2c533e85715e4a7235265a40f1441 | da531e810afd730b9aee3a00b2cd40818c6d0fd6 | refs/heads/master | 2021-05-17T16:08:03.764059 | 2020-03-28T18:11:51 | 2020-03-28T18:11:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 128 | java | package mpip.finki.ukim.googlenearbyplaces.models;
public class GoogleGeometryItem {
public GoogleLocationItem location;
}
| [
"kostadinljatkoski@hotmail.com"
] | kostadinljatkoski@hotmail.com |
bd7c6799131392b2fa68b9f82f37218f20fcee20 | 3892cf8ec26eab9f449338631ceae27dfd8b7fb7 | /app/src/main/java/io/azaan/taro/io/azaan/taro/viz/models/StackedBarData.java | 4c2779fc9382e4216a5064292ebc0346199eb82c | [] | no_license | aznn/taro | eb0389f8265d8e50606e9e3d46a80878bca76bba | ee2d73a74c4950e3cbc2e239bf4a9106b99e0974 | refs/heads/master | 2021-06-06T11:17:24.246938 | 2016-09-17T00:06:31 | 2016-09-17T00:06:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 484 | java | package io.azaan.taro.io.azaan.taro.viz.models;
/**
* Data model for stacked bar charts
*/
public class StackedBarData implements XLabel, YValue {
public final int value;
public final String label;
public StackedBarData(String label, int value) {
this.value = value;
this.label = label;
}
@Override
public String getXLabel() {
return label;
}
@Override
public float getYValue() {
return (float) value;
}
}
| [
"azaan@outlook.com"
] | azaan@outlook.com |
261447b817573a1154b3e8788d2f2c1b52f3536e | d9477e8e6e0d823cf2dec9823d7424732a7563c4 | /plugins/SVNPlugin/tags/1.1.0/src/ise/plugin/svn/gui/PropertyEditor.java | ec29240eb0b70de3965b5eff1c71ce177460df3f | [] | no_license | RobertHSchmidt/jedit | 48fd8e1e9527e6f680de334d1903a0113f9e8380 | 2fbb392d6b569aefead29975b9be12e257fbe4eb | refs/heads/master | 2023-08-30T02:52:55.676638 | 2018-07-11T13:28:01 | 2018-07-11T13:28:01 | 140,587,948 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,156 | java | /*
Copyright (c) 2007, Dale Anson
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the author nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package ise.plugin.svn.gui;
// imports
import java.awt.event.*;
import java.io.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
import org.gjt.sp.jedit.GUIUtilities;
import org.gjt.sp.jedit.View;
import org.gjt.sp.jedit.jEdit;
import org.gjt.sp.jedit.browser.VFSBrowser;
import org.gjt.sp.jedit.gui.HistoryTextField;
import ise.java.awt.KappaLayout;
import ise.java.awt.LambdaLayout;
import ise.plugin.svn.data.PropertyData;
import ise.plugin.svn.PVHelper;
import ise.plugin.svn.library.FileUtilities;
import static ise.plugin.svn.gui.HistoryModelNames.*;
/**
* Dialog for adding files and directories.
*/
public class PropertyEditor extends JDialog {
// instance fields
private View view = null;
private String name = null;
private String value = null;
private boolean isDirectory = false;
private boolean canceled = false;
private PropertyData propertyData = null;
private String[] default_file_prop_names = new String[] {
"",
"svn:executable",
"svn:mime-type",
"svn:ignore",
"svn:keywords",
"svn:eol-style", // native, CRLF, CR, LF
"svn:externals",
"svn:special",
"bugtraq:url",
"bugtraq:warnifnoissue", // boolean
"bugtraq:label",
"bugtraq:message",
"bugtraq:number", // boolean
"bugtraq:append"}; // boolean
private String[] default_dir_prop_names = new String[] {
"",
"svn:mime-type",
"svn:ignore",
"svn:keywords",
"svn:eol-style", // native, CRLF, CR, LF
"svn:externals",
"svn:special",
"bugtraq:url",
"bugtraq:warnifnoissue", // boolean
"bugtraq:label",
"bugtraq:message",
"bugtraq:number", // boolean
"bugtraq:append"}; // boolean
public PropertyEditor( View view, String name, String value, boolean isDirectory ) {
super( ( JFrame ) view, jEdit.getProperty("ips.Property_Editor", "Property Editor"), true );
this.view = view;
this.name = name;
this.value = value;
this.isDirectory = isDirectory;
_init();
}
/** Initialises the option pane. */
protected void _init() {
propertyData = new PropertyData();
String[] filePropNames = null;
String file_props = jEdit.getProperty("ise.plugin.svn.gui.PropertyEditor.defaultFilePropNames");
if (file_props == null || file_props.length() == 0) {
filePropNames = default_file_prop_names;
}
else {
filePropNames = file_props.split("[,]");
}
String[] dirPropNames = null;
String dir_props = jEdit.getProperty("ise.plugin.svn.gui.PropertyEditor.defaultDirPropNames");
if (dir_props == null || dir_props.length() == 0) {
dirPropNames = default_dir_prop_names;
}
else {
dirPropNames = dir_props.split("[,]");
}
JPanel panel = new JPanel( new LambdaLayout() );
panel.setBorder( new EmptyBorder( 6, 6, 6, 6 ) );
JLabel prop_name_label = new JLabel( jEdit.getProperty("ips.Property_name>", "Property name:") );
final JComboBox prop_chooser = new JComboBox( isDirectory ? dirPropNames : filePropNames );
prop_chooser.setEditable( true );
prop_chooser.setSelectedItem( name == null ? "" : name );
JPanel content_panel = new JPanel( new LambdaLayout() );
content_panel.setBorder( BorderFactory.createTitledBorder( BorderFactory.createEtchedBorder(), jEdit.getProperty("ips.Property_value", "Property value") ) );
final JRadioButton text_btn = new JRadioButton( jEdit.getProperty("ips.Enter_a_text_value>", "Enter a text value:") );
text_btn.setSelected( true );
final JRadioButton file_btn = new JRadioButton( jEdit.getProperty("ips.Or_load_value_from_file>", "Or load value from file:") );
ButtonGroup bg = new ButtonGroup();
bg.add( text_btn );
bg.add( file_btn );
final JTextArea text_value = new JTextArea( 8, 30 );
if ( value != null ) {
text_value.setText( value );
}
final HistoryTextField file_value = new HistoryTextField( PATH );
file_value.setColumns(30);
file_value.setEnabled( false );
final JButton browse_btn = new JButton( jEdit.getProperty("ips.Browse...", "Browse...") );
browse_btn.setEnabled( false );
browse_btn.addActionListener(
new ActionListener() {
public void actionPerformed( ActionEvent ae ) {
String[] filename = GUIUtilities.showVFSFileDialog( view, PVHelper.getProjectRoot( view ), VFSBrowser.OPEN_DIALOG, false );
if ( filename != null && filename.length > 0 ) {
file_value.setText( filename[ 0 ] );
}
}
}
);
ActionListener al = new ActionListener() {
public void actionPerformed( ActionEvent ae ) {
file_value.setEnabled( file_btn.isSelected() );
browse_btn.setEnabled( file_btn.isSelected() );
text_value.setEnabled( text_btn.isSelected() );
}
};
text_btn.addActionListener( al );
file_btn.addActionListener( al );
content_panel.add( "0, 0, 7, 1, W, w, 3", text_btn );
content_panel.add( "0, 1, 1, 1", KappaLayout.createHorizontalStrut( 11, true ) );
content_panel.add( "1, 1, 6, 1, 0, wh, 3", new JScrollPane( text_value ) );
content_panel.add( "0, 2, 7, 1, W, w, 3", file_btn );
content_panel.add( "0, 3, 1, 1", KappaLayout.createHorizontalStrut( 11, true ) );
content_panel.add( "1, 3, 5, 1, W, w, 3", file_value );
content_panel.add( "6, 3, 1, 1, E, , 3", browse_btn );
final JCheckBox recursive_cb = new JCheckBox( jEdit.getProperty("ips.Apply_recursively?", "Apply recursively?") );
recursive_cb.setSelected( false );
recursive_cb.setEnabled( isDirectory );
recursive_cb.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent ae ) {
propertyData.setRecursive( recursive_cb.isSelected() );
}
}
);
// buttons
KappaLayout kl = new KappaLayout();
JPanel btn_panel = new JPanel( kl );
JButton ok_btn = new JButton( jEdit.getProperty("ips.Ok", "Ok") );
JButton cancel_btn = new JButton( jEdit.getProperty("ips.Cancel", "Cancel") );
btn_panel.add( "0, 0, 1, 1, 0, w, 3", ok_btn );
btn_panel.add( "1, 0, 1, 1, 0, w, 3", cancel_btn );
kl.makeColumnsSameWidth( 0, 1 );
ok_btn.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent ae ) {
Object item = prop_chooser.getSelectedItem();
if ( item != null && item.toString().length() > 0 ) {
propertyData.setName( item.toString() );
if ( text_btn.isSelected() ) {
propertyData.setValue( text_value.getText() == null ? "" : text_value.getText() );
}
else {
String filename = file_value.getText();
if (filename == null || filename.length() == 0) {
JOptionPane.showMessageDialog( view, jEdit.getProperty("ips.No_filename_entered_for_property_value.", "No filename entered for property value."), jEdit.getProperty("ips.Error", "Error"), JOptionPane.ERROR_MESSAGE );
file_value.requestFocusInWindow();
return ;
}
try {
Reader reader = new BufferedReader( new FileReader( filename ) );
StringWriter writer = new StringWriter();
FileUtilities.copy( reader, writer );
propertyData.setValue( writer.toString() );
}
catch ( Exception e ) {
JOptionPane.showMessageDialog( view, jEdit.getProperty("ips.Unable_to_read_property_value_from_file>", "Unable to read property value from file:") + "\n" + e.getMessage(), jEdit.getProperty("ips.Error", "Error"), JOptionPane.ERROR_MESSAGE );
return ;
}
}
}
PropertyEditor.this.setVisible( false );
PropertyEditor.this.dispose();
file_value.addCurrentToHistory();
}
}
);
cancel_btn.addActionListener( new ActionListener() {
public void actionPerformed( ActionEvent ae ) {
propertyData = null;
PropertyEditor.this.setVisible( false );
PropertyEditor.this.dispose();
}
}
);
// add the components to the option panel
panel.add( "0, 0, 1, 1, W, , 6", prop_name_label );
panel.add( "1, 0, 5, 1, W, w, 4", prop_chooser );
panel.add( "0, 1, 6, 1, W, wh, 3", content_panel );
panel.add( "0, 2, 1, 1, 0, , 0", KappaLayout.createVerticalStrut( 6, true ) );
panel.add( "0, 3, 6, 1, W, , 6", recursive_cb );
panel.add( "0, 4, 1, 1, 0, , 0", KappaLayout.createVerticalStrut( 10, true ) );
panel.add( "0, 5, 6, 1, E, , 6", btn_panel );
setContentPane( panel );
pack();
}
/**
* @return null indicates user canceled
*/
public PropertyData getPropertyData() {
return propertyData;
}
public static void main ( String[] args ) {
PropertyEditor pe = new PropertyEditor( null, "svn:externals", "*", true );
pe.setVisible( true );
}
}
| [
"daleanson@6b1eeb88-9816-0410-afa2-b43733a0f04e"
] | daleanson@6b1eeb88-9816-0410-afa2-b43733a0f04e |
ebd1d1ab478bc93dc234ccb77b18a0d4892cdb81 | 0ee53560cc47b2771bc91f991829aed2e073ac07 | /app/src/androidTest/java/com/androidorange/example/firebasertdb/ExampleInstrumentedTest.java | d9b8c773fe878576f24f889b33b06674e4f82d19 | [] | no_license | JLF426551/FirebaseRTDB | 710b79484316306cd647faed50c96aefc16baa1a | 9f8be6061222d7af2c4870b560ceefb4e6fab1b4 | refs/heads/master | 2020-03-30T01:08:14.999078 | 2018-10-18T08:26:39 | 2018-10-18T08:26:39 | 150,561,149 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package com.androidorange.example.firebasertdb;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.androidorange.example.firebasertdb", appContext.getPackageName());
}
}
| [
"leon.edu@outlook.com"
] | leon.edu@outlook.com |
63a0987ca29201f272092462bec3447224e49985 | d3dcff0c5b2120c5319c9930dfd5693b3435957a | /app/src/main/java/com/mobilesoft/bonways/uis/viewholders/CommentViewHolder.java | e6cf6968590b0e61b7a396a619e7ef6903204df4 | [] | no_license | Coccoonx/costax | 012d1347a4f33e5d5b5bd0d0894712e0edc100e3 | fa593166596e26cf10a02b5e75e9dd242efa86d7 | refs/heads/master | 2021-01-11T16:23:42.500927 | 2017-08-23T22:15:57 | 2017-08-23T22:15:57 | 80,071,023 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,045 | java | package com.mobilesoft.bonways.uis.viewholders;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.mikhaellopez.circularimageview.CircularImageView;
import com.mobilesoft.bonways.R;
/**
* Created by Lyonnel Dzotang on 25/01/2017.
*/
public class CommentViewHolder extends RecyclerView.ViewHolder {
public LinearLayout container;
public CircularImageView authorPicture;
public TextView authorName;
public TextView date;
public TextView content;
public CommentViewHolder(View itemView) {
super(itemView);
authorName = (TextView) itemView.findViewById(R.id.author);
date = (TextView) itemView.findViewById(R.id.date);
content = (TextView) itemView.findViewById(R.id.content);
container = (LinearLayout) itemView.findViewById(R.id.item_container);
authorPicture = (CircularImageView) itemView.findViewById(R.id.authorPicture);
}
}
| [
"dtlyonnel@gmail.com"
] | dtlyonnel@gmail.com |
319a08f8b953b3026829ac3f0dcb3a14ef4b2b13 | 6dcade5a53a3e0c1db6fc54c8f850580a95a5c8a | /src/com/google/gson/annotations/Expose.java | 1e58d43792c8fdc5750108193e779dd17725b567 | [] | no_license | Vikame/Practice | 40263f56b14801c0bd207d8757067acc7adb1ceb | 80c92505c26f17fd307f94560b1b6e8004b446ab | refs/heads/master | 2021-01-23T12:48:44.179637 | 2017-09-06T20:05:00 | 2017-09-06T20:05:00 | 102,653,039 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,332 | java | /*
* Copyright (C) 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.gson.annotations;
import java.lang.annotation.*;
/**
* An annotation that indicates this member should be exposed for JSON
* serialization or deserialization.
*
* <p>This annotation has no effect unless you build {@link com.google.gson.Gson}
* with a {@link com.google.gson.GsonBuilder} and invoke
* {@link com.google.gson.GsonBuilder#excludeFieldsWithoutExposeAnnotation()}
* method.</p>
*
* <p>Here is an example of how this annotation is meant to be used:
* <p><pre>
* public class User {
* @Expose private String firstName;
* @Expose(serialize = false) private String lastName;
* @Expose (serialize = false, deserialize = false) private String emailAddress;
* private String password;
* }
* </pre></p>
* If you created Gson with {@code new Gson()}, the {@code toJson()} and {@code fromJson()}
* methods will use the {@code password} field along-with {@code firstName}, {@code lastName},
* and {@code emailAddress} for serialization and deserialization. However, if you created Gson
* with {@code Gson gson = new GsonBuilder().excludeFieldsWithoutExposeAnnotation().create()}
* then the {@code toJson()} and {@code fromJson()} methods of Gson will exclude the
* {@code password} field. This is because the {@code password} field is not marked with the
* {@code @Expose} annotation. Gson will also exclude {@code lastName} and {@code emailAddress}
* from serialization since {@code serialize} is set to {@code false}. Similarly, Gson will
* exclude {@code emailAddress} from deserialization since {@code deserialize} is set to false.
*
* <p>Note that another way to achieve the same effect would have been to just mark the
* {@code password} field as {@code transient}, and Gson would have excluded it even with default
* settings. The {@code @Expose} annotation is useful in a style of programming where you want to
* explicitly specify all fields that should get considered for serialization or deserialization.
*
* @author Inderjeet Singh
* @author Joel Leitch
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Expose {
/**
* If {@code true}, the field marked with this annotation is written out in the JSON while
* serializing. If {@code false}, the field marked with this annotation is skipped from the
* serialized output. Defaults to {@code true}.
* @since 1.4
*/
boolean serialize() default true;
/**
* If {@code true}, the field marked with this annotation is deserialized from the JSON.
* If {@code false}, the field marked with this annotation is skipped during deserialization.
* Defaults to {@code true}.
* @since 1.4
*/
boolean deserialize() default true;
}
| [
"walterkillmenowpls@gmail.com"
] | walterkillmenowpls@gmail.com |
8683f6fe5b48c022dcd954762f9f31d51b30e97f | ee33740354349d8bbfc22fdf7c48df926b850f2b | /temp/src/minecraft_server/net/minecraft/network/play/client/CPacketPlayer.java | e54991874af4d84b403e5817f7f3ee097d3c1f58 | [] | no_license | Targonian/Targonian | 1187f67be8d50661ead802f658d20815c66aaef4 | 0e0ca2e6e2f1fb2389690d70e430efecff6b2e9f | refs/heads/master | 2020-03-08T04:40:53.089851 | 2018-04-03T15:33:34 | 2018-04-03T15:33:34 | 127,928,808 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,036 | java | package net.minecraft.network.play.client;
import java.io.IOException;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.INetHandlerPlayServer;
public class CPacketPlayer implements Packet<INetHandlerPlayServer> {
protected double field_149479_a;
protected double field_149477_b;
protected double field_149478_c;
protected float field_149476_e;
protected float field_149473_f;
protected boolean field_149474_g;
protected boolean field_149480_h;
protected boolean field_149481_i;
public void func_148833_a(INetHandlerPlayServer p_148833_1_) {
p_148833_1_.func_147347_a(this);
}
public void func_148837_a(PacketBuffer p_148837_1_) throws IOException {
this.field_149474_g = p_148837_1_.readUnsignedByte() != 0;
}
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException {
p_148840_1_.writeByte(this.field_149474_g ? 1 : 0);
}
public double func_186997_a(double p_186997_1_) {
return this.field_149480_h ? this.field_149479_a : p_186997_1_;
}
public double func_186996_b(double p_186996_1_) {
return this.field_149480_h ? this.field_149477_b : p_186996_1_;
}
public double func_187000_c(double p_187000_1_) {
return this.field_149480_h ? this.field_149478_c : p_187000_1_;
}
public float func_186999_a(float p_186999_1_) {
return this.field_149481_i ? this.field_149476_e : p_186999_1_;
}
public float func_186998_b(float p_186998_1_) {
return this.field_149481_i ? this.field_149473_f : p_186998_1_;
}
public boolean func_149465_i() {
return this.field_149474_g;
}
public static class Position extends CPacketPlayer {
public Position() {
this.field_149480_h = true;
}
public void func_148837_a(PacketBuffer p_148837_1_) throws IOException {
this.field_149479_a = p_148837_1_.readDouble();
this.field_149477_b = p_148837_1_.readDouble();
this.field_149478_c = p_148837_1_.readDouble();
super.func_148837_a(p_148837_1_);
}
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException {
p_148840_1_.writeDouble(this.field_149479_a);
p_148840_1_.writeDouble(this.field_149477_b);
p_148840_1_.writeDouble(this.field_149478_c);
super.func_148840_b(p_148840_1_);
}
}
public static class PositionRotation extends CPacketPlayer {
public PositionRotation() {
this.field_149480_h = true;
this.field_149481_i = true;
}
public void func_148837_a(PacketBuffer p_148837_1_) throws IOException {
this.field_149479_a = p_148837_1_.readDouble();
this.field_149477_b = p_148837_1_.readDouble();
this.field_149478_c = p_148837_1_.readDouble();
this.field_149476_e = p_148837_1_.readFloat();
this.field_149473_f = p_148837_1_.readFloat();
super.func_148837_a(p_148837_1_);
}
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException {
p_148840_1_.writeDouble(this.field_149479_a);
p_148840_1_.writeDouble(this.field_149477_b);
p_148840_1_.writeDouble(this.field_149478_c);
p_148840_1_.writeFloat(this.field_149476_e);
p_148840_1_.writeFloat(this.field_149473_f);
super.func_148840_b(p_148840_1_);
}
}
public static class Rotation extends CPacketPlayer {
public Rotation() {
this.field_149481_i = true;
}
public void func_148837_a(PacketBuffer p_148837_1_) throws IOException {
this.field_149476_e = p_148837_1_.readFloat();
this.field_149473_f = p_148837_1_.readFloat();
super.func_148837_a(p_148837_1_);
}
public void func_148840_b(PacketBuffer p_148840_1_) throws IOException {
p_148840_1_.writeFloat(this.field_149476_e);
p_148840_1_.writeFloat(this.field_149473_f);
super.func_148840_b(p_148840_1_);
}
}
}
| [
"38045193+Targons@users.noreply.github.com"
] | 38045193+Targons@users.noreply.github.com |
3573e8da686f769cfbadf1130242d04e6d4ecb04 | 9ac7c01f3850bd1800b6081159bd36ad1be1595c | /Week8_Capstone/Artifacts/bytecode/ryey/easer/core/log/e$a.java | d6151e26485d839ea78de72e34464cfe7cdd8593 | [] | no_license | dr-natetorious/TIM-8101-Principals_of_Computer_Science | c956a09f1de593f60e1ac1ce96df604f873e20c1 | 20342f018149746167d704adb2988008de13dc62 | refs/heads/master | 2022-06-28T07:20:34.232059 | 2022-05-27T15:15:09 | 2022-05-27T15:15:09 | 174,446,001 | 0 | 0 | null | 2019-04-29T21:03:15 | 2019-03-08T01:13:52 | Java | UTF-8 | Java | false | false | 1,330 | java | public final class ryey.easer.core.log.e$a implements android.os.Parcelable$Creator<ryey.easer.core.log.e> {
public ryey.easer.core.log.e$a(a.b.b.a);
Code:
0: aload_0
1: invokespecial #17 // Method "<init>":()V
4: return
public ryey.easer.core.log.e a(android.os.Parcel);
Code:
0: aload_1
1: ldc #20 // String parcel
3: invokestatic #26 // Method a/b/b/c.b:(Ljava/lang/Object;Ljava/lang/String;)V
6: new #9 // class ryey/easer/core/log/e
9: dup
10: aload_1
11: invokespecial #29 // Method ryey/easer/core/log/e."<init>":(Landroid/os/Parcel;)V
14: areturn
public ryey.easer.core.log.e[] a(int);
Code:
0: iload_1
1: anewarray #9 // class ryey/easer/core/log/e
4: areturn
public java.lang.Object createFromParcel(android.os.Parcel);
Code:
0: aload_0
1: aload_1
2: invokevirtual #34 // Method a:(Landroid/os/Parcel;)Lryey/easer/core/log/e;
5: areturn
public java.lang.Object[] newArray(int);
Code:
0: aload_0
1: iload_1
2: invokevirtual #38 // Method a:(I)[Lryey/easer/core/log/e;
5: areturn
}
| [
"noreply@github.com"
] | dr-natetorious.noreply@github.com |
88710745a49b281ced6135f52798b32fea08ccb7 | ae5ad3651d8b2f0f61e430a519558867b1ca21d2 | /nativespider.win32/src/nativespider/win32/RobotImpl.java | a86ac746e03c9e9633ea97b2404d8082ef7512ba | [] | no_license | aabcce/aabccespider | 911733ee1e3722ad9165d7233a925d57ab578d67 | ae8f1adfb0da133d947192cb20c0fe395ebabcfb | refs/heads/master | 2021-01-01T05:47:48.949449 | 2010-01-05T14:52:54 | 2010-01-05T14:52:54 | 32,613,774 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,052 | java | package nativespider.win32;
import nativespider.interfaces.IRobot;
import org.eclipse.swt.SWT;
import org.eclipse.swt.internal.win32.*;
public class RobotImpl implements IRobot {
public int[] getMousePostion()
{
POINT pt = new POINT ();
OS.GetCursorPos (pt);
return new int[] {pt.x,pt.y};
}
public boolean mouseMoveTo(int posX, int posY) {
MOUSEINPUT inputs = new MOUSEINPUT ();
inputs.dwFlags = OS.MOUSEEVENTF_MOVE | OS.MOUSEEVENTF_ABSOLUTE;
int x= 0, y = 0, width = 0, height = 0;
if (OS.WIN32_VERSION >= OS.VERSION (5, 0)) {
inputs.dwFlags |= OS.MOUSEEVENTF_VIRTUALDESK;
x = OS.GetSystemMetrics (OS.SM_XVIRTUALSCREEN);
y = OS.GetSystemMetrics (OS.SM_YVIRTUALSCREEN);
width = OS.GetSystemMetrics (OS.SM_CXVIRTUALSCREEN);
height = OS.GetSystemMetrics (OS.SM_CYVIRTUALSCREEN);
} else {
width = OS.GetSystemMetrics (OS.SM_CXSCREEN);
height = OS.GetSystemMetrics (OS.SM_CYSCREEN);
}
inputs.dx = ((posX - x) * 65535 + width - 2) / (width - 1);
inputs.dy = ((posY - y) * 65535 + height - 2) / (height - 1);
int /*long*/ hHeap = OS.GetProcessHeap ();
int /*long*/ pInputs = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, INPUT.sizeof);
OS.MoveMemory(pInputs, new int[] {OS.INPUT_MOUSE}, 4);
//TODO - DWORD type of INPUT structure aligned to 8 bytes on 64 bit
OS.MoveMemory (pInputs + OS.PTR_SIZEOF, inputs, MOUSEINPUT.sizeof);
boolean result = OS.SendInput (1, pInputs, INPUT.sizeof) != 0;
OS.HeapFree (hHeap, 0, pInputs);
return result;
}
public boolean mouseMove(int posX, int posY) {
int[] pos = getMousePostion();
return mouseMoveTo(pos[0] + posX,pos[1] + posY);
}
public boolean click()
{
boolean res = pressMouse(1);
res = res && releaseMouse(1);
return(res);
}
public boolean rightClick()
{
boolean res = pressMouse(3);
res = res && releaseMouse(3);
return(res);
}
public boolean middleClick()
{
boolean res = pressMouse(2);
res = res && releaseMouse(2);
return(res);
}
public boolean pressMouse(int button)
{
return mouseSend(SWT.MouseDown,button);
}
public boolean releaseMouse(int button)
{
return mouseSend(SWT.MouseUp,button);
}
private boolean mouseSend(int type,int button)
{
MOUSEINPUT inputs = new MOUSEINPUT ();
switch (button) {
case 1: inputs.dwFlags = type == SWT.MouseDown ? OS.MOUSEEVENTF_LEFTDOWN : OS.MOUSEEVENTF_LEFTUP; break;
case 2: inputs.dwFlags = type == SWT.MouseDown ? OS.MOUSEEVENTF_MIDDLEDOWN : OS.MOUSEEVENTF_MIDDLEUP; break;
case 3: inputs.dwFlags = type == SWT.MouseDown ? OS.MOUSEEVENTF_RIGHTDOWN : OS.MOUSEEVENTF_RIGHTUP; break;
case 4: {
if (OS.WIN32_VERSION < OS.VERSION (5, 0)) return false;
inputs.dwFlags = type == SWT.MouseDown ? OS.MOUSEEVENTF_XDOWN : OS.MOUSEEVENTF_XUP;
inputs.mouseData = OS.XBUTTON1;
break;
}
case 5: {
if (OS.WIN32_VERSION < OS.VERSION (5, 0)) return false;
inputs.dwFlags = type == SWT.MouseDown ? OS.MOUSEEVENTF_XDOWN : OS.MOUSEEVENTF_XUP;
inputs.mouseData = OS.XBUTTON2;
break;
}
default: return false;
}
int /*long*/ hHeap = OS.GetProcessHeap ();
int /*long*/ pInputs = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, INPUT.sizeof);
OS.MoveMemory(pInputs, new int[] {OS.INPUT_MOUSE}, 4);
//TODO - DWORD type of INPUT structure aligned to 8 bytes on 64 bit
OS.MoveMemory (pInputs + OS.PTR_SIZEOF, inputs, MOUSEINPUT.sizeof);
boolean result = OS.SendInput (1, pInputs, INPUT.sizeof) != 0;
OS.HeapFree (hHeap, 0, pInputs);
return result;
}
public boolean scrollMouse(int wheelAmt,int type) {
MOUSEINPUT inputs = new MOUSEINPUT ();
if (OS.WIN32_VERSION < OS.VERSION (5, 0)) return false;
inputs.dwFlags = OS.MOUSEEVENTF_WHEEL;
switch (type) {
case SWT.SCROLL_PAGE:
inputs.mouseData = wheelAmt * OS.WHEEL_DELTA;
break;
case SWT.SCROLL_LINE:
int [] value = new int [1];
OS.SystemParametersInfo (OS.SPI_GETWHEELSCROLLLINES, 0, value, 0);
inputs.mouseData = wheelAmt * OS.WHEEL_DELTA / value [0];
break;
default: return false;
}
int /*long*/ hHeap = OS.GetProcessHeap ();
int /*long*/ pInputs = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, INPUT.sizeof);
OS.MoveMemory(pInputs, new int[] {OS.INPUT_MOUSE}, 4);
//TODO - DWORD type of INPUT structure aligned to 8 bytes on 64 bit
OS.MoveMemory (pInputs + OS.PTR_SIZEOF, inputs, MOUSEINPUT.sizeof);
boolean result = OS.SendInput (1, pInputs, INPUT.sizeof) != 0;
OS.HeapFree (hHeap, 0, pInputs);
return result;
}
public boolean typeKey(int keycode)
{
boolean res = pressKey(keycode);
res = res && releaseKey(keycode);
return res;
}
public boolean typeText(String text)
{
boolean shift = false;
for(char c : text.toCharArray())
{
if(c == '~')
{
c = '`';
shift = true;
}
else if(c == '!')
{
c = '1';
shift = true;
}
else if(c == '@')
{
c = '2';
shift = true;
}
else if(c == '#')
{
c = '3';
shift = true;
}
else if(c == '$')
{
c = '4';
shift = true;
}
else if(c == '%')
{
c = '5';
shift = true;
}
else if(c == '^')
{
c = '6';
shift = true;
}
else if(c == '&')
{
c = '7';
shift = true;
}
else if(c == '*')
{
c = '8';
shift = true;
}
else if(c == '(')
{
c = '9';
shift = true;
}
else if(c == ')')
{
c = '0';
shift = true;
}
else if(c == '_')
{
c = '-';
shift = true;
}
else if(c == '+')
{
c = '=';
shift = true;
}
else if(c == '{')
{
c = '[';
shift = true;
}
else if(c == '}')
{
c = ']';
shift = true;
}
else if(c == '|')
{
c = '\\';
shift = true;
}
else if(c == '<')
{
c = ',';
shift = true;
}
else if(c == '>')
{
c = '.';
shift = true;
}
else if(c == '?')
{
c = '/';
shift = true;
}
else if(c == ':')
{
c = ';';
shift = true;
}
else if(c == '"')
{
c = '\'';
shift = true;
}
if(shift)
{
pressKey(SWT.SHIFT);
}
typeKey(c);
if(shift)
{
releaseKey(SWT.SHIFT);
}
}
return true;
}
public boolean pressKey(int keycode)
{
return keySend(SWT.KeyUp,keycode);
}
public boolean releaseKey(int keycode)
{
return keySend(SWT.KeyDown,keycode);
}
private boolean keySend(int type, int keycode)
{
KEYBDINPUT inputs = new KEYBDINPUT ();
inputs.wVk = (short) untranslateKey (keycode);
if (inputs.wVk == 0) {
char key = (char) keycode;
switch (key) {
case SWT.BS: inputs.wVk = (short) OS.VK_BACK; break;
case SWT.CR: inputs.wVk = (short) OS.VK_RETURN; break;
case SWT.DEL: inputs.wVk = (short) OS.VK_DELETE; break;
case SWT.ESC: inputs.wVk = (short) OS.VK_ESCAPE; break;
case SWT.TAB: inputs.wVk = (short) OS.VK_TAB; break;
/*
* Since there is no LF key on the keyboard, do not attempt
* to map LF to CR or attempt to post an LF key.
*/
// case SWT.LF: inputs.wVk = (short) OS.VK_RETURN; break;
case SWT.LF: return false;
default: {
if (OS.IsWinCE) {
inputs.wVk = (short)/*64*/OS.CharUpper ((short) key);
} else {
inputs.wVk = OS.VkKeyScan ((short) wcsToMbcs (key, 0));
if (inputs.wVk == -1) return false;
inputs.wVk &= 0xFF;
}
}
}
}
inputs.dwFlags = type == SWT.KeyUp ? OS.KEYEVENTF_KEYUP : 0;
int /*long*/ hHeap = OS.GetProcessHeap ();
int /*long*/ pInputs = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, INPUT.sizeof);
OS.MoveMemory(pInputs, new int[] {OS.INPUT_KEYBOARD}, 4);
//TODO - DWORD type of INPUT structure aligned to 8 bytes on 64 bit
OS.MoveMemory (pInputs + OS.PTR_SIZEOF, inputs, KEYBDINPUT.sizeof);
boolean result = OS.SendInput (1, pInputs, INPUT.sizeof) != 0;
OS.HeapFree (hHeap, 0, pInputs);
return result;
}
/* Key Mappings */
private static final int [] [] KeyTable = {
/* Keyboard and Mouse Masks */
{OS.VK_MENU, SWT.ALT},
{OS.VK_SHIFT, SWT.SHIFT},
{OS.VK_CONTROL, SWT.CONTROL},
// {OS.VK_????, SWT.COMMAND},
/* NOT CURRENTLY USED */
// {OS.VK_LBUTTON, SWT.BUTTON1},
// {OS.VK_MBUTTON, SWT.BUTTON3},
// {OS.VK_RBUTTON, SWT.BUTTON2},
/* Non-Numeric Keypad Keys */
{OS.VK_UP, SWT.ARROW_UP},
{OS.VK_DOWN, SWT.ARROW_DOWN},
{OS.VK_LEFT, SWT.ARROW_LEFT},
{OS.VK_RIGHT, SWT.ARROW_RIGHT},
{OS.VK_PRIOR, SWT.PAGE_UP},
{OS.VK_NEXT, SWT.PAGE_DOWN},
{OS.VK_HOME, SWT.HOME},
{OS.VK_END, SWT.END},
{OS.VK_INSERT, SWT.INSERT},
/* Virtual and Ascii Keys */
{OS.VK_BACK, SWT.BS},
{OS.VK_RETURN, SWT.CR},
{OS.VK_DELETE, SWT.DEL},
{OS.VK_ESCAPE, SWT.ESC},
{OS.VK_RETURN, SWT.LF},
{OS.VK_TAB, SWT.TAB},
/* Functions Keys */
{OS.VK_F1, SWT.F1},
{OS.VK_F2, SWT.F2},
{OS.VK_F3, SWT.F3},
{OS.VK_F4, SWT.F4},
{OS.VK_F5, SWT.F5},
{OS.VK_F6, SWT.F6},
{OS.VK_F7, SWT.F7},
{OS.VK_F8, SWT.F8},
{OS.VK_F9, SWT.F9},
{OS.VK_F10, SWT.F10},
{OS.VK_F11, SWT.F11},
{OS.VK_F12, SWT.F12},
{OS.VK_F13, SWT.F13},
{OS.VK_F14, SWT.F14},
{OS.VK_F15, SWT.F15},
/* Numeric Keypad Keys */
{OS.VK_MULTIPLY, SWT.KEYPAD_MULTIPLY},
{OS.VK_ADD, SWT.KEYPAD_ADD},
{OS.VK_RETURN, SWT.KEYPAD_CR},
{OS.VK_SUBTRACT, SWT.KEYPAD_SUBTRACT},
{OS.VK_DECIMAL, SWT.KEYPAD_DECIMAL},
{OS.VK_DIVIDE, SWT.KEYPAD_DIVIDE},
{OS.VK_NUMPAD0, SWT.KEYPAD_0},
{OS.VK_NUMPAD1, SWT.KEYPAD_1},
{OS.VK_NUMPAD2, SWT.KEYPAD_2},
{OS.VK_NUMPAD3, SWT.KEYPAD_3},
{OS.VK_NUMPAD4, SWT.KEYPAD_4},
{OS.VK_NUMPAD5, SWT.KEYPAD_5},
{OS.VK_NUMPAD6, SWT.KEYPAD_6},
{OS.VK_NUMPAD7, SWT.KEYPAD_7},
{OS.VK_NUMPAD8, SWT.KEYPAD_8},
{OS.VK_NUMPAD9, SWT.KEYPAD_9},
// {OS.VK_????, SWT.KEYPAD_EQUAL},
/* Other keys */
{OS.VK_CAPITAL, SWT.CAPS_LOCK},
{OS.VK_NUMLOCK, SWT.NUM_LOCK},
{OS.VK_SCROLL, SWT.SCROLL_LOCK},
{OS.VK_PAUSE, SWT.PAUSE},
{OS.VK_CANCEL, SWT.BREAK},
{OS.VK_SNAPSHOT, SWT.PRINT_SCREEN},
// {OS.VK_????, SWT.HELP},
};
private static int untranslateKey (int key) {
for (int i=0; i<KeyTable.length; i++) {
if (KeyTable [i] [1] == key) return KeyTable [i] [0];
}
return 0;
}
/*
* Returns a single character, converted from the wide
* character set (WCS) used by Java to the specified
* multi-byte character set used by the operating system
* widgets.
*
* @param ch the WCS character
* @param codePage the code page used to convert the character
* @return the MBCS character
*/
static int wcsToMbcs (char ch, int codePage) {
if (OS.IsUnicode) return ch;
if (ch <= 0x7F) return ch;
TCHAR buffer = new TCHAR (codePage, ch, false);
return buffer.tcharAt (0);
}
}
| [
"aabcce@gmail.com@32d238da-d7d5-11de-8e5c-7bc2cb6520f4"
] | aabcce@gmail.com@32d238da-d7d5-11de-8e5c-7bc2cb6520f4 |
01625b9b39d2748a78cad3878d3877a754f20167 | c7bf1d96eb434a74648b1072d8f6960089120983 | /src/java/es/uma/ecplusproject/backing/CopyResources.java | 05c3a6cbb6d2433c97ac524e5878f77864c84bab | [] | no_license | jfrchicanog/ECPlusAcademicPortal | d999e44bb190bcceadd61a6c5011550f03df0a8e | eefc6eb88a82eb4a97e25296583f154db3190a48 | refs/heads/master | 2022-07-01T23:22:18.738837 | 2018-05-17T00:24:39 | 2018-05-17T00:24:39 | 143,293,118 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,114 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package es.uma.ecplusproject.backing;
import es.uma.ecplusproject.backing.util.WordsBatchSyntax;
import es.uma.ecplusproject.ejb.ECPlusBusinessException;
import es.uma.ecplusproject.ejb.EdicionLocal;
import es.uma.ecplusproject.entities.ListaPalabras;
import es.uma.ecplusproject.entities.RecursoAudioVisual;
import es.uma.ecplusproject.entities.Video;
import java.io.Serializable;
import java.util.List;
import java.util.OptionalLong;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.inject.Named;
import javax.faces.view.ViewScoped;
import javax.inject.Inject;
/**
*
* @author francis
*/
@Named(value = "copyResources")
@ViewScoped
public class CopyResources implements Serializable {
@Inject
private EdicionLocal edicion;
private List<ListaPalabras> listaPalabras;
private ListaPalabras listaOrigen;
private ListaPalabras listaDestino;
private String resultado;
private String comandos;
public String getListaOrigen() {
if (listaOrigen != null) {
return listaOrigen.getIdioma();
} else {
return null;
}
}
public String getListaDestino() {
if (listaDestino != null) {
return listaDestino.getIdioma();
} else {
return null;
}
}
public void setListaOrigen(String listaSeleccionada) {
if (listaSeleccionada == null) {
this.listaOrigen = null;
} else {
listaPalabras.stream()
.filter(lp -> lp.getIdioma().equals(listaSeleccionada))
.forEach(lp -> this.listaOrigen = lp);
}
}
public void setListaDestino(String listaSeleccionada) {
if (listaSeleccionada == null) {
this.listaDestino = null;
} else {
listaPalabras.stream()
.filter(lp -> lp.getIdioma().equals(listaSeleccionada))
.forEach(lp -> this.listaDestino = lp);
}
}
public List<ListaPalabras> getListaPalabras() {
if (listaPalabras == null) {
listaPalabras = edicion.fetchListasPalabras();
listaOrigen = listaPalabras.get(0);
listaDestino = listaPalabras.get(0);
}
return listaPalabras;
}
public void procesar() {
if (listaOrigen == null || listaDestino == null || comandos == null) {
resultado = "Seleccione las listas y escriba las palabras";
return;
}
if (listaOrigen == listaDestino) {
resultado = "Las listas origen y destino no pueden ser la misma";
return;
}
Stream.of(comandos.split("\\r?\\n")).forEach(line->{
String [] destOrigin = line.split("\\\t");
if (destOrigin.length == 2) {
String destinationWord = destOrigin[0];
String originWord = destOrigin[1];
processEntry(originWord, destinationWord);
}
});
resultado = "Ejecutado con éxito";
}
private void processEntry(String origin, String destination) {
Set<RecursoAudioVisual> originResources = WordsBatchSyntax.lineToWord(listaOrigen, origin)
.flatMap(p->{
OptionalLong minId = p.getAudiovisuales().stream()
.filter(rav -> (rav instanceof Video))
.mapToLong(RecursoAudioVisual::getId).min();
if (minId.isPresent()) {
return p.getAudiovisuales().stream()
.filter(rav -> minId.getAsLong()!=rav.getId());
} else {
return p.getAudiovisuales().stream();
}
})
.collect(Collectors.toSet());
WordsBatchSyntax.lineToWord(listaDestino, destination)
.forEach(to->{
originResources.stream()
.filter((ravFrom) -> (to.getAudiovisuales().stream()
.map(ravTo->ravTo.getFicheros())
.allMatch(files->!files.equals(ravFrom.getFicheros()))))
.forEach((ravFrom) -> {
to.getAudiovisuales().add(ravFrom);
});
try {
edicion.editarPalabra(to);
} catch (ECPlusBusinessException e) {
System.out.println(e.getMessage());
}
});
}
public String getResultado() {
return resultado;
}
public String getComandos() {
return comandos;
}
public void setComandos(String comandos) {
this.comandos = comandos;
}
}
| [
"chicano@lcc.uma.es"
] | chicano@lcc.uma.es |
a8a28f3860b94e3b3aa7a2e6bc82111ebfd8f3ed | 2f0f52be4f58f53f21eab69f393ba3be8def655b | /contrato/src/main/java/br/com/pauta/model/request/PautaRequest.java | d1c55e43a9c895976b1af298aa3d98cbfc820507 | [] | no_license | DiovaneMendes/pauta-service | 94de20cec763fbd211d5d0e4686888132e724bed | 3344969c4806a5584dc75b95fcbef16497cd3546 | refs/heads/master | 2023-04-17T08:10:45.452106 | 2021-05-03T03:31:54 | 2021-05-03T03:31:54 | 273,524,005 | 0 | 0 | null | 2020-06-24T17:06:07 | 2020-06-19T15:14:22 | null | UTF-8 | Java | false | false | 536 | java | package br.com.pauta.model.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
@Data
@Builder
@ApiModel
@NoArgsConstructor
@AllArgsConstructor
public class PautaRequest {
@ApiModelProperty(value = "nomePauta", example = "Lucro", required = true)
@NotNull(message = "Nome da pauta é obrigatória")
private String nomePauta;
}
| [
"diovane.m.mendes@gmail.com"
] | diovane.m.mendes@gmail.com |
dfa76dea27f1c6c6dec4006fb6183900132c65ea | 6740dea586450fd249bac20a99e74afb477cb367 | /android/Chirper/app/src/main/java/ramp/chirper/android/TwitterAsyncTask.java | dd8abdc810d4ab53824923900966419c3f9e5d8c | [
"Apache-2.0"
] | permissive | lvguanming/samples | 944dec86baa0f493574bd3b17926d6a905d6c114 | ab2dc42255b6d09f7d5434b28bc1aa9b91a92042 | refs/heads/master | 2021-01-10T07:39:16.184918 | 2016-12-19T04:00:29 | 2016-12-19T04:00:29 | 53,655,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,792 | java | package ramp.chirper.android;
import android.app.Activity;
import android.app.ProgressDialog;
import android.os.AsyncTask;
import java.util.ArrayList;
import java.util.List;
import twitter4j.Query;
import twitter4j.Twitter;
/**
* Created by rpalaniappan on 18/06/14.
*/
public class TwitterAsyncTask extends AsyncTask<String, Void, ArrayList<String>> {
Twitter twitter = null;
Activity activity = null;
ProgressDialog progressDialog = null;
public TwitterAsyncTask(Twitter twitter, Activity activity) {
this.twitter = twitter;
this.activity = activity;
}
@Override
protected void onPreExecute() {
super.onPreExecute();
progressDialog = ProgressDialog.show(activity, "Search", "Searching Twitter");
}
@Override
protected ArrayList<String> doInBackground(String... objects) {
ArrayList<String> statusTexts = new ArrayList<String>();
List<twitter4j.Status> statuses = null;
try {
String query = null;
if (objects != null && objects.length > 0) {
query = objects[0];
} else {
query = "Intuit";
}
progressDialog.setMessage("Searching Twitter for query '"+query+"'");
statuses = twitter.search(new Query(query)).getTweets();
for (twitter4j.Status s : statuses) {
statusTexts.add(s.getText());
}
} catch (Exception e) {
statusTexts.add("Twitter query failed: " + e.toString());
}
return statusTexts;
}
@Override
protected void onPostExecute(ArrayList<String> o) {
super.onPostExecute(o);
progressDialog.dismiss();
((TweetListActivity)activity).setListViewAdapter(o);
}
}
| [
"gim@GimdeMacBook-Pro.local"
] | gim@GimdeMacBook-Pro.local |
c1e5bc70d4165efc1b99e97197828cc16b0a3d78 | 943524d7f4d5e21e9994029b427e642e06f53363 | /Eclipse_Workspace/Eclipse_Workspace/Eclipse_Workspace/ToolsQASelenium/src/practiceSelenium/PracticeExercise1.java | dcfdfe228b4860258d447f98dc0c86f1501fbe37 | [] | no_license | akshayjain585/Learnings | 878cec4bd2a4aaccd7ed5bd5974f8f1741129bc0 | 4d72a02ee45af6d76a7454559d7db7ee804a97a9 | refs/heads/master | 2023-05-12T02:12:02.705812 | 2021-02-03T09:00:49 | 2021-02-03T09:00:49 | 151,600,614 | 0 | 0 | null | 2023-05-09T18:06:41 | 2018-10-04T16:14:37 | JavaScript | UTF-8 | Java | false | false | 858 | java | /*
Practice Exercise 1
1) Launch new Browser
2) Open URL http://www.toolsqa.com/automation-practice-form/
3) Type Name & Last Name (Use Name locator)
4) Click on Submit button (Use ID locator)
*/
package practiceSelenium;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class PracticeExercise1 {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
String baseURL = "http://www.toolsqa.com/automation-practice-form/" ;
driver.get(baseURL);
driver.findElement(By.name("firstname")).sendKeys("Akshay");
driver.findElement(By.name("lastname")).sendKeys("Jain");
driver.findElement(By.id("submit")).click();
}
}
| [
"AJain11@yodlee.com"
] | AJain11@yodlee.com |
8bad6d9a1f1c6de45060fcafd55ed89373666ce5 | eaa97c4ed9eb2d21712d4d15051d11fad1afb222 | /src/Chap08/IndexOfTester.java | 690cf1dfdd02541f99861430378c136892ac26b6 | [] | no_license | takanamir/Algorithm_java_study | a5479c025fcd8e9d210f8270606411084c70b2e6 | 63422cdd44b5af1107ac561d5481bc82452d3634 | refs/heads/master | 2022-10-03T12:45:16.510022 | 2020-06-09T08:34:15 | 2020-06-09T08:34:15 | 268,947,466 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,326 | java | package Chap08;
import java.util.Scanner;
//String.indexOfメソッドとString.lastIndexOfメソッドによる文字列探索
public class IndexOfTester {
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
System.out.print("テキスト:");
String s1 = stdIn.next(); // テキスト用文字列
System.out.print("パターン:");
String s2 = stdIn.next(); // パターン用文字列
int idx1 = s1.indexOf(s2); // 文字列s1からs2を探索(先頭側)
int idx2 = s1.lastIndexOf(s2); // 文字列s1からs2を探索(末尾側)
if (idx1 == -1)
System.out.println("テキスト中にパターンは存在しません。");
else {
// マッチ文字の直前までの《半角》での文字数を求める
int len1 = 0;
for (int i = 0; i < idx1; i++)
len1 += s1.substring(i, i + 1).getBytes().length;
len1 += s2.length();
int len2 = 0;
for (int i = 0; i < idx2; i++)
len2 += s1.substring(i, i + 1).getBytes().length;
len2 += s2.length();
System.out.println("テキスト:" + s1);
System.out.printf(String.format("パターン:%%%ds\n", len1), s2);
System.out.println("テキスト:" + s1);
System.out.printf(String.format("パターン:%%%ds\n", len2), s2);
}
}
} | [
"rtakanami0706@gmail.com"
] | rtakanami0706@gmail.com |
2307dff7f86f80b7295f6a0baa21667883d1068d | eadedaf59ba8c2ac37c268bbd3baf31635504ea9 | /src/test/java/com/psawesome/testcodeproject/pagination/korea_style/PaginationRunner.java | ca1e1fbfcdb306832e91532564ba503f5490c87e | [] | no_license | wiv33/test-code-project | 9288b57b4221b46f59b5cebeb5ced3b6420b0d79 | 993d82b530b4c374a9e91f939e5f59f1b56fae47 | refs/heads/master | 2023-06-01T17:55:10.794340 | 2021-06-27T15:32:23 | 2021-06-27T15:32:23 | 234,860,509 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 358 | java | package com.psawesome.testcodeproject.pagination.korea_style;
/**
* @author pilseong
* @version 1.0
* @description
* @see == 개정이력(Modification Information) ==
* <p>
* 수정일 수정자 수정내용
* ------ -------- --------------------------
* @since 2020-03-05
*/
public class PaginationRunner {
}
| [
"wiv821253@gmail.com"
] | wiv821253@gmail.com |
b701ca3e62ed3fbc2a70450ee4ffed98e8f75be3 | a5c0f8e18b8a4bd940e12a98945de3ba29da3840 | /src/ufps/vistas/TestEmail.java | 50b92e8d5651a5772a3937653f7fed0482680f16 | [] | no_license | SantiagoAndresSerrano/Persistencia | 95d2fc6dd61318cc167dcd7c6e62178667de5dcf | f7937533df8e2b838ce4e6b9e9f62d6b77f47f75 | refs/heads/master | 2023-01-16T04:29:26.312531 | 2020-11-26T22:03:04 | 2020-11-26T22:03:04 | 273,975,997 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,344 | java | package ufps.vistas;
import java.util.Scanner;
import ufps.util.varios.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Usuario
*/
public class TestEmail {
/**
* Se tiene creada la cuenta ejemplo.email.ufps@gmail.com,
* para efectos de seguridad, se crea una segunda contraseña usando la verificación
* de dos pasos de gmail: http://www.youtube.com/watch?v=zMabEyrtPRg&t=2m13s&noredirect=1
* la contraseña generada es: nfrbdxklxggkgoko
*
* Para ejecutar el ejercicio debe descargar javamail.jar y copiar en el lib "mail.jar"
*
*/
public static void main(String args[])
{
String emailUsuarioEmisor="ejemplo.email.ufps@gmail.com";
String clave="nfrbdxklxggkgoko";
//Cambia el valor de la variable emailReceptor por el email que desee enviarle mensajes
Scanner teclado=new Scanner(System.in);
System.out.println("Digite una dirección de email:");
String emailReceptor=teclado.nextLine();
ServicioEmail email=new ServicioEmail(emailUsuarioEmisor, clave);
email.enviarEmail(emailReceptor, "Esto es un ejemplo", "Mi cuerpo del mensaje");
System.out.println("Se ha enviado email: "+emailReceptor);
}
}
| [
"madarme@ufps.edu.co"
] | madarme@ufps.edu.co |
1fd83aeb3772b89f817cfd6a6bc5e8487041df58 | 4ca9f8a1e3fd894520e71b66ad52bfec75e0d17e | /app/src/main/java/com/ayfp/anyuanwisdom/config/preferences/Preferences.java | 45c0018904da92e844468fdc6156f43056e5cf07 | [] | no_license | linerhome/AnyuanWisdom | 6d726dec76db8b6fbf6c485ecb0dbabbd8a9e40c | c4cf2ad7a136636e2554874380ac94b25b65e4e9 | refs/heads/master | 2023-03-21T04:44:54.409195 | 2018-02-28T05:36:24 | 2018-02-28T05:36:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,944 | java | package com.ayfp.anyuanwisdom.config.preferences;
import android.content.Context;
import android.content.SharedPreferences;
import android.text.TextUtils;
import com.ayfp.anyuanwisdom.base.MyApplication;
/**
* Created by hzxuwen on 2015/4/13.
*/
public class Preferences {
private static final String KEY_USER_ACCOUNT = "account";
private static final String KEY_USER_TOKEN = "token";
private static final String KEY_USER_ID= "user_id";
private static final String KEY_USER_NAME = "user_name";
public static void saveUserAccount(String account) {
saveString(KEY_USER_ACCOUNT, account);
}
public static String getUserAccount() {
return getString(KEY_USER_ACCOUNT);
}
public static void saveUserToken(String token) {
saveString(KEY_USER_TOKEN, token);
}
public static String getUserToken() {
return getString(KEY_USER_TOKEN);
}
public static void saveUserId(String userId){
saveString(KEY_USER_ID,userId);
}
public static String getUserId(){
return getString(KEY_USER_ID);
}
public static void saveUserName(String userName){
saveString(KEY_USER_NAME,userName);
}
public static String getUserName(){
return getString(KEY_USER_NAME);
}
public static boolean checkUserLogin(){
if (TextUtils.isEmpty(getUserName())){
return false;
}else {
return true;
}
}
private static void saveString(String key, String value) {
SharedPreferences.Editor editor = getSharedPreferences().edit();
editor.putString(key, value);
editor.commit();
}
private static String getString(String key) {
return getSharedPreferences().getString(key, null);
}
static SharedPreferences getSharedPreferences() {
return MyApplication.getContext().getSharedPreferences("ayfp", Context.MODE_PRIVATE);
}
}
| [
"wlwangjc@foxmail.com"
] | wlwangjc@foxmail.com |
bda0ec322e7c91c2d614491a39b46c1c9a9f221b | de7b67d4f8aa124f09fc133be5295a0c18d80171 | /workspace_headfirstdesignpatterns/testdesignpattern/src/proxy/TestProxy.java | 6eb3ae03120a97c76af92b24ea87b691c86a4baf | [] | no_license | lin-lee/eclipse_workspace_test | adce936e4ae8df97f7f28965a6728540d63224c7 | 37507f78bc942afb11490c49942cdfc6ef3dfef8 | refs/heads/master | 2021-05-09T10:02:55.854906 | 2018-01-31T07:19:02 | 2018-01-31T07:19:02 | 119,460,523 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package proxy;
public class TestProxy {
public static void main(String [] args){
BookFacadeProxy proxy = new BookFacadeProxy();
BookFacade bookProxy = (BookFacade) proxy.bind(new BookFacadeImpl());
bookProxy.addBook();
}
}
| [
"lilin@lvmama.com"
] | lilin@lvmama.com |
0cd3a24214e034392ba080176b37e03107c31827 | fea0b545b087ea44339123c5f8eb9b09337f0c66 | /boot-mybatis-plus-beetl/src/main/java/com/sino/scaffold/model/Status.java | 10aaf433424f76072145edf3b2faaba2f18989aa | [
"Apache-2.0"
] | permissive | boboan0254/Falsework | 9ef9ba094e033410eca0080624c213a74c04fbaa | e6f9215846d6caeb0d3b41b0ec59bfc273b328bb | refs/heads/master | 2021-09-05T04:50:41.552989 | 2018-01-24T05:20:15 | 2018-01-24T05:20:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 108 | java | package com.sino.scaffold.model;
/**
* @author kerbores
*
*/
public enum Status {
DISABLED, ENABLED
}
| [
"Kerbores@gmail.com"
] | Kerbores@gmail.com |
92d4a954bd2fedc2bf3f478f034aaf0fcbdeeb7a | e3b401814e8fbe73e1979cea8980c1ce93ca6dc8 | /mybatis-ext/src/main/java/com/winning/mybatis/support/Criteria.java | 128d6eb9385c10c710396edb09027607099883fd | [] | no_license | Sunshineuun/kbms-framework | ad9a7f0d42a64bec000434d40d0a73354d02675b | 7528b3d9fd4c7fa4a5dd2a31b4d31005e4d10d8b | refs/heads/master | 2021-01-18T16:46:18.714175 | 2017-04-27T10:22:01 | 2017-04-27T10:22:01 | 86,767,080 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,500 | java | package com.winning.mybatis.support;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.StringUtils;
public final class Criteria {
private final List<Condition> conditions = new ArrayList<Condition>(5);
private final List<Order> orders = new ArrayList<Order>(1);
private Criteria() {
}
public static Criteria create() {
return new Criteria();
}
public Criteria andEqualTo(String name, Object value) {
conditions.add(new Condition("and", name, "=", value));
return this;
}
public Criteria andNotEqualTo(String name, Object value) {
conditions.add(new Condition("and", name, "<>", value));
return this;
}
public Criteria andThanOrEqualTo(String name, Object value) {
conditions.add(new Condition("and", name, ">=", value));
return this;
}
public Criteria andLessOrEqualTo(String name, Object value) {
conditions.add(new Condition("and", name, "<=", value));
return this;
}
public Criteria andLike(String name, Object value) {
conditions.add(new Condition("and", name, "like", "%" + value + "%"));
return this;
}
public Criteria andNotLike(String name, Object value) {
conditions.add(new Condition("and", name, "not like", "%" + value + "%"));
return this;
}
public Criteria andLeftLike(String name, Object value) {
conditions.add(new Condition("and", name, "like", "%" + value));
return this;
}
public Criteria andIsNull(String name) {
conditions.add(new Condition("and", name, "is null"));
return this;
}
public Criteria andIsNotNull(String name) {
conditions.add(new Condition("and", name, "is not null"));
return this;
}
public Criteria andRightLike(String name, Object value) {
conditions.add(new Condition("and", name, "like", value + "%"));
return this;
}
public Criteria andIn(String name, Object[] values) {
conditions.add(new Condition("and", name, "in ('" + StringUtils.join(values, "','") + "')"));
return this;
}
public Criteria andNotIn(String name, Object[] values) {
conditions.add(new Condition("and", name, "not in (" + StringUtils.join(values, "','") + ")"));
return this;
}
public Criteria orEqualTo(String name, Object value) {
conditions.add(new Condition("or", name, "=", value));
return this;
}
public Criteria orNotEqualTo(String name, Object value) {
conditions.add(new Condition("or", name, "<>", value));
return this;
}
public Criteria orThanOrEqualTo(String name, Object value) {
conditions.add(new Condition("or", name, ">=", value));
return this;
}
public Criteria orLessOrEqualTo(String name, Object value) {
conditions.add(new Condition("or", name, "<=", value));
return this;
}
public Criteria orLike(String name, Object value) {
conditions.add(new Condition("or", name, "like", "%" + value + "%"));
return this;
}
public Criteria orLeftLike(String name, Object value) {
conditions.add(new Condition("or", name, "like", "%" + value));
return this;
}
public Criteria orIsNull(String name) {
conditions.add(new Condition("or", name, "is null"));
return this;
}
public Criteria orIsNotNull(String name) {
conditions.add(new Condition("or", name, "is not null"));
return this;
}
public Criteria orRightLike(String name, Object value) {
conditions.add(new Condition("or", name, "like", value + "%"));
return this;
}
public Criteria orIn(String name, Object[] values) {
conditions.add(new Condition("or", name, "in ('" + StringUtils.join(values, "','") + "')"));
return this;
}
public Criteria orNotIn(String name, Object[] values) {
conditions.add(new Condition("or", name, "not in ('" + StringUtils.join(values, "','") + "')"));
return this;
}
public Criteria orderASC(String name) {
orders.add(new Order(name, "asc"));
return this;
}
public Criteria orderDESC(String name) {
orders.add(new Order(name, "desc"));
return this;
}
public List<Condition> getConditions() {
return conditions;
}
public List<Order> getOrders() {
return orders;
}
public class Condition {
private String name;
private String join;
private Object value;
private String operator;
private String commonOper;
public Condition(String join, String name, String operator, Object value) {
this.join = join;
this.name = name;
this.operator = operator;
this.value = value;
}
public Condition(String join, String name, String commonOper) {
this.join = join;
this.name = name;
this.commonOper = commonOper;
}
public String getCommonOper() {
return commonOper;
}
public void setCommonOper(String commonOper) {
this.commonOper = commonOper;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getJoin() {
return join;
}
public void setJoin(String join) {
this.join = join;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
}
public class Order {
private String name;
private String order;
public Order(String name, String order) {
this.name = name;
this.order = order;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getOrder() {
return order;
}
public void setOrder(String order) {
this.order = order;
}
}
}
| [
"583853240@qq.com"
] | 583853240@qq.com |
610fe5dae09564da44d40474780bac9f7333864e | 4ed9269ac93f77735bbad50c2d4df398506c5d40 | /Team.java | 6ae109be5bd44c5666c62c35f067aa1679e51245 | [] | no_license | nvidia94/Java-app | 38470075e731d0fafeda6c5b4c1357a1dc4e7b0f | d5d5792b4f716be37347d3ea734618d1a057cfb5 | refs/heads/master | 2020-04-02T00:41:49.960680 | 2018-10-19T17:30:26 | 2018-10-19T17:30:26 | 153,817,330 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,363 | java | package com.company;
/**
* Team class for the tournament */
public class Team {
private int teamId; // holds team id number
private String teamName; // holds team country
private int groupId; // holds the groupid for the team
private int matchesPlayed; // holds the matches
private int wins; // hold the wins
private int draws; // holds the draws
private int losses; // hold the looses
private int golsFor; // hold the gols against
private int golsAgainst; // hold the gols against
private int golsDiff ; // holds the gol differential
private int points; // hold the points
/**
* Constructors
* */
public Team(){}
public Team(Team team){
this.teamId = team.teamId;
this.teamName = team.teamName;
this.matchesPlayed = team.matchesPlayed;
this.wins = team.wins;
this.draws = team.draws;
this.losses = team.losses;
this.golsFor = team.golsFor;
this.golsAgainst = team.golsAgainst;
this.golsDiff = team.golsDiff;
this.points = team.points;
}
public Team(String teamName){
this.teamName = teamName;
}
public Team(String teamName, int matchesPlayed, int wins,
int draws, int losses, int golsFor, int golsAgainst,
int golsDiff, int points){
this.teamName = teamName;
this.matchesPlayed = matchesPlayed;
this.wins = wins;
this.draws = draws;
this.losses = losses;
this.golsFor = golsFor;
this.golsAgainst = golsAgainst;
this.golsDiff = golsDiff;
this.points = points;
}
/**
* Accessors and mutators methods methods
*/
public int getGroupId(){
return groupId;
}
public int getTeamId() {
return teamId;
}
public String getTeamName(){
return teamName;
}
public int getMatchesPlayed() {
return matchesPlayed;
}
public int getWins() {
return wins;
}
public int getDraws() {
return draws;
}
public int getLosses() {
return losses;
}
public int getGolsAgainst() {
return golsAgainst;
}
public int getGolsFor() {
return golsFor;
}
public int getGolsDiff() {
return golsDiff;
}
public int getPoints() {
return points;
}
public void setTeamName(String teamName) {
this.teamName = teamName;
}
public void setTeamId(int teamId) {
this.teamId = teamId;
}
public void setWins() {
this.wins += 1;
}
public void setDraws() {
this.draws += 1;
}
public void setLosses() {
this.losses += 1;
}
public void setGolsFor(int i) {
this.golsFor +=i;
}
public void setGolsAgainst(int i) {
this.golsAgainst += i;
}
public void setGolsDiff() {
this.golsDiff = (this.golsFor -
this.golsAgainst);
}
public void setPointsWins() {
this.points += 3;
}
public void setPointsDraw(){
this.points += 1;
}
public void setMatchesPlayed() {
this.matchesPlayed += 1;
}
}
| [
"noreply@github.com"
] | nvidia94.noreply@github.com |
2adbf32e72d3169850ec752e2248d3b83d77e64d | fdea8640ef2099364e76271bc89ade47871bb919 | /app/src/main/java/com/example/edithrewards/ui/home/HomeFragment.java | e8967e8a83004cff02206a4ee4f5c6fda1a8beec | [] | no_license | virtualRst/Edith_rewards | a9c70f2897c677140b59aa5d6a3739fb57f1b73c | ec82723b7365c3979397e5782684c030e2d8e65d | refs/heads/master | 2022-04-02T19:43:47.426379 | 2020-01-06T12:59:00 | 2020-01-06T12:59:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,139 | java | package com.example.edithrewards.ui.home;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import com.example.edithrewards.R;
public class HomeFragment extends Fragment {
private HomeViewModel homeViewModel;
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
homeViewModel =
ViewModelProviders.of(this).get(HomeViewModel.class);
View root = inflater.inflate(R.layout.fragment_home, container, false);
final TextView textView = root.findViewById(R.id.text_home);
homeViewModel.getText().observe(this, new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
textView.setText(s);
}
});
return root;
}
} | [
"rishabhtiwari821@gmial.com"
] | rishabhtiwari821@gmial.com |
d8419d82b49d42ac85b05f018b6691c03a3cd8db | 66f3174237b3163ef879933348d2e6f80d985caa | /app/src/main/java/com/colpencil/redwood/bean/RxBusMsg.java | a3b9cd4c036fde2f99873509ca5a8dbb21336996 | [] | no_license | zsj6102/hongmu2.0 | 77ce2b4a0b9db630c78baa3938cbe0046f6515a2 | 7e9ab54ecf47da19fd1f2415cda1dbc9ade30a73 | refs/heads/master | 2021-01-01T04:42:04.518022 | 2017-10-31T03:35:33 | 2017-10-31T03:35:36 | 97,228,220 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,732 | java | package com.colpencil.redwood.bean;
import java.util.HashMap;
/**
* 描述 RxBus 消息通知的实体类
* 作者:曾 凤
* 邮箱:20000263@qq.com
* 日期:2016/7/8 15 41
*/
public class RxBusMsg {
/**
* 处理类型表示 0:标识处理expandListView 1:标识处理购物车中数量增减 2:标识处理多张相册选择问题
* 3:销毁登录界面 4:更新个人中信息 5:修改密码成功 6:个人中心信息修改成功 7:进行订单退货
* 8:进入立即支付 9:申请退款 10:查看物流 11:确认收货 12:确认取消退款 13申请售后 14进行评价
* 15:取消售后 16:填写物流 17:联系客服 18:我的周拍-立即付款 19:我的周拍—去竞拍
* 20:我的定制-立即付款 21:我的定制-新的定制 22:领取购物券 23:使用优惠券 24:退款,售后理由适配器的选择
* 25:提交申请理由 26:成功清空收藏记录 27:刷新商品收藏界面 28:刷新百科收藏界面 29:刷新帖子收藏界面
* 30:消息记录成功删除 31:禁止一键清除按钮的使用 32:一键清除按钮解锁 33:兑换优惠券成功
* 34:地址列表有所变动 35:取消订单成功—通知刷新订单界面 36:取消售后操作成功—通知刷新界面
* 37:进入首页 38删除浏览记录 39:在浏览记录里面分享 40:刷新浏览列表
* 41:邮寄方式发生了更改 42:支付方式发生了变化 43:选择使用优惠券 44:选择收货地址
* 45:支付宝支付成功 46:支付宝支付失败 47:微信支付成功 48:微信支付失败 49:微信支付取消
* 50:刷新我的定制界面 51:提醒卖家发货 52:进入订单详情 53:退出登录 54:银联支付 55:银联支付失败
* 56:跳转到百科 57:刷新购物车的数据 58:刷新标签
* 60:删除百科浏览记录 61:删除帖子浏览记录 62:删除商品浏览记录 63:我的周拍跳转到周拍详情
* 64:删除订单 65:我的周拍立即付款
*70:商家修改地址
* 71:商家修改退货地址
* 80:个人名片夹操作后 81:商品名片夹操作后
*
* 90:速拍收藏之后
*
* 95:速拍获取申请状态判断是不是商家
* 96:品牌判断是不是商家
* 97:名师
* 98:专场
*100:添加商品详情
* 510:商家主页 关注成功
* 511:商家主页 取消关注成功
*/
private int type = -1;
private int position;//集合位置
private int positonGroupMsg;
private int positonChildMsg;
private String msg;
private String orderNum;//订单编号
private String cpns_sn;//优惠券券号
private int cpns_id;//优惠券id
private int point;//兑换需要的积分
private int foot_id;//浏览记录id
private int return_order_id;//退款id
/**
* 定制标识
*/
private int customType;
private int product_id;
private int goods_id;
private int order_id;
/**
* 0:待审核 1:立即付款2:待付款3:新的定制4:待付首款5:待付尾款
*/
private int stateName;
/**
* 订单项id
*/
private int item_id;
/**
* 名称
*/
private String name;
private HashMap<String, String> map;
private String sn;
private int status;//订单状态
private float scale;
public float getScale() {
return scale;
}
public void setScale(float scale) {
this.scale = scale;
}
public HashMap<String, String> getMap() {
return map;
}
public void setMap(HashMap<String, String> map) {
this.map = map;
}
public int getStateName() {
return stateName;
}
public void setStateName(int stateName) {
this.stateName = stateName;
}
public int getCustomType() {
return customType;
}
public void setCustomType(int customType) {
this.customType = customType;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getPositonGroupMsg() {
return positonGroupMsg;
}
public void setPositonGroupMsg(int positonGroupMsg) {
this.positonGroupMsg = positonGroupMsg;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public int getPositonChildMsg() {
return positonChildMsg;
}
public void setPositonChildMsg(int positonChildMsg) {
this.positonChildMsg = positonChildMsg;
}
public String getOrderNum() {
return orderNum;
}
public void setOrderNum(String orderNum) {
this.orderNum = orderNum;
}
public int getPosition() {
return position;
}
public void setPosition(int position) {
this.position = position;
}
public String getCpns_sn() {
return cpns_sn;
}
public void setCpns_sn(String cpns_sn) {
this.cpns_sn = cpns_sn;
}
public int getCpns_id() {
return cpns_id;
}
public void setCpns_id(int cpns_id) {
this.cpns_id = cpns_id;
}
public int getPoint() {
return point;
}
public void setPoint(int point) {
this.point = point;
}
public int getFoot_id() {
return foot_id;
}
public void setFoot_id(int foot_id) {
this.foot_id = foot_id;
}
public int getReturn_order_id() {
return return_order_id;
}
public void setReturn_order_id(int return_order_id) {
this.return_order_id = return_order_id;
}
public int getProduct_id() {
return product_id;
}
public void setProduct_id(int product_id) {
this.product_id = product_id;
}
public int getGoods_id() {
return goods_id;
}
public void setGoods_id(int goods_id) {
this.goods_id = goods_id;
}
public int getItem_id() {
return item_id;
}
public void setItem_id(int item_id) {
this.item_id = item_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSn() {
return sn;
}
public void setSn(String sn) {
this.sn = sn;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getOrder_id() {
return order_id;
}
public void setOrder_id(int order_id) {
this.order_id = order_id;
}
}
| [
"610257110@qq.com"
] | 610257110@qq.com |
523f7d30e5aae85905ffee9d1a982db773a1668d | eafb530572578ddd94734ef7e49c24ecdba0d704 | /src/test/java/com/datasource/PostgresDatasourceTest.java | c3d3549a347b3f9fb69fe5055b969c0043af20b4 | [] | no_license | camonunez18/Challenge_pto3 | 825dd2032fb79872445cae0a0b5aaa75d3d42b62 | b8010a42feda2dfac7b0a6be65d473640fe53a8a | refs/heads/master | 2022-12-07T06:49:20.741491 | 2020-08-29T22:37:48 | 2020-08-29T22:37:48 | 291,309,170 | 0 | 0 | null | 2020-08-29T22:22:51 | 2020-08-29T16:38:59 | Java | UTF-8 | Java | false | false | 552 | java | package com.datasource;
import com.zaxxer.hikari.HikariDataSource;
import org.junit.Assert;
import org.junit.Test;
public class PostgresDatasourceTest {
PostgresDatasource postgresDatasource = new PostgresDatasource();
@Test
public void testHikariDataSource() throws Exception {
HikariDataSource result = postgresDatasource.hikariDataSource();
Assert.assertNotNull(result);
}
}
//Generated with love by TestMe :) Please report issues and submit feature requests at: http://weirddev.com/forum#!/testme | [
"Camilo.Nunez@unisys.com"
] | Camilo.Nunez@unisys.com |
c47dcfcc8d5a5c3ad31b573367b0afb63f6ff0fc | dd8154aaf9fb1ad06f86f380f8bb8a5f9e2e6c7b | /xlib/src/gui/delete_update_student.java | bacaf552142739af6f3311acc30381cd759312ce | [] | no_license | pius-mn/library-management--system-in-java | 07ceafc1a17ef781c0356774858f7a1d31def012 | f42e3b3e3084ec16b29d4e6c65f86ebd818177c9 | refs/heads/main | 2023-03-26T05:40:11.736552 | 2021-04-02T13:29:01 | 2021-04-02T13:29:01 | 354,022,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,801 | java |
/*
* Created by JFormDesigner on Mon Mar 15 16:44:09 EAT 2021
*/
import java.awt.*;
import javax.swing.*;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle;
/**
* @author pius
*/
public class delete_update_student extends JPanel {
public delete_update_student() {
initComponents();
}
public void clear(){
idtxt.setText("");
username.setText("");
fnametxt.setText("");
lnametxt.setText("");
email.setText("");
password.setText("");
confirm_password.setText("");
}
public void setData(String id,String user,String fname,String lname,String mail){
idtxt.setText(id);
username.setText(user);
fnametxt.setText(fname);
lnametxt.setText(lname);
email.setText(mail);
}
public void collectedData(){
String passcode=String.valueOf(password.getPassword());
String conpasscode=String.valueOf(confirm_password.getPassword());
String operation= (String) comboBox1.getSelectedItem();
String usertype=(String) comboBox2.getSelectedItem();
String id =idtxt.getText();
String user=username.getText();
String fname=fnametxt.getText();
String lname=lnametxt.getText();
String mail=email.getText();
if(mail.equals("")|| lname.equals("") || fname.equals("")|| user.equals("")|| passcode.equals("")|| conpasscode.equals("")){
label11.setText("fill all fields!");
JOptionPane.showMessageDialog(null, "something went wrong ! EMPTY fields! Try again!");
}
else{
if(operation=="delete" && controller.delete_user(id)){
JOptionPane.showMessageDialog(null, "deleted");
clear();
}
if(passcode.equals(conpasscode)){
if(operation=="update" && controller.update_user(id, user, fname, lname, mail,passcode,usertype)){
JOptionPane.showMessageDialog(null, "updated");
clear();
}
}else{label11.setText("PAssword mismatch!");
JOptionPane.showMessageDialog(null, "something went wrong! password mismatch! Try again!");}
}
}
private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
// Generated using JFormDesigner Evaluation license - Pius
panel2 = new JPanel();
label1 = new JLabel();
label2 = new JLabel();
label3 = new JLabel();
label4 = new JLabel();
username = new JTextField();
password = new JPasswordField();
confirm_password = new JPasswordField();
label5 = new JLabel();
email = new JTextField();
fnametxt = new JTextField();
lnametxt = new JTextField();
label7 = new JLabel();
label8 = new JLabel();
label6 = new JLabel();
idtxt = new JTextField();
label9 = new JLabel();
comboBox1 = new JComboBox<>();
label10 = new JLabel();
comboBox2 = new JComboBox<>();
label11 = new JLabel();
//======== this ========
setBorder(new javax.swing.border.CompoundBorder(new javax.swing.border.TitledBorder(new javax
.swing.border.EmptyBorder(0,0,0,0), "JF\u006frmD\u0065sig\u006eer \u0045val\u0075ati\u006fn",javax.swing
.border.TitledBorder.CENTER,javax.swing.border.TitledBorder.BOTTOM,new java.awt.
Font("Dia\u006cog",java.awt.Font.BOLD,12),java.awt.Color.red
), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener(){@Override
public void propertyChange(java.beans.PropertyChangeEvent e){if("\u0062ord\u0065r".equals(e.getPropertyName(
)))throw new RuntimeException();}});
//======== panel2 ========
{
panel2.setBackground(new Color(153, 153, 153));
//---- label1 ----
label1.setText("username");
label1.setFont(new Font("Tahoma", Font.BOLD, 12));
label1.setForeground(Color.white);
//---- label2 ----
label2.setText("email");
label2.setForeground(Color.white);
label2.setFont(new Font("Tahoma", Font.BOLD, 12));
//---- label3 ----
label3.setText("password");
label3.setFont(new Font("Tahoma", Font.BOLD, 12));
label3.setBackground(Color.darkGray);
label3.setForeground(Color.white);
//---- label4 ----
label4.setText("confirm password");
label4.setFont(new Font("Tahoma", Font.BOLD, 11));
label4.setForeground(Color.white);
//---- label5 ----
label5.setForeground(Color.red);
label5.setFont(new Font("Tahoma", Font.BOLD, 12));
//---- label7 ----
label7.setText("first name");
label7.setFont(new Font("Tahoma", Font.BOLD, 12));
label7.setForeground(Color.white);
//---- label8 ----
label8.setText("last name");
label8.setFont(new Font("Tahoma", Font.BOLD, 12));
label8.setForeground(Color.white);
//---- label6 ----
label6.setText("userId");
label6.setFont(new Font("Tahoma", Font.BOLD, 12));
label6.setBackground(Color.darkGray);
label6.setForeground(Color.white);
//---- idtxt ----
idtxt.setEditable(false);
//---- label9 ----
label9.setText("select option");
label9.setFont(new Font("Tahoma", Font.BOLD, 12));
label9.setBackground(Color.darkGray);
label9.setForeground(Color.white);
//---- comboBox1 ----
comboBox1.setModel(new DefaultComboBoxModel<>(new String[] {
"update",
"delete"
}));
//---- label10 ----
label10.setText("select usertype");
label10.setFont(new Font("Tahoma", Font.BOLD, 12));
label10.setBackground(Color.darkGray);
label10.setForeground(Color.white);
//---- comboBox2 ----
comboBox2.setModel(new DefaultComboBoxModel<>(new String[] {
"user",
"Admin"
}));
//---- label11 ----
label11.setForeground(Color.red);
label11.setFont(new Font("Tahoma", Font.BOLD, 12));
GroupLayout panel2Layout = new GroupLayout(panel2);
panel2.setLayout(panel2Layout);
panel2Layout.setHorizontalGroup(
panel2Layout.createParallelGroup()
.addGroup(panel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(panel2Layout.createParallelGroup()
.addGroup(panel2Layout.createSequentialGroup()
.addGap(101, 101, 101)
.addComponent(label5, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(274, 274, 274))
.addGroup(panel2Layout.createSequentialGroup()
.addGroup(panel2Layout.createParallelGroup()
.addComponent(label1, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
.addComponent(label7, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
.addComponent(label8, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(panel2Layout.createParallelGroup()
.addComponent(username, GroupLayout.Alignment.TRAILING)
.addComponent(fnametxt)
.addComponent(lnametxt)))
.addGroup(panel2Layout.createSequentialGroup()
.addComponent(label2, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(email))
.addGroup(panel2Layout.createSequentialGroup()
.addComponent(label3, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(password))
.addGroup(panel2Layout.createSequentialGroup()
.addGroup(panel2Layout.createParallelGroup()
.addGroup(panel2Layout.createSequentialGroup()
.addComponent(label10, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
.addGap(42, 42, 42)
.addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(panel2Layout.createSequentialGroup()
.addComponent(label9, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(panel2Layout.createSequentialGroup()
.addComponent(label6, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(idtxt, GroupLayout.PREFERRED_SIZE, 280, GroupLayout.PREFERRED_SIZE)))
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addGroup(panel2Layout.createParallelGroup()
.addGroup(GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
.addComponent(label4)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(confirm_password, GroupLayout.PREFERRED_SIZE, 280, GroupLayout.PREFERRED_SIZE))
.addGroup(GroupLayout.Alignment.TRAILING, panel2Layout.createSequentialGroup()
.addComponent(label11, GroupLayout.PREFERRED_SIZE, 209, GroupLayout.PREFERRED_SIZE)
.addGap(63, 63, 63)))))
.addContainerGap())
);
panel2Layout.setVerticalGroup(
panel2Layout.createParallelGroup()
.addGroup(panel2Layout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label1, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(username, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
.addComponent(fnametxt)
.addComponent(label7, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(lnametxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addComponent(label8, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label2, GroupLayout.PREFERRED_SIZE, 20, GroupLayout.PREFERRED_SIZE)
.addComponent(email, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label3)
.addComponent(password, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label4)
.addComponent(confirm_password, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label6)
.addComponent(idtxt, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(label11)
.addGap(4, 4, 4)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label10)
.addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(label9)
.addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(label5)
.addGap(54, 54, 54))
);
}
GroupLayout layout = new GroupLayout(this);
setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup()
.addGroup(layout.createParallelGroup()
.addComponent(panel2, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(0, 410, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup()
.addGroup(layout.createParallelGroup()
.addGroup(layout.createSequentialGroup()
.addComponent(panel2, GroupLayout.PREFERRED_SIZE, 311, GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE)))
.addGap(0, 311, Short.MAX_VALUE)
);
// JFormDesigner - End of component initialization //GEN-END:initComponents
}
// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
// Generated using JFormDesigner Evaluation license - Pius
private JPanel panel2;
private JLabel label1;
private JLabel label2;
private JLabel label3;
private JLabel label4;
private JTextField username;
private JPasswordField password;
private JPasswordField confirm_password;
private JLabel label5;
private JTextField email;
private JTextField fnametxt;
private JTextField lnametxt;
private JLabel label7;
private JLabel label8;
private JLabel label6;
private JTextField idtxt;
private JLabel label9;
private JComboBox<String> comboBox1;
private JLabel label10;
private JComboBox<String> comboBox2;
private JLabel label11;
// JFormDesigner - End of variables declaration //GEN-END:variables
}
| [
"noreply@github.com"
] | pius-mn.noreply@github.com |
7d4f91a45bcc4ea428ce8df4e63fad32376f18d2 | 88f777916a146c005c7a05a1a65f59cba2c5166f | /src/main/java/registration/TokenController.java | 49025e997569ed6b3b2c8bb0383362fa5b5c0e4a | [] | no_license | puneetbehl/verification-token-generator | e3e9b5398da050073aa8714a01e72f9ea1e4ba85 | 95380f54efb3260af689c52908c65b69a408aeb7 | refs/heads/master | 2020-04-09T08:19:47.124114 | 2018-12-03T13:33:55 | 2018-12-03T13:34:27 | 160,190,340 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,808 | java | package registration;
import io.micronaut.context.annotation.Value;
import io.micronaut.http.HttpResponse;
import io.micronaut.http.MediaType;
import io.micronaut.http.annotation.Controller;
import io.micronaut.http.annotation.Get;
import io.micronaut.http.annotation.Post;
import io.reactivex.Flowable;
import io.reactivex.Single;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
@Controller("/token")
public class TokenController implements RegistrationTokenOperations {
private final RegistrationTokenGenerator tokenGenerator;
private final RegistrationTokenValidator tokenValidator;
@SuppressWarnings("WeakerAccess")
@Value("${micronaut.registration.token.jwt.expirationInSeconds:3600}")
protected Integer tokenExpirationInSeconds;
public TokenController(RegistrationTokenGenerator tokenGenerator, RegistrationTokenValidator tokenValidator) {
this.tokenGenerator = tokenGenerator;
this.tokenValidator = tokenValidator;
}
@Override
@Get(value = "/generate{?registrationDetails*}", produces = MediaType.TEXT_PLAIN)
public Single<HttpResponse<String>> generate(@Valid RegistrationDetails registrationDetails) {
return Single.just(tokenGenerator.generateToken(registrationDetails, tokenExpirationInSeconds))
.map(token -> {
if (token.isPresent()) {
return HttpResponse.ok(token.get());
}
return HttpResponse.noContent();
});
}
@Override
@Post(value = "/validate")
public Flowable<HttpResponse<? extends TokenDetails>> validate(@NotEmpty String token) {
return Flowable.fromPublisher(tokenValidator.validateToken(token))
.map(HttpResponse::ok);
}
}
| [
"behl4485@gmail.com"
] | behl4485@gmail.com |
b99bf88eeae78f1aeb16fdaa9f8a0fdab0854dc2 | 6aa503863a8d6d6bb294b6ef73706c3ff000affb | /src/main/java/com/trungtamjava/DAO/SizeSanPhamDao.java | 41a52d25d94e34bf46d5f40e247c9acd58e96ee4 | [] | no_license | xuanphi99/shopMini | 543d227bd242f92120db3e7cc2c82175a8181d1d | bd03cb1cb5c96b7bf7ceffd05424c3e2c6d135a9 | refs/heads/master | 2023-07-24T17:51:04.328358 | 2021-09-07T07:41:19 | 2021-09-07T07:41:19 | 370,915,853 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 880 | java | package com.trungtamjava.DAO;
import java.util.List;
import javax.transaction.Transactional;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.context.annotation.ScopedProxyMode;
import org.springframework.stereotype.Repository;
import com.trungtamjava.entity.SizeSanPham;
import com.trungtamjava.lmplement.SizeSanPhamIpm;
@Repository
@Scope(proxyMode = ScopedProxyMode.TARGET_CLASS)
public class SizeSanPhamDao implements SizeSanPhamIpm {
@Autowired
private SessionFactory se;
@Transactional
public List<SizeSanPham> getSizeSanPhams() {
Session session = se.getCurrentSession();
String sql = " from sizesanpham";
List<SizeSanPham> list = session.createQuery(sql).getResultList();
return list;
}
}
| [
"doanxuanphi2@gmail.com"
] | doanxuanphi2@gmail.com |
b3d973f8ca2bcf2baf954378e4f38b7418555c3d | 5fc9e8d3ead99b8a2e8b7f6279997220864b881e | /src/main/java/com/example/mzord/controllers/SeafarerController.java | 71f17ebf2db625c4a44a2168562243453bf5fa10 | [] | no_license | mzord/SeaManager | c18169f1c7f9642d52759204b2756a7d32987861 | 752585eb433d307828cbe718b3723be3afcd1a3a | refs/heads/main | 2023-01-04T08:23:04.957454 | 2020-10-31T17:50:19 | 2020-10-31T17:50:19 | 309,734,225 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,478 | java | package com.example.mzord.controllers;
import static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*;
import com.example.mzord.models.Seafarer;
import com.example.mzord.services.DocParser;
import com.example.mzord.services.ISeafarerService;
import org.apache.poi.openxml4j.exceptions.OpenXML4JException;
import org.apache.xmlbeans.XmlException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.*;
@RestController
@RequestMapping("/api/seafarers")
public class SeafarerController {
@Autowired
private ISeafarerService seafarerService;
// Show all seafarers from Database
@GetMapping("/all")
public List<Seafarer> showAll() {
List<Seafarer> seafarers = seafarerService.findAll();
for(Seafarer seafarer : seafarers) {
seafarer.add(linkTo(methodOn(CertificateController.class)
.showCertificates(seafarer.getId()))
.withRel("Certificates:"));
}
return seafarers;
}
@GetMapping("/byfunc")
public List<Seafarer> showOrderedByFunction() {
return seafarerService.sortByFunction();
}
// Show specific seafarer using PathVariable 'id'
@GetMapping("/{id}")
public Optional<Seafarer> findById(@PathVariable("id") Long id) {
Optional<Seafarer> seafarer = seafarerService.findById(id);
seafarer.get().add(linkTo(methodOn(CertificateController.class)
.showCertificates(seafarer.get().getId()))
.withRel("Certificates:"));
return seafarer;
}
// Post a new seafarer through body parameters
@PostMapping("/add")
public Seafarer addSeafarer(@RequestBody Seafarer newSeafarer) {
return seafarerService.save(newSeafarer);
}
@PutMapping("/update")
public List<Seafarer> updateSeafarers(@RequestBody List<Seafarer> seafarerList) {
List<Seafarer> updatedSeafarers = new ArrayList<>();
seafarerList.forEach(
seafarer -> {
seafarerService.updateSeafarer(seafarer);
}
);
return seafarerList;
}
@PutMapping("/update/{id}")
public void updateSeafarerById(@PathVariable Long id, @RequestBody Map<String, String> requestJson) {
seafarerService.update(id, requestJson);
}
}
| [
"alvesefomm@gmail.com"
] | alvesefomm@gmail.com |
0176de14d3b0c3459cc6cb70d1230f2d38ce95f4 | 1d3b011abea9677533d991f4cd8a277c3d3cb78a | /src/Scripts/Testcase6.java | b0456c5786d9461dfbff3148d52bad82c0aefab2 | [] | no_license | GeetaBailannanavar/Facebook | 522c1b8af25df542d4e99cc0a2836b6660eddb48 | 64c7c2739a154659e07d1eebe6f7828a73459d30 | refs/heads/master | 2020-03-21T13:01:10.728710 | 2018-06-25T11:10:22 | 2018-06-25T11:10:22 | 138,583,703 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 882 | java | package Scripts;
import org.openqa.selenium.WebDriver;
import org.testng.annotations.Test;
import POM.HomePage;
import POM.LoginPage;
import POM.MarketPage;
import genericlib.Base_test;
import genericlib.Excel;
public class Testcase6 extends Base_test
{
@Test
public void action7() throws InterruptedException
{
LoginPage l=new LoginPage(driver);
l.emailid(Excel.ExcelSheet(path, "sheet1", 1, 1));
l.password(Excel.ExcelSheet(path, "sheet1", 2, 1));
l.login();
HomePage h=new HomePage(driver);
Thread.sleep(3000);
h.home();
Thread.sleep(5000);
h.marketplace();
Thread.sleep(5000);
h.profile();
Thread.sleep(4000);
// MarketPage m=new MarketPage(driver);
// Thread.sleep(3000);
// m.buying();
// Thread.sleep(2000);
h.ddown();
Thread.sleep(6000);
h.logout();
}
}
| [
"ii@i"
] | ii@i |
71b4d638e3aefa00e5f708a768f7e4c39913b739 | 628de1aa2d2d5d960f949b6868b03a427721a482 | /src/main/java/com/canzs/czs/pojo/entity/BusinessConsumer.java | 18d7c8ab1be7d18ec7245375b25218e758c35205 | [] | no_license | xiwc/czs | 402197e4cda814b95176221319da88d044978341 | 288ee97253adf4ba22724d6df85887d8f2d913fa | refs/heads/master | 2016-09-05T09:40:02.021254 | 2014-07-15T11:16:48 | 2014-07-15T11:16:48 | 19,299,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,429 | java | package com.canzs.czs.pojo.entity;
// Generated 2014-5-12 20:25:46 by Hibernate Tools 3.4.0.CR1
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* BusinessConsumer generated by hbm2java
*/
@Entity
@Table(name = "business_consumer", catalog = "czs")
public class BusinessConsumer implements java.io.Serializable {
private Long id;
private String businessId;
private String consumerId;
private Long consumeTimes;
private Date lastConsumeTime;
private Long sceneId;
private String consumeCode;
private Short status;
private String handler;
private Date handleDateTime;
public BusinessConsumer() {
}
public BusinessConsumer(String businessId, String consumerId, Long consumeTimes, Date lastConsumeTime,
Long sceneId, String consumeCode, Short status, String handler, Date handleDateTime) {
this.businessId = businessId;
this.consumerId = consumerId;
this.consumeTimes = consumeTimes;
this.lastConsumeTime = lastConsumeTime;
this.sceneId = sceneId;
this.consumeCode = consumeCode;
this.status = status;
this.handler = handler;
this.handleDateTime = handleDateTime;
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "id", unique = true, nullable = false)
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
@Column(name = "business_id")
public String getBusinessId() {
return this.businessId;
}
public void setBusinessId(String businessId) {
this.businessId = businessId;
}
@Column(name = "consumer_id")
public String getConsumerId() {
return this.consumerId;
}
public void setConsumerId(String consumerId) {
this.consumerId = consumerId;
}
@Column(name = "consume_times")
public Long getConsumeTimes() {
return this.consumeTimes;
}
public void setConsumeTimes(Long consumeTimes) {
this.consumeTimes = consumeTimes;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "last_consume_time", length = 19)
public Date getLastConsumeTime() {
return this.lastConsumeTime;
}
public void setLastConsumeTime(Date lastConsumeTime) {
this.lastConsumeTime = lastConsumeTime;
}
@Column(name = "scene_id")
public Long getSceneId() {
return this.sceneId;
}
public void setSceneId(Long sceneId) {
this.sceneId = sceneId;
}
@Column(name = "consume_code", length = 500)
public String getConsumeCode() {
return this.consumeCode;
}
public void setConsumeCode(String consumeCode) {
this.consumeCode = consumeCode;
}
@Column(name = "status")
public Short getStatus() {
return this.status;
}
public void setStatus(Short status) {
this.status = status;
}
@Column(name = "handler")
public String getHandler() {
return this.handler;
}
public void setHandler(String handler) {
this.handler = handler;
}
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "handle_date_time", length = 19)
public Date getHandleDateTime() {
return this.handleDateTime;
}
public void setHandleDateTime(Date handleDateTime) {
this.handleDateTime = handleDateTime;
}
}
| [
"xiweicheng@yeah.net"
] | xiweicheng@yeah.net |
9c53784af33e6740e5496acc4be98f4700ae6cbd | 58b5ee7d11f40f315fa63f1fa982b30e4e753894 | /baiduYun/src/com/cjb/baiduyun/BaiduMain.java | 17759e77dab971a720b7a1f6863adad4605432b7 | [] | no_license | caijinbei/Test | 06e4d23d98780c989e85dcd7ea962420868ae13a | 824ff3c1f22179ff2430d83197c652f0f919d8fa | refs/heads/master | 2020-08-19T18:57:05.968664 | 2018-04-20T10:49:04 | 2018-04-20T10:49:04 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 5,626 | java | package com.cjb.baiduyun;
import java.io.IOException;
import java.sql.SQLException;
import org.apache.http.HttpEntity;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
public class BaiduMain {
/**
* @param args
* @throws IOException
* @throws ClientProtocolException
* @throws SQLException
*/
public static void main(String[] args) throws ClientProtocolException, IOException, SQLException {
DBUtil dbUtil = new DBUtil();
dbUtil.initConn();
//43738000
int n=43738209;
for (int i = 0; i < 2000; i++) {
try {
BaiduRes res = new BaiduRes();
res.setNum("" + (n+i));
res.setYurl("http://pdd.19mi.net/go/" + (n+i));
System.err.println("index:"+i);
getBaiduUrl(res);
if(res.isGetUrlSuccess()){
getMsg(res);
if(res.isGetMsgSuccess()){
String sql = "INSERT INTO BAIDUYUN(num,yurl,burl,filename,sxtime,filetime) VALUES ('" + res.getNum() + "', '" + res.getYurl() + "', '" + res.getBurl() + "', '" + res.getFilename() + "', '" + res.getSxtime() + "', '" + res.getFiletime() + "')";
dbUtil.exeSql(sql);
System.err.println("抓取成功");
}else {
System.err.println("地址抓取失败");
}
}else {
res.getBurl();
System.err.println("信息抓取失败");
}
Thread.sleep(1000);
} catch (Exception e) {
System.err.println("抓取失败");
}
}
dbUtil.closeConn();
}
private static void getMsg(BaiduRes res) throws ClientProtocolException, IOException {
try {
CloseableHttpClient httpClient = new DefaultHttpClient();
// 执行请求
CloseableHttpResponse response = null;
httpClient.getParams().setParameter("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11");
HttpGet httpGet = new HttpGet(res.getBurl());
httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");
response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
String responseContent = EntityUtils.toString(entity, "UTF-8");
responseContent = responseContent.replace(" ", "").replace("\n", "").replace("\t", "").replace("\r", "");
//System.err.println(responseContent);
String titleStart = "><title>";
String titleEnd = "_免费高速下载|百度网盘";
int start = responseContent.indexOf(titleStart);
int end = responseContent.indexOf(titleEnd);
if (start < 0||end<0) {
res.setGetMsgSuccess(false);
return;
}
String title = responseContent.substring(start + titleStart.length(), end);
//System.err.println(title);
res.setFilename(title.replace("'", ""));
/*---------------------------------*/
titleStart = "失效时间:";
titleEnd = "</div><divclass=\"slide-show-other-cnsclearfix\">";
start = responseContent.indexOf(titleStart);
end = responseContent.indexOf(titleEnd);
title = responseContent.substring(start + titleStart.length(), end);
//System.err.println(title);
res.setSxtime(title);
/*---------------------------------*/
titleStart = "<divclass=\"share-file-info\"><span>";
titleEnd = "</span></div><divclass=\"share-valid-check\">";
start = responseContent.indexOf(titleStart);
end = responseContent.indexOf(titleEnd);
title = responseContent.substring(start + titleStart.length(), end);
// System.err.println(title);
res.setFiletime(title);
response.close();
httpClient.close();
} catch (Exception e) {
res.setGetMsgSuccess(false);
e.printStackTrace();
}
res.setGetMsgSuccess(true);
}
/**
*
* 获取百度云地址
*
* @return
*/
private static String getBaiduUrl(BaiduRes res) {
// 43739544
String baidu = "";
CloseableHttpClient httpClient = new DefaultHttpClient();
// 执行请求
CloseableHttpResponse response = null;
try {
httpClient.getParams().setParameter("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11");
HttpGet httpGet = new HttpGet(res.getYurl());
httpGet.setHeader("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3");
response = httpClient.execute(httpGet);
HttpEntity entity = response.getEntity();
String responseContent = EntityUtils.toString(entity, "UTF-8");
//System.err.println(responseContent);
//进行处理验证码
if (responseContent.indexOf("请输入验证码") > 0) {
return "";
//new DoWithCode().dowithCodeTobaiduURL(res);
}
// 截取数据 找到百度云地址
String startIndex = "<a href=\"";
int start = responseContent.indexOf(startIndex);
int end = responseContent.indexOf("\" rel=\"");
baidu = responseContent.substring(start + startIndex.length(), end);
//System.err.println(baidu);
response.close();
httpClient.close();
} catch (Exception e) {
}finally{
try {
response.close();
httpClient.close();
Thread.sleep(60000*30);
} catch (Exception e2) {
// TODO: handle exception
}
}
if (baidu.length() > 10) {
res.setGetUrlSuccess(true);
res.setBurl(baidu);
}
return baidu;
}
}
| [
"caiji@caijinbei"
] | caiji@caijinbei |
c989b974b7fe4a78d4f6793d3d09b226e7238f6f | 965522720d9df90bfca9c821ec3d733d31ab1c3c | /src/main/java/com/justfind/constant/BaseConstant.java | 4e169633de81dc9a3e1d17c115cf3f15baf42597 | [] | no_license | weifeng17183/chebao | eeca4856d23f920bc56800c3012b0d525a8a431d | bd76c1ab534e18740fff4dfeb6734f3b8a2b7c99 | refs/heads/master | 2020-03-28T10:08:22.565448 | 2019-01-11T06:25:30 | 2019-01-11T06:25:30 | 148,085,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,288 | java | package com.justfind.constant;
public class BaseConstant {
public static final String WX_URL = "https://api.mch.weixin.qq.com/pay/unifiedorder";
public static final String WX_URL_RETURN = "https://api.mch.weixin.qq.com/secapi/pay/refund";
public static final String PAY_METHOD = "POST";
public static final String LOGIN_SESSION = "LOGINSESSION";
public static final String HEAD_PORTRAIT = "headPortrait";
public static final String SHOP_PORTRAIT = "shopPortrait";
public static final String CAR_PIC = "carPic";
public static final String ORDER_PIC = "orderPic";
public static class RefundStatus {
public static final int WAIT = 0; // 退款申请中
public static final int SUCCESS = 1; // 退款成功
public static final int FAIL = 2;// :退款失败
}
public static class OrderStatus{
public static final int CANCEL=-1; //取消订单
public static final int WAIT=0; //待支付
public static final int PAYING=1; // 支付中
public static final int SUCCESS=2;//支付成功
public static final int FAIL=3;//支付失败
public static final int REFUNDING=4;//退款中
public static final int REFUND=5;//已退款
public static final int REFUND_FAIL=6;//退款失败
}
public static class PayType {
public static final int ALIPAY = 0; // 阿里
public static final int WEIXIN = 1; // 微信
}
/**
* 手机验证码的有效时间
*/
public static final int VERIFYCODE_VAILDATE_SECOND = 300;
public static class UserStates {
public static final int NORMAL = 1;
public static final int DISABLED = 2;
}
public static class AdminStatus {
public static final int NORMAL = 1; // 正常
public static final int DISABLED = 2; // 禁用
}
public static class SequenceKey{
public static final String ORDER_KEY="ORDER_KEY";
public static final String RETURN_KEY="RETURN_KEY";
}
public static class FrontLoginStatus {
public static final int SUCCESS = 0; // 登录成功
public static final int FAIL_USER_NAME = -1; // 用户名不存在
public static final int FAIL_PASSWORD = -2; // 密码错误
public static final int FAIL_PROVIDER = -3; // 供应商暂不支持登录
}
}
| [
"kuaizhao@windows10.microdone.cn"
] | kuaizhao@windows10.microdone.cn |
908a916f557511b0d3ab522a7207e3e00b75ed83 | 258268e47b5bda38373c72e19c64988a40a78019 | /ex5/Ex2_MethoCall.java | cbe34a029d15c80ce1e07d96cd7919698f4f7e03 | [] | no_license | SimJaeMin/Javabook | 336adbb0af7dd879b3d72c2d169e8289310d4280 | 509dab087c765e942ef96db894add2e40e5a1247 | refs/heads/master | 2020-06-24T13:57:09.218721 | 2019-07-26T12:01:28 | 2019-07-26T12:01:28 | 198,979,909 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 406 | java | package ex5;
/* Ex2_MethoCall */
public class Ex2_MethoCall {
//C메서드의 인자로 일반 자료형을 전달 할때
//값을 복사해서 전달 하는 개념
public static void main(String[] args) {
int n = 10;
test(n);
System.out.println("Value1:"+n);
}
private static void test(int n) {
n += 20;
System.out.println("Value2:"+n);
}
}
| [
"o0xvx0o5@naver.com"
] | o0xvx0o5@naver.com |
3b2bcf5938980d03c18c6abf23978221f642d67d | b97bf8bf78a2db4a7717b32498b08cb62f647a75 | /src/main/java/su/spb/den/OutputProviderImpl.java | 7c7974b0b87175916f00e1089b6414b611d1b237 | [] | no_license | denis-anisimov/elevator | 57b85fefd86b50fa9660780710ff0c90ce7875de | 0b97d69e27da7d5c7e8050bec73023466a1cb81b | refs/heads/master | 2021-08-29T17:44:42.674223 | 2017-12-14T14:12:51 | 2017-12-14T14:14:03 | 114,258,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | package su.spb.den;
public class OutputProviderImpl implements OutputProvider {
@Override
public void error(String error) {
System.err.println(error);
System.err.flush();
}
@Override
public void floorPassed(int floor) {
System.out.println(String
.format("\nThe elevator is on the floor number %d", floor));
showCommandInvite();
}
@Override
public void doorsOpened() {
System.out.println("\nThe elevator's doors are opened");
showCommandInvite();
}
@Override
public void doorsClosed() {
System.out.println("\nThe elevator's doors are closed");
showCommandInvite();
}
@Override
public void sameFloorInside(int floor) {
System.out.println(String.format(
"\nThe elevator's doors are closed, it's on the floor number %s, "
+ "ignoring command to go the same floor requested inside the elevator",
floor));
showCommandInvite();
}
@Override
public void doorsClosing() {
// ignore
}
private void showCommandInvite() {
System.out.print("> ");
System.out.flush();
}
}
| [
"denis@vaadin.com"
] | denis@vaadin.com |
36c429159be0e0870fd1133314ef18c74c4862dd | 7c20d7db37a629bf859cc1b3f14d5906076c78a4 | /src/com/master/bd/Relatorio_Gerencial_ContaBD.java | 7e71c3ce1237da30aefff9b95082c75d4176f165 | [] | no_license | tbaiocco/nfe4 | 9055b237338f45afe7ec708c94880cea04887325 | 8e2416d30797dc8a2b1deaed1633f88ac26b75b2 | refs/heads/master | 2020-03-24T19:33:25.169266 | 2018-11-22T18:39:27 | 2018-11-22T18:39:27 | 142,933,673 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,738 | java | package com.master.bd;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import com.master.ed.Relatorio_Gerencial_ContaED;
import com.master.util.BancoUtil;
import com.master.util.Excecoes;
import com.master.util.bd.ExecutaSQL;
/**
* @author Regis Steigleder
* @serial Relatorios Gerenciais
* @serialData 14/12/2005
*/
public class Relatorio_Gerencial_ContaBD extends BancoUtil {
private ExecutaSQL executasql;
public Relatorio_Gerencial_ContaBD(ExecutaSQL sql) {
super(sql);
this.executasql = sql;
}
public Relatorio_Gerencial_ContaED inclui(Relatorio_Gerencial_ContaED ed) throws Excecoes {
String sql = null;
try {
ed.setOid_Relatorio_Gerencial_Conta(getAutoIncremento("oid_Relatorio_Gerencial_conta", "Relatorios_Gerenciais_Contas"));
sql = " INSERT INTO " +
" Relatorios_Gerenciais_Contas " +
" ( " +
" oid_Relatorio_Gerencial_Conta," +
" oid_Conta," +
" oid_Usuario," +
" oid_Relatorio_Gerencial," +
" oid_Relatorio_Gerencial_Grupo " +
" ) " +
" VALUES (" +
ed.getOid_Relatorio_Gerencial_Conta() + ", " +
ed.getOid_Conta() + ", " +
ed.getOid_Usuario() + ", " +
ed.getOid_Relatorio_Gerencial() + ", " +
ed.getOid_Relatorio_Gerencial_Grupo() +
" ) ";
executasql.executarUpdate(sql);
return ed;
} catch (Exception exc) {
throw new Excecoes(exc.getMessage(), exc, this.getClass().getName(),
"inclui(Relatorio_Gerenciai_ContaED ed)");
}
}
public void altera(Relatorio_Gerencial_ContaED ed) throws Excecoes {
String sql = null;
try {
sql = " UPDATE Relatorios_Gerenciais_Contas SET " +
" oid_Relatorio_Gerencial_Conta = oid_Relatorio_Gerencial_Conta, " +
" oid_Conta = " + ed.getOid_Conta() + ", " +
" oid_Usuario = " + ed.getOid_Usuario() + ", " +
" oid_Relatorio_Gerencial = " + ed.getOid_Relatorio_Gerencial() + ", " +
" oid_Relatorio_Gerencial_Grupo = " + ed.getOid_Relatorio_Gerencial_Grupo() + ", " +
" DT_STAMP = '" + ed.getDt_stamp() + "', " +
" USUARIO_STAMP = '" + ed.getUsuario_Stamp() + "', " +
" DM_STAMP = '" + ed.getDm_Stamp() + "' " +
" WHERE " +
" oid_Relatorio_Gerencial_Conta = " + ed.getOid_Relatorio_Gerencial_Conta();
executasql.executarUpdate(sql);
} catch (Exception exc) {
throw new Excecoes(exc.getMessage(), exc, this.getClass().getName(),
"altera(Relatorio_Gerencial_ContaED ed)");
}
}
public void deleta(Relatorio_Gerencial_ContaED ed) throws Excecoes {
String sql = null;
try {
sql = " DELETE " +
" FROM Relatorios_Gerenciais_Contas " +
" WHERE oid_Relatorio_Gerencial_Conta = " + ed.getOid_Relatorio_Gerencial_Conta();
executasql.executarUpdate(sql);
} catch (Exception exc) {
throw new Excecoes(exc.getMessage(), exc, this.getClass().getName(),
"deleta(Relatorio_Gerencial_ContaED ed)");
}
}
public ArrayList lista(Relatorio_Gerencial_ContaED ed) throws Excecoes {
String sql = null;
ArrayList list = new ArrayList();
try {
sql = " SELECT * " +
" FROM " +
" Relatorios_Gerenciais_Contas as rgc, " +
" Usuarios as u, " +
" Contas as c" +
" WHERE 1=1 ";
if (ed.getOid_Relatorio_Gerencial_Conta() > 0)
sql += " AND rgc.oid_Relatorio_Gerencial_Conta = " + ed.getOid_Relatorio_Gerencial_Conta();
else {
if (ed.getOid_Relatorio_Gerencial() > 0)
sql += " AND rgc.oid_Relatorio_Gerencial = " + ed.getOid_Relatorio_Gerencial();
if (ed.getOid_Usuario() > 0)
sql += " AND rgc.oid_Usuario = " + ed.getOid_Usuario();
if (ed.getOid_Relatorio_Gerencial_Grupo() > 0)
sql += " AND rgc.oid_Relatorio_Gerencial_Grupo = " + ed.getOid_Relatorio_Gerencial_Grupo();
}
sql += " and rgc.oid_Conta = c.oid_Conta" +
" and rgc.oid_Usuario = u.oid_Usuario " +
" ORDER BY " +
" c.cd_Conta ";
ResultSet res = this.executasql.executarConsulta(sql);
while (res.next())
{
Relatorio_Gerencial_ContaED edVolta = new Relatorio_Gerencial_ContaED();
edVolta.setOid_Relatorio_Gerencial_Conta(res.getInt("oid_Relatorio_Gerencial_Conta"));
edVolta.setOid_Conta(res.getInt("oid_Conta"));
edVolta.setOid_Usuario(res.getInt("oid_Usuario"));
edVolta.setOid_Relatorio_Gerencial(res.getInt("oid_Relatorio_Gerencial"));
edVolta.setOid_Relatorio_Gerencial_Grupo(res.getInt("oid_Relatorio_Gerencial_Grupo"));
edVolta.setCd_Conta(res.getString("cd_Conta"));
edVolta.setNm_Conta(res.getString("nm_Conta"));
edVolta.setCd_Estrutural(res.getString("cd_Estrutural"));
edVolta.setNm_Usuario(res.getString("nm_Usuario"));
list.add(edVolta);
}
return list;
} catch (Exception exc) {
throw new Excecoes(exc.getMessage(), exc, this.getClass().getName(),
"lista(Relatorio_Gerencial_ContaED ed)");
}
}
public Relatorio_Gerencial_ContaED getByRecord(Relatorio_Gerencial_ContaED ed) throws Excecoes {
String sql = null;
Relatorio_Gerencial_ContaED edQBR = new Relatorio_Gerencial_ContaED();
try {
sql = " SELECT * " +
" FROM " +
" Relatorios_Gerenciais_Contas as rgc, " +
" Usuarios as u, " +
" Contas as c " +
" WHERE ";
if (ed.getOid_Relatorio_Gerencial_Conta() > 0 ) {
sql +=" rgc.oid_Relatorio_Gerencial_Conta = " + ed.getOid_Relatorio_Gerencial_Conta();
} else {
if (ed.getOid_Relatorio_Gerencial_Grupo() > 0 ) {
sql +=" rgc.oid_Relatorio_Gerencial_Grupo = " + ed.getOid_Relatorio_Gerencial_Grupo() +
" and rgc.oid_Conta = " + ed.getOid_Conta();
}
}
sql += " and rgc.oid_Conta = c.oid_Conta" +
" and rgc.oid_Usuario = u.oid_Usuario " +
" ORDER BY " +
" c.cd_Conta ";
ResultSet res = null;
res = this.executasql.executarConsulta(sql);
while (res.next()){
populaED(edQBR, res);
}
}
catch(Exception e){
throw new Excecoes(e.getMessage(), e, getClass().getName(), "getByRecord(Relatorio_Gerencial_ContaED ed)");
}
return edQBR;
}
protected void populaED(Relatorio_Gerencial_ContaED ed, ResultSet res) throws SQLException {
ed.setOid_Relatorio_Gerencial_Conta(res.getInt("oid_Relatorio_Gerencial_Conta"));
ed.setOid_Conta(res.getInt("oid_Conta"));
ed.setOid_Usuario(res.getInt("oid_Usuario"));
ed.setOid_Relatorio_Gerencial(res.getInt("oid_Relatorio_Gerencial"));
ed.setOid_Relatorio_Gerencial_Grupo(res.getInt("oid_Relatorio_Gerencial_Grupo"));
ed.setCd_Conta(res.getString("cd_Conta"));
ed.setNm_Conta(res.getString("nm_Conta"));
ed.setCd_Estrutural(res.getString("cd_Estrutural"));
ed.setNm_Usuario(res.getString("nm_Usuario"));
}
} | [
"teofilo.baiocco@letshare.com"
] | teofilo.baiocco@letshare.com |
24239e09e90872048a93b94911e3e00b3feb0f68 | 3a816a876e735ca1c80a56d66c8960ec1a41128d | /Section 4/Decimal Comparator Ex 5/src/com/company/DecimalComparator.java | b9c2c10fa9e2f3485ad6afcf35d61cda0bf2b427 | [] | no_license | SaifuddinSaifee/Java-Udemy | 8ec20e191a25dccb15dfd36eb5bd902d3047c5b8 | e40dc8fc7aa040cd2ca6d335ff4c67b8839a4943 | refs/heads/main | 2023-08-13T17:21:12.547319 | 2021-09-22T21:10:06 | 2021-09-22T21:10:06 | 364,477,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 260 | java | package com.company;
public class DecimalComparator {
public static boolean areEqualByThreeDecimalPlaces (double num1, double num2) {
int num1_ = (int) (num1 * 1000);
int num2_ = (int) (num2 * 1000);
return num1_ == num2_;
}
}
| [
"saifuddin.saifee@live.co.uk"
] | saifuddin.saifee@live.co.uk |
364ecc7a68dc0364a98ec2978302c15e7e3c3dad | 503872dfdf82e44be7dbf4dd3b6b1412f12df25d | /src/main/java/com/server/career/controller/BaseController.java | 5d3b42c77bc22dfe82eadb2150677ccdb4861c1e | [] | no_license | devcuong/rivercity | af4fb43d2dc5a28012a55334f6b0c632e083cc29 | ceeecbd72098f55e287a25d1e3c52fa002aaaf00 | refs/heads/master | 2020-04-06T06:56:28.275710 | 2016-08-22T19:11:31 | 2016-08-22T19:11:31 | 61,335,084 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 72 | java | package com.server.career.controller;
public class BaseController {
}
| [
"cuong.dh8c@gmail.com"
] | cuong.dh8c@gmail.com |
8d10861229d698e8d89ad6d86373e77fb248c2fa | bc72beca56de83388defa3e4beb2a6b9047f9b95 | /src/main/java/ai/cuddle/spark/entity/Word.java | 7a45ac619720cc7b337070daa1499e3b36b8a68f | [] | no_license | witnesslq/SparkSqlWithSpring | c3af46dcc0d22a408a48b3ce6275f639fe0e3f68 | 0ee18d919f7ab7c1aaaacdc9c05c01ea8ebe8612 | refs/heads/master | 2020-03-23T12:20:14.366573 | 2018-02-09T15:45:00 | 2018-02-09T15:45:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 568 | java | package ai.cuddle.spark.entity;
/**
* Created by suman.das on 11/30/17.
*/
public class Word {
private String word;
public Word() {
}
public Word(String word) {
this.word = word;
}
public void setWord(String word) {
this.word = word;
}
public String getWord() {
return word;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("Word{");
sb.append("word='").append(word).append('\'');
sb.append('}');
return sb.toString();
}
}
| [
"suman.das@fractalanalytics.com"
] | suman.das@fractalanalytics.com |
df37daa6ee72fae96ed1e82a000cb991554b0c54 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /ess-20140828/src/main/java/com/aliyun/ess20140828/models/CreateAlarmResponseBody.java | 683dbde5f6af8964285edd4382e4178ad846a874 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 935 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.ess20140828.models;
import com.aliyun.tea.*;
public class CreateAlarmResponseBody extends TeaModel {
@NameInMap("AlarmTaskId")
public String alarmTaskId;
@NameInMap("RequestId")
public String requestId;
public static CreateAlarmResponseBody build(java.util.Map<String, ?> map) throws Exception {
CreateAlarmResponseBody self = new CreateAlarmResponseBody();
return TeaModel.build(map, self);
}
public CreateAlarmResponseBody setAlarmTaskId(String alarmTaskId) {
this.alarmTaskId = alarmTaskId;
return this;
}
public String getAlarmTaskId() {
return this.alarmTaskId;
}
public CreateAlarmResponseBody setRequestId(String requestId) {
this.requestId = requestId;
return this;
}
public String getRequestId() {
return this.requestId;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
8b1a22a18b95a20cd83f0df3f2f95fa6ccaca975 | 58a8d4e86f2d46efbade3b7385d406a6030b676a | /LeanTech/src/main/java/com/leantech/example/LeanTechApplication.java | 39243fb5f3a989239e13cf9bba9058c5d96af459 | [] | no_license | hcsalced/LeanTech | ec25e336af9832a637e6da3cc769aae7885822fb | 5af8368fe818dbd8b76c9a1a2323d6e945850455 | refs/heads/master | 2023-06-14T09:01:51.689415 | 2021-07-09T03:07:45 | 2021-07-09T03:07:45 | 384,303,988 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package com.leantech.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class LeanTechApplication {
public static void main(String[] args) {
SpringApplication.run(LeanTechApplication.class, args);
}
}
| [
"hcsalced@hotmail.com"
] | hcsalced@hotmail.com |
96b366293b695dc57a46deed80b7113f5665f42d | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/appbrand/game/e/a/e$1.java | cfed7e5fd8b8ea4ac45ea62761164cb884d413aa | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 6,213 | java | package com.tencent.mm.plugin.appbrand.game.e.a;
import android.content.Context;
import android.text.Editable;
import android.view.View;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.LinearLayout.LayoutParams;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.config.a.a.b;
import com.tencent.mm.plugin.appbrand.game.widget.input.WAGamePanelInputEditText;
import com.tencent.mm.plugin.appbrand.game.widget.input.a.a;
import com.tencent.mm.plugin.appbrand.o;
import com.tencent.mm.plugin.appbrand.page.u;
import com.tencent.mm.plugin.appbrand.s;
import com.tencent.mm.plugin.appbrand.widget.input.d.b;
import com.tencent.mm.plugin.appbrand.widget.input.p;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.ae;
import com.tencent.mm.ui.tools.b.c;
import com.tencent.mm.ui.tools.f.a;
final class e$1
implements Runnable
{
e$1(e parame, s params, String paramString, int paramInt1, boolean paramBoolean1, boolean paramBoolean2, b paramb, int paramInt2)
{
}
public final void run()
{
AppMethodBeat.i(130205);
e locale = this.hsz;
Object localObject1 = this.hsj;
Object localObject2 = this.hsu;
int i = this.hsv;
boolean bool1 = this.hsw;
boolean bool2 = this.hsx;
b localb = this.hsy;
int j = this.eIl;
Object localObject3;
if (((s)localObject1).isRunning())
{
localObject3 = ((s)localObject1).aun();
if (localObject3 != null);
}
else
{
AppMethodBeat.o(130205);
return;
}
float f = com.tencent.mm.bz.a.getDensity(((u)localObject3).mContext);
com.tencent.mm.plugin.appbrand.game.widget.input.a locala = com.tencent.mm.plugin.appbrand.game.widget.input.a.cl(((u)localObject3).getContentView());
WAGamePanelInputEditText localWAGamePanelInputEditText = locala.getAttachedEditText();
label151: boolean bool3;
if (!bo.isNullOrNil((String)localObject2))
{
localObject3 = localObject2;
if (((String)localObject2).length() > i)
localObject3 = ((String)localObject2).substring(0, i);
localWAGamePanelInputEditText.setText((CharSequence)localObject3);
localWAGamePanelInputEditText.setSelection(localWAGamePanelInputEditText.getText().length());
if (bool1)
break label583;
bool3 = true;
label159: localWAGamePanelInputEditText.setSingleLine(bool3);
localWAGamePanelInputEditText.setMaxLength(i);
localObject3 = p.a(localWAGamePanelInputEditText).PM(i);
((c)localObject3).zIx = false;
((c)localObject3).jeZ = f.a.zFu;
((c)localObject3).a(new e.2(locale, localWAGamePanelInputEditText, (s)localObject1));
localWAGamePanelInputEditText.addTextChangedListener(new e.3(locale, (s)localObject1));
localWAGamePanelInputEditText.setComposingDismissedListener(new e.4(locale, localWAGamePanelInputEditText, (s)localObject1));
locala.setOnConfirmClickListener(new e.5(locale, localWAGamePanelInputEditText, (s)localObject1, bool2, locala));
locala.setOnVisibilityChangedListener(new e.6(locale, localWAGamePanelInputEditText, (s)localObject1, locala, f, j));
if (!bool1)
localWAGamePanelInputEditText.setOnEditorActionListener(new e.7(locale, bool2, localWAGamePanelInputEditText, (s)localObject1));
localObject3 = com.tencent.mm.plugin.appbrand.config.a.a.t(((s)localObject1).getRuntime().atM()).dI(com.tencent.mm.plugin.appbrand.config.a.a.ayQ());
localObject1 = ((s)localObject1).getRuntime().atM();
localObject2 = locala.hur;
j = ae.fr((Context)localObject1);
ab.i("MicroMsg.WAGameInputPanel", "orientation: %s", new Object[] { localObject3 });
if ((localObject3 == a.b.hiM) || (localObject3 == a.b.hiN) || (a.b.hiO == localObject3) || (a.b.hiP == localObject3))
{
localObject3 = (LinearLayout.LayoutParams)((a.a)localObject2).huw.getLayoutParams();
ab.i("MicroMsg.WAGameInputPanel", "EditBar setmConfirmButtonPadding tolerate(%d),rightMargin(%d).", new Object[] { Integer.valueOf(j), Integer.valueOf(((LinearLayout.LayoutParams)localObject3).rightMargin) });
((LinearLayout.LayoutParams)localObject3).setMargins(((LinearLayout.LayoutParams)localObject3).leftMargin, ((LinearLayout.LayoutParams)localObject3).topMargin, j + ((LinearLayout.LayoutParams)localObject3).rightMargin, ((LinearLayout.LayoutParams)localObject3).bottomMargin);
((a.a)localObject2).huw.setLayoutParams((ViewGroup.LayoutParams)localObject3);
}
if (localb != null)
break label589;
localObject3 = b.jiY;
label486: locala.getAttachedEditText().setImeOptions(((b)localObject3).jjd);
locala.getAttachedEditText().setFocusable(true);
locala.getAttachedEditText().setFocusableInTouchMode(true);
locala.show();
switch (com.tencent.mm.plugin.appbrand.game.widget.input.a.2.huv[localObject3.ordinal()])
{
default:
case 1:
case 2:
case 3:
case 4:
case 5:
}
}
while (true)
{
AppMethodBeat.o(130205);
break;
localWAGamePanelInputEditText.setText("");
break label151;
label583: bool3 = false;
break label159;
label589: localObject3 = localb;
break label486;
((Button)locala.hur.getConfirmButton()).setText(2131297109);
AppMethodBeat.o(130205);
break;
((Button)locala.hur.getConfirmButton()).setText(2131297112);
AppMethodBeat.o(130205);
break;
((Button)locala.hur.getConfirmButton()).setText(2131297111);
AppMethodBeat.o(130205);
break;
((Button)locala.hur.getConfirmButton()).setText(2131297110);
AppMethodBeat.o(130205);
break;
((Button)locala.hur.getConfirmButton()).setText(2131297113);
}
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes3-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.appbrand.game.e.a.e.1
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
a3fcce53e38940680511a14a09aa2c1a60643b17 | 1c5e8605c1a4821bc2a759da670add762d0a94a2 | /easrc/equipment/special/app/AbstractAnnualYearPlanEditUIHandler.java | 84bc9abb2297cc2164d579ce6aa0e8c71bf8e7cf | [] | no_license | shxr/NJG | 8195cfebfbda1e000c30081399c5fbafc61bb7be | 1b60a4a7458da48991de4c2d04407c26ccf2f277 | refs/heads/master | 2020-12-24T06:51:18.392426 | 2016-04-25T03:09:27 | 2016-04-25T03:09:27 | 19,804,797 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | /**
* output package name
*/
package com.kingdee.eas.port.equipment.special.app;
import com.kingdee.bos.Context;
import com.kingdee.eas.framework.batchHandler.RequestContext;
import com.kingdee.eas.framework.batchHandler.ResponseContext;
/**
* output class name
*/
public abstract class AbstractAnnualYearPlanEditUIHandler extends com.kingdee.eas.xr.app.XRBillBaseEditUIHandler
{
} | [
"shxr_code@126.com"
] | shxr_code@126.com |
3f8de607df17402e96c7405261ec0ab5da13077e | 4a1e5e3edcfc57e70a2b3de9d95cde15aa97009c | /src/PrimeorNot.java | 81b8e18eccd4d321b691812859ebce41daffd91c | [] | no_license | League-Level0-Student/level-0-module-4-Dragon12346 | 3aae9ccf9fea1253d9362aa07f5c4acd91ee0c4d | abdde60921748b3ba9c17efaf88c329f322f8dd4 | refs/heads/master | 2021-09-11T20:33:39.740878 | 2018-04-12T01:33:26 | 2018-04-12T01:33:26 | 112,880,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 454 | java | import javax.swing.JOptionPane;
public class PrimeorNot {
public static void main(String[] args) {
for (int i = 0; i < 450; i++) {
String q = JOptionPane.showInputDialog("Give me a #.");
int w = Integer.parseInt(q);
for (int j = 2; j < w-1; j++) {
if (w % j == 0) {
JOptionPane.showMessageDialog(null, "Not Prime");
System.exit(0);;
}
}
JOptionPane.showMessageDialog(null, "It's Prime.");
}
}
}
| [
"league@iMac.attlocal.net"
] | league@iMac.attlocal.net |
0b19230b51df9ce64025925e3fd37b0d2d1843e6 | a51b0eb46ee2b6bc826fbc2ac2c2d2adea8d6594 | /app/src/main/java/com/world/jasonloh95/towit/driverSettingActivity.java | 3eb85dc376a6240ad7bfb30a949a35f8a6219679 | [] | no_license | JasonLoh0601/TowIt | 162ad5240519c3eb27cce7338ffef42c28052567 | c5e9eff22f298225f8cdbda6a7b8c315550ff98d | refs/heads/master | 2021-01-25T14:15:38.761137 | 2018-03-03T08:27:06 | 2018-03-03T08:27:06 | 123,670,523 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,794 | java | package com.world.jasonloh95.towit;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioGroup;
import com.bumptech.glide.Glide;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
public class driverSettingActivity extends AppCompatActivity {
private EditText mNameField, mPhoneField, mCarField;
private Button mBack, mConfirm;
private ImageView mProfileImage;
private FirebaseAuth mAuth;
private DatabaseReference mDriverDatabase;
private String userID;
private String mName;
private String mPhone;
private String mCar;
private String mService;
private String mProfileImageUrl;
private Uri resultUri;
private RadioGroup mRadioGroup;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_driver_setting);
mNameField = (EditText) findViewById(R.id.name);
mPhoneField = (EditText) findViewById(R.id.phone);
mCarField = (EditText) findViewById(R.id.car);
mProfileImage = (ImageView) findViewById(R.id.profileImage);
mBack = (Button) findViewById(R.id.back);
mConfirm = (Button) findViewById(R.id.confirm);
mAuth = FirebaseAuth.getInstance();
userID = mAuth.getCurrentUser().getUid();
mDriverDatabase = FirebaseDatabase.getInstance().getReference().child("Driver").child(userID);
getUserInfo();
mProfileImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, 1);
}
});
mConfirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
saveUserInformation();
}
});
mBack.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
return;
}
});
}
private void getUserInfo(){
mDriverDatabase.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot dataSnapshot) {
if(dataSnapshot.exists() && dataSnapshot.getChildrenCount()>0){
Map<String, Object> map = (Map<String, Object>) dataSnapshot.getValue();
if(map.get("name")!=null){
mName = map.get("name").toString();
mNameField.setText(mName);
}
if(map.get("contactNumber")!=null){
mPhone = map.get("contactNumber").toString();
mPhoneField.setText(mPhone);
}
if(map.get("car")!=null){
mCar = map.get("car").toString();
mCarField.setText(mCar);
}
if(map.get("profileImageUrl")!=null){
mProfileImageUrl = map.get("profileImageUrl").toString();
Glide.with(getApplication()).load(mProfileImageUrl).into(mProfileImage);
}
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
}
});
}
private void saveUserInformation() {
mName = mNameField.getText().toString();
mPhone = mPhoneField.getText().toString();
mCar = mCarField.getText().toString();
Map userInfo = new HashMap();
userInfo.put("name", mName);
userInfo.put("contactNumber", mPhone);
userInfo.put("car", mCar);
mDriverDatabase.updateChildren(userInfo);
if(resultUri != null) {
StorageReference filePath = FirebaseStorage.getInstance().getReference().child("profile_images").child(userID);
Bitmap bitmap = null;
try {
bitmap = MediaStore.Images.Media.getBitmap(getApplication().getContentResolver(), resultUri);
} catch (IOException e) {
e.printStackTrace();
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 20, baos);
byte[] data = baos.toByteArray();
UploadTask uploadTask = filePath.putBytes(data);
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
finish();
return;
}
});
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Uri downloadUrl = taskSnapshot.getDownloadUrl();
Map newImage = new HashMap();
newImage.put("profileImageUrl", downloadUrl.toString());
mDriverDatabase.updateChildren(newImage);
finish();
return;
}
});
}else{
finish();
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(requestCode == 1 && resultCode == Activity.RESULT_OK){
final Uri imageUri = data.getData();
resultUri = imageUri;
mProfileImage.setImageURI(resultUri);
}
}
}
| [
"jasonloh0601@gmail.com"
] | jasonloh0601@gmail.com |
a8a9b0f121ba2ccfad66e65aa71f090a3ec85d9f | c02d8075f0e05f7c4dfbdd6e64994dc73598dcd7 | /app/src/main/java/com/rideme/driver/network/NetworkActionResult.java | 9efa5b21971527366ffbf057bf02cbb7a5209521 | [] | no_license | GetSI-Sby/getotodriver | 1b2b9256a7dfad8478ea2b1c537bdbaf4449a79c | c794aca2caa3b6100d1c6e7cfcbe89deee2f7beb | refs/heads/master | 2021-03-17T23:07:21.938696 | 2020-03-13T13:36:41 | 2020-03-13T13:36:41 | 247,025,120 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 234 | java | package com.rideme.driver.network;
import org.json.JSONObject;
public interface NetworkActionResult {
public void onSuccess(JSONObject obj);
public void onFailure(String message);
public void onError(String message);
} | [
"170441100100@student.trunojoyo.ac.id"
] | 170441100100@student.trunojoyo.ac.id |
7f3ca96dc3e2f852ecf0227288196fa6eb49e372 | d00081ce3d3c0270ce5683e8d6b7f7843a273835 | /src/main/java/com/hundsun/accountingsystem/Global/VO/TGdxxbParamPojo.java | 8cd3229a077b4a915101e6b4ac0ab31ce887d57c | [] | no_license | flycow/AccountingSystem | dcbfd4c0666be140491053c29a1adfa7e335b537 | 1b25759be378cb2b48fc0d65527cd5598f69f72d | refs/heads/master | 2020-06-12T15:24:01.466326 | 2019-04-29T01:05:17 | 2019-04-29T01:05:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 334 | java | package com.hundsun.accountingsystem.Global.VO;
public class TGdxxbParamPojo {
private int start;
private int end;
public int getStart() {
return start;
}
public void setStart(int start) {
this.start = start;
}
public int getEnd() {
return end;
}
public void setEnd(int end) {
this.end = end;
}
}
| [
"905770446@qq.com"
] | 905770446@qq.com |
c47305a38d24d57bf9e19354e76103113ba100fa | f88d585f07e72e2c32d22c5033f2d6896b1d2816 | /Day1Assignment1/BaseClass.java | dbad8e9036da9d82ae3bbb6ea6d89dccb15ef1d4 | [] | no_license | rameshraor/SeleniumAugust-Week5-Day1 | 98286aa38933ff47c8c461acc1ff5b5eae345a1d | 2dc82815a50d6ca1f4f3a264f2452583da116c03 | refs/heads/main | 2023-07-29T07:06:37.172916 | 2021-09-06T12:40:01 | 2021-09-06T12:40:01 | 403,219,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,266 | java | /**
*
*/
package week5.Day1Assignment1;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import io.github.bonigarcia.wdm.WebDriverManager;
/**
* @author Ramesh
*
* This is the base class - with pre-condition and post-condition
*/
public class BaseClass {
public ChromeDriver driver;
@BeforeMethod
public void preCondition() {
System.out.println("In preCondition() method");
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("http://leaftaps.com/opentaps/");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.id("username")).sendKeys("DemoSalesManager");
driver.findElement(By.id("password")).sendKeys("crmsfa");
driver.findElement(By.className("decorativeSubmit")).click();
driver.findElement(By.linkText("CRM/SFA")).click();
driver.findElement(By.linkText("Leads")).click();
}
@AfterMethod
public void postCondition() {
System.out.println("In postCondition() method");
driver.close();
}
}
| [
"noreply@github.com"
] | rameshraor.noreply@github.com |
cb14e75ba6986ae7215028c681213e2f50e99361 | 9539e7142eb7ec92d2a94239070e81283eb5476e | /score-http/score-http/src/main/java/org/oagi/score/repo/component/dt/UpdateDtPropertiesRepositoryRequest.java | e61491dfd2e6334e02be0305cd500277bebfe890 | [
"MIT"
] | permissive | OAGi/Score | 4040b1fe508bc17e853755d72c4f363d5f4cc97b | 36f9f65bcc51b6764cb5ec5919dbc96cf9f987d9 | refs/heads/master | 2023-08-31T03:59:58.456923 | 2023-08-28T02:37:11 | 2023-08-28T02:37:11 | 20,700,485 | 8 | 9 | MIT | 2023-08-28T02:37:12 | 2014-06-10T20:27:01 | Java | UTF-8 | Java | false | false | 3,208 | java | package org.oagi.score.repo.component.dt;
import org.oagi.score.data.RepositoryRequest;
import org.oagi.score.gateway.http.api.cc_management.data.node.CcBdtPriRestri;
import org.oagi.score.repo.api.impl.utils.StringUtils;
import org.springframework.security.core.AuthenticatedPrincipal;
import java.math.BigInteger;
import java.time.LocalDateTime;
import java.util.List;
public class UpdateDtPropertiesRepositoryRequest extends RepositoryRequest {
private final BigInteger dtManifestId;
private String qualifier;
private String sixDigitId;
private String contentComponentDefinition;
private String definition;
private String definitionSource;
private boolean deprecated;
private BigInteger namespaceId;
private List<CcBdtPriRestri> bdtPriRestriList;
public UpdateDtPropertiesRepositoryRequest(AuthenticatedPrincipal user,
BigInteger dtManifestId) {
super(user);
this.dtManifestId = dtManifestId;
}
public UpdateDtPropertiesRepositoryRequest(AuthenticatedPrincipal user,
LocalDateTime localDateTime,
BigInteger dtManifestId) {
super(user, localDateTime);
this.dtManifestId = dtManifestId;
}
public BigInteger getDtManifestId() {
return dtManifestId;
}
public String getQualifier() {
return qualifier;
}
public void setQualifier(String qualifier) {
if (StringUtils.hasLength(qualifier)) {
this.qualifier = qualifier;
}
}
public String getSixDigitId() {
return sixDigitId;
}
public void setSixDigitId(String sixDigitId) {
this.sixDigitId = sixDigitId;
}
public String getContentComponentDefinition() {
return contentComponentDefinition;
}
public void setContentComponentDefinition(String contentComponentDefinition) {
if (StringUtils.hasLength(contentComponentDefinition)) {
this.contentComponentDefinition = contentComponentDefinition;
}
}
public String getDefinition() {
return definition;
}
public void setDefinition(String definition) {
if (StringUtils.hasLength(definition)) {
this.definition = definition;
}
}
public String getDefinitionSource() {
return definitionSource;
}
public void setDefinitionSource(String definitionSource) {
if (StringUtils.hasLength(definitionSource)) {
this.definitionSource = definitionSource;
}
}
public boolean isDeprecated() {
return deprecated;
}
public void setDeprecated(boolean deprecated) {
this.deprecated = deprecated;
}
public BigInteger getNamespaceId() {
return namespaceId;
}
public void setNamespaceId(BigInteger namespaceId) {
this.namespaceId = namespaceId;
}
public List<CcBdtPriRestri> getBdtPriRestriList() {
return bdtPriRestriList;
}
public void setBdtPriRestriList(List<CcBdtPriRestri> bdtPriRestriList) {
this.bdtPriRestriList = bdtPriRestriList;
}
}
| [
"hakju.oh@nist.gov"
] | hakju.oh@nist.gov |
f8f078b6ccbe200fd8288261ee19208200d16339 | 8f2462e3ca711cb99e26a80c97124392714f3fa8 | /src/main/java/com/studing/command/Command.java | 0a0faeed8ba01ccafab51f33649934ad2fe98f02 | [] | no_license | qzfeng/design | 8eff2b35e97b5a529dfd80182a1132657556e5d4 | 4b74ade3e34fcaf4317e29974858883af88d3d9c | refs/heads/master | 2021-01-22T19:54:10.859770 | 2017-04-05T00:15:55 | 2017-04-05T00:15:55 | 85,255,400 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 140 | java | package com.studing.command;
/**
* Created by fengqz on 2017-3-20.
*/
public interface Command {
void execute();
void undo();
}
| [
"1123824550@qq.com"
] | 1123824550@qq.com |
3e67739105bba37d55fbb42784e2f3291c2c1e35 | 2d91d7c8aeb30d7c3b8ec974a8dface50539112a | /resources/src/main/java/com/feature/resources/server/service/impl/GraphicServiceImpl.java | 83074aced999b17746ecfe7b45faf1b8a19864a4 | [] | no_license | zouyanjian/resources | beb9bc78a5bb3ed4a01ed3d59c2a9ba720c41360 | 10acbfb4dd167538e0c9800af0f61fa1228bef11 | refs/heads/master | 2021-01-18T08:42:35.430388 | 2013-04-01T06:20:10 | 2013-04-01T06:20:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 10,804 | java | package com.feature.resources.server.service.impl;
import com.feature.resources.server.dao.GraphicDao;
import com.feature.resources.server.dao.PropertiesDao;
import com.feature.resources.server.domain.*;
import com.feature.resources.server.dto.CheckResult;
import com.feature.resources.server.dto.CheckStatusDesc;
import com.feature.resources.server.dto.GraphicCheckDTO;
import com.feature.resources.server.dto.GraphicDTO;
import com.feature.resources.server.service.*;
import com.feature.resources.server.util.DomainObjectFactory;
import com.feature.resources.server.util.FilesUtil;
import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.mongodb.gridfs.GridFSDBFile;
import net.coobird.thumbnailator.Thumbnails;
import org.apache.commons.lang3.StringUtils;
import org.bson.types.ObjectId;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Iterator;
import java.util.List;
public class GraphicServiceImpl implements GraphicService {
public static final Logger LOGGER = LoggerFactory.getLogger(GraphicServiceImpl.class);
@Inject
private GraphicDao graphicDao;
@Inject
private PropertiesDao propertiesDao;
@Inject
private DomainObjectFactory objectFactory;
@Inject
private PropertiesService propertiesService;
@Inject
private TagService tagService;
@Inject
private WorkSpaceService workSpaceService;
@Inject
private CXServerService cxServerService;
private Integer width = 40;
private Integer height = 40;
public Graphic addNewGraphic(Graphic graphic, InputStream inputStream) {
Preconditions.checkNotNull(graphic);
Preconditions.checkNotNull(inputStream);
try {
Object fileId = graphicDao.create(graphic.getName(), "application/image", inputStream);
graphic.setAttachment(fileId);
} catch (IOException e) {
LOGGER.error("errors:", e);
}
graphicDao.save(graphic);
return graphic;
}
public void delete(String stringId) {
checkParameters(stringId);
ObjectId id = new ObjectId(stringId);
checkParameters(stringId);
Graphic graphic = get(stringId);
propertiesDao.delete(graphic.getProperties());
graphicDao.deleteGridFSDBFile(graphic.getAttachment());
graphicDao.deleteById(id);
}
public Graphic get(String id) {
checkParameters(id);
return graphicDao.findOne("id", new ObjectId(id));
}
public List<Graphic> findAll() {
return graphicDao.findAllByCreateAtTime();
}
public Graphic add(Graphic graphic) {
graphicDao.save(graphic);
return graphic;
}
public void writeThumbnailStreamIntoDisplay(String graphicId, OutputStream outputStream) {
checkParameters(graphicId);
Graphic graphic = graphicDao.get(new ObjectId(graphicId));
GridFSDBFile gridFSDBFile = graphicDao.getGridFSDBFile(graphic.getAttachment());
InputStream inputStream = gridFSDBFile.getInputStream();
if (gridFSDBFile != null) {
try {
BufferedImage image = findSupportImage(inputStream);
if(image != null){
Thumbnails.of(image).size(width, height).imageType(BufferedImage.TYPE_INT_ARGB).outputFormat("PNG").toOutputStream(outputStream);
FileOutputStream fileOutputStream = FilesUtil.createTemplateThumbnailFile(graphicId, width, height);
Thumbnails.of(image).size(width, height).imageType(BufferedImage.TYPE_INT_ARGB).outputFormat("PNG").toOutputStream(fileOutputStream);
}else {
displayOriginalImageContent(outputStream, inputStream);
}
// Thumbnails.of(inputStream).size(width, height).imageType(BufferedImage.TYPE_INT_ARGB).toOutputStream(outputStream);
} catch (IOException e) {
LOGGER.error("Thumbnail image error!",e);
}finally {
closeIOStream(outputStream,inputStream);
}
}
}
public BufferedImage findSupportImage(InputStream inputStream){
try {
ImageInputStream imageInputStream = ImageIO.createImageInputStream(inputStream);
BufferedImage image = null;
ImageReader imageReader;
Iterator<ImageReader> imageReaders = ImageIO.getImageReaders(imageInputStream);
while (imageReaders!=null&&imageReaders.hasNext()){
imageReader = imageReaders.next();
imageReader.setInput(imageInputStream);
try {
image = imageReader.read(0);
break;
} catch (IOException e) {
}
}
return image;
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public void displayThumbnailImage(String graphicId, OutputStream outputStream, List<Integer> size) {
width = size.get(0);
height = size.get(1);
if(FilesUtil.isThumbnailFileAlreadyExists(graphicId,width,height)){
try {
FilesUtil.writeTempThumbnailFile(graphicId,width,height,outputStream);
} catch (IOException e) {
LOGGER.error("Read template thumbnail files failed",e);
}
}else {
writeThumbnailStreamIntoDisplay(graphicId, outputStream);
}
}
public void writeOriginalResourceIntoOutputStream(String graphicId, OutputStream outputStream) {
checkParameters(graphicId);
Graphic graphic = graphicDao.get(new ObjectId(graphicId));
if (graphic == null) {
return;
}
GridFSDBFile gridFSDBFile = graphicDao.getGridFSDBFile(graphic.getAttachment());
InputStream input = gridFSDBFile.getInputStream();
if (gridFSDBFile != null) {
try {
displayOriginalImageContent(outputStream, input);
} catch (IOException e) {
LOGGER.error("Display Image error:", e);
} finally {
closeIOStream(outputStream, input);
}
}
}
private void checkParameters(String graphicId) {
Preconditions.checkNotNull(graphicId);
Preconditions.checkArgument(StringUtils.isNotEmpty(graphicId));
Preconditions.checkArgument(ObjectId.isValid(graphicId),"Graphic ID is invalid");
}
private void displayOriginalImageContent(OutputStream outputStream, InputStream inputStream) throws IOException {
byte[] bytes = new byte[2048];
InputStream input = inputStream;
int result = 0;
while ((result = input.read(bytes)) != -1) {
outputStream.write(bytes, 0, result);
}
outputStream.flush();
}
private void closeIOStream(OutputStream outputStream, InputStream input) {
if (input != null) {
try {
input.close();
} catch (IOException e) {
LOGGER.error("IO errors:", e);
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
LOGGER.error("IO errors:",e);
}
}
}
public Graphic saveGraphic(byte[] contents, Graphic graphic) {
InputStream inputStream = new ByteArrayInputStream(contents);
return addNewGraphic(graphic, inputStream);
}
@Override
public List<Graphic> findGraphicByPage(int requestPage, int pageSize) {
return graphicDao.findByPage(requestPage,pageSize);
}
@Override
public long getGraphicsTotalCount(String userId) {
return graphicDao.getTotalRecordCount(userId);
}
@Override
public long getGraphicsTotalCountByUserAndQueryType(String userId,String queryType) {
String upperCaseQueryType = queryType.toUpperCase();
CheckStatusDesc checkStatusDesc = CheckStatusDesc.valueOf(upperCaseQueryType);
return graphicDao.countRecordByQueryType(userId,checkStatusDesc);
}
@Override
public void updateGraphic(GraphicDTO graphicDTO) {
TagDescription tagDescription = tagService.getTagDescriptionById(graphicDTO.getTagId());
Graphic graphic = get(graphicDTO.getId());
graphic.setName(graphicDTO.getName());
graphic.setDescription(graphicDTO.getDescription());
if(tagDescription != null){
graphic.setTag(tagDescription);
}
graphicDao.save(graphic);
}
public String dealUploadDataToCreateNewGraphic(byte[] contents, Graphic graphic) {
Graphic afterSaveGraphic = saveGraphic(contents, graphic);
return afterSaveGraphic.getIdString();
}
public Graphic generateGraphic(String fileName, long size, String contentType,String tagId,String workspaceId) {
Graphic graphic = objectFactory.createGraphic(fileName, contentType);
if(StringUtils.isNotEmpty(tagId) && ObjectId.isValid(tagId)){
TagDescription tagDescription = tagService.getTagDescriptionById(tagId);
graphic.setTag(tagDescription);
}
if(StringUtils.isNotEmpty(workspaceId) && ObjectId.isValid(workspaceId)){
WorkSpace workSpace = workSpaceService.getWorkSpaceById(workspaceId);
graphic.setWorkSpace(workSpace);
}
Properties properties = objectFactory.createProperties(fileName, size, contentType);
propertiesService.addNewProperties(properties);
graphic.setProperties(properties);
return graphic;
}
@Override
// @RequiresPermissions(value ={"user:xxx"} )
// @RequiresAuthentication
public List<Graphic> findGraphicByPageAndQueryTypeAndUser(int requestPage, int pageSize, String queryType, String userId) {
String upperCaseQueryType = queryType.toUpperCase();
return graphicDao.findByPageAndQueryTypeAndUserId(requestPage,pageSize, CheckStatusDesc.valueOf(upperCaseQueryType),userId);
}
@Override
public void checkGraphics(GraphicCheckDTO graphicCheckDTO) {
CheckResult checkResult = CheckResult.valueOf(graphicCheckDTO.getCheckResult());
int row =graphicDao.updateCheckStatus(graphicCheckDTO.getGraphicIds(),CheckStatusDesc.CHECKED, checkResult);
LOGGER.info("Check status updated row:"+row);
cxServerService.updateGraphicResourceAuditStatus(graphicCheckDTO);
}
@Override
public void batchDelete(List<String> idString) {
graphicDao.batchDelete(idString);
}
}
| [
"zouyanjian110@gmail.com"
] | zouyanjian110@gmail.com |
a64f202f6f40dc1cc1a698096a3a355bf1dfbb18 | b1af7c1d8b6fa64c21e4f3c2e78ff655e094ec54 | /src/test/java/com/robertobatts/springcustom/cache/CachingCollectionElementsIndividuallyTest.java | fea57ef611e582a78c97bb991becd53c03f742de | [] | no_license | robertobatts/spring-custom-cache | 38af921948068f679f1698553114e80a3a40c2f1 | c4ff99e1fdcf10ba5deb9b78932be76cdba842ca | refs/heads/master | 2023-01-10T17:19:09.165291 | 2019-11-17T19:03:04 | 2019-11-17T19:03:04 | 220,494,671 | 0 | 0 | null | 2022-12-27T14:44:58 | 2019-11-08T15:26:42 | Java | UTF-8 | Java | false | false | 3,351 | java | package com.robertobatts.springcustom.cache;
import com.robertobatts.springcustom.config.CachingApplicationConfiguration;
import com.robertobatts.springcustom.domain.CustomObject;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.CacheManager;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = CachingCollectionElementsIndividuallyTest.ConfigurationTest.class)
public class CachingCollectionElementsIndividuallyTest {
@Autowired
private DummyService dummyService;
@Autowired
private CacheManager cacheManager;
@Test
public void cacheHitsAndMisses() {
List<CustomObject> objects = new ArrayList<CustomObject>() {{
add(new CustomObject(new CustomObject.PrimaryKey("123ABC", "boh"), "123D"));
add(new CustomObject(new CustomObject.PrimaryKey("QWERTY", "ciao"), "76567D"));
}};
dummyService.getObjects(objects);
assertThat(this.dummyService.isCacheMiss()).isTrue();
dummyService.getObject(new CustomObject(new CustomObject.PrimaryKey("123ABC", "boh"), "123D"));
assertThat(this.dummyService.isCacheMiss()).isFalse();
dummyService.getObject(new CustomObject.PrimaryKey("123ABC", "boh"));
assertThat(this.dummyService.isCacheMiss()).isFalse();
dummyService.getObject(new CustomObject.PrimaryKey("QWERTY", "ciao"));
assertThat(this.dummyService.isCacheMiss()).isFalse();
dummyService.getObjects(objects);
assertThat(this.dummyService.isCacheMiss()).isFalse();
objects.add((new CustomObject(new CustomObject.PrimaryKey("ABCDEFG", "YEAH"), "123D")));
dummyService.getObjects(objects);
assertThat(this.dummyService.isCacheMiss()).isTrue();
}
@Service
protected static class DummyService {
private boolean cacheMiss;
public synchronized boolean isCacheMiss() {
boolean cacheMiss = this.cacheMiss;
setCacheMiss(false);
return cacheMiss;
}
public synchronized void setCacheMiss(boolean cacheMiss) {
this.cacheMiss = cacheMiss;
}
@Cacheable("objects")
public List<CustomObject> getObjects(List<CustomObject> objects) {
setCacheMiss(true);
return objects;
}
@Cacheable("objects")
public CustomObject getObject(CustomObject object) {
setCacheMiss(true);
return object;
}
@Cacheable("objects")
public CustomObject getObject(CustomObject.PrimaryKey key) {
setCacheMiss(true);
return new CustomObject(key, "something");
}
}
protected static class ConfigurationTest extends CachingApplicationConfiguration {
@Bean
public DummyService dummyService() {
return new DummyService();
}
}
}
| [
"battaroberto@gmail.com"
] | battaroberto@gmail.com |
21f421d865a1e392dc9dbd937b1bd6ae934c15a1 | 2538e0c08ee043608ce8685d9b8ee1e57d951e81 | /src/main/java/com/nfsindustries/model/DateAndPlaceOfBirth.java | 81bfbb46512fc82cd81d5f639ba39bc41ee3b72e | [] | no_license | maxmousee/New10-JavaBackEnd | 12755c3d4d9d7e76846d12b516afbe632302eb51 | 1b1e581aca24363cc1b1fdb51c0016eefc3d73f0 | refs/heads/master | 2020-04-05T21:17:00.505944 | 2018-11-13T04:05:47 | 2018-11-13T04:05:47 | 157,214,991 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,112 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.11.12 at 09:45:14 PM CET
//
package com.nfsindustries.model;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>Java class for DateAndPlaceOfBirth complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="DateAndPlaceOfBirth">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="BirthDt" type="{urn:iso:std:iso:20022:tech:xsd:camt.053.001.02}ISODate"/>
* <element name="PrvcOfBirth" type="{urn:iso:std:iso:20022:tech:xsd:camt.053.001.02}Max35Text" minOccurs="0"/>
* <element name="CityOfBirth" type="{urn:iso:std:iso:20022:tech:xsd:camt.053.001.02}Max35Text"/>
* <element name="CtryOfBirth" type="{urn:iso:std:iso:20022:tech:xsd:camt.053.001.02}CountryCode"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DateAndPlaceOfBirth", propOrder = {
"birthDt",
"prvcOfBirth",
"cityOfBirth",
"ctryOfBirth"
})
public class DateAndPlaceOfBirth {
@XmlElement(name = "BirthDt", required = true)
@XmlSchemaType(name = "date")
protected XMLGregorianCalendar birthDt;
@XmlElement(name = "PrvcOfBirth")
protected String prvcOfBirth;
@XmlElement(name = "CityOfBirth", required = true)
protected String cityOfBirth;
@XmlElement(name = "CtryOfBirth", required = true)
protected String ctryOfBirth;
/**
* Gets the value of the birthDt property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getBirthDt() {
return birthDt;
}
/**
* Sets the value of the birthDt property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setBirthDt(XMLGregorianCalendar value) {
this.birthDt = value;
}
/**
* Gets the value of the prvcOfBirth property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getPrvcOfBirth() {
return prvcOfBirth;
}
/**
* Sets the value of the prvcOfBirth property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setPrvcOfBirth(String value) {
this.prvcOfBirth = value;
}
/**
* Gets the value of the cityOfBirth property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCityOfBirth() {
return cityOfBirth;
}
/**
* Sets the value of the cityOfBirth property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCityOfBirth(String value) {
this.cityOfBirth = value;
}
/**
* Gets the value of the ctryOfBirth property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCtryOfBirth() {
return ctryOfBirth;
}
/**
* Sets the value of the ctryOfBirth property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCtryOfBirth(String value) {
this.ctryOfBirth = value;
}
}
| [
"maxmousee@gmail.com"
] | maxmousee@gmail.com |
e7bd0dea84fd27c637658ace9a253a6d58266b79 | 12b17568e3b89820018ac1d2366c55d662355ccf | /original/kanzi/src/main/java/kanzi/ByteTransform.java | 050b9caad972802a901e556421ce1f691875828e | [] | no_license | miguelvelezmj25/performance-mapper-evaluation | 0b086d60767250b9df7d89dfa70336b2e884af49 | e8f42e1f9006826a79e65edae30d9aa906eb8a30 | refs/heads/master | 2023-08-18T04:36:38.878803 | 2021-10-20T13:47:54 | 2021-10-20T13:47:54 | 91,713,239 | 0 | 0 | null | 2021-01-15T15:33:51 | 2017-05-18T16:05:51 | Java | UTF-8 | Java | false | false | 1,351 | java | /*
Copyright 2011-2017 Frederic Langlet
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 kanzi;
// A byte transform is an operation that takes an array of bytes as input and
// turns it into another array of bytes of the same size.
public interface ByteTransform {
// Read src.length bytes from src.array[src.index], process them and
// write them to dst.array[dst.index]. The index of each slice is updated
// with the number of bytes respectively read from and written to.
public boolean forward(SliceByteArray src, SliceByteArray dst);
// Read src.length bytes from src.array[src.index], process them and
// write them to dst.array[dst.index]. The index of each slice is updated
// with the number of bytes respectively read from and written to.
public boolean inverse(SliceByteArray src, SliceByteArray dst);
}
| [
"miguelvelez@mijecu25.com"
] | miguelvelez@mijecu25.com |
33161d93eb9e3473683b662ab9fc55c5ba046ef0 | a4f0f291d842aeb0c649eaad587b9a5d9fa22c4c | /generationAula17/src/exPOO/Ex6Main.java | 56a93a10177e08f6f3d05946b71ca4007ed074c3 | [] | no_license | UlverGuara/Generation-Java-17-Aula-POO | fd76cba594f68859ef3abe6e318078b73e604c42 | 2da9d395f29580dbe02cbceb8cdaf2ee26b7fbb4 | refs/heads/main | 2023-02-26T16:01:39.285800 | 2021-02-04T01:20:26 | 2021-02-04T01:20:26 | 335,794,417 | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 640 | java | package exPOO;
/*6. Implemente a classe Vendedor como subclasse da classe Pessoa.
Um determinado vendedor tem como atributos da classe Pessoa
e também os atributos próprios como valorVendas (correspondente ao valor monetário dos artigos vendidos)
e o atributo comissao (porcentagem do valorVendas que será adicionado ao vencimento base do Vendedor).*/
public class Ex6Main {
public static void main(String[] args) {
// Instanciando um Objeto da Classe Ex6Vendedor.
Ex6Vendedor vendedor = new Ex6Vendedor("Pessoal1", "Rua1", "9999-6666", "Paçocas", 10, 500, 10);
vendedor.caculaComissao();
vendedor.imprimaInfo();
}
}
| [
"rafahell.momberg@gmail.com"
] | rafahell.momberg@gmail.com |
d8c658959c635ddc45129a50849e9c2dd76545b1 | 1ca86d5d065372093c5f2eae3b1a146dc0ba4725 | /spring-5/src/test/java/com/surya/jupiter/Spring5JUnit5IntegrationTest.java | c47eb02e734938a9d9feb2156bc9e73c308a21c6 | [] | no_license | Suryakanta97/DemoExample | 1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e | 5c6b831948e612bdc2d9d578a581df964ef89bfb | refs/heads/main | 2023-08-10T17:30:32.397265 | 2021-09-22T16:18:42 | 2021-09-22T16:18:42 | 391,087,435 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 906 | java | package com.surya.jupiter;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.test.context.ContextConfiguration;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = TestConfig.class)
class Spring5JUnit5IntegrationTest {
@Autowired
private Task task;
@Test
void givenAMethodName_whenInjecting_thenApplicationContextInjectedIntoMetho(ApplicationContext applicationContext) {
assertNotNull(applicationContext, "ApplicationContext should have been injected by Spring");
assertEquals(this.task, applicationContext.getBean("taskName", Task.class));
}
}
| [
"suryakanta97@github.com"
] | suryakanta97@github.com |
510ed88adf585616b1e65dcda245571f128978dc | 2c9bc9ac4d2707a04129373bdac239a4612322e3 | /TestThread.java | 73bf746f99b4cd93d10b4f6852c76055d1d913d9 | [] | no_license | Akashnishad17/javap | ce0e88112ac13f718c0a0d5377c25d6f39270add | ec8e615f9a5a6ded26ba25f421c69784d5b5528e | refs/heads/master | 2023-02-22T12:02:15.928222 | 2023-02-11T09:07:37 | 2023-02-11T09:07:37 | 214,708,604 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 606 | java | class SampleDemo implements Runnable {
private Thread t;
private String threadName;
SampleDemo (String threadName){
this.threadName = threadName;
}
public void run()
{
while (true)
System.out.print(threadName);
}
public void start ()
{
if (t == null)
{
t = new Thread (this, threadName);
t.start ();
}
}
}
public class TestThread {
public static void main(String args[]) {
SampleDemo A = new SampleDemo( "A");
SampleDemo B = new SampleDemo( "B");
B.start();
A.start();
}
} | [
"akashnishad2017@gmail.com"
] | akashnishad2017@gmail.com |
abf253dcf8e1038653a67ece39900308ce81e42c | ae2a7b4d67ef9cdcad8117ebdad1b24cc21c6b29 | /pbutil/src/test/java/com/promise/pbutil/JavaDateTest.java | 2881f14a0fe699534aa91c4d32d0283dc4ecb0a9 | [] | no_license | xingjian/customtools | ce25251dda34a678f36b0d00888b6721ac16b886 | d020a0c49280683f6fafaad60a4119299735a562 | refs/heads/master | 2020-12-24T06:42:55.991494 | 2017-03-04T14:42:54 | 2017-03-04T14:42:54 | 29,650,107 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,706 | java | package com.promise.pbutil;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.junit.Test;
/**
* 功能描述: java 日期测试类
* @author:<a href="mailto:xingjian@tongtusoft.com.cn">邢健</a>
* @version: V1.0
* 日期:2015年11月5日 上午11:40:59
*/
public class JavaDateTest {
/**
* 测试日期相减
*/
@Test
public void testDateReduce() throws Exception{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:00");
Calendar cal = Calendar.getInstance();
System.out.println(format.format(cal.getTime()));
cal.add(Calendar.MINUTE, -5);
int day=cal.getActualMaximum(Calendar.DAY_OF_MONTH);
System.out.println(day);
int minute=cal.get(Calendar.MINUTE);
Date dateCreate = cal.getTime();
System.out.println(format.format(dateCreate));
}
public static void main(String[] args) throws Exception{
Socket socket = new Socket("172.24.186.135", 9999);
OutputStream socketOut = socket.getOutputStream();
socketOut.write("ttyj".toString().getBytes());
while(true){
InputStream socketInput = socket.getInputStream();
BufferedReader buffer = new BufferedReader(new InputStreamReader(socketInput));
String data = null;
while ((data=buffer.readLine())!=null) {
System.out.println(data);
}
}
}
}
| [
"xingjian@yeah.net"
] | xingjian@yeah.net |
295fd23595f1cb2dfc9b1beffdde449781e80440 | 12d301145c9845bfc085fd6468747c313610edf3 | /java/src/homework/Sum.java | 7da078f94d2a889f8496edd945af4d0d3e590a0c | [] | no_license | Yangmila/Java_code | 45f1c8fd9203ea0746ccc39c520aed94dc4968b4 | f8f6b570cda0bc182ad008d3a46ef7bbb4bf5731 | refs/heads/master | 2023-07-09T21:51:44.049705 | 2021-08-08T03:02:09 | 2021-08-08T03:02:09 | 316,651,804 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 483 | java | package homework;
public class Sum {
public static int sum(int a,int b){
return a+b;
}
public static double sum(double a,double b,double c){
return a+b+c;
}
public static void main(String[] args) {
int n1=2;
int n2=8;
double n3=2.3,n4=7.2,n5=8.9;
int ret1=sum(n1,n2);
double ret2=sum(n5,n3,n4);
System.out.println(n1+"+"+n2+"="+ret1);
System.out.println(n3+"+"+n4+"+"+n5+"="+ret2);
}
}
| [
"1822403563@qq.com"
] | 1822403563@qq.com |
781efc423ef3129daa6961c3def691d116bec6bf | 2922bbd05373a3ef0fd1e905946044258b408a47 | /aerial/engine/src/ax/engine/core/geometry/GeometryOperation.java | bbfb2926ff4ffdeaa8e805ac5c94731a83d9e555 | [] | no_license | LacombeJ/Aerial | 50f0c7d5ddfd75ecaa16156b03dca4d953042d9a | bacffb8af91c3fe956c436be39633840b2f4b196 | refs/heads/master | 2020-03-23T07:49:55.208702 | 2018-07-17T15:16:36 | 2018-07-17T15:16:36 | 141,291,649 | 6 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,058 | java | package ax.engine.core.geometry;
import ax.engine.core.Geometry;
import ax.engine.core.Transform;
import ax.math.vector.Matrix4;
import ax.math.vector.Vector2;
import ax.math.vector.Vector3;
import ax.math.vector.Vector4;
public interface GeometryOperation {
void modify(Geometry geometry);
// TODO isolate different types of operations (Vertex op, VertexArray op, TexCoord op, etc) into own module (call into modules for geometry operations)
public static GeometryOperation scaleTexCoords(float x, float y, float ox, float oy) {
return (g) -> {
Vector2[] uvs = g.getTexCoordArray();
Vector2 scalar = new Vector2(x,y);
Vector2 origin = new Vector2(ox,oy);
for (Vector2 uv : uvs) {
uv.scale(scalar, origin);
}
g.setTexCoordArray(uvs);
};
}
public static GeometryOperation scaleTexCoords(float x, float y) {
return scaleTexCoords(x,y,0.5f,0.5f);
}
public static GeometryOperation translateTexCoords(float x, float y) {
return (g) -> {
Vector2[] uvs = g.getTexCoordArray();
Vector2 translate = new Vector2(x,y);
for (Vector2 uv : uvs) {
uv.add(translate);
}
g.setTexCoordArray(uvs);
};
}
public static GeometryOperation transform(Matrix4 transformation) {
return (g) -> {
Vector3[] vertices = g.getVertexArray();
for (Vector3 v : vertices) {
Vector4 mult = transformation.multiply(new Vector4(v,1));
v.set(mult.x,mult.y,mult.z);
}
g.setVectorArray(vertices);
//TODO verify
Matrix4 rot = transformation.getRotation().toMatrix();
Vector3[] normals = g.getNormalArray();
for (Vector3 v : normals) {
Vector4 mult = rot.multiply(new Vector4(v,1));
v.set(mult.x,mult.y,mult.z);
}
g.setNormalArray(normals);
};
}
public static GeometryOperation transform(Transform t) {
return transform(t.computeMatrix());
}
}
| [
"lacombejonathan.17@gmail.com"
] | lacombejonathan.17@gmail.com |
034f6a336fe4dceaadf4a7a06dd3e46eb183ce6b | 98d07029e1c387b2dd30269553baf2dad2f70bcc | /mantis-client/src/main/java/io/mantisrx/client/SinkClientImpl.java | 32b1213766f4fc07f7d193fb755b74fb72f9f6e4 | [
"Apache-2.0"
] | permissive | nickmahilani/mantis | fb4ddcfbb2c934d1cd974d5fc649cf59ef6a9733 | 07175b352c50cd7f9383e1404931e0b4f150a095 | refs/heads/master | 2021-06-24T01:14:41.329771 | 2021-01-27T20:57:44 | 2021-01-27T20:57:44 | 193,785,552 | 0 | 0 | Apache-2.0 | 2019-06-25T21:26:23 | 2019-06-25T21:26:22 | null | UTF-8 | Java | false | false | 13,573 | java | /*
* Copyright 2019 Netflix, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.mantisrx.client;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import com.netflix.spectator.api.BasicTag;
import io.mantisrx.common.metrics.Gauge;
import io.mantisrx.common.metrics.Metrics;
import io.mantisrx.common.metrics.spectator.MetricGroupId;
import io.mantisrx.server.master.client.MasterClientWrapper;
import io.reactivex.mantis.remote.observable.EndpointChange;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import rx.Observable;
import rx.Observer;
import rx.functions.Action1;
import rx.functions.Func1;
public class SinkClientImpl<T> implements SinkClient<T> {
private static final Logger logger = LoggerFactory.getLogger(SinkClientImpl.class);
final String jobId;
final SinkConnectionFunc<T> sinkConnectionFunc;
final JobSinkLocator jobSinkLocator;
final private AtomicBoolean nowClosed = new AtomicBoolean(false);
final private SinkConnections<T> sinkConnections = new SinkConnections<>();
private final String sinkGuageName = "SinkConnections";
private final String expectedSinksGaugeName = "ExpectedSinkConnections";
private final String sinkReceivingDataGaugeName = "sinkRecvngData";
private final String clientNotConnectedToAllSourcesGaugeName = "clientNotConnectedToAllSources";
private final Gauge sinkGauge;
private final Gauge expectedSinksGauge;
private final Gauge sinkReceivingDataGauge;
private final Gauge clientNotConnectedToAllSourcesGauge;
private final AtomicInteger numSinkWorkers = new AtomicInteger();
private final Observer<SinkConnectionsStatus> sinkConnectionsStatusObserver;
private final long dataRecvTimeoutSecs;
private final Metrics metrics;
private final boolean disablePingFiltering;
SinkClientImpl(String jobId, SinkConnectionFunc<T> sinkConnectionFunc, JobSinkLocator jobSinkLocator,
Observable<Integer> numSinkWorkersObservable,
Observer<SinkConnectionsStatus> sinkConnectionsStatusObserver, long dataRecvTimeoutSecs) {
this(jobId, sinkConnectionFunc, jobSinkLocator, numSinkWorkersObservable, sinkConnectionsStatusObserver,
dataRecvTimeoutSecs, false);
}
SinkClientImpl(String jobId, SinkConnectionFunc<T> sinkConnectionFunc, JobSinkLocator jobSinkLocator,
Observable<Integer> numSinkWorkersObservable,
Observer<SinkConnectionsStatus> sinkConnectionsStatusObserver, long dataRecvTimeoutSecs,
boolean disablePingFiltering) {
this.jobId = jobId;
this.sinkConnectionFunc = sinkConnectionFunc;
this.jobSinkLocator = jobSinkLocator;
BasicTag jobIdTag = new BasicTag("jobId", Optional.ofNullable(jobId).orElse("NullJobId"));
MetricGroupId metricGroupId = new MetricGroupId(SinkClientImpl.class.getCanonicalName(), jobIdTag);
this.metrics = new Metrics.Builder()
.id(metricGroupId)
.addGauge(sinkGuageName)
.addGauge(expectedSinksGaugeName)
.addGauge(sinkReceivingDataGaugeName)
.addGauge(clientNotConnectedToAllSourcesGaugeName)
.build();
sinkGauge = metrics.getGauge(sinkGuageName);
expectedSinksGauge = metrics.getGauge(expectedSinksGaugeName);
sinkReceivingDataGauge = metrics.getGauge(sinkReceivingDataGaugeName);
clientNotConnectedToAllSourcesGauge = metrics.getGauge(clientNotConnectedToAllSourcesGaugeName);
numSinkWorkersObservable
.doOnNext((integer) -> numSinkWorkers.set(integer))
.takeWhile((integer) -> !nowClosed.get())
.subscribe();
this.sinkConnectionsStatusObserver = sinkConnectionsStatusObserver;
this.dataRecvTimeoutSecs = dataRecvTimeoutSecs;
this.disablePingFiltering = disablePingFiltering;
}
private String toSinkName(String host, int port) {
return host + "-" + port;
}
@Override
public boolean hasError() {
return false;
}
@Override
public String getError() {
return null;
}
@Override
public Observable<Observable<T>> getResults() {
return getPartitionedResults(-1, 0);
}
@Override
public Observable<Observable<T>> getPartitionedResults(final int forIndex, final int totalPartitions) {
return internalGetResults(forIndex, totalPartitions);
// return Observable
// .create(new Observable.OnSubscribe<Observable<T>>() {
// @Override
// public void call(final Subscriber subscriber) {
// internalGetResults(forIndex, totalPartitions).subscribe(subscriber);
// }
// })
// .subscribeOn(Schedulers.io());
}
private <T> Observable<Observable<T>> internalGetResults(int forIndex, int totalPartitions) {
return jobSinkLocator
.locatePartitionedSinkForJob(jobId, forIndex, totalPartitions)
.map(new Func1<EndpointChange, Observable<T>>() {
@Override
public Observable<T> call(EndpointChange endpointChange) {
if (nowClosed.get())
return Observable.empty();
if (endpointChange.getType() == EndpointChange.Type.complete) {
return handleEndpointClose(endpointChange);
} else {
return handleEndpointConnect(endpointChange);
}
}
})
.doOnUnsubscribe(() -> {
try {
logger.warn("Closing connections to sink of job " + jobId);
closeAllConnections();
} catch (Exception e) {
Observable.error(e);
}
})
.share()
// .lift(new Observable.Operator<Observable<T>, Observable<T>>() {
// @Override
// public Subscriber<? super Observable<T>> call(Subscriber<? super Observable<T>> subscriber) {
// subscriber.add(Subscriptions.create(new Action0() {
// @Override
// public void call() {
// try {
// logger.warn("Closing connections to sink of job " + jobId);
// closeAllConnections();
// } catch (Exception e) {
// throw new RuntimeException(e);
// }
// }
// }));
// return subscriber;
// }
// })
// .share()
// .lift(new DropOperator<Observable<T>>("client_partition_share"))
;
}
private <T> Observable<T> handleEndpointConnect(EndpointChange endpoint) {
logger.info("Opening connection to sink at " + endpoint.toString());
final String unwrappedHost = MasterClientWrapper.getUnwrappedHost(endpoint.getEndpoint().getHost());
SinkConnection sinkConnection = sinkConnectionFunc.call(unwrappedHost, endpoint.getEndpoint().getPort(),
new Action1<Boolean>() {
@Override
public void call(Boolean flag) {
updateSinkConx(flag);
}
},
new Action1<Boolean>() {
@Override
public void call(Boolean flag) {
updateSinkDataReceivingStatus(flag);
}
},
dataRecvTimeoutSecs,
this.disablePingFiltering
);
if (nowClosed.get()) {// check if closed before adding
try {
sinkConnection.close();
} catch (Exception e) {
logger.warn("Error closing sink connection " + sinkConnection.getName() + " - " + e.getMessage(), e);
}
return Observable.empty();
}
sinkConnections.put(toSinkName(unwrappedHost, endpoint.getEndpoint().getPort()), sinkConnection);
if (nowClosed.get()) {
try {
sinkConnection.close();
sinkConnections.remove(toSinkName(unwrappedHost, endpoint.getEndpoint().getPort()));
return Observable.empty();
} catch (Exception e) {
logger.warn("Error closing sink connection - " + e.getMessage());
}
}
return ((SinkConnection<T>) sinkConnection).call()
//.flatMap(o -> o)
;
}
private void updateSinkDataReceivingStatus(Boolean flag) {
if (flag)
sinkReceivingDataGauge.increment();
else
sinkReceivingDataGauge.decrement();
expectedSinksGauge.set(numSinkWorkers.get());
if (expectedSinksGauge.value() != sinkReceivingDataGauge.value()) {
this.clientNotConnectedToAllSourcesGauge.set(1);
} else {
this.clientNotConnectedToAllSourcesGauge.set(0);
}
if (sinkConnectionsStatusObserver != null) {
synchronized (sinkConnectionsStatusObserver) {
sinkConnectionsStatusObserver.onNext(new SinkConnectionsStatus(sinkReceivingDataGauge.value(), sinkGauge.value(), numSinkWorkers.get()));
}
}
}
private void updateSinkConx(Boolean flag) {
if (flag)
sinkGauge.increment();
else
sinkGauge.decrement();
expectedSinksGauge.set(numSinkWorkers.get());
if (expectedSinksGauge.value() != sinkReceivingDataGauge.value()) {
this.clientNotConnectedToAllSourcesGauge.set(1);
} else {
this.clientNotConnectedToAllSourcesGauge.set(0);
}
if (sinkConnectionsStatusObserver != null) {
synchronized (sinkConnectionsStatusObserver) {
sinkConnectionsStatusObserver.onNext(new SinkConnectionsStatus(sinkReceivingDataGauge.value(), sinkGauge.value(), numSinkWorkers.get()));
}
}
}
private <T> Observable<T> handleEndpointClose(EndpointChange endpoint) {
logger.info("Closed connection to sink at " + endpoint.toString());
final String unwrappedHost = MasterClientWrapper.getUnwrappedHost(endpoint.getEndpoint().getHost());
final SinkConnection<T> removed = (SinkConnection<T>) sinkConnections.remove(toSinkName(unwrappedHost, endpoint.getEndpoint().getPort()));
if (removed != null) {
try {
removed.close();
} catch (Exception e) {
// shouldn't happen
logger.error("Unexpected exception on closing sinkConnection: " + e.getMessage(), e);
}
}
return Observable.empty();
}
private void closeAllConnections() throws Exception {
nowClosed.set(true);
sinkConnections.closeOut((SinkConnection<T> tSinkConnection) -> {
try {
tSinkConnection.close();
} catch (Exception e) {
logger.warn("Error closing sink connection " + tSinkConnection.getName() +
" - " + e.getMessage(), e);
}
});
}
class SinkConnections<T> {
final private Map<String, SinkConnection<T>> sinkConnections = new HashMap<>();
private boolean isClosed = false;
private void put(String key, SinkConnection<T> val) {
synchronized (sinkConnections) {
if (isClosed)
return;
sinkConnections.put(key, val);
}
}
private SinkConnection<T> remove(String key) {
synchronized (sinkConnections) {
return sinkConnections.remove(key);
}
}
private void closeOut(Action1<SinkConnection<T>> onClose) {
synchronized (sinkConnections) {
isClosed = true;
}
for (SinkConnection<T> sinkConnection : sinkConnections.values()) {
logger.info("Closing " + sinkConnection.getName());
onClose.call(sinkConnection);
}
}
}
}
| [
"jchao@netflix.com"
] | jchao@netflix.com |
5be6357b87dda03885e98c44474a7686051416e6 | aa732f268c0bf1f141c2e7b438cfe78b0a9cb8c1 | /src/main/java/com/lzh/comment/config/UserRealm.java | bf08386f9bf4e3e676ee72148db8558be6a02563 | [] | no_license | qingyunerya/comment | d024a07c5443b0b75e2308db12ef4bf4ae4d1ce4 | 005a6e389b153fb6c44e2fe5448fdbe9bf0e5398 | refs/heads/master | 2022-12-08T23:37:50.145695 | 2020-09-10T02:46:11 | 2020-09-10T02:46:11 | 294,284,790 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 780 | java | package com.lzh.comment.config;
import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authz.AuthorizationInfo;
import org.apache.shiro.realm.AuthorizingRealm;
import org.apache.shiro.subject.PrincipalCollection;
public class UserRealm extends AuthorizingRealm {
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principalCollection) {
System.out.println("授权");
return null;
}
@Override
protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authenticationToken) throws AuthenticationException {
System.out.println("认证");
return null;
}
}
| [
"2424753284@qq.com"
] | 2424753284@qq.com |
e9914bccbf7f7dd8c8bf6caf5cc4ebbdee70a31c | 04a9825dae017a4ae7127f5b59f7bd8866f18955 | /src/main/java/AppContextListener.java | 311ca1ac39dc7647feaee277d3dd7a4bafa32164 | [] | no_license | bchu523/cs122 | 729d3b006c374c889e55ec860e6dd66768790027 | fd4de58994c8f9ac5e0c522bcf3f1a372b4ceed1 | refs/heads/master | 2020-05-23T10:12:01.796080 | 2017-01-30T07:24:38 | 2017-01-30T07:24:38 | 80,401,234 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,377 | java | import java.sql.SQLException;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
@WebListener
public class AppContextListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent servletContextEvent) {
ServletContext ctx = servletContextEvent.getServletContext();
String url = ctx.getInitParameter("DBURL");
String u = ctx.getInitParameter("DBUSER");
String p = ctx.getInitParameter("DBPWD");
// create database connection from init parameters and set it to context
DBConnectionManager dbManager;
try {
dbManager = new DBConnectionManager(url, u, p);
ctx.setAttribute("DBManager", dbManager);
System.out.println("Database connection initialized for Application.");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public void contextDestroyed(ServletContextEvent servletContextEvent) {
ServletContext ctx = servletContextEvent.getServletContext();
DBConnectionManager dbManager = (DBConnectionManager) ctx.getAttribute("DBManager");
dbManager.closeConnection();
System.out.println("Database connection closed for Application.");
}
} | [
"bchu526@gmail.com"
] | bchu526@gmail.com |
239e9fda07938428fc5806af06ef87ecf7e75235 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/3/3_522e25b3630b3f42dca877dd0c73576ba1966ef1/Portal/3_522e25b3630b3f42dca877dd0c73576ba1966ef1_Portal_s.java | 2e863f4b665f5301ea1a58448e0e751f7f784e2c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 5,017 | java | package com.undeadscythes.udsplugin;
import com.undeadscythes.udsplugin.utilities.*;
import java.util.ArrayList;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
/**
* A nether portal that goes elsewhere.
* @author Dave
*/
public class Portal implements Saveable {
/**
* File name of portal file.
*/
public static final String PATH = "portals.csv";
private final String name;
private Warp warp;
private Portal portal;
private String portalLink = "";
private final World world;
private final Vector min, max;
private Direction exit;
public Portal(final String name, final Warp warp, final World world, final Vector v1, final Vector v2) {
this.name = name;
this.warp = warp;
this.world = world;
this.min = Region.floor(Vector.getMinimum(v1, v2));
this.max = Region.floor(Vector.getMaximum(v1, v2));
}
public Portal(final String record) {
final String[] recordSplit = record.split("\t");
switch (recordSplit.length) {
case 7:
exit = Direction.getByName(recordSplit[6]);
default:
name = recordSplit[0];
warp = UDSPlugin.getWarps().get(recordSplit[1]);
portalLink = recordSplit[2];
world = Bukkit.getWorld(recordSplit[3]);
min = Region.getBlockPos(recordSplit[4]);
max = Region.getBlockPos(recordSplit[5]);
}
}
@Override
public final String getRecord() {
final ArrayList<String> record = new ArrayList<String>();
record.add(name);
record.add(warp == null ? "null" : warp.getName());
record.add(portal == null ? "null" : portal.getName());
record.add(world.getName());
record.add(min.toString());
record.add(max.toString());
record.add(exit == null ? "null" : exit.toString());
return StringUtils.join(record, "\t");
}
public final boolean hasWarp() {
if(warp != null || portal != null) {
return true;
}
return false;
}
public final String getWarpName() {
if(warp == null) {
if(portal != null) {
return portal.getName() + "*";
} else {
return null;
}
}
return warp.getName();
}
public final void setWarp(final Warp warp) {
this.warp = warp;
}
public final void setPortal(final Portal portal) {
warp = null;
this.portal = portal;
}
public final String getName() {
return name;
}
public final Vector getV1() {
return min;
}
public final Vector getV2() {
return max;
}
public final World getWorld() {
return world;
}
public final void warp(final Player player) {
if(warp == null) {
if(portal != null) {
final Vector half = portal.getV2().clone().subtract(portal.getV1()).multiply(0.5);
final Location mid = portal.getV1().clone().add(half).add(new Vector(0.5, 0, 0.5)).toLocation(portal.getWorld());
final Location to = Warp.findFloor(mid);
to.setYaw(portal.getYaw());
PlayerUtils.getOnlinePlayer(player.getName()).teleport(to);
}
} else {
player.teleport(warp.getLocation());
}
}
public final void warp(final Entity entity) {
if(warp == null) {
if(portal != null) {
final Vector half = portal.getV2().clone().subtract(portal.getV1()).multiply(0.5);
final Location mid = portal.getV1().clone().add(half).add(new Vector(0.5, 0, 0.5)).toLocation(portal.getWorld());
entity.teleport(Warp.findFloor(mid));
}
} else {
entity.teleport(warp.getLocation());
}
}
public final boolean crossWorld() {
if(warp == null) {
if(portal != null && world.equals(portal.getWorld())) {
return false;
}
return true;
} else {
if(world.equals(warp.getLocation().getWorld())) {
return false;
}
return true;
}
}
public final void linkPortal() {
if(!portalLink.equals("")) {
setPortal(UDSPlugin.getPortals().get(portalLink));
}
}
public final float getYaw() {
return exit == null ? 0 : exit.getYaw();
}
public final void setExit(final Direction exit) {
this.exit = exit;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
e978908fd09c6fafaec0f8043ea8160880d595eb | 684d29e6491058dbdc5e82cd73efc732d6a8741a | /castilloAubuntuPgm1/src/UbuntuProgram1.java | 679d0df38369e61f13694a0b94af57b1f47f67a2 | [] | no_license | Havenchao/school_work | bda31e464031c756b0e5ec97fcbc5218c534b3ab | c2579ea6b6bfa81af69bc8a9ffd544d812523471 | refs/heads/master | 2021-07-11T12:55:59.071459 | 2020-07-25T19:29:23 | 2020-07-25T19:29:23 | 171,355,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 595 | java | public class UbuntuProgram1
{
public static void main(String[] args)
{
processUbuntu("Andrew", 2019.2); // Calls processUbuntu method with name and number parameter.
}
public static void processUbuntu(String name, double number)
{
String[] separate = String.valueOf(number).split("\\."); // Separate integer and decimal numbers.
// First row display name. Second row with display 10 spaces with the integer part and 5 spaces for the decimal part.
System.out.printf("%1$s%n%2$10s.%3$5s", name, separate[0], separate[1]);
}
} | [
"Mr Liberty"
] | Mr Liberty |
29f9ec5655f6f29597c6439e625c18a828e2c2ae | c152cc1b9095bb9782261bcd4941d6826556c64a | /src/frc/robot/FRCLib/AutoHelperFunctions/AutonConversionFactors.java | 3f6d96dfbecdc66939e2320d87e1bdb84940038a | [] | no_license | OpenControls/frclib | 4f5b8be0e9f267e7278583dede14807eebea028a | 59ebd64b46576b42392077a40733a7b824892230 | refs/heads/master | 2022-12-26T09:16:10.959468 | 2020-10-02T17:09:09 | 2020-10-02T17:09:09 | 300,310,181 | 0 | 0 | null | 2020-10-02T17:09:10 | 2020-10-01T14:32:24 | Java | UTF-8 | Java | false | false | 2,248 | java |
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018-2019 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package frc.robot.FRCLib.AutoHelperFunctions;
/**
* Handles conversion between units for the Talon auton
*/
public class AutonConversionFactors {
public static final double convertTalonSRXNativeUnitsToWPILibTrajecoryUnits(double talonVelocity, double tpr, double diameter, double gearRatio){
double ticksPerMeter = convertTalonEncoderTicksToMeters(talonVelocity, diameter, tpr, gearRatio);
double metersPerTick = 1/ticksPerMeter;
double ticksPerSecond = talonVelocity * 10;
double metersPerSecond = ticksPerSecond * metersPerTick;
return metersPerSecond;
}
public static double convertWPILibUnitsToTalonSRXNativeUnits(double metersPerSecond, double tpr, double diameter, double gearRatio){
double circumference = Math.PI * diameter;
double tprAtWheel = tpr * gearRatio;
double revPerMeterAtWheel = 1/circumference * metersPerSecond;
double ticksAtWheel = revPerMeterAtWheel * tprAtWheel;
double inTicksPerMillisecond = ticksAtWheel / 10;
return inTicksPerMillisecond;
}
public static double convertTalonEncoderTicksToMeters(double ticks, double diameter, double tpr, double gearRatio){
double circumference = Math.PI *diameter;
double wheelRevolutionsPerMeter = 1/circumference;
double ticksPerWheelRevolution = tpr * gearRatio;
double ticksPerMeter = ticksPerWheelRevolution * wheelRevolutionsPerMeter;
double result = ticks * 1/ticksPerMeter;
return result;
}
public static double convertFeetToMeters(double value) {
return value * 0.3048;
}
public static double convertMetersToFeet(double value) {
return value * 1 / 0.3048;
}
} | [
"alex@abvr.xyz"
] | alex@abvr.xyz |
546b2ff6a468bb75f7f836cabe58973e80aff571 | abc54d3b5cad00eb59eb9e72c971f98dd9bbb0d3 | /src/main/java/salesapp/roommybatis/mapper/PRoomMapperEx.java | 148fc74b1d786c34f2db05e52001cb00c25d7958 | [] | no_license | JakartaProject/salesapp | ea8975b21cffb64533bb5632debac0b48bfba3e3 | 955dfca8c617f6480e2157f31955145c49b6e099 | refs/heads/master | 2020-03-25T01:50:07.850836 | 2018-08-29T07:55:11 | 2018-08-29T07:55:11 | 143,259,382 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 12,506 | java | package salesapp.roommybatis.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.type.JdbcType;
import salesapp.roommybatis.entity.PRoom;
public interface PRoomMapperEx extends PRoomMapper {
@Select({ "<script>", "select * from p_Room", "where Status = 'To be sold' ",
"<if test='structure != null'> and RoomStru = #{structure} </if>",
"<if test='areaFrom != null'> and YsBldArea >= #{areaFrom} </if>",
"<if test='areaTo != null'> and YsBldArea <= #{areaTo} </if>",
"<if test='priceFrom != null'> and PriceDj >= #{priceFrom} </if>",
"<if test='priceTo != null'> and PriceDj <= #{priceTo} </if>",
"<if test='totalPriceFrom != null'> and TotalDj >= #{totalPriceFrom} </if>",
"<if test='totalPriceTo != null'> and TotalDj <= #{totalPriceTo} </if>",
"order by RoomShortInfo","</script>" })
@Results({ @Result(column = "RoomGUID", property = "roomguid", jdbcType = JdbcType.CHAR, id = true),
@Result(column = "BUGUID", property = "buguid", jdbcType = JdbcType.CHAR),
@Result(column = "ProjGUID", property = "projguid", jdbcType = JdbcType.CHAR),
@Result(column = "BldGUID", property = "bldguid", jdbcType = JdbcType.CHAR),
@Result(column = "MainRoomGUID", property = "mainroomguid", jdbcType = JdbcType.CHAR),
@Result(column = "Unit", property = "unit", jdbcType = JdbcType.VARCHAR),
@Result(column = "Floor", property = "floor", jdbcType = JdbcType.VARCHAR),
@Result(column = "No", property = "no", jdbcType = JdbcType.VARCHAR),
@Result(column = "Room", property = "room", jdbcType = JdbcType.VARCHAR),
@Result(column = "RoomCode", property = "roomcode", jdbcType = JdbcType.VARCHAR),
@Result(column = "HuXing", property = "huxing", jdbcType = JdbcType.VARCHAR),
@Result(column = "Status", property = "status", jdbcType = JdbcType.VARCHAR),
@Result(column = "IsVirtualRoom", property = "isvirtualroom", jdbcType = JdbcType.TINYINT),
@Result(column = "BldArea", property = "bldarea", jdbcType = JdbcType.DECIMAL),
@Result(column = "TnArea", property = "tnarea", jdbcType = JdbcType.DECIMAL),
@Result(column = "BlRhDate", property = "blrhdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "RHBLZT", property = "rhblzt", jdbcType = JdbcType.VARCHAR),
@Result(column = "YFBZ", property = "yfbz", jdbcType = JdbcType.VARCHAR),
@Result(column = "XPos", property = "xpos", jdbcType = JdbcType.INTEGER),
@Result(column = "YPos", property = "ypos", jdbcType = JdbcType.INTEGER),
@Result(column = "ZxBz", property = "zxbz", jdbcType = JdbcType.VARCHAR),
@Result(column = "Price", property = "price", jdbcType = JdbcType.DECIMAL),
@Result(column = "TnPrice", property = "tnprice", jdbcType = JdbcType.DECIMAL),
@Result(column = "Total", property = "total", jdbcType = JdbcType.DECIMAL),
@Result(column = "ZxPrice", property = "zxprice", jdbcType = JdbcType.DECIMAL),
@Result(column = "ZxTotal", property = "zxtotal", jdbcType = JdbcType.DECIMAL),
@Result(column = "IsTempletRoom", property = "istempletroom", jdbcType = JdbcType.TINYINT),
@Result(column = "Locker", property = "locker", jdbcType = JdbcType.VARCHAR),
@Result(column = "LockTime", property = "locktime", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "TfDate", property = "tfdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "DjArea", property = "djarea", jdbcType = JdbcType.VARCHAR),
@Result(column = "IsAreaModify", property = "isareamodify", jdbcType = JdbcType.TINYINT),
@Result(column = "VirtualStatus", property = "virtualstatus", jdbcType = JdbcType.VARCHAR),
@Result(column = "RHDate", property = "rhdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "JFRQ", property = "jfrq", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "XkRow", property = "xkrow", jdbcType = JdbcType.VARCHAR),
@Result(column = "XkCol", property = "xkcol", jdbcType = JdbcType.VARCHAR),
@Result(column = "AreaStatus", property = "areastatus", jdbcType = JdbcType.VARCHAR),
@Result(column = "West", property = "west", jdbcType = JdbcType.VARCHAR),
@Result(column = "AreaChangingGUID", property = "areachangingguid", jdbcType = JdbcType.CHAR),
@Result(column = "ImportDate", property = "importdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "ChooseRoom", property = "chooseroom", jdbcType = JdbcType.TINYINT),
@Result(column = "CstName", property = "cstname", jdbcType = JdbcType.VARCHAR),
@Result(column = "CstGUIDList", property = "cstguidlist", jdbcType = JdbcType.VARCHAR),
@Result(column = "ChooseRoomCstName", property = "chooseroomcstname", jdbcType = JdbcType.VARCHAR),
@Result(column = "ChooseRoomDate", property = "chooseroomdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "Jbr", property = "jbr", jdbcType = JdbcType.VARCHAR),
@Result(column = "isAnnexe", property = "isannexe", jdbcType = JdbcType.TINYINT),
@Result(column = "Sight", property = "sight", jdbcType = JdbcType.VARCHAR),
@Result(column = "RoomStru", property = "roomstru", jdbcType = JdbcType.VARCHAR),
@Result(column = "AbsolutelyFloor", property = "absolutelyfloor", jdbcType = JdbcType.VARCHAR),
@Result(column = "StatusChgGUID", property = "statuschgguid", jdbcType = JdbcType.CHAR),
@Result(column = "SaleRentable", property = "salerentable", jdbcType = JdbcType.VARCHAR),
@Result(column = "RentPrice", property = "rentprice", jdbcType = JdbcType.DECIMAL),
@Result(column = "CalcRentMode", property = "calcrentmode", jdbcType = JdbcType.VARCHAR),
@Result(column = "RentUnit", property = "rentunit", jdbcType = JdbcType.VARCHAR),
@Result(column = "Bz", property = "bz", jdbcType = JdbcType.VARCHAR),
@Result(column = "RentStatus", property = "rentstatus", jdbcType = JdbcType.VARCHAR),
@Result(column = "ContinueRentStatus", property = "continuerentstatus", jdbcType = JdbcType.VARCHAR),
@Result(column = "NextRentStatus", property = "nextrentstatus", jdbcType = JdbcType.VARCHAR),
@Result(column = "RentName", property = "rentname", jdbcType = JdbcType.VARCHAR),
@Result(column = "RentGUIDList", property = "rentguidlist", jdbcType = JdbcType.VARCHAR),
@Result(column = "RentStatusChgGUID", property = "rentstatuschgguid", jdbcType = JdbcType.CHAR),
@Result(column = "RentLocker", property = "rentlocker", jdbcType = JdbcType.VARCHAR),
@Result(column = "RentLockTime", property = "rentlocktime", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "RentAmount", property = "rentamount", jdbcType = JdbcType.DECIMAL),
@Result(column = "BProductTypeCode", property = "bproducttypecode", jdbcType = JdbcType.VARCHAR),
@Result(column = "YsBldArea", property = "ysbldarea", jdbcType = JdbcType.DECIMAL),
@Result(column = "YsTnArea", property = "ystnarea", jdbcType = JdbcType.DECIMAL),
@Result(column = "ScBldArea", property = "scbldarea", jdbcType = JdbcType.DECIMAL),
@Result(column = "ScTnArea", property = "sctnarea", jdbcType = JdbcType.DECIMAL),
@Result(column = "ChooseRoomNo", property = "chooseroomno", jdbcType = JdbcType.INTEGER),
@Result(column = "ImportData_SP5", property = "importdataSp5", jdbcType = JdbcType.VARCHAR),
@Result(column = "FloorNo", property = "floorno", jdbcType = JdbcType.INTEGER),
@Result(column = "UnitNo", property = "unitno", jdbcType = JdbcType.INTEGER),
@Result(column = "SLControlDate", property = "slcontroldate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "IsHfLock", property = "ishflock", jdbcType = JdbcType.TINYINT),
@Result(column = "PriceDj", property = "pricedj", jdbcType = JdbcType.DECIMAL),
@Result(column = "TnPriceDj", property = "tnpricedj", jdbcType = JdbcType.DECIMAL),
@Result(column = "TotalDj", property = "totaldj", jdbcType = JdbcType.DECIMAL),
@Result(column = "IsDj2AreaLock", property = "isdj2arealock", jdbcType = JdbcType.TINYINT),
@Result(column = "IsBzj2AreaLock", property = "isbzj2arealock", jdbcType = JdbcType.TINYINT),
@Result(column = "IsDjTf", property = "isdjtf", jdbcType = JdbcType.TINYINT),
@Result(column = "IsBzjTf", property = "isbzjtf", jdbcType = JdbcType.TINYINT),
@Result(column = "IsDjAreaModify", property = "isdjareamodify", jdbcType = JdbcType.TINYINT),
@Result(column = "ChooseRoomBookingGUID", property = "chooseroombookingguid", jdbcType = JdbcType.CHAR),
@Result(column = "Visible", property = "visible", jdbcType = JdbcType.INTEGER),
@Result(column = "isyl", property = "isyl", jdbcType = JdbcType.INTEGER),
@Result(column = "roombz", property = "roombz", jdbcType = JdbcType.VARCHAR),
@Result(column = "PreRoomGUID", property = "preroomguid", jdbcType = JdbcType.VARCHAR),
@Result(column = "FloorGUID", property = "floorguid", jdbcType = JdbcType.CHAR),
@Result(column = "UnitGUID", property = "unitguid", jdbcType = JdbcType.CHAR),
@Result(column = "ResourcesTypeGUID", property = "resourcestypeguid", jdbcType = JdbcType.CHAR),
@Result(column = "CurRentStatus", property = "currentstatus", jdbcType = JdbcType.TINYINT),
@Result(column = "RoomStatus", property = "roomstatus", jdbcType = JdbcType.TINYINT),
@Result(column = "Cg", property = "cg", jdbcType = JdbcType.VARCHAR),
@Result(column = "Hz", property = "hz", jdbcType = JdbcType.VARCHAR),
@Result(column = "Power", property = "power", jdbcType = JdbcType.VARCHAR),
@Result(column = "Gas", property = "gas", jdbcType = JdbcType.VARCHAR),
@Result(column = "Gs", property = "gs", jdbcType = JdbcType.VARCHAR),
@Result(column = "Ps", property = "ps", jdbcType = JdbcType.VARCHAR),
@Result(column = "Kt", property = "kt", jdbcType = JdbcType.VARCHAR),
@Result(column = "Other", property = "other", jdbcType = JdbcType.VARCHAR),
@Result(column = "YJQYDate", property = "yjqydate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "CreateDate", property = "createdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "IsAlowIn", property = "isalowin", jdbcType = JdbcType.TINYINT),
@Result(column = "Client", property = "client", jdbcType = JdbcType.VARCHAR),
@Result(column = "EntrustDate", property = "entrustdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "EntrustJbr", property = "entrustjbr", jdbcType = JdbcType.VARCHAR),
@Result(column = "EntrustJbDate", property = "entrustjbdate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "EntrustEndDate", property = "entrustenddate", jdbcType = JdbcType.TIMESTAMP),
@Result(column = "Contact", property = "contact", jdbcType = JdbcType.VARCHAR),
@Result(column = "EntrustJbrGUID", property = "entrustjbrguid", jdbcType = JdbcType.CHAR),
@Result(column = "RoomInfo", property = "roominfo", jdbcType = JdbcType.VARCHAR),
@Result(column = "RoomShortInfo", property = "roomshortinfo", jdbcType = JdbcType.VARCHAR),
@Result(column = "RoomSort", property = "roomsort", jdbcType = JdbcType.VARCHAR),
@Result(column = "RoomZlBz", property = "roomzlbz", jdbcType = JdbcType.VARCHAR),
@Result(column = "ERPCode", property = "erpcode", jdbcType = JdbcType.VARCHAR),
@Result(column = "IsTransferERPCode", property = "istransfererpcode", jdbcType = JdbcType.TINYINT),
@Result(column = "ERPCodeApproveState", property = "erpcodeapprovestate", jdbcType = JdbcType.VARCHAR),
@Result(column = "VirtualAccount", property = "virtualaccount", jdbcType = JdbcType.VARCHAR),
@Result(column = "SaleStatus", property = "salestatus", jdbcType = JdbcType.VARCHAR),
@Result(column = "ShortUnitNo", property = "shortunitno", jdbcType = JdbcType.VARCHAR),
@Result(column = "ShortVirtualAccount", property = "shortvirtualaccount", jdbcType = JdbcType.VARCHAR),
@Result(column = "RoomMemo", property = "roommemo", jdbcType = JdbcType.LONGVARCHAR),
@Result(column = "JFMemo", property = "jfmemo", jdbcType = JdbcType.LONGVARCHAR),
@Result(column = "ReturnMsg", property = "returnmsg", jdbcType = JdbcType.LONGVARCHAR) })
List<PRoom> search(@Param("structure") String structure, @Param("areaFrom") String areaFrom,
@Param("areaTo") String areaTo, @Param("priceFrom") String priceFrom, @Param("priceTo") String priceTo,
@Param("totalPriceFrom") String totalPriceFrom, @Param("totalPriceTo") String totalPriceTo);
}
| [
"meikarta@10.128.171.88"
] | meikarta@10.128.171.88 |
6e1111f9964699874f07b6befee31cf9c7b01c6f | 83b7dc3722a62d967bb6b1c133cf153552fdf856 | /src/main/java/com/webside/member/service/impl/MemberServiceImpl.java | edf7cdad2e81977727ac24d4c4f5567136d96d0a | [] | no_license | Corn-886/webside | 363dcf6c0a995baa293b01ece8ca13030dfd8c03 | 80ad03a5e631cbc11fc6eb42083508ec4c452584 | refs/heads/master | 2022-09-28T17:45:31.182988 | 2022-09-23T06:48:42 | 2022-09-23T06:48:42 | 65,898,541 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 894 | java | package com.webside.member.service.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.webside.base.baseservice.impl.AbstractService;
import com.webside.member.mapper.MemberMapper;
import com.webside.member.model.MemberEntity;
import com.webside.member.service.MemberService;
import com.webside.user.model.UserEntity;
@Service("MemberService")
public class MemberServiceImpl extends AbstractService<MemberEntity, Long> implements MemberService {
@Autowired
private MemberMapper membermapper;
//这句必须要加上。不然会报空指针异常,因为在实际调用的时候不是BaseMapper调用,而是具体的mapper,这里为userMapper
@Autowired
public void setBaseMapper() {
super.setBaseMapper(membermapper);
}
}
| [
"752623077@qq.com"
] | 752623077@qq.com |
808f53ebf517e3916a9d2354accd30ec1f3d91e3 | 52cd88dd6be5c27c4043b90fc5b5e6e4b8715dc9 | /Test/src/test1214/MyStack.java | d9d59453e4b85ded353dca0b13d887988f8cf807 | [] | no_license | hypernova1/newdeal | 92e742ce4c74337273976b284e0d31cdf54a5c07 | f75e69c85a4adb2192aae9acf22dd6583b449412 | refs/heads/master | 2021-06-29T18:56:24.088392 | 2018-12-29T07:19:17 | 2018-12-29T07:19:17 | 159,305,944 | 0 | 0 | null | 2020-10-13T16:23:18 | 2018-11-27T09:01:37 | Java | UTF-8 | Java | false | false | 1,543 | java | package test1214;
public class MyStack<T> {
private T[] stackArr;
private int size;
@SuppressWarnings("unchecked")
public MyStack(int arrSize) {
stackArr = (T[]) new Object[arrSize];
}
public boolean empty() { // 스택이 비었는지 확인
if(size == 0) return true;
return false;
}
public boolean full() { //스택이 풀인지 확인
if(stackArr.length == size) return true;
return false;
}
public void push(T obj) {
if(stackArr.length == size) {
for(int i = 1; i < size; i++) {
stackArr[i - 1] = stackArr[i];
}
stackArr[size - 1] = obj;
return;
}
stackArr[size++] = obj;
}
public T pop() {
if(size == 0) return null;
size--;
T obj = stackArr[size];
stackArr[size] = null;
return obj;
}
public int size() {
return size;
}
public static void main(String[] args) {
MyStack<Integer> s = new MyStack<>(10);
for(int i = 0; i < 12; i++) {
s.push(i);
}
System.out.println(s.size());
System.out.println("----------------------");
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
System.out.println(s.pop());
}
} | [
"chtlstjd01@gmail.com"
] | chtlstjd01@gmail.com |
c740c72bb53557a8f6db6630af6f99644a5a123d | 28e4e0221c5948fbf0fba3d509f7a1d04b934628 | /app/src/main/java/com/ricardohg/ejercicio3/Product.java | 6e2356ec2c2fac1a8d7e4e6cb3784daf5d0ccf69 | [] | no_license | RedRichard/JSONParsing-Android-CM | 3c35ea55975dbe9860cdfe393125084e5992257b | 957e43db4b35ce3e4aad894c0d6a3b34cd24996e | refs/heads/master | 2022-07-08T06:39:32.988138 | 2020-05-13T21:53:15 | 2020-05-13T21:53:15 | 263,747,635 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,368 | java | package com.ricardohg.ejercicio3;
import java.io.Serializable;
public class Product implements Serializable {
String id;
String name;
String price;
String provider;
String delivery;
String imageURL;
public Product(String id, String name, String price, String provider, String delivery, String imageURL) {
this.id = id;
this.name = name;
this.price = price;
this.provider = provider;
this.delivery = delivery;
this.imageURL = imageURL;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getProvider() {
return provider;
}
public void setProvider(String provider) {
this.provider = provider;
}
public String getDelivery() {
return delivery;
}
public void setDelivery(String delivery) {
this.delivery = delivery;
}
public String getImageURL() {
return imageURL;
}
public void setImageURL(String imageURL) {
this.imageURL = imageURL;
}
}
| [
"gomric@hotmail.com"
] | gomric@hotmail.com |
bfcae12639a600ed5412eabee788e5ec56103799 | dd2d6f8bc5310211dabb47d7a7550717abefd438 | /test/src/main/java/com/liu/shan/designpattern/proxy/GamePlayerProxy.java | b877a4615a3b684b62ebbf4a90322ed12e35a18e | [] | no_license | kkliuxin/shanshan | 9583988cbbaf89a8eab62e7675eec6a0093c6a0e | c7049e9b57df7ee0d7074741b4ad35c69e381742 | refs/heads/master | 2022-12-04T01:10:11.619483 | 2019-08-27T03:28:33 | 2019-08-27T03:28:33 | 74,337,025 | 0 | 0 | null | 2022-11-16T06:23:17 | 2016-11-21T07:22:24 | Java | UTF-8 | Java | false | false | 705 | java | package com.liu.shan.designpattern.proxy;
/**
* Created by BBF on 2016/11/18.
*/
public class GamePlayerProxy implements IGamePlayer,IProxy {
private IGamePlayer iGamePlayer = null;
public GamePlayerProxy(IGamePlayer iGamePlayer) {
this.iGamePlayer = iGamePlayer;
}
@Override
public void login(String user, String password) {
this.iGamePlayer.login(user, password);
}
@Override
public void killBoss() {
this.iGamePlayer.killBoss();
}
@Override
public void upgrade() {
this.iGamePlayer.upgrade();
this.cout();
}
@Override
public void cout() {
System.out.println("收取费用100元");
}
}
| [
"1024904798@qq.com"
] | 1024904798@qq.com |
756424222cfa128cb2dbaefdfa646dc0816ca8c1 | 34b713d69bae7d83bb431b8d9152ae7708109e74 | /core/broadleaf-framework-web/src/main/java/org/broadleafcommerce/core/web/controller/checkout/BroadleafBillingInfoController.java | f11f37a669cc3904f735d9fedfa7900e0834ad4d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | sinotopia/BroadleafCommerce | d367a22af589b51cc16e2ad094f98ec612df1577 | 502ff293d2a8d58ba50a640ed03c2847cb6369f6 | refs/heads/BroadleafCommerce-4.0.x | 2021-01-23T14:14:45.029362 | 2019-07-26T14:18:05 | 2019-07-26T14:18:05 | 93,246,635 | 0 | 0 | null | 2017-06-03T12:27:13 | 2017-06-03T12:27:13 | null | UTF-8 | Java | false | false | 8,997 | java | /*
* #%L
* BroadleafCommerce Framework Web
* %%
* Copyright (C) 2009 - 2013 Broadleaf Commerce
* %%
* 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.
* #L%
*/
package org.broadleafcommerce.core.web.controller.checkout;
import org.apache.commons.lang.StringUtils;
import org.broadleafcommerce.common.exception.ServiceException;
import org.broadleafcommerce.common.payment.PaymentGatewayType;
import org.broadleafcommerce.common.payment.PaymentType;
import org.broadleafcommerce.core.order.domain.Order;
import org.broadleafcommerce.core.payment.domain.OrderPayment;
import org.broadleafcommerce.core.pricing.service.exception.PricingException;
import org.broadleafcommerce.core.web.checkout.model.BillingInfoForm;
import org.broadleafcommerce.core.web.order.CartState;
import org.broadleafcommerce.profile.core.domain.Address;
import org.broadleafcommerce.profile.core.domain.CustomerPayment;
import org.broadleafcommerce.profile.core.domain.Phone;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author Elbert Bautista (elbertbautista)
*/
public class BroadleafBillingInfoController extends AbstractCheckoutController {
/**
* Processes the request to save a billing address.
*
* Note: this default Broadleaf implementation will create an OrderPayment of
* type CREDIT_CARD if it doesn't exist and save the passed in billing address
*
* @param request
* @param response
* @param model
* @param billingForm
* @return the return path
* @throws org.broadleafcommerce.common.exception.ServiceException
*/
public String saveBillingAddress(HttpServletRequest request, HttpServletResponse response, Model model,
BillingInfoForm billingForm, BindingResult result) throws PricingException, ServiceException {
Order cart = CartState.getCart();
CustomerPayment customerPayment = null;
if (billingForm.isUseShippingAddress()){
copyShippingAddressToBillingAddress(cart, billingForm);
}
Boolean useCustomerPayment = billingForm.getUseCustomerPayment();
if (useCustomerPayment && billingForm.getCustomerPaymentId() != null) {
customerPayment = customerPaymentService.readCustomerPaymentById(billingForm.getCustomerPaymentId());
if (customerPayment != null) {
Address address = customerPayment.getBillingAddress();
if (address != null) {
copyAddressToBillingAddress(billingForm, address);
}
}
}
billingInfoFormValidator.validate(billingForm, result);
if (result.hasErrors()) {
return getCheckoutView();
}
if ((billingForm.getAddress().getPhonePrimary() != null) &&
(StringUtils.isEmpty(billingForm.getAddress().getPhonePrimary().getPhoneNumber()))) {
billingForm.getAddress().setPhonePrimary(null);
}
if ((billingForm.getAddress().getPhoneSecondary() != null) &&
(StringUtils.isEmpty(billingForm.getAddress().getPhoneSecondary().getPhoneNumber()))) {
billingForm.getAddress().setPhoneSecondary(null);
}
if ((billingForm.getAddress().getPhoneFax() != null) &&
(StringUtils.isEmpty(billingForm.getAddress().getPhoneFax().getPhoneNumber()))) {
billingForm.getAddress().setPhoneFax(null);
}
boolean found = false;
String paymentName = billingForm.getPaymentName();
Boolean saveNewPayment = billingForm.getSaveNewPayment();
for (OrderPayment p : cart.getPayments()) {
if (PaymentType.CREDIT_CARD.equals(p.getType()) && p.isActive()) {
if (p.getBillingAddress() == null) {
p.setBillingAddress(billingForm.getAddress());
} else {
Address updatedAddress = updateAddress(billingForm.getAddress(), p.getBillingAddress());
p.setBillingAddress(updatedAddress);
}
found = true;
}
}
if (!found) {
// A Temporary Order Payment will be created to hold the billing address.
// The Payment Gateway will send back any validated address and
// the PaymentGatewayCheckoutService will persist a new payment of type CREDIT_CARD when it applies it to the Order
OrderPayment tempOrderPayment = orderPaymentService.create();
tempOrderPayment.setType(PaymentType.CREDIT_CARD);
tempOrderPayment.setPaymentGatewayType(PaymentGatewayType.TEMPORARY);
tempOrderPayment.setBillingAddress(billingForm.getAddress());
tempOrderPayment.setOrder(cart);
cart.getPayments().add(tempOrderPayment);
}
orderService.save(cart, true);
if (isAjaxRequest(request)) {
//Add module specific model variables
checkoutControllerExtensionManager.getProxy().addAdditionalModelVariables(model);
return getCheckoutView();
} else {
return getCheckoutPageRedirect();
}
}
/**
* This method will copy the shipping address of the first fulfillment group on the order
* to the billing address on the BillingInfoForm that is passed in.
*/
protected void copyShippingAddressToBillingAddress(Order order, BillingInfoForm billingInfoForm) {
if (order.getFulfillmentGroups().get(0) != null) {
Address shipping = order.getFulfillmentGroups().get(0).getAddress();
if (shipping != null) {
copyAddressToBillingAddress(billingInfoForm, shipping);
}
}
}
protected void copyAddressToBillingAddress(BillingInfoForm billingInfoForm, Address address) {
Address billing = addressService.create();
billingInfoForm.setAddress(updateAddress(address, billing));
}
private Address updateAddress(Address updatedInfoAddress, Address addressToBeUpdated) {
addressToBeUpdated.setFullName(updatedInfoAddress.getFullName());
addressToBeUpdated.setFirstName(updatedInfoAddress.getFirstName());
addressToBeUpdated.setLastName(updatedInfoAddress.getLastName());
addressToBeUpdated.setAddressLine1(updatedInfoAddress.getAddressLine1());
addressToBeUpdated.setAddressLine2(updatedInfoAddress.getAddressLine2());
addressToBeUpdated.setCity(updatedInfoAddress.getCity());
addressToBeUpdated.setState(updatedInfoAddress.getState());
addressToBeUpdated.setIsoCountrySubdivision(updatedInfoAddress.getIsoCountrySubdivision());
addressToBeUpdated.setStateProvinceRegion(updatedInfoAddress.getStateProvinceRegion());
addressToBeUpdated.setPostalCode(updatedInfoAddress.getPostalCode());
addressToBeUpdated.setCountry(updatedInfoAddress.getCountry());
addressToBeUpdated.setIsoCountryAlpha2(updatedInfoAddress.getIsoCountryAlpha2());
addressToBeUpdated.setPrimaryPhone(updatedInfoAddress.getPrimaryPhone());
addressToBeUpdated.setSecondaryPhone(updatedInfoAddress.getSecondaryPhone());
addressToBeUpdated.setFax(updatedInfoAddress.getFax());
addressToBeUpdated.setPhonePrimary(copyPhone(updatedInfoAddress.getPhonePrimary(),
addressToBeUpdated.getPhonePrimary()));
addressToBeUpdated.setPhoneSecondary(copyPhone(updatedInfoAddress.getPhoneSecondary(),
addressToBeUpdated.getPhoneSecondary()));
addressToBeUpdated.setPhoneFax(copyPhone(updatedInfoAddress.getPhoneFax(), addressToBeUpdated.getPhoneFax()));
addressToBeUpdated.setEmailAddress(updatedInfoAddress.getEmailAddress());
return addressToBeUpdated;
}
protected Phone copyPhone(Phone phoneToCopy, Phone phoneToUpdate) {
if (phoneToCopy != null) {
if (phoneToUpdate == null) {
phoneToUpdate = phoneService.create();
}
phoneToUpdate.setPhoneNumber(phoneToCopy.getPhoneNumber());
return phoneToUpdate;
}
return null;
}
}
| [
"sinosie7en@gmail.com"
] | sinosie7en@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.