blob_id
stringlengths 40
40
| __id__
int64 225
39,780B
| directory_id
stringlengths 40
40
| path
stringlengths 6
313
| content_id
stringlengths 40
40
| detected_licenses
list | license_type
stringclasses 2
values | repo_name
stringlengths 6
132
| repo_url
stringlengths 25
151
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringlengths 4
70
| visit_date
timestamp[ns] | revision_date
timestamp[ns] | committer_date
timestamp[ns] | github_id
int64 7.28k
689M
⌀ | star_events_count
int64 0
131k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 23
values | gha_fork
bool 2
classes | gha_event_created_at
timestamp[ns] | gha_created_at
timestamp[ns] | gha_updated_at
timestamp[ns] | gha_pushed_at
timestamp[ns] | gha_size
int64 0
40.4M
⌀ | gha_stargazers_count
int32 0
112k
⌀ | gha_forks_count
int32 0
39.4k
⌀ | gha_open_issues_count
int32 0
11k
⌀ | gha_language
stringlengths 1
21
⌀ | gha_archived
bool 2
classes | gha_disabled
bool 1
class | content
stringlengths 7
4.37M
| src_encoding
stringlengths 3
16
| language
stringclasses 1
value | length_bytes
int64 7
4.37M
| extension
stringclasses 24
values | filename
stringlengths 4
174
| language_id
stringclasses 1
value | entities
list | contaminating_dataset
stringclasses 0
values | malware_signatures
list | redacted_content
stringlengths 7
4.37M
| redacted_length_bytes
int64 7
4.37M
| alphanum_fraction
float32 0.25
0.94
| alpha_fraction
float32 0.25
0.94
| num_lines
int32 1
84k
| avg_line_length
float32 0.76
99.9
| std_line_length
float32 0
220
| max_line_length
int32 5
998
| is_vendor
bool 2
classes | is_generated
bool 1
class | max_hex_length
int32 0
319
| hex_fraction
float32 0
0.38
| max_unicode_length
int32 0
408
| unicode_fraction
float32 0
0.36
| max_base64_length
int32 0
506
| base64_fraction
float32 0
0.5
| avg_csv_sep_count
float32 0
4
| is_autogen_header
bool 1
class | is_empty_html
bool 1
class | shard
stringclasses 16
values |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
604c015b1bfc340cca4020542d52e48f7ec7b551
| 32,315,333,985,868 |
43c4f0f22978580a4a12ed2254bde0d06cc95d2f
|
/src/main/java/com/code/data/application/ProductsApplication.java
|
3bd264fae1695c266a04047bec245addbf3e3f31
|
[] |
no_license
|
mateusaugusto/java-weapp-coding
|
https://github.com/mateusaugusto/java-weapp-coding
|
5f54d050b4e6ec4e3f7a4c0a46de11ceb65a7a87
|
13c8abcc43d45f9d6153a60ae2f18ff706def3f7
|
refs/heads/master
| 2020-04-11T01:20:44.175000 | 2016-06-20T16:15:06 | 2016-06-20T16:15:06 | 60,290,628 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.code.data.application;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Component;
import com.code.data.domain.Products;
import com.code.data.repository.ProductsRepository;
@Component
public class ProductsApplication {
@Autowired
private ProductsRepository repository;
public List<Products> findAllProducts(){
List<Products> listProducts = repository.findAll();
return listProducts;
}
public Products findProductById(long idProduct){
return repository.findById(idProduct);
}
@Transactional
@CacheEvict(
value = "products",
key = "#id")
public void delete(Long id) {
// logger.info("> delete id:{}", id);
repository.delete(id);
//logger.info("< delete id:{}", id);
}
@CacheEvict(
value = "products",
allEntries = true)
public void evictCache() {
//logger.info("> evictCache");
//logger.info("< evictCache");
}
}
|
UTF-8
|
Java
| 1,141 |
java
|
ProductsApplication.java
|
Java
|
[] | null |
[] |
package com.code.data.application;
import java.util.List;
import javax.transaction.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Component;
import com.code.data.domain.Products;
import com.code.data.repository.ProductsRepository;
@Component
public class ProductsApplication {
@Autowired
private ProductsRepository repository;
public List<Products> findAllProducts(){
List<Products> listProducts = repository.findAll();
return listProducts;
}
public Products findProductById(long idProduct){
return repository.findById(idProduct);
}
@Transactional
@CacheEvict(
value = "products",
key = "#id")
public void delete(Long id) {
// logger.info("> delete id:{}", id);
repository.delete(id);
//logger.info("< delete id:{}", id);
}
@CacheEvict(
value = "products",
allEntries = true)
public void evictCache() {
//logger.info("> evictCache");
//logger.info("< evictCache");
}
}
| 1,141 | 0.677476 | 0.677476 | 47 | 23.276596 | 19.018135 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.87234 | false | false |
7
|
f833e76c031d8bdcf22e20c9771bf41eb9e29c88
| 38,233,798,880,208 |
ee20a05de1231369c433b3cf79a013285a829d67
|
/src/com/joe/designmode/behavior/mediator/IMediator.java
|
abebacdcf71e0e944d1a0e5c2d3f2c90afa4ab13
|
[] |
no_license
|
joehqf/MyThread
|
https://github.com/joehqf/MyThread
|
e0d92aefe855f41344a917fc2447fbc9c7d1e566
|
6ad098782a47489d2d48b97b0a23eb98d56e8f76
|
refs/heads/master
| 2023-02-04T18:55:28.916000 | 2020-12-12T01:23:49 | 2020-12-12T01:23:49 | 317,094,047 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.joe.designmode.behavior.mediator;
/**
* 抽象中介者
*/
public interface IMediator {
void register(String dname, IDepartment d);// 将具体的同事类注册到中介者中,让中介者知道所有的同事。以便进行交互
void command(String dname);// 通过部门名称,发出命令
}
|
UTF-8
|
Java
| 318 |
java
|
IMediator.java
|
Java
|
[] | null |
[] |
package com.joe.designmode.behavior.mediator;
/**
* 抽象中介者
*/
public interface IMediator {
void register(String dname, IDepartment d);// 将具体的同事类注册到中介者中,让中介者知道所有的同事。以便进行交互
void command(String dname);// 通过部门名称,发出命令
}
| 318 | 0.754545 | 0.754545 | 10 | 21 | 25.779837 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.6 | false | false |
7
|
93a21f973068caafe86bccb10b4b4155bfd4a487
| 38,233,798,878,336 |
69bd72771f5f7ecd675c0b38c542fcb5af7dc287
|
/src/organic/generation/points/area/DiskPointGenerator.java
|
f213e17e1ad080698add715cd6ad64791711eb3a
|
[
"MIT"
] |
permissive
|
lakeheck/sandbox
|
https://github.com/lakeheck/sandbox
|
85ede9867535da842b6d48b224859720dbc0c4d3
|
175f902f662b2a99d76a1d2b1f56b0f06b203d6b
|
refs/heads/main
| 2023-04-11T20:36:44.534000 | 2021-04-03T23:53:31 | 2021-04-03T23:53:31 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package organic.generation.points.area;
import organic.generation.AbstractSeededRandom;
import organic.generation.points.PointGenerator;
import util.vector.ReadVector;
import util.vector.Vector;
public class DiskPointGenerator extends AbstractSeededRandom implements PointGenerator {
private final double radius;
private final ReadVector center;
public DiskPointGenerator(double radius, ReadVector center) {
super();
this.radius = radius;
this.center = center;
}
public DiskPointGenerator(double radius, ReadVector center, long seed) {
super(seed);
this.radius = radius;
this.center = center;
}
@Override
public Vector get() {
double angle = random.nextDouble() * Math.PI * 2;
double u = random.nextDouble() + random .nextDouble();
double r = (u > 1 ? 2 - u : u) * radius;
return Vector.fromAngle(angle).mult(r).add(center);
}
}
|
UTF-8
|
Java
| 950 |
java
|
DiskPointGenerator.java
|
Java
|
[] | null |
[] |
package organic.generation.points.area;
import organic.generation.AbstractSeededRandom;
import organic.generation.points.PointGenerator;
import util.vector.ReadVector;
import util.vector.Vector;
public class DiskPointGenerator extends AbstractSeededRandom implements PointGenerator {
private final double radius;
private final ReadVector center;
public DiskPointGenerator(double radius, ReadVector center) {
super();
this.radius = radius;
this.center = center;
}
public DiskPointGenerator(double radius, ReadVector center, long seed) {
super(seed);
this.radius = radius;
this.center = center;
}
@Override
public Vector get() {
double angle = random.nextDouble() * Math.PI * 2;
double u = random.nextDouble() + random .nextDouble();
double r = (u > 1 ? 2 - u : u) * radius;
return Vector.fromAngle(angle).mult(r).add(center);
}
}
| 950 | 0.677895 | 0.674737 | 31 | 29.645161 | 24.229479 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.645161 | false | false |
7
|
f5e1689e20b375fd6379eede9c4872cb3da68953
| 12,816,182,477,012 |
49885bca32532faac93cb461b0c6875cdd29516c
|
/Java/DCSFileServer/KeyStoreCreator.java
|
9f381d35710284a714b1e132070c4a3ba47f8e92
|
[] |
no_license
|
charlottepierce/Scratchpad
|
https://github.com/charlottepierce/Scratchpad
|
746173412001af794995360db56d44c8ce8bad96
|
94a9d6d8dfbc30a558d559273777bce23c034e53
|
refs/heads/master
| 2016-09-08T19:20:08.988000 | 2016-08-24T12:36:16 | 2016-08-24T12:36:16 | 5,909,770 | 0 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.security.*;
import java.io.*;
import javax.crypto.*;
class KeyStoreCreator
{
public static void main(String args[]) throws Exception
{
KeyStore ks1 = KeyStore.getInstance("JCEKS");
//initialise keystore
ks1.load(null, null);
BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));
//get keystorename and password
System.out.print("Keystore name (must end with .keystore): ");
String keyStoreName = inFromUser.readLine();
System.out.print("Keystore password: ");
char[] password = inFromUser.readLine().toCharArray();
//create output stream for the keystored
FileOutputStream outToKS = new FileOutputStream(keyStoreName);
//create the keystore
ks1.store(outToKS, password);
//create a SecretKey and store in the key store
//load the keystore
KeyStore ks2 = KeyStore.getInstance("JCEKS");
FileInputStream inFromFile = new FileInputStream(keyStoreName);
ks2.load(inFromFile, password);
FileOutputStream outToKS2 = new FileOutputStream(keyStoreName);
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
Key key = keyGen.generateKey();
ks2.setKeyEntry("Key1", key, password, null);
//rewrite the new keystore with the new entry
ks2.store(outToKS2, password);
}
}
|
UTF-8
|
Java
| 1,326 |
java
|
KeyStoreCreator.java
|
Java
|
[] | null |
[] |
import java.security.*;
import java.io.*;
import javax.crypto.*;
class KeyStoreCreator
{
public static void main(String args[]) throws Exception
{
KeyStore ks1 = KeyStore.getInstance("JCEKS");
//initialise keystore
ks1.load(null, null);
BufferedReader inFromUser = new BufferedReader(new InputStreamReader(System.in));
//get keystorename and password
System.out.print("Keystore name (must end with .keystore): ");
String keyStoreName = inFromUser.readLine();
System.out.print("Keystore password: ");
char[] password = inFromUser.readLine().toCharArray();
//create output stream for the keystored
FileOutputStream outToKS = new FileOutputStream(keyStoreName);
//create the keystore
ks1.store(outToKS, password);
//create a SecretKey and store in the key store
//load the keystore
KeyStore ks2 = KeyStore.getInstance("JCEKS");
FileInputStream inFromFile = new FileInputStream(keyStoreName);
ks2.load(inFromFile, password);
FileOutputStream outToKS2 = new FileOutputStream(keyStoreName);
KeyGenerator keyGen = KeyGenerator.getInstance("AES");
Key key = keyGen.generateKey();
ks2.setKeyEntry("Key1", key, password, null);
//rewrite the new keystore with the new entry
ks2.store(outToKS2, password);
}
}
| 1,326 | 0.705882 | 0.698341 | 39 | 33.025642 | 23.151106 | 85 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.692308 | false | false |
7
|
5eb7307a9dc1daf031e763aa5319ad9ab10341b6
| 37,684,043,070,778 |
c0c7aa8ef7f92e965ac26538a1e5125b5828cfa3
|
/Year 2/GMSISFX/src/MenuController.java
|
62baa3916e895eef5611afd8a37cd4bb3ee9747e
|
[] |
no_license
|
Melojan/University
|
https://github.com/Melojan/University
|
a9d38d735abb2743df36dce69cebbfede448ca90
|
a15dbfc93316892579220144b173c24fe26dc7eb
|
refs/heads/master
| 2020-04-14T02:30:28.898000 | 2019-01-08T22:29:10 | 2019-01-08T22:29:10 | 163,584,295 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import Authentication.Session;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class MenuController implements Initializable {
@FXML
private AnchorPane ap;
@FXML
private Button spc;
@FXML
private Button dandr;
@FXML
private Button customer;
@FXML
private Button vehicle;
@FXML
private Button parts;
@FXML
private Button admin;
@FXML
private Button logoutButton;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// this.stage = (Stage) ap.getScene().getWindow();
}
@FXML
void GoTo1(ActionEvent event) throws Exception{
Stage stage = (Stage)ap.getScene().getWindow();
Object source = event.getSource();
Parent root;
if (source instanceof Button) { //should always be true in your example
Button clickedBtn = (Button) source; // that's the button that was clicked
System.out.println(clickedBtn.getId()); // prints the id of the button
switch (clickedBtn.getId()) {
case "customer":
root = FXMLLoader.load(getClass().getResource("customers/gui/FXMLDocument.fxml"));
break;
case "spc":
root = FXMLLoader.load(getClass().getResource("SPC/SPC.fxml"));
break;
case "admin":
root = FXMLLoader.load(getClass().getResource("Authentication/Admins.fxml"));
break;
case "vehicle":
root = FXMLLoader.load(getClass().getResource("Vehicle/FXMLDocument.fxml"));
break;
case "parts":
root = FXMLLoader.load(getClass().getResource("Parts/menu.fxml"));
break;
case "dandr":
root = FXMLLoader.load(getClass().getResource("diagRep/GUI/BookingTable.fxml"));
break;
default:
root = FXMLLoader.load(getClass().getResource("menu.fxml"));
break;
}
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
@FXML
private void logout(ActionEvent event) throws Exception{
Session.Logout();
FXMLLoader loader = new FXMLLoader((getClass().getResource("Authentication/Login.fxml")));
Stage stage = (Stage) logoutButton.getScene().getWindow();
Parent root = (Parent)loader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
|
UTF-8
|
Java
| 3,433 |
java
|
MenuController.java
|
Java
|
[] | null |
[] |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import Authentication.Session;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;
public class MenuController implements Initializable {
@FXML
private AnchorPane ap;
@FXML
private Button spc;
@FXML
private Button dandr;
@FXML
private Button customer;
@FXML
private Button vehicle;
@FXML
private Button parts;
@FXML
private Button admin;
@FXML
private Button logoutButton;
/**
* Initializes the controller class.
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
// this.stage = (Stage) ap.getScene().getWindow();
}
@FXML
void GoTo1(ActionEvent event) throws Exception{
Stage stage = (Stage)ap.getScene().getWindow();
Object source = event.getSource();
Parent root;
if (source instanceof Button) { //should always be true in your example
Button clickedBtn = (Button) source; // that's the button that was clicked
System.out.println(clickedBtn.getId()); // prints the id of the button
switch (clickedBtn.getId()) {
case "customer":
root = FXMLLoader.load(getClass().getResource("customers/gui/FXMLDocument.fxml"));
break;
case "spc":
root = FXMLLoader.load(getClass().getResource("SPC/SPC.fxml"));
break;
case "admin":
root = FXMLLoader.load(getClass().getResource("Authentication/Admins.fxml"));
break;
case "vehicle":
root = FXMLLoader.load(getClass().getResource("Vehicle/FXMLDocument.fxml"));
break;
case "parts":
root = FXMLLoader.load(getClass().getResource("Parts/menu.fxml"));
break;
case "dandr":
root = FXMLLoader.load(getClass().getResource("diagRep/GUI/BookingTable.fxml"));
break;
default:
root = FXMLLoader.load(getClass().getResource("menu.fxml"));
break;
}
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
@FXML
private void logout(ActionEvent event) throws Exception{
Session.Logout();
FXMLLoader loader = new FXMLLoader((getClass().getResource("Authentication/Login.fxml")));
Stage stage = (Stage) logoutButton.getScene().getWindow();
Parent root = (Parent)loader.load();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
}
}
| 3,433 | 0.547917 | 0.547626 | 121 | 27.371901 | 26.499691 | 118 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.446281 | false | false |
7
|
95e48cb01be235a3ca9959e0e3b8806f7f7aaa48
| 15,453,292,392,419 |
69b5eee11160d8a354cd706f6f17b9ef1386d34c
|
/src/Config/DBConnection.java
|
4b849cd96627f0a4246b7825d5874624f914902c
|
[] |
no_license
|
mahmoudgabrweb/jdbc-java
|
https://github.com/mahmoudgabrweb/jdbc-java
|
e5d606cbd3b93f2c795e3fb79eae3c2c7be12f0a
|
cde99b63baf806f9e996857752f5c08e2dc7137a
|
refs/heads/master
| 2020-09-26T06:28:57.899000 | 2019-12-10T18:22:52 | 2019-12-10T18:22:52 | 226,188,587 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Config;
import java.sql.Connection;
import java.sql.DriverManager;
/**
*
* @author mahmoudgabr
*/
public class DBConnection {
Connection connection = null;
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/java_test";
String dbUser = "root";
String dbPass = "root1234";
public Connection getConnection() {
try {
Class.forName(driver);
connection = DriverManager.getConnection(url, dbUser, dbPass);
} catch (Exception ex) {
System.out.println("Exception: " + ex.getMessage());
}
return connection;
}
}
|
UTF-8
|
Java
| 675 |
java
|
DBConnection.java
|
Java
|
[
{
"context": ";\nimport java.sql.DriverManager;\n/**\n *\n * @author mahmoudgabr\n */\npublic class DBConnection {\n \n Connecti",
"end": 105,
"score": 0.9989332556724548,
"start": 94,
"tag": "USERNAME",
"value": "mahmoudgabr"
},
{
"context": "\n String dbUser = \"root\";\n String dbPass = \"root1234\";\n \n public Connection getConnection() {\n ",
"end": 337,
"score": 0.9994543790817261,
"start": 329,
"tag": "PASSWORD",
"value": "root1234"
}
] | null |
[] |
package Config;
import java.sql.Connection;
import java.sql.DriverManager;
/**
*
* @author mahmoudgabr
*/
public class DBConnection {
Connection connection = null;
String driver = "com.mysql.jdbc.Driver";
String url = "jdbc:mysql://localhost:3306/java_test";
String dbUser = "root";
String dbPass = "<PASSWORD>";
public Connection getConnection() {
try {
Class.forName(driver);
connection = DriverManager.getConnection(url, dbUser, dbPass);
} catch (Exception ex) {
System.out.println("Exception: " + ex.getMessage());
}
return connection;
}
}
| 677 | 0.594074 | 0.582222 | 29 | 22.275862 | 19.532284 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.482759 | false | false |
7
|
b45fc56b02a712b58ae890228942bc0c4c17a714
| 11,381,663,388,238 |
10fb2898529dce0dfdb812b6619627dfde1d7663
|
/clinicaparcia2paieam/Clinica_WEB/JavaSource/edu/eam/clinica/web/bean/medico/Inicio_Medico_Bean.java
|
ef78b0e63150cd32ff81162ca3b96cbbd3fbdbe8
|
[] |
no_license
|
miguelmeca/clinicaparcia2paieam
|
https://github.com/miguelmeca/clinicaparcia2paieam
|
062b6b49dc53a99f0bde8cfdc233f78e6d241770
|
5ebd5b3afdb91af8be0c4bfa313177e257e0ea77
|
refs/heads/master
| 2021-01-10T06:31:09.096000 | 2012-05-07T12:40:08 | 2012-05-07T12:40:08 | 46,895,889 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package edu.eam.clinica.web.bean.medico;
import javax.persistence.EntityManager;
import edu.eam.clinica.jpa.entidades.Persona;
public class Inicio_Medico_Bean {
public EntityManager em;
public Persona persona;
public String login;
public String password;
public Inicio_Medico_Bean() {
/*falta inicializar el FactoryEntityManager*/
}
public String iniciarSesion(){
return null;
}
}
|
UTF-8
|
Java
| 430 |
java
|
Inicio_Medico_Bean.java
|
Java
|
[] | null |
[] |
package edu.eam.clinica.web.bean.medico;
import javax.persistence.EntityManager;
import edu.eam.clinica.jpa.entidades.Persona;
public class Inicio_Medico_Bean {
public EntityManager em;
public Persona persona;
public String login;
public String password;
public Inicio_Medico_Bean() {
/*falta inicializar el FactoryEntityManager*/
}
public String iniciarSesion(){
return null;
}
}
| 430 | 0.711628 | 0.711628 | 24 | 15.916667 | 16.648115 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
7
|
c6d862eee6462f0df03f092c267f17ce38abf51e
| 18,631,568,196,748 |
a042f8b0e67943acec6ff725a8031ea81f034044
|
/src/main/java/com/czerwo/reworktracking/ftrot/roles/leadEngineer/TaskDto.java
|
dadd7083dd7f44c02fde6b9d5455ebae1e67d448
|
[] |
no_license
|
Czerwo93/FTROT2
|
https://github.com/Czerwo93/FTROT2
|
8971238fccf391446efce7a557b3825e2035da69
|
4aa374427304f4b20ca6e83106d3179b5300dfcc
|
refs/heads/master
| 2023-03-12T17:16:38.329000 | 2021-03-21T19:43:27 | 2021-03-21T19:43:27 | 309,162,950 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.czerwo.reworktracking.ftrot.roles.leadEngineer;
class TaskDto {
private Long id;
private String name;
private String description;
private double duration;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public double getDuration() {
return duration;
}
public void setDuration(double duration) {
this.duration = duration;
}
}
|
UTF-8
|
Java
| 757 |
java
|
TaskDto.java
|
Java
|
[] | null |
[] |
package com.czerwo.reworktracking.ftrot.roles.leadEngineer;
class TaskDto {
private Long id;
private String name;
private String description;
private double duration;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public double getDuration() {
return duration;
}
public void setDuration(double duration) {
this.duration = duration;
}
}
| 757 | 0.608983 | 0.608983 | 41 | 17.463415 | 16.355946 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.317073 | false | false |
7
|
e23bc4496142e122f094ece7c05cde67fecb4809
| 34,857,954,607,340 |
39a4aa06b27f845d971e7088c082e39ba6d5c2d1
|
/src/main/java/com/ayocrazy/easystage/uimeta/MetaMethod.java
|
7c5de55f2dde445a9c33ea987e479914cf9388e9
|
[] |
no_license
|
KirinHorse/EasyStage
|
https://github.com/KirinHorse/EasyStage
|
3fcc7bd8d0b86e7df1be974f153f49b3b2a177e2
|
322a4fb51f5c81e94503d79324035c7003d543d3
|
refs/heads/master
| 2023-08-19T03:27:00.702000 | 2017-02-10T04:41:35 | 2017-02-10T04:41:35 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ayocrazy.easystage.uimeta;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by 26286 on 2017/1/14.
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface MetaMethod {
String name() default "default";
}
|
UTF-8
|
Java
| 427 |
java
|
MetaMethod.java
|
Java
|
[
{
"context": "t java.lang.annotation.Target;\n\n/**\n * Created by 26286 on 2017/1/14.\n */\n@Inherited\n@Retention(Retention",
"end": 264,
"score": 0.9903250932693481,
"start": 259,
"tag": "USERNAME",
"value": "26286"
}
] | null |
[] |
package com.ayocrazy.easystage.uimeta;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Created by 26286 on 2017/1/14.
*/
@Inherited
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface MetaMethod {
String name() default "default";
}
| 427 | 0.789227 | 0.761124 | 17 | 24.117647 | 16.287428 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.411765 | false | false |
7
|
a0c2452e2e33129a2732e7270df4bb8054727751
| 27,273,042,389,448 |
84a94c4cb77078334d987b424020cc16a56840d5
|
/json-merge-lib/src/test/java/it/traeck/tools/json/merge/JsonMergeTest.java
|
3e71fc5cb3aedffbee8caa6db37d90dab503cc2c
|
[] |
no_license
|
misl/json-merge
|
https://github.com/misl/json-merge
|
dec59ba553b5c8e6d4befbf68b99dc8bf931721a
|
f4b0b9e36b68d25f1195ceae05063da703dfc955
|
refs/heads/master
| 2023-08-20T21:06:21.443000 | 2019-09-24T14:57:31 | 2019-09-24T14:57:31 | 210,563,077 | 2 | 1 | null | false | 2023-08-15T17:41:32 | 2019-09-24T09:24:31 | 2021-12-09T17:34:23 | 2023-08-15T17:41:31 | 27 | 1 | 1 | 4 |
Java
| false | false |
package it.traeck.tools.json.merge;
import org.junit.jupiter.api.Test;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonValue;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Test cases for JsonMerge
*/
public class JsonMergeTest {
@Test
public void testMergeSimpleObjects() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 1 ).build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "b", "b" ).build();
JsonObject jsonObject3 = Json.createObjectBuilder()
.addNull( "c" ).build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2, jsonObject3 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 3 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.getInt( "a" ) ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.getString( "b" ) ).isEqualTo( "b" );
assertThat( mergeObject.containsKey( "c" ) ).isTrue();
assertThat( mergeObject.isNull( "c" ) ).isTrue();
}
@Test
public void testMergeOverlap() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 1 ).build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", "a" )
.add( "b", "b" ).build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 2 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.getString( "a" ) ).isEqualTo( "a" );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.getString( "b" ) ).isEqualTo( "b" );
}
@Test
public void testMergeOverlapArrayOverNumber() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 1 ).build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.add( "b", "b" ).build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 2 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.get( "a" ).getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
assertThat( mergeObject.getJsonArray( "a" ).size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.getString( "b" ) ).isEqualTo( "b" );
}
@Test
public void testMergeObjectInObject() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createObjectBuilder()
.add( "x", 1 )
.add( "z", 3 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createObjectBuilder()
.add( "y", 2 )
.add( "z", 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.get( "a" ).getValueType() ).isEqualTo( JsonArray.ValueType.OBJECT );
JsonObject a = mergeObject.getJsonObject( "a" );
assertThat( a.getInt( "x" ) ).isEqualTo( 1 );
assertThat( a.getInt( "y" ) ).isEqualTo( 2 );
assertThat( a.getInt( "z" ) ).isEqualTo( 4 );
}
@Test
public void testMergeObjectInNotObject() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", "String" )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createObjectBuilder()
.add( "y", 2 )
.add( "z", 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.get( "a" ).getValueType() ).isEqualTo( JsonArray.ValueType.OBJECT );
JsonObject a = mergeObject.getJsonObject( "a" );
assertThat( a.getInt( "y" ) ).isEqualTo( 2 );
assertThat( a.getInt( "z" ) ).isEqualTo( 4 );
}
@Test
public void testMergeObjectInObjectNotPresent() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 3 )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "b", Json.createObjectBuilder()
.add( "y", 2 )
.add( "z", 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 2 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.getInt( "a" ) ).isEqualTo( 3 );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.get( "b" ).getValueType() ).isEqualTo( JsonArray.ValueType.OBJECT );
JsonObject a = mergeObject.getJsonObject( "b" );
assertThat( a.getInt( "y" ) ).isEqualTo( 2 );
assertThat( a.getInt( "z" ) ).isEqualTo( 4 );
}
@Test
public void testMergeArrays() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( "b" )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 1 );
assertThat( jsonArray.getString( 0 ) ).isEqualTo( "b" );
}
@Test
public void testMergeArraysWithNothing() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.addNull()
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isEqualTo( jsonObject1 );
}
@Test
public void testMergeArraysShorterIntoLonger() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.add( 2 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 0 ) ).isEqualTo( 3 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 2 );
}
@Test
public void testMergeArraysLongerIntoShorter() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 2 )
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 0 ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 3 );
}
@Test
public void testMergeObjectsInArray() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createObjectBuilder()
.add( "x", 1 )
.build() )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createObjectBuilder()
.add( "y", 2 )
.build() )
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.OBJECT );
JsonObject element = jsonArray.get( 0 ).asJsonObject();
assertThat( element.size() ).isEqualTo( 2 );
assertThat( element.getInt( "x" ) ).isEqualTo( 1 );
assertThat( element.getInt( "y" ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 3 );
}
@Test
public void testMergeObjectInArrayNotObject() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createObjectBuilder()
.add( "y", 2 )
.build() )
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.OBJECT );
JsonObject element = jsonArray.get( 0 ).asJsonObject();
assertThat( element.size() ).isEqualTo( 1 );
assertThat( element.getInt( "y" ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 3 );
}
@Test
public void testMergeArraysInArray() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createArrayBuilder()
.add( 1 )
.build() )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createArrayBuilder()
.add( 2 )
.add( 3 )
.build() )
.add( 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray subArray = jsonArray.get( 0 ).asJsonArray();
assertThat( subArray.size() ).isEqualTo( 2 );
assertThat( subArray.getInt( 0 ) ).isEqualTo( 2 );
assertThat( subArray.getInt( 1 ) ).isEqualTo( 3 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 4 );
}
@Test
public void testMergeArraysInArrayNotArray() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createArrayBuilder()
.add( 2 )
.build() )
.add( 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray subArray = jsonArray.get( 0 ).asJsonArray();
assertThat( subArray.size() ).isEqualTo( 1 );
assertThat( subArray.getInt( 0 ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 4 );
}
}
|
UTF-8
|
Java
| 14,857 |
java
|
JsonMergeTest.java
|
Java
|
[] | null |
[] |
package it.traeck.tools.json.merge;
import org.junit.jupiter.api.Test;
import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonValue;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Test cases for JsonMerge
*/
public class JsonMergeTest {
@Test
public void testMergeSimpleObjects() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 1 ).build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "b", "b" ).build();
JsonObject jsonObject3 = Json.createObjectBuilder()
.addNull( "c" ).build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2, jsonObject3 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 3 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.getInt( "a" ) ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.getString( "b" ) ).isEqualTo( "b" );
assertThat( mergeObject.containsKey( "c" ) ).isTrue();
assertThat( mergeObject.isNull( "c" ) ).isTrue();
}
@Test
public void testMergeOverlap() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 1 ).build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", "a" )
.add( "b", "b" ).build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 2 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.getString( "a" ) ).isEqualTo( "a" );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.getString( "b" ) ).isEqualTo( "b" );
}
@Test
public void testMergeOverlapArrayOverNumber() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 1 ).build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.add( "b", "b" ).build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 2 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.get( "a" ).getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
assertThat( mergeObject.getJsonArray( "a" ).size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.getString( "b" ) ).isEqualTo( "b" );
}
@Test
public void testMergeObjectInObject() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createObjectBuilder()
.add( "x", 1 )
.add( "z", 3 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createObjectBuilder()
.add( "y", 2 )
.add( "z", 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.get( "a" ).getValueType() ).isEqualTo( JsonArray.ValueType.OBJECT );
JsonObject a = mergeObject.getJsonObject( "a" );
assertThat( a.getInt( "x" ) ).isEqualTo( 1 );
assertThat( a.getInt( "y" ) ).isEqualTo( 2 );
assertThat( a.getInt( "z" ) ).isEqualTo( 4 );
}
@Test
public void testMergeObjectInNotObject() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", "String" )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createObjectBuilder()
.add( "y", 2 )
.add( "z", 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.get( "a" ).getValueType() ).isEqualTo( JsonArray.ValueType.OBJECT );
JsonObject a = mergeObject.getJsonObject( "a" );
assertThat( a.getInt( "y" ) ).isEqualTo( 2 );
assertThat( a.getInt( "z" ) ).isEqualTo( 4 );
}
@Test
public void testMergeObjectInObjectNotPresent() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", 3 )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "b", Json.createObjectBuilder()
.add( "y", 2 )
.add( "z", 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 2 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
assertThat( mergeObject.getInt( "a" ) ).isEqualTo( 3 );
assertThat( mergeObject.containsKey( "b" ) ).isTrue();
assertThat( mergeObject.get( "b" ).getValueType() ).isEqualTo( JsonArray.ValueType.OBJECT );
JsonObject a = mergeObject.getJsonObject( "b" );
assertThat( a.getInt( "y" ) ).isEqualTo( 2 );
assertThat( a.getInt( "z" ) ).isEqualTo( 4 );
}
@Test
public void testMergeArrays() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( "b" )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 1 );
assertThat( jsonArray.getString( 0 ) ).isEqualTo( "b" );
}
@Test
public void testMergeArraysWithNothing() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.addNull()
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isEqualTo( jsonObject1 );
}
@Test
public void testMergeArraysShorterIntoLonger() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.add( 2 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 0 ) ).isEqualTo( 3 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 2 );
}
@Test
public void testMergeArraysLongerIntoShorter() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 2 )
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 0 ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 3 );
}
@Test
public void testMergeObjectsInArray() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createObjectBuilder()
.add( "x", 1 )
.build() )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createObjectBuilder()
.add( "y", 2 )
.build() )
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.OBJECT );
JsonObject element = jsonArray.get( 0 ).asJsonObject();
assertThat( element.size() ).isEqualTo( 2 );
assertThat( element.getInt( "x" ) ).isEqualTo( 1 );
assertThat( element.getInt( "y" ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 3 );
}
@Test
public void testMergeObjectInArrayNotObject() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createObjectBuilder()
.add( "y", 2 )
.build() )
.add( 3 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.OBJECT );
JsonObject element = jsonArray.get( 0 ).asJsonObject();
assertThat( element.size() ).isEqualTo( 1 );
assertThat( element.getInt( "y" ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 3 );
}
@Test
public void testMergeArraysInArray() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createArrayBuilder()
.add( 1 )
.build() )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createArrayBuilder()
.add( 2 )
.add( 3 )
.build() )
.add( 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray subArray = jsonArray.get( 0 ).asJsonArray();
assertThat( subArray.size() ).isEqualTo( 2 );
assertThat( subArray.getInt( 0 ) ).isEqualTo( 2 );
assertThat( subArray.getInt( 1 ) ).isEqualTo( 3 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 4 );
}
@Test
public void testMergeArraysInArrayNotArray() {
// Prepare
JsonObject jsonObject1 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( 1 )
.build() )
.build();
JsonObject jsonObject2 = Json.createObjectBuilder()
.add( "a", Json.createArrayBuilder()
.add( Json.createArrayBuilder()
.add( 2 )
.build() )
.add( 4 )
.build() )
.build();
// Execute
JsonObject mergeObject = JsonMerge.merge( jsonObject1, jsonObject2 );
// Verify
assertThat( mergeObject ).isNotNull();
assertThat( mergeObject.size() ).isEqualTo( 1 );
assertThat( mergeObject.containsKey( "a" ) ).isTrue();
JsonValue jsonValue = mergeObject.get( "a" );
assertThat( jsonValue.getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray jsonArray = jsonValue.asJsonArray();
assertThat( jsonArray.size() ).isEqualTo( 2 );
assertThat( jsonArray.get( 0 ).getValueType() ).isEqualTo( JsonValue.ValueType.ARRAY );
JsonArray subArray = jsonArray.get( 0 ).asJsonArray();
assertThat( subArray.size() ).isEqualTo( 1 );
assertThat( subArray.getInt( 0 ) ).isEqualTo( 2 );
assertThat( jsonArray.getInt( 1 ) ).isEqualTo( 4 );
}
}
| 14,857 | 0.612977 | 0.60214 | 425 | 33.957645 | 23.585102 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.536471 | false | false |
7
|
b6e09c5cd0d6f9f7843442b24227515e74c41097
| 33,964,601,414,727 |
2f27880a638fd76c0d20cb8042220d6d1dcc7288
|
/Dynamic Programming practice/BinomialCoefficient.java
|
5f54053f2379167bea239978dfdf43c6376ed0fb
|
[] |
no_license
|
anujabawaskar/CompetitiveProgramming-LeetCode
|
https://github.com/anujabawaskar/CompetitiveProgramming-LeetCode
|
d064962e515936db32c75cf80a0e6e89d290b7df
|
8bd46a4dea14ad6acb77b3a1d0dfe27b31878c5b
|
refs/heads/master
| 2020-03-18T22:13:20.717000 | 2018-07-31T04:53:48 | 2018-07-31T04:53:48 | 135,332,838 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
class BinomialCoefficient
{
// Returns value of Binomial Coefficient C(n, k)
static int binomialCoeff(int n, int k)
{
int dp[][] = new int[n + 1][k + 1];
for(int i = 0; i<= n; i++) {
for(int j = 0; j <= min(i, k); j++) {
if(j == 0 || i == j)
dp[i][j] = 1;
else
dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
}
}
return dp[n][k];
}
// A utility function to return minimum of two integers
static int min(int a, int b)
{
return (a<b)? a: b;
}
/* Driver program to test above function*/
public static void main(String args[])
{
int n = 5, k = 2;
System.out.println("Value of C("+n+","+k+") is "+binomialCoeff(n, k));
}
}
/*This code is contributed by Rajat Mishra*/
|
UTF-8
|
Java
| 736 |
java
|
BinomialCoefficient.java
|
Java
|
[
{
"context": "alCoeff(n, k));\n\t}\n}\n/*This code is contributed by Rajat Mishra*/\n",
"end": 733,
"score": 0.9998862147331238,
"start": 721,
"tag": "NAME",
"value": "Rajat Mishra"
}
] | null |
[] |
class BinomialCoefficient
{
// Returns value of Binomial Coefficient C(n, k)
static int binomialCoeff(int n, int k)
{
int dp[][] = new int[n + 1][k + 1];
for(int i = 0; i<= n; i++) {
for(int j = 0; j <= min(i, k); j++) {
if(j == 0 || i == j)
dp[i][j] = 1;
else
dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];
}
}
return dp[n][k];
}
// A utility function to return minimum of two integers
static int min(int a, int b)
{
return (a<b)? a: b;
}
/* Driver program to test above function*/
public static void main(String args[])
{
int n = 5, k = 2;
System.out.println("Value of C("+n+","+k+") is "+binomialCoeff(n, k));
}
}
/*This code is contributed by <NAME>*/
| 730 | 0.53125 | 0.516304 | 31 | 22.709677 | 20.261505 | 71 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.451613 | false | false |
7
|
37a1c7045380587ce5f2b321e9228ac68364d158
| 34,531,537,104,946 |
305f19098f4fb4ed0f2a3f47537371dbe037691a
|
/28th Nov, 2019/newpractice.java
|
d71a2d232635b1c18a5cd14fd7dd4187eb7d7986
|
[] |
no_license
|
vizhanix/broadwayjava
|
https://github.com/vizhanix/broadwayjava
|
990de534416cb6b86327ae33741544f531600bdc
|
f5b543e976fcbe44e2292eebf7cc05d67bddac0a
|
refs/heads/master
| 2020-09-21T01:25:12.513000 | 2019-12-06T10:39:44 | 2019-12-06T10:39:44 | 224,639,618 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
class Practice {
public static void main(String[] args) {
// --------- Escape Sequences codes ----------
/*
* System.out.println("Hello \nWorld \nBanana \nApple \nMango");
* System.out.println("---------------------");
* System.out.println("Hello \tWorld \tBanana \tApple \tMango");
* System.out.println("---------------------"); System.out.
* println("Hello \n\tWorld \n\t\tBanana \n\t\t\tApple \n\t\t\t\tMango");
* System.out.println("---------------------");
* System.out.println("Author of this book is \'Mixon Tandukar\' ");
* System.out.println("---------------------");
* System.out.println("Author of this book is \"Mixon Tandukar\"");
* System.out.println("---------------------");
* System.out.println("Author of this book is \\Mixon Tandukar\\");
*/
}
}
|
UTF-8
|
Java
| 845 |
java
|
newpractice.java
|
Java
|
[
{
"context": " * System.out.println(\"Author of this book is \\'Mixon Tandukar\\' \");\n * System.out.println(\"----------------",
"end": 569,
"score": 0.9998440742492676,
"start": 555,
"tag": "NAME",
"value": "Mixon Tandukar"
},
{
"context": " * System.out.println(\"Author of this book is \\\"Mixon Tandukar\\\"\");\n * System.out.println(\"-----------------",
"end": 694,
"score": 0.9998494982719421,
"start": 680,
"tag": "NAME",
"value": "Mixon Tandukar"
},
{
"context": " * System.out.println(\"Author of this book is \\\\Mixon Tandukar\\\\\");\n */\n\n \n\n }\n}",
"end": 818,
"score": 0.9998412132263184,
"start": 804,
"tag": "NAME",
"value": "Mixon Tandukar"
}
] | null |
[] |
class Practice {
public static void main(String[] args) {
// --------- Escape Sequences codes ----------
/*
* System.out.println("Hello \nWorld \nBanana \nApple \nMango");
* System.out.println("---------------------");
* System.out.println("Hello \tWorld \tBanana \tApple \tMango");
* System.out.println("---------------------"); System.out.
* println("Hello \n\tWorld \n\t\tBanana \n\t\t\tApple \n\t\t\t\tMango");
* System.out.println("---------------------");
* System.out.println("Author of this book is \'<NAME>\' ");
* System.out.println("---------------------");
* System.out.println("Author of this book is \"<NAME>\"");
* System.out.println("---------------------");
* System.out.println("Author of this book is \\<NAME>\\");
*/
}
}
| 821 | 0.511243 | 0.511243 | 22 | 37.454544 | 29.071585 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
7
|
5df1cc09f6b9b07da81ee1c35bcc1ad4c8ac9134
| 38,611,756,000,768 |
5b148f56ba5ab6af745c7c43f25afd541b8cb29f
|
/JAVA2/src/pk702/StBufferTest.java
|
fb9d58d287e6d2960d134a1b9f37888be9820aee
|
[] |
no_license
|
YOOHW/JAVA2
|
https://github.com/YOOHW/JAVA2
|
07da74df1211e0bcc70f5c3386c59f86df8d2415
|
9ac3cbbad150dd5d92e7092f6ce36b63995f699a
|
refs/heads/master
| 2022-11-06T13:36:29.939000 | 2020-07-02T10:06:57 | 2020-07-02T10:06:57 | 276,599,445 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package pk702;
//
//
public class StBufferTest {
public static void main(String[] args) {
// 한번 생성된 String 값은 불변
// String -> 고정
// StringBuffer -> 동기화 제공
// StringBuilder -> 동기화 제공 x
// 동기화 ==> 순서(멀티스레드) / 단점 : 임계구역
StringBuffer buf=new StringBuffer("Nice Day! ");
System.out.println(buf.toString()); // toString 바로 쓰기 가능
System.out.println(buf.length()); // 문자열의 크기
System.out.println(buf.capacity()); // 용량
buf.ensureCapacity(100); //용량 크기 증가
System.out.println(buf.capacity()); // 확인해보면 100 나옴
buf.insert(0, "Hi! ");
buf.insert(14, "Everybody^^");
System.out.println(buf);
buf.delete(0, 4);
System.out.println(buf);
// StringBuffer : 다만 동기화 제공함. 단일 스레드에서는 적합하지 않다
}
}
|
UHC
|
Java
| 960 |
java
|
StBufferTest.java
|
Java
|
[] | null |
[] |
package pk702;
//
//
public class StBufferTest {
public static void main(String[] args) {
// 한번 생성된 String 값은 불변
// String -> 고정
// StringBuffer -> 동기화 제공
// StringBuilder -> 동기화 제공 x
// 동기화 ==> 순서(멀티스레드) / 단점 : 임계구역
StringBuffer buf=new StringBuffer("Nice Day! ");
System.out.println(buf.toString()); // toString 바로 쓰기 가능
System.out.println(buf.length()); // 문자열의 크기
System.out.println(buf.capacity()); // 용량
buf.ensureCapacity(100); //용량 크기 증가
System.out.println(buf.capacity()); // 확인해보면 100 나옴
buf.insert(0, "Hi! ");
buf.insert(14, "Everybody^^");
System.out.println(buf);
buf.delete(0, 4);
System.out.println(buf);
// StringBuffer : 다만 동기화 제공함. 단일 스레드에서는 적합하지 않다
}
}
| 960 | 0.57868 | 0.560914 | 41 | 17.219513 | 18.269676 | 58 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.878049 | false | false |
7
|
79fd8dd4c7eaeda6966caf7dbabdd4e30ec8d01b
| 5,222,680,299,409 |
7a9b86ca7ad2d22a503f0189c441031e19f02bd3
|
/restaurante-mascotas/dominio/src/test/java/com/ceiba/reserva/servicio/ServicioMostrarReservaTest.java
|
c12deb4bd352aa98991ae0333d6481251dc57872
|
[] |
no_license
|
mauriciovargasCeiba/RestauranteMascotas
|
https://github.com/mauriciovargasCeiba/RestauranteMascotas
|
1659c94658bb3fbffe9005c479383dce721966cb
|
d96e200e06f2e7bb584a378c459070993c8c348b
|
refs/heads/master
| 2023-02-12T10:55:43.948000 | 2021-01-08T13:45:10 | 2021-01-08T13:45:10 | 324,142,026 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ceiba.reserva.servicio;
import com.ceiba.BasePrueba;
import com.ceiba.reserva.excepcion.ExcepcionReservaInexistente;
import com.ceiba.reserva.modelo.dto.DtoReserva;
import com.ceiba.reserva.puerto.dao.DaoReserva;
import com.ceiba.reserva.servicio.testdatabuilder.DtoReservaTestDataBuilder;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.*;
public class ServicioMostrarReservaTest {
private ServicioMostrarReserva servicioMostrarReserva;
private DaoReserva daoReserva;
@Before
public void inicializar() {
daoReserva = mock(DaoReserva.class);
servicioMostrarReserva = new ServicioMostrarReserva(daoReserva);
}
@Test
public void ejecutar() {
// arrange
DtoReserva dtoReserva = new DtoReservaTestDataBuilder().build();
when(daoReserva.existe(anyString())).thenReturn(true);
when(daoReserva.mostrar(anyString())).thenReturn(dtoReserva);
// act - assert
Assert.assertEquals("123_1234", servicioMostrarReserva.ejecutar("123_1234").getCodigoGenerado());
}
@Test
public void ejecutarConReservaInexistente() {
// arrange
String codigoGenerado = "123_9999";
when(daoReserva.existe(codigoGenerado)).thenReturn(false);
// act - assert
BasePrueba.assertThrows(
() -> servicioMostrarReserva.ejecutar(codigoGenerado),
ExcepcionReservaInexistente.class,
"La reserva con código 123_9999 no existe en el sistema"
);
}
}
|
UTF-8
|
Java
| 1,588 |
java
|
ServicioMostrarReservaTest.java
|
Java
|
[] | null |
[] |
package com.ceiba.reserva.servicio;
import com.ceiba.BasePrueba;
import com.ceiba.reserva.excepcion.ExcepcionReservaInexistente;
import com.ceiba.reserva.modelo.dto.DtoReserva;
import com.ceiba.reserva.puerto.dao.DaoReserva;
import com.ceiba.reserva.servicio.testdatabuilder.DtoReservaTestDataBuilder;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import static org.mockito.Mockito.*;
public class ServicioMostrarReservaTest {
private ServicioMostrarReserva servicioMostrarReserva;
private DaoReserva daoReserva;
@Before
public void inicializar() {
daoReserva = mock(DaoReserva.class);
servicioMostrarReserva = new ServicioMostrarReserva(daoReserva);
}
@Test
public void ejecutar() {
// arrange
DtoReserva dtoReserva = new DtoReservaTestDataBuilder().build();
when(daoReserva.existe(anyString())).thenReturn(true);
when(daoReserva.mostrar(anyString())).thenReturn(dtoReserva);
// act - assert
Assert.assertEquals("123_1234", servicioMostrarReserva.ejecutar("123_1234").getCodigoGenerado());
}
@Test
public void ejecutarConReservaInexistente() {
// arrange
String codigoGenerado = "123_9999";
when(daoReserva.existe(codigoGenerado)).thenReturn(false);
// act - assert
BasePrueba.assertThrows(
() -> servicioMostrarReserva.ejecutar(codigoGenerado),
ExcepcionReservaInexistente.class,
"La reserva con código 123_9999 no existe en el sistema"
);
}
}
| 1,588 | 0.702583 | 0.68494 | 50 | 30.74 | 26.87587 | 105 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.48 | false | false |
7
|
be441aadf22013d50b583a635ab5720a803baf90
| 35,527,969,509,187 |
0480329d409ee6cf45427d2447c212a4964c6c92
|
/app/src/main/java/com/example/devicetestingapplication/ftpserver/FTPservice.java
|
8bbc1b31854db0125bd1ba2176f44ac7260fbbb5
|
[] |
no_license
|
DoChEnGzZ/DeviceTestingApplication
|
https://github.com/DoChEnGzZ/DeviceTestingApplication
|
8e16e5bbbc3a53f10b0e4f7ba5a8b2e0e3677ff7
|
4f361701c8b017c9665e63e272c9796294ab624a
|
refs/heads/main
| 2023-08-02T20:01:06.200000 | 2021-09-23T07:46:24 | 2021-09-23T07:46:24 | 355,461,426 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.devicetestingapplication.ftpserver;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;
import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.FtpServerFactory;
import org.apache.ftpserver.ftplet.Authority;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.listener.ListenerFactory;
import org.apache.ftpserver.usermanager.impl.BaseUser;
import org.apache.ftpserver.usermanager.impl.WritePermission;
import androidx.annotation.Nullable;
import com.example.devicetestingapplication.R;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class FTPservice extends Service {
private FtpServer ftpServer;
private static final String username="root";
private static final String password="123456";
private static final String tag="ftpserver test";
private static final String CHANNEL_ID_STRING="1";
private static final String CHANEL_NAME = "channel_name_1";
private String boot;
private int port=2021;
@Override
public void onCreate() {
super.onCreate();
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
NotificationManager notificationManager = (NotificationManager) getSystemService(this.NOTIFICATION_SERVICE);
NotificationChannel channel = null;
channel = new NotificationChannel(CHANNEL_ID_STRING,CHANEL_NAME,NotificationManager.IMPORTANCE_HIGH);
notificationManager.createNotificationChannel(channel);
Notification notification = new Notification.Builder(getApplicationContext(), CHANNEL_ID_STRING).build();
startForeground(1, notification);
}
boot= Environment.getExternalStorageDirectory().getAbsolutePath()+"/ftpboot";
File file=new File(boot);
if(!file.exists())
{
Log.d(tag,"ftp boot dont existed");
if(!file.mkdirs()){
Log.d(tag,"ftp boot has been existed");
}
}
else
Log.d(tag,"ftp boot has been existed");
try {
initserver();
if(!ftpServer.isStopped())
{
Log.d(tag,"ftp server has been started");
}
} catch (FtpException e) {
Log.d(tag,e.getMessage());
e.printStackTrace();
}
}
@Override
public void onDestroy() {
super.onDestroy();
stopftp();
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
private void initserver() throws FtpException{
stopftp();
startftp();
}
private void startftp() throws FtpException{
FtpServerFactory serverFactory=new FtpServerFactory();
BaseUser baseUser=new BaseUser();
baseUser.setName(username);
baseUser.setPassword(password);
baseUser.setHomeDirectory(boot);
List<Authority> authorities = new ArrayList<Authority>();
authorities.add(new WritePermission());
baseUser.setAuthorities(authorities);
serverFactory.getUserManager().save(baseUser);
ListenerFactory factory = new ListenerFactory();
factory.setPort(port);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
ftpServer.start();
Log.d(tag,"file dir is"+boot);
}
private void stopftp(){
if(ftpServer!=null&&!ftpServer.isStopped()){
ftpServer.stop();
ftpServer=null;
}
}
}
|
UTF-8
|
Java
| 3,759 |
java
|
FTPservice.java
|
Java
|
[
{
"context": "Server;\n private static final String username=\"root\";\n private static final String password=\"12345",
"end": 946,
"score": 0.9038662910461426,
"start": 942,
"tag": "USERNAME",
"value": "root"
},
{
"context": "\"root\";\n private static final String password=\"123456\";\n private static final String tag=\"ftpserver ",
"end": 997,
"score": 0.999245822429657,
"start": 991,
"tag": "PASSWORD",
"value": "123456"
},
{
"context": "baseUser=new BaseUser();\n baseUser.setName(username);\n baseUser.setPassword(password);\n ",
"end": 3020,
"score": 0.9996432065963745,
"start": 3012,
"tag": "USERNAME",
"value": "username"
},
{
"context": "r.setName(username);\n baseUser.setPassword(password);\n baseUser.setHomeDirectory(boot);\n ",
"end": 3060,
"score": 0.9991154074668884,
"start": 3052,
"tag": "PASSWORD",
"value": "password"
}
] | null |
[] |
package com.example.devicetestingapplication.ftpserver;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Intent;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;
import org.apache.ftpserver.FtpServer;
import org.apache.ftpserver.FtpServerFactory;
import org.apache.ftpserver.ftplet.Authority;
import org.apache.ftpserver.ftplet.FtpException;
import org.apache.ftpserver.listener.ListenerFactory;
import org.apache.ftpserver.usermanager.impl.BaseUser;
import org.apache.ftpserver.usermanager.impl.WritePermission;
import androidx.annotation.Nullable;
import com.example.devicetestingapplication.R;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class FTPservice extends Service {
private FtpServer ftpServer;
private static final String username="root";
private static final String password="<PASSWORD>";
private static final String tag="ftpserver test";
private static final String CHANNEL_ID_STRING="1";
private static final String CHANEL_NAME = "channel_name_1";
private String boot;
private int port=2021;
@Override
public void onCreate() {
super.onCreate();
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
NotificationManager notificationManager = (NotificationManager) getSystemService(this.NOTIFICATION_SERVICE);
NotificationChannel channel = null;
channel = new NotificationChannel(CHANNEL_ID_STRING,CHANEL_NAME,NotificationManager.IMPORTANCE_HIGH);
notificationManager.createNotificationChannel(channel);
Notification notification = new Notification.Builder(getApplicationContext(), CHANNEL_ID_STRING).build();
startForeground(1, notification);
}
boot= Environment.getExternalStorageDirectory().getAbsolutePath()+"/ftpboot";
File file=new File(boot);
if(!file.exists())
{
Log.d(tag,"ftp boot dont existed");
if(!file.mkdirs()){
Log.d(tag,"ftp boot has been existed");
}
}
else
Log.d(tag,"ftp boot has been existed");
try {
initserver();
if(!ftpServer.isStopped())
{
Log.d(tag,"ftp server has been started");
}
} catch (FtpException e) {
Log.d(tag,e.getMessage());
e.printStackTrace();
}
}
@Override
public void onDestroy() {
super.onDestroy();
stopftp();
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
private void initserver() throws FtpException{
stopftp();
startftp();
}
private void startftp() throws FtpException{
FtpServerFactory serverFactory=new FtpServerFactory();
BaseUser baseUser=new BaseUser();
baseUser.setName(username);
baseUser.setPassword(<PASSWORD>);
baseUser.setHomeDirectory(boot);
List<Authority> authorities = new ArrayList<Authority>();
authorities.add(new WritePermission());
baseUser.setAuthorities(authorities);
serverFactory.getUserManager().save(baseUser);
ListenerFactory factory = new ListenerFactory();
factory.setPort(port);
serverFactory.addListener("default", factory.createListener());
ftpServer = serverFactory.createServer();
ftpServer.start();
Log.d(tag,"file dir is"+boot);
}
private void stopftp(){
if(ftpServer!=null&&!ftpServer.isStopped()){
ftpServer.stop();
ftpServer=null;
}
}
}
| 3,765 | 0.671987 | 0.668529 | 115 | 31.686956 | 24.2108 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.678261 | false | false |
7
|
1981cb0e8701abe29ae12157f2d35089dd5f0850
| 39,479,339,410,334 |
802e0746e31a7f6b4805f4512c74266f9351a04f
|
/src/main/java/com/app/goalbet/models/ModelApiResponse.java
|
b93fb5f4cd0acbabce4f554f23de1a36ce3ca777
|
[] |
no_license
|
dhyanmohandas/goal-bet-api
|
https://github.com/dhyanmohandas/goal-bet-api
|
7a87836ea419be5abbaf333fcd5d08945edad103
|
074a05284fb00a2cd54c3f20d3c5df621fa1f7b0
|
refs/heads/main
| 2023-06-01T07:53:40.287000 | 2021-06-13T19:04:53 | 2021-06-13T19:04:53 | 371,756,271 | 0 | 0 | null | false | 2021-06-13T19:04:54 | 2021-05-28T16:15:07 | 2021-06-12T18:05:27 | 2021-06-13T19:04:53 | 144 | 0 | 0 | 0 |
Java
| false | false |
package com.app.goalbet.models;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* ModelApiResponse
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2021-06-13T17:47:34.066280200+05:30[Asia/Calcutta]")
public class ModelApiResponse {
@JsonProperty("status")
private Integer status = null;
@JsonProperty("data")
private Object data = null;
public ModelApiResponse status(Integer status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@ApiModelProperty(value = "")
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public ModelApiResponse data(Object data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
**/
@ApiModelProperty(value = "")
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.status, _apiResponse.status) &&
Objects.equals(this.data, _apiResponse.data);
}
@Override
public int hashCode() {
return Objects.hash(status, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
UTF-8
|
Java
| 2,379 |
java
|
ModelApiResponse.java
|
Java
|
[] | null |
[] |
package com.app.goalbet.models;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* ModelApiResponse
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.SpringCodegen", date = "2021-06-13T17:47:34.066280200+05:30[Asia/Calcutta]")
public class ModelApiResponse {
@JsonProperty("status")
private Integer status = null;
@JsonProperty("data")
private Object data = null;
public ModelApiResponse status(Integer status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@ApiModelProperty(value = "")
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public ModelApiResponse data(Object data) {
this.data = data;
return this;
}
/**
* Get data
* @return data
**/
@ApiModelProperty(value = "")
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ModelApiResponse _apiResponse = (ModelApiResponse) o;
return Objects.equals(this.status, _apiResponse.status) &&
Objects.equals(this.data, _apiResponse.data);
}
@Override
public int hashCode() {
return Objects.hash(status, data);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ModelApiResponse {\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" data: ").append(toIndentedString(data)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| 2,379 | 0.660361 | 0.648171 | 102 | 22.32353 | 23.465101 | 151 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.382353 | false | false |
7
|
738c57173c637e590d1ba18d1ec420088e1eda6f
| 39,625,368,298,984 |
87a0fdfbfade71e5df65d11c307a15256e136d48
|
/Norbert Jambor/AddressBook_EJB/AddressBook_EJB_Server/ejbModule/addressbook/model/Contact.java
|
3cbfe5a7729a8f6f6515bee2c8846d8e443c7c5d
|
[] |
no_license
|
irems-internship-2020/projects
|
https://github.com/irems-internship-2020/projects
|
eceda4b36ef2786866b66a96554c30a50b014778
|
e1071da9a1f5d1be064f9d4565c5b3bed81a71b4
|
refs/heads/master
| 2022-12-09T09:48:53.131000 | 2020-09-09T08:06:41 | 2020-09-09T08:06:41 | 281,327,791 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package addressbook.model;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
@SuppressWarnings("serial")
@Entity
@Table(name="contact")
public class Contact extends BaseEntity{
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "phone_number")
private String phoneNumber;
private String email;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "address_fk", referencedColumnName = "Id")
private Address address;
@Transient
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
public Contact() {
}
public Contact(Integer id, String firstName, String lastName, Address address, String phoneNumber, String email) {
super(id);
this.firstName = firstName;
this.lastName = lastName;
this.address = address;
this.phoneNumber = phoneNumber;
this.email = email;
}
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.removePropertyChangeListener(listener);
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Address getAddress() {
return address;
}
public String getPhoneNumber() {
return phoneNumber;
}
public String getEmail() {
return email;
}
public void setFirstName(String firstName) {
propertyChangeSupport.firePropertyChange("firstName", this.firstName, this.firstName = firstName);
}
public void setLastName(String lastName) {
propertyChangeSupport.firePropertyChange("lastName", this.lastName, this.lastName = lastName);
}
public void setAddress(Address address) {
propertyChangeSupport.firePropertyChange("address", this.address, this.address = address);
}
public void setPhoneNumber(String phoneNumber) {
propertyChangeSupport.firePropertyChange("married", this.phoneNumber, this.phoneNumber = phoneNumber);
}
public void setEmail(String email) {
propertyChangeSupport.firePropertyChange("married", this.email, this.email = email);
}
}
|
UTF-8
|
Java
| 2,502 |
java
|
Contact.java
|
Java
|
[
{
"context": "Contact() {\n\t}\n\n\tpublic Contact(Integer id, String firstName, String lastName, Address address, String phoneNu",
"end": 957,
"score": 0.8853411078453064,
"start": 948,
"tag": "NAME",
"value": "firstName"
},
{
"context": "ublic Contact(Integer id, String firstName, String lastName, Address address, String phoneNumber, String emai",
"end": 974,
"score": 0.9193909168243408,
"start": 966,
"tag": "NAME",
"value": "lastName"
},
{
"context": "r, String email) {\n\t\tsuper(id);\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.address = add",
"end": 1070,
"score": 0.9898064136505127,
"start": 1061,
"tag": "NAME",
"value": "firstName"
},
{
"context": ");\n\t\tthis.firstName = firstName;\n\t\tthis.lastName = lastName;\n\t\tthis.address = address;\n\t\tthis.phoneNumber = p",
"end": 1098,
"score": 0.9671590924263,
"start": 1090,
"tag": "NAME",
"value": "lastName"
},
{
"context": "yChange(\"lastName\", this.lastName, this.lastName = lastName);\n\t}\n\t\n\tpublic void setAddress(Address address) {",
"end": 2066,
"score": 0.9956433773040771,
"start": 2058,
"tag": "NAME",
"value": "lastName"
}
] | null |
[] |
package addressbook.model;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
@SuppressWarnings("serial")
@Entity
@Table(name="contact")
public class Contact extends BaseEntity{
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Column(name = "phone_number")
private String phoneNumber;
private String email;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "address_fk", referencedColumnName = "Id")
private Address address;
@Transient
private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
public Contact() {
}
public Contact(Integer id, String firstName, String lastName, Address address, String phoneNumber, String email) {
super(id);
this.firstName = firstName;
this.lastName = lastName;
this.address = address;
this.phoneNumber = phoneNumber;
this.email = email;
}
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) {
propertyChangeSupport.addPropertyChangeListener(propertyName, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
propertyChangeSupport.removePropertyChangeListener(listener);
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Address getAddress() {
return address;
}
public String getPhoneNumber() {
return phoneNumber;
}
public String getEmail() {
return email;
}
public void setFirstName(String firstName) {
propertyChangeSupport.firePropertyChange("firstName", this.firstName, this.firstName = firstName);
}
public void setLastName(String lastName) {
propertyChangeSupport.firePropertyChange("lastName", this.lastName, this.lastName = lastName);
}
public void setAddress(Address address) {
propertyChangeSupport.firePropertyChange("address", this.address, this.address = address);
}
public void setPhoneNumber(String phoneNumber) {
propertyChangeSupport.firePropertyChange("married", this.phoneNumber, this.phoneNumber = phoneNumber);
}
public void setEmail(String email) {
propertyChangeSupport.firePropertyChange("married", this.email, this.email = email);
}
}
| 2,502 | 0.779377 | 0.779377 | 92 | 26.206522 | 28.33209 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.434783 | false | false |
7
|
72f305c193b6c0653c82bb7bda52b65a220034a3
| 18,554,258,788,519 |
3d030a2c50b7e3018d4f009c035a30ee212aced7
|
/src/array/Demo03Array.java
|
55b65f270b7f3c0cdf14280316bd47fd0286c0b6
|
[] |
no_license
|
HandH1998/Java_learn
|
https://github.com/HandH1998/Java_learn
|
ef4738cc45c821731175c15045d01dc5d4e15743
|
fdc25778d9b7443a856c24131125c7bba814372d
|
refs/heads/master
| 2023-01-09T06:25:43.971000 | 2020-11-03T06:45:27 | 2020-11-03T06:45:27 | 297,592,226 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package array;
public class Demo03Array {
public static void main(String[] args) {
//省略格式的静态初始化
int[] arrayA={10,20,30};
//静态初始化的标准格式,可以拆分为两个步骤
int[] arrayB;
arrayB=new int[] {22,33,44};
//冬天初始化的标准格式,也可以
int[] arrayC;
arrayC=new int[4];
//静态初始化的省略格式,不能拆成两个步骤
// int[] arrayD;错误!!
// arrayD={3,5};错误!!
}
}
|
UTF-8
|
Java
| 542 |
java
|
Demo03Array.java
|
Java
|
[] | null |
[] |
package array;
public class Demo03Array {
public static void main(String[] args) {
//省略格式的静态初始化
int[] arrayA={10,20,30};
//静态初始化的标准格式,可以拆分为两个步骤
int[] arrayB;
arrayB=new int[] {22,33,44};
//冬天初始化的标准格式,也可以
int[] arrayC;
arrayC=new int[4];
//静态初始化的省略格式,不能拆成两个步骤
// int[] arrayD;错误!!
// arrayD={3,5};错误!!
}
}
| 542 | 0.5225 | 0.48 | 17 | 22.529411 | 11.52551 | 44 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.764706 | false | false |
7
|
50c57fe33500abd99e574f4c91ddea2c0156c393
| 36,352,603,230,648 |
5cff2b9e06c2eed20b4f25d7a6fc69f8e85d91be
|
/src/stacksqueues/priorityqueue/UnorderedMaxPriorityQueue.java
|
63debcafc33409288eebb1a8ae9d4870ab5074b0
|
[] |
no_license
|
lukaszwelnicki/princeton_algorithms
|
https://github.com/lukaszwelnicki/princeton_algorithms
|
5b457e08c42cf10bcb692ad72818b3dac77df191
|
c4601028133d56228316a00a98294c6fda7d5f23
|
refs/heads/master
| 2021-07-12T07:20:23.260000 | 2020-06-26T09:55:17 | 2020-06-26T09:55:17 | 168,420,702 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package stacksqueues.priorityqueue;
import static common.PrimitiveOperations.exch;
import static common.PrimitiveOperations.less;
public class UnorderedMaxPriorityQueue<T extends Comparable<T>> implements MaxPriorityQueue<T> {
private T[] priorityQueue;
private int size;
public UnorderedMaxPriorityQueue(int capacity) {
this.priorityQueue = (T[]) new Comparable[capacity];
}
@Override
public T max() {
return priorityQueue[getMaxIndex()];
}
@Override
public void insert(T key) {
priorityQueue[size++] = key;
}
@Override
public T delete() {
int maxIndex = getMaxIndex();
exch(priorityQueue, maxIndex, size - 1);
return priorityQueue[--size];
}
@Override
public boolean isEmpty() {
return size == 0;
}
@Override
public int size() {
return size;
}
private int getMaxIndex() {
int maxIndex = 0;
for (int i = 1; i < size; i++) {
if (less(priorityQueue[maxIndex], priorityQueue[i])) {
maxIndex = i;
}
}
return maxIndex;
}
}
|
UTF-8
|
Java
| 1,150 |
java
|
UnorderedMaxPriorityQueue.java
|
Java
|
[] | null |
[] |
package stacksqueues.priorityqueue;
import static common.PrimitiveOperations.exch;
import static common.PrimitiveOperations.less;
public class UnorderedMaxPriorityQueue<T extends Comparable<T>> implements MaxPriorityQueue<T> {
private T[] priorityQueue;
private int size;
public UnorderedMaxPriorityQueue(int capacity) {
this.priorityQueue = (T[]) new Comparable[capacity];
}
@Override
public T max() {
return priorityQueue[getMaxIndex()];
}
@Override
public void insert(T key) {
priorityQueue[size++] = key;
}
@Override
public T delete() {
int maxIndex = getMaxIndex();
exch(priorityQueue, maxIndex, size - 1);
return priorityQueue[--size];
}
@Override
public boolean isEmpty() {
return size == 0;
}
@Override
public int size() {
return size;
}
private int getMaxIndex() {
int maxIndex = 0;
for (int i = 1; i < size; i++) {
if (less(priorityQueue[maxIndex], priorityQueue[i])) {
maxIndex = i;
}
}
return maxIndex;
}
}
| 1,150 | 0.595652 | 0.592174 | 52 | 21.115385 | 20.560093 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.403846 | false | false |
7
|
634d91c8a14cee2bba2463c7f9a1e2a8bb6a4bc3
| 38,835,094,336,644 |
c06da748f7a23b7094db22a5f9a3033e92470aee
|
/study-test/src/main/java/com/study/config/ProxyE.java
|
9b5eba240b28b3327bb20d1e7de2df4508a499f0
|
[
"Apache-2.0"
] |
permissive
|
luckymeet/spring-framework-study
|
https://github.com/luckymeet/spring-framework-study
|
5386014426bce0f3abd1c4d8417c06f44d6043c1
|
3cb16fe2dea173a578a0780b8de6329d3a747e94
|
refs/heads/master
| 2022-12-10T06:26:32.300000 | 2020-09-10T07:02:32 | 2020-09-10T07:02:32 | 278,598,585 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.study.config;
//E 通过Enhance的superClass得到
public class ProxyE extends E {
// 包含代理逻辑的对象a通过代理类构造方法传入进来,用cglib的话,这个就是MethodInterceptor
// A a;
// public void setA(A a){
// a = a;
// }
// 遍历E属性和方法得到
@Override
public void targetMethod() {
// System.out.println("-----------------代理逻辑,但是这里一般不会写死,需要外部传入代理逻辑");
// super.targetMethod();
// 一般传入一个对象,而这个对象实现某个接口,实现接口方法完成代理逻辑
// 通过这个对象调用上面接口方法完成代理逻辑
// a --imp I { method m(xx)}--> a.m(xx)
}
}
|
UTF-8
|
Java
| 707 |
java
|
ProxyE.java
|
Java
|
[] | null |
[] |
package com.study.config;
//E 通过Enhance的superClass得到
public class ProxyE extends E {
// 包含代理逻辑的对象a通过代理类构造方法传入进来,用cglib的话,这个就是MethodInterceptor
// A a;
// public void setA(A a){
// a = a;
// }
// 遍历E属性和方法得到
@Override
public void targetMethod() {
// System.out.println("-----------------代理逻辑,但是这里一般不会写死,需要外部传入代理逻辑");
// super.targetMethod();
// 一般传入一个对象,而这个对象实现某个接口,实现接口方法完成代理逻辑
// 通过这个对象调用上面接口方法完成代理逻辑
// a --imp I { method m(xx)}--> a.m(xx)
}
}
| 707 | 0.665944 | 0.665944 | 23 | 19.043478 | 19.02282 | 70 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.130435 | false | false |
7
|
8ecac355a040a014587d0c25e0e8601934db17ed
| 8,237,747,328,020 |
3c2d5e2fa29ada5c54b4431114c84558d1ad2424
|
/lol/app/src/main/java/com/atalayakilli/lol/RestApi/ApiKey.java
|
e24f3f61bf53f9ebb2a72a8ce757ca3880855139
|
[
"MIT"
] |
permissive
|
atalayakilli/LolStats
|
https://github.com/atalayakilli/LolStats
|
e85e61ce5c05499a145b405238e835e77384558f
|
02e14085cc491e965866eecc00d5e6b036f057fb
|
refs/heads/master
| 2020-04-04T15:01:02.214000 | 2018-11-03T20:37:00 | 2018-11-03T20:37:00 | 156,021,796 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.atalayakilli.lol.RestApi;
public class ApiKey {
public static String api_key;
public static String adsBanner;
}
|
UTF-8
|
Java
| 138 |
java
|
ApiKey.java
|
Java
|
[] | null |
[] |
package com.atalayakilli.lol.RestApi;
public class ApiKey {
public static String api_key;
public static String adsBanner;
}
| 138 | 0.724638 | 0.724638 | 10 | 12.7 | 15.849606 | 37 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.3 | false | false |
7
|
6cf050a58fea7d3a2a08fc0249896cb91082be47
| 35,450,660,109,134 |
c3072002124b99ef4758f468e68503ac82032a7f
|
/七大原则/src/依赖倒置/TwoShop.java
|
3f110d0b9930a092f0f1df4461fefdcde8371e26
|
[] |
no_license
|
Frank682/Design_Pattern
|
https://github.com/Frank682/Design_Pattern
|
6596bf7cb9963132501cad19852fcd773216afee
|
d7f44aa8dfdac37777daf2b0a749c5064883979c
|
refs/heads/master
| 2023-04-06T19:29:35.513000 | 2021-04-19T06:06:04 | 2021-04-19T06:06:04 | 264,617,932 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package 依赖倒置;
public class TwoShop implements Shop{
public String sell()
{
return "Two Sell";
}
}
|
UTF-8
|
Java
| 127 |
java
|
TwoShop.java
|
Java
|
[] | null |
[] |
package 依赖倒置;
public class TwoShop implements Shop{
public String sell()
{
return "Two Sell";
}
}
| 127 | 0.605042 | 0.605042 | 8 | 13.875 | 12.751838 | 37 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.25 | false | false |
7
|
7903f342752eda0a638ce3760ab854257b45c9ae
| 32,315,334,005,102 |
e6d11606bdd4df1b35ca79228bfd4244a8d99ca1
|
/src/Model/Entity/Entity.java
|
a618c831427249e15144ce25c75f85031ad6adba
|
[] |
no_license
|
IronicCats/Iteration1
|
https://github.com/IronicCats/Iteration1
|
2b02243f44a49f78e675e4cce1a7a6f27e8bf2c0
|
c55e0c637b69efdb29449a2f6a44ae4f9d5f5a0b
|
refs/heads/master
| 2021-01-10T17:54:54.814000 | 2016-02-08T18:36:28 | 2016-02-08T18:36:28 | 50,787,119 | 1 | 0 | null | false | 2016-02-08T08:16:24 | 2016-01-31T17:55:32 | 2016-02-04T01:40:36 | 2016-02-08T08:16:24 | 1,108 | 1 | 0 | 0 |
Java
| null | null |
package Model.Entity;
import Controller.Controller;
import Model.Entity.Inventory.Equipment.Equipment;
import Model.Entity.Inventory.Inventory;
import Model.Entity.Occupation.Occupation;
import Model.Entity.Occupation.Smasher;
import Model.Entity.Occupation.Sneak;
import Model.Entity.Occupation.Summoner;
import Model.Entity.Inventory.Pack;
import Model.Entity.Stats.Stats;
import Model.Location;
import Model.Map.Tiles.Tile;
import java.awt.*;
/**
* Created by broskj on 1/31/16.
*/
public abstract class Entity {
private Stats stats;
private Occupation occupation;
protected Location location;
private Inventory inventory;
private Nav nav;
private EquipmentStats equipmentStats;
protected float speed;
protected Controller controller;
protected int width, height;
protected Rectangle bounds;
public Entity(Controller controller, Location location, int width, int height, Occupation o, Stats stats) {
this.location = location;
this.controller = controller;
this.width = width;
this.height = height;
this.occupation = o;
this.stats = stats;
this.equipmentStats = null;
this.bounds = new Rectangle(0, 0, width , height);
bounds = new Rectangle(0, 0, width , height);
}
public void initializeEquipmentStats(Equipment equipment) {
this.equipmentStats = new EquipmentStats(equipment, 0, 0, this.stats);
stats.setEquipmentStats(equipmentStats);
equipment.setEquipmentStats(equipmentStats);
equipmentStats.update();
} // end initializeEquipmentStats
public abstract void tick();
public abstract void render(Graphics g);
public float getPixelX() {
return location.getPixelX();
}
public void setX(int x) {
location.setX(x);
}
public float getPixelY() {
return location.getPixelY();
}
public void setY(int y) {
location.setY(y);
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public float getSpeed() {
return speed;
}
public void setSpeed(float speed) {
this.speed = speed;
}
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
public void useItem(){}
public void equipItem(){}
public void uneuquipItem(){}
public void dropItem(){}
public void pause(){}
public void openInventory(){}
public void openMenu(){}
public Stats getStats() { return stats; }
public void setStats(Stats stats){this.stats = stats;}
public Occupation getOccupation() { return occupation; }
}
|
UTF-8
|
Java
| 2,919 |
java
|
Entity.java
|
Java
|
[
{
"context": "Tiles.Tile;\n\nimport java.awt.*;\n\n/**\n * Created by broskj on 1/31/16.\n */\n\npublic abstract class Entity {\n\n",
"end": 473,
"score": 0.9996259808540344,
"start": 467,
"tag": "USERNAME",
"value": "broskj"
}
] | null |
[] |
package Model.Entity;
import Controller.Controller;
import Model.Entity.Inventory.Equipment.Equipment;
import Model.Entity.Inventory.Inventory;
import Model.Entity.Occupation.Occupation;
import Model.Entity.Occupation.Smasher;
import Model.Entity.Occupation.Sneak;
import Model.Entity.Occupation.Summoner;
import Model.Entity.Inventory.Pack;
import Model.Entity.Stats.Stats;
import Model.Location;
import Model.Map.Tiles.Tile;
import java.awt.*;
/**
* Created by broskj on 1/31/16.
*/
public abstract class Entity {
private Stats stats;
private Occupation occupation;
protected Location location;
private Inventory inventory;
private Nav nav;
private EquipmentStats equipmentStats;
protected float speed;
protected Controller controller;
protected int width, height;
protected Rectangle bounds;
public Entity(Controller controller, Location location, int width, int height, Occupation o, Stats stats) {
this.location = location;
this.controller = controller;
this.width = width;
this.height = height;
this.occupation = o;
this.stats = stats;
this.equipmentStats = null;
this.bounds = new Rectangle(0, 0, width , height);
bounds = new Rectangle(0, 0, width , height);
}
public void initializeEquipmentStats(Equipment equipment) {
this.equipmentStats = new EquipmentStats(equipment, 0, 0, this.stats);
stats.setEquipmentStats(equipmentStats);
equipment.setEquipmentStats(equipmentStats);
equipmentStats.update();
} // end initializeEquipmentStats
public abstract void tick();
public abstract void render(Graphics g);
public float getPixelX() {
return location.getPixelX();
}
public void setX(int x) {
location.setX(x);
}
public float getPixelY() {
return location.getPixelY();
}
public void setY(int y) {
location.setY(y);
}
public int getWidth() {
return width;
}
public void setWidth(int width) {
this.width = width;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
public float getSpeed() {
return speed;
}
public void setSpeed(float speed) {
this.speed = speed;
}
public Location getLocation() {
return location;
}
public void setLocation(Location location) {
this.location = location;
}
public void useItem(){}
public void equipItem(){}
public void uneuquipItem(){}
public void dropItem(){}
public void pause(){}
public void openInventory(){}
public void openMenu(){}
public Stats getStats() { return stats; }
public void setStats(Stats stats){this.stats = stats;}
public Occupation getOccupation() { return occupation; }
}
| 2,919 | 0.659815 | 0.656047 | 128 | 21.804688 | 19.818733 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.53125 | false | false |
7
|
397ba62d7476154c068aa7d12b6f7d9acc763d06
| 37,203,006,749,173 |
833726b22126df692f8ca476c33b33a863d07003
|
/home7/src/FloorQueue.java
|
e7914d201beb1399538c4f1d35197a269ba5a82d
|
[] |
no_license
|
darewolf-cyber/BUAA_OO
|
https://github.com/darewolf-cyber/BUAA_OO
|
48ad397dbf2911dcc4ff210e6a6e4c28095cb67d
|
547ae4b8d19a2f83d32c665d67e3a5f805fec5bd
|
refs/heads/master
| 2021-02-12T22:35:11.823000 | 2019-11-21T07:00:23 | 2019-11-21T07:00:23 | 244,638,160 | 7 | 2 | null | true | 2020-03-03T13:05:50 | 2020-03-03T13:05:49 | 2019-12-28T07:05:18 | 2019-11-21T07:00:50 | 63,989 | 0 | 0 | 0 | null | false | false |
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
public class FloorQueue<T> {
private ConcurrentHashMap<Integer,
CopyOnWriteArrayList<T>> queue;
public FloorQueue() {
queue = new ConcurrentHashMap<>();
}
public synchronized void add(int floor,T pr) {
if (queue.containsKey(floor)) {
queue.get(floor).add(pr);
}
else {
CopyOnWriteArrayList<T> l =
new CopyOnWriteArrayList<>();
l.add(pr);
queue.put(floor,l);
}
}
public synchronized void addAll(int floor,
CopyOnWriteArrayList<T> list) {
if (queue.containsKey(floor)) {
queue.get(floor).addAll(list);
}
else {
queue.put(floor,list);
}
}
public synchronized CopyOnWriteArrayList<T> get(int floor) {
return queue.get(floor);
}
public synchronized boolean containsKey(int floor) {
return queue.containsKey(floor);
}
public synchronized void remove(int index) {
queue.remove(index);
}
public synchronized int size() {
return queue.keySet().size();
}
public synchronized boolean isEmpty() {
return queue.isEmpty();
}
public String toString() {
return queue.toString();
}
}
|
UTF-8
|
Java
| 1,410 |
java
|
FloorQueue.java
|
Java
|
[] | null |
[] |
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
public class FloorQueue<T> {
private ConcurrentHashMap<Integer,
CopyOnWriteArrayList<T>> queue;
public FloorQueue() {
queue = new ConcurrentHashMap<>();
}
public synchronized void add(int floor,T pr) {
if (queue.containsKey(floor)) {
queue.get(floor).add(pr);
}
else {
CopyOnWriteArrayList<T> l =
new CopyOnWriteArrayList<>();
l.add(pr);
queue.put(floor,l);
}
}
public synchronized void addAll(int floor,
CopyOnWriteArrayList<T> list) {
if (queue.containsKey(floor)) {
queue.get(floor).addAll(list);
}
else {
queue.put(floor,list);
}
}
public synchronized CopyOnWriteArrayList<T> get(int floor) {
return queue.get(floor);
}
public synchronized boolean containsKey(int floor) {
return queue.containsKey(floor);
}
public synchronized void remove(int index) {
queue.remove(index);
}
public synchronized int size() {
return queue.keySet().size();
}
public synchronized boolean isEmpty() {
return queue.isEmpty();
}
public String toString() {
return queue.toString();
}
}
| 1,410 | 0.571631 | 0.571631 | 57 | 23.736841 | 19.62591 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.368421 | false | false |
7
|
ec4191e17424b224d27c99bda88a5419dd85ae9d
| 4,355,096,903,221 |
65fd435a943a5def1fea41b9cb654622f53cbb88
|
/src/main/java/br/com/casadocodigo/loja/controllers/PedidosServicoController.java
|
1ffec007459d7f7561dc635c5ef5da601c1693b0
|
[] |
no_license
|
flaviosolci/casadocodigo
|
https://github.com/flaviosolci/casadocodigo
|
0f06e399fc718e68a2d0b102eaf388b50e28e0bd
|
44ddbcea2b11d4661af15b9c5e39a5e5d9436661
|
refs/heads/master
| 2020-12-14T14:04:53.556000 | 2020-01-18T23:39:11 | 2020-01-18T23:39:11 | 234,765,841 | 0 | 0 | null | true | 2020-01-18T16:49:16 | 2020-01-18T16:49:15 | 2019-10-24T17:49:34 | 2019-05-07T02:47:37 | 379 | 0 | 0 | 0 | null | false | false |
package br.com.casadocodigo.loja.controllers;
import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.ModelAndView;
import br.com.casadocodigo.loja.models.ExternalOrderResponse;
@Controller
@RequestMapping("/pedidos")
public class PedidosServicoController {
private RestTemplate restTemplate;
@Autowired
public PedidosServicoController(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
@RequestMapping(method = RequestMethod.GET)
public ModelAndView listar() {
String uri = "https://book-payment.herokuapp.com/orders";
List<ExternalOrderResponse> response = Arrays
.asList(restTemplate.getForObject(uri, ExternalOrderResponse[].class));
ModelAndView modelAndView = new ModelAndView("pedidos/pedidos");
modelAndView.addObject("pedidos", response);
return modelAndView;
}
}
|
UTF-8
|
Java
| 1,139 |
java
|
PedidosServicoController.java
|
Java
|
[] | null |
[] |
package br.com.casadocodigo.loja.controllers;
import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.ModelAndView;
import br.com.casadocodigo.loja.models.ExternalOrderResponse;
@Controller
@RequestMapping("/pedidos")
public class PedidosServicoController {
private RestTemplate restTemplate;
@Autowired
public PedidosServicoController(RestTemplate restTemplate) {
this.restTemplate = restTemplate;
}
@RequestMapping(method = RequestMethod.GET)
public ModelAndView listar() {
String uri = "https://book-payment.herokuapp.com/orders";
List<ExternalOrderResponse> response = Arrays
.asList(restTemplate.getForObject(uri, ExternalOrderResponse[].class));
ModelAndView modelAndView = new ModelAndView("pedidos/pedidos");
modelAndView.addObject("pedidos", response);
return modelAndView;
}
}
| 1,139 | 0.812994 | 0.812994 | 36 | 30.638889 | 24.701723 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.166667 | false | false |
7
|
b2af661c5023713a4b064bbba269bdfe2e957d29
| 35,596,688,992,862 |
40e1c0fddefd119fc95900fb311693a32f66fad8
|
/ExerciseSolutions/src/sheet2Methods/Ex1AddAndMultiply.java
|
bdc359c51fbf9a9da8fc324c5bd8ab6938345653
|
[] |
no_license
|
SandraHawkins/Java2017
|
https://github.com/SandraHawkins/Java2017
|
4478176cd76d511ba0a3dce41b72817ba109516b
|
b1e8ad2a6f308493d4b611d8d5fa63a4c8cf4588
|
refs/heads/master
| 2022-01-15T08:42:36.954000 | 2017-09-15T08:31:03 | 2017-09-15T08:31:03 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sheet2Methods;
public class Ex1AddAndMultiply {
public static void main(String [] args) {
Ex1AddAndMultiply ex1 = new Ex1AddAndMultiply();
int a = 10;
int b = 12;
ex1.add(a, b);
ex1.multiply(a, b);
ex1.divide(20, 7);
ex1.subtract(a, b);
ex1.remainder(20, 7);
}
/*
The modulus operator give the remainder after integer division.
*/
public void remainder(int a, int b) {
int result = a % b;
System.out.printf("The remainder of %d %% %d is %d",
a, b, result );
}
public void divide(int a, int b) {
int result = a / b;
System.out.printf("%d divided by %d is %d\n", a, b, result);
}
public void multiply(int num1, int num2) {
System.out.println(num1 + " and " + num2 + " multiplied is " +
(num1 * num2));
}
public void subtract(int a, int b) {
int result;
result = a - b;
System.out.printf("%d minus %d is %d\n", a, b, result);
}
public void add(int a, int b) {
int result;
result = a + b;
System.out.printf("%d and %d added is %d\n", a, b, result);
}
}
|
UTF-8
|
Java
| 1,066 |
java
|
Ex1AddAndMultiply.java
|
Java
|
[] | null |
[] |
package sheet2Methods;
public class Ex1AddAndMultiply {
public static void main(String [] args) {
Ex1AddAndMultiply ex1 = new Ex1AddAndMultiply();
int a = 10;
int b = 12;
ex1.add(a, b);
ex1.multiply(a, b);
ex1.divide(20, 7);
ex1.subtract(a, b);
ex1.remainder(20, 7);
}
/*
The modulus operator give the remainder after integer division.
*/
public void remainder(int a, int b) {
int result = a % b;
System.out.printf("The remainder of %d %% %d is %d",
a, b, result );
}
public void divide(int a, int b) {
int result = a / b;
System.out.printf("%d divided by %d is %d\n", a, b, result);
}
public void multiply(int num1, int num2) {
System.out.println(num1 + " and " + num2 + " multiplied is " +
(num1 * num2));
}
public void subtract(int a, int b) {
int result;
result = a - b;
System.out.printf("%d minus %d is %d\n", a, b, result);
}
public void add(int a, int b) {
int result;
result = a + b;
System.out.printf("%d and %d added is %d\n", a, b, result);
}
}
| 1,066 | 0.590056 | 0.565666 | 47 | 21.702127 | 20.322836 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.276596 | false | false |
7
|
6d8be43ceaf150b1921374fd3a39fe8675a15777
| 34,205,119,603,559 |
31426144c163bae444621e03a9ea824bb4c57739
|
/task-impl/src/test/java/com/chutneytesting/task/micrometer/MicrometerTimerStartTaskTest.java
|
27659ffcb883a3c8d65ddc777172d505dc63e66f
|
[
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-generic-cla",
"QPL-1.0",
"LicenseRef-scancode-free-unknown",
"W3C",
"GPL-1.0-or-later",
"Apache-1.1",
"NPL-1.1",
"BSD-4-Clause",
"NPL-1.0",
"OGL-UK-3.0",
"Python-2.0",
"JSON",
"GPL-1.0-only",
"MIT",
"ICU",
"MS-PL",
"AFL-2.1",
"PostgreSQL",
"Sleepycat",
"LicenseRef-scancode-unicode",
"BSL-1.0",
"LicenseRef-scancode-public-domain",
"CPOL-1.02",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-unknown",
"BSD-2-Clause",
"MS-LPL"
] |
permissive
|
boddissattva/chutney
|
https://github.com/boddissattva/chutney
|
ea1d4b30b304883325ec2a36fa792a374295ce76
|
e7efdd1828ff1ae368c2611240150bd53c59731b
|
refs/heads/master
| 2021-12-07T19:48:26.492000 | 2021-07-28T17:26:22 | 2021-07-28T17:26:22 | 242,990,494 | 0 | 0 |
Apache-2.0
| true | 2021-08-02T16:45:26 | 2020-02-25T12:07:38 | 2021-07-28T19:58:55 | 2021-07-28T19:58:53 | 4,102 | 0 | 0 | 1 |
Java
| false | false |
package com.chutneytesting.task.micrometer;
import static com.chutneytesting.task.micrometer.MicrometerTimerStartTask.OUTPUT_TIMER_SAMPLE;
import static io.micrometer.core.instrument.Metrics.globalRegistry;
import static org.assertj.core.api.Assertions.assertThat;
import com.chutneytesting.task.TestLogger;
import com.chutneytesting.task.spi.TaskExecutionResult;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;
public class MicrometerTimerStartTaskTest extends MicrometerTaskTest {
private MicrometerTimerStartTask sut;
@Test
public void should_start_a_timing_sample() {
// Given
sut = new MicrometerTimerStartTask(new TestLogger(), null);
// When
TaskExecutionResult result = sut.execute();
// Then
assertSuccessAndSampleObjectType(result);
Timer.Sample timerSampleOutput = (Timer.Sample) result.outputs.get(OUTPUT_TIMER_SAMPLE);
assertThat(globalRegistry.getMeters()).isEmpty();
assertThat(meterRegistry.getMeters()).isEmpty();
assertThat(timerSampleOutput).isNotNull();
}
@Test
public void should_start_a_timing_sample_with_a_given_registry() {
// Given
MeterRegistry givenMeterRegistry = new SimpleMeterRegistry();
sut = new MicrometerTimerStartTask(new TestLogger(), givenMeterRegistry);
// When
TaskExecutionResult result = sut.execute();
// Then
assertSuccessAndSampleObjectType(result);
Timer.Sample timerSampleOutput = (Timer.Sample) result.outputs.get(OUTPUT_TIMER_SAMPLE);
assertThat(globalRegistry.getMeters()).isEmpty();
assertThat(meterRegistry.getMeters()).isEmpty();
assertThat(givenMeterRegistry.getMeters()).isEmpty();
assertThat(timerSampleOutput).isNotNull();
}
@Test
public void should_log_timing_sample_start() {
// Given
TestLogger logger = new TestLogger();
sut = new MicrometerTimerStartTask(logger, null);
// When
TaskExecutionResult result = sut.execute();
// Then
assertSuccessAndSampleObjectType(result);
assertThat(logger.info).hasSize(1);
assertThat(logger.info.get(0)).contains("started");
}
private void assertSuccessAndSampleObjectType(TaskExecutionResult result) {
assertSuccessAndOutputObjectType(result, OUTPUT_TIMER_SAMPLE, Timer.Sample.class);
}
}
|
UTF-8
|
Java
| 2,557 |
java
|
MicrometerTimerStartTaskTest.java
|
Java
|
[] | null |
[] |
package com.chutneytesting.task.micrometer;
import static com.chutneytesting.task.micrometer.MicrometerTimerStartTask.OUTPUT_TIMER_SAMPLE;
import static io.micrometer.core.instrument.Metrics.globalRegistry;
import static org.assertj.core.api.Assertions.assertThat;
import com.chutneytesting.task.TestLogger;
import com.chutneytesting.task.spi.TaskExecutionResult;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Timer;
import io.micrometer.core.instrument.simple.SimpleMeterRegistry;
import org.junit.jupiter.api.Test;
public class MicrometerTimerStartTaskTest extends MicrometerTaskTest {
private MicrometerTimerStartTask sut;
@Test
public void should_start_a_timing_sample() {
// Given
sut = new MicrometerTimerStartTask(new TestLogger(), null);
// When
TaskExecutionResult result = sut.execute();
// Then
assertSuccessAndSampleObjectType(result);
Timer.Sample timerSampleOutput = (Timer.Sample) result.outputs.get(OUTPUT_TIMER_SAMPLE);
assertThat(globalRegistry.getMeters()).isEmpty();
assertThat(meterRegistry.getMeters()).isEmpty();
assertThat(timerSampleOutput).isNotNull();
}
@Test
public void should_start_a_timing_sample_with_a_given_registry() {
// Given
MeterRegistry givenMeterRegistry = new SimpleMeterRegistry();
sut = new MicrometerTimerStartTask(new TestLogger(), givenMeterRegistry);
// When
TaskExecutionResult result = sut.execute();
// Then
assertSuccessAndSampleObjectType(result);
Timer.Sample timerSampleOutput = (Timer.Sample) result.outputs.get(OUTPUT_TIMER_SAMPLE);
assertThat(globalRegistry.getMeters()).isEmpty();
assertThat(meterRegistry.getMeters()).isEmpty();
assertThat(givenMeterRegistry.getMeters()).isEmpty();
assertThat(timerSampleOutput).isNotNull();
}
@Test
public void should_log_timing_sample_start() {
// Given
TestLogger logger = new TestLogger();
sut = new MicrometerTimerStartTask(logger, null);
// When
TaskExecutionResult result = sut.execute();
// Then
assertSuccessAndSampleObjectType(result);
assertThat(logger.info).hasSize(1);
assertThat(logger.info.get(0)).contains("started");
}
private void assertSuccessAndSampleObjectType(TaskExecutionResult result) {
assertSuccessAndOutputObjectType(result, OUTPUT_TIMER_SAMPLE, Timer.Sample.class);
}
}
| 2,557 | 0.714509 | 0.713727 | 73 | 34.027397 | 29.335552 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.534247 | false | false |
7
|
af14339b48cc353d50f8d5b2a5cf99dcde07da14
| 39,573,828,705,982 |
0c838c2d82076ea993eb0d6443a4116d3c808bf5
|
/src/main/java/de/uni_koeln/spinfo/crZone/applications/SingleExperimentExecution.java
|
07bce9675b91de0d9752466c2ef7a5f3a3c22bf1
|
[] |
no_license
|
spinfo/jasc
|
https://github.com/spinfo/jasc
|
6550b0035b8eeb6544a68c42907e623eeacc3a5e
|
e6d7f6bb3c0da0a52228e3cf386b708d4c601ea7
|
refs/heads/master
| 2015-08-17T23:52:10.886000 | 2015-08-11T12:10:45 | 2015-08-11T12:10:45 | 27,872,446 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package de.uni_koeln.spinfo.crZone.applications;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.uni_koeln.spinfo.core.data.ClassifyUnit;
import de.uni_koeln.spinfo.core.data.ExperimentConfiguration;
import de.uni_koeln.spinfo.core.data.FeatureUnitConfiguration;
import de.uni_koeln.spinfo.core.distance.Distance;
import de.uni_koeln.spinfo.core.featureEngineering.quantifiers.AbstractFeatureQuantifier;
import de.uni_koeln.spinfo.core.featureEngineering.quantifiers.LogLikeliHoodFeatureQuantifier;
import de.uni_koeln.spinfo.crZone.preprocessing.CRZoneReader;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.SVMClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneAbstractClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneKNNClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneNaiveBayesClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneRocchioClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.data.ExperimentResult;
import de.uni_koeln.spinfo.zoneAnalysis.helpers.SingleToMultiClassConverter;
import de.uni_koeln.spinfo.zoneAnalysis.preprocessing.TrainingDataGenerator;
import de.uni_koeln.spinfo.zoneAnalysis.workflow.ZoneJobs;
import de.uni_koeln.spinfo.zoneAnalysis.workflow.ZoneSingleExperimentExecutor;
public class SingleExperimentExecution {
public static void main(String[] args) throws IOException, ClassNotFoundException{
// CRZoneReader reader = new CRZoneReader();
// File file = new File("CR/data/data.xls");
// List<ClassifyUnit> ccus = reader.getCompFiles(file);
// TrainingDataGenerator tdg = new TrainingDataGenerator(file);
// tdg.writeTrainingDataFile(new File("ZoneCR/data/trainingDataFile.csv"), ccus);
File inputFile = new File("ZoneCR/data/trainingDataFile.csv");
///////////////////////////////////////////////
///////experiment parameters
///////////////////////////////////////////////
File outputFolder = new File("ZoneCR/output/Singleresults");
int k = 1;
boolean ignoreStopwords = true;
boolean normalizeInput = true;
boolean useStemmer = true;
boolean suffixTree = false;
int[] nGrams = {2,3};
int miScoredFeaturesPerClass = 0;
Distance distance = Distance.COSINUS;
ZoneAbstractClassifier classifier = new SVMClassifier();
AbstractFeatureQuantifier quantifier = new LogLikeliHoodFeatureQuantifier();
List<Integer> evaluationCategories = null;
/////////////////////////////////////////////////
//////////END///
////////////////////////////////////////////////
///////////////////NO Translations///////////////////////////////////
ZoneJobs jobs = new ZoneJobs();
FeatureUnitConfiguration fuc = new FeatureUnitConfiguration(
normalizeInput, useStemmer, ignoreStopwords, nGrams,
false, miScoredFeaturesPerClass, suffixTree);
ExperimentConfiguration expConfig = new ExperimentConfiguration(fuc,
quantifier, classifier, inputFile, "ZoneCR/output");
ExperimentResult result = ZoneSingleExperimentExecutor.crossValidate(
expConfig, jobs, inputFile, 5,5,null, false, evaluationCategories);
System.out.println("F Measure: \t" + result.getF1Measure());
System.out.println("Precision: \t" + result.getPrecision());
System.out.println("Recall: \t" + result.getRecall());
System.out.println("Accuracy: \t" + result.getAccuracy());
//store result
jobs.persistExperimentResult(result, outputFolder);
}
}
|
UTF-8
|
Java
| 3,605 |
java
|
SingleExperimentExecution.java
|
Java
|
[] | null |
[] |
package de.uni_koeln.spinfo.crZone.applications;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.uni_koeln.spinfo.core.data.ClassifyUnit;
import de.uni_koeln.spinfo.core.data.ExperimentConfiguration;
import de.uni_koeln.spinfo.core.data.FeatureUnitConfiguration;
import de.uni_koeln.spinfo.core.distance.Distance;
import de.uni_koeln.spinfo.core.featureEngineering.quantifiers.AbstractFeatureQuantifier;
import de.uni_koeln.spinfo.core.featureEngineering.quantifiers.LogLikeliHoodFeatureQuantifier;
import de.uni_koeln.spinfo.crZone.preprocessing.CRZoneReader;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.SVMClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneAbstractClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneKNNClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneNaiveBayesClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.classifier.ZoneRocchioClassifier;
import de.uni_koeln.spinfo.zoneAnalysis.data.ExperimentResult;
import de.uni_koeln.spinfo.zoneAnalysis.helpers.SingleToMultiClassConverter;
import de.uni_koeln.spinfo.zoneAnalysis.preprocessing.TrainingDataGenerator;
import de.uni_koeln.spinfo.zoneAnalysis.workflow.ZoneJobs;
import de.uni_koeln.spinfo.zoneAnalysis.workflow.ZoneSingleExperimentExecutor;
public class SingleExperimentExecution {
public static void main(String[] args) throws IOException, ClassNotFoundException{
// CRZoneReader reader = new CRZoneReader();
// File file = new File("CR/data/data.xls");
// List<ClassifyUnit> ccus = reader.getCompFiles(file);
// TrainingDataGenerator tdg = new TrainingDataGenerator(file);
// tdg.writeTrainingDataFile(new File("ZoneCR/data/trainingDataFile.csv"), ccus);
File inputFile = new File("ZoneCR/data/trainingDataFile.csv");
///////////////////////////////////////////////
///////experiment parameters
///////////////////////////////////////////////
File outputFolder = new File("ZoneCR/output/Singleresults");
int k = 1;
boolean ignoreStopwords = true;
boolean normalizeInput = true;
boolean useStemmer = true;
boolean suffixTree = false;
int[] nGrams = {2,3};
int miScoredFeaturesPerClass = 0;
Distance distance = Distance.COSINUS;
ZoneAbstractClassifier classifier = new SVMClassifier();
AbstractFeatureQuantifier quantifier = new LogLikeliHoodFeatureQuantifier();
List<Integer> evaluationCategories = null;
/////////////////////////////////////////////////
//////////END///
////////////////////////////////////////////////
///////////////////NO Translations///////////////////////////////////
ZoneJobs jobs = new ZoneJobs();
FeatureUnitConfiguration fuc = new FeatureUnitConfiguration(
normalizeInput, useStemmer, ignoreStopwords, nGrams,
false, miScoredFeaturesPerClass, suffixTree);
ExperimentConfiguration expConfig = new ExperimentConfiguration(fuc,
quantifier, classifier, inputFile, "ZoneCR/output");
ExperimentResult result = ZoneSingleExperimentExecutor.crossValidate(
expConfig, jobs, inputFile, 5,5,null, false, evaluationCategories);
System.out.println("F Measure: \t" + result.getF1Measure());
System.out.println("Precision: \t" + result.getPrecision());
System.out.println("Recall: \t" + result.getRecall());
System.out.println("Accuracy: \t" + result.getAccuracy());
//store result
jobs.persistExperimentResult(result, outputFolder);
}
}
| 3,605 | 0.714286 | 0.712344 | 84 | 40.916668 | 27.575527 | 94 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.178571 | false | false |
7
|
5bc3c6d3fa113e4f680bb37275972cbe620244e8
| 30,288,109,438,857 |
ebb6eac1dcdf4c0c540b0f546b01b573e7cc8b92
|
/src/ac71/m/FlyingEnemy.java
|
0634632bc59855f4af556bc586e420ef01d82fe6
|
[] |
no_license
|
aniranc/M
|
https://github.com/aniranc/M
|
5b8540ddd6c766b6eb28b5f77af9ee7c38c3e0d3
|
f2dad3406d24be46b56ddacbac7a3f21c8e7fe6e
|
refs/heads/master
| 2015-07-13T11:30:18 | 2013-12-16T20:52:04 | 2013-12-16T20:52:04 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package ac71.m;
import java.awt.Graphics2D;
import java.util.Map;
import ac71.engine.*;
import ac71.engine.collision.*;
import ac71.engine.io.*;
import cs195n.*;
public class FlyingEnemy extends DynamicEntity {
private boolean towardsEnd = true;
private final float SPEED;
private Vec2f origin;
class PatrolInput extends Input {
@Override
public void run(Map<String, String> args) {
String[] destArr = args.get("dest").split(",");
doPatrol(new Vec2f(Float.parseFloat(destArr[0]), Float.parseFloat(destArr[1])));
}
}
public FlyingEnemy(GraphicShape primaryShape, float mass,
float restitution, float speed, World world) {
super(primaryShape, mass, restitution, world);
origin = primaryShape.getCenter();
this.SPEED = speed;
addInput("doPatrol", new PatrolInput());
}
@Override
public void applyForce(Vec2f v) {
//do nothing
}
@Override
public void applyImpulse(Vec2f v) {
//do nothing
}
@Override
public void renderWith(Graphics2D g) {
if (!towardsEnd) primaryShape.flipHorizontal();
super.renderWith(g);
}
void doPatrol(Vec2f dest) {
if (towardsEnd && primaryShape.collidesPoint(dest)) towardsEnd = false;
if (!towardsEnd && primaryShape.collidesPoint(origin)) towardsEnd = true;
if (towardsEnd) {
Vec2f dir = dest.minus(getCenter());
if (!dir.isZero()) velocity = dir.normalized().smult(SPEED);
} else {
Vec2f dir = origin.minus(getCenter());
if (!dir.isZero()) velocity = dir.normalized().smult(SPEED);
}
}
}
|
UTF-8
|
Java
| 1,499 |
java
|
FlyingEnemy.java
|
Java
|
[] | null |
[] |
package ac71.m;
import java.awt.Graphics2D;
import java.util.Map;
import ac71.engine.*;
import ac71.engine.collision.*;
import ac71.engine.io.*;
import cs195n.*;
public class FlyingEnemy extends DynamicEntity {
private boolean towardsEnd = true;
private final float SPEED;
private Vec2f origin;
class PatrolInput extends Input {
@Override
public void run(Map<String, String> args) {
String[] destArr = args.get("dest").split(",");
doPatrol(new Vec2f(Float.parseFloat(destArr[0]), Float.parseFloat(destArr[1])));
}
}
public FlyingEnemy(GraphicShape primaryShape, float mass,
float restitution, float speed, World world) {
super(primaryShape, mass, restitution, world);
origin = primaryShape.getCenter();
this.SPEED = speed;
addInput("doPatrol", new PatrolInput());
}
@Override
public void applyForce(Vec2f v) {
//do nothing
}
@Override
public void applyImpulse(Vec2f v) {
//do nothing
}
@Override
public void renderWith(Graphics2D g) {
if (!towardsEnd) primaryShape.flipHorizontal();
super.renderWith(g);
}
void doPatrol(Vec2f dest) {
if (towardsEnd && primaryShape.collidesPoint(dest)) towardsEnd = false;
if (!towardsEnd && primaryShape.collidesPoint(origin)) towardsEnd = true;
if (towardsEnd) {
Vec2f dir = dest.minus(getCenter());
if (!dir.isZero()) velocity = dir.normalized().smult(SPEED);
} else {
Vec2f dir = origin.minus(getCenter());
if (!dir.isZero()) velocity = dir.normalized().smult(SPEED);
}
}
}
| 1,499 | 0.703803 | 0.689126 | 61 | 23.573771 | 22.05467 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.836066 | false | false |
7
|
0e331588c044d9401720841f6de50293ef8730bf
| 38,268,158,635,260 |
a66fe422c8938c2489a66339ca7c0eff67886f31
|
/IOCProj74-100p-CustoerLayeredApp-Profiles/src/main/java/com/nt/cfgs/AppConfig.java
|
dd3de0b73c75ab97401c440dd620c50553423cb3
|
[] |
no_license
|
8341849309/spring-core
|
https://github.com/8341849309/spring-core
|
674c0cc19fc5fbd4ce21b83e772defcc9f759490
|
d4d05a07deae8977e1f6512902f64ec357f11295
|
refs/heads/master
| 2023-05-27T17:08:07.937000 | 2021-06-03T10:58:29 | 2021-06-03T10:58:29 | 349,339,665 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.nt.cfgs;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import com.zaxxer.hikari.HikariDataSource;
@Configuration
@ComponentScan(basePackages = "com.nt")
public class AppConfig {
@Bean("dmds")
@Profile({"dev","test"})
public DriverManagerDataSource createDMDS() {
DriverManagerDataSource dmds=new DriverManagerDataSource();
dmds.setUrl("jdbc:mysql:///spring");
dmds.setUsername("root");
dmds.setPassword("root");
return dmds;
}
@Bean("hikariDS")
@Profile({"uat","prod"})
public HikariDataSource createHikariDS() {
HikariDataSource ds=new HikariDataSource();
ds.setJdbcUrl("jdbc:oracle:thin:@localhost:1521:xe");
ds.setUsername("root");
ds.setPassword("root");
return ds;
}
}
|
UTF-8
|
Java
| 1,014 |
java
|
AppConfig.java
|
Java
|
[
{
"context": "Url(\"jdbc:mysql:///spring\");\r\n\t\tdmds.setUsername(\"root\");\r\n\t\tdmds.setPassword(\"root\");\r\n\t\t\r\n\t\treturn dmd",
"end": 678,
"score": 0.8548094034194946,
"start": 674,
"tag": "USERNAME",
"value": "root"
},
{
"context": "\n\t\tdmds.setUsername(\"root\");\r\n\t\tdmds.setPassword(\"root\");\r\n\t\t\r\n\t\treturn dmds;\r\n\t}\r\n\t\r\n\t@Bean(\"hikariDS\")",
"end": 707,
"score": 0.9992825984954834,
"start": 703,
"tag": "PASSWORD",
"value": "root"
},
{
"context": "cle:thin:@localhost:1521:xe\");\r\n\t\tds.setUsername(\"root\");\r\n\t\tds.setPassword(\"root\");\r\n\t\t\r\n\t\treturn ds;\r\n",
"end": 957,
"score": 0.9335099458694458,
"start": 953,
"tag": "USERNAME",
"value": "root"
},
{
"context": "\");\r\n\t\tds.setUsername(\"root\");\r\n\t\tds.setPassword(\"root\");\r\n\t\t\r\n\t\treturn ds;\r\n\t}\r\n}\r\n",
"end": 984,
"score": 0.9993488192558289,
"start": 980,
"tag": "PASSWORD",
"value": "root"
}
] | null |
[] |
package com.nt.cfgs;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
import com.zaxxer.hikari.HikariDataSource;
@Configuration
@ComponentScan(basePackages = "com.nt")
public class AppConfig {
@Bean("dmds")
@Profile({"dev","test"})
public DriverManagerDataSource createDMDS() {
DriverManagerDataSource dmds=new DriverManagerDataSource();
dmds.setUrl("jdbc:mysql:///spring");
dmds.setUsername("root");
dmds.setPassword("<PASSWORD>");
return dmds;
}
@Bean("hikariDS")
@Profile({"uat","prod"})
public HikariDataSource createHikariDS() {
HikariDataSource ds=new HikariDataSource();
ds.setJdbcUrl("jdbc:oracle:thin:@localhost:1521:xe");
ds.setUsername("root");
ds.setPassword("<PASSWORD>");
return ds;
}
}
| 1,026 | 0.736686 | 0.732742 | 36 | 26.166666 | 21.102264 | 67 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.472222 | false | false |
7
|
59a183c634293a2c55cca3b14c2ca19e009cb042
| 38,268,158,636,649 |
dda7f1b00b0ba3cb2e3ead6c6841c83fcd014e9f
|
/src/main/java/za/co/eoh/invetory/management/service/UserviceImpl.java
|
d2ba2ed80ba8abfa0d94387eafe3c3424a39e4df
|
[] |
no_license
|
thakgatso1/inventoryManagement
|
https://github.com/thakgatso1/inventoryManagement
|
3e45a81c475a34e80bfdc95f5dacb697a7b7f91e
|
dc4e77870092083992f9edbd0765ba9c56760b65
|
refs/heads/master
| 2020-12-03T01:51:10.346000 | 2017-07-31T11:10:53 | 2017-07-31T11:10:53 | 95,875,233 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package za.co.eoh.invetory.management.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import za.co.eoh.invetory.management.entity.User;
import za.co.eoh.invetory.management.dao.UserDao;
import java.util.List;
/**
*
* @author thakgatso
*/
@Service
@Transactional
public class UserviceImpl implements UserService{
@Autowired
private UserDao userDao;
@Override
public List<User> getAllUser() {
return userDao.findAll(); }
@Override
public User getUserById(int id) {
return userDao.findById(id);
}
@Override
public User mergeUser(User user) {
return userDao.mergeUser(user);
}
@Override
public User saveOrUpdate(User user) {
return userDao.saveOrUpdate(user);
}
@Override
public void deleteUser(User user) {
userDao.delete(user);
}
@Override
public User login(String username, String password) {
return userDao.login(username, password);
}
}
|
UTF-8
|
Java
| 1,282 |
java
|
UserviceImpl.java
|
Java
|
[
{
"context": "serDao;\n\nimport java.util.List;\n\n/**\n *\n * @author thakgatso\n */\n@Service \n@Transactional\npublic class Uservic",
"end": 560,
"score": 0.9996099472045898,
"start": 551,
"tag": "USERNAME",
"value": "thakgatso"
}
] | null |
[] |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package za.co.eoh.invetory.management.service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import za.co.eoh.invetory.management.entity.User;
import za.co.eoh.invetory.management.dao.UserDao;
import java.util.List;
/**
*
* @author thakgatso
*/
@Service
@Transactional
public class UserviceImpl implements UserService{
@Autowired
private UserDao userDao;
@Override
public List<User> getAllUser() {
return userDao.findAll(); }
@Override
public User getUserById(int id) {
return userDao.findById(id);
}
@Override
public User mergeUser(User user) {
return userDao.mergeUser(user);
}
@Override
public User saveOrUpdate(User user) {
return userDao.saveOrUpdate(user);
}
@Override
public void deleteUser(User user) {
userDao.delete(user);
}
@Override
public User login(String username, String password) {
return userDao.login(username, password);
}
}
| 1,282 | 0.712949 | 0.712949 | 56 | 21.892857 | 21.222191 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.339286 | false | false |
7
|
85ebc72b0516b407fb3fad6799209e6773f82904
| 26,972,394,645,369 |
363095f50c3420bcaedb4a22d4c5dd0ef0286e95
|
/src/main/java/com/yarregion/webqueue/webqueue/talon.java
|
9d4eb37059da73d4533c37702892f739047cfbfe
|
[] |
no_license
|
aaa3d/webQueue
|
https://github.com/aaa3d/webQueue
|
6508710efeb050bde55f3e128ca7436a42c1b9fc
|
7a04c433e5d696e5c493ef151217048daca34358
|
refs/heads/master
| 2021-01-22T06:01:48.484000 | 2017-06-19T14:24:07 | 2017-06-19T14:24:07 | 92,513,903 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.yarregion.webqueue.webqueue;
import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.OnDelete;
import static org.hibernate.annotations.OnDeleteAction.CASCADE;
/**
*
* @author istorozhev
*/
@Entity
public class talon implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(columnDefinition = "integer")
@Getter
private int id;
@Getter
@Setter
private String name;
@Column(columnDefinition = "integer")
@Getter
@Setter
private int number;
@Getter
private Calendar date;
@Getter
@Setter
@ManyToOne(cascade=CascadeType.ALL , fetch = FetchType.LAZY)
@JoinColumn(name = "next_id", insertable = true, columnDefinition = "integer", foreignKey = @ForeignKey(name = "FK_TALON_NEXT_TALON"))
private talon nextTalon;
@Getter
@Setter
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "queue_id", insertable = true, columnDefinition = "integer", foreignKey = @ForeignKey(name = "FK_TALON_QUEUE"))
private queue queue;
public talon(){
System.out.print((String.format("new talon def constructor: id={0}, number={1} ", this.id, this.number)));
}
public talon(talon parent){
date =Calendar.getInstance();
if (parent != null){
number = parent.getNumber()+1;
parent.setNextTalon(this);
}
}
}
|
UTF-8
|
Java
| 2,271 |
java
|
talon.java
|
Java
|
[
{
"context": "ons.OnDeleteAction.CASCADE;\n\n\n\n\n\n/**\n *\n * @author istorozhev\n */\n@Entity\npublic class talon implements Seriali",
"end": 974,
"score": 0.9974711537361145,
"start": 964,
"tag": "USERNAME",
"value": "istorozhev"
}
] | null |
[] |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.yarregion.webqueue.webqueue;
import java.io.Serializable;
import java.util.Calendar;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ForeignKey;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.OnDelete;
import static org.hibernate.annotations.OnDeleteAction.CASCADE;
/**
*
* @author istorozhev
*/
@Entity
public class talon implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(columnDefinition = "integer")
@Getter
private int id;
@Getter
@Setter
private String name;
@Column(columnDefinition = "integer")
@Getter
@Setter
private int number;
@Getter
private Calendar date;
@Getter
@Setter
@ManyToOne(cascade=CascadeType.ALL , fetch = FetchType.LAZY)
@JoinColumn(name = "next_id", insertable = true, columnDefinition = "integer", foreignKey = @ForeignKey(name = "FK_TALON_NEXT_TALON"))
private talon nextTalon;
@Getter
@Setter
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "queue_id", insertable = true, columnDefinition = "integer", foreignKey = @ForeignKey(name = "FK_TALON_QUEUE"))
private queue queue;
public talon(){
System.out.print((String.format("new talon def constructor: id={0}, number={1} ", this.id, this.number)));
}
public talon(talon parent){
date =Calendar.getInstance();
if (parent != null){
number = parent.getNumber()+1;
parent.setNextTalon(this);
}
}
}
| 2,271 | 0.687803 | 0.686482 | 90 | 24.233334 | 26.237398 | 138 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.488889 | false | false |
7
|
468a2e5c0974df02020154fc76b44630702e836b
| 19,052,474,946,741 |
e253265892679838d8d3c2e3c6c4f3d89a6b2447
|
/src/test/java/org/hibernate/sebersole/pg/junit5/testing/package-info.java
|
a98c5c5519ca5b1960a67288e6bc87f843d04a97
|
[] |
no_license
|
yrodiere/junit5-playground
|
https://github.com/yrodiere/junit5-playground
|
62714c7abcf89762ff932fac4b9db1edfe2ca299
|
ee112a05b7b8151ee60913ea60449344f2def4ce
|
refs/heads/master
| 2021-07-23T06:26:56.716000 | 2017-10-26T16:00:48 | 2017-10-26T16:00:48 | 108,514,601 | 0 | 0 | null | true | 2017-10-27T07:34:44 | 2017-10-27T07:34:43 | 2017-10-24T15:08:02 | 2017-10-26T16:00:56 | 84 | 0 | 0 | 0 | null | false | null |
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
/**
* Annotations and JUnit 5 extensions used in writing tests. These would
* live in hibernate-testing/src/main/java. They's be used in the other module's
* tests
*/
package org.hibernate.sebersole.pg.junit5.testing;
|
UTF-8
|
Java
| 458 |
java
|
package-info.java
|
Java
|
[] | null |
[] |
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
*/
/**
* Annotations and JUnit 5 extensions used in writing tests. These would
* live in hibernate-testing/src/main/java. They's be used in the other module's
* tests
*/
package org.hibernate.sebersole.pg.junit5.testing;
| 458 | 0.735808 | 0.722707 | 13 | 34.23077 | 35.124294 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.230769 | false | false |
7
|
c63a9e4ae41c1ba576536003deb4d160af82a7d9
| 23,055,384,511,259 |
de98166c25b04595556ae1050273b3f3811c55e5
|
/src/сircles/BackGround.java
|
bd6b9e9716947ed680df6b235f3daffbd06b0975
|
[] |
no_license
|
Qwerty-arch/RelaxBallsGame
|
https://github.com/Qwerty-arch/RelaxBallsGame
|
dc8bc6c81ed08417f0a175453c5e6c0c42c59e83
|
136eedcb637e85e18cda4168bc03e2c1d2e82d6c
|
refs/heads/master
| 2020-12-15T01:07:32.003000 | 2020-01-19T17:49:37 | 2020-01-19T17:49:37 | 234,940,190 | 0 | 0 | null | false | 2020-01-19T23:44:51 | 2020-01-19T17:47:56 | 2020-01-19T17:49:46 | 2020-01-19T23:42:04 | 13 | 0 | 0 | 1 |
Java
| false | false |
package сircles;
import java.awt.Color;
public class BackGround {
public Color ColorTime () {
Color Newcolor = new Color (255, (int)(Math.random() * 255), (int)(Math.random() * 255));
return Newcolor;
}}
|
UTF-8
|
Java
| 235 |
java
|
BackGround.java
|
Java
|
[] | null |
[] |
package сircles;
import java.awt.Color;
public class BackGround {
public Color ColorTime () {
Color Newcolor = new Color (255, (int)(Math.random() * 255), (int)(Math.random() * 255));
return Newcolor;
}}
| 235 | 0.611111 | 0.57265 | 12 | 18.416666 | 26.26296 | 97 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
7
|
6c328c5790da015c1add3094fa8d0bbc4ccde59a
| 7,696,581,454,919 |
4e609a08965e2d85ea3614c480ef22e4e1ee0859
|
/src/CommandManager.java
|
671099f91a3aa9af227d0199a780136015308277
|
[] |
no_license
|
roopepaajanen/Prog4_2020
|
https://github.com/roopepaajanen/Prog4_2020
|
923a9af5cba92ac59695bbd9d0f66026ce062ffc
|
6f3a7253b7a0842a57417a0b54f7a30a07933750
|
refs/heads/master
| 2022-12-30T04:44:17.558000 | 2020-10-22T00:40:59 | 2020-10-22T00:40:59 | 295,425,851 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import javax.swing.plaf.nimbus.State;
import java.util.Stack;
/**
* Class that manages the Commands and Containers given that changes the undo and redo stacks respectively.
*/
public class CommandManager {
private Command lastCommand;
private Stack< Command> undoStack = new Stack<>();
private Stack<Command>redoStack = new Stack<>();
private Stack<Container> undoContainerStack = new Stack<>();
private Stack<Container> redoContainerStack = new Stack<>();
private Container lastContainer;
//private MusicOrganizerWindow view2;
public CommandManager(/*MusicOrganizerWindow view*/) {
//view2 = view;
}
public Stack<Command> getUndoStack(){
return undoStack;
}
public Stack<Command> getRedoStack(){
return redoStack;
}
/** Performs the basic function of the chosen command and pushes it to the undoStack for when undo will be used*/
public void executeCommand(Command com) {
lastContainer = com.execute();
if (lastContainer != null){
undoStack.push(com); //add....
lastCommand = com;
undoContainerStack.push(lastContainer);
}
}
/** Perform the undo function where it pushes and pops so that the user can both undo and redo to the
* same commands*/
public void undo() {
lastCommand.undo(lastContainer);
redoStack.push(lastCommand);
redoContainerStack.push(lastContainer);
lastCommand = undoStack.pop();
lastContainer = undoContainerStack.pop();
}
/** Perform the redo function where it pushes and pops so that the user can both undo and redo to the
* same commands*/
public void redo(){
undoStack.push(lastCommand);
undoContainerStack.push(lastContainer);
lastCommand = redoStack.pop();
lastContainer = redoContainerStack.pop();
lastCommand.redo(lastContainer);
}
}
|
UTF-8
|
Java
| 1,934 |
java
|
CommandManager.java
|
Java
|
[] | null |
[] |
import javax.swing.plaf.nimbus.State;
import java.util.Stack;
/**
* Class that manages the Commands and Containers given that changes the undo and redo stacks respectively.
*/
public class CommandManager {
private Command lastCommand;
private Stack< Command> undoStack = new Stack<>();
private Stack<Command>redoStack = new Stack<>();
private Stack<Container> undoContainerStack = new Stack<>();
private Stack<Container> redoContainerStack = new Stack<>();
private Container lastContainer;
//private MusicOrganizerWindow view2;
public CommandManager(/*MusicOrganizerWindow view*/) {
//view2 = view;
}
public Stack<Command> getUndoStack(){
return undoStack;
}
public Stack<Command> getRedoStack(){
return redoStack;
}
/** Performs the basic function of the chosen command and pushes it to the undoStack for when undo will be used*/
public void executeCommand(Command com) {
lastContainer = com.execute();
if (lastContainer != null){
undoStack.push(com); //add....
lastCommand = com;
undoContainerStack.push(lastContainer);
}
}
/** Perform the undo function where it pushes and pops so that the user can both undo and redo to the
* same commands*/
public void undo() {
lastCommand.undo(lastContainer);
redoStack.push(lastCommand);
redoContainerStack.push(lastContainer);
lastCommand = undoStack.pop();
lastContainer = undoContainerStack.pop();
}
/** Perform the redo function where it pushes and pops so that the user can both undo and redo to the
* same commands*/
public void redo(){
undoStack.push(lastCommand);
undoContainerStack.push(lastContainer);
lastCommand = redoStack.pop();
lastContainer = redoContainerStack.pop();
lastCommand.redo(lastContainer);
}
}
| 1,934 | 0.664943 | 0.663909 | 57 | 32.929825 | 27.977974 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.45614 | false | false |
7
|
a158cf2352c3b0f1ecf703fcbd7152f3709de951
| 30,940,944,469,977 |
e85cf76c87203eeb5a993064b3ece9e316c298a7
|
/bpm/src/main/java/com/desmart/desmartbpm/controller/BpmPublicFormController.java
|
ca1543be96dc896d9b7fa5e534f80fb2807cfc92
|
[] |
no_license
|
zhaowei198311/IBM-BPM
|
https://github.com/zhaowei198311/IBM-BPM
|
b9f0c3301de00b030df97821598080df759f427e
|
f8123ae9447a98dde42688c458899815ed4fe419
|
refs/heads/master
| 2020-03-27T04:40:31.762000 | 2018-08-24T07:18:51 | 2018-08-24T07:18:51 | 145,959,706 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.desmart.desmartbpm.controller;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.desmart.common.constant.ServerResponse;
import com.desmart.desmartbpm.entity.BpmPublicForm;
import com.desmart.common.exception.PlatformException;
import com.desmart.desmartbpm.service.BpmPublicFormService;
import com.desmart.desmartsystem.service.BpmGlobalConfigService;
/**
* 公共表单管理控制器
* @author loser_wu
* @since 2018年5月24日
*/
@Controller
@RequestMapping(value = "/publicForm")
public class BpmPublicFormController {
private static final Logger LOG = LoggerFactory.getLogger(BpmFormManageController.class);
@Autowired
private BpmPublicFormService bpmPublicFormService;
@Autowired
private BpmGlobalConfigService bpmGlobalConfigService;
/**
* 转到公共表单的管理页面
*/
@RequestMapping(value = "/index")
public ModelAndView index() {
return new ModelAndView("desmartbpm/publicForm");
}
/**
* 转到表单设计器
*/
@RequestMapping(value = "/designForm")
public ModelAndView designForm(String formUid,String formName,String formDescription,
String dynHtml,String formCode) {
ModelAndView modelAndView = new ModelAndView("desmartbpm/common/publicFormDesign");
modelAndView.addObject("formUid", formUid);
modelAndView.addObject("formName", formName);
modelAndView.addObject("formDescription", formDescription);
modelAndView.addObject("dynHtml",dynHtml);
modelAndView.addObject("formCode",formCode);
return modelAndView;
}
/**
* 根据表单名分页查询公共表单
*/
@RequestMapping(value = "/listFormByFormName")
@ResponseBody
public ServerResponse listFormByFormName(String formName,
@RequestParam(value="pageNum",defaultValue="1") Integer pageNum,
@RequestParam(value="pageSize",defaultValue="10") Integer pageSize) {
return bpmPublicFormService.listFormByFormName(formName,pageNum,pageSize);
}
/**
* 根据表单名精确查询表单
*/
@RequestMapping(value = "/queryFormByFormNameAndCode")
@ResponseBody
public ServerResponse queryFormByFormNameAndCode(String formName,String formCode) {
try {
return bpmPublicFormService.queryFormByFormNameAndCode(formName,formCode);
}catch(Exception e) {
LOG.error("查询表单异常",e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 根据表单ID精确查询表单
*/
@RequestMapping(value = "/queryFormByFormUid")
@ResponseBody
public ServerResponse queryFormByFormUid(String formUid) {
return bpmPublicFormService.queryFormByFormUid(formUid);
}
/**
* 根据表单id查询表单是否已被关联了步骤的主表单引用
*/
@RequestMapping(value = "/isBindMainForm")
@ResponseBody
public ServerResponse isBindMainForm(@Param("formUids") String[] formUids) {
try {
return bpmPublicFormService.isBindMainForm(formUids);
}catch(Exception e) {
LOG.error("查询公共表单是否被主表单绑定", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 保存公共表单信息
*/
@RequestMapping(value = "/saveForm")
@ResponseBody
public ServerResponse saveForm(@RequestBody BpmPublicForm bpmPublicForm) {
try {
return bpmPublicFormService.saveForm(bpmPublicForm);
}catch(Exception e) {
LOG.error("保存子表单异常", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 修改公共的表单内容
*/
@RequestMapping(value = "/upadteFormContent")
@ResponseBody
public ServerResponse upadteFormContent(@RequestBody BpmPublicForm bpmPublicForm) {
try {
return bpmPublicFormService.upadteFormContent(bpmPublicForm);
}catch(Exception e) {
LOG.error("修改子表单异常", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 修改公共的表单属性
*/
@RequestMapping(value = "/updateFormInfo")
@ResponseBody
public ServerResponse updateFormInfo(BpmPublicForm bpmPublicForm) {
try {
return bpmPublicFormService.updateFormInfo(bpmPublicForm);
}catch(PlatformException e) {
LOG.error("修改子表单异常", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}catch(Exception e) {
LOG.error("修改子表单异常", e);
return ServerResponse.createByErrorMessage("表单属性修改失败");
}
}
/**
* 删除公共表单
*/
@RequestMapping(value = "/deleteForm")
@ResponseBody
public ServerResponse deleteForm(@Param("formUids") String[] formUids) {
try {
return bpmPublicFormService.deleteForm(formUids);
}catch(Exception e) {
LOG.error("删除子表单异常", e);
return ServerResponse.createByError();
}
}
/**
* 复制表单
*/
@RequestMapping(value = "/copyForm")
@ResponseBody
public ServerResponse copyForm(BpmPublicForm bpmPubilcForm) {
try {
return bpmPublicFormService.copyForm(bpmPubilcForm);
}catch(Exception e) {
return ServerResponse.createByError();
}
}
/**
* 进入选择关联子表单的页面
*/
@RequestMapping(value = "/selectPublicForm")
@ResponseBody
public ModelAndView toChoosePublicForm(String elementId,String formUid) {
ModelAndView mv = new ModelAndView("desmartbpm/choosePublicForm");
mv.addObject("elementId",elementId);
mv.addObject("formUid",formUid);
return mv;
}
/**
* 添加主表单与公共表单之间的关联信息
*/
@RequestMapping(value = "/saveFormRelePublicForm")
@ResponseBody
public ServerResponse saveFormRelePublicForm(String formUid,String[] publicFormUidArr) {
try {
return bpmPublicFormService.saveFormRelePublicForm(formUid,publicFormUidArr);
}catch(Exception e) {
LOG.error("增加子表单与主表单关联异常", e);
return ServerResponse.createByError();
}
}
/**
* 根据表单id和公共表单id查询是否有相同的关联信息
*/
@RequestMapping(value = "/queryReleByFormUidAndPublicFormUid")
@ResponseBody
public ServerResponse queryReleByFormUidAndPublicFormUid(String formUid,String publicFormUid) {
try {
return bpmPublicFormService.queryReleByFormUidAndPublicFormUid(formUid,publicFormUid);
}catch(Exception e) {
LOG.error("查询子表单与主表单关联异常", e);
return ServerResponse.createByError();
}
}
}
|
UTF-8
|
Java
| 6,903 |
java
|
BpmPublicFormController.java
|
Java
|
[
{
"context": "balConfigService;\r\n\r\n/**\r\n * 公共表单管理控制器\r\n * @author loser_wu\r\n * @since 2018年5月24日\r\n */\r\n@Controller\r\n@Request",
"end": 898,
"score": 0.9996710419654846,
"start": 890,
"tag": "USERNAME",
"value": "loser_wu"
}
] | null |
[] |
package com.desmart.desmartbpm.controller;
import org.apache.ibatis.annotations.Param;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.desmart.common.constant.ServerResponse;
import com.desmart.desmartbpm.entity.BpmPublicForm;
import com.desmart.common.exception.PlatformException;
import com.desmart.desmartbpm.service.BpmPublicFormService;
import com.desmart.desmartsystem.service.BpmGlobalConfigService;
/**
* 公共表单管理控制器
* @author loser_wu
* @since 2018年5月24日
*/
@Controller
@RequestMapping(value = "/publicForm")
public class BpmPublicFormController {
private static final Logger LOG = LoggerFactory.getLogger(BpmFormManageController.class);
@Autowired
private BpmPublicFormService bpmPublicFormService;
@Autowired
private BpmGlobalConfigService bpmGlobalConfigService;
/**
* 转到公共表单的管理页面
*/
@RequestMapping(value = "/index")
public ModelAndView index() {
return new ModelAndView("desmartbpm/publicForm");
}
/**
* 转到表单设计器
*/
@RequestMapping(value = "/designForm")
public ModelAndView designForm(String formUid,String formName,String formDescription,
String dynHtml,String formCode) {
ModelAndView modelAndView = new ModelAndView("desmartbpm/common/publicFormDesign");
modelAndView.addObject("formUid", formUid);
modelAndView.addObject("formName", formName);
modelAndView.addObject("formDescription", formDescription);
modelAndView.addObject("dynHtml",dynHtml);
modelAndView.addObject("formCode",formCode);
return modelAndView;
}
/**
* 根据表单名分页查询公共表单
*/
@RequestMapping(value = "/listFormByFormName")
@ResponseBody
public ServerResponse listFormByFormName(String formName,
@RequestParam(value="pageNum",defaultValue="1") Integer pageNum,
@RequestParam(value="pageSize",defaultValue="10") Integer pageSize) {
return bpmPublicFormService.listFormByFormName(formName,pageNum,pageSize);
}
/**
* 根据表单名精确查询表单
*/
@RequestMapping(value = "/queryFormByFormNameAndCode")
@ResponseBody
public ServerResponse queryFormByFormNameAndCode(String formName,String formCode) {
try {
return bpmPublicFormService.queryFormByFormNameAndCode(formName,formCode);
}catch(Exception e) {
LOG.error("查询表单异常",e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 根据表单ID精确查询表单
*/
@RequestMapping(value = "/queryFormByFormUid")
@ResponseBody
public ServerResponse queryFormByFormUid(String formUid) {
return bpmPublicFormService.queryFormByFormUid(formUid);
}
/**
* 根据表单id查询表单是否已被关联了步骤的主表单引用
*/
@RequestMapping(value = "/isBindMainForm")
@ResponseBody
public ServerResponse isBindMainForm(@Param("formUids") String[] formUids) {
try {
return bpmPublicFormService.isBindMainForm(formUids);
}catch(Exception e) {
LOG.error("查询公共表单是否被主表单绑定", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 保存公共表单信息
*/
@RequestMapping(value = "/saveForm")
@ResponseBody
public ServerResponse saveForm(@RequestBody BpmPublicForm bpmPublicForm) {
try {
return bpmPublicFormService.saveForm(bpmPublicForm);
}catch(Exception e) {
LOG.error("保存子表单异常", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 修改公共的表单内容
*/
@RequestMapping(value = "/upadteFormContent")
@ResponseBody
public ServerResponse upadteFormContent(@RequestBody BpmPublicForm bpmPublicForm) {
try {
return bpmPublicFormService.upadteFormContent(bpmPublicForm);
}catch(Exception e) {
LOG.error("修改子表单异常", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}
}
/**
* 修改公共的表单属性
*/
@RequestMapping(value = "/updateFormInfo")
@ResponseBody
public ServerResponse updateFormInfo(BpmPublicForm bpmPublicForm) {
try {
return bpmPublicFormService.updateFormInfo(bpmPublicForm);
}catch(PlatformException e) {
LOG.error("修改子表单异常", e);
return ServerResponse.createByErrorMessage(e.getMessage());
}catch(Exception e) {
LOG.error("修改子表单异常", e);
return ServerResponse.createByErrorMessage("表单属性修改失败");
}
}
/**
* 删除公共表单
*/
@RequestMapping(value = "/deleteForm")
@ResponseBody
public ServerResponse deleteForm(@Param("formUids") String[] formUids) {
try {
return bpmPublicFormService.deleteForm(formUids);
}catch(Exception e) {
LOG.error("删除子表单异常", e);
return ServerResponse.createByError();
}
}
/**
* 复制表单
*/
@RequestMapping(value = "/copyForm")
@ResponseBody
public ServerResponse copyForm(BpmPublicForm bpmPubilcForm) {
try {
return bpmPublicFormService.copyForm(bpmPubilcForm);
}catch(Exception e) {
return ServerResponse.createByError();
}
}
/**
* 进入选择关联子表单的页面
*/
@RequestMapping(value = "/selectPublicForm")
@ResponseBody
public ModelAndView toChoosePublicForm(String elementId,String formUid) {
ModelAndView mv = new ModelAndView("desmartbpm/choosePublicForm");
mv.addObject("elementId",elementId);
mv.addObject("formUid",formUid);
return mv;
}
/**
* 添加主表单与公共表单之间的关联信息
*/
@RequestMapping(value = "/saveFormRelePublicForm")
@ResponseBody
public ServerResponse saveFormRelePublicForm(String formUid,String[] publicFormUidArr) {
try {
return bpmPublicFormService.saveFormRelePublicForm(formUid,publicFormUidArr);
}catch(Exception e) {
LOG.error("增加子表单与主表单关联异常", e);
return ServerResponse.createByError();
}
}
/**
* 根据表单id和公共表单id查询是否有相同的关联信息
*/
@RequestMapping(value = "/queryReleByFormUidAndPublicFormUid")
@ResponseBody
public ServerResponse queryReleByFormUidAndPublicFormUid(String formUid,String publicFormUid) {
try {
return bpmPublicFormService.queryReleByFormUidAndPublicFormUid(formUid,publicFormUid);
}catch(Exception e) {
LOG.error("查询子表单与主表单关联异常", e);
return ServerResponse.createByError();
}
}
}
| 6,903 | 0.735382 | 0.733501 | 217 | 27.396313 | 25.864939 | 96 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.78341 | false | false |
7
|
c2b648993ab90c3e58602cb64bd71070d8339537
| 25,469,156,116,121 |
3d6c5635796135bc02ce3a28e73b2214f90642a0
|
/src/com/security/Encrypt.java
|
b029c6d6b41d9c2dda9e12578fa472edcfd3f979
|
[] |
no_license
|
martintribino/jyaa2020_grupo12
|
https://github.com/martintribino/jyaa2020_grupo12
|
34e47fd50af257e8d159cf9100efed54a54097dc
|
c362ab32c02b950ffe7c400c08f6a4d36a1d1eb8
|
refs/heads/master
| 2023-01-20T20:38:05.567000 | 2020-08-20T20:26:22 | 2020-08-20T20:26:22 | 286,133,150 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.security;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
public class Encrypt {
private static BCryptPasswordEncoder bcryptInstance;
public static BCryptPasswordEncoder getInstance() {
if (bcryptInstance == null) {
createInstance();
}
return bcryptInstance;
}
private static synchronized void createInstance() { // for multithreading
if (bcryptInstance == null) {
bcryptInstance = new BCryptPasswordEncoder(9);
}
}
public static String encode(String clave){
BCryptPasswordEncoder instance = Encrypt.getInstance();
return instance.encode(clave);
}
public static Boolean matches(String clave, String claveCodificada){
BCryptPasswordEncoder instance = Encrypt.getInstance();
return instance.matches((CharSequence)clave, claveCodificada);
}
}
|
UTF-8
|
Java
| 841 |
java
|
Encrypt.java
|
Java
|
[] | null |
[] |
package com.security;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
public class Encrypt {
private static BCryptPasswordEncoder bcryptInstance;
public static BCryptPasswordEncoder getInstance() {
if (bcryptInstance == null) {
createInstance();
}
return bcryptInstance;
}
private static synchronized void createInstance() { // for multithreading
if (bcryptInstance == null) {
bcryptInstance = new BCryptPasswordEncoder(9);
}
}
public static String encode(String clave){
BCryptPasswordEncoder instance = Encrypt.getInstance();
return instance.encode(clave);
}
public static Boolean matches(String clave, String claveCodificada){
BCryptPasswordEncoder instance = Encrypt.getInstance();
return instance.matches((CharSequence)clave, claveCodificada);
}
}
| 841 | 0.750297 | 0.749108 | 30 | 27.033333 | 25.763647 | 74 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.266667 | false | false |
7
|
8f41b17df577044dffadc49dddbadec6199421c3
| 22,522,808,538,405 |
60e3d39794c0142e99e9b15129bcfd9ea49e179d
|
/src/StartChessJFrame.java
|
6616b02fcdc363127994877a5baa23e94d8a777a
|
[] |
no_license
|
18804636934/fantastic-palm-tree
|
https://github.com/18804636934/fantastic-palm-tree
|
b9ccb9a980b9a5ebabfb98c7f323b2e7eb78a41c
|
7c9fee34f420e437b6aeb94ddc9d21abce2ff5ce
|
refs/heads/master
| 2020-05-22T19:33:55.116000 | 2019-04-23T07:32:34 | 2019-04-23T07:32:34 | 84,718,422 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
/**
*五子棋主框架类,程序启动类
*/
public class StartChessJFrame extends JFrame {
/**
* 构造方法StartChessJFrame(),创建整体框架、按钮与菜单。
* 监听器MyItemListener(ActionEvent e),监听按钮
* 主方法main(String[] args)
*/
private static final long serialVersionUID = 1L;
private ChessBoard chessBoard;// 五子棋--棋盘类
private JPanel toolbar;// 一般轻量级容器
private JButton startButton, backButton, exitButton;// 按钮的实现,通过 Action 可配置按钮,并进行一定程度的控制
private JMenuBar menuBar;// 菜单栏的实现,将 JMenu 对象添加到菜单栏以构造菜单
private JMenu sysMenu;// 菜单的该实现是一个包含 JMenuItem 的弹出窗口,用户选择 JMenuBar 上的项时会显示该 JMenuItem
private JMenuItem startMenuItem, exitMenuItem, backMenuItem;// 菜单中的项的实现,菜单项本质上是位于列表中的按钮
// 重新开始,退出,和悔棋菜单项
public StartChessJFrame() {
setTitle("五子棋");// 设置标题
chessBoard = new ChessBoard();// 构造一个棋盘
Container contentPane = getContentPane();// 添加到容器中的组件放在一个列表中
contentPane.add(chessBoard);// 将棋盘追加到此容器的尾部
chessBoard.setOpaque(true);// 绘制其边界内的所有像素
// 创建和添加菜单
menuBar = new JMenuBar();// 初始化菜单栏
sysMenu = new JMenu("菜单");// 初始化菜单
// 初始化菜单项
startMenuItem = new JMenuItem("重新开始");
exitMenuItem = new JMenuItem("退出");
backMenuItem = new JMenuItem("悔棋");
// 将三个菜单项添加到菜单上
sysMenu.add(startMenuItem);
sysMenu.add(exitMenuItem);
sysMenu.add(backMenuItem);
// 初始化按钮事件监听器内部类
MyItemListener lis = new MyItemListener();
// 将三个菜单注册到事件监听器上
startMenuItem.addActionListener(lis);
backMenuItem.addActionListener(lis);
exitMenuItem.addActionListener(lis);
menuBar.add(sysMenu);// 将系统菜单添加到菜单栏上
setJMenuBar(menuBar);// 将menuBar设置为菜单栏
toolbar = new JPanel();// 工具面板实例化
// 三个按钮初始化
startButton = new JButton("重新开始");
exitButton = new JButton("退出");
backButton = new JButton("悔棋");
// 将工具面板按钮用FlowLayout布局
toolbar.setLayout(new FlowLayout(FlowLayout.LEFT));
// 将三个按钮添加到工具面板
toolbar.add(startButton);
toolbar.add(exitButton);
toolbar.add(backButton);
// 将三个按钮注册监听事件
startButton.addActionListener(lis);
exitButton.addActionListener(lis);
backButton.addActionListener(lis);
add(toolbar, BorderLayout.SOUTH);// 将工具面板布局到界面”南方“也就是下方
add(chessBoard);// 将面板对象添加到窗体上
// 设置界面关闭事件
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();// 自适应大小,布置容器,让它使用显示其内容所需的最小空间。
}
//菜单与按钮的监听器
private class MyItemListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();// 获得事件源
if (obj == startMenuItem || obj == startButton) {
// 重新开始
System.out.println("重新开始");
chessBoard.restartGame();
}
else if (obj == exitMenuItem || obj == exitButton){
// 退出
System.exit(0);
}
else if (obj == backMenuItem || obj == backButton) {
// 悔棋
System.out.println("悔棋");
chessBoard.goback();
}
}
}
//main
public static void main(String[] args) {
StartChessJFrame f = new StartChessJFrame();// 创建主框架
f.setVisible(true);// 显示主框架
}
}
|
GB18030
|
Java
| 3,847 |
java
|
StartChessJFrame.java
|
Java
|
[] | null |
[] |
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
/**
*五子棋主框架类,程序启动类
*/
public class StartChessJFrame extends JFrame {
/**
* 构造方法StartChessJFrame(),创建整体框架、按钮与菜单。
* 监听器MyItemListener(ActionEvent e),监听按钮
* 主方法main(String[] args)
*/
private static final long serialVersionUID = 1L;
private ChessBoard chessBoard;// 五子棋--棋盘类
private JPanel toolbar;// 一般轻量级容器
private JButton startButton, backButton, exitButton;// 按钮的实现,通过 Action 可配置按钮,并进行一定程度的控制
private JMenuBar menuBar;// 菜单栏的实现,将 JMenu 对象添加到菜单栏以构造菜单
private JMenu sysMenu;// 菜单的该实现是一个包含 JMenuItem 的弹出窗口,用户选择 JMenuBar 上的项时会显示该 JMenuItem
private JMenuItem startMenuItem, exitMenuItem, backMenuItem;// 菜单中的项的实现,菜单项本质上是位于列表中的按钮
// 重新开始,退出,和悔棋菜单项
public StartChessJFrame() {
setTitle("五子棋");// 设置标题
chessBoard = new ChessBoard();// 构造一个棋盘
Container contentPane = getContentPane();// 添加到容器中的组件放在一个列表中
contentPane.add(chessBoard);// 将棋盘追加到此容器的尾部
chessBoard.setOpaque(true);// 绘制其边界内的所有像素
// 创建和添加菜单
menuBar = new JMenuBar();// 初始化菜单栏
sysMenu = new JMenu("菜单");// 初始化菜单
// 初始化菜单项
startMenuItem = new JMenuItem("重新开始");
exitMenuItem = new JMenuItem("退出");
backMenuItem = new JMenuItem("悔棋");
// 将三个菜单项添加到菜单上
sysMenu.add(startMenuItem);
sysMenu.add(exitMenuItem);
sysMenu.add(backMenuItem);
// 初始化按钮事件监听器内部类
MyItemListener lis = new MyItemListener();
// 将三个菜单注册到事件监听器上
startMenuItem.addActionListener(lis);
backMenuItem.addActionListener(lis);
exitMenuItem.addActionListener(lis);
menuBar.add(sysMenu);// 将系统菜单添加到菜单栏上
setJMenuBar(menuBar);// 将menuBar设置为菜单栏
toolbar = new JPanel();// 工具面板实例化
// 三个按钮初始化
startButton = new JButton("重新开始");
exitButton = new JButton("退出");
backButton = new JButton("悔棋");
// 将工具面板按钮用FlowLayout布局
toolbar.setLayout(new FlowLayout(FlowLayout.LEFT));
// 将三个按钮添加到工具面板
toolbar.add(startButton);
toolbar.add(exitButton);
toolbar.add(backButton);
// 将三个按钮注册监听事件
startButton.addActionListener(lis);
exitButton.addActionListener(lis);
backButton.addActionListener(lis);
add(toolbar, BorderLayout.SOUTH);// 将工具面板布局到界面”南方“也就是下方
add(chessBoard);// 将面板对象添加到窗体上
// 设置界面关闭事件
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();// 自适应大小,布置容器,让它使用显示其内容所需的最小空间。
}
//菜单与按钮的监听器
private class MyItemListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
Object obj = e.getSource();// 获得事件源
if (obj == startMenuItem || obj == startButton) {
// 重新开始
System.out.println("重新开始");
chessBoard.restartGame();
}
else if (obj == exitMenuItem || obj == exitButton){
// 退出
System.exit(0);
}
else if (obj == backMenuItem || obj == backButton) {
// 悔棋
System.out.println("悔棋");
chessBoard.goback();
}
}
}
//main
public static void main(String[] args) {
StartChessJFrame f = new StartChessJFrame();// 创建主框架
f.setVisible(true);// 显示主框架
}
}
| 3,847 | 0.713991 | 0.713304 | 102 | 27.519608 | 20.130325 | 88 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.333333 | false | false |
7
|
f64fd31dfd173756ba061ca3284b7b3c0e224b92
| 22,660,247,520,769 |
a26ea49cb5f9462bef537e306758f2ddacff2f3f
|
/src/main/java/com/trows/attendance/controller/AccountController.java
|
eba19d52fb502c325f37003a54d0a099303147fc
|
[] |
no_license
|
trows/attendance
|
https://github.com/trows/attendance
|
366016b47c454584cf294d7f1565c7f763da5cd4
|
e2087070420d7795e9f79cd5447cc3f957da878d
|
refs/heads/master
| 2021-01-01T03:40:26.898000 | 2016-06-02T12:25:09 | 2016-06-02T12:25:09 | 57,179,229 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.trows.attendance.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.trows.attendance.entity.Account;
import com.trows.attendance.entity.Punch;
import com.trows.attendance.entity.Salary;
import com.trows.attendance.entity.Vacate;
import com.trows.attendance.service.*;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* Created by Throws_exception on 2015/12/28.
*/
@Controller
public class AccountController {
@Autowired
private AccountService accountService;
@Autowired
private PunchService punchService;
@Autowired
private SalaryService salaryService;
@Autowired
private VacateService vacateService;
@Autowired
private NoticeService noticeService;
private void print(HttpServletResponse response, String value) {
try {
response.getWriter().print(value);
} catch (IOException e) {
e.printStackTrace();
}
}
private void print(HttpServletResponse response, int value) {
try {
response.getWriter().print(value);
} catch (IOException e) {
e.printStackTrace();
}
}
@RequestMapping("/createAccount.do")
public void createAccount(@RequestParam("account") String accountStr, HttpServletResponse response) {
Account account = JSON.parseObject(accountStr, Account.class);
int result = accountService.insert(account, "createAccount");
account.setPassword(DigestUtils.md5Hex(DigestUtils.sha1Hex(account.getAccount_id() + "")));
accountService.update(account, "setPassword");
Punch punch = new Punch();
punch.setAccount_id(account.getAccount_id());
punchService.insert(punch, "initPunch");
Salary salary = new Salary();
salary.setAccount_id(account.getAccount_id());
salary.setBase_wage(Float.parseFloat(JSON.parseObject(accountStr).getString("base_wage")));
salaryService.insert(salary, "initSalary");
this.print(response, result);
}
@RequestMapping("/checkLogin.do")
public String checkLogin(HttpServletRequest request, @RequestParam("form-username") String user_name, @RequestParam("form-password") String password) {
int account_id;
if (user_name != null) {
account_id = Integer.parseInt(user_name);
} else {
return "redirect:./index.html";
}
Account account = accountService.getEntityByKey(account_id, "getAccountById");
if (account != null && account.getPassword().equals(DigestUtils.md5Hex(DigestUtils.sha1Hex(password)))) {
HttpSession session = request.getSession(true);
session.setAttribute("account_id", account_id);
session.setAttribute("user_name", account.getUser_name());
session.setAttribute("department", account.getDepartment());
session.setAttribute("level", account.getLevel());
switch (account.getLevel()) {
case 3:
return "redirect:./manageInfo.html";
default:
return "redirect:./toEmployeesPage.htm";
}
}
return "redirect:./index.html?return_code=300";
}
@RequestMapping("/toEmployeesPage.htm")
public String toEmployeesPage(HttpServletRequest request) {
int account_id = (Integer) request.getSession(true).getAttribute("account_id");
Account account = accountService.getEntityByKey(account_id, "getAccountById");
request.setAttribute("account", account);
Punch punch = punchService.getEntityByKey(account_id, "getPunchById");
Salary salary = salaryService.getEntityByKey(account_id, "getSalaryById");
if (salary.getCount_wage() == null) {
salary.setCount_wage("0");
} else {
SimpleDateFormat df = new SimpleDateFormat("MM");
int now = Integer.parseInt(df.format(new Date()));
String month_wage = JSON.parseObject(salary.getCount_wage()).getString(String.valueOf(now - 1));
if (month_wage != null) {
salary.setCount_wage(month_wage);
} else {
salary.setCount_wage("0");
}
}
request.setAttribute("noticeList", noticeService.getListByStr(account.getDepartment(), "getMyNotice"));
request.setAttribute("salary", salary);
request.setAttribute("punch", punch);
List<Vacate> list;
if (account.getLevel() == 1) {
list = vacateService.getListByKey(account_id, "getMyVacate");
request.setAttribute("vacateList", list);
return "./employees_page";
} else if (account.getLevel() == 2) {
list = vacateService.getListByStr(account.getDepartment(), "getDepartmentVacate");
request.setAttribute("vacateList", list);
return "./charge_page";
}
return "redirect:./index.html?return_code=300";
}
@RequestMapping("/changePassword.do")
public void changePassword(HttpServletRequest request, HttpServletResponse response) {
String origin = request.getParameter("origin");
String change = request.getParameter("change");
int account_id = (Integer) request.getSession(true).getAttribute("account_id");
Account account = accountService.getEntityByKey(account_id, "getAccountById");
if (account.getPassword().equals(DigestUtils.md5Hex(DigestUtils.sha1Hex(origin)))) {
account.setPassword(DigestUtils.md5Hex(DigestUtils.sha1Hex(change)));
this.print(response, accountService.update(account, "setPassword"));
} else {
this.print(response, 0);
}
}
@RequestMapping("/getDepartment.do")
public void getDepartment(@RequestParam("department") String department, HttpServletResponse response) {
// System.out.println(department);
List<Account> list = accountService.getListByStr(department.trim(), "getDepartment");
this.print(response, JSON.toJSONString(list,SerializerFeature.WriteNullStringAsEmpty,SerializerFeature.WriteNullNumberAsZero,
SerializerFeature.WriteMapNullValue));
}
@RequestMapping("/resetPassword.do")
public void resetPassword(@RequestParam("account_id") String account_id,HttpServletResponse response){
Account account =new Account();
account.setAccount_id(Integer.parseInt(account_id));
account.setPassword(DigestUtils.md5Hex(DigestUtils.sha1Hex(account_id)));
this.print(response,accountService.update(account,"resetPassword"));
}
@RequestMapping("/delAccount.do")
public void delAccount(@RequestParam("account_id") int account_id,HttpServletResponse response){
this.print(response,accountService.deleteByKey(account_id,"delAccount"));
}
@RequestMapping("/updateAccount.do")
public void updateAccount(@RequestParam("data") String data,HttpServletResponse response){
Account account = JSON.parseObject(data,Account.class);
System.out.println(account);
this.print(response,accountService.update(account,"updateAccount"));
}
@RequestMapping("/loginOut.htm")
public String loginOut(HttpServletRequest request){
request.getSession(true).invalidate();
return "redirect:./index.html";
}
@RequestMapping("/promote.do")
public void promote(@RequestParam("account_id") int account_id,HttpServletResponse response){
this.print(response,accountService.updateByKey(account_id,"promote"));
}
}
|
UTF-8
|
Java
| 8,115 |
java
|
AccountController.java
|
Java
|
[
{
"context": "l.Date;\nimport java.util.List;\n\n\n/**\n * Created by Throws_exception on 2015/12/28.\n */\n@Controller\npublic class Accou",
"end": 913,
"score": 0.9696238040924072,
"start": 897,
"tag": "USERNAME",
"value": "Throws_exception"
}
] | null |
[] |
package com.trows.attendance.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.trows.attendance.entity.Account;
import com.trows.attendance.entity.Punch;
import com.trows.attendance.entity.Salary;
import com.trows.attendance.entity.Vacate;
import com.trows.attendance.service.*;
import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* Created by Throws_exception on 2015/12/28.
*/
@Controller
public class AccountController {
@Autowired
private AccountService accountService;
@Autowired
private PunchService punchService;
@Autowired
private SalaryService salaryService;
@Autowired
private VacateService vacateService;
@Autowired
private NoticeService noticeService;
private void print(HttpServletResponse response, String value) {
try {
response.getWriter().print(value);
} catch (IOException e) {
e.printStackTrace();
}
}
private void print(HttpServletResponse response, int value) {
try {
response.getWriter().print(value);
} catch (IOException e) {
e.printStackTrace();
}
}
@RequestMapping("/createAccount.do")
public void createAccount(@RequestParam("account") String accountStr, HttpServletResponse response) {
Account account = JSON.parseObject(accountStr, Account.class);
int result = accountService.insert(account, "createAccount");
account.setPassword(DigestUtils.md5Hex(DigestUtils.sha1Hex(account.getAccount_id() + "")));
accountService.update(account, "setPassword");
Punch punch = new Punch();
punch.setAccount_id(account.getAccount_id());
punchService.insert(punch, "initPunch");
Salary salary = new Salary();
salary.setAccount_id(account.getAccount_id());
salary.setBase_wage(Float.parseFloat(JSON.parseObject(accountStr).getString("base_wage")));
salaryService.insert(salary, "initSalary");
this.print(response, result);
}
@RequestMapping("/checkLogin.do")
public String checkLogin(HttpServletRequest request, @RequestParam("form-username") String user_name, @RequestParam("form-password") String password) {
int account_id;
if (user_name != null) {
account_id = Integer.parseInt(user_name);
} else {
return "redirect:./index.html";
}
Account account = accountService.getEntityByKey(account_id, "getAccountById");
if (account != null && account.getPassword().equals(DigestUtils.md5Hex(DigestUtils.sha1Hex(password)))) {
HttpSession session = request.getSession(true);
session.setAttribute("account_id", account_id);
session.setAttribute("user_name", account.getUser_name());
session.setAttribute("department", account.getDepartment());
session.setAttribute("level", account.getLevel());
switch (account.getLevel()) {
case 3:
return "redirect:./manageInfo.html";
default:
return "redirect:./toEmployeesPage.htm";
}
}
return "redirect:./index.html?return_code=300";
}
@RequestMapping("/toEmployeesPage.htm")
public String toEmployeesPage(HttpServletRequest request) {
int account_id = (Integer) request.getSession(true).getAttribute("account_id");
Account account = accountService.getEntityByKey(account_id, "getAccountById");
request.setAttribute("account", account);
Punch punch = punchService.getEntityByKey(account_id, "getPunchById");
Salary salary = salaryService.getEntityByKey(account_id, "getSalaryById");
if (salary.getCount_wage() == null) {
salary.setCount_wage("0");
} else {
SimpleDateFormat df = new SimpleDateFormat("MM");
int now = Integer.parseInt(df.format(new Date()));
String month_wage = JSON.parseObject(salary.getCount_wage()).getString(String.valueOf(now - 1));
if (month_wage != null) {
salary.setCount_wage(month_wage);
} else {
salary.setCount_wage("0");
}
}
request.setAttribute("noticeList", noticeService.getListByStr(account.getDepartment(), "getMyNotice"));
request.setAttribute("salary", salary);
request.setAttribute("punch", punch);
List<Vacate> list;
if (account.getLevel() == 1) {
list = vacateService.getListByKey(account_id, "getMyVacate");
request.setAttribute("vacateList", list);
return "./employees_page";
} else if (account.getLevel() == 2) {
list = vacateService.getListByStr(account.getDepartment(), "getDepartmentVacate");
request.setAttribute("vacateList", list);
return "./charge_page";
}
return "redirect:./index.html?return_code=300";
}
@RequestMapping("/changePassword.do")
public void changePassword(HttpServletRequest request, HttpServletResponse response) {
String origin = request.getParameter("origin");
String change = request.getParameter("change");
int account_id = (Integer) request.getSession(true).getAttribute("account_id");
Account account = accountService.getEntityByKey(account_id, "getAccountById");
if (account.getPassword().equals(DigestUtils.md5Hex(DigestUtils.sha1Hex(origin)))) {
account.setPassword(DigestUtils.md5Hex(DigestUtils.sha1Hex(change)));
this.print(response, accountService.update(account, "setPassword"));
} else {
this.print(response, 0);
}
}
@RequestMapping("/getDepartment.do")
public void getDepartment(@RequestParam("department") String department, HttpServletResponse response) {
// System.out.println(department);
List<Account> list = accountService.getListByStr(department.trim(), "getDepartment");
this.print(response, JSON.toJSONString(list,SerializerFeature.WriteNullStringAsEmpty,SerializerFeature.WriteNullNumberAsZero,
SerializerFeature.WriteMapNullValue));
}
@RequestMapping("/resetPassword.do")
public void resetPassword(@RequestParam("account_id") String account_id,HttpServletResponse response){
Account account =new Account();
account.setAccount_id(Integer.parseInt(account_id));
account.setPassword(DigestUtils.md5Hex(DigestUtils.sha1Hex(account_id)));
this.print(response,accountService.update(account,"resetPassword"));
}
@RequestMapping("/delAccount.do")
public void delAccount(@RequestParam("account_id") int account_id,HttpServletResponse response){
this.print(response,accountService.deleteByKey(account_id,"delAccount"));
}
@RequestMapping("/updateAccount.do")
public void updateAccount(@RequestParam("data") String data,HttpServletResponse response){
Account account = JSON.parseObject(data,Account.class);
System.out.println(account);
this.print(response,accountService.update(account,"updateAccount"));
}
@RequestMapping("/loginOut.htm")
public String loginOut(HttpServletRequest request){
request.getSession(true).invalidate();
return "redirect:./index.html";
}
@RequestMapping("/promote.do")
public void promote(@RequestParam("account_id") int account_id,HttpServletResponse response){
this.print(response,accountService.updateByKey(account_id,"promote"));
}
}
| 8,115 | 0.677264 | 0.673444 | 196 | 40.403061 | 31.813484 | 155 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.755102 | false | false |
7
|
3f45651b33b990309408244bf17c6c3d09fcb739
| 7,447,473,292,474 |
bbc4113a7a233c248544c2391070cba360fcca15
|
/src/com/timbuchalka/FitBurger.java
|
3c8517594a448a90d2852bad0de341115797c0b6
|
[] |
no_license
|
tosiah/Inheritance-BurgerRestaurant
|
https://github.com/tosiah/Inheritance-BurgerRestaurant
|
7a7ba00a44bdc6529ce51255379c98beb50814f8
|
b2082bedf046fb72b8b6a23eb6a17a6347caac4f
|
refs/heads/master
| 2020-03-31T09:47:53.701000 | 2018-10-08T17:01:03 | 2018-10-08T17:01:03 | 152,111,243 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.timbuchalka;
/**
* Created by Antonina on 2017-05-06.
*/
public class FitBurger extends Burger{
private boolean avocado;
private boolean carrot;
public FitBurger(String meat, double price) {
super("brown rye", meat, price);
this.avocado = false;
this.carrot = false;
}
public boolean isAvocado() {
return avocado;
}
public void setAvocado(boolean avocado) {
this.avocado = avocado;
}
public boolean isCarrot() {
return carrot;
}
public void setCarrot(boolean carrot) {
this.carrot = carrot;
}
@Override
public String showOrderDetails() {
return super.showOrderDetails() + "\navocado: " + isAvocado() + "\ncarrot: " + isCarrot();
}
@Override
public double countCost() {
super.countCost();
if(avocado) {
this.price += 0.40;
}
if(carrot) {
this.price += 0.20;
}
return this.price;
}
}
|
UTF-8
|
Java
| 1,013 |
java
|
FitBurger.java
|
Java
|
[
{
"context": "package com.timbuchalka;\n\n/**\n * Created by Antonina on 2017-05-06.\n */\npublic class FitBurger extends",
"end": 52,
"score": 0.9995476603507996,
"start": 44,
"tag": "NAME",
"value": "Antonina"
}
] | null |
[] |
package com.timbuchalka;
/**
* Created by Antonina on 2017-05-06.
*/
public class FitBurger extends Burger{
private boolean avocado;
private boolean carrot;
public FitBurger(String meat, double price) {
super("brown rye", meat, price);
this.avocado = false;
this.carrot = false;
}
public boolean isAvocado() {
return avocado;
}
public void setAvocado(boolean avocado) {
this.avocado = avocado;
}
public boolean isCarrot() {
return carrot;
}
public void setCarrot(boolean carrot) {
this.carrot = carrot;
}
@Override
public String showOrderDetails() {
return super.showOrderDetails() + "\navocado: " + isAvocado() + "\ncarrot: " + isCarrot();
}
@Override
public double countCost() {
super.countCost();
if(avocado) {
this.price += 0.40;
}
if(carrot) {
this.price += 0.20;
}
return this.price;
}
}
| 1,013 | 0.565647 | 0.551826 | 49 | 19.67347 | 18.656277 | 98 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.367347 | false | false |
7
|
7fad9510faf5a14cdb563e52a46314f6b8f091ff
| 24,386,824,343,655 |
0de9c91955bdeb7a99eac16b3ad98b28d2b00721
|
/src/main/java/no/nav/fo/veilarbdialog/Application.java
|
83dbd1d0a0ada5dd4aab49a0276cca41ab303be7
|
[
"MIT"
] |
permissive
|
navikt/veilarbdialog
|
https://github.com/navikt/veilarbdialog
|
6af2f8e4fb60423c387a021d652bc55c48d4f31a
|
71de40f23c47d7c089da28d927439c3c0290777d
|
refs/heads/main
| 2023-09-01T20:07:08.744000 | 2023-08-17T12:10:32 | 2023-08-17T12:10:32 | 160,199,893 | 2 | 1 |
MIT
| false | 2023-09-08T11:31:07 | 2018-12-03T14:01:15 | 2023-01-21T12:53:34 | 2023-09-08T11:31:06 | 2,718 | 2 | 1 | 9 |
Java
| false | false |
package no.nav.fo.veilarbdialog;
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableSchedulerLock(defaultLockAtMostFor = "PT10M")
public class Application {
public static void main(String... args) {
SpringApplication.run(Application.class, args);
}
}
|
UTF-8
|
Java
| 439 |
java
|
Application.java
|
Java
|
[] | null |
[] |
package no.nav.fo.veilarbdialog;
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
@EnableSchedulerLock(defaultLockAtMostFor = "PT10M")
public class Application {
public static void main(String... args) {
SpringApplication.run(Application.class, args);
}
}
| 439 | 0.8041 | 0.799544 | 14 | 30.357143 | 25.280165 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.428571 | false | false |
7
|
97f97ea62a375bc6d1b333cd110a706934a33f16
| 28,673,201,697,793 |
a3021b4e731a61866208db9901a12fce94f4c21a
|
/src/main/java/com/example/demo/dateAndTime/DateAndTimeApp.java
|
a5073cbec4be6790b475933907dd271775fe8886
|
[] |
no_license
|
saechimdaeki/Study_Java8
|
https://github.com/saechimdaeki/Study_Java8
|
bdde38da8e4ba2e27b66a3ac3cd3ce490f3869ef
|
462076b8b053cd01dce6f68cf087364dd0700ee2
|
refs/heads/main
| 2023-02-04T06:06:56.844000 | 2020-12-28T09:57:04 | 2020-12-28T09:57:04 | 318,523,716 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.demo.dateAndTime;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
public class DateAndTimeApp {
public static void main(String[] args) throws InterruptedException {
Date date=new Date();//date인데 타임까지 포함하고있다능...?
long time=date.getTime(); // 이건 기계용 시간.
System.out.println(date);
System.out.println(time);
Thread.sleep(1000*3);
Date after3Seconds=new Date();
System.out.println(after3Seconds);
after3Seconds.setTime(time);
System.out.println(after3Seconds); //mutable 하다.
//Calendar keesunBirthDay=new GregorianCalendar(1982,7,15); Month 는 0부터시작하므로 아래와같이 하자..
Calendar keesunBirthDay=new GregorianCalendar(1982, Calendar.JULY,15);
System.out.println(keesunBirthDay.getTime());
//=======================Date와 Time API=======================
System.out.println("=============Date와 Time API================");
Instant instant=Instant.now(); //지금시간 (기계시간) 기준시 UTC, GMT
System.out.println(instant);
ZoneId zone=ZoneId.systemDefault();
System.out.println(zone);
ZonedDateTime zonedDateTime = instant.atZone(zone);
System.out.println(zonedDateTime);
Instant nowinst=Instant.now();
LocalDateTime now=LocalDateTime.now(); //인류 시간 (Local이 붙어있기 때문에현재 시스템 참고해서 나옴)
System.out.println(now);
LocalDateTime birthday=LocalDateTime.of(1982, Month.JULY,15,0,0,0);
ZonedDateTime nowInKorea=ZonedDateTime.now(ZoneId.of("Asia/Seoul")); //특정 zone의 시간을 보고싶을때
System.out.println(nowInKorea);
LocalDate today=LocalDate.now();
LocalDate thisYearBirthday=LocalDate.of(2021,Month.FEBRUARY,15);
Period between = Period.between(today, thisYearBirthday);
System.out.println(between.getDays());
Period until=today.until(thisYearBirthday);
System.out.println(until.get(ChronoUnit.DAYS)); //사람용 시간
Instant plus = nowinst.plus(10, ChronoUnit.SECONDS);
Duration between1 = Duration.between(nowinst, plus);//기계용 시간
System.out.println(between1);
//=============문자열 출력 위한 포매팅=====================
System.out.println("=============문자열 출력 위한 포매팅=====================");
LocalDateTime nowlocal=LocalDateTime.now();
DateTimeFormatter MMddyyyy = DateTimeFormatter.ofPattern("MM/dd/yyyy"); //포매팅
System.out.println(now.format(MMddyyyy));
LocalDate parse = LocalDate.parse("02/15/1994", MMddyyyy); //파싱
System.out.println(parse);
Date date1=new Date();
Instant instant1=date1.toInstant(); // 데이트 가지고 인스턴트 만들기 가능
Date newDate=Date.from(instant1); //인스턴트 가지고 데이트 만들기 가능
GregorianCalendar gregorianCalendar=new GregorianCalendar();
LocalDateTime dateTime=gregorianCalendar.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); // 그레고리 캘린더로 LOCALDATETIME만들기
ZonedDateTime dateTime1=gregorianCalendar.toInstant().atZone(ZoneId.systemDefault());
GregorianCalendar from = GregorianCalendar.from(dateTime1); //zonedDatetime으로 그레고리 캘린더 만들기 가능
ZoneId zoneId= TimeZone.getTimeZone("PST").toZoneId();
TimeZone timeZone = TimeZone.getTimeZone(zoneId);
}
}
|
UTF-8
|
Java
| 3,819 |
java
|
DateAndTimeApp.java
|
Java
|
[] | null |
[] |
package com.example.demo.dateAndTime;
import java.text.SimpleDateFormat;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
public class DateAndTimeApp {
public static void main(String[] args) throws InterruptedException {
Date date=new Date();//date인데 타임까지 포함하고있다능...?
long time=date.getTime(); // 이건 기계용 시간.
System.out.println(date);
System.out.println(time);
Thread.sleep(1000*3);
Date after3Seconds=new Date();
System.out.println(after3Seconds);
after3Seconds.setTime(time);
System.out.println(after3Seconds); //mutable 하다.
//Calendar keesunBirthDay=new GregorianCalendar(1982,7,15); Month 는 0부터시작하므로 아래와같이 하자..
Calendar keesunBirthDay=new GregorianCalendar(1982, Calendar.JULY,15);
System.out.println(keesunBirthDay.getTime());
//=======================Date와 Time API=======================
System.out.println("=============Date와 Time API================");
Instant instant=Instant.now(); //지금시간 (기계시간) 기준시 UTC, GMT
System.out.println(instant);
ZoneId zone=ZoneId.systemDefault();
System.out.println(zone);
ZonedDateTime zonedDateTime = instant.atZone(zone);
System.out.println(zonedDateTime);
Instant nowinst=Instant.now();
LocalDateTime now=LocalDateTime.now(); //인류 시간 (Local이 붙어있기 때문에현재 시스템 참고해서 나옴)
System.out.println(now);
LocalDateTime birthday=LocalDateTime.of(1982, Month.JULY,15,0,0,0);
ZonedDateTime nowInKorea=ZonedDateTime.now(ZoneId.of("Asia/Seoul")); //특정 zone의 시간을 보고싶을때
System.out.println(nowInKorea);
LocalDate today=LocalDate.now();
LocalDate thisYearBirthday=LocalDate.of(2021,Month.FEBRUARY,15);
Period between = Period.between(today, thisYearBirthday);
System.out.println(between.getDays());
Period until=today.until(thisYearBirthday);
System.out.println(until.get(ChronoUnit.DAYS)); //사람용 시간
Instant plus = nowinst.plus(10, ChronoUnit.SECONDS);
Duration between1 = Duration.between(nowinst, plus);//기계용 시간
System.out.println(between1);
//=============문자열 출력 위한 포매팅=====================
System.out.println("=============문자열 출력 위한 포매팅=====================");
LocalDateTime nowlocal=LocalDateTime.now();
DateTimeFormatter MMddyyyy = DateTimeFormatter.ofPattern("MM/dd/yyyy"); //포매팅
System.out.println(now.format(MMddyyyy));
LocalDate parse = LocalDate.parse("02/15/1994", MMddyyyy); //파싱
System.out.println(parse);
Date date1=new Date();
Instant instant1=date1.toInstant(); // 데이트 가지고 인스턴트 만들기 가능
Date newDate=Date.from(instant1); //인스턴트 가지고 데이트 만들기 가능
GregorianCalendar gregorianCalendar=new GregorianCalendar();
LocalDateTime dateTime=gregorianCalendar.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime(); // 그레고리 캘린더로 LOCALDATETIME만들기
ZonedDateTime dateTime1=gregorianCalendar.toInstant().atZone(ZoneId.systemDefault());
GregorianCalendar from = GregorianCalendar.from(dateTime1); //zonedDatetime으로 그레고리 캘린더 만들기 가능
ZoneId zoneId= TimeZone.getTimeZone("PST").toZoneId();
TimeZone timeZone = TimeZone.getTimeZone(zoneId);
}
}
| 3,819 | 0.656871 | 0.640738 | 88 | 38.44318 | 31.399137 | 140 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.840909 | false | false |
7
|
457a3fc806a9d8e8e3c87de0abc74b44fba6452f
| 29,575,144,834,323 |
db3fde5ae2a9b2f7844f47152d97f652f4fc0b3b
|
/src/main/java/org/cejug/cc_jsf/pojo/Produto.java
|
00fe583931bceba76e448fc61d7e4ab1cd124fdf
|
[] |
no_license
|
samuelteixeiras/cc_jsf
|
https://github.com/samuelteixeiras/cc_jsf
|
04317d4d6c0d9a89d09b0a48fa3bee48466516d1
|
098612bb977e09337b3c8586efc54d055c30a98e
|
refs/heads/master
| 2021-07-12T04:31:25.592000 | 2013-10-29T01:17:18 | 2013-10-29T01:17:18 | 13,942,136 | 0 | 0 | null | true | 2021-06-29T21:08:14 | 2013-10-29T00:07:07 | 2014-09-09T14:41:48 | 2021-06-29T21:08:12 | 203 | 0 | 0 | 1 |
Java
| false | false |
package org.cejug.cc_jsf.pojo;
import java.util.Date;
import java.io.Serializable;
import java.math.BigDecimal;
//Importações necessárias para uso das anotações
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Classe que representa um produto
*
*/
@Entity //define que esta classe será uma tabela em um base de dados
@Table(name = "produtos") //define o nome da tabela na base de dados
public class Produto implements Serializable{
//Propriedades
private static final long serialVersionUID = 8114001930137970115L;
@Id //diz que a propriedade id deve ser o identificador desta tabela no banco
@GeneratedValue(strategy = GenerationType.AUTO) //forma como será gerado este identificador
private Integer id; //código único identificador
@Column(length = 50) //tamanho do campo nome
private String nome; //uma descrição para o produto
@Column(precision=25, scale=10) //definindo precisão e escala
private BigDecimal preco; //preço para a venda
@Column(length=1) //tamanho do campo
private Byte situacao; //Guardara o estado do produnto sendo estes: novo, bom estado, mais ou menos e quebrado
private Boolean inativo; //não é mais usado no sistema
@Lob //equivale ao blob, como um varchar de tamanho indefinido
private String observacoes; //dados adicionais
@Temporal(TemporalType.DATE) //diz que esta propriedade será uma data
@Column(name = "data_de_cadastro", nullable = false, updatable = false) // define o nome da coluna; que não pode ser nula; e a propriedade não pode ser alterada
private Date dataDeCadastro; //data em que o produto foi registrado no banco de dados
//Construtores
/**
* Construtor padrão, ele é necessário (obrigatório) para o correto funcionamento do JPA
*/
public Produto(){}
//Getters e Setters
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public BigDecimal getPreco() {
return preco;
}
public void setPreco(BigDecimal preco) {
this.preco = preco;
}
public Byte getSituacao() {
return situacao;
}
public void setSituacao(Byte situacao) {
this.situacao = situacao;
}
public Boolean getInativo() {
return inativo;
}
public void setInativo(Boolean inativo) {
this.inativo = inativo;
}
public String getObservacoes() {
return observacoes;
}
public void setObservacoes(String observacoes) {
this.observacoes = observacoes;
}
public Date getDataDeCadastro() {
return dataDeCadastro;
}
public void setDataDeCadastro(Date dataDeCadastro) {
this.dataDeCadastro = dataDeCadastro;
}
//Métodos Sobrescritos
/**
* Sobrescreve hashCode e equals, não é obrigatório
* Mais a respeito em: http://stackoverflow.com/questions/5031614/the-jpa-hashcode-equals-dilemma
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Produto other = (Produto) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "Id: " + this.id + " Nome: " + this.nome;
}
}
|
UTF-8
|
Java
| 3,900 |
java
|
Produto.java
|
Java
|
[] | null |
[] |
package org.cejug.cc_jsf.pojo;
import java.util.Date;
import java.io.Serializable;
import java.math.BigDecimal;
//Importações necessárias para uso das anotações
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
/**
* Classe que representa um produto
*
*/
@Entity //define que esta classe será uma tabela em um base de dados
@Table(name = "produtos") //define o nome da tabela na base de dados
public class Produto implements Serializable{
//Propriedades
private static final long serialVersionUID = 8114001930137970115L;
@Id //diz que a propriedade id deve ser o identificador desta tabela no banco
@GeneratedValue(strategy = GenerationType.AUTO) //forma como será gerado este identificador
private Integer id; //código único identificador
@Column(length = 50) //tamanho do campo nome
private String nome; //uma descrição para o produto
@Column(precision=25, scale=10) //definindo precisão e escala
private BigDecimal preco; //preço para a venda
@Column(length=1) //tamanho do campo
private Byte situacao; //Guardara o estado do produnto sendo estes: novo, bom estado, mais ou menos e quebrado
private Boolean inativo; //não é mais usado no sistema
@Lob //equivale ao blob, como um varchar de tamanho indefinido
private String observacoes; //dados adicionais
@Temporal(TemporalType.DATE) //diz que esta propriedade será uma data
@Column(name = "data_de_cadastro", nullable = false, updatable = false) // define o nome da coluna; que não pode ser nula; e a propriedade não pode ser alterada
private Date dataDeCadastro; //data em que o produto foi registrado no banco de dados
//Construtores
/**
* Construtor padrão, ele é necessário (obrigatório) para o correto funcionamento do JPA
*/
public Produto(){}
//Getters e Setters
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public BigDecimal getPreco() {
return preco;
}
public void setPreco(BigDecimal preco) {
this.preco = preco;
}
public Byte getSituacao() {
return situacao;
}
public void setSituacao(Byte situacao) {
this.situacao = situacao;
}
public Boolean getInativo() {
return inativo;
}
public void setInativo(Boolean inativo) {
this.inativo = inativo;
}
public String getObservacoes() {
return observacoes;
}
public void setObservacoes(String observacoes) {
this.observacoes = observacoes;
}
public Date getDataDeCadastro() {
return dataDeCadastro;
}
public void setDataDeCadastro(Date dataDeCadastro) {
this.dataDeCadastro = dataDeCadastro;
}
//Métodos Sobrescritos
/**
* Sobrescreve hashCode e equals, não é obrigatório
* Mais a respeito em: http://stackoverflow.com/questions/5031614/the-jpa-hashcode-equals-dilemma
*/
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((id == null) ? 0 : id.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
Produto other = (Produto) obj;
if (id == null) {
if (other.id != null)
return false;
} else if (!id.equals(other.id))
return false;
return true;
}
@Override
public String toString() {
return "Id: " + this.id + " Nome: " + this.nome;
}
}
| 3,900 | 0.692308 | 0.682757 | 154 | 23.155844 | 26.043453 | 161 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.344156 | false | false |
7
|
dde0e653e419f615670c881c93df45a3d7508db8
| 29,575,144,837,109 |
94cd22ff76daf8124dd1cad7d7c218d8b5d7107d
|
/src/main/java/com/esure/radar/calculation/operations/Minus.java
|
a3dff593168560a5bd89246787b2c0ad71b456f8
|
[] |
no_license
|
ddavey2018/Radar
|
https://github.com/ddavey2018/Radar
|
4c59b86528de1d52e32f6b4f5f69b53edc0da8c2
|
7707620a933ae4aa6fe5bd1677dccda2b8f16f2c
|
refs/heads/master
| 2020-03-17T21:41:02.672000 | 2018-06-01T15:00:11 | 2018-06-01T15:00:11 | 133,969,448 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.esure.radar.calculation.operations;
import com.esure.radar.fields.Value;
public class Minus extends AbstractionCalculationOperation
{
protected Minus(Value<? extends Number> n1, Value<? extends Number> n2)
{
super(n1, n2);
}
@Override
public Number getValue()
{
return n1.getValue().doubleValue() - n2.getValue().doubleValue();
}
}
|
UTF-8
|
Java
| 412 |
java
|
Minus.java
|
Java
|
[] | null |
[] |
package com.esure.radar.calculation.operations;
import com.esure.radar.fields.Value;
public class Minus extends AbstractionCalculationOperation
{
protected Minus(Value<? extends Number> n1, Value<? extends Number> n2)
{
super(n1, n2);
}
@Override
public Number getValue()
{
return n1.getValue().doubleValue() - n2.getValue().doubleValue();
}
}
| 412 | 0.640777 | 0.626214 | 19 | 19.68421 | 25.131344 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.315789 | false | false |
7
|
13858d1225d37b61755628dcddea23fb54f9f565
| 22,771,916,660,387 |
09521cd84d06e60a174ea50e6105f4993d4d5d79
|
/generatedcode/EOGUI.java
|
2611bf972f05593d19f475cdf3ab659014118a28
|
[] |
no_license
|
barkow15/PlanOrg
|
https://github.com/barkow15/PlanOrg
|
9247382f06d6bd1639b2a49367a075456fc4f969
|
c0340b835e5618949a018f7558d0ad752b06fe37
|
refs/heads/master
| 2020-04-07T08:31:01.049000 | 2019-02-15T10:39:29 | 2019-02-15T10:39:29 | 158,217,452 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import javax.swing.*;
import java.awt.*;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.GraphicsDevice;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.*;
import java.util.*;
/**
Administrates the GUI, what panels are shown and communicates with EOManager, with data the user creates, reads, updates and deletes.
*/
public class EOGUI {
// JPanel[] screens = null;
private Map<EODisplayType, EOPanel> screens = null;
private JFrame frame = null;
private int screenwidth = 0;
private int screenheight = 0;
EOManager eomanager = null;
EOBreadcrumb breadcrumb = null;
//usertype = 1: Secretarian
//usertype = 2: Facilitator
int usertype = 2;
public EOGUI(EOManager eomanager)
{
this.breadcrumb = new EOBreadcrumb();
this.eomanager = eomanager;
if(usertype == 1)
{
frame = new JFrame("Event Organizer Administration 1.1");
}
else
{
frame = new JFrame("Event Organizer 1.1");
}
//frame.setUndecorated(true);
//GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
//gd.setFullScreenWindow(frame);
frame.setResizable(false);
frame.setSize(1300, 700);
frame.setLayout(null);
frame.setVisible(true);
//We will close Java when the screen is exited
frame.addWindowListener(
new WindowAdapter()
{
public void windowClosed(WindowEvent e)
{
System.out.println("windowClosed");
Runtime.getRuntime().exit(0);
}
public void windowClosing(WindowEvent e)
{
System.out.println("windowClosing");
Runtime.getRuntime().exit(0);
}
});
screenwidth = frame.getWidth();
screenheight = frame.getHeight();
//Setting up our different screens
// screens = new JPanel[8];
screens = new HashMap<EODisplayType, EOPanel>();
screens.put(EODisplayType.START, new EOPanelStartMenu(this));
screens.put(EODisplayType.CREATEARRANGEMENT, new EOPanelCreateArrangement(this));
screens.put(EODisplayType.UPDATEARRANGEMENT, new EOPanelUpdateArrangement(this));
screens.put(EODisplayType.DELETEARRANGEMENT, new EOPanelDeleteArrangement(this));
screens.put(EODisplayType.OPENARRANGEMENT, new EOPanelOpenArrangement(this));
screens.put(EODisplayType.CREATEEVENT, new EOPanelCreateEvent(this));
screens.put(EODisplayType.UPDATEEVENT, new EOPanelUpdateEvent(this));
screens.put(EODisplayType.OPENEVENT, new EOPanelOpenEvent(this));
screens.put(EODisplayType.ADMEVENTTYPE, new EOPanelADMEventType(this));
screens.put(EODisplayType.OPENEVENTTYPE, new EOPanelOpenEventType(this));
screens.put(EODisplayType.ADMFACILITATOR, new EOPanelADMFacilitator(this));
screens.put(EODisplayType.OPENFACILITATOR, new EOPanelOpenFacilitator(this));
screens.put(EODisplayType.EXPORT, new EOPanelExport(this));
screens.put(EODisplayType.IMPORT, new EOPanelImport(this));
screens.put(EODisplayType.ERROR, new EOPanelError(this));
DisableAllScreen();
runCommand(EOOperation.START);
}
public javax.swing.border.Border getDefaultBorder()
{
return(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
}
/**
Returns a que that shows where the user is in the system, so the user can keep track of current location.
*/
public EOBreadcrumb getBreadcrumb()
{
return(this.breadcrumb);
}
public Font getFontbig (){
return (new Font ("Arial", Font.PLAIN,40));
}
public Font getFontmedium (){
return (new Font ("Arial", Font.PLAIN,20));
}
public Font getFontsmall (){
return (new Font ("Arial", Font.PLAIN,12));
}
/**
Disable all panels.
*/
void DisableAllScreen()
{
for(Map.Entry m:screens.entrySet())
{
((JPanel)m.getValue()).setBounds(0, 0, screenwidth, screenheight);
((JPanel)m.getValue()).setVisible(false);
frame.add((JPanel)m.getValue());
}
}
/**
Get width of the application
*/
public int getWidth()
{
return(screenwidth);
}
/**
Get height of the application
*/
public int getHeight()
{
return(screenheight);
}
/**
*
* Main metode that is called from the panels, this metode controls which panel that is shown through the EOOperation.getDisplayType.
*/
public void runCommand(EOOperation operation) {
EOOperation coperation = eomanager.runCommand(operation);
DisableAllScreen();
if(coperation.getDisplayType() == null)
{
System.out.println("DisplayType == null");
}
if(coperation.getData() == null)
{
System.out.println("getData == null");
}
System.out.println("Viser: " + coperation.getDisplayType());
screens.get(coperation.getDisplayType()).setVisible(true, coperation);
}
/**
* <pre>
* Returns if the user is administrator or not.
* If the user is not administrator, they only have read options availab.e
* </pre>
*/
public boolean isAdministrator()
{
return(usertype == 1);
}
/**
* <pre>
* Shows a dialogbox to the user
* </pre>
*/
public void dialogbox(String msg)
{
JOptionPane.showMessageDialog(frame, msg);
}
}
|
UTF-8
|
Java
| 5,695 |
java
|
EOGUI.java
|
Java
|
[] | null |
[] |
import javax.swing.*;
import java.awt.*;
import java.awt.Dimension;
import java.awt.GraphicsEnvironment;
import java.awt.GraphicsDevice;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.*;
import java.util.*;
/**
Administrates the GUI, what panels are shown and communicates with EOManager, with data the user creates, reads, updates and deletes.
*/
public class EOGUI {
// JPanel[] screens = null;
private Map<EODisplayType, EOPanel> screens = null;
private JFrame frame = null;
private int screenwidth = 0;
private int screenheight = 0;
EOManager eomanager = null;
EOBreadcrumb breadcrumb = null;
//usertype = 1: Secretarian
//usertype = 2: Facilitator
int usertype = 2;
public EOGUI(EOManager eomanager)
{
this.breadcrumb = new EOBreadcrumb();
this.eomanager = eomanager;
if(usertype == 1)
{
frame = new JFrame("Event Organizer Administration 1.1");
}
else
{
frame = new JFrame("Event Organizer 1.1");
}
//frame.setUndecorated(true);
//GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
//gd.setFullScreenWindow(frame);
frame.setResizable(false);
frame.setSize(1300, 700);
frame.setLayout(null);
frame.setVisible(true);
//We will close Java when the screen is exited
frame.addWindowListener(
new WindowAdapter()
{
public void windowClosed(WindowEvent e)
{
System.out.println("windowClosed");
Runtime.getRuntime().exit(0);
}
public void windowClosing(WindowEvent e)
{
System.out.println("windowClosing");
Runtime.getRuntime().exit(0);
}
});
screenwidth = frame.getWidth();
screenheight = frame.getHeight();
//Setting up our different screens
// screens = new JPanel[8];
screens = new HashMap<EODisplayType, EOPanel>();
screens.put(EODisplayType.START, new EOPanelStartMenu(this));
screens.put(EODisplayType.CREATEARRANGEMENT, new EOPanelCreateArrangement(this));
screens.put(EODisplayType.UPDATEARRANGEMENT, new EOPanelUpdateArrangement(this));
screens.put(EODisplayType.DELETEARRANGEMENT, new EOPanelDeleteArrangement(this));
screens.put(EODisplayType.OPENARRANGEMENT, new EOPanelOpenArrangement(this));
screens.put(EODisplayType.CREATEEVENT, new EOPanelCreateEvent(this));
screens.put(EODisplayType.UPDATEEVENT, new EOPanelUpdateEvent(this));
screens.put(EODisplayType.OPENEVENT, new EOPanelOpenEvent(this));
screens.put(EODisplayType.ADMEVENTTYPE, new EOPanelADMEventType(this));
screens.put(EODisplayType.OPENEVENTTYPE, new EOPanelOpenEventType(this));
screens.put(EODisplayType.ADMFACILITATOR, new EOPanelADMFacilitator(this));
screens.put(EODisplayType.OPENFACILITATOR, new EOPanelOpenFacilitator(this));
screens.put(EODisplayType.EXPORT, new EOPanelExport(this));
screens.put(EODisplayType.IMPORT, new EOPanelImport(this));
screens.put(EODisplayType.ERROR, new EOPanelError(this));
DisableAllScreen();
runCommand(EOOperation.START);
}
public javax.swing.border.Border getDefaultBorder()
{
return(BorderFactory.createLineBorder(Color.LIGHT_GRAY, 1));
}
/**
Returns a que that shows where the user is in the system, so the user can keep track of current location.
*/
public EOBreadcrumb getBreadcrumb()
{
return(this.breadcrumb);
}
public Font getFontbig (){
return (new Font ("Arial", Font.PLAIN,40));
}
public Font getFontmedium (){
return (new Font ("Arial", Font.PLAIN,20));
}
public Font getFontsmall (){
return (new Font ("Arial", Font.PLAIN,12));
}
/**
Disable all panels.
*/
void DisableAllScreen()
{
for(Map.Entry m:screens.entrySet())
{
((JPanel)m.getValue()).setBounds(0, 0, screenwidth, screenheight);
((JPanel)m.getValue()).setVisible(false);
frame.add((JPanel)m.getValue());
}
}
/**
Get width of the application
*/
public int getWidth()
{
return(screenwidth);
}
/**
Get height of the application
*/
public int getHeight()
{
return(screenheight);
}
/**
*
* Main metode that is called from the panels, this metode controls which panel that is shown through the EOOperation.getDisplayType.
*/
public void runCommand(EOOperation operation) {
EOOperation coperation = eomanager.runCommand(operation);
DisableAllScreen();
if(coperation.getDisplayType() == null)
{
System.out.println("DisplayType == null");
}
if(coperation.getData() == null)
{
System.out.println("getData == null");
}
System.out.println("Viser: " + coperation.getDisplayType());
screens.get(coperation.getDisplayType()).setVisible(true, coperation);
}
/**
* <pre>
* Returns if the user is administrator or not.
* If the user is not administrator, they only have read options availab.e
* </pre>
*/
public boolean isAdministrator()
{
return(usertype == 1);
}
/**
* <pre>
* Shows a dialogbox to the user
* </pre>
*/
public void dialogbox(String msg)
{
JOptionPane.showMessageDialog(frame, msg);
}
}
| 5,695 | 0.625637 | 0.620369 | 184 | 29.956522 | 27.579693 | 134 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.61413 | false | false |
7
|
808038f97f5ad84ec794ea0fc9fb08ee55f79033
| 25,615,185,002,915 |
3e01b532678828f07530cbee44909b5810f31021
|
/src/fr/eni_ecole/qcm/servlet/Referentiel.java
|
48eabcb0304cbebf687bc8ad7e6929dcd0defafd
|
[] |
no_license
|
JordanDavid/ProjetQCM
|
https://github.com/JordanDavid/ProjetQCM
|
0588dbdcdf393f35188acad016548fbb8469c5cc
|
1cc02cf070c3b964022a7ad551c718e6d1d75434
|
refs/heads/master
| 2016-08-12T19:56:04.265000 | 2015-10-30T14:22:26 | 2015-10-30T14:22:26 | 44,527,563 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package fr.eni_ecole.qcm.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Type;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.json.*;
import fr.eni_ecole.qcm.bean.Question;
import fr.eni_ecole.qcm.bean.Reponse;
import fr.eni_ecole.qcm.bean.Theme;
import fr.eni_ecole.qcm.dal.DALQuestion;
import fr.eni_ecole.qcm.dal.DALReponse;
import fr.eni_ecole.qcm.dal.DALTheme;
/**
* Servlet implementation class Referentiel
*/
public class Referentiel extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Referentiel() {
super();
}
/**
* @see Servlet#init(ServletConfig)
*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
/**
* @see Servlet#destroy()
*/
public void destroy() {
;
}
/**
* @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
*/
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.service(request, response);
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request,response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request,response);
}
private void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher dispatcher = null;
String action = request.getParameter("action");
List<Theme> themes = null;
JSONObject json = null;
try {
if("getQuestions".equals(action)){
HashMap<String, List<Question>> map = new HashMap<String, List<Question>>();
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("id"))); ;
List<Question> questions = DALQuestion.getQuestionByTheme(theme);
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-store");
map.put("data", questions);
json = new JSONObject(map);
PrintWriter out = response.getWriter();
out.println(json.toString());
out.flush();
}else if("getReponses".equals(action)){
HashMap<String, List<Reponse>> map = new HashMap<String, List<Reponse>>();
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("idTheme"))); ;
Question question = new Question();
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
question.setTheme(theme);
List<Reponse>reponses = DALReponse.selectByThemeQuestion(question);
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-store");
map.put("data", reponses);
json = new JSONObject(map);
PrintWriter out = response.getWriter();
out.println(json.toString());
out.flush();
}else {
if("ajoutTheme".equals(action)){
String libelle = request.getParameter("libelle_theme");
Theme theme = new Theme();
theme.setLibelle(libelle);
theme = DALTheme.ajouter(theme);
}else if("supprimerTheme".equals(action)){
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("idTheme")));
DALTheme.supprimer(theme);
} else if("changerThemeQuestion".equals(action)){
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("idTheme")));
Question question = new Question();
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
question.setTheme(theme);
DALQuestion.changerTheme(question);
} else if("supprimerQuestion".equals(action)){
Question question = new Question();
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
DALQuestion.supprimer(question);
} else if("enregistrerQuestion".equals(action)){
//Récupère les paramètre de la requête
String enonce = request.getParameter("enonce");
String image = request.getParameter("image");
Boolean typeQuestion = Integer.parseInt(request.getParameter("typeQuestion")) == 1 ? true : false;
//Récupère le thème concerné
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("theme")));
//Création de la question
Question question = new Question();
question.setEnonce(enonce);
question.setImage(image);
question.setTypeReponse(typeQuestion);
question.setTheme(theme);
if(request.getParameter("idQuestion") == null || (Integer.parseInt(request.getParameter("idQuestion"))) <= 0 ){
question = DALQuestion.ajouter(question);
}else{
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
DALQuestion.modifier(question);
}
//récupère la liste des réponses
JSONArray reponses = new JSONArray(request.getParameter("lst_reponses"));
for(int i=0; i < reponses.length();i++){
if(!reponses.isNull(i)){
JSONObject reponse = reponses.getJSONObject(i);
Reponse r = new Reponse();
r.setReponse(reponse.getString("reponse"));
r.setIdReponse(reponse.getInt("idReponse"));
r.setBonneReponse(reponse.getBoolean("bonneReponse"));
r.setQuestion(question);
if(r.getIdReponse()<1){
DALReponse.ajouter(r);
}else{
DALReponse.modifier(r);
}
}
}
}
themes = DALTheme.selectAll();
dispatcher = request.getRequestDispatcher("/formateur/gestionReferentiel.jsp");
request.setAttribute("themes", themes);
dispatcher.forward(request, response);
}
} catch (Exception e) {
dispatcher = request.getRequestDispatcher("/erreur.jsp");
request.setAttribute("erreur", e);
dispatcher.forward(request, response);
}
}
}
|
UTF-8
|
Java
| 6,623 |
java
|
Referentiel.java
|
Java
|
[] | null |
[] |
package fr.eni_ecole.qcm.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.List;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.lang.reflect.Type;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import org.json.*;
import fr.eni_ecole.qcm.bean.Question;
import fr.eni_ecole.qcm.bean.Reponse;
import fr.eni_ecole.qcm.bean.Theme;
import fr.eni_ecole.qcm.dal.DALQuestion;
import fr.eni_ecole.qcm.dal.DALReponse;
import fr.eni_ecole.qcm.dal.DALTheme;
/**
* Servlet implementation class Referentiel
*/
public class Referentiel extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public Referentiel() {
super();
}
/**
* @see Servlet#init(ServletConfig)
*/
public void init(ServletConfig config) throws ServletException {
super.init(config);
}
/**
* @see Servlet#destroy()
*/
public void destroy() {
;
}
/**
* @see HttpServlet#service(HttpServletRequest request, HttpServletResponse response)
*/
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.service(request, response);
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request,response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
processRequest(request,response);
}
private void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher dispatcher = null;
String action = request.getParameter("action");
List<Theme> themes = null;
JSONObject json = null;
try {
if("getQuestions".equals(action)){
HashMap<String, List<Question>> map = new HashMap<String, List<Question>>();
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("id"))); ;
List<Question> questions = DALQuestion.getQuestionByTheme(theme);
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-store");
map.put("data", questions);
json = new JSONObject(map);
PrintWriter out = response.getWriter();
out.println(json.toString());
out.flush();
}else if("getReponses".equals(action)){
HashMap<String, List<Reponse>> map = new HashMap<String, List<Reponse>>();
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("idTheme"))); ;
Question question = new Question();
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
question.setTheme(theme);
List<Reponse>reponses = DALReponse.selectByThemeQuestion(question);
response.setContentType("application/json");
response.setHeader("Cache-Control", "no-store");
map.put("data", reponses);
json = new JSONObject(map);
PrintWriter out = response.getWriter();
out.println(json.toString());
out.flush();
}else {
if("ajoutTheme".equals(action)){
String libelle = request.getParameter("libelle_theme");
Theme theme = new Theme();
theme.setLibelle(libelle);
theme = DALTheme.ajouter(theme);
}else if("supprimerTheme".equals(action)){
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("idTheme")));
DALTheme.supprimer(theme);
} else if("changerThemeQuestion".equals(action)){
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("idTheme")));
Question question = new Question();
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
question.setTheme(theme);
DALQuestion.changerTheme(question);
} else if("supprimerQuestion".equals(action)){
Question question = new Question();
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
DALQuestion.supprimer(question);
} else if("enregistrerQuestion".equals(action)){
//Récupère les paramètre de la requête
String enonce = request.getParameter("enonce");
String image = request.getParameter("image");
Boolean typeQuestion = Integer.parseInt(request.getParameter("typeQuestion")) == 1 ? true : false;
//Récupère le thème concerné
Theme theme = new Theme();
theme.setIdTheme(Integer.parseInt(request.getParameter("theme")));
//Création de la question
Question question = new Question();
question.setEnonce(enonce);
question.setImage(image);
question.setTypeReponse(typeQuestion);
question.setTheme(theme);
if(request.getParameter("idQuestion") == null || (Integer.parseInt(request.getParameter("idQuestion"))) <= 0 ){
question = DALQuestion.ajouter(question);
}else{
question.setIdQuestion(Integer.parseInt(request.getParameter("idQuestion")));
DALQuestion.modifier(question);
}
//récupère la liste des réponses
JSONArray reponses = new JSONArray(request.getParameter("lst_reponses"));
for(int i=0; i < reponses.length();i++){
if(!reponses.isNull(i)){
JSONObject reponse = reponses.getJSONObject(i);
Reponse r = new Reponse();
r.setReponse(reponse.getString("reponse"));
r.setIdReponse(reponse.getInt("idReponse"));
r.setBonneReponse(reponse.getBoolean("bonneReponse"));
r.setQuestion(question);
if(r.getIdReponse()<1){
DALReponse.ajouter(r);
}else{
DALReponse.modifier(r);
}
}
}
}
themes = DALTheme.selectAll();
dispatcher = request.getRequestDispatcher("/formateur/gestionReferentiel.jsp");
request.setAttribute("themes", themes);
dispatcher.forward(request, response);
}
} catch (Exception e) {
dispatcher = request.getRequestDispatcher("/erreur.jsp");
request.setAttribute("erreur", e);
dispatcher.forward(request, response);
}
}
}
| 6,623 | 0.695869 | 0.695113 | 206 | 31.082523 | 26.997446 | 120 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.626214 | false | false |
7
|
5965c9f97d3cb0c34b8f5f83aa2cd73b36f15c53
| 21,337,397,575,398 |
96a4e53df7e080b9d7ba85a424fc4a02b9677c59
|
/app/src/main/java/com/yz/yikfrl/yizhilearning/contract/detail/WebViewLoadContract.java
|
33ccb42e7e727803312bd216bfd0672b246bf557
|
[] |
no_license
|
yikfrl/YiZhiLearning
|
https://github.com/yikfrl/YiZhiLearning
|
571c4ba3ece53cf1f485a77d84f0dd6c04bf029a
|
9600887dffeaa101e791a07d147403730f11cb65
|
refs/heads/master
| 2021-05-02T12:42:57.905000 | 2018-03-09T10:03:40 | 2018-03-09T10:03:40 | 120,745,984 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.yz.yikfrl.yizhilearning.contract.detail;
import com.yz.yikfrl.yizhilearning.presenter.detail.BaseWebViewLoadPresenter;
/**
* Created by yangz on 2018/3/5.
*
* webview加载更多详情,传入url显示webview
*/
public interface WebViewLoadContract {
abstract class WebViewLoadPresenter extends BaseWebViewLoadPresenter<IWebViewLoadModel,
IWebViewLoadView>{
/**
* 加载url
* @param url url
*/
public abstract void loadUrl(String url);
}
interface IWebViewLoadModel extends BaseWebViewLoadContract.IBaseWebViewLoadModel{
}
interface IWebViewLoadView extends BaseWebViewLoadContract.IBaseWebViewLoadView{
/**
* 显示url详情
*
* @param url url
*/
void showUrlDetail(String url);
}
}
|
UTF-8
|
Java
| 837 |
java
|
WebViewLoadContract.java
|
Java
|
[
{
"context": "etail.BaseWebViewLoadPresenter;\n\n/**\n * Created by yangz on 2018/3/5.\n *\n * webview加载更多详情,传入url显示webview\n ",
"end": 156,
"score": 0.9995952248573303,
"start": 151,
"tag": "USERNAME",
"value": "yangz"
}
] | null |
[] |
package com.yz.yikfrl.yizhilearning.contract.detail;
import com.yz.yikfrl.yizhilearning.presenter.detail.BaseWebViewLoadPresenter;
/**
* Created by yangz on 2018/3/5.
*
* webview加载更多详情,传入url显示webview
*/
public interface WebViewLoadContract {
abstract class WebViewLoadPresenter extends BaseWebViewLoadPresenter<IWebViewLoadModel,
IWebViewLoadView>{
/**
* 加载url
* @param url url
*/
public abstract void loadUrl(String url);
}
interface IWebViewLoadModel extends BaseWebViewLoadContract.IBaseWebViewLoadModel{
}
interface IWebViewLoadView extends BaseWebViewLoadContract.IBaseWebViewLoadView{
/**
* 显示url详情
*
* @param url url
*/
void showUrlDetail(String url);
}
}
| 837 | 0.672478 | 0.665006 | 32 | 24.09375 | 27.129734 | 91 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.15625 | false | false |
7
|
5e16e2116405c7755450f77cc98d66b9f51d4e05
| 10,763,188,045,472 |
40828700b0e12620b7aaa1d64cc9d659cb366086
|
/target/tomcat/work/Tomcat/localhost/_/org/apache/jsp/WEB_002dINF/content/question/list_jsp.java
|
c5631c559a41f9044c3e872cb1220270613b0049
|
[] |
no_license
|
xiongruixiang/project01
|
https://github.com/xiongruixiang/project01
|
aca2a643bbb489a30030965e223ece757efab212
|
b6c960460743d133b184024e62fc1b78b613885d
|
refs/heads/master
| 2021-01-20T06:55:16.379000 | 2017-03-04T13:18:21 | 2017-03-04T13:18:21 | 83,684,954 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.37
* Generated at: 2016-09-21 21:50:49 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.WEB_002dINF.content.question;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class list_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fif_0026_005ftest;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005felse;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005furl_0026_005faction;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fa_0026_005fhref;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005felse = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005furl_0026_005faction = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.release();
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.release();
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.release();
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.release();
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.release();
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.release();
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.release();
_005fjspx_005ftagPool_005fs_005felse.release();
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.release();
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.release();
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.release();
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html class='no-js' lang='en'>\r\n");
out.write("<head>\r\n");
out.write("<meta charset='utf-8'>\r\n");
out.write("<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>\r\n");
out.write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n");
out.write("<title>在线考试系统——试题管理</title>\r\n");
out.write("<!-- CSS -->\r\n");
out.write("<link rel=\"stylesheet\"\r\n");
out.write("\thref=\"http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css\">\r\n");
out.write("<link href=\"../../css/index.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n");
out.write("<link href=\"../../Font-Awesome/css/font-awesome.min.css\"\r\n");
out.write("\trel=\"stylesheet\" />\r\n");
out.write("<link href=\"../../images/exam2.png\" rel=\"icon\" type=\"image/ico\" />\r\n");
out.write("</head>\r\n");
out.write("<body class='main page'>\r\n");
out.write("\t<!-- =====================================导航栏======================================== -->\r\n");
out.write("\t<!-- Navbar -->\r\n");
out.write("\t<div class='navbar navbar-default' id='navbar'>\r\n");
out.write("\t\t<img style=\"height:45px;width:45;position:absolute;left:13px;\" src=\"../../images/exam2.png\">\r\n");
out.write("\t\t<a class='navbar-brand' href='#'>\r\n");
out.write("\t\t\t<img id=\"login_logo\" class=\"login_logo\" style=\"margin-left:45px;margin-top:-20px;\" src=\"../../images/logo.png\">\r\n");
out.write("\t\t</a>\r\n");
out.write("\t\t<ul class='nav navbar-nav pull-right'>\r\n");
out.write("\t\t\t<li class='dropdown user'>\r\n");
out.write("\t\t\t<a class='dropdown-toggle'\r\n");
out.write("\t\t\t\tdata-toggle='dropdown' href='#'> \r\n");
out.write("\t\t\t\t<img style=\"height:20px;width:20px\" src=\"../../images/personal.png\">\r\n");
out.write("\t\t\t\t<strong>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${login_name}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</strong> \r\n");
out.write("\t\t\t</a>\r\n");
out.write("\t\t\t</li>\r\n");
out.write("\t\t\t<li class='dropdown user'>\r\n");
out.write("\t\t\t<a class='dropdown-toggle'\r\n");
out.write("\t\t\t\tdata-toggle='dropdown' href='#'> \r\n");
out.write("\t\t\t\t<img style=\"height:20px;width:20px\" src=\"../../images/quit.png\">\r\n");
out.write("\t\t\t\t<strong>安全退出</strong> \r\n");
out.write("\t\t\t</a>\r\n");
out.write("\t\t\t</li>\t\t\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t</div>\r\n");
out.write("\t<div id='wrapper'>\r\n");
out.write("\t\t<!-- ============================== Sidebar==================================== -->\r\n");
out.write("\t\t<section id='sidebar'> <i\r\n");
out.write("\t\t\tclass='icon-align-justify icon-large' id='toggle'></i>\r\n");
out.write("\t\t<ul id='dock'>\r\n");
out.write("\t\t\t<li class='launcher '><i class='icon-dashboard'></i> <a\r\n");
out.write("\t\t\t\t\thref=\"index\">首页</a></li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-table'></i> <a href=\"usermanage\">用户管理</a></li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-file-text-alt'></i> <a\r\n");
out.write("\t\t\t\t\thref=\"subjectmanage\">科目管理</a></li>\r\n");
out.write("\t\t\t\t<li class='launcher dropdown hover'><i class='icon-flag'></i> <a\r\n");
out.write("\t\t\t\t\thref='pointsmanage'>知识点管理</a>\r\n");
out.write("\t\t\t\t<li class='launcher active'><i class='icon-bookmark'></i> <a href=\"questionmanage\">试题管理</a>\r\n");
out.write("\t\t\t\t</li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-cloud'></i> <a href=\"papermanage\">试卷管理</a>\r\n");
out.write("\t\t\t\t</li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-bug'></i><a href=\"online\">在线考试</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write(" \t\t<li class='launcher'><i class='icon-group'></i><a href=\"classTeam\">班级管理</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write(" \t\t<li class='launcher'><i class='icon-cogs'></i><a href=\"studentsTeam\">学生管理</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write(" \t\t<li class='launcher'><i class='icon-book'></i><a href=\"#\">考试安排</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t\t<div data-toggle='tooltip' id='beaker' title='Made by lab2023'></div>\r\n");
out.write("\t\t</section>\r\n");
out.write("\t\t<!-- Tools -->\r\n");
out.write("\t\t<section id='tools'>\r\n");
out.write("\t\t<ul class='breadcrumb' id='breadcrumb'>\r\n");
out.write("\t\t\t <li class='title'>试题管理</li>\r\n");
out.write(" <li><a href=\"#\">试题列表</a></li>\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t\t<div id='toolbar'>\r\n");
out.write("\t\t\t<div class='btn-group'>\r\n");
out.write("\t\t\t\t<a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\ttitle='Building'> <i class='icon-building'></i>\r\n");
out.write("\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\ttitle='Laptop'> <i class='icon-laptop'></i>\r\n");
out.write("\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\ttitle='Calendar'> <i class='icon-calendar'></i> <span\r\n");
out.write("\t\t\t\t\tclass='badge'>3</span>\r\n");
out.write("\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#' title='Lemon'>\r\n");
out.write("\t\t\t\t\t<i class='icon-lemon'></i>\r\n");
out.write("\t\t\t\t</a>\r\n");
out.write("\t\t\t</div>\r\n");
out.write("\t\t</div>\r\n");
out.write("\t\t</section>\r\n");
out.write("\r\n");
out.write("\t\t<!-- ======================================搜索功能行====================================================== -->\r\n");
out.write("\r\n");
out.write("\t\t<input class=\"input-text\" style=\"width: 250px\" type=\"text\" value=\"\"\r\n");
out.write("\t\t\tplaceholder=\"输入知识点\" id=\"article-class-val\">\r\n");
out.write("\t\t<button type=\"button\" class=\"btn btn-primary\" id=\"\" name=\"\"\r\n");
out.write("\t\t\tonClick=\"article_class_add(this);\">\r\n");
out.write("\t\t\t<i class=\"icon-search\"></i> 搜索知识点\r\n");
out.write("\t\t</button>\r\n");
out.write("\r\n");
out.write("\t\t</span>\r\n");
out.write("\t\t<!-- ========================================Content ======================================= -->\r\n");
out.write("\r\n");
out.write("\t\t<div id='content'>\r\n");
out.write("\t\t\t<div class='panel panel-default grid'>\r\n");
out.write("\t\t\t\t<div class='panel-heading'>\r\n");
out.write("\t\t\t\t\t<i class='icon-table icon-large'></i> 试题列表\r\n");
out.write("\t\t\t\t\t<div class='panel-tools'>\r\n");
out.write("\t\t\t\t\t\t<div class='btn-group'>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fa_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\t\t\t\ttitle='Reload'> <i class='icon-refresh'></i>\r\n");
out.write("\t\t\t\t\t\t\t</a>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t<div class='badge'>\r\n");
out.write("\t\t\t\t\t\t\t共有数据:");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${sumId }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</strong> 条\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t\t<div class='panel-body filters'>\r\n");
out.write("\t\t\t\t\t<div class='row'>\r\n");
out.write("\t\t\t\t\t\t<div class='col-md-9'>\r\n");
out.write("\t\t\t\t\t\t\t<!-- 科目下拉列表框 -->\r\n");
out.write("\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fform_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t\t<!-- ============================================================================================ -->\r\n");
out.write("\t\t\t\t<table class='table table-bordered'>\r\n");
out.write("\t\t\t\t\t<thead>\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th>ID</th>\r\n");
out.write("\t\t\t\t\t\t\t<th>题目内容</th>\r\n");
out.write("\t\t\t\t\t\t\t<th>状态</th>\r\n");
out.write("\t\t\t\t\t\t\t<th class='actions'>操作</th>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t</thead>\r\n");
out.write("\t\t\t\t\t<tbody>\r\n");
out.write("\t\t\t\t\t\t<!-- getUserList() -->\r\n");
out.write("\t\t\t\t\t\t");
if (_jspx_meth_s_005fiterator_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t</tbody>\r\n");
out.write("\t\t\t\t</table>\r\n");
out.write("\t\t\t\t<!-- =========================================================翻页==================================================== -->\r\n");
out.write("\r\n");
out.write("\t\t\t\t<div class='panel-footer'>\r\n");
out.write("\t\t\t\t\t<ul class='pagination pagination-sm'>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t<li>");
if (_jspx_meth_s_005furl_005f4(_jspx_page_context))
return;
out.write("</li>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t<li>");
if (_jspx_meth_s_005furl_005f5(_jspx_page_context))
return;
out.write(" <li>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write("\t\t\t\t\t\t<li> ");
if (_jspx_meth_s_005fa_005f1(_jspx_page_context))
return;
out.write("</li>\r\n");
out.write(" \r\n");
out.write(" <li>\r\n");
out.write(" ");
if (_jspx_meth_s_005fiterator_005f1(_jspx_page_context))
return;
out.write("\r\n");
out.write(" </li>\r\n");
out.write(" <li><div class='badge'>第:");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageNow}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</strong> 页</div></li>\r\n");
out.write(" <li>");
if (_jspx_meth_s_005fa_005f2(_jspx_page_context))
return;
out.write(" </li>\r\n");
out.write(" </ul>\r\n");
out.write(" </div>\r\n");
out.write("\r\n");
out.write("<!-- ==============================================JavaScript ================================================== -->\r\n");
out.write("\t\t\t\t\t\t\t<script>\r\n");
out.write("\t\t\t\t\t\t\t\tvar _gaq = [ [ '_setAccount', 'UA-XXXXX-X' ],\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t[ '_trackPageview' ] ];\r\n");
out.write("\t\t\t\t\t\t\t\t(function(d, t) {\r\n");
out.write("\t\t\t\t\t\t\t\t\tvar g = d.createElement(t), s = d\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t.getElementsByTagName(t)[0];\r\n");
out.write("\t\t\t\t\t\t\t\t\tg.src = ('https:' == location.protocol ? '//ssl'\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t: '//www')\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t+ '.google-analytics.com/ga.js';\r\n");
out.write("\t\t\t\t\t\t\t\t\ts.parentNode.insertBefore(g, s)\r\n");
out.write("\t\t\t\t\t\t\t\t}(document, 'script'));\r\n");
out.write("\t\t\t\t\t\t\t</script>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_s_005fa_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:a
org.apache.struts2.views.jsp.ui.AnchorTag _jspx_th_s_005fa_005f0 = (org.apache.struts2.views.jsp.ui.AnchorTag) _005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.get(org.apache.struts2.views.jsp.ui.AnchorTag.class);
_jspx_th_s_005fa_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fa_005f0.setParent(null);
// /WEB-INF/content/question/list.jsp(111,7) null
_jspx_th_s_005fa_005f0.setDynamicAttribute(null, "class", "btn");
// /WEB-INF/content/question/list.jsp(111,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fa_005f0.setAction("add");
int _jspx_eval_s_005fa_005f0 = _jspx_th_s_005fa_005f0.doStartTag();
if (_jspx_eval_s_005fa_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fa_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fa_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fa_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<i class='icon-filter'></i>\r\n");
out.write("\t\t\t\t添加本科目考题\r\n");
out.write("\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fa_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fa_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fa_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.reuse(_jspx_th_s_005fa_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.reuse(_jspx_th_s_005fa_005f0);
return false;
}
private boolean _jspx_meth_s_005fform_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:form
org.apache.struts2.views.jsp.ui.FormTag _jspx_th_s_005fform_005f0 = (org.apache.struts2.views.jsp.ui.FormTag) _005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.get(org.apache.struts2.views.jsp.ui.FormTag.class);
_jspx_th_s_005fform_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fform_005f0.setParent(null);
// /WEB-INF/content/question/list.jsp(128,7) name = theme type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setTheme("simple");
// /WEB-INF/content/question/list.jsp(128,7) name = cssClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setCssClass("form-horizontal ajax-form");
// /WEB-INF/content/question/list.jsp(128,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setAction("search");
// /WEB-INF/content/question/list.jsp(128,7) name = method type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setMethod("post");
int _jspx_eval_s_005fform_005f0 = _jspx_th_s_005fform_005f0.doStartTag();
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fform_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fform_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fselect_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<select class=\"select l\" name=\"question.status\"\r\n");
out.write("\t\t\t\t\t\t\t\t\tonChange=\"SetSubID(this);\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"1\">可用</option>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"0\">禁用</option>\r\n");
out.write("\t\t\t\t\t\t\t\t</select>\r\n");
out.write("\t\t\t\t\t\t\t\t<select class=\"select l\" name=\"question.type\"\r\n");
out.write("\t\t\t\t\t\t\t\t\tonChange=\"SetSubID(this);\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"1\">单选题</option>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"2\">多选题</option>\r\n");
out.write("\t\t\t\t\t\t\t\t</select>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t<div class='col-md-3'>\r\n");
out.write("\t\t\t\t\t\t\t<div class='input-group'>\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005ftextfield_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<span class='input-group-btn'> ");
if (_jspx_meth_s_005fsubmit_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t</span>\r\n");
out.write("\t\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fform_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fform_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.reuse(_jspx_th_s_005fform_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.reuse(_jspx_th_s_005fform_005f0);
return false;
}
private boolean _jspx_meth_s_005fselect_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:select
org.apache.struts2.views.jsp.ui.SelectTag _jspx_th_s_005fselect_005f0 = (org.apache.struts2.views.jsp.ui.SelectTag) _005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.get(org.apache.struts2.views.jsp.ui.SelectTag.class);
_jspx_th_s_005fselect_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fselect_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /WEB-INF/content/question/list.jsp(130,8) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setId("subject.id");
// /WEB-INF/content/question/list.jsp(130,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setName("subject_id");
// /WEB-INF/content/question/list.jsp(130,8) name = list type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setList("subjectList");
// /WEB-INF/content/question/list.jsp(130,8) name = listKey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setListKey("id");
// /WEB-INF/content/question/list.jsp(130,8) name = listValue type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setListValue("title");
// /WEB-INF/content/question/list.jsp(130,8) name = onchange type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setOnchange("selected(this.value)");
int _jspx_eval_s_005fselect_005f0 = _jspx_th_s_005fselect_005f0.doStartTag();
if (_jspx_eval_s_005fselect_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fselect_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fselect_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fselect_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fselect_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fselect_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fselect_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.reuse(_jspx_th_s_005fselect_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.reuse(_jspx_th_s_005fselect_005f0);
return false;
}
private boolean _jspx_meth_s_005ftextfield_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:textfield
org.apache.struts2.views.jsp.ui.TextFieldTag _jspx_th_s_005ftextfield_005f0 = (org.apache.struts2.views.jsp.ui.TextFieldTag) _005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.TextFieldTag.class);
_jspx_th_s_005ftextfield_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005ftextfield_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /WEB-INF/content/question/list.jsp(148,8) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setId("title");
// /WEB-INF/content/question/list.jsp(148,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setName("points.title");
// /WEB-INF/content/question/list.jsp(148,8) null
_jspx_th_s_005ftextfield_005f0.setDynamicAttribute(null, "class", "form-control");
// /WEB-INF/content/question/list.jsp(148,8) null
_jspx_th_s_005ftextfield_005f0.setDynamicAttribute(null, "placeholder", "输入知识点");
// /WEB-INF/content/question/list.jsp(148,8) name = type type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setType("text");
int _jspx_eval_s_005ftextfield_005f0 = _jspx_th_s_005ftextfield_005f0.doStartTag();
if (_jspx_th_s_005ftextfield_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.reuse(_jspx_th_s_005ftextfield_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.reuse(_jspx_th_s_005ftextfield_005f0);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f0 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /WEB-INF/content/question/list.jsp(150,39) null
_jspx_th_s_005fsubmit_005f0.setDynamicAttribute(null, "class", "btn");
// /WEB-INF/content/question/list.jsp(150,39) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f0.setValue("确认修改");
int _jspx_eval_s_005fsubmit_005f0 = _jspx_th_s_005fsubmit_005f0.doStartTag();
if (_jspx_th_s_005fsubmit_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f0);
return false;
}
private boolean _jspx_meth_s_005fiterator_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:iterator
org.apache.struts2.views.jsp.IteratorTag _jspx_th_s_005fiterator_005f0 = (org.apache.struts2.views.jsp.IteratorTag) _005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.get(org.apache.struts2.views.jsp.IteratorTag.class);
_jspx_th_s_005fiterator_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fiterator_005f0.setParent(null);
// /WEB-INF/content/question/list.jsp(170,6) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f0.setValue("questionList");
// /WEB-INF/content/question/list.jsp(170,6) name = status type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f0.setStatus("s");
int _jspx_eval_s_005fiterator_005f0 = _jspx_th_s_005fiterator_005f0.doStartTag();
if (_jspx_eval_s_005fiterator_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fiterator_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fiterator_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fiterator_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t<tr>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<!-- getName() -->\r\n");
out.write("\t\t\t\t\t\t\t\t<td>");
if (_jspx_meth_s_005fproperty_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("</td>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<td>");
if (_jspx_meth_s_005fproperty_005f1(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("</td>\r\n");
out.write("\t\t\t\t\t\t\t\t<td id=\"status\">");
if (_jspx_meth_s_005fif_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005felse_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("</td>\r\n");
out.write("\t\t\t\t\t\t\t\t<!-- el中不会出现空指针异常 -->\r\n");
out.write("\t\t\t\t\t\t\t\t<td class='action'><a class='btn btn-success' title='修改'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-edit'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a> <a class='btn btn-info'\r\n");
out.write("\t\t\t\t\t\t\t\t\tonClick=\"return window.confirm('删除此用户后,该用户将无法登录系统,您确定要删除吗?')\"\r\n");
out.write("\t\t\t\t\t\t\t\t\ttitle='删除'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f1(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-trash'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a> <a class='btn btn-danger'\r\n");
out.write("\t\t\t\t\t\t\t\t\tonClick=\"return window.confirm('禁用此用户后,该用户将无法登录系统,您确定要禁用吗?')\"\r\n");
out.write("\t\t\t\t\t\t\t\t\ttitle='禁用'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f2(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-ban-circle'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a> <a class='btn btn-warning' title='查看'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f3(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-zoom-in'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a></td>\r\n");
out.write("\t\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fiterator_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fiterator_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fiterator_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f0);
return false;
}
private boolean _jspx_meth_s_005fproperty_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:property
org.apache.struts2.views.jsp.PropertyTag _jspx_th_s_005fproperty_005f0 = (org.apache.struts2.views.jsp.PropertyTag) _005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.get(org.apache.struts2.views.jsp.PropertyTag.class);
_jspx_th_s_005fproperty_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fproperty_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(174,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fproperty_005f0.setValue("#s.index+1");
int _jspx_eval_s_005fproperty_005f0 = _jspx_th_s_005fproperty_005f0.doStartTag();
if (_jspx_th_s_005fproperty_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f0);
return false;
}
private boolean _jspx_meth_s_005fproperty_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:property
org.apache.struts2.views.jsp.PropertyTag _jspx_th_s_005fproperty_005f1 = (org.apache.struts2.views.jsp.PropertyTag) _005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.get(org.apache.struts2.views.jsp.PropertyTag.class);
_jspx_th_s_005fproperty_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fproperty_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(176,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fproperty_005f1.setValue("title");
int _jspx_eval_s_005fproperty_005f1 = _jspx_th_s_005fproperty_005f1.doStartTag();
if (_jspx_th_s_005fproperty_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f1);
return false;
}
private boolean _jspx_meth_s_005fif_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:if
org.apache.struts2.views.jsp.IfTag _jspx_th_s_005fif_005f0 = (org.apache.struts2.views.jsp.IfTag) _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.get(org.apache.struts2.views.jsp.IfTag.class);
_jspx_th_s_005fif_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fif_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(177,24) name = test type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fif_005f0.setTest("status==1");
int _jspx_eval_s_005fif_005f0 = _jspx_th_s_005fif_005f0.doStartTag();
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fif_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fif_005f0.doInitBody();
}
do {
out.write('在');
out.write('用');
int evalDoAfterBody = _jspx_th_s_005fif_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
return false;
}
private boolean _jspx_meth_s_005felse_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:else
org.apache.struts2.views.jsp.ElseTag _jspx_th_s_005felse_005f0 = (org.apache.struts2.views.jsp.ElseTag) _005fjspx_005ftagPool_005fs_005felse.get(org.apache.struts2.views.jsp.ElseTag.class);
_jspx_th_s_005felse_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005felse_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
int _jspx_eval_s_005felse_005f0 = _jspx_th_s_005felse_005f0.doStartTag();
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005felse_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005felse_005f0.doInitBody();
}
do {
out.write('作');
out.write('废');
int evalDoAfterBody = _jspx_th_s_005felse_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005felse_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005felse.reuse(_jspx_th_s_005felse_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005felse.reuse(_jspx_th_s_005felse_005f0);
return false;
}
private boolean _jspx_meth_s_005furl_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f0 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(181,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f0.setAction("edit");
int _jspx_eval_s_005furl_005f0 = _jspx_th_s_005furl_005f0.doStartTag();
if (_jspx_eval_s_005furl_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f0.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f0(_jspx_th_s_005furl_005f0, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f0);
return false;
}
private boolean _jspx_meth_s_005fparam_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f0 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f0);
// /WEB-INF/content/question/list.jsp(182,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f0.setName("id");
// /WEB-INF/content/question/list.jsp(182,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f0.setValue("id");
int _jspx_eval_s_005fparam_005f0 = _jspx_th_s_005fparam_005f0.doStartTag();
if (_jspx_th_s_005fparam_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f0);
return false;
}
private boolean _jspx_meth_s_005furl_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f1 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(188,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f1.setAction("delete");
int _jspx_eval_s_005furl_005f1 = _jspx_th_s_005furl_005f1.doStartTag();
if (_jspx_eval_s_005furl_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f1.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f1(_jspx_th_s_005furl_005f1, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f1);
return false;
}
private boolean _jspx_meth_s_005fparam_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f1 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f1);
// /WEB-INF/content/question/list.jsp(189,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f1.setName("id");
// /WEB-INF/content/question/list.jsp(189,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f1.setValue("id");
int _jspx_eval_s_005fparam_005f1 = _jspx_th_s_005fparam_005f1.doStartTag();
if (_jspx_th_s_005fparam_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f1);
return false;
}
private boolean _jspx_meth_s_005furl_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f2 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(195,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f2.setAction("disable");
int _jspx_eval_s_005furl_005f2 = _jspx_th_s_005furl_005f2.doStartTag();
if (_jspx_eval_s_005furl_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f2.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f2(_jspx_th_s_005furl_005f2, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f2);
return false;
}
private boolean _jspx_meth_s_005fparam_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f2 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f2);
// /WEB-INF/content/question/list.jsp(196,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f2.setName("id");
// /WEB-INF/content/question/list.jsp(196,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f2.setValue("id");
int _jspx_eval_s_005fparam_005f2 = _jspx_th_s_005fparam_005f2.doStartTag();
if (_jspx_th_s_005fparam_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f2);
return false;
}
private boolean _jspx_meth_s_005furl_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f3 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f3.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(200,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f3.setAction("view");
int _jspx_eval_s_005furl_005f3 = _jspx_th_s_005furl_005f3.doStartTag();
if (_jspx_eval_s_005furl_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f3.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f3(_jspx_th_s_005furl_005f3, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f3);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f3);
return false;
}
private boolean _jspx_meth_s_005fparam_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f3, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f3 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f3.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f3);
// /WEB-INF/content/question/list.jsp(201,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f3.setName("id");
// /WEB-INF/content/question/list.jsp(201,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f3.setValue("id");
int _jspx_eval_s_005fparam_005f3 = _jspx_th_s_005fparam_005f3.doStartTag();
if (_jspx_th_s_005fparam_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f3);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f3);
return false;
}
private boolean _jspx_meth_s_005furl_005f4(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f4 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f4.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f4.setParent(null);
// /WEB-INF/content/question/list.jsp(214,10) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f4.setId("url_pre");
// /WEB-INF/content/question/list.jsp(214,10) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f4.setValue("list.action");
int _jspx_eval_s_005furl_005f4 = _jspx_th_s_005furl_005f4.doStartTag();
if (_jspx_eval_s_005furl_005f4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f4.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f4.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f4(_jspx_th_s_005furl_005f4, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f4.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f4);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f4);
return false;
}
private boolean _jspx_meth_s_005fparam_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f4, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f4 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f4.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f4);
// /WEB-INF/content/question/list.jsp(215,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f4.setName("pageNow");
// /WEB-INF/content/question/list.jsp(215,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f4.setValue("pageNow-1");
int _jspx_eval_s_005fparam_005f4 = _jspx_th_s_005fparam_005f4.doStartTag();
if (_jspx_th_s_005fparam_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f4);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f4);
return false;
}
private boolean _jspx_meth_s_005furl_005f5(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f5 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f5.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f5.setParent(null);
// /WEB-INF/content/question/list.jsp(218,10) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f5.setId("url_next");
// /WEB-INF/content/question/list.jsp(218,10) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f5.setValue("list.action");
int _jspx_eval_s_005furl_005f5 = _jspx_th_s_005furl_005f5.doStartTag();
if (_jspx_eval_s_005furl_005f5 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f5.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f5.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f5(_jspx_th_s_005furl_005f5, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f5.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f5);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f5);
return false;
}
private boolean _jspx_meth_s_005fparam_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f5, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f5 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f5.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f5);
// /WEB-INF/content/question/list.jsp(219,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f5.setName("pageNow");
// /WEB-INF/content/question/list.jsp(219,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f5.setValue("pageNow+1");
int _jspx_eval_s_005fparam_005f5 = _jspx_th_s_005fparam_005f5.doStartTag();
if (_jspx_th_s_005fparam_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f5);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f5);
return false;
}
private boolean _jspx_meth_s_005fa_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:a
org.apache.struts2.views.jsp.ui.AnchorTag _jspx_th_s_005fa_005f1 = (org.apache.struts2.views.jsp.ui.AnchorTag) _005fjspx_005ftagPool_005fs_005fa_0026_005fhref.get(org.apache.struts2.views.jsp.ui.AnchorTag.class);
_jspx_th_s_005fa_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fa_005f1.setParent(null);
// /WEB-INF/content/question/list.jsp(223,11) name = href type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fa_005f1.setHref("%{url_pre}");
int _jspx_eval_s_005fa_005f1 = _jspx_th_s_005fa_005f1.doStartTag();
if (_jspx_eval_s_005fa_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fa_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fa_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fa_005f1.doInitBody();
}
do {
out.write('上');
out.write('一');
out.write('页');
int evalDoAfterBody = _jspx_th_s_005fa_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fa_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fa_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f1);
return false;
}
private boolean _jspx_meth_s_005fiterator_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:iterator
org.apache.struts2.views.jsp.IteratorTag _jspx_th_s_005fiterator_005f1 = (org.apache.struts2.views.jsp.IteratorTag) _005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.get(org.apache.struts2.views.jsp.IteratorTag.class);
_jspx_th_s_005fiterator_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fiterator_005f1.setParent(null);
// /WEB-INF/content/question/list.jsp(226,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f1.setValue("question");
// /WEB-INF/content/question/list.jsp(226,5) name = status type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f1.setStatus("status");
int _jspx_eval_s_005fiterator_005f1 = _jspx_th_s_005fiterator_005f1.doStartTag();
if (_jspx_eval_s_005fiterator_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fiterator_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fiterator_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fiterator_005f1.doInitBody();
}
do {
out.write("\r\n");
out.write(" ");
if (_jspx_meth_s_005furl_005f6(_jspx_th_s_005fiterator_005f1, _jspx_page_context))
return true;
out.write("\r\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_s_005fiterator_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fiterator_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fiterator_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f1);
return false;
}
private boolean _jspx_meth_s_005furl_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f6 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f6.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f1);
// /WEB-INF/content/question/list.jsp(227,5) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f6.setId("url");
// /WEB-INF/content/question/list.jsp(227,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f6.setValue("list.action");
int _jspx_eval_s_005furl_005f6 = _jspx_th_s_005furl_005f6.doStartTag();
if (_jspx_eval_s_005furl_005f6 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f6.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f6.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f6(_jspx_th_s_005furl_005f6, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f6.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f6);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f6);
return false;
}
private boolean _jspx_meth_s_005fparam_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f6, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f6 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f6.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f6);
// /WEB-INF/content/question/list.jsp(228,9) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f6.setName("pageNow");
// /WEB-INF/content/question/list.jsp(228,9) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f6.setValue("pageNow");
int _jspx_eval_s_005fparam_005f6 = _jspx_th_s_005fparam_005f6.doStartTag();
if (_jspx_th_s_005fparam_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f6);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f6);
return false;
}
private boolean _jspx_meth_s_005fa_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:a
org.apache.struts2.views.jsp.ui.AnchorTag _jspx_th_s_005fa_005f2 = (org.apache.struts2.views.jsp.ui.AnchorTag) _005fjspx_005ftagPool_005fs_005fa_0026_005fhref.get(org.apache.struts2.views.jsp.ui.AnchorTag.class);
_jspx_th_s_005fa_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005fa_005f2.setParent(null);
// /WEB-INF/content/question/list.jsp(233,9) name = href type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fa_005f2.setHref("%{url_next}");
int _jspx_eval_s_005fa_005f2 = _jspx_th_s_005fa_005f2.doStartTag();
if (_jspx_eval_s_005fa_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fa_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fa_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fa_005f2.doInitBody();
}
do {
out.write('下');
out.write('一');
out.write('页');
int evalDoAfterBody = _jspx_th_s_005fa_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fa_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fa_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f2);
return false;
}
}
|
UTF-8
|
Java
| 83,613 |
java
|
list_jsp.java
|
Java
|
[
{
"context": " null\n _jspx_th_s_005fselect_005f0.setListKey(\"id\");\n // /WEB-INF/content/question/list.jsp(130,",
"end": 28786,
"score": 0.6768805384635925,
"start": 28784,
"tag": "KEY",
"value": "id"
}
] | null |
[] |
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.37
* Generated at: 2016-09-21 21:50:49 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp.WEB_002dINF.content.question;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
public final class list_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fif_0026_005ftest;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005felse;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005furl_0026_005faction;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid;
private org.apache.jasper.runtime.TagHandlerPool _005fjspx_005ftagPool_005fs_005fa_0026_005fhref;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005felse = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005furl_0026_005faction = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref = org.apache.jasper.runtime.TagHandlerPool.getTagHandlerPool(getServletConfig());
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.release();
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.release();
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.release();
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.release();
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.release();
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.release();
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.release();
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.release();
_005fjspx_005ftagPool_005fs_005felse.release();
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.release();
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.release();
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.release();
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.release();
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html;charset=UTF-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html class='no-js' lang='en'>\r\n");
out.write("<head>\r\n");
out.write("<meta charset='utf-8'>\r\n");
out.write("<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>\r\n");
out.write("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n");
out.write("<title>在线考试系统——试题管理</title>\r\n");
out.write("<!-- CSS -->\r\n");
out.write("<link rel=\"stylesheet\"\r\n");
out.write("\thref=\"http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css\">\r\n");
out.write("<link href=\"../../css/index.css\" rel=\"stylesheet\" type=\"text/css\" />\r\n");
out.write("<link href=\"../../Font-Awesome/css/font-awesome.min.css\"\r\n");
out.write("\trel=\"stylesheet\" />\r\n");
out.write("<link href=\"../../images/exam2.png\" rel=\"icon\" type=\"image/ico\" />\r\n");
out.write("</head>\r\n");
out.write("<body class='main page'>\r\n");
out.write("\t<!-- =====================================导航栏======================================== -->\r\n");
out.write("\t<!-- Navbar -->\r\n");
out.write("\t<div class='navbar navbar-default' id='navbar'>\r\n");
out.write("\t\t<img style=\"height:45px;width:45;position:absolute;left:13px;\" src=\"../../images/exam2.png\">\r\n");
out.write("\t\t<a class='navbar-brand' href='#'>\r\n");
out.write("\t\t\t<img id=\"login_logo\" class=\"login_logo\" style=\"margin-left:45px;margin-top:-20px;\" src=\"../../images/logo.png\">\r\n");
out.write("\t\t</a>\r\n");
out.write("\t\t<ul class='nav navbar-nav pull-right'>\r\n");
out.write("\t\t\t<li class='dropdown user'>\r\n");
out.write("\t\t\t<a class='dropdown-toggle'\r\n");
out.write("\t\t\t\tdata-toggle='dropdown' href='#'> \r\n");
out.write("\t\t\t\t<img style=\"height:20px;width:20px\" src=\"../../images/personal.png\">\r\n");
out.write("\t\t\t\t<strong>");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${login_name}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</strong> \r\n");
out.write("\t\t\t</a>\r\n");
out.write("\t\t\t</li>\r\n");
out.write("\t\t\t<li class='dropdown user'>\r\n");
out.write("\t\t\t<a class='dropdown-toggle'\r\n");
out.write("\t\t\t\tdata-toggle='dropdown' href='#'> \r\n");
out.write("\t\t\t\t<img style=\"height:20px;width:20px\" src=\"../../images/quit.png\">\r\n");
out.write("\t\t\t\t<strong>安全退出</strong> \r\n");
out.write("\t\t\t</a>\r\n");
out.write("\t\t\t</li>\t\t\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t</div>\r\n");
out.write("\t<div id='wrapper'>\r\n");
out.write("\t\t<!-- ============================== Sidebar==================================== -->\r\n");
out.write("\t\t<section id='sidebar'> <i\r\n");
out.write("\t\t\tclass='icon-align-justify icon-large' id='toggle'></i>\r\n");
out.write("\t\t<ul id='dock'>\r\n");
out.write("\t\t\t<li class='launcher '><i class='icon-dashboard'></i> <a\r\n");
out.write("\t\t\t\t\thref=\"index\">首页</a></li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-table'></i> <a href=\"usermanage\">用户管理</a></li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-file-text-alt'></i> <a\r\n");
out.write("\t\t\t\t\thref=\"subjectmanage\">科目管理</a></li>\r\n");
out.write("\t\t\t\t<li class='launcher dropdown hover'><i class='icon-flag'></i> <a\r\n");
out.write("\t\t\t\t\thref='pointsmanage'>知识点管理</a>\r\n");
out.write("\t\t\t\t<li class='launcher active'><i class='icon-bookmark'></i> <a href=\"questionmanage\">试题管理</a>\r\n");
out.write("\t\t\t\t</li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-cloud'></i> <a href=\"papermanage\">试卷管理</a>\r\n");
out.write("\t\t\t\t</li>\r\n");
out.write("\t\t\t\t<li class='launcher'><i class='icon-bug'></i><a href=\"online\">在线考试</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write(" \t\t<li class='launcher'><i class='icon-group'></i><a href=\"classTeam\">班级管理</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write(" \t\t<li class='launcher'><i class='icon-cogs'></i><a href=\"studentsTeam\">学生管理</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write(" \t\t<li class='launcher'><i class='icon-book'></i><a href=\"#\">考试安排</a>\r\n");
out.write(" \t\t</li>\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t\t<div data-toggle='tooltip' id='beaker' title='Made by lab2023'></div>\r\n");
out.write("\t\t</section>\r\n");
out.write("\t\t<!-- Tools -->\r\n");
out.write("\t\t<section id='tools'>\r\n");
out.write("\t\t<ul class='breadcrumb' id='breadcrumb'>\r\n");
out.write("\t\t\t <li class='title'>试题管理</li>\r\n");
out.write(" <li><a href=\"#\">试题列表</a></li>\r\n");
out.write("\t\t</ul>\r\n");
out.write("\t\t<div id='toolbar'>\r\n");
out.write("\t\t\t<div class='btn-group'>\r\n");
out.write("\t\t\t\t<a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\ttitle='Building'> <i class='icon-building'></i>\r\n");
out.write("\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\ttitle='Laptop'> <i class='icon-laptop'></i>\r\n");
out.write("\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\ttitle='Calendar'> <i class='icon-calendar'></i> <span\r\n");
out.write("\t\t\t\t\tclass='badge'>3</span>\r\n");
out.write("\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#' title='Lemon'>\r\n");
out.write("\t\t\t\t\t<i class='icon-lemon'></i>\r\n");
out.write("\t\t\t\t</a>\r\n");
out.write("\t\t\t</div>\r\n");
out.write("\t\t</div>\r\n");
out.write("\t\t</section>\r\n");
out.write("\r\n");
out.write("\t\t<!-- ======================================搜索功能行====================================================== -->\r\n");
out.write("\r\n");
out.write("\t\t<input class=\"input-text\" style=\"width: 250px\" type=\"text\" value=\"\"\r\n");
out.write("\t\t\tplaceholder=\"输入知识点\" id=\"article-class-val\">\r\n");
out.write("\t\t<button type=\"button\" class=\"btn btn-primary\" id=\"\" name=\"\"\r\n");
out.write("\t\t\tonClick=\"article_class_add(this);\">\r\n");
out.write("\t\t\t<i class=\"icon-search\"></i> 搜索知识点\r\n");
out.write("\t\t</button>\r\n");
out.write("\r\n");
out.write("\t\t</span>\r\n");
out.write("\t\t<!-- ========================================Content ======================================= -->\r\n");
out.write("\r\n");
out.write("\t\t<div id='content'>\r\n");
out.write("\t\t\t<div class='panel panel-default grid'>\r\n");
out.write("\t\t\t\t<div class='panel-heading'>\r\n");
out.write("\t\t\t\t\t<i class='icon-table icon-large'></i> 试题列表\r\n");
out.write("\t\t\t\t\t<div class='panel-tools'>\r\n");
out.write("\t\t\t\t\t\t<div class='btn-group'>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fa_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t</a> <a class='btn' data-toggle='toolbar-tooltip' href='#'\r\n");
out.write("\t\t\t\t\t\t\t\ttitle='Reload'> <i class='icon-refresh'></i>\r\n");
out.write("\t\t\t\t\t\t\t</a>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t<div class='badge'>\r\n");
out.write("\t\t\t\t\t\t\t共有数据:");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${sumId }", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</strong> 条\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t\t<div class='panel-body filters'>\r\n");
out.write("\t\t\t\t\t<div class='row'>\r\n");
out.write("\t\t\t\t\t\t<div class='col-md-9'>\r\n");
out.write("\t\t\t\t\t\t\t<!-- 科目下拉列表框 -->\r\n");
out.write("\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fform_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t</div>\r\n");
out.write("\t\t\t\t<!-- ============================================================================================ -->\r\n");
out.write("\t\t\t\t<table class='table table-bordered'>\r\n");
out.write("\t\t\t\t\t<thead>\r\n");
out.write("\t\t\t\t\t\t<tr>\r\n");
out.write("\t\t\t\t\t\t\t<th>ID</th>\r\n");
out.write("\t\t\t\t\t\t\t<th>题目内容</th>\r\n");
out.write("\t\t\t\t\t\t\t<th>状态</th>\r\n");
out.write("\t\t\t\t\t\t\t<th class='actions'>操作</th>\r\n");
out.write("\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t</thead>\r\n");
out.write("\t\t\t\t\t<tbody>\r\n");
out.write("\t\t\t\t\t\t<!-- getUserList() -->\r\n");
out.write("\t\t\t\t\t\t");
if (_jspx_meth_s_005fiterator_005f0(_jspx_page_context))
return;
out.write("\r\n");
out.write("\t\t\t\t\t</tbody>\r\n");
out.write("\t\t\t\t</table>\r\n");
out.write("\t\t\t\t<!-- =========================================================翻页==================================================== -->\r\n");
out.write("\r\n");
out.write("\t\t\t\t<div class='panel-footer'>\r\n");
out.write("\t\t\t\t\t<ul class='pagination pagination-sm'>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t<li>");
if (_jspx_meth_s_005furl_005f4(_jspx_page_context))
return;
out.write("</li>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t<li>");
if (_jspx_meth_s_005furl_005f5(_jspx_page_context))
return;
out.write(" <li>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write("\t\t\t\t\t\t<li> ");
if (_jspx_meth_s_005fa_005f1(_jspx_page_context))
return;
out.write("</li>\r\n");
out.write(" \r\n");
out.write(" <li>\r\n");
out.write(" ");
if (_jspx_meth_s_005fiterator_005f1(_jspx_page_context))
return;
out.write("\r\n");
out.write(" </li>\r\n");
out.write(" <li><div class='badge'>第:");
out.write((java.lang.String) org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate("${pageNow}", java.lang.String.class, (javax.servlet.jsp.PageContext)_jspx_page_context, null, false));
out.write("</strong> 页</div></li>\r\n");
out.write(" <li>");
if (_jspx_meth_s_005fa_005f2(_jspx_page_context))
return;
out.write(" </li>\r\n");
out.write(" </ul>\r\n");
out.write(" </div>\r\n");
out.write("\r\n");
out.write("<!-- ==============================================JavaScript ================================================== -->\r\n");
out.write("\t\t\t\t\t\t\t<script>\r\n");
out.write("\t\t\t\t\t\t\t\tvar _gaq = [ [ '_setAccount', 'UA-XXXXX-X' ],\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t[ '_trackPageview' ] ];\r\n");
out.write("\t\t\t\t\t\t\t\t(function(d, t) {\r\n");
out.write("\t\t\t\t\t\t\t\t\tvar g = d.createElement(t), s = d\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t.getElementsByTagName(t)[0];\r\n");
out.write("\t\t\t\t\t\t\t\t\tg.src = ('https:' == location.protocol ? '//ssl'\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t: '//www')\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t\t+ '.google-analytics.com/ga.js';\r\n");
out.write("\t\t\t\t\t\t\t\t\ts.parentNode.insertBefore(g, s)\r\n");
out.write("\t\t\t\t\t\t\t\t}(document, 'script'));\r\n");
out.write("\t\t\t\t\t\t\t</script>\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
private boolean _jspx_meth_s_005fa_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:a
org.apache.struts2.views.jsp.ui.AnchorTag _jspx_th_s_005fa_005f0 = (org.apache.struts2.views.jsp.ui.AnchorTag) _005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.get(org.apache.struts2.views.jsp.ui.AnchorTag.class);
_jspx_th_s_005fa_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fa_005f0.setParent(null);
// /WEB-INF/content/question/list.jsp(111,7) null
_jspx_th_s_005fa_005f0.setDynamicAttribute(null, "class", "btn");
// /WEB-INF/content/question/list.jsp(111,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fa_005f0.setAction("add");
int _jspx_eval_s_005fa_005f0 = _jspx_th_s_005fa_005f0.doStartTag();
if (_jspx_eval_s_005fa_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fa_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fa_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fa_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<i class='icon-filter'></i>\r\n");
out.write("\t\t\t\t添加本科目考题\r\n");
out.write("\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fa_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fa_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fa_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.reuse(_jspx_th_s_005fa_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fa_0026_005fclass_005faction.reuse(_jspx_th_s_005fa_005f0);
return false;
}
private boolean _jspx_meth_s_005fform_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:form
org.apache.struts2.views.jsp.ui.FormTag _jspx_th_s_005fform_005f0 = (org.apache.struts2.views.jsp.ui.FormTag) _005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.get(org.apache.struts2.views.jsp.ui.FormTag.class);
_jspx_th_s_005fform_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fform_005f0.setParent(null);
// /WEB-INF/content/question/list.jsp(128,7) name = theme type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setTheme("simple");
// /WEB-INF/content/question/list.jsp(128,7) name = cssClass type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setCssClass("form-horizontal ajax-form");
// /WEB-INF/content/question/list.jsp(128,7) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setAction("search");
// /WEB-INF/content/question/list.jsp(128,7) name = method type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fform_005f0.setMethod("post");
int _jspx_eval_s_005fform_005f0 = _jspx_th_s_005fform_005f0.doStartTag();
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fform_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fform_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fselect_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<select class=\"select l\" name=\"question.status\"\r\n");
out.write("\t\t\t\t\t\t\t\t\tonChange=\"SetSubID(this);\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"1\">可用</option>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"0\">禁用</option>\r\n");
out.write("\t\t\t\t\t\t\t\t</select>\r\n");
out.write("\t\t\t\t\t\t\t\t<select class=\"select l\" name=\"question.type\"\r\n");
out.write("\t\t\t\t\t\t\t\t\tonChange=\"SetSubID(this);\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"1\">单选题</option>\r\n");
out.write("\t\t\t\t\t\t\t\t\t<option value=\"2\">多选题</option>\r\n");
out.write("\t\t\t\t\t\t\t\t</select>\r\n");
out.write("\t\t\t\t\t\t</div>\r\n");
out.write("\t\t\t\t\t\t<div class='col-md-3'>\r\n");
out.write("\t\t\t\t\t\t\t<div class='input-group'>\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005ftextfield_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<span class='input-group-btn'> ");
if (_jspx_meth_s_005fsubmit_005f0(_jspx_th_s_005fform_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t</span>\r\n");
out.write("\t\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fform_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fform_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fform_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.reuse(_jspx_th_s_005fform_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fform_0026_005ftheme_005fmethod_005fcssClass_005faction.reuse(_jspx_th_s_005fform_005f0);
return false;
}
private boolean _jspx_meth_s_005fselect_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:select
org.apache.struts2.views.jsp.ui.SelectTag _jspx_th_s_005fselect_005f0 = (org.apache.struts2.views.jsp.ui.SelectTag) _005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.get(org.apache.struts2.views.jsp.ui.SelectTag.class);
_jspx_th_s_005fselect_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fselect_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /WEB-INF/content/question/list.jsp(130,8) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setId("subject.id");
// /WEB-INF/content/question/list.jsp(130,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setName("subject_id");
// /WEB-INF/content/question/list.jsp(130,8) name = list type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setList("subjectList");
// /WEB-INF/content/question/list.jsp(130,8) name = listKey type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setListKey("id");
// /WEB-INF/content/question/list.jsp(130,8) name = listValue type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setListValue("title");
// /WEB-INF/content/question/list.jsp(130,8) name = onchange type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fselect_005f0.setOnchange("selected(this.value)");
int _jspx_eval_s_005fselect_005f0 = _jspx_th_s_005fselect_005f0.doStartTag();
if (_jspx_eval_s_005fselect_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fselect_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fselect_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fselect_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fselect_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fselect_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fselect_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.reuse(_jspx_th_s_005fselect_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fselect_0026_005fonchange_005fname_005flistValue_005flistKey_005flist_005fid.reuse(_jspx_th_s_005fselect_005f0);
return false;
}
private boolean _jspx_meth_s_005ftextfield_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:textfield
org.apache.struts2.views.jsp.ui.TextFieldTag _jspx_th_s_005ftextfield_005f0 = (org.apache.struts2.views.jsp.ui.TextFieldTag) _005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.TextFieldTag.class);
_jspx_th_s_005ftextfield_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005ftextfield_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /WEB-INF/content/question/list.jsp(148,8) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setId("title");
// /WEB-INF/content/question/list.jsp(148,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setName("points.title");
// /WEB-INF/content/question/list.jsp(148,8) null
_jspx_th_s_005ftextfield_005f0.setDynamicAttribute(null, "class", "form-control");
// /WEB-INF/content/question/list.jsp(148,8) null
_jspx_th_s_005ftextfield_005f0.setDynamicAttribute(null, "placeholder", "输入知识点");
// /WEB-INF/content/question/list.jsp(148,8) name = type type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005ftextfield_005f0.setType("text");
int _jspx_eval_s_005ftextfield_005f0 = _jspx_th_s_005ftextfield_005f0.doStartTag();
if (_jspx_th_s_005ftextfield_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.reuse(_jspx_th_s_005ftextfield_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005ftextfield_0026_005ftype_005fplaceholder_005fname_005fid_005fclass_005fnobody.reuse(_jspx_th_s_005ftextfield_005f0);
return false;
}
private boolean _jspx_meth_s_005fsubmit_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fform_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:submit
org.apache.struts2.views.jsp.ui.SubmitTag _jspx_th_s_005fsubmit_005f0 = (org.apache.struts2.views.jsp.ui.SubmitTag) _005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.get(org.apache.struts2.views.jsp.ui.SubmitTag.class);
_jspx_th_s_005fsubmit_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fsubmit_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fform_005f0);
// /WEB-INF/content/question/list.jsp(150,39) null
_jspx_th_s_005fsubmit_005f0.setDynamicAttribute(null, "class", "btn");
// /WEB-INF/content/question/list.jsp(150,39) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fsubmit_005f0.setValue("确认修改");
int _jspx_eval_s_005fsubmit_005f0 = _jspx_th_s_005fsubmit_005f0.doStartTag();
if (_jspx_th_s_005fsubmit_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fsubmit_0026_005fvalue_005fclass_005fnobody.reuse(_jspx_th_s_005fsubmit_005f0);
return false;
}
private boolean _jspx_meth_s_005fiterator_005f0(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:iterator
org.apache.struts2.views.jsp.IteratorTag _jspx_th_s_005fiterator_005f0 = (org.apache.struts2.views.jsp.IteratorTag) _005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.get(org.apache.struts2.views.jsp.IteratorTag.class);
_jspx_th_s_005fiterator_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fiterator_005f0.setParent(null);
// /WEB-INF/content/question/list.jsp(170,6) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f0.setValue("questionList");
// /WEB-INF/content/question/list.jsp(170,6) name = status type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f0.setStatus("s");
int _jspx_eval_s_005fiterator_005f0 = _jspx_th_s_005fiterator_005f0.doStartTag();
if (_jspx_eval_s_005fiterator_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fiterator_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fiterator_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fiterator_005f0.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t<tr>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<!-- getName() -->\r\n");
out.write("\t\t\t\t\t\t\t\t<td>");
if (_jspx_meth_s_005fproperty_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("</td>\r\n");
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t<td>");
if (_jspx_meth_s_005fproperty_005f1(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("</td>\r\n");
out.write("\t\t\t\t\t\t\t\t<td id=\"status\">");
if (_jspx_meth_s_005fif_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005felse_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("</td>\r\n");
out.write("\t\t\t\t\t\t\t\t<!-- el中不会出现空指针异常 -->\r\n");
out.write("\t\t\t\t\t\t\t\t<td class='action'><a class='btn btn-success' title='修改'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f0(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-edit'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a> <a class='btn btn-info'\r\n");
out.write("\t\t\t\t\t\t\t\t\tonClick=\"return window.confirm('删除此用户后,该用户将无法登录系统,您确定要删除吗?')\"\r\n");
out.write("\t\t\t\t\t\t\t\t\ttitle='删除'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f1(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-trash'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a> <a class='btn btn-danger'\r\n");
out.write("\t\t\t\t\t\t\t\t\tonClick=\"return window.confirm('禁用此用户后,该用户将无法登录系统,您确定要禁用吗?')\"\r\n");
out.write("\t\t\t\t\t\t\t\t\ttitle='禁用'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f2(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-ban-circle'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a> <a class='btn btn-warning' title='查看'\r\n");
out.write("\t\t\t\t\t\t\t\t\thref=\"");
if (_jspx_meth_s_005furl_005f3(_jspx_th_s_005fiterator_005f0, _jspx_page_context))
return true;
out.write("\">\r\n");
out.write("\t\t\t\t\t\t\t\t\t\t<i class='icon-zoom-in'></i>\r\n");
out.write("\t\t\t\t\t\t\t\t</a></td>\r\n");
out.write("\t\t\t\t\t\t\t</tr>\r\n");
out.write("\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005fiterator_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fiterator_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fiterator_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f0);
return false;
}
private boolean _jspx_meth_s_005fproperty_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:property
org.apache.struts2.views.jsp.PropertyTag _jspx_th_s_005fproperty_005f0 = (org.apache.struts2.views.jsp.PropertyTag) _005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.get(org.apache.struts2.views.jsp.PropertyTag.class);
_jspx_th_s_005fproperty_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fproperty_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(174,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fproperty_005f0.setValue("#s.index+1");
int _jspx_eval_s_005fproperty_005f0 = _jspx_th_s_005fproperty_005f0.doStartTag();
if (_jspx_th_s_005fproperty_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f0);
return false;
}
private boolean _jspx_meth_s_005fproperty_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:property
org.apache.struts2.views.jsp.PropertyTag _jspx_th_s_005fproperty_005f1 = (org.apache.struts2.views.jsp.PropertyTag) _005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.get(org.apache.struts2.views.jsp.PropertyTag.class);
_jspx_th_s_005fproperty_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fproperty_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(176,12) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fproperty_005f1.setValue("title");
int _jspx_eval_s_005fproperty_005f1 = _jspx_th_s_005fproperty_005f1.doStartTag();
if (_jspx_th_s_005fproperty_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fproperty_0026_005fvalue_005fnobody.reuse(_jspx_th_s_005fproperty_005f1);
return false;
}
private boolean _jspx_meth_s_005fif_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:if
org.apache.struts2.views.jsp.IfTag _jspx_th_s_005fif_005f0 = (org.apache.struts2.views.jsp.IfTag) _005fjspx_005ftagPool_005fs_005fif_0026_005ftest.get(org.apache.struts2.views.jsp.IfTag.class);
_jspx_th_s_005fif_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fif_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(177,24) name = test type = java.lang.String reqTime = false required = true fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fif_005f0.setTest("status==1");
int _jspx_eval_s_005fif_005f0 = _jspx_th_s_005fif_005f0.doStartTag();
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fif_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fif_005f0.doInitBody();
}
do {
out.write('在');
out.write('用');
int evalDoAfterBody = _jspx_th_s_005fif_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fif_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fif_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fif_0026_005ftest.reuse(_jspx_th_s_005fif_005f0);
return false;
}
private boolean _jspx_meth_s_005felse_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:else
org.apache.struts2.views.jsp.ElseTag _jspx_th_s_005felse_005f0 = (org.apache.struts2.views.jsp.ElseTag) _005fjspx_005ftagPool_005fs_005felse.get(org.apache.struts2.views.jsp.ElseTag.class);
_jspx_th_s_005felse_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005felse_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
int _jspx_eval_s_005felse_005f0 = _jspx_th_s_005felse_005f0.doStartTag();
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005felse_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005felse_005f0.doInitBody();
}
do {
out.write('作');
out.write('废');
int evalDoAfterBody = _jspx_th_s_005felse_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005felse_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005felse_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005felse.reuse(_jspx_th_s_005felse_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005felse.reuse(_jspx_th_s_005felse_005f0);
return false;
}
private boolean _jspx_meth_s_005furl_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f0 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(181,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f0.setAction("edit");
int _jspx_eval_s_005furl_005f0 = _jspx_th_s_005furl_005f0.doStartTag();
if (_jspx_eval_s_005furl_005f0 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f0.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f0.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f0(_jspx_th_s_005furl_005f0, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f0.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f0 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f0);
return false;
}
private boolean _jspx_meth_s_005fparam_005f0(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f0 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f0.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f0);
// /WEB-INF/content/question/list.jsp(182,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f0.setName("id");
// /WEB-INF/content/question/list.jsp(182,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f0.setValue("id");
int _jspx_eval_s_005fparam_005f0 = _jspx_th_s_005fparam_005f0.doStartTag();
if (_jspx_th_s_005fparam_005f0.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f0);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f0);
return false;
}
private boolean _jspx_meth_s_005furl_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f1 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(188,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f1.setAction("delete");
int _jspx_eval_s_005furl_005f1 = _jspx_th_s_005furl_005f1.doStartTag();
if (_jspx_eval_s_005furl_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f1.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f1(_jspx_th_s_005furl_005f1, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f1);
return false;
}
private boolean _jspx_meth_s_005fparam_005f1(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f1 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f1.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f1);
// /WEB-INF/content/question/list.jsp(189,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f1.setName("id");
// /WEB-INF/content/question/list.jsp(189,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f1.setValue("id");
int _jspx_eval_s_005fparam_005f1 = _jspx_th_s_005fparam_005f1.doStartTag();
if (_jspx_th_s_005fparam_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f1);
return false;
}
private boolean _jspx_meth_s_005furl_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f2 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(195,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f2.setAction("disable");
int _jspx_eval_s_005furl_005f2 = _jspx_th_s_005furl_005f2.doStartTag();
if (_jspx_eval_s_005furl_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f2.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f2(_jspx_th_s_005furl_005f2, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f2);
return false;
}
private boolean _jspx_meth_s_005fparam_005f2(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f2, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f2 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f2.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f2);
// /WEB-INF/content/question/list.jsp(196,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f2.setName("id");
// /WEB-INF/content/question/list.jsp(196,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f2.setValue("id");
int _jspx_eval_s_005fparam_005f2 = _jspx_th_s_005fparam_005f2.doStartTag();
if (_jspx_th_s_005fparam_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f2);
return false;
}
private boolean _jspx_meth_s_005furl_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f0, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f3 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005faction.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f3.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f0);
// /WEB-INF/content/question/list.jsp(200,15) name = action type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f3.setAction("view");
int _jspx_eval_s_005furl_005f3 = _jspx_th_s_005furl_005f3.doStartTag();
if (_jspx_eval_s_005furl_005f3 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f3.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f3.doInitBody();
}
do {
out.write(" \r\n");
out.write(" \t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f3(_jspx_th_s_005furl_005f3, _jspx_page_context))
return true;
out.write(" \r\n");
out.write(" \t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f3.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f3 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f3);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005faction.reuse(_jspx_th_s_005furl_005f3);
return false;
}
private boolean _jspx_meth_s_005fparam_005f3(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f3, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f3 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f3.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f3.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f3);
// /WEB-INF/content/question/list.jsp(201,25) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f3.setName("id");
// /WEB-INF/content/question/list.jsp(201,25) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f3.setValue("id");
int _jspx_eval_s_005fparam_005f3 = _jspx_th_s_005fparam_005f3.doStartTag();
if (_jspx_th_s_005fparam_005f3.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f3);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f3);
return false;
}
private boolean _jspx_meth_s_005furl_005f4(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f4 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f4.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f4.setParent(null);
// /WEB-INF/content/question/list.jsp(214,10) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f4.setId("url_pre");
// /WEB-INF/content/question/list.jsp(214,10) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f4.setValue("list.action");
int _jspx_eval_s_005furl_005f4 = _jspx_th_s_005furl_005f4.doStartTag();
if (_jspx_eval_s_005furl_005f4 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f4.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f4.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f4(_jspx_th_s_005furl_005f4, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f4.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f4 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f4);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f4);
return false;
}
private boolean _jspx_meth_s_005fparam_005f4(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f4, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f4 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f4.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f4.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f4);
// /WEB-INF/content/question/list.jsp(215,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f4.setName("pageNow");
// /WEB-INF/content/question/list.jsp(215,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f4.setValue("pageNow-1");
int _jspx_eval_s_005fparam_005f4 = _jspx_th_s_005fparam_005f4.doStartTag();
if (_jspx_th_s_005fparam_005f4.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f4);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f4);
return false;
}
private boolean _jspx_meth_s_005furl_005f5(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f5 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f5.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f5.setParent(null);
// /WEB-INF/content/question/list.jsp(218,10) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f5.setId("url_next");
// /WEB-INF/content/question/list.jsp(218,10) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f5.setValue("list.action");
int _jspx_eval_s_005furl_005f5 = _jspx_th_s_005furl_005f5.doStartTag();
if (_jspx_eval_s_005furl_005f5 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f5.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f5.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f5(_jspx_th_s_005furl_005f5, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f5.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f5 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f5);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f5);
return false;
}
private boolean _jspx_meth_s_005fparam_005f5(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f5, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f5 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f5.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f5.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f5);
// /WEB-INF/content/question/list.jsp(219,8) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f5.setName("pageNow");
// /WEB-INF/content/question/list.jsp(219,8) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f5.setValue("pageNow+1");
int _jspx_eval_s_005fparam_005f5 = _jspx_th_s_005fparam_005f5.doStartTag();
if (_jspx_th_s_005fparam_005f5.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f5);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f5);
return false;
}
private boolean _jspx_meth_s_005fa_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:a
org.apache.struts2.views.jsp.ui.AnchorTag _jspx_th_s_005fa_005f1 = (org.apache.struts2.views.jsp.ui.AnchorTag) _005fjspx_005ftagPool_005fs_005fa_0026_005fhref.get(org.apache.struts2.views.jsp.ui.AnchorTag.class);
_jspx_th_s_005fa_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fa_005f1.setParent(null);
// /WEB-INF/content/question/list.jsp(223,11) name = href type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fa_005f1.setHref("%{url_pre}");
int _jspx_eval_s_005fa_005f1 = _jspx_th_s_005fa_005f1.doStartTag();
if (_jspx_eval_s_005fa_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fa_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fa_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fa_005f1.doInitBody();
}
do {
out.write('上');
out.write('一');
out.write('页');
int evalDoAfterBody = _jspx_th_s_005fa_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fa_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fa_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f1);
return false;
}
private boolean _jspx_meth_s_005fiterator_005f1(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:iterator
org.apache.struts2.views.jsp.IteratorTag _jspx_th_s_005fiterator_005f1 = (org.apache.struts2.views.jsp.IteratorTag) _005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.get(org.apache.struts2.views.jsp.IteratorTag.class);
_jspx_th_s_005fiterator_005f1.setPageContext(_jspx_page_context);
_jspx_th_s_005fiterator_005f1.setParent(null);
// /WEB-INF/content/question/list.jsp(226,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f1.setValue("question");
// /WEB-INF/content/question/list.jsp(226,5) name = status type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fiterator_005f1.setStatus("status");
int _jspx_eval_s_005fiterator_005f1 = _jspx_th_s_005fiterator_005f1.doStartTag();
if (_jspx_eval_s_005fiterator_005f1 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fiterator_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fiterator_005f1.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fiterator_005f1.doInitBody();
}
do {
out.write("\r\n");
out.write(" ");
if (_jspx_meth_s_005furl_005f6(_jspx_th_s_005fiterator_005f1, _jspx_page_context))
return true;
out.write("\r\n");
out.write(" ");
int evalDoAfterBody = _jspx_th_s_005fiterator_005f1.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fiterator_005f1 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fiterator_005f1.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f1);
return true;
}
_005fjspx_005ftagPool_005fs_005fiterator_0026_005fvalue_005fstatus.reuse(_jspx_th_s_005fiterator_005f1);
return false;
}
private boolean _jspx_meth_s_005furl_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005fiterator_005f1, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:url
org.apache.struts2.views.jsp.URLTag _jspx_th_s_005furl_005f6 = (org.apache.struts2.views.jsp.URLTag) _005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.get(org.apache.struts2.views.jsp.URLTag.class);
_jspx_th_s_005furl_005f6.setPageContext(_jspx_page_context);
_jspx_th_s_005furl_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005fiterator_005f1);
// /WEB-INF/content/question/list.jsp(227,5) name = id type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f6.setId("url");
// /WEB-INF/content/question/list.jsp(227,5) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005furl_005f6.setValue("list.action");
int _jspx_eval_s_005furl_005f6 = _jspx_th_s_005furl_005f6.doStartTag();
if (_jspx_eval_s_005furl_005f6 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005furl_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005furl_005f6.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005furl_005f6.doInitBody();
}
do {
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t\t");
if (_jspx_meth_s_005fparam_005f6(_jspx_th_s_005furl_005f6, _jspx_page_context))
return true;
out.write("\r\n");
out.write("\t\t\t\t\t\t\t\t");
int evalDoAfterBody = _jspx_th_s_005furl_005f6.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005furl_005f6 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005furl_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f6);
return true;
}
_005fjspx_005ftagPool_005fs_005furl_0026_005fvalue_005fid.reuse(_jspx_th_s_005furl_005f6);
return false;
}
private boolean _jspx_meth_s_005fparam_005f6(javax.servlet.jsp.tagext.JspTag _jspx_th_s_005furl_005f6, javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:param
org.apache.struts2.views.jsp.ParamTag _jspx_th_s_005fparam_005f6 = (org.apache.struts2.views.jsp.ParamTag) _005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.get(org.apache.struts2.views.jsp.ParamTag.class);
_jspx_th_s_005fparam_005f6.setPageContext(_jspx_page_context);
_jspx_th_s_005fparam_005f6.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_s_005furl_005f6);
// /WEB-INF/content/question/list.jsp(228,9) name = name type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f6.setName("pageNow");
// /WEB-INF/content/question/list.jsp(228,9) name = value type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fparam_005f6.setValue("pageNow");
int _jspx_eval_s_005fparam_005f6 = _jspx_th_s_005fparam_005f6.doStartTag();
if (_jspx_th_s_005fparam_005f6.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f6);
return true;
}
_005fjspx_005ftagPool_005fs_005fparam_0026_005fvalue_005fname_005fnobody.reuse(_jspx_th_s_005fparam_005f6);
return false;
}
private boolean _jspx_meth_s_005fa_005f2(javax.servlet.jsp.PageContext _jspx_page_context)
throws java.lang.Throwable {
javax.servlet.jsp.PageContext pageContext = _jspx_page_context;
javax.servlet.jsp.JspWriter out = _jspx_page_context.getOut();
// s:a
org.apache.struts2.views.jsp.ui.AnchorTag _jspx_th_s_005fa_005f2 = (org.apache.struts2.views.jsp.ui.AnchorTag) _005fjspx_005ftagPool_005fs_005fa_0026_005fhref.get(org.apache.struts2.views.jsp.ui.AnchorTag.class);
_jspx_th_s_005fa_005f2.setPageContext(_jspx_page_context);
_jspx_th_s_005fa_005f2.setParent(null);
// /WEB-INF/content/question/list.jsp(233,9) name = href type = java.lang.String reqTime = false required = false fragment = false deferredValue = false expectedTypeName = null deferredMethod = false methodSignature = null
_jspx_th_s_005fa_005f2.setHref("%{url_next}");
int _jspx_eval_s_005fa_005f2 = _jspx_th_s_005fa_005f2.doStartTag();
if (_jspx_eval_s_005fa_005f2 != javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
if (_jspx_eval_s_005fa_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.pushBody();
_jspx_th_s_005fa_005f2.setBodyContent((javax.servlet.jsp.tagext.BodyContent) out);
_jspx_th_s_005fa_005f2.doInitBody();
}
do {
out.write('下');
out.write('一');
out.write('页');
int evalDoAfterBody = _jspx_th_s_005fa_005f2.doAfterBody();
if (evalDoAfterBody != javax.servlet.jsp.tagext.BodyTag.EVAL_BODY_AGAIN)
break;
} while (true);
if (_jspx_eval_s_005fa_005f2 != javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
out = _jspx_page_context.popBody();
}
}
if (_jspx_th_s_005fa_005f2.doEndTag() == javax.servlet.jsp.tagext.Tag.SKIP_PAGE) {
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f2);
return true;
}
_005fjspx_005ftagPool_005fs_005fa_0026_005fhref.reuse(_jspx_th_s_005fa_005f2);
return false;
}
}
| 83,613 | 0.673656 | 0.595823 | 1,275 | 64.238434 | 55.186184 | 294 | false | false | 0 | 0 | 0 | 0 | 92 | 0.001106 | 0.77098 | false | false |
7
|
378f8a3ad42a74e701f71cd15da13bcd3fd08216
| 21,715,354,716,214 |
cb7257e9053f83b810d69a1ace0d21e72f513d73
|
/src/main/java/Test/demo.java
|
901594131def7773aba0133652d847026e5497f3
|
[] |
no_license
|
Liuuulu/kylin
|
https://github.com/Liuuulu/kylin
|
45f1d38a61941daeae7f6688755462e142c06944
|
4578aeda4e5ee12512eb2c14403c5ebcf06d7ed9
|
refs/heads/master
| 2023-03-18T18:49:57.609000 | 2020-12-25T01:09:06 | 2020-12-25T01:09:06 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package Test;
public class demo {
public static void main(String[] args) {
String aString ="11111111110000000000000000000000";
int num=0;
for (int i = 0; i < aString.length(); i++) {
if (num < 9){
if (aString.charAt(i)=='1') {
num++;
}
}else {
num = 1;
if (aString.charAt(i)=='1') {
num++;
}
}
}
int ziwangshu = (int)(Math.pow(2, num));
System.out.println(ziwangshu);
// double pow = Math.pow(2, 3);
// System.out.println(pow);
// String eight = Eight(451);
// System.out.println(eight);
// int ten = Ten("111000011");
// System.out.println(ten);
}
public static String Eight(int num) {
String a = Integer.toBinaryString(num);
while (a.length() < 8)
{
a = '0' + a;
}
return a;
}
//将二进制数转换成十进制的数
public static int Ten(String s){
int x = 0;
for(char c: s.toCharArray())
x = x * 2 + (c == '1' ? 1 : 0);
return x;
}
}
|
UTF-8
|
Java
| 1,203 |
java
|
demo.java
|
Java
|
[] | null |
[] |
package Test;
public class demo {
public static void main(String[] args) {
String aString ="11111111110000000000000000000000";
int num=0;
for (int i = 0; i < aString.length(); i++) {
if (num < 9){
if (aString.charAt(i)=='1') {
num++;
}
}else {
num = 1;
if (aString.charAt(i)=='1') {
num++;
}
}
}
int ziwangshu = (int)(Math.pow(2, num));
System.out.println(ziwangshu);
// double pow = Math.pow(2, 3);
// System.out.println(pow);
// String eight = Eight(451);
// System.out.println(eight);
// int ten = Ten("111000011");
// System.out.println(ten);
}
public static String Eight(int num) {
String a = Integer.toBinaryString(num);
while (a.length() < 8)
{
a = '0' + a;
}
return a;
}
//将二进制数转换成十进制的数
public static int Ten(String s){
int x = 0;
for(char c: s.toCharArray())
x = x * 2 + (c == '1' ? 1 : 0);
return x;
}
}
| 1,203 | 0.433305 | 0.382328 | 43 | 26.372093 | 14.96822 | 59 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.55814 | false | false |
7
|
c12e859961807c1ae9600cd3b6d7e5e2a475a118
| 16,638,703,336,657 |
848f37c2fe9db647730d97d451c7dc8191886541
|
/src/com/iwedia/custom/EnterPinDialog.java
|
3a7329bfdc790f089d99828f8e3a93d90cc63fe4
|
[
"Apache-2.0"
] |
permissive
|
AminRahkan/android4tv-example4
|
https://github.com/AminRahkan/android4tv-example4
|
f8a6f9edb5f0fa532ee00aa673326ed67d87118f
|
0b69b002ed79694baaafb24bd14b37121d092d59
|
refs/heads/master
| 2016-12-25T11:35:39.645000 | 2014-07-25T09:48:00 | 2014-07-25T09:48:00 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright (C) 2014 iWedia S.A. 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.iwedia.custom;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.text.InputFilter;
import android.text.InputType;
import android.widget.EditText;
import android.widget.Toast;
import com.iwedia.exampleip.dtv.DVBManager;
/**
* Class for checking PIN code.
*/
public class EnterPinDialog extends AlertDialog {
public static final int PIN_INVALID = -1;
private static final int NUMBER_OF_PIN_DIGITS = 4;
private EditText mEditText;
private PinCheckedCallback mCallbackPinChecked;
private PinEnteredCallback mCallbackPinEntered;
public interface PinCheckedCallback {
public void pinChecked(boolean pinOk);
}
public interface PinEnteredCallback {
public void pinEntered(int pin);
}
public EnterPinDialog(final Context context, PinEnteredCallback callback) {
super(context);
mCallbackPinEntered = callback;
init(context);
}
public EnterPinDialog(final Context context, PinCheckedCallback callback) {
super(context);
mCallbackPinChecked = callback;
init(context);
}
private void init(final Context context) {
setTitle("Enter Pin code");
setButton(BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (mEditText.getText().length() == NUMBER_OF_PIN_DIGITS) {
int pin = PIN_INVALID;
try {
pin = Integer.valueOf(mEditText.getText().toString());
} catch (NumberFormatException e) {
e.printStackTrace();
}
if (mCallbackPinChecked != null) {
boolean ok = DVBManager.getInstance()
.getParentalManager().checkPin(pin);
if (!ok) {
Toast.makeText(context, "Wrong pin entered",
Toast.LENGTH_SHORT).show();
}
mCallbackPinChecked.pinChecked(ok);
}
if (mCallbackPinEntered != null) {
mCallbackPinEntered.pinEntered(pin);
}
dialog.dismiss();
}
}
});
mEditText = new EditText(context);
InputFilter maxLengthFilter = new InputFilter.LengthFilter(4);
mEditText.setFilters(new InputFilter[] { maxLengthFilter });
mEditText.setInputType(InputType.TYPE_CLASS_NUMBER);
setView(mEditText);
}
@Override
public void onBackPressed() {
super.onBackPressed();
if (mCallbackPinChecked != null) {
mCallbackPinChecked.pinChecked(false);
}
}
}
|
UTF-8
|
Java
| 3,503 |
java
|
EnterPinDialog.java
|
Java
|
[] | null |
[] |
/*
* Copyright (C) 2014 iWedia S.A. 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.iwedia.custom;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.text.InputFilter;
import android.text.InputType;
import android.widget.EditText;
import android.widget.Toast;
import com.iwedia.exampleip.dtv.DVBManager;
/**
* Class for checking PIN code.
*/
public class EnterPinDialog extends AlertDialog {
public static final int PIN_INVALID = -1;
private static final int NUMBER_OF_PIN_DIGITS = 4;
private EditText mEditText;
private PinCheckedCallback mCallbackPinChecked;
private PinEnteredCallback mCallbackPinEntered;
public interface PinCheckedCallback {
public void pinChecked(boolean pinOk);
}
public interface PinEnteredCallback {
public void pinEntered(int pin);
}
public EnterPinDialog(final Context context, PinEnteredCallback callback) {
super(context);
mCallbackPinEntered = callback;
init(context);
}
public EnterPinDialog(final Context context, PinCheckedCallback callback) {
super(context);
mCallbackPinChecked = callback;
init(context);
}
private void init(final Context context) {
setTitle("Enter Pin code");
setButton(BUTTON_POSITIVE, "Ok", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (mEditText.getText().length() == NUMBER_OF_PIN_DIGITS) {
int pin = PIN_INVALID;
try {
pin = Integer.valueOf(mEditText.getText().toString());
} catch (NumberFormatException e) {
e.printStackTrace();
}
if (mCallbackPinChecked != null) {
boolean ok = DVBManager.getInstance()
.getParentalManager().checkPin(pin);
if (!ok) {
Toast.makeText(context, "Wrong pin entered",
Toast.LENGTH_SHORT).show();
}
mCallbackPinChecked.pinChecked(ok);
}
if (mCallbackPinEntered != null) {
mCallbackPinEntered.pinEntered(pin);
}
dialog.dismiss();
}
}
});
mEditText = new EditText(context);
InputFilter maxLengthFilter = new InputFilter.LengthFilter(4);
mEditText.setFilters(new InputFilter[] { maxLengthFilter });
mEditText.setInputType(InputType.TYPE_CLASS_NUMBER);
setView(mEditText);
}
@Override
public void onBackPressed() {
super.onBackPressed();
if (mCallbackPinChecked != null) {
mCallbackPinChecked.pinChecked(false);
}
}
}
| 3,503 | 0.612047 | 0.608907 | 95 | 35.873684 | 24.871561 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.536842 | false | false |
7
|
2181215a005f7af3dca3770418b6ad2421a2b1a8
| 10,093,173,152,628 |
fab880b4117065b2096d54086b0b62d64cede73d
|
/orangecandle-server/src/main/java/com/orangecandle/repository/Faculty.java
|
c8c9a267a19b21e1fef79e6a57b1764d165ba11f
|
[] |
no_license
|
team40175/orangecandle
|
https://github.com/team40175/orangecandle
|
a2ce47b20e8f9eca87675b67ea896172669612df
|
cc6721ce300f17ff4a45154096eb2c0359d6ba29
|
refs/heads/master
| 2020-05-17T00:10:55.263000 | 2015-05-22T20:23:46 | 2015-05-22T20:23:46 | 33,117,788 | 0 | 0 | null | false | 2015-05-22T20:09:31 | 2015-03-30T10:52:55 | 2015-05-08T13:46:13 | 2015-05-22T20:09:30 | 6,352 | 0 | 0 | 0 |
JavaScript
| null | null |
package com.orangecandle.repository;
import org.springframework.data.jpa.repository.JpaRepository;
public interface Faculty extends
JpaRepository<com.orangecandle.domain.Faculty, Long> {
public com.orangecandle.domain.Faculty findByName(String name);
}
|
UTF-8
|
Java
| 268 |
java
|
Faculty.java
|
Java
|
[] | null |
[] |
package com.orangecandle.repository;
import org.springframework.data.jpa.repository.JpaRepository;
public interface Faculty extends
JpaRepository<com.orangecandle.domain.Faculty, Long> {
public com.orangecandle.domain.Faculty findByName(String name);
}
| 268 | 0.798507 | 0.798507 | 9 | 27.777779 | 26.519501 | 64 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.777778 | false | false |
7
|
10a0f805ebab1caaa0eaebc741fbfa7699e9ac4e
| 1,443,109,079,117 |
3c19ccee084c8c151de016a89a336b9ce26392c9
|
/src/main/java/io/project/api/domain/model/Cliente.java
|
6205495e81af927975652e5d14d48d6c8e7d1d15
|
[] |
no_license
|
gabriellaxaviera/projectApiRest
|
https://github.com/gabriellaxaviera/projectApiRest
|
2d4de4702aed5322acf4b5939269e47030f34634
|
5a0518f63496cb66419f89f7497390b5ef50d28a
|
refs/heads/master
| 2023-08-12T08:15:54.535000 | 2021-09-24T17:42:36 | 2021-09-24T17:42:36 | 399,573,471 | 0 | 0 | null | false | 2021-09-24T17:42:36 | 2021-08-24T18:54:22 | 2021-09-09T12:32:14 | 2021-09-24T17:42:36 | 111 | 0 | 0 | 0 |
Java
| false | false |
package io.project.api.domain.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.br.CPF;
import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.util.Set;
@Entity
@Table(name = "cliente") //não obrigatório caso o nome da entidade seja o mesmo
@Getter
@Setter
@NoArgsConstructor
public class Cliente {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Integer id;
@Column(name = "nome", length = 100)
@NotEmpty(message = "{campo.nome.obrigatorio}")
private String nome;
@Column(name = "cpf", length = 11)
@NotEmpty(message = "{campo.cpf.obrigatorio}")
@CPF(message = "{campo.cpf.invalido}")
private String cpf;
@JsonIgnore
@OneToMany(mappedBy = "cliente", fetch = FetchType.LAZY)
// ONE cliente para MANY pedidos;
// mapped by a propriedade que que esta lidando com os pediso, no caso é cliente
// não recomendado eager, para não pesar a consulta
private Set<Pedido> pedidos;
public Cliente(Integer id, String nome) {
this.id = id;
this.nome = nome;
}
}
|
UTF-8
|
Java
| 1,252 |
java
|
Cliente.java
|
Java
|
[] | null |
[] |
package io.project.api.domain.model;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.validator.constraints.br.CPF;
import javax.persistence.*;
import javax.validation.constraints.NotEmpty;
import java.util.Set;
@Entity
@Table(name = "cliente") //não obrigatório caso o nome da entidade seja o mesmo
@Getter
@Setter
@NoArgsConstructor
public class Cliente {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Integer id;
@Column(name = "nome", length = 100)
@NotEmpty(message = "{campo.nome.obrigatorio}")
private String nome;
@Column(name = "cpf", length = 11)
@NotEmpty(message = "{campo.cpf.obrigatorio}")
@CPF(message = "{campo.cpf.invalido}")
private String cpf;
@JsonIgnore
@OneToMany(mappedBy = "cliente", fetch = FetchType.LAZY)
// ONE cliente para MANY pedidos;
// mapped by a propriedade que que esta lidando com os pediso, no caso é cliente
// não recomendado eager, para não pesar a consulta
private Set<Pedido> pedidos;
public Cliente(Integer id, String nome) {
this.id = id;
this.nome = nome;
}
}
| 1,252 | 0.700882 | 0.696872 | 46 | 26.108696 | 21.842548 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.478261 | false | false |
7
|
5460bfe068fc6f7ea8cc7fa0b3801db8ffdd756c
| 11,802,570,174,610 |
857e4a79b67cbd7314c6d710e45323930b0c8061
|
/src/com/lw/ttzw/DataQueryManager.java
|
914b232186824aa84da4db12a1f0d14f05686957
|
[] |
no_license
|
liu149339750/NovelReader
|
https://github.com/liu149339750/NovelReader
|
6460d58aea37eaed5be38e3f82979dfe8a9dfc41
|
f6dc7d051f218d90ec293320890c46bf2606462d
|
refs/heads/master
| 2021-01-19T19:22:46.582000 | 2018-05-14T13:19:26 | 2018-05-14T13:19:26 | 88,413,841 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.lw.ttzw;
import java.util.List;
import org.htmlparser.util.ParserException;
import com.lw.bean.Chapter;
import com.lw.bean.Novel;
import com.lw.bean.NovelDetail;
import com.lw.bean.Novels;
import com.lw.datainterfaceimpl.TTZWImpl;
import android.util.Pair;
public class DataQueryManager implements DataInterface{
private static DataQueryManager dataQueryManager = new DataQueryManager();
private static final String TAG = "DataQueryManager";
private DataInterface mDataInterface;
public static DataQueryManager instance() {
return dataQueryManager;
}
public DataQueryManager() {
}
@Override
public Novels search(String keyword) throws ParserException {
return SourceSelector.getDefaultSource().search(keyword);
}
@Override
public Novels loadSearchNovel(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.loadSearchNovel(url);
}
return SourceSelector.getDefaultSource().loadSearchNovel(url);
}
@Override
public String getChapterContent(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getChapterContent(url);
}
return SourceSelector.getDefaultSource().getChapterContent(url);
}
@Override
public List<Chapter> getNovelChapers(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getNovelChapers(url);
}
return SourceSelector.getDefaultSource().getNovelChapers(url);
}
@Override
public NovelDetail getNovelDetail(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getNovelDetail(url);
}
System.out.println("use default :>" + url);
return SourceSelector.getDefaultSource().getNovelDetail(url);
}
@Override
public List<Novel> getLastUpdates(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getLastUpdates(url);
}
return SourceSelector.getDefaultSource().getLastUpdates(url);
}
@Override
public Novels getSortKindNovels(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getSortKindNovels(url);
}
return SourceSelector.getDefaultSource().getSortKindNovels(url);
}
@Override
public List<Pair<String, String>> getSortKindUrlPairs() {
DataInterface df = SourceSelector.getDefaultSource();
if(df != null) {
return df.getSortKindUrlPairs();
}
return SourceSelector.getDefaultSource().getSortKindUrlPairs();
}
@Override
public List<Pair<String, String>> getLastUpdateUrlPairs() {
DataInterface df = SourceSelector.getDefaultSource();
if(df != null) {
return df.getLastUpdateUrlPairs();
}
return SourceSelector.getDefaultSource().getLastUpdateUrlPairs();
}
@Override
public String getTag() {
return SourceSelector.getDefaultSource().getTag();
}
@Override
public DataInterface select(String url) {
return SourceSelector.selectDataInterface(url);
}
@Override
public String getChapterUrl(String url) {
DataInterface df = SourceSelector.getDefaultSource();
if(df != null) {
return df.getChapterUrl(url);
}
return SourceSelector.getDefaultSource().getChapterUrl(url);
}
@Override
public Novels getRankNovels(String url) throws ParserException {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Pair<String, String>> getWeekRankUrlPairs() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Pair<String, String>> getMonthRankUrlPairs() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Pair<String, String>> getAllRankUrlPairs() {
// TODO Auto-generated method stub
return null;
}
public String queryTag(String url) {
DataInterface di = SourceSelector.selectDataInterface(url);
if(di != null)
return di.getTag();
return "";
}
}
|
UTF-8
|
Java
| 4,071 |
java
|
DataQueryManager.java
|
Java
|
[] | null |
[] |
package com.lw.ttzw;
import java.util.List;
import org.htmlparser.util.ParserException;
import com.lw.bean.Chapter;
import com.lw.bean.Novel;
import com.lw.bean.NovelDetail;
import com.lw.bean.Novels;
import com.lw.datainterfaceimpl.TTZWImpl;
import android.util.Pair;
public class DataQueryManager implements DataInterface{
private static DataQueryManager dataQueryManager = new DataQueryManager();
private static final String TAG = "DataQueryManager";
private DataInterface mDataInterface;
public static DataQueryManager instance() {
return dataQueryManager;
}
public DataQueryManager() {
}
@Override
public Novels search(String keyword) throws ParserException {
return SourceSelector.getDefaultSource().search(keyword);
}
@Override
public Novels loadSearchNovel(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.loadSearchNovel(url);
}
return SourceSelector.getDefaultSource().loadSearchNovel(url);
}
@Override
public String getChapterContent(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getChapterContent(url);
}
return SourceSelector.getDefaultSource().getChapterContent(url);
}
@Override
public List<Chapter> getNovelChapers(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getNovelChapers(url);
}
return SourceSelector.getDefaultSource().getNovelChapers(url);
}
@Override
public NovelDetail getNovelDetail(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getNovelDetail(url);
}
System.out.println("use default :>" + url);
return SourceSelector.getDefaultSource().getNovelDetail(url);
}
@Override
public List<Novel> getLastUpdates(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getLastUpdates(url);
}
return SourceSelector.getDefaultSource().getLastUpdates(url);
}
@Override
public Novels getSortKindNovels(String url) throws ParserException {
DataInterface df = SourceSelector.selectDataInterface(url);
if(df != null) {
return df.getSortKindNovels(url);
}
return SourceSelector.getDefaultSource().getSortKindNovels(url);
}
@Override
public List<Pair<String, String>> getSortKindUrlPairs() {
DataInterface df = SourceSelector.getDefaultSource();
if(df != null) {
return df.getSortKindUrlPairs();
}
return SourceSelector.getDefaultSource().getSortKindUrlPairs();
}
@Override
public List<Pair<String, String>> getLastUpdateUrlPairs() {
DataInterface df = SourceSelector.getDefaultSource();
if(df != null) {
return df.getLastUpdateUrlPairs();
}
return SourceSelector.getDefaultSource().getLastUpdateUrlPairs();
}
@Override
public String getTag() {
return SourceSelector.getDefaultSource().getTag();
}
@Override
public DataInterface select(String url) {
return SourceSelector.selectDataInterface(url);
}
@Override
public String getChapterUrl(String url) {
DataInterface df = SourceSelector.getDefaultSource();
if(df != null) {
return df.getChapterUrl(url);
}
return SourceSelector.getDefaultSource().getChapterUrl(url);
}
@Override
public Novels getRankNovels(String url) throws ParserException {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Pair<String, String>> getWeekRankUrlPairs() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Pair<String, String>> getMonthRankUrlPairs() {
// TODO Auto-generated method stub
return null;
}
@Override
public List<Pair<String, String>> getAllRankUrlPairs() {
// TODO Auto-generated method stub
return null;
}
public String queryTag(String url) {
DataInterface di = SourceSelector.selectDataInterface(url);
if(di != null)
return di.getTag();
return "";
}
}
| 4,071 | 0.749939 | 0.749939 | 159 | 24.603773 | 24.395849 | 75 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.559748 | false | false |
7
|
d6caebe17cb33967c4f5e7283752467388b806f1
| 15,118,284,927,742 |
2f1f883b88c35fbdd7bcdad42b364df465f61279
|
/ses-app/ses-mobile-rps/src/main/java/com/redescooter/ses/mobile/rps/service/base/impl/OpePurchasBServiceImpl.java
|
14b70f7f2167f1766b4999ecd7c0042c98804305
|
[
"MIT"
] |
permissive
|
RedElect/ses-server
|
https://github.com/RedElect/ses-server
|
bd4a6c6091d063217655ab573422f4cf37c8dcbf
|
653cda02110cb31a36d8435cc4c72e792467d134
|
refs/heads/master
| 2023-06-19T16:16:53.418000 | 2021-07-19T09:19:25 | 2021-07-19T09:19:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.redescooter.ses.mobile.rps.service.base.impl;
import com.redescooter.ses.mobile.rps.dm.OpePurchasB;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.redescooter.ses.mobile.rps.dao.base.OpePurchasBMapper;
import com.redescooter.ses.mobile.rps.service.base.OpePurchasBService;
@Service
public class OpePurchasBServiceImpl extends ServiceImpl<OpePurchasBMapper, OpePurchasB> implements OpePurchasBService {
@Override
public int batchInsert(List<OpePurchasB> list) {
return baseMapper.batchInsert(list);
}
@Override
public int insertOrUpdate(OpePurchasB record) {
return baseMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(OpePurchasB record) {
return baseMapper.insertOrUpdateSelective(record);
}
}
|
UTF-8
|
Java
| 919 |
java
|
OpePurchasBServiceImpl.java
|
Java
|
[] | null |
[] |
package com.redescooter.ses.mobile.rps.service.base.impl;
import com.redescooter.ses.mobile.rps.dm.OpePurchasB;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.redescooter.ses.mobile.rps.dao.base.OpePurchasBMapper;
import com.redescooter.ses.mobile.rps.service.base.OpePurchasBService;
@Service
public class OpePurchasBServiceImpl extends ServiceImpl<OpePurchasBMapper, OpePurchasB> implements OpePurchasBService {
@Override
public int batchInsert(List<OpePurchasB> list) {
return baseMapper.batchInsert(list);
}
@Override
public int insertOrUpdate(OpePurchasB record) {
return baseMapper.insertOrUpdate(record);
}
@Override
public int insertOrUpdateSelective(OpePurchasB record) {
return baseMapper.insertOrUpdateSelective(record);
}
}
| 919 | 0.768226 | 0.768226 | 29 | 30.206896 | 30.639595 | 119 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.37931 | false | false |
7
|
5eff96e8258fe96b64e5a4651444f92eed98da93
| 15,882,789,069,255 |
30a36f962bbe445de036631b9c5db38a783fcd14
|
/workspace/ExceptionTest/src/ExceptionTest.java
|
c3f7d8e656cb54fb230a563254c0396083fb1c80
|
[] |
no_license
|
wowyyy/Program-Java
|
https://github.com/wowyyy/Program-Java
|
2b0d122ab849070ca6c97e933dbc054af20bae4e
|
5b16d5b79d066ec4bc80ceb58353912800723c8f
|
refs/heads/master
| 2021-06-21T08:11:52.353000 | 2017-08-09T16:22:29 | 2017-08-09T16:22:29 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class ExceptionTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new Student("LiuAnkun").setOff(2);
new Student("LiuAnkun").setOff(1);
new Student("LiuAnkun").setOff(0);
}
}
class SoldOutException extends Exception{
SoldOutException(){
}
SoldOutException(String msg){
super(msg);
}
}
class CarLaterException extends Exception{
CarLaterException(){
}
CarLaterException(String msg){
super(msg);
}
}
class Go2Shool {
private int status = 0;
private String name=null;
Go2Shool() {
System.out.print("go to school ...\n");
}
Go2Shool(String name){
this.name = name;
System.out.print(this.name+"..."+"go to school ...\n");
}
public void goToSchool(int status) throws SoldOutException,CarLaterException {
this.status = status;
if(this.status == 1)
throw new CarLaterException("The train was late");
if(this.status == 2)
throw new SoldOutException("Tickets sold out");
System.out.print("To get to school !");
}
}
class Student {
private Go2Shool gh;
private String name;
private int status = 0;
Student(String name){
this.name = name;
gh = new Go2Shool(this.name);
}
public void setOff(int status){
this.status = status;
try {
gh.goToSchool(this.status);
} catch (SoldOutException se) {
se.printStackTrace();
} catch (CarLaterException ce) {
ce.printStackTrace();
} finally {
System.out.print("千辛万险到达学校!\n");
}
}
}
|
GB18030
|
Java
| 1,549 |
java
|
ExceptionTest.java
|
Java
|
[
{
"context": "ODO Auto-generated method stub\n\n\t\t\n\t\tnew Student(\"LiuAnkun\").setOff(2);\n\t\tnew Student(\"LiuAnkun\").setOff(1);",
"end": 163,
"score": 0.9997699856758118,
"start": 155,
"tag": "NAME",
"value": "LiuAnkun"
},
{
"context": "new Student(\"LiuAnkun\").setOff(2);\n\t\tnew Student(\"LiuAnkun\").setOff(1);\n\t\tnew Student(\"LiuAnkun\").setOff(0);",
"end": 200,
"score": 0.9997453689575195,
"start": 192,
"tag": "NAME",
"value": "LiuAnkun"
},
{
"context": "new Student(\"LiuAnkun\").setOff(1);\n\t\tnew Student(\"LiuAnkun\").setOff(0);\n\t}\n\n}\n\n\n\nclass SoldOutException exte",
"end": 237,
"score": 0.9997159242630005,
"start": 229,
"tag": "NAME",
"value": "LiuAnkun"
}
] | null |
[] |
public class ExceptionTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
new Student("LiuAnkun").setOff(2);
new Student("LiuAnkun").setOff(1);
new Student("LiuAnkun").setOff(0);
}
}
class SoldOutException extends Exception{
SoldOutException(){
}
SoldOutException(String msg){
super(msg);
}
}
class CarLaterException extends Exception{
CarLaterException(){
}
CarLaterException(String msg){
super(msg);
}
}
class Go2Shool {
private int status = 0;
private String name=null;
Go2Shool() {
System.out.print("go to school ...\n");
}
Go2Shool(String name){
this.name = name;
System.out.print(this.name+"..."+"go to school ...\n");
}
public void goToSchool(int status) throws SoldOutException,CarLaterException {
this.status = status;
if(this.status == 1)
throw new CarLaterException("The train was late");
if(this.status == 2)
throw new SoldOutException("Tickets sold out");
System.out.print("To get to school !");
}
}
class Student {
private Go2Shool gh;
private String name;
private int status = 0;
Student(String name){
this.name = name;
gh = new Go2Shool(this.name);
}
public void setOff(int status){
this.status = status;
try {
gh.goToSchool(this.status);
} catch (SoldOutException se) {
se.printStackTrace();
} catch (CarLaterException ce) {
ce.printStackTrace();
} finally {
System.out.print("千辛万险到达学校!\n");
}
}
}
| 1,549 | 0.647943 | 0.640105 | 92 | 15.597826 | 16.692266 | 80 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.597826 | false | false |
7
|
96c358978ec09e43e8c46f4d0a1d4a2218f0a08e
| 5,368,709,179,172 |
4baf49124fcc2ad0f5af9182b00533ea78b3c6bd
|
/org.ziptie.net/src/org/ziptie/net/ping/icmp/PingConfig.java
|
4e165eaacdc497ae04e776e2dbdc162870c879b5
|
[] |
no_license
|
patrickpreuss/ziptie
|
https://github.com/patrickpreuss/ziptie
|
d7e42d6f2956cf1fbad785f66009ce277f2e1e5b
|
a4e2b3cc9e042ba903fc5254290be5c7d4aaa16c
|
refs/heads/master
| 2021-01-20T16:31:19.827000 | 2013-02-23T18:30:24 | 2013-02-23T18:30:24 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/* Alterpoint, Inc.
*
* The contents of this source code are proprietary and confidential
* All code, patterns, and comments are Copyright Alterpoint, Inc. 2003-2005
*
* $Author: rkruse $
* $Date: 2008/06/04 02:27:37 $
* $Revision: 1.4 $
* $Source: /usr/local/cvsroot/org.ziptie.net/src/org/ziptie/net/ping/icmp/PingConfig.java,v $
*/
package org.ziptie.net.ping.icmp;
import org.ziptie.common.OsTypes;
/**
* PingSyntaxConfig provides a configuration for ping commands and arguements on RedHat Linux, Windows Server and
* Solaris.
*/
public class PingConfig
{
private String command;
private String timeoutFlag;
private String sizeFlag;
private String countFlag;
private OsTypes os = OsTypes.Unknown;
/**
*
*/
public PingConfig()
{
}
/**
* @return Returns the os.
*/
public OsTypes getOs()
{
return os;
}
/**
* @param os The os to set.
*/
public void setOs(OsTypes os)
{
this.os = os;
}
/**
* @return Returns the command.
*/
public String getCommand()
{
return command;
}
/**
* @param command The command to set.
*/
public void setCommand(String command)
{
this.command = command;
}
/**
* @return Returns the countFlag.
*/
public String getCountFlag()
{
return countFlag;
}
/**
* @param countFlag The countFlag to set.
*/
public void setCountFlag(String countFlag)
{
this.countFlag = countFlag;
}
/**
* @return Returns the sizeFlag.
*/
public String getSizeFlag()
{
return sizeFlag;
}
/**
* @param sizeFlag The sizeFlag to set.
*/
public void setSizeFlag(String sizeFlag)
{
this.sizeFlag = sizeFlag;
}
/**
* @return Returns the timeoutFlag.
*/
public String getTimeoutFlag()
{
return timeoutFlag;
}
/**
* @param timeoutFlag The timeoutFlag to set.
*/
public void setTimeoutFlag(String timeoutFlag)
{
this.timeoutFlag = timeoutFlag;
}
/**
* {@inheritDoc}
*/
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((command == null) ? 0 : command.hashCode());
result = prime * result + ((countFlag == null) ? 0 : countFlag.hashCode());
result = prime * result + ((sizeFlag == null) ? 0 : sizeFlag.hashCode());
result = prime * result + ((timeoutFlag == null) ? 0 : timeoutFlag.hashCode());
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final PingConfig other = (PingConfig) obj;
if (command == null)
{
if (other.command != null)
{
return false;
}
}
else if (!command.equals(other.command))
{
return false;
}
if (countFlag == null)
{
if (other.countFlag != null)
{
return false;
}
}
else if (!countFlag.equals(other.countFlag))
{
return false;
}
if (sizeFlag == null)
{
if (other.sizeFlag != null)
{
return false;
}
}
else if (!sizeFlag.equals(other.sizeFlag))
{
return false;
}
if (timeoutFlag == null)
{
if (other.timeoutFlag != null)
{
return false;
}
}
else if (!timeoutFlag.equals(other.timeoutFlag))
{
return false;
}
return true;
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("nls")
@Override
public String toString()
{
return command + " " + countFlag + " " + sizeFlag + " " + timeoutFlag;
}
}
|
UTF-8
|
Java
| 4,254 |
java
|
PingConfig.java
|
Java
|
[
{
"context": "yright Alterpoint, Inc. 2003-2005\n *\n * $Author: rkruse $\n * $Date: 2008/06/04 02:27:37 $\n * $Revisio",
"end": 192,
"score": 0.9996609091758728,
"start": 186,
"tag": "USERNAME",
"value": "rkruse"
}
] | null |
[] |
/* Alterpoint, Inc.
*
* The contents of this source code are proprietary and confidential
* All code, patterns, and comments are Copyright Alterpoint, Inc. 2003-2005
*
* $Author: rkruse $
* $Date: 2008/06/04 02:27:37 $
* $Revision: 1.4 $
* $Source: /usr/local/cvsroot/org.ziptie.net/src/org/ziptie/net/ping/icmp/PingConfig.java,v $
*/
package org.ziptie.net.ping.icmp;
import org.ziptie.common.OsTypes;
/**
* PingSyntaxConfig provides a configuration for ping commands and arguements on RedHat Linux, Windows Server and
* Solaris.
*/
public class PingConfig
{
private String command;
private String timeoutFlag;
private String sizeFlag;
private String countFlag;
private OsTypes os = OsTypes.Unknown;
/**
*
*/
public PingConfig()
{
}
/**
* @return Returns the os.
*/
public OsTypes getOs()
{
return os;
}
/**
* @param os The os to set.
*/
public void setOs(OsTypes os)
{
this.os = os;
}
/**
* @return Returns the command.
*/
public String getCommand()
{
return command;
}
/**
* @param command The command to set.
*/
public void setCommand(String command)
{
this.command = command;
}
/**
* @return Returns the countFlag.
*/
public String getCountFlag()
{
return countFlag;
}
/**
* @param countFlag The countFlag to set.
*/
public void setCountFlag(String countFlag)
{
this.countFlag = countFlag;
}
/**
* @return Returns the sizeFlag.
*/
public String getSizeFlag()
{
return sizeFlag;
}
/**
* @param sizeFlag The sizeFlag to set.
*/
public void setSizeFlag(String sizeFlag)
{
this.sizeFlag = sizeFlag;
}
/**
* @return Returns the timeoutFlag.
*/
public String getTimeoutFlag()
{
return timeoutFlag;
}
/**
* @param timeoutFlag The timeoutFlag to set.
*/
public void setTimeoutFlag(String timeoutFlag)
{
this.timeoutFlag = timeoutFlag;
}
/**
* {@inheritDoc}
*/
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ((command == null) ? 0 : command.hashCode());
result = prime * result + ((countFlag == null) ? 0 : countFlag.hashCode());
result = prime * result + ((sizeFlag == null) ? 0 : sizeFlag.hashCode());
result = prime * result + ((timeoutFlag == null) ? 0 : timeoutFlag.hashCode());
return result;
}
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final PingConfig other = (PingConfig) obj;
if (command == null)
{
if (other.command != null)
{
return false;
}
}
else if (!command.equals(other.command))
{
return false;
}
if (countFlag == null)
{
if (other.countFlag != null)
{
return false;
}
}
else if (!countFlag.equals(other.countFlag))
{
return false;
}
if (sizeFlag == null)
{
if (other.sizeFlag != null)
{
return false;
}
}
else if (!sizeFlag.equals(other.sizeFlag))
{
return false;
}
if (timeoutFlag == null)
{
if (other.timeoutFlag != null)
{
return false;
}
}
else if (!timeoutFlag.equals(other.timeoutFlag))
{
return false;
}
return true;
}
/**
* {@inheritDoc}
*/
@SuppressWarnings("nls")
@Override
public String toString()
{
return command + " " + countFlag + " " + sizeFlag + " " + timeoutFlag;
}
}
| 4,254 | 0.501646 | 0.494358 | 206 | 19.650486 | 19.768911 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.213592 | false | false |
7
|
6437c979043604d932f2f8d6c12c5c98b4c73407
| 25,778,393,777,038 |
39a7ed01715492b021fd69a4d9888d5d3f2a21ec
|
/native-core/src/main/java/com/shawntime/rpc/core/protocol/ParameterEntity.java
|
5c6775199836c5c672331c9f2d9542c48b000c06
|
[] |
no_license
|
shawntime/shawn-native-rpc
|
https://github.com/shawntime/shawn-native-rpc
|
b65a1eb59555ce28fe68e02d50b7f009f2e3528e
|
0631921c7c48a0a122b7f60362a21736591fcf58
|
refs/heads/master
| 2021-01-24T12:23:51.066000 | 2018-02-28T06:01:41 | 2018-02-28T06:01:41 | 123,135,074 | 7 | 2 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.shawntime.rpc.core.protocol;
/**
* 方法请求参数封装
*/
public class ParameterEntity {
private String clazz;
private Object value;
public String getClazz() {
return clazz;
}
public void setClazz(String clazz) {
this.clazz = clazz;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
}
|
UTF-8
|
Java
| 437 |
java
|
ParameterEntity.java
|
Java
|
[] | null |
[] |
package com.shawntime.rpc.core.protocol;
/**
* 方法请求参数封装
*/
public class ParameterEntity {
private String clazz;
private Object value;
public String getClazz() {
return clazz;
}
public void setClazz(String clazz) {
this.clazz = clazz;
}
public Object getValue() {
return value;
}
public void setValue(Object value) {
this.value = value;
}
}
| 437 | 0.598575 | 0.598575 | 27 | 14.592592 | 14.376574 | 40 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.259259 | false | false |
7
|
8ebb7ce88cf209d03187da80dff1ad2008b47f4e
| 22,076,131,961,306 |
bc8dbd600a067cc9d50f7ff8c0a74638b9c9590a
|
/FlipkartAddToKart/src/test/java/com/stepdefinitions/TestLogin.java
|
43e496e2c23378b3d9c099783fe04c2887ae2ddd
|
[] |
no_license
|
RajeshS235/FlipkartTest
|
https://github.com/RajeshS235/FlipkartTest
|
8bb4ed319c4c05ba2a650ca2842054aa35a9defa
|
d1bcaf6d7841d6bd4630bc9f200fbc6da41a3380
|
refs/heads/master
| 2023-03-02T00:20:00.530000 | 2021-02-12T02:56:27 | 2021-02-12T02:56:27 | 337,272,508 | 0 | 0 | null | false | 2021-02-11T07:47:02 | 2021-02-09T02:43:50 | 2021-02-11T07:40:59 | 2021-02-11T07:47:02 | 47 | 0 | 0 | 0 |
Java
| false | false |
package com.stepdefinitions;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import com.pageobjects.LoginPageObjects;
import cucumber.api.java.en.*;
public class TestLogin {
public WebDriver driver;
public LoginPageObjects lp;
@Given("User Launch Chrome browser")
public void user_Launch_Chrome_browser() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\admin\\eclipse-workspace\\YourLogo\\Driver\\chromedriver.exe");
driver = new ChromeDriver();
}
@When("User open URL {string}")
public void user_open_URL(String url) throws InterruptedException {
driver.get(url);
driver.manage().window().maximize();
}
@When("User Entered username {string} and password {string}")
public void user_Entered_username_and_password(String username, String password) {
driver.manage().timeouts().implicitlyWait(200, TimeUnit.SECONDS);
lp = new LoginPageObjects(driver);
lp.moveToElement();
lp.setUsername(username);
lp.clickContinue();
lp.setPassword(password);
}
@When("User click the login button")
public void user_click_the_login_button() {
lp.clickSignin();
}
@Then("Page title should be {string}")
public void page_title_should_be(String title2) {
driver.manage().timeouts().implicitlyWait(200, TimeUnit.SECONDS);
String title = driver.getTitle();
}
@When("User click logout button")
public void user_click_logout_button() {
driver.navigate().refresh();
lp.logOut();
String title1 = driver.getTitle();
System.out.println(title1);
}
@When("User close browser")
public void user_close_browser() {
driver.quit();
}
}
|
UTF-8
|
Java
| 1,702 |
java
|
TestLogin.java
|
Java
|
[
{
"context": "river);\n\t\t\n\t\tlp.moveToElement();\n\t\tlp.setUsername(username);\n\t\tlp.clickContinue();\n\t\tlp.setPassword(password",
"end": 1051,
"score": 0.9989593029022217,
"start": 1043,
"tag": "USERNAME",
"value": "username"
},
{
"context": "username);\n\t\tlp.clickContinue();\n\t\tlp.setPassword(password);\n\t}\n\n\t@When(\"User click the login button\")\n\tpubl",
"end": 1101,
"score": 0.9935697317123413,
"start": 1093,
"tag": "PASSWORD",
"value": "password"
}
] | null |
[] |
package com.stepdefinitions;
import java.util.concurrent.TimeUnit;
import org.junit.Assert;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import com.pageobjects.LoginPageObjects;
import cucumber.api.java.en.*;
public class TestLogin {
public WebDriver driver;
public LoginPageObjects lp;
@Given("User Launch Chrome browser")
public void user_Launch_Chrome_browser() {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\admin\\eclipse-workspace\\YourLogo\\Driver\\chromedriver.exe");
driver = new ChromeDriver();
}
@When("User open URL {string}")
public void user_open_URL(String url) throws InterruptedException {
driver.get(url);
driver.manage().window().maximize();
}
@When("User Entered username {string} and password {string}")
public void user_Entered_username_and_password(String username, String password) {
driver.manage().timeouts().implicitlyWait(200, TimeUnit.SECONDS);
lp = new LoginPageObjects(driver);
lp.moveToElement();
lp.setUsername(username);
lp.clickContinue();
lp.setPassword(<PASSWORD>);
}
@When("User click the login button")
public void user_click_the_login_button() {
lp.clickSignin();
}
@Then("Page title should be {string}")
public void page_title_should_be(String title2) {
driver.manage().timeouts().implicitlyWait(200, TimeUnit.SECONDS);
String title = driver.getTitle();
}
@When("User click logout button")
public void user_click_logout_button() {
driver.navigate().refresh();
lp.logOut();
String title1 = driver.getTitle();
System.out.println(title1);
}
@When("User close browser")
public void user_close_browser() {
driver.quit();
}
}
| 1,704 | 0.725617 | 0.720329 | 72 | 22.638889 | 23.901014 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.361111 | false | false |
7
|
378408e677d68289784a6c5a9a3e6747573f6580
| 13,786,845,064,276 |
7214e5bd984a6ef65d5cdbad03914a722d39c633
|
/src/main/java/edu/miu/cs/se/exceptions/order/OrderNotModifiedException.java
|
1a07f37db419fec60eb72cfb8bb6d98b547761f7
|
[] |
no_license
|
Dawed-Muzeyen/mini-shopping-project
|
https://github.com/Dawed-Muzeyen/mini-shopping-project
|
e1d620dbb081927f72d1a82908ecc366009de2f7
|
bcfbf8ccf6b87f63e5f5b336b419529e1f5ba3cc
|
refs/heads/main
| 2023-08-11T21:24:26.414000 | 2021-09-27T22:53:11 | 2021-09-27T22:53:11 | 410,621,627 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package edu.miu.cs.se.exceptions.order;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_MODIFIED)
public class OrderNotModifiedException extends RuntimeException {
private String message;
public OrderNotModifiedException(String message) {
super(message);
}
}
|
UTF-8
|
Java
| 373 |
java
|
OrderNotModifiedException.java
|
Java
|
[] | null |
[] |
package edu.miu.cs.se.exceptions.order;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_MODIFIED)
public class OrderNotModifiedException extends RuntimeException {
private String message;
public OrderNotModifiedException(String message) {
super(message);
}
}
| 373 | 0.790885 | 0.790885 | 14 | 25.642857 | 23.954144 | 65 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.357143 | false | false |
7
|
ddbfdefec295101de1d23af3eceb795ae65f9ba4
| 13,511,967,169,634 |
13f91e159b7980e0f6132bb1f4e2ae06cca18ca5
|
/src/test/java/LocalDateTest.java
|
bf4ae87f64aed539384a1c5141e744c932d0210b
|
[] |
no_license
|
crydemon/bigData
|
https://github.com/crydemon/bigData
|
6792c445894d5563184d948fa7ac82a6e5d20f4a
|
9fddc4d51d0a3f5814039de3bde6ea58a75386a3
|
refs/heads/master
| 2022-06-22T13:59:15.580000 | 2019-07-02T08:19:25 | 2019-07-02T08:19:25 | 170,628,595 | 0 | 0 | null | false | 2022-06-21T00:56:15 | 2019-02-14T04:45:53 | 2019-07-02T08:19:35 | 2022-06-21T00:56:11 | 204 | 0 | 0 | 4 |
Scala
| false | false |
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import org.junit.jupiter.api.Test;
public class LocalDateTest {
@Test
public void test() {
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime time = LocalDateTime.now();
String localTime = df.format(time);
LocalDateTime ldt = LocalDateTime.parse("2017/09/28 17:07:05",df);
System.out.println("LocalDateTime转成String类型的时间:"+localTime);
}
}
|
UTF-8
|
Java
| 496 |
java
|
LocalDateTest.java
|
Java
|
[] | null |
[] |
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import org.junit.jupiter.api.Test;
public class LocalDateTest {
@Test
public void test() {
DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
LocalDateTime time = LocalDateTime.now();
String localTime = df.format(time);
LocalDateTime ldt = LocalDateTime.parse("2017/09/28 17:07:05",df);
System.out.println("LocalDateTime转成String类型的时间:"+localTime);
}
}
| 496 | 0.7375 | 0.708333 | 16 | 29 | 25.468117 | 78 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5625 | false | false |
7
|
10fc7eb771b738a991b1697a2b498af7c8ea3072
| 18,537,078,916,027 |
b3e84fc5db4920f3f7625a53f5abeceb8d26be49
|
/src/main/java/com/xionglindong/web/HelloController.java
|
a47a7e0ceac9005a6a1a3d04fcc95a01417aac13
|
[] |
no_license
|
Mocuishlerr/bootdemo
|
https://github.com/Mocuishlerr/bootdemo
|
f2832d4745d8581b182a457d9534006fd2d1caad
|
537a62561de38e6a82486e975dbfb47e336455b6
|
refs/heads/master
| 2021-01-13T16:40:59.814000 | 2017-03-21T09:05:19 | 2017-03-21T09:05:19 | 77,876,409 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.xionglindong.web;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.xionglindong.exception.MyException;
@RestController
public class HelloController {
@ResponseBody
@RequestMapping("/hello")
public String hello() throws Exception{
throw new Exception("温馨提示:您访问的地址不存在!");
}
@RequestMapping("/json")
public String json() throws MyException{
throw new MyException("你麻痹,又出错啦!");
}
@RequestMapping("/login")
public String login() throws Exception{
return "login";
}
}
|
UTF-8
|
Java
| 698 |
java
|
HelloController.java
|
Java
|
[] | null |
[] |
package com.xionglindong.web;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import com.xionglindong.exception.MyException;
@RestController
public class HelloController {
@ResponseBody
@RequestMapping("/hello")
public String hello() throws Exception{
throw new Exception("温馨提示:您访问的地址不存在!");
}
@RequestMapping("/json")
public String json() throws MyException{
throw new MyException("你麻痹,又出错啦!");
}
@RequestMapping("/login")
public String login() throws Exception{
return "login";
}
}
| 698 | 0.770769 | 0.770769 | 28 | 22.214285 | 20.669779 | 62 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1 | false | false |
7
|
792e1d6bee373124ce104407d25db4491120cea4
| 13,477,607,442,612 |
dda4fe72a0a0ce1a150aaa4156e9488080ff741c
|
/DatadrivenFrameworkMaven/src/main/java/com/bagal/excel/utility/ExeclUtilsNew.java
|
8f82d4b7ca09f6d36c2d6f45db693cb0044b7e31
|
[] |
no_license
|
umajibagal/AutomationTesting
|
https://github.com/umajibagal/AutomationTesting
|
bda70fe115d65ac32ae3db4e692b6cab135fa377
|
31db49de28fcf27d4ce568c05950b237791f7c52
|
refs/heads/master
| 2022-07-09T09:06:20.032000 | 2020-03-01T12:13:22 | 2020-03-01T12:13:22 | 199,654,936 | 0 | 1 | null | false | 2022-06-29T17:35:45 | 2019-07-30T13:14:48 | 2020-03-01T12:13:25 | 2022-06-29T17:35:45 | 42,601 | 0 | 0 | 5 |
HTML
| false | false |
package com.bagal.excel.utility;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.sl.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
//import org.apache.poi.ss.usermodel.Sheet;;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class ExeclUtilsNew {
public void ReadExcel(String Filename, String FilePath, String Sheetname) throws IOException {
File file = new File(FilePath + "\\" + Filename);
FileInputStream in = new FileInputStream(file);
Workbook read = null;
// getting filename extension
String fileExtension = Filename.substring(Filename.indexOf("."));
System.out.println("FileName Extension\t" + fileExtension);
// check condition as per file extension
if (fileExtension.equals(".xlsx")) {
read = new XSSFWorkbook(in);
} else {
read = new HSSFWorkbook(in);
}
// Read the sheet
org.apache.poi.ss.usermodel.Sheet sRead = read.getSheet(Sheetname);
// get number of rows
int rowCount = sRead.getLastRowNum() - sRead.getFirstRowNum();
for (int i = 1; i <= rowCount; i++) {
Row row = sRead.getRow(i);
// String srow = row.toString();
// System.out.println(srow);
for (int j = 1; j < row.getLastCellNum(); j++) {
System.out.print(row.getCell(j).getStringCellValue() + "|| ");
}
System.out.println();
}
// System.out.println();
}
public void WriteExcel(String Filename, String FilePath, String Sheetname, String[] dWrite) throws IOException {
Workbook writeExcel = null;
File file = new File(FilePath + "\\" + Filename);
System.out.println(file.toString());
FileInputStream in = new FileInputStream(file);
String fileExtensionName = Filename.substring(Filename.indexOf("."));
// Check condition if the file is xlsx file
if (fileExtensionName.equals(".xlsx")) {
writeExcel = new XSSFWorkbook(in);
} else {
writeExcel = new HSSFWorkbook(in);
}
org.apache.poi.ss.usermodel.Sheet sRead = writeExcel.getSheet(Sheetname);
int rowCount = sRead.getLastRowNum() - sRead.getFirstRowNum();
System.out.println(rowCount);
Row nRow = sRead.getRow(0);
Row nwRow = sRead.createRow(rowCount + 1);
// System.out.println(nRow.getLastCel);
for (int j = 0; j < nRow.getLastCellNum(); j++) {
// System.out.println("inside");
Cell cell = nwRow.createCell(j);
// System.out.println(dWrite[j]);
cell.setCellValue(dWrite[j]);
}
in.close();
FileOutputStream out = new FileOutputStream(file);
writeExcel.write(out);
out.close();
}
public void WriteExcelRow(String Filename, String FilePath, String Sheetname, int row, int Column, String Data)
throws IOException {
{
Workbook writeExcel = null;
File file = new File(FilePath + "\\" + Filename);
System.out.println(file.toString());
FileInputStream in = new FileInputStream(file);
String fileExtensionName = Filename.substring(Filename.indexOf("."));
// Check condition if the file is xlsx file
if (fileExtensionName.equals(".xlsx")) {
writeExcel = new XSSFWorkbook(in);
} else {
writeExcel = new HSSFWorkbook(in);
}
org.apache.poi.ss.usermodel.Sheet sRead = writeExcel.getSheet(Sheetname);
Row rRow = sRead.getRow(row);
Cell sCell = rRow.getCell(Column);
if (sCell == null)
{
Cell cCell = rRow.createCell(Column);
cCell.setCellValue(Data);
}
else
{
sCell.setCellValue(Data);
}
in.close();
FileOutputStream out = new FileOutputStream(file);
writeExcel.write(out);
out.close();
}
}
}
|
UTF-8
|
Java
| 3,926 |
java
|
ExeclUtilsNew.java
|
Java
|
[] | null |
[] |
package com.bagal.excel.utility;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.sl.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
//import org.apache.poi.ss.usermodel.Sheet;;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
public class ExeclUtilsNew {
public void ReadExcel(String Filename, String FilePath, String Sheetname) throws IOException {
File file = new File(FilePath + "\\" + Filename);
FileInputStream in = new FileInputStream(file);
Workbook read = null;
// getting filename extension
String fileExtension = Filename.substring(Filename.indexOf("."));
System.out.println("FileName Extension\t" + fileExtension);
// check condition as per file extension
if (fileExtension.equals(".xlsx")) {
read = new XSSFWorkbook(in);
} else {
read = new HSSFWorkbook(in);
}
// Read the sheet
org.apache.poi.ss.usermodel.Sheet sRead = read.getSheet(Sheetname);
// get number of rows
int rowCount = sRead.getLastRowNum() - sRead.getFirstRowNum();
for (int i = 1; i <= rowCount; i++) {
Row row = sRead.getRow(i);
// String srow = row.toString();
// System.out.println(srow);
for (int j = 1; j < row.getLastCellNum(); j++) {
System.out.print(row.getCell(j).getStringCellValue() + "|| ");
}
System.out.println();
}
// System.out.println();
}
public void WriteExcel(String Filename, String FilePath, String Sheetname, String[] dWrite) throws IOException {
Workbook writeExcel = null;
File file = new File(FilePath + "\\" + Filename);
System.out.println(file.toString());
FileInputStream in = new FileInputStream(file);
String fileExtensionName = Filename.substring(Filename.indexOf("."));
// Check condition if the file is xlsx file
if (fileExtensionName.equals(".xlsx")) {
writeExcel = new XSSFWorkbook(in);
} else {
writeExcel = new HSSFWorkbook(in);
}
org.apache.poi.ss.usermodel.Sheet sRead = writeExcel.getSheet(Sheetname);
int rowCount = sRead.getLastRowNum() - sRead.getFirstRowNum();
System.out.println(rowCount);
Row nRow = sRead.getRow(0);
Row nwRow = sRead.createRow(rowCount + 1);
// System.out.println(nRow.getLastCel);
for (int j = 0; j < nRow.getLastCellNum(); j++) {
// System.out.println("inside");
Cell cell = nwRow.createCell(j);
// System.out.println(dWrite[j]);
cell.setCellValue(dWrite[j]);
}
in.close();
FileOutputStream out = new FileOutputStream(file);
writeExcel.write(out);
out.close();
}
public void WriteExcelRow(String Filename, String FilePath, String Sheetname, int row, int Column, String Data)
throws IOException {
{
Workbook writeExcel = null;
File file = new File(FilePath + "\\" + Filename);
System.out.println(file.toString());
FileInputStream in = new FileInputStream(file);
String fileExtensionName = Filename.substring(Filename.indexOf("."));
// Check condition if the file is xlsx file
if (fileExtensionName.equals(".xlsx")) {
writeExcel = new XSSFWorkbook(in);
} else {
writeExcel = new HSSFWorkbook(in);
}
org.apache.poi.ss.usermodel.Sheet sRead = writeExcel.getSheet(Sheetname);
Row rRow = sRead.getRow(row);
Cell sCell = rRow.getCell(Column);
if (sCell == null)
{
Cell cCell = rRow.createCell(Column);
cCell.setCellValue(Data);
}
else
{
sCell.setCellValue(Data);
}
in.close();
FileOutputStream out = new FileOutputStream(file);
writeExcel.write(out);
out.close();
}
}
}
| 3,926 | 0.661488 | 0.660214 | 153 | 23.673203 | 24.598164 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.137255 | false | false |
7
|
12cab12b24d2c5714737d361a39606255e566866
| 18,287,970,753,659 |
55950da9e72bf942b9c7f77e98da6905f44439d1
|
/src/main/java/me/efraimgentil/jsr303/validation/annotation/Order1.java
|
bc125b246d5b88b484e071370c5a6e53591004fc
|
[] |
no_license
|
efraimgentil/jsr303-beanvalidation
|
https://github.com/efraimgentil/jsr303-beanvalidation
|
3e0a01e354cb33ef453e64fb025acc4fc3eb1453
|
4c1b927f2aa583bfbe1936a68e6477573e31592c
|
refs/heads/master
| 2020-03-08T03:34:22.291000 | 2018-05-10T01:58:17 | 2018-05-10T01:58:17 | 127,895,149 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package me.efraimgentil.jsr303.validation.annotation;
import me.efraimgentil.jsr303.validation.Order1Validator;
import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import java.lang.annotation.*;
@Documented
@Constraint(validatedBy = Order1Validator.class)
@Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
@ReportAsSingleViolation
public @interface Order1 {
String message() default "Must have 1";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
|
UTF-8
|
Java
| 633 |
java
|
Order1.java
|
Java
|
[] | null |
[] |
package me.efraimgentil.jsr303.validation.annotation;
import me.efraimgentil.jsr303.validation.Order1Validator;
import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
import java.lang.annotation.*;
@Documented
@Constraint(validatedBy = Order1Validator.class)
@Target({ ElementType.PARAMETER, ElementType.FIELD, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
@ReportAsSingleViolation
public @interface Order1 {
String message() default "Must have 1";
Class<?>[] groups() default {};
Class<? extends Payload>[] payload() default {};
}
| 633 | 0.78673 | 0.770932 | 21 | 29.142857 | 22.970552 | 82 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.52381 | false | false |
7
|
f0fe835d42b0e861f12a05986515085b9cbee989
| 3,195,455,730,079 |
75ccdced3d9a71a873ea0c3cacfaee512249c46c
|
/dcm4chee-conf-test/src/test/java/org/dcm4chee/conf/ConfigEETestsIT.java
|
05121ccc1e6dce9b479a83df12cead8aa13d9c79
|
[] |
no_license
|
tarekmamdouh/dcm4chee-conf
|
https://github.com/tarekmamdouh/dcm4chee-conf
|
77d19fb321a0a0214ce5a238f241dbe19c267f9f
|
50dafdbe4f03031cbc9dcb1bb2f426459125019e
|
refs/heads/master
| 2020-03-14T19:03:28.098000 | 2017-06-28T14:01:36 | 2017-06-28T14:01:36 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* **** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is part of dcm4che, an implementation of DICOM(TM) in
* Java(TM), hosted at https://github.com/gunterze/dcm4che.
*
* The Initial Developer of the Original Code is
* Agfa Healthcare.
* Portions created by the Initial Developer are Copyright (C) 2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* See @authors listed below
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK *****
*/
package org.dcm4chee.conf;
import org.dcm4che3.conf.api.ConfigurationNotFoundException;
import org.dcm4che3.conf.api.DicomConfiguration;
import org.dcm4che3.conf.api.internal.DicomConfigurationManager;
import org.dcm4che3.conf.core.api.BatchRunner.Batch;
import org.dcm4che3.conf.core.api.Configuration;
import org.dcm4che3.conf.core.api.ConfigurationException;
import org.dcm4che3.conf.dicom.DicomPath;
import org.dcm4che3.net.Device;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.asset.FileAsset;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.EJB;
import javax.enterprise.inject.Any;
import javax.inject.Inject;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author Roman K
*/
@RunWith(Arquillian.class)
public class ConfigEETestsIT {
private static Logger LOG = LoggerFactory
.getLogger(ConfigEETestsIT.class);
@EJB
MyConfyEJB myConfyEJB;
@Deployment
public static WebArchive createDeployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
composeWar(war);
war.as(ZipExporter.class).exportTo(
new File("test.war"), true);
return war;
}
public static void composeWar(WebArchive war) {
war.addClass(ConfigEETestsIT.class);
war.addClass(MyConfyEJB.class);
war.addClass(ReferencingDeviceExtension.class);
war.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/MANIFEST.MF")), "MANIFEST.MF");
war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
JavaArchive[] archs = Maven.resolver()
.loadPomFromFile("testpom.xml")
.importRuntimeAndTestDependencies()
.resolve().withoutTransitivity()
.as(JavaArchive.class);
for (JavaArchive a : archs) {
war.addAsLibrary(a);
}
}
@Inject
@Any
DicomConfigurationManager configurationManager;
public DicomConfigurationManager getConfig() throws ConfigurationException {
// disable upgrade
System.getProperties().remove("org.dcm4che.conf.upgrade.settingsFile");
// disable notifications
System.setProperty("org.dcm4che.conf.notifications", "false");
return configurationManager;
}
@Test
public void rollbackTest() throws Exception {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
storage.runBatch(new Batch() {
@Override
public void run() {
try {
config.persist(new Device("shouldWork"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
});
Assert.assertNotNull(config.findDevice("shouldWork"));
try {
storage.runBatch(new Batch() {
@Override
public void run() {
try {
config.persist(new Device("shouldBeRolledBack"));
config.findDevice("shouldBeRolledBack");
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
throw new RuntimeException("Let's roll (back)!");
}
});
} catch (Exception e) {
// it's fine
//Assert.assertEquals(e.getCause().getMessage(), "Let's roll (back)!");
}
try {
config.findDevice("shouldBeRolledBack");
Assert.fail("device shouldBeRolledBack must not be there");
} catch (ConfigurationNotFoundException e) {
//it ok
}
}
@Test
public void lockTest() throws Exception {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
final Semaphore masterSemaphore = new Semaphore(0);
final Semaphore childSemaphore = new Semaphore(0);
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
final AtomicInteger parallel = new AtomicInteger(0);
Thread thread1 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
LOG.info("locking...");
storage.lock();
LOG.info("locked!");
parallel.addAndGet(1);
try {
config.persist(new Device("someDevice1"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
LOG.info("double-locking...");
storage.lock();
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
Thread thread2 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
LOG.info("locking...");
storage.lock();
LOG.info("locked!");
parallel.addAndGet(1);
try {
config.persist(new Device("someDevice2"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
thread1.start();
thread2.start();
Thread.sleep(500);
// make sure
Assert.assertEquals(1, parallel.get());
masterSemaphore.release();
Thread.sleep(500);
// make sure
Assert.assertEquals(2, parallel.get());
masterSemaphore.release();
Thread.sleep(500);
}
@Test
public void persistRootNodeTest() throws ConfigurationException {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
config.persist(new Device("D1"));
config.persist(new Device("D2"));
final Map<String, Object> configurationRoot = (Map<String, Object>) storage.getConfigurationNode(DicomPath.CONFIG_ROOT_PATH, null);
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
try {
storage.removeNode(DicomPath.CONFIG_ROOT_PATH);
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, configurationRoot, null);
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
});
try {
config.findDevice("D1");
} catch (ConfigurationException e) {
Assert.fail("Device should have been found");
}
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
config.persist(new Device("D3"));
config.persist(new Device("D4"));
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, configurationRoot, null);
try {
config.findDevice("D1");
} catch (ConfigurationException e) {
Assert.fail("Device should have been found");
}
try {
config.findDevice("D3");
Assert.fail("Device D3 shouldn't have been found");
} catch (ConfigurationException ignored) {
}
}
@Test
// Only works with em.flush
public void test2ConcurrentPersists() throws ConfigurationException, InterruptedException {
final Semaphore masterSemaphore = new Semaphore(0);
final Semaphore childSemaphore = new Semaphore(0);
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
config.persist(new Device("someDevice"));
config.persist(new Device("someNotImportantDevice"));
Thread thread1 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
try {
Device someDevice = config.findDevice("someDevice");
someDevice.setSoftwareVersions("5", "6", "7");
config.merge(someDevice);
// make sure em flush happens
config.findDevice("someNotImportantDevice");
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
childSemaphore.release();
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
Thread thread2 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
try {
Device someDevice = config.findDevice("someDevice");
someDevice.setSoftwareVersions("1", "2", "3");
config.merge(someDevice);
// make sure em flush happens
config.findDevice("someNotImportantDevice");
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
childSemaphore.release();
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
thread1.start();
thread2.start();
boolean doneIn5Seconds = childSemaphore.tryAcquire(2, 5, TimeUnit.SECONDS);
try {
Assert.assertFalse(doneIn5Seconds);
} finally {
LOG.info("Releasing children threads..");
masterSemaphore.release(2);
Thread.sleep(1000);
}
}
@Test
public void testIntegrityCheck() throws ConfigurationException {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
final Device a = new Device("a");
final Device b = new Device("b");
ReferencingDeviceExtension ext = new ReferencingDeviceExtension();
ext.setRef(a);
b.addDeviceExtension(ext);
try {
config.persist(b);
Assert.fail("Should have failed since device 'a' is not persisted yet but referenced");
} catch (Exception e) {
// ok
}
// this should work since integrity check is done on commit
config.runBatch(new DicomConfiguration.DicomConfigBatch() {
@Override
public void run() {
try {
config.persist(b);
config.persist(a);
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
});
try {
config.removeDevice(a.getDeviceName());
Assert.fail("Should have failed since device 'a' is referenced");
} catch (Exception e) {
// ok
}
}
}
|
UTF-8
|
Java
| 15,756 |
java
|
ConfigEETestsIT.java
|
Java
|
[
{
"context": "TM) in\n * Java(TM), hosted at https://github.com/gunterze/dcm4che.\n *\n * The Initial Developer of the Orig",
"end": 699,
"score": 0.9994561076164246,
"start": 691,
"tag": "USERNAME",
"value": "gunterze"
},
{
"context": "l.concurrent.atomic.AtomicInteger;\n\n/**\n * @author Roman K\n */\n@RunWith(Arquillian.class)\npublic class Confi",
"end": 3169,
"score": 0.9994771480560303,
"start": 3162,
"tag": "NAME",
"value": "Roman K"
}
] | null |
[] |
/*
* **** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is part of dcm4che, an implementation of DICOM(TM) in
* Java(TM), hosted at https://github.com/gunterze/dcm4che.
*
* The Initial Developer of the Original Code is
* Agfa Healthcare.
* Portions created by the Initial Developer are Copyright (C) 2015
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* See @authors listed below
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK *****
*/
package org.dcm4chee.conf;
import org.dcm4che3.conf.api.ConfigurationNotFoundException;
import org.dcm4che3.conf.api.DicomConfiguration;
import org.dcm4che3.conf.api.internal.DicomConfigurationManager;
import org.dcm4che3.conf.core.api.BatchRunner.Batch;
import org.dcm4che3.conf.core.api.Configuration;
import org.dcm4che3.conf.core.api.ConfigurationException;
import org.dcm4che3.conf.dicom.DicomPath;
import org.dcm4che3.net.Device;
import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.asset.FileAsset;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ejb.EJB;
import javax.enterprise.inject.Any;
import javax.inject.Inject;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author <NAME>
*/
@RunWith(Arquillian.class)
public class ConfigEETestsIT {
private static Logger LOG = LoggerFactory
.getLogger(ConfigEETestsIT.class);
@EJB
MyConfyEJB myConfyEJB;
@Deployment
public static WebArchive createDeployment() {
WebArchive war = ShrinkWrap.create(WebArchive.class, "test.war");
composeWar(war);
war.as(ZipExporter.class).exportTo(
new File("test.war"), true);
return war;
}
public static void composeWar(WebArchive war) {
war.addClass(ConfigEETestsIT.class);
war.addClass(MyConfyEJB.class);
war.addClass(ReferencingDeviceExtension.class);
war.addAsManifestResource(new FileAsset(new File("src/test/resources/META-INF/MANIFEST.MF")), "MANIFEST.MF");
war.addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
JavaArchive[] archs = Maven.resolver()
.loadPomFromFile("testpom.xml")
.importRuntimeAndTestDependencies()
.resolve().withoutTransitivity()
.as(JavaArchive.class);
for (JavaArchive a : archs) {
war.addAsLibrary(a);
}
}
@Inject
@Any
DicomConfigurationManager configurationManager;
public DicomConfigurationManager getConfig() throws ConfigurationException {
// disable upgrade
System.getProperties().remove("org.dcm4che.conf.upgrade.settingsFile");
// disable notifications
System.setProperty("org.dcm4che.conf.notifications", "false");
return configurationManager;
}
@Test
public void rollbackTest() throws Exception {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
storage.runBatch(new Batch() {
@Override
public void run() {
try {
config.persist(new Device("shouldWork"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
});
Assert.assertNotNull(config.findDevice("shouldWork"));
try {
storage.runBatch(new Batch() {
@Override
public void run() {
try {
config.persist(new Device("shouldBeRolledBack"));
config.findDevice("shouldBeRolledBack");
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
throw new RuntimeException("Let's roll (back)!");
}
});
} catch (Exception e) {
// it's fine
//Assert.assertEquals(e.getCause().getMessage(), "Let's roll (back)!");
}
try {
config.findDevice("shouldBeRolledBack");
Assert.fail("device shouldBeRolledBack must not be there");
} catch (ConfigurationNotFoundException e) {
//it ok
}
}
@Test
public void lockTest() throws Exception {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
final Semaphore masterSemaphore = new Semaphore(0);
final Semaphore childSemaphore = new Semaphore(0);
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
final AtomicInteger parallel = new AtomicInteger(0);
Thread thread1 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
LOG.info("locking...");
storage.lock();
LOG.info("locked!");
parallel.addAndGet(1);
try {
config.persist(new Device("someDevice1"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
LOG.info("double-locking...");
storage.lock();
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
Thread thread2 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
LOG.info("locking...");
storage.lock();
LOG.info("locked!");
parallel.addAndGet(1);
try {
config.persist(new Device("someDevice2"));
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
thread1.start();
thread2.start();
Thread.sleep(500);
// make sure
Assert.assertEquals(1, parallel.get());
masterSemaphore.release();
Thread.sleep(500);
// make sure
Assert.assertEquals(2, parallel.get());
masterSemaphore.release();
Thread.sleep(500);
}
@Test
public void persistRootNodeTest() throws ConfigurationException {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
config.persist(new Device("D1"));
config.persist(new Device("D2"));
final Map<String, Object> configurationRoot = (Map<String, Object>) storage.getConfigurationNode(DicomPath.CONFIG_ROOT_PATH, null);
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
try {
storage.removeNode(DicomPath.CONFIG_ROOT_PATH);
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, configurationRoot, null);
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
});
try {
config.findDevice("D1");
} catch (ConfigurationException e) {
Assert.fail("Device should have been found");
}
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
config.persist(new Device("D3"));
config.persist(new Device("D4"));
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, configurationRoot, null);
try {
config.findDevice("D1");
} catch (ConfigurationException e) {
Assert.fail("Device should have been found");
}
try {
config.findDevice("D3");
Assert.fail("Device D3 shouldn't have been found");
} catch (ConfigurationException ignored) {
}
}
@Test
// Only works with em.flush
public void test2ConcurrentPersists() throws ConfigurationException, InterruptedException {
final Semaphore masterSemaphore = new Semaphore(0);
final Semaphore childSemaphore = new Semaphore(0);
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
config.persist(new Device("someDevice"));
config.persist(new Device("someNotImportantDevice"));
Thread thread1 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
try {
Device someDevice = config.findDevice("someDevice");
someDevice.setSoftwareVersions("5", "6", "7");
config.merge(someDevice);
// make sure em flush happens
config.findDevice("someNotImportantDevice");
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
childSemaphore.release();
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
Thread thread2 = new Thread() {
@Override
public void run() {
myConfyEJB.execInTransaction(new Runnable() {
@Override
public void run() {
try {
Device someDevice = config.findDevice("someDevice");
someDevice.setSoftwareVersions("1", "2", "3");
config.merge(someDevice);
// make sure em flush happens
config.findDevice("someNotImportantDevice");
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
childSemaphore.release();
try {
masterSemaphore.acquire();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
});
LOG.info("Committed");
super.run();
}
};
thread1.start();
thread2.start();
boolean doneIn5Seconds = childSemaphore.tryAcquire(2, 5, TimeUnit.SECONDS);
try {
Assert.assertFalse(doneIn5Seconds);
} finally {
LOG.info("Releasing children threads..");
masterSemaphore.release(2);
Thread.sleep(1000);
}
}
@Test
public void testIntegrityCheck() throws ConfigurationException {
final DicomConfigurationManager config = getConfig();
final Configuration storage = config.getConfigurationStorage();
storage.persistNode(DicomPath.CONFIG_ROOT_PATH, new HashMap<String, Object>(), null);
final Device a = new Device("a");
final Device b = new Device("b");
ReferencingDeviceExtension ext = new ReferencingDeviceExtension();
ext.setRef(a);
b.addDeviceExtension(ext);
try {
config.persist(b);
Assert.fail("Should have failed since device 'a' is not persisted yet but referenced");
} catch (Exception e) {
// ok
}
// this should work since integrity check is done on commit
config.runBatch(new DicomConfiguration.DicomConfigBatch() {
@Override
public void run() {
try {
config.persist(b);
config.persist(a);
} catch (ConfigurationException e) {
throw new RuntimeException(e);
}
}
});
try {
config.removeDevice(a.getDeviceName());
Assert.fail("Should have failed since device 'a' is referenced");
} catch (Exception e) {
// ok
}
}
}
| 15,755 | 0.557565 | 0.551853 | 481 | 31.756756 | 26.745142 | 139 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.480249 | false | false |
7
|
87c49072f104c28ef811c6b040e564779e37fbcd
| 17,093,969,851,109 |
e08c5629ca311003edb20e50fd75346a663a12cd
|
/from_c_code/proj_sp2/IndivObject.java
|
1c4aa6d29c7cbbc48e340c01a315b3a5acf6b417
|
[] |
no_license
|
kingjon3377/strategicprimer-old-impls
|
https://github.com/kingjon3377/strategicprimer-old-impls
|
4c35a2588f9f6f2e8ffad5695bf8d5cb3cbda7e6
|
0e45fd3ad1b5665d0bfb96dec63d5ec597065c98
|
refs/heads/master
| 2020-08-06T10:01:49.630000 | 2019-10-05T03:08:14 | 2019-10-05T03:08:14 | 212,935,763 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package proj_sp2;
class IndivObject extends SPObject implements Instance {
String name;
int meleeBonusAdd;
int rangedBonusAdd;
int meleeBonusDice;
int rangedBonusDice;
int meleeBonusDamage;
int rangedBonusDamage;
int movementBonus;
int visionBonus;
double cost;
double maintenanceBonus;
double maintenanceMod;
int armorClass_Add;
int flags;
int maxHP;
int currHP;
public boolean takeDamage(final int damage) {
if (damage >= 0) {
currHP -= damage;
return true;
} else {
return false;
}
}
}
|
UTF-8
|
Java
| 523 |
java
|
IndivObject.java
|
Java
|
[] | null |
[] |
package proj_sp2;
class IndivObject extends SPObject implements Instance {
String name;
int meleeBonusAdd;
int rangedBonusAdd;
int meleeBonusDice;
int rangedBonusDice;
int meleeBonusDamage;
int rangedBonusDamage;
int movementBonus;
int visionBonus;
double cost;
double maintenanceBonus;
double maintenanceMod;
int armorClass_Add;
int flags;
int maxHP;
int currHP;
public boolean takeDamage(final int damage) {
if (damage >= 0) {
currHP -= damage;
return true;
} else {
return false;
}
}
}
| 523 | 0.73805 | 0.734226 | 27 | 18.370371 | 11.251825 | 56 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.962963 | false | false |
7
|
3af0ec33245703ab887f4a77dc90981bd4c8b144
| 17,093,969,849,691 |
688a5d2ece4e55c434eceedd63337aa7f5a3dff8
|
/app/src/main/java/com/siem/siemmedicos/ui/activity/LoginActivity.java
|
1759b7e4cab6b89058ba6955b1d44bf683308c7c
|
[] |
no_license
|
siemunlam/AndroidMedicos
|
https://github.com/siemunlam/AndroidMedicos
|
8ff0a2c38605e7dc60eaaaebfd6f954345cebbb5
|
145c3266b964760bdbac1a43f718aeb707b6aa12
|
refs/heads/master
| 2021-01-01T06:23:56.710000 | 2017-11-17T19:24:32 | 2017-11-17T19:24:32 | 97,420,803 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.siem.siemmedicos.ui.activity;
import android.app.Activity;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.Toast;
import com.google.firebase.iid.FirebaseInstanceId;
import com.siem.siemmedicos.R;
import com.siem.siemmedicos.databinding.ActivityLoginBinding;
import com.siem.siemmedicos.model.serverapi.LoginResponse;
import com.siem.siemmedicos.utils.ApiConstants;
import com.siem.siemmedicos.utils.Constants;
import com.siem.siemmedicos.utils.PreferencesHelper;
import com.siem.siemmedicos.utils.RetrofitClient;
import com.siem.siemmedicos.utils.Utils;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class LoginActivity extends Activity implements Callback<LoginResponse> {
private PreferencesHelper mPreferences;
private ActivityLoginBinding mBinding;
private Toast mToast;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
controlarMedicoLogueado();
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_login);
mBinding.contentProgress.bringToFront();
mBinding.buttonLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(isLoginFullComplete()){
habilitarLoading();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
String user = mBinding.edittextUser.getText();
String pass = mBinding.edittextPass.getText();
Call<LoginResponse> call = RetrofitClient.getServerClient().login(user, pass);
call.enqueue(LoginActivity.this);
}
}, 100);
}
}
});
setBackgroundImage();
}
@Override
public void onResponse(Call<LoginResponse> call, Response<LoginResponse> response) {
switch(response.code()){
case Constants.CODE_SERVER_OK:
LoginResponse loginResponse = response.body();
ApiConstants.Item estadoNoDisponible = new ApiConstants.NoDisponible();
mPreferences.setMedicoToken(loginResponse.getToken());
mPreferences.setValueEstado(estadoNoDisponible.getValue());
mPreferences.setDescriptionEstado(estadoNoDisponible.getDescription(LoginActivity.this));
goToMap();
break;
case Constants.CODE_BAD_REQUEST:
loginError();
break;
default:
serverError();
break;
}
}
@Override
public void onFailure(Call<LoginResponse> call, Throwable t) {
serverError();
}
private void setBackgroundImage() {
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.background_login, options);
Bitmap resizedbitmap = Bitmap.createScaledBitmap(bitmap, width, height, true);
BitmapDrawable bmpDrawable = new BitmapDrawable(getResources(), resizedbitmap);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mBinding.scrollview.setBackground(bmpDrawable);
}else{
mBinding.scrollview.setBackgroundDrawable(bmpDrawable);
}
bitmap.recycle();
}
private boolean isLoginFullComplete() {
String user = mBinding.edittextUser.getText();
String pass = mBinding.edittextPass.getText();
List<View> listErrorView = new ArrayList<>();
if(user.isEmpty())
listErrorView.add(mBinding.edittextUser);
if(pass.isEmpty())
listErrorView.add(mBinding.edittextPass);
missingFields(listErrorView);
return listErrorView.size() <= 0;
}
private void missingFields(List<View> listErrorView) {
if(listErrorView.size() > 0){
mToast = Toast.makeText(LoginActivity.this, getString(R.string.errorEmptyFields), Toast.LENGTH_LONG);
mToast.show();
Utils.vibrate(this, listErrorView);
}
}
private void serverError(){
deshabilitarLoading();
mToast = Toast.makeText(this, getString(R.string.error), Toast.LENGTH_LONG);
mToast.show();
}
private void loginError() {
deshabilitarLoading();
mToast = Toast.makeText(LoginActivity.this, getString(R.string.errorLogin), Toast.LENGTH_LONG);
mToast.show();
List<View> listErrorView = new ArrayList<>();
listErrorView.add(mBinding.edittextUser);
listErrorView.add(mBinding.edittextPass);
Utils.vibrate(this, listErrorView);
}
private void habilitarLoading() {
mBinding.buttonLogin.setEnabled(false);
mBinding.edittextPass.setEnabled(false);
mBinding.edittextUser.setEnabled(false);
Utils.setTouchable(this, false);
mBinding.contentProgress.setVisibility(View.VISIBLE);
Utils.hideSoftKeyboard(this);
}
private void deshabilitarLoading() {
mBinding.buttonLogin.setEnabled(true);
mBinding.edittextPass.setEnabled(true);
mBinding.edittextUser.setEnabled(true);
Utils.setTouchable(this, true);
mBinding.contentProgress.setVisibility(View.GONE);
}
private void controlarMedicoLogueado() {
mPreferences = PreferencesHelper.getInstance();
mPreferences.setFirebaseToken(FirebaseInstanceId.getInstance().getToken());
if(mPreferences.getMedicoToken() != null){
goToMap();
}
}
private void goToMap() {
startActivity(new Intent(LoginActivity.this, MapActivity.class));
finish();
}
}
|
UTF-8
|
Java
| 6,568 |
java
|
LoginActivity.java
|
Java
|
[] | null |
[] |
package com.siem.siemmedicos.ui.activity;
import android.app.Activity;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.DisplayMetrics;
import android.view.View;
import android.widget.Toast;
import com.google.firebase.iid.FirebaseInstanceId;
import com.siem.siemmedicos.R;
import com.siem.siemmedicos.databinding.ActivityLoginBinding;
import com.siem.siemmedicos.model.serverapi.LoginResponse;
import com.siem.siemmedicos.utils.ApiConstants;
import com.siem.siemmedicos.utils.Constants;
import com.siem.siemmedicos.utils.PreferencesHelper;
import com.siem.siemmedicos.utils.RetrofitClient;
import com.siem.siemmedicos.utils.Utils;
import java.util.ArrayList;
import java.util.List;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
public class LoginActivity extends Activity implements Callback<LoginResponse> {
private PreferencesHelper mPreferences;
private ActivityLoginBinding mBinding;
private Toast mToast;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
controlarMedicoLogueado();
mBinding = DataBindingUtil.setContentView(this, R.layout.activity_login);
mBinding.contentProgress.bringToFront();
mBinding.buttonLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if(isLoginFullComplete()){
habilitarLoading();
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
String user = mBinding.edittextUser.getText();
String pass = mBinding.edittextPass.getText();
Call<LoginResponse> call = RetrofitClient.getServerClient().login(user, pass);
call.enqueue(LoginActivity.this);
}
}, 100);
}
}
});
setBackgroundImage();
}
@Override
public void onResponse(Call<LoginResponse> call, Response<LoginResponse> response) {
switch(response.code()){
case Constants.CODE_SERVER_OK:
LoginResponse loginResponse = response.body();
ApiConstants.Item estadoNoDisponible = new ApiConstants.NoDisponible();
mPreferences.setMedicoToken(loginResponse.getToken());
mPreferences.setValueEstado(estadoNoDisponible.getValue());
mPreferences.setDescriptionEstado(estadoNoDisponible.getDescription(LoginActivity.this));
goToMap();
break;
case Constants.CODE_BAD_REQUEST:
loginError();
break;
default:
serverError();
break;
}
}
@Override
public void onFailure(Call<LoginResponse> call, Throwable t) {
serverError();
}
private void setBackgroundImage() {
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 2;
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.background_login, options);
Bitmap resizedbitmap = Bitmap.createScaledBitmap(bitmap, width, height, true);
BitmapDrawable bmpDrawable = new BitmapDrawable(getResources(), resizedbitmap);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
mBinding.scrollview.setBackground(bmpDrawable);
}else{
mBinding.scrollview.setBackgroundDrawable(bmpDrawable);
}
bitmap.recycle();
}
private boolean isLoginFullComplete() {
String user = mBinding.edittextUser.getText();
String pass = mBinding.edittextPass.getText();
List<View> listErrorView = new ArrayList<>();
if(user.isEmpty())
listErrorView.add(mBinding.edittextUser);
if(pass.isEmpty())
listErrorView.add(mBinding.edittextPass);
missingFields(listErrorView);
return listErrorView.size() <= 0;
}
private void missingFields(List<View> listErrorView) {
if(listErrorView.size() > 0){
mToast = Toast.makeText(LoginActivity.this, getString(R.string.errorEmptyFields), Toast.LENGTH_LONG);
mToast.show();
Utils.vibrate(this, listErrorView);
}
}
private void serverError(){
deshabilitarLoading();
mToast = Toast.makeText(this, getString(R.string.error), Toast.LENGTH_LONG);
mToast.show();
}
private void loginError() {
deshabilitarLoading();
mToast = Toast.makeText(LoginActivity.this, getString(R.string.errorLogin), Toast.LENGTH_LONG);
mToast.show();
List<View> listErrorView = new ArrayList<>();
listErrorView.add(mBinding.edittextUser);
listErrorView.add(mBinding.edittextPass);
Utils.vibrate(this, listErrorView);
}
private void habilitarLoading() {
mBinding.buttonLogin.setEnabled(false);
mBinding.edittextPass.setEnabled(false);
mBinding.edittextUser.setEnabled(false);
Utils.setTouchable(this, false);
mBinding.contentProgress.setVisibility(View.VISIBLE);
Utils.hideSoftKeyboard(this);
}
private void deshabilitarLoading() {
mBinding.buttonLogin.setEnabled(true);
mBinding.edittextPass.setEnabled(true);
mBinding.edittextUser.setEnabled(true);
Utils.setTouchable(this, true);
mBinding.contentProgress.setVisibility(View.GONE);
}
private void controlarMedicoLogueado() {
mPreferences = PreferencesHelper.getInstance();
mPreferences.setFirebaseToken(FirebaseInstanceId.getInstance().getToken());
if(mPreferences.getMedicoToken() != null){
goToMap();
}
}
private void goToMap() {
startActivity(new Intent(LoginActivity.this, MapActivity.class));
finish();
}
}
| 6,568 | 0.656669 | 0.655298 | 178 | 35.898876 | 26.225918 | 113 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.702247 | false | false |
7
|
60339b95baa33936534db4f652bf2d5932f910b1
| 19,662,360,300,810 |
1d2e2d8b54389dae86c85edd719f145d43894a07
|
/DSIHomework6.java
|
75c30a39c3cdf5d767a443c4e6720c13f5f93686
|
[] |
no_license
|
hiukao/DePaul-Projects
|
https://github.com/hiukao/DePaul-Projects
|
868db1a57d23cdfa867bea856c6faf31db6d12db
|
27615a20a2f45642494fd2ac37d045a62ff355c0
|
refs/heads/master
| 2022-12-04T01:05:29.103000 | 2020-08-24T01:33:18 | 2020-08-24T01:33:18 | 289,799,168 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package homework; // -1 point if you change the package name
import java.text.DecimalFormat;
import java.util.NoSuchElementException;
import stdlib.*;
public class DSIHomework6 { //-1 point if you change the class name
/** this class maintains a linked structure via the instance variable first
*
* in the examples in this file and testing output, a list is denoted using { }
*
* example { 1 2 3 4 } represents a linked list with first node value 1;
* subsequent nodes have values 2,3,4
* 4 is the value in the last node
*/
/**
* DSIHomework6 version 1.0
*
* Delete one of the following:
*
* A) The work submitted here is solely mine.
*
* B) I had *some* help on the following parts of this assignment
*
* Complete the methods below.
* None of your methods should modify the list, unless that is the purpose of the method.
* All your methods should on operate on the instance variable first
* The toString method is provided for debugging and testing; you may not use it in your solutions
*
* You may not use arrays or any other java collection class
* You may not add any fields to the node or list classes.
* You may not add any methods to the node class.
*
* You MAY add private methods to the DSIHomework6 class (helper functions for the recursion).
*/
static boolean showMeSuccess = true; // set to true to also see Success notifications for tests
// set to false to only see Failure notifications for tests
static class Node {
public Node (int item, Node next) { this.item = item; this.next = next; }
public int item;
public Node next;
}
Node first; // reference to the whole list
/** here is an example function w/ helper function to compute the size of linked list
*/
public int size () {
return sizeHelper( first);
}
private int sizeHelper( Node x) { // x represents the first node of the 'current' list
//base case: empty list, size is 0
if ( x == null) return 0;
// general case. smaller problem is list that comes after x
// below: 1 counts the node that x refers to
// recursive call finds size of smaller list
return 1 + sizeHelper( x.next);
}
/** findMax
*
* precondition: list has at least value
*
* a function to compute the max of the list using recursion
* Note max of a list of size 1 is the sole value in the list
* You will want to create a helper function to do the recursion
*
*/
public int findMax () {
// next line is just a demo of checking the precondition, will not be tested
if ( first == null ) throw new NoSuchElementException(" User Error: FindMax invoked on empty list ");
return StdRandom.uniform(1000); //TODO 1: fix this
}
// place helper function for findMax here
/** insertValueBeforeEveryX
*
* Preconditions: list may be empty, X and Value are not equal
*
* insert a new node containing Value before every node containing X
*
* you can write this iteratively or recursively, but you should only have one loop or recursive helper
* you may not call any other method (e.g. size )
*
* { }.insertValueBeforeEveryX(9,2) --> { } // initial list was empty
* { 1 1 1 1 }.insertValueBeforeEveryX(9,2) --> { 1 1 1 1 } // 0 occurrences of '2'
* { 2 }.insertValueBeforeEveryX(9,2) --> { 9 2} // 1 occurrence of '2'
* { 1 2 3 2 }.insertValueBeforeEveryX(9,2) --> { 1 9 2 3 9 2} // 2 occurrences of '2'
*
*/
public void insertValueBeforeEveryX (int value, int X ) {
// next line is just a demo of checking the precondition, will not be tested
if ( X == value ) throw new IllegalArgumentException(" User Error: illegal argument ");
return; //TODO 2: fix this
}
/** positionOfSecondToLastOccurrence
*
* Precondition: none // list may be empty
*
* a function to compute: the position within the list of the second to last occurrence
* of the parameter: number
*
* positions are counted as an offset from the beginning.
*
* if the list is { 1,2,3,4,3 }, the second to last 3 is in position 2
* if number appears 0 or 1 time, return -1
*
* you can write this iteratively or recursively, but you should only have one loop or recursive helper
* Examples
* {0,1,2,5,5,5,5,5,8,9}.positionOfSeondToLastOccurrence(5) == 6
* {0,1,3,4,5,5,2,5,8,9}.positionOfSeondToLastOccurrence(2) == -1
*
*/
public int positionOfSecondToLastOccurrence (int number) {
return -2; //TODO 3: fix this
}
/** deleteTheFirstConsecutiveDuplicateItem
*
* Precondition: None. List may be empty or have only one value
*
* a function to delete the second of two consecutive nodes containing the same value
* only delete the duplicate for the first such occurrence
*
* Examples:
* {1 2 3 4 5 6}.deleteTheFirstConsecutiveDuplicateItem() --> {1 2 3 4 5 6} // no consecutive duplicates
* {1 2 1 2 1 2}.deleteTheFirstConsecutiveDuplicateItem() --> {1 2 1 2 1 2} // no consecutive duplicates
* {5 5 2 3 4 5}.deleteTheFirstConsecutiveDuplicateItem() --> {5 2 3 4 5} // delete the 5
* {5 1 1 2 3 1}.deleteTheFirstConsecutiveDuplicateItem() --> {5 1 2 3 1} // delete the 1
* {5 5 1 1 3 4}.deleteTheFirstConsecutiveDuplicateItem() --> {5 1 1 3 4 } // delete the 5
* {5 4 3 2 1 1}.deleteTheFirstConsecutiveDuplicateItem() --> {5 4 3 2 1 } // delete the 1
*
*/
public void deleteTheFirstConsecutiveDuplicateItem() {
// TODO 4: fix this
}
/**
* the following is an example method included as a reference
*
* deleteTheFirstOccurrenceOf
*
* it deletes the first occurrence of a node with the parameter 'value'
* {1 2 3 4 3 6}.deleteTheFirstOccurrenceOf(3) --> { 1 2 4 3 6 }
* {1 2 1 2 1 2}.deleteTheFirstOccurrenceOf(1) --> {2 1 2 1 2}
*
* a video exploring it's solution and debugging may be available
*
* to test this function
* comment in: debugSomething in main,
* create a test case in debugSomething
* call the test function, passing test case
* here's an example:
* testDeleteTheFirstOccurenceOf("1225", 5, "122");
*/
public void deleteTheFirstOccurrenceOf(int value) {
if (first == null) return; // empty list
if ( first.item != value) { // special case: item is at front.
first = first.next;
return; // stop looking
}
for(Node tmp = first; tmp.next !=null; tmp = tmp.next) { // note: stopping early
if ( tmp.next.item == value) { //note: peek ahead!
tmp.next = tmp.next.next; // deletes tmp.next
return; // stop looking
}
}
}
// for debugging purposes, you may comment/uncomment the calls in main below
// you should restore the calls as below when you submit your solution
public static void main (String args[]) {
//debugSomething();
findMaxTests ();
insertValueBeforeEveryXTests();
secondToLastPositionTests();
deleteTheFirstConsecutiveDuplicateItemTests();
}
private static void debugSomething () {
// Use this for debugging!
// Add the names of helper functions if you use them.
//Trace.drawSteps();
Trace.drawStepsOfMethod ("findMax");
Trace.drawStepsOfMethod ("insertValueBeforeEveryX");
Trace.drawStepsOfMethod ("positionOfSecondToLastOccurrence");
Trace.drawStepsOfMethod ("deleteTheFirstConsecutiveDuplicateItem");
Trace.drawStepsOfMethod ("deleteTheFirstOccurrenceOf");
//Trace.run ();
// To Use: Put the test here you want to debug:
// testFindMax (4, "11 -21 31 41");
testDeleteTheFirstOccurenceOf("1 2 2 3 4 4 ", 2, "1 2 3 4 4" );
}
private static void findMaxTests() {
// arg1: the max
// arg2: data to build the list
testFindMax(4, "4");
testFindMax(4, "1 2 3 4");
testFindMax(4, "4 3 2 1");
testFindMax(4, "1 1 2 3 2 4 1 2");
StdOut.println( " ........ find max tests complete \n");
}
private static void insertValueBeforeEveryXTests() {
// arg1: expected list contents
// arg2: value to insert
// arg3: X - number to search for
// arg4: data for original list
// all tests use value = 1, X = 99
testInsertValueBeforeEveryX ("", 1, 99, ""); // empty starting list
testInsertValueBeforeEveryX ("1 99", 1, 99, "99"); // starting list has one value: 99
testInsertValueBeforeEveryX ("88", 1, 99, "88"); // starting list has one value: 88
testInsertValueBeforeEveryX ("1 99 10", 1, 99, "99 10"); // starting list has two values, starts with 99
testInsertValueBeforeEveryX ("10 1 99", 1, 99, "10 99"); // starting list has two values, ends with 99
testInsertValueBeforeEveryX ("1 99 10 1 99", 1, 99, "99 10 99"); // starting list has multiple 99s
testInsertValueBeforeEveryX ("5 1 99 6 1 99 1 99 7", 1, 99, "5 99 6 99 99 7"); // starting list has multiple 99s
StdOut.println( " ........ insertValueBefore tests complete \n");
}
private static void secondToLastPositionTests() {
// arg1: expected position answer
// arg2: value to search for
// arg3: data for original list
testPositionOfSecondToLastOccurrence (-1, 99, "");
testPositionOfSecondToLastOccurrence (-1, 99, "11");
testPositionOfSecondToLastOccurrence (-1, 99, "11 21 31 41");
testPositionOfSecondToLastOccurrence (-1, 11, "11 21 31 41");
testPositionOfSecondToLastOccurrence (-1, 21, "11 21 31 41");
testPositionOfSecondToLastOccurrence (0, 11, "11 21 31 11");
testPositionOfSecondToLastOccurrence (3, 11, "11 11 11 11 11");
testPositionOfSecondToLastOccurrence (2, 11, "11 21 11 35 11");
StdOut.println( " ........ secondToLastPosition tests complete \n");
}
private static void deleteTheFirstConsecutiveDuplicateItemTests() {
// arg 1: data for original list
// arg 2: data for correct modifed list
testDeleteTheFirstConsecutiveDuplicateItem("","");
testDeleteTheFirstConsecutiveDuplicateItem("1","1");
testDeleteTheFirstConsecutiveDuplicateItem("1 2","1 2");
testDeleteTheFirstConsecutiveDuplicateItem("1 2 3","1 2 3");
testDeleteTheFirstConsecutiveDuplicateItem("1 1 2 3 4 5","1 2 3 4 5");
testDeleteTheFirstConsecutiveDuplicateItem("1 2 2 3 4 5","1 2 3 4 5");
testDeleteTheFirstConsecutiveDuplicateItem("1 1 2 2 3 4 5", "1 2 2 3 4 5");
testDeleteTheFirstConsecutiveDuplicateItem("1 2 3 4 5 5", "1 2 3 4 5");
StdOut.println( " ........ deleteTheFirstConsecutiveDuplicateItem tests complete \n");
}
/* ToString method to print */
public String toString () {
// Use DecimalFormat #.### rather than String.format 0.3f to leave off trailing zeroes
DecimalFormat format = new DecimalFormat ("#.###");
StringBuilder result = new StringBuilder ("{ ") ;
for (Node x = first; x != null; x = x.next) {
result.append (format.format (x.item));
result.append (" ");
}
result.append (" }");
return result.toString ();
}
/* Method to create lists */
public static DSIHomework6 of(String s) {
Node first = null;
String[] nums = s.split (" ");
for (int i = nums.length-1; i >= 0; i--) {
try {
int num = Integer.parseInt (nums[i]);
first = new Node (num, first);
} catch (NumberFormatException e) {
// ignore anything that is not an int
}
}
DSIHomework6 result = new DSIHomework6 ();
result.first = first;
return result;
}
private static void testFindMax (int expected, String sList) {
DSIHomework6 list = DSIHomework6.of (sList);
String sStart = list.toString ();
int actual = list.findMax();
boolean status = true;
String fsList = "{ " + sList + " }";
if (expected != actual) {
StdOut.format ("Failed %20s.findMax(): Expecting: %2d Actual: %4d\n", fsList, expected, actual);
status = false;
}
String sEnd = list.toString ();
if (! sStart.equals (sEnd)) {
StdOut.format ("Failed %20s.findMax(): List changed to %s\n", fsList, sEnd);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success findMax(): Result: %d input: %s\n", actual, sStart);
}
private static void testInsertValueBeforeEveryX (String eList, int iValue, int X, String sList) {
DSIHomework6 list = DSIHomework6.of (sList);
DSIHomework6 expectedList = DSIHomework6.of (eList);
list.insertValueBeforeEveryX(iValue, X);
String actual = list.toString();
String expected = expectedList.toString();
boolean status = true;
String fsList = "{ " + sList + " }";
if (! expected.equals(actual)) {
StdOut.format ("Failed %18s.insertValueBeforeEveryX(1,99): Expecting %s Actual %s\n", fsList, expected, actual);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %18s.insertValueBeforeEveryX(1,99): Result: %s \n", fsList, actual);
}
private static void testPositionOfSecondToLastOccurrence (int expected, int num, String sList) {
DSIHomework6 list = DSIHomework6.of (sList);
String sStart = list.toString ();
int actual = list.positionOfSecondToLastOccurrence(num);
boolean status = true;
String fsList = "{ " + sList + " }";
if (expected != actual) {
StdOut.format ("Failed %20s.positionOfSecondToLastOccurrence(%2d): Expecting: %d Actual: %d\n", fsList, num, expected, actual);
status = false;
}
String sEnd = list.toString ();
if (! sStart.equals (sEnd)) {
StdOut.format ("Failed %20s.positionOfSecondToLastOccurrence(%2d): List changed to %s\n", fsList, num, sEnd);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %20s.positionOfSecondToLastOccurrence(%2d): Result: %2d position of %d in %s\n", fsList, num, actual, num , sStart);
}
private static void testDeleteTheFirstConsecutiveDuplicateItem (String sList, String eList) {
DSIHomework6 list = DSIHomework6.of (sList);
DSIHomework6 expectedList = DSIHomework6.of (eList);
list.deleteTheFirstConsecutiveDuplicateItem();
String actual = list.toString();
String expected = expectedList.toString();
boolean status = true;
String fsList = "{ " + sList + " }";
if (! expected.equals(actual)) {
StdOut.format ("Failed %18s.deleteTheFirstConsecutiveDuplicateItem(): Expecting %s Actual %s\n", fsList, expected, actual);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %18s.deleteTheFirstConsecutiveDuplicateItem(): Result: %s \n", fsList, actual);
}
private static void testDeleteTheFirstOccurenceOf (String sList, int x, String eList) {
DSIHomework6 list = DSIHomework6.of (sList);
DSIHomework6 expectedList = DSIHomework6.of (eList);
list.deleteTheFirstOccurrenceOf(x);
String actual = list.toString();
String expected = expectedList.toString();
boolean status = true;
String fsList = "{ " + sList + " }";
if (! expected.equals(actual)) {
StdOut.format ("Failed %18s.deleteTheFirstOccurenceOf(%d): Expecting %s Actual %s\n", fsList, x, expected, actual);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %18s.TheFirstOccurenceOf(%d): Result: %s \n", fsList,x, actual);
}
}
|
UTF-8
|
Java
| 15,057 |
java
|
DSIHomework6.java
|
Java
|
[] | null |
[] |
package homework; // -1 point if you change the package name
import java.text.DecimalFormat;
import java.util.NoSuchElementException;
import stdlib.*;
public class DSIHomework6 { //-1 point if you change the class name
/** this class maintains a linked structure via the instance variable first
*
* in the examples in this file and testing output, a list is denoted using { }
*
* example { 1 2 3 4 } represents a linked list with first node value 1;
* subsequent nodes have values 2,3,4
* 4 is the value in the last node
*/
/**
* DSIHomework6 version 1.0
*
* Delete one of the following:
*
* A) The work submitted here is solely mine.
*
* B) I had *some* help on the following parts of this assignment
*
* Complete the methods below.
* None of your methods should modify the list, unless that is the purpose of the method.
* All your methods should on operate on the instance variable first
* The toString method is provided for debugging and testing; you may not use it in your solutions
*
* You may not use arrays or any other java collection class
* You may not add any fields to the node or list classes.
* You may not add any methods to the node class.
*
* You MAY add private methods to the DSIHomework6 class (helper functions for the recursion).
*/
static boolean showMeSuccess = true; // set to true to also see Success notifications for tests
// set to false to only see Failure notifications for tests
static class Node {
public Node (int item, Node next) { this.item = item; this.next = next; }
public int item;
public Node next;
}
Node first; // reference to the whole list
/** here is an example function w/ helper function to compute the size of linked list
*/
public int size () {
return sizeHelper( first);
}
private int sizeHelper( Node x) { // x represents the first node of the 'current' list
//base case: empty list, size is 0
if ( x == null) return 0;
// general case. smaller problem is list that comes after x
// below: 1 counts the node that x refers to
// recursive call finds size of smaller list
return 1 + sizeHelper( x.next);
}
/** findMax
*
* precondition: list has at least value
*
* a function to compute the max of the list using recursion
* Note max of a list of size 1 is the sole value in the list
* You will want to create a helper function to do the recursion
*
*/
public int findMax () {
// next line is just a demo of checking the precondition, will not be tested
if ( first == null ) throw new NoSuchElementException(" User Error: FindMax invoked on empty list ");
return StdRandom.uniform(1000); //TODO 1: fix this
}
// place helper function for findMax here
/** insertValueBeforeEveryX
*
* Preconditions: list may be empty, X and Value are not equal
*
* insert a new node containing Value before every node containing X
*
* you can write this iteratively or recursively, but you should only have one loop or recursive helper
* you may not call any other method (e.g. size )
*
* { }.insertValueBeforeEveryX(9,2) --> { } // initial list was empty
* { 1 1 1 1 }.insertValueBeforeEveryX(9,2) --> { 1 1 1 1 } // 0 occurrences of '2'
* { 2 }.insertValueBeforeEveryX(9,2) --> { 9 2} // 1 occurrence of '2'
* { 1 2 3 2 }.insertValueBeforeEveryX(9,2) --> { 1 9 2 3 9 2} // 2 occurrences of '2'
*
*/
public void insertValueBeforeEveryX (int value, int X ) {
// next line is just a demo of checking the precondition, will not be tested
if ( X == value ) throw new IllegalArgumentException(" User Error: illegal argument ");
return; //TODO 2: fix this
}
/** positionOfSecondToLastOccurrence
*
* Precondition: none // list may be empty
*
* a function to compute: the position within the list of the second to last occurrence
* of the parameter: number
*
* positions are counted as an offset from the beginning.
*
* if the list is { 1,2,3,4,3 }, the second to last 3 is in position 2
* if number appears 0 or 1 time, return -1
*
* you can write this iteratively or recursively, but you should only have one loop or recursive helper
* Examples
* {0,1,2,5,5,5,5,5,8,9}.positionOfSeondToLastOccurrence(5) == 6
* {0,1,3,4,5,5,2,5,8,9}.positionOfSeondToLastOccurrence(2) == -1
*
*/
public int positionOfSecondToLastOccurrence (int number) {
return -2; //TODO 3: fix this
}
/** deleteTheFirstConsecutiveDuplicateItem
*
* Precondition: None. List may be empty or have only one value
*
* a function to delete the second of two consecutive nodes containing the same value
* only delete the duplicate for the first such occurrence
*
* Examples:
* {1 2 3 4 5 6}.deleteTheFirstConsecutiveDuplicateItem() --> {1 2 3 4 5 6} // no consecutive duplicates
* {1 2 1 2 1 2}.deleteTheFirstConsecutiveDuplicateItem() --> {1 2 1 2 1 2} // no consecutive duplicates
* {5 5 2 3 4 5}.deleteTheFirstConsecutiveDuplicateItem() --> {5 2 3 4 5} // delete the 5
* {5 1 1 2 3 1}.deleteTheFirstConsecutiveDuplicateItem() --> {5 1 2 3 1} // delete the 1
* {5 5 1 1 3 4}.deleteTheFirstConsecutiveDuplicateItem() --> {5 1 1 3 4 } // delete the 5
* {5 4 3 2 1 1}.deleteTheFirstConsecutiveDuplicateItem() --> {5 4 3 2 1 } // delete the 1
*
*/
public void deleteTheFirstConsecutiveDuplicateItem() {
// TODO 4: fix this
}
/**
* the following is an example method included as a reference
*
* deleteTheFirstOccurrenceOf
*
* it deletes the first occurrence of a node with the parameter 'value'
* {1 2 3 4 3 6}.deleteTheFirstOccurrenceOf(3) --> { 1 2 4 3 6 }
* {1 2 1 2 1 2}.deleteTheFirstOccurrenceOf(1) --> {2 1 2 1 2}
*
* a video exploring it's solution and debugging may be available
*
* to test this function
* comment in: debugSomething in main,
* create a test case in debugSomething
* call the test function, passing test case
* here's an example:
* testDeleteTheFirstOccurenceOf("1225", 5, "122");
*/
public void deleteTheFirstOccurrenceOf(int value) {
if (first == null) return; // empty list
if ( first.item != value) { // special case: item is at front.
first = first.next;
return; // stop looking
}
for(Node tmp = first; tmp.next !=null; tmp = tmp.next) { // note: stopping early
if ( tmp.next.item == value) { //note: peek ahead!
tmp.next = tmp.next.next; // deletes tmp.next
return; // stop looking
}
}
}
// for debugging purposes, you may comment/uncomment the calls in main below
// you should restore the calls as below when you submit your solution
public static void main (String args[]) {
//debugSomething();
findMaxTests ();
insertValueBeforeEveryXTests();
secondToLastPositionTests();
deleteTheFirstConsecutiveDuplicateItemTests();
}
private static void debugSomething () {
// Use this for debugging!
// Add the names of helper functions if you use them.
//Trace.drawSteps();
Trace.drawStepsOfMethod ("findMax");
Trace.drawStepsOfMethod ("insertValueBeforeEveryX");
Trace.drawStepsOfMethod ("positionOfSecondToLastOccurrence");
Trace.drawStepsOfMethod ("deleteTheFirstConsecutiveDuplicateItem");
Trace.drawStepsOfMethod ("deleteTheFirstOccurrenceOf");
//Trace.run ();
// To Use: Put the test here you want to debug:
// testFindMax (4, "11 -21 31 41");
testDeleteTheFirstOccurenceOf("1 2 2 3 4 4 ", 2, "1 2 3 4 4" );
}
private static void findMaxTests() {
// arg1: the max
// arg2: data to build the list
testFindMax(4, "4");
testFindMax(4, "1 2 3 4");
testFindMax(4, "4 3 2 1");
testFindMax(4, "1 1 2 3 2 4 1 2");
StdOut.println( " ........ find max tests complete \n");
}
private static void insertValueBeforeEveryXTests() {
// arg1: expected list contents
// arg2: value to insert
// arg3: X - number to search for
// arg4: data for original list
// all tests use value = 1, X = 99
testInsertValueBeforeEveryX ("", 1, 99, ""); // empty starting list
testInsertValueBeforeEveryX ("1 99", 1, 99, "99"); // starting list has one value: 99
testInsertValueBeforeEveryX ("88", 1, 99, "88"); // starting list has one value: 88
testInsertValueBeforeEveryX ("1 99 10", 1, 99, "99 10"); // starting list has two values, starts with 99
testInsertValueBeforeEveryX ("10 1 99", 1, 99, "10 99"); // starting list has two values, ends with 99
testInsertValueBeforeEveryX ("1 99 10 1 99", 1, 99, "99 10 99"); // starting list has multiple 99s
testInsertValueBeforeEveryX ("5 1 99 6 1 99 1 99 7", 1, 99, "5 99 6 99 99 7"); // starting list has multiple 99s
StdOut.println( " ........ insertValueBefore tests complete \n");
}
private static void secondToLastPositionTests() {
// arg1: expected position answer
// arg2: value to search for
// arg3: data for original list
testPositionOfSecondToLastOccurrence (-1, 99, "");
testPositionOfSecondToLastOccurrence (-1, 99, "11");
testPositionOfSecondToLastOccurrence (-1, 99, "11 21 31 41");
testPositionOfSecondToLastOccurrence (-1, 11, "11 21 31 41");
testPositionOfSecondToLastOccurrence (-1, 21, "11 21 31 41");
testPositionOfSecondToLastOccurrence (0, 11, "11 21 31 11");
testPositionOfSecondToLastOccurrence (3, 11, "11 11 11 11 11");
testPositionOfSecondToLastOccurrence (2, 11, "11 21 11 35 11");
StdOut.println( " ........ secondToLastPosition tests complete \n");
}
private static void deleteTheFirstConsecutiveDuplicateItemTests() {
// arg 1: data for original list
// arg 2: data for correct modifed list
testDeleteTheFirstConsecutiveDuplicateItem("","");
testDeleteTheFirstConsecutiveDuplicateItem("1","1");
testDeleteTheFirstConsecutiveDuplicateItem("1 2","1 2");
testDeleteTheFirstConsecutiveDuplicateItem("1 2 3","1 2 3");
testDeleteTheFirstConsecutiveDuplicateItem("1 1 2 3 4 5","1 2 3 4 5");
testDeleteTheFirstConsecutiveDuplicateItem("1 2 2 3 4 5","1 2 3 4 5");
testDeleteTheFirstConsecutiveDuplicateItem("1 1 2 2 3 4 5", "1 2 2 3 4 5");
testDeleteTheFirstConsecutiveDuplicateItem("1 2 3 4 5 5", "1 2 3 4 5");
StdOut.println( " ........ deleteTheFirstConsecutiveDuplicateItem tests complete \n");
}
/* ToString method to print */
public String toString () {
// Use DecimalFormat #.### rather than String.format 0.3f to leave off trailing zeroes
DecimalFormat format = new DecimalFormat ("#.###");
StringBuilder result = new StringBuilder ("{ ") ;
for (Node x = first; x != null; x = x.next) {
result.append (format.format (x.item));
result.append (" ");
}
result.append (" }");
return result.toString ();
}
/* Method to create lists */
public static DSIHomework6 of(String s) {
Node first = null;
String[] nums = s.split (" ");
for (int i = nums.length-1; i >= 0; i--) {
try {
int num = Integer.parseInt (nums[i]);
first = new Node (num, first);
} catch (NumberFormatException e) {
// ignore anything that is not an int
}
}
DSIHomework6 result = new DSIHomework6 ();
result.first = first;
return result;
}
private static void testFindMax (int expected, String sList) {
DSIHomework6 list = DSIHomework6.of (sList);
String sStart = list.toString ();
int actual = list.findMax();
boolean status = true;
String fsList = "{ " + sList + " }";
if (expected != actual) {
StdOut.format ("Failed %20s.findMax(): Expecting: %2d Actual: %4d\n", fsList, expected, actual);
status = false;
}
String sEnd = list.toString ();
if (! sStart.equals (sEnd)) {
StdOut.format ("Failed %20s.findMax(): List changed to %s\n", fsList, sEnd);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success findMax(): Result: %d input: %s\n", actual, sStart);
}
private static void testInsertValueBeforeEveryX (String eList, int iValue, int X, String sList) {
DSIHomework6 list = DSIHomework6.of (sList);
DSIHomework6 expectedList = DSIHomework6.of (eList);
list.insertValueBeforeEveryX(iValue, X);
String actual = list.toString();
String expected = expectedList.toString();
boolean status = true;
String fsList = "{ " + sList + " }";
if (! expected.equals(actual)) {
StdOut.format ("Failed %18s.insertValueBeforeEveryX(1,99): Expecting %s Actual %s\n", fsList, expected, actual);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %18s.insertValueBeforeEveryX(1,99): Result: %s \n", fsList, actual);
}
private static void testPositionOfSecondToLastOccurrence (int expected, int num, String sList) {
DSIHomework6 list = DSIHomework6.of (sList);
String sStart = list.toString ();
int actual = list.positionOfSecondToLastOccurrence(num);
boolean status = true;
String fsList = "{ " + sList + " }";
if (expected != actual) {
StdOut.format ("Failed %20s.positionOfSecondToLastOccurrence(%2d): Expecting: %d Actual: %d\n", fsList, num, expected, actual);
status = false;
}
String sEnd = list.toString ();
if (! sStart.equals (sEnd)) {
StdOut.format ("Failed %20s.positionOfSecondToLastOccurrence(%2d): List changed to %s\n", fsList, num, sEnd);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %20s.positionOfSecondToLastOccurrence(%2d): Result: %2d position of %d in %s\n", fsList, num, actual, num , sStart);
}
private static void testDeleteTheFirstConsecutiveDuplicateItem (String sList, String eList) {
DSIHomework6 list = DSIHomework6.of (sList);
DSIHomework6 expectedList = DSIHomework6.of (eList);
list.deleteTheFirstConsecutiveDuplicateItem();
String actual = list.toString();
String expected = expectedList.toString();
boolean status = true;
String fsList = "{ " + sList + " }";
if (! expected.equals(actual)) {
StdOut.format ("Failed %18s.deleteTheFirstConsecutiveDuplicateItem(): Expecting %s Actual %s\n", fsList, expected, actual);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %18s.deleteTheFirstConsecutiveDuplicateItem(): Result: %s \n", fsList, actual);
}
private static void testDeleteTheFirstOccurenceOf (String sList, int x, String eList) {
DSIHomework6 list = DSIHomework6.of (sList);
DSIHomework6 expectedList = DSIHomework6.of (eList);
list.deleteTheFirstOccurrenceOf(x);
String actual = list.toString();
String expected = expectedList.toString();
boolean status = true;
String fsList = "{ " + sList + " }";
if (! expected.equals(actual)) {
StdOut.format ("Failed %18s.deleteTheFirstOccurenceOf(%d): Expecting %s Actual %s\n", fsList, x, expected, actual);
status = false;
}
if ( status && showMeSuccess)
StdOut.format ("Success %18s.TheFirstOccurenceOf(%d): Result: %s \n", fsList,x, actual);
}
}
| 15,057 | 0.670386 | 0.634057 | 409 | 35.814182 | 32.945381 | 145 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.08313 | false | false |
7
|
bb60f87c95976f306835e907809349ae96f2cc1a
| 19,662,360,302,483 |
9dc8508d8d648e2fd4f3af9964e91ca985b8d764
|
/Book/src/com/guestbook/client/Ask.java
|
bb5742022025bfbdfbd82e095cb5f76332cee428
|
[] |
no_license
|
smile60749/GWT-Accounting-Book
|
https://github.com/smile60749/GWT-Accounting-Book
|
6f202a3ff100ecbb097b4c20a24de394bfe52e38
|
aa64872d14fd4b29d41a6f56ce0824e2499564b5
|
refs/heads/master
| 2021-01-13T05:03:30.688000 | 2017-02-07T15:42:47 | 2017-02-07T15:42:47 | 81,205,403 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.guestbook.client;
import com.guestbook.client.GreetingService;
import com.guestbook.client.GreetingServiceAsync;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;
public class Ask extends DialogBox {
//private Post post;
private TextBox limittb;
public Ask() {
//String limit=limittb.getText();
DockPanel dockPanel = new DockPanel();
dockPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
dockPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
setWidget(dockPanel);
dockPanel.setSize("377px", "311px");
FlexTable flexTable = new FlexTable();
dockPanel.add(flexTable, DockPanel.CENTER);
flexTable.setSize("370px", "304px");
Label lblNewLabel = new Label("\u8ACB\u8F38\u5165\u9322\u9322\u7684\u4E0A\u9650\uFF1A");
lblNewLabel.setStyleName("dialog-Title");
flexTable.setWidget(0, 0, lblNewLabel);
limittb = new TextBox();
flexTable.setWidget(0, 1, limittb);
Label lblNewLabel_2 = new Label("\u5269\u9918\u7684\u9322\u9322\uFF1A");
lblNewLabel_2.setStyleName("dialog-Title");
flexTable.setWidget(2, 0, lblNewLabel_2);
final Label lblast = new Label("");
lblast.setStyleName("gwt-TextBox");
flexTable.setWidget(2, 1, lblast);
DockPanel dockPanel_1 = new DockPanel();
dockPanel.add(dockPanel_1, DockPanel.SOUTH);
Button countbtn = new Button("\u8A08\u7B97");
countbtn.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
GreetingServiceAsync greetingService1 =
(GreetingServiceAsync) GWT.create(GreetingService.class);
greetingService1.greetServer(limittb.getText(), new AsyncCallback<String>()
{
@Override
public void onSuccess(String result) {
// TODO Auto-generated method stub
lblast.setText(""+result);
}
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
Window.alert("error!");
}
});
}
});
dockPanel_1.add(countbtn, DockPanel.CENTER);
countbtn.setStyleName("dialog-Title-new");
countbtn.setSize("55px", "33px");
Button leavebtn = new Button("\u96E2\u958B");
leavebtn.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
}
});
leavebtn.setStyleName("dialog-Title-new");
dockPanel_1.add(leavebtn, DockPanel.EAST);
leavebtn.setSize("55px", "33px");
}
}
|
UTF-8
|
Java
| 2,979 |
java
|
Ask.java
|
Java
|
[] | null |
[] |
package com.guestbook.client;
import com.guestbook.client.GreetingService;
import com.guestbook.client.GreetingServiceAsync;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.HasVerticalAlignment;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.dom.client.ClickEvent;
public class Ask extends DialogBox {
//private Post post;
private TextBox limittb;
public Ask() {
//String limit=limittb.getText();
DockPanel dockPanel = new DockPanel();
dockPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
dockPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
setWidget(dockPanel);
dockPanel.setSize("377px", "311px");
FlexTable flexTable = new FlexTable();
dockPanel.add(flexTable, DockPanel.CENTER);
flexTable.setSize("370px", "304px");
Label lblNewLabel = new Label("\u8ACB\u8F38\u5165\u9322\u9322\u7684\u4E0A\u9650\uFF1A");
lblNewLabel.setStyleName("dialog-Title");
flexTable.setWidget(0, 0, lblNewLabel);
limittb = new TextBox();
flexTable.setWidget(0, 1, limittb);
Label lblNewLabel_2 = new Label("\u5269\u9918\u7684\u9322\u9322\uFF1A");
lblNewLabel_2.setStyleName("dialog-Title");
flexTable.setWidget(2, 0, lblNewLabel_2);
final Label lblast = new Label("");
lblast.setStyleName("gwt-TextBox");
flexTable.setWidget(2, 1, lblast);
DockPanel dockPanel_1 = new DockPanel();
dockPanel.add(dockPanel_1, DockPanel.SOUTH);
Button countbtn = new Button("\u8A08\u7B97");
countbtn.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
GreetingServiceAsync greetingService1 =
(GreetingServiceAsync) GWT.create(GreetingService.class);
greetingService1.greetServer(limittb.getText(), new AsyncCallback<String>()
{
@Override
public void onSuccess(String result) {
// TODO Auto-generated method stub
lblast.setText(""+result);
}
@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub
Window.alert("error!");
}
});
}
});
dockPanel_1.add(countbtn, DockPanel.CENTER);
countbtn.setStyleName("dialog-Title-new");
countbtn.setSize("55px", "33px");
Button leavebtn = new Button("\u96E2\u958B");
leavebtn.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
hide();
}
});
leavebtn.setStyleName("dialog-Title-new");
dockPanel_1.add(leavebtn, DockPanel.EAST);
leavebtn.setSize("55px", "33px");
}
}
| 2,979 | 0.730782 | 0.698221 | 89 | 32.471909 | 21.193113 | 90 | false | false | 0 | 0 | 54 | 0.030211 | 0 | 0 | 3 | false | false |
7
|
45874834256c829ba3973fe1ddf4bd1fd8572df3
| 17,351,667,890,458 |
92108e5d30246fdae82ee4803c5d4b71386e7cad
|
/src/selenium/Testgit.java
|
aff86c1d8300102f655490e8b66c3d9a4ad37abc
|
[] |
no_license
|
sugunakar-267/Selenium
|
https://github.com/sugunakar-267/Selenium
|
e2b6a8817f2f943d7ed1e40b45229cea8755e5ed
|
e10a5b7d42de52dcbc063606a74f3dfbb241463b
|
refs/heads/master
| 2023-04-08T03:06:38.937000 | 2021-04-14T13:15:24 | 2021-04-14T13:15:24 | 357,904,497 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package selenium;
public class Testgit
{
public static void main(String[] args)
{
System.out.println("Git is showing problem");
}
}
|
UTF-8
|
Java
| 153 |
java
|
Testgit.java
|
Java
|
[] | null |
[] |
package selenium;
public class Testgit
{
public static void main(String[] args)
{
System.out.println("Git is showing problem");
}
}
| 153 | 0.640523 | 0.640523 | 11 | 11.909091 | 16.483902 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.636364 | false | false |
7
|
efb51f209b586e54a20a55be2e29fb9e3d2d8a8b
| 17,128,329,641,898 |
2536c446c91624147ff4b454b1c09d1fcd9731d0
|
/selenium/src/practice/chromes.java
|
2b44d0e1d4bb6edfc1828e2d9f9ce5edf45a5bb9
|
[] |
no_license
|
prashanthsm8/amazon
|
https://github.com/prashanthsm8/amazon
|
c5528eac04182108b339062aa15b7dcef454beab
|
1127b7af397a5762fb106f8f935c4a7688ddec68
|
refs/heads/master
| 2020-03-16T21:40:04.642000 | 2018-05-13T06:42:20 | 2018-05-13T06:42:20 | 133,009,199 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package practice;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class chromes {
public static void main(String[] args) throws SQLException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "D://sel_workspace//chromedriver_win32//chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.co.in/?gfe_rd=cr&dcr=0&ei=RdnSWuHWFKOwX6OVhfgM");
String host="localhost";
String port= "3306";
Connection con=DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/QADB", "root", "root");
Statement s=con.createStatement();
ResultSet rs=s.executeQuery("select * from Empinfo");
while(rs.next())
{
System.out.println(rs.getString("name"));
}
}
}
|
UTF-8
|
Java
| 995 |
java
|
chromes.java
|
Java
|
[] | null |
[] |
package practice;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class chromes {
public static void main(String[] args) throws SQLException {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "D://sel_workspace//chromedriver_win32//chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.google.co.in/?gfe_rd=cr&dcr=0&ei=RdnSWuHWFKOwX6OVhfgM");
String host="localhost";
String port= "3306";
Connection con=DriverManager.getConnection("jdbc:mysql://" + host + ":" + port + "/QADB", "root", "root");
Statement s=con.createStatement();
ResultSet rs=s.executeQuery("select * from Empinfo");
while(rs.next())
{
System.out.println(rs.getString("name"));
}
}
}
| 995 | 0.687437 | 0.679397 | 43 | 21.139534 | 27.829699 | 108 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.209302 | false | false |
7
|
af4773fafff33678719ce636747210aa11a3bdbd
| 8,297,876,834,118 |
22141953a37ec08facbb922ce847372cf24638c2
|
/app/src/main/java/com/example/devjams/ReadWebPage.java
|
1d4631ffad5eb93f6edb34e096db4f86877f1bce
|
[] |
no_license
|
AdityaK11/DevJams
|
https://github.com/AdityaK11/DevJams
|
c65a7aa14ec14f090d5501f4eefbb6f8ea40d696
|
3528125d88dbafed638f6f775fa56671aaee1652
|
refs/heads/master
| 2020-08-23T06:50:20.817000 | 2019-10-24T21:37:06 | 2019-10-24T21:37:06 | 216,563,774 | 0 | 0 | null | false | 2019-10-24T22:21:00 | 2019-10-21T12:34:38 | 2019-10-24T21:37:23 | 2019-10-24T22:18:34 | 6,131 | 0 | 0 | 1 |
Java
| false | false |
package com.example.devjams;
import android.app.Activity;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
public class ReadWebPage extends Activity {
private TextView textView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_read_web_page);
textView = (TextView) findViewById(R.id.TextView01);
new RequestTask().execute("http://www.google.com/");
}
private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
String response = "";
for (String url : urls) {
DefaultHttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
try {
HttpResponse execute = client.execute(httpGet);
InputStream content = execute.getEntity().getContent();
BufferedReader buffer = new BufferedReader(
new InputStreamReader(content));
String s = "";
while ((s = buffer.readLine()) != null) {
response += s;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return response;
}
@Override
protected void onPostExecute(String result) {
textView.setText(Html.fromHtml(result));
}
}
public void readWebpage(View view) {
/*DownloadWebPageTask task = new DownloadWebPageTask();
task.execute(new String[] { "http://www.google.com" });*/
new RequestTask().execute("http://www.google.com/");
}
class RequestTask extends AsyncTask<String, String, String>{
@Override
// username, password, message, mobile
protected String doInBackground(String... url) {
// constants
int timeoutSocket = 5000;
int timeoutConnection = 5000;
HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
HttpClient client = new DefaultHttpClient(httpParameters);
HttpGet httpget = new HttpGet(url[0]);
try {
HttpResponse getResponse = client.execute(httpget);
final int statusCode = getResponse.getStatusLine().getStatusCode();
if(statusCode != HttpStatus.SC_OK) {
Log.w("MyApp", "Download Error: " + statusCode + "| for URL: " + url);
return null;
}
String line = "";
StringBuilder total = new StringBuilder();
HttpEntity getResponseEntity = getResponse.getEntity();
BufferedReader reader = new BufferedReader(new InputStreamReader(getResponseEntity.getContent()));
while((line = reader.readLine()) != null) {
total.append(line);
}
line = total.toString();
return line;
} catch (Exception e) {
Log.w("MyApp", "Download Exception : " + e.toString());
}
return null;
}
@Override
protected void onPostExecute(String result) {
// do something with result
textView.setText(Html.fromHtml(result));
}
}
}
|
UTF-8
|
Java
| 4,343 |
java
|
ReadWebPage.java
|
Java
|
[] | null |
[] |
package com.example.devjams;
import android.app.Activity;
import android.os.AsyncTask;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
public class ReadWebPage extends Activity {
private TextView textView;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_read_web_page);
textView = (TextView) findViewById(R.id.TextView01);
new RequestTask().execute("http://www.google.com/");
}
private class DownloadWebPageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
String response = "";
for (String url : urls) {
DefaultHttpClient client = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
try {
HttpResponse execute = client.execute(httpGet);
InputStream content = execute.getEntity().getContent();
BufferedReader buffer = new BufferedReader(
new InputStreamReader(content));
String s = "";
while ((s = buffer.readLine()) != null) {
response += s;
}
} catch (Exception e) {
e.printStackTrace();
}
}
return response;
}
@Override
protected void onPostExecute(String result) {
textView.setText(Html.fromHtml(result));
}
}
public void readWebpage(View view) {
/*DownloadWebPageTask task = new DownloadWebPageTask();
task.execute(new String[] { "http://www.google.com" });*/
new RequestTask().execute("http://www.google.com/");
}
class RequestTask extends AsyncTask<String, String, String>{
@Override
// username, password, message, mobile
protected String doInBackground(String... url) {
// constants
int timeoutSocket = 5000;
int timeoutConnection = 5000;
HttpParams httpParameters = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
HttpClient client = new DefaultHttpClient(httpParameters);
HttpGet httpget = new HttpGet(url[0]);
try {
HttpResponse getResponse = client.execute(httpget);
final int statusCode = getResponse.getStatusLine().getStatusCode();
if(statusCode != HttpStatus.SC_OK) {
Log.w("MyApp", "Download Error: " + statusCode + "| for URL: " + url);
return null;
}
String line = "";
StringBuilder total = new StringBuilder();
HttpEntity getResponseEntity = getResponse.getEntity();
BufferedReader reader = new BufferedReader(new InputStreamReader(getResponseEntity.getContent()));
while((line = reader.readLine()) != null) {
total.append(line);
}
line = total.toString();
return line;
} catch (Exception e) {
Log.w("MyApp", "Download Exception : " + e.toString());
}
return null;
}
@Override
protected void onPostExecute(String result) {
// do something with result
textView.setText(Html.fromHtml(result));
}
}
}
| 4,343 | 0.600046 | 0.597283 | 127 | 33.19685 | 25.460495 | 114 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.574803 | false | false |
7
|
7b993780ae3eab21aac71efd11fb8e9fe3285bef
| 17,093,969,855,626 |
606382acb532e2ad4c9320eaba2de06697274447
|
/src/servlet/index_servlet.java
|
fb822b44d62f3a3af0ab53f4e0d6c15284722d2c
|
[] |
no_license
|
feishuoren/Java-sec
|
https://github.com/feishuoren/Java-sec
|
801cc8bad095cc95e62fc47f9f9f9d00cd6b03a2
|
c730e7dbf1d1faef584e350689f9fc392c715d62
|
refs/heads/main
| 2023-03-13T20:59:32.227000 | 2021-03-23T13:28:25 | 2021-03-23T13:28:25 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import safe_Action.RSACoder;
import safe_Action.key;
import faction.index;
public class index_servlet extends HttpServlet {
/**
* Constructor of the object.
*/
public index_servlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String name = request.getParameter("username");
String password = request.getParameter("password");
String publickey = request.getParameter("publickey");
String privatekey = request.getParameter("privatekey");
key key = new key();
try {
key.getKeyMap(publickey, privatekey);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
index index = new index();
try {
index.index(name,password,publickey,privatekey);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.sendRedirect("../login.jsp");
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
|
UTF-8
|
Java
| 2,040 |
java
|
index_servlet.java
|
Java
|
[
{
"context": "t=UTF-8\");\r\n\t\tString name = request.getParameter(\"username\");\r\n\t\tString password = request.getParameter(\"pas",
"end": 1265,
"score": 0.9487460851669312,
"start": 1257,
"tag": "USERNAME",
"value": "username"
}
] | null |
[] |
package servlet;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import safe_Action.RSACoder;
import safe_Action.key;
import faction.index;
public class index_servlet extends HttpServlet {
/**
* Constructor of the object.
*/
public index_servlet() {
super();
}
/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
String name = request.getParameter("username");
String password = request.getParameter("password");
String publickey = request.getParameter("publickey");
String privatekey = request.getParameter("privatekey");
key key = new key();
try {
key.getKeyMap(publickey, privatekey);
} catch (Exception e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
index index = new index();
try {
index.index(name,password,publickey,privatekey);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
response.sendRedirect("../login.jsp");
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}
}
| 2,040 | 0.686765 | 0.685294 | 79 | 23.822784 | 21.38896 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.493671 | false | false |
7
|
ada3456d144f8e639a1fb6d2f20bd60c3b807e59
| 24,876,450,579,977 |
e78bf0af94a5ba49a4f3701c5ccdd2814c582733
|
/app/src/main/java/com/example/registroclientesdmr/inicio/InicioSesion.java
|
26a107ae7dc928dbc8d55fd952d052625062a265
|
[] |
no_license
|
noptuno/RegistroClientesDMR
|
https://github.com/noptuno/RegistroClientesDMR
|
689cbe52bc4883baf25875c6f5edab68b7f9f4b5
|
96413fa6412285159e55bffd23078ebe61f99920
|
refs/heads/master
| 2023-08-04T12:52:06.136000 | 2021-09-24T20:08:02 | 2021-09-24T20:08:02 | 409,629,919 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.registroclientesdmr.inicio;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.registroclientesdmr.MainActivity;
import com.example.registroclientesdmr.R;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class InicioSesion extends AppCompatActivity {
private FirebaseAuth mAuth;
private Button btnsesion, btngoogle;
private EditText txtemail;
private EditText txtpassword;
private ProgressDialog dialog;
private ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inicio_sesion);
btngoogle = findViewById(R.id.btn_google);
btnsesion = findViewById(R.id.btn_sesion);
txtemail = findViewById(R.id.et_correo);
txtpassword = findViewById(R.id.et_contrasena);
progressDialog = new ProgressDialog(this);
dialog = new ProgressDialog(this);
iniciar_sesion();
mAuth = FirebaseAuth.getInstance();
}
private void iniciar_sesion() {
btnsesion.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String email = txtemail.getText().toString();
String password = txtpassword.getText().toString();
if (email.length() > 0 && password.length() > 0) {
progressDialog.setMessage("Iniciando Sesion en linea...");
progressDialog.show();
mAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(InicioSesion.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
FirebaseUser user = mAuth.getCurrentUser();
updateUI(user);
} else {
Toast.makeText(InicioSesion.this, "invalido", Toast.LENGTH_LONG).show();
}
progressDialog.dismiss();
}
});
} else {
Toast.makeText(InicioSesion.this, "Datos Inválidos", Toast.LENGTH_LONG).show();
}
}
});
}
private void updateUI(FirebaseUser user) {
hideProgressDialog();
if (user != null) {
Intent intent = new Intent(InicioSesion.this, MainActivity.class);
startActivity(intent);
SharedPreferences pref = getSharedPreferences("LOGINDMR", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putString("EMAIL", user.getEmail());
editor.putString("ESTADO_LOGIN", "SI");
editor.apply();
finish();
}
}
private void showProgressDialog() {
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
}
private void hideProgressDialog() {
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.hide();
}
@Override
protected void onStart() {
super.onStart();
FirebaseUser currentUser = mAuth.getCurrentUser();
updateUI(currentUser);
}
}
|
UTF-8
|
Java
| 4,221 |
java
|
InicioSesion.java
|
Java
|
[] | null |
[] |
package com.example.registroclientesdmr.inicio;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.example.registroclientesdmr.MainActivity;
import com.example.registroclientesdmr.R;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
public class InicioSesion extends AppCompatActivity {
private FirebaseAuth mAuth;
private Button btnsesion, btngoogle;
private EditText txtemail;
private EditText txtpassword;
private ProgressDialog dialog;
private ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_inicio_sesion);
btngoogle = findViewById(R.id.btn_google);
btnsesion = findViewById(R.id.btn_sesion);
txtemail = findViewById(R.id.et_correo);
txtpassword = findViewById(R.id.et_contrasena);
progressDialog = new ProgressDialog(this);
dialog = new ProgressDialog(this);
iniciar_sesion();
mAuth = FirebaseAuth.getInstance();
}
private void iniciar_sesion() {
btnsesion.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String email = txtemail.getText().toString();
String password = txtpassword.getText().toString();
if (email.length() > 0 && password.length() > 0) {
progressDialog.setMessage("Iniciando Sesion en linea...");
progressDialog.show();
mAuth.signInWithEmailAndPassword(email, password)
.addOnCompleteListener(InicioSesion.this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (task.isSuccessful()) {
FirebaseUser user = mAuth.getCurrentUser();
updateUI(user);
} else {
Toast.makeText(InicioSesion.this, "invalido", Toast.LENGTH_LONG).show();
}
progressDialog.dismiss();
}
});
} else {
Toast.makeText(InicioSesion.this, "Datos Inválidos", Toast.LENGTH_LONG).show();
}
}
});
}
private void updateUI(FirebaseUser user) {
hideProgressDialog();
if (user != null) {
Intent intent = new Intent(InicioSesion.this, MainActivity.class);
startActivity(intent);
SharedPreferences pref = getSharedPreferences("LOGINDMR", Context.MODE_PRIVATE);
SharedPreferences.Editor editor = pref.edit();
editor.putString("EMAIL", user.getEmail());
editor.putString("ESTADO_LOGIN", "SI");
editor.apply();
finish();
}
}
private void showProgressDialog() {
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.show();
}
private void hideProgressDialog() {
dialog.setCancelable(false);
dialog.setCanceledOnTouchOutside(false);
dialog.hide();
}
@Override
protected void onStart() {
super.onStart();
FirebaseUser currentUser = mAuth.getCurrentUser();
updateUI(currentUser);
}
}
| 4,221 | 0.606635 | 0.606161 | 134 | 30.5 | 26.328506 | 112 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.574627 | false | false |
7
|
ffa920151886a31bfcb0bbb84b7a779ddfc96ebb
| 29,411,936,081,944 |
7742882b605a393230091a7955508dff4a87db44
|
/src/main/java/com/shop/controller/AdressController.java
|
a96f014c9f909d87be4c47aa264bf35d5b2ba7dc
|
[] |
no_license
|
Marynx/OnlineShop
|
https://github.com/Marynx/OnlineShop
|
b0791714383201d02cbe10ea0c504501d72956ff
|
d164cdd3ef8b4f2d5421a59ea9c5c1441255f055
|
refs/heads/master
| 2020-05-17T04:42:11.427000 | 2019-06-09T23:52:18 | 2019-06-09T23:52:18 | 183,515,059 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.shop.controller;
import com.shop.model.Adress;
import com.shop.model.User;
import com.shop.repository.AdressRepository;
import com.shop.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.security.Principal;
@Controller
@RequestMapping("/adress")
public class AdressController {
private UserRepository userRepository;
private AdressRepository adressRepository;
@Autowired
public AdressController(UserRepository userRepository,AdressRepository adressRepository){
this.userRepository=userRepository;
this.adressRepository=adressRepository;
}
//
// @GetMapping("/")
// public String updateAdress(Principal principal, Model model){
// User user=userRepository.findByLogin(principal.getName());
// Adress adress=user.getAdress();
// System.out.println(adress);
// model.addAttribute("adress",adress);
// return "updateForm";
// }
@PostMapping("")
public String addAdress(Principal principal, @ModelAttribute @Valid Adress adress, BindingResult bindingResult){
if(bindingResult.hasErrors())
return "redirect:/user/personalData";
else{
User user =userRepository.findByLogin(principal.getName());
adressRepository.save(adress);
user.setAdress(adress);
userRepository.save(user);
return "redirect:/user/personalData";
}
}
@GetMapping("/edit")
public String updateAddress(Principal principal, Model model){
User user=userRepository.findByLogin(principal.getName());
Adress adress=user.getAdress();
System.out.println(adress);
model.addAttribute("adress",adress);
return "updateForm";
}
@PostMapping("/edit/{id}")
public String updateAddress(@PathVariable("id") Long id, @Valid Adress adress, BindingResult bindingResult){
if(bindingResult.hasErrors()){
adress.setId(id);
return "updateForm";
}else{
System.out.println(adress);
// Adress adress1=adressRepository.findById(adress.getId()).get();
adressRepository.save(adress);
return "redirect:/user/personalData";
}
}
}
|
UTF-8
|
Java
| 2,498 |
java
|
AdressController.java
|
Java
|
[] | null |
[] |
package com.shop.controller;
import com.shop.model.Adress;
import com.shop.model.User;
import com.shop.repository.AdressRepository;
import com.shop.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.security.Principal;
@Controller
@RequestMapping("/adress")
public class AdressController {
private UserRepository userRepository;
private AdressRepository adressRepository;
@Autowired
public AdressController(UserRepository userRepository,AdressRepository adressRepository){
this.userRepository=userRepository;
this.adressRepository=adressRepository;
}
//
// @GetMapping("/")
// public String updateAdress(Principal principal, Model model){
// User user=userRepository.findByLogin(principal.getName());
// Adress adress=user.getAdress();
// System.out.println(adress);
// model.addAttribute("adress",adress);
// return "updateForm";
// }
@PostMapping("")
public String addAdress(Principal principal, @ModelAttribute @Valid Adress adress, BindingResult bindingResult){
if(bindingResult.hasErrors())
return "redirect:/user/personalData";
else{
User user =userRepository.findByLogin(principal.getName());
adressRepository.save(adress);
user.setAdress(adress);
userRepository.save(user);
return "redirect:/user/personalData";
}
}
@GetMapping("/edit")
public String updateAddress(Principal principal, Model model){
User user=userRepository.findByLogin(principal.getName());
Adress adress=user.getAdress();
System.out.println(adress);
model.addAttribute("adress",adress);
return "updateForm";
}
@PostMapping("/edit/{id}")
public String updateAddress(@PathVariable("id") Long id, @Valid Adress adress, BindingResult bindingResult){
if(bindingResult.hasErrors()){
adress.setId(id);
return "updateForm";
}else{
System.out.println(adress);
// Adress adress1=adressRepository.findById(adress.getId()).get();
adressRepository.save(adress);
return "redirect:/user/personalData";
}
}
}
| 2,498 | 0.688551 | 0.688151 | 73 | 33.219177 | 25.511881 | 116 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.643836 | false | false |
7
|
0595b53a8aad2c362b8c0daf90071d8f7d1c27d7
| 23,424,751,683,429 |
b6d239db7811c3b02f42a470f3e7016f5f0fb6cc
|
/src/utilities/Walking.java
|
ed71d42ab7f0c8341f516fdacb574d6767e1fdcb
|
[] |
no_license
|
Aiid0z/aiWoodcutter
|
https://github.com/Aiid0z/aiWoodcutter
|
aca1a3231e07c87666acb65f75a4075438536b41
|
7140263536fe14c782bab53c146c52639a111caf
|
refs/heads/master
| 2015-07-22T01:59:02 | 2015-06-09T08:45:24 | 2015-06-09T08:45:24 | 37,061,524 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package utilities;
public class Walking {
}
|
UTF-8
|
Java
| 48 |
java
|
Walking.java
|
Java
|
[] | null |
[] |
package utilities;
public class Walking {
}
| 48 | 0.708333 | 0.708333 | 7 | 5.857143 | 9.014728 | 22 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.142857 | false | false |
7
|
5e23967d29e86a6cbfa612a81dd09d6a5aa038a7
| 2,284,922,666,549 |
760a04988755ad65fc7d85b4901ce4e1aa0c207e
|
/PS_PPS_Dev/PS_PPS_domain/src/gov/va/med/pharmacy/peps/domain/common/model/EplFdbDrugIngredientDo.java
|
f2e8d8d5809479263080a95027153e51eba50198
|
[] |
no_license
|
jeveleth/Hazardous-Pharmaceuticals
|
https://github.com/jeveleth/Hazardous-Pharmaceuticals
|
9599f66cf583d6203e40f2039a9c35581a02f358
|
1e3ebfbbfbc0f8e354bbc4d0591ffe583f819216
|
refs/heads/master
| 2017-12-19T20:07:01.941000 | 2015-06-25T20:50:21 | 2015-06-25T20:50:21 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package gov.va.med.pharmacy.peps.domain.common.model;
// Generated Nov 18, 2011 1:24:26 PM by Hibernate Tools 3.2.4.GA
import java.util.Date;
/**
* EplFdbDrugIngredientDo generated by hbm2java
*
* @hibernate.class
*
*/
public class EplFdbDrugIngredientDo extends gov.va.med.pharmacy.peps.domain.common.model.DataObject implements
java.io.Serializable {
public static final String FDB_DRUG_INGREDIENT = "fdbDrugIngredient";
public static final String EPL_DRUG_INGREDIENT_FK = "eplDrugIngredientFk";
private String fdbDrugIngredient;
private Long eplDrugIngredientFk;
private String createdBy;
private Date createdDtm;
private String lastModifiedBy;
private Date lastModifiedDtm;
private static final long serialVersionUID = 1L;
/**
* Default Constructor
*/
public EplFdbDrugIngredientDo() {
}
/**
* Minimal Constructor
*
* @param fdbHicseqn
* @param fdbDrugIngredient
* @param createdBy
* @param createdDtm
*/
public EplFdbDrugIngredientDo(String fdbDrugIngredient, String eplDrugIngredientFk,
String createdBy, Date createdDtm) {
this.fdbDrugIngredient = fdbDrugIngredient;
this.createdBy = createdBy;
this.createdDtm = createdDtm;
}
/**
* Full Constructor
*
* @param id
* @param fdbDrugIngredient
* @param createdBy
* @param createdDtm
* @param lastModifiedBy
* @param lastModifiedDtm
* @param eplFdbDrugIngredientAssocs
*/
public EplFdbDrugIngredientDo(String fdbDrugIngredient, Long eplDrugIngredientFk,
String createdBy, Date createdDtm, String lastModifiedBy, Date lastModifiedDtm) {
this.fdbDrugIngredient = fdbDrugIngredient;
this.eplDrugIngredientFk = eplDrugIngredientFk;
this.createdBy = createdBy;
this.createdDtm = createdDtm;
this.lastModifiedBy = lastModifiedBy;
this.lastModifiedDtm = lastModifiedDtm;
}
/**
*
* @return fdbDrugIngredient
*/
public String getFdbDrugIngredient() {
return this.fdbDrugIngredient;
}
/**
*
* @param fdbDrugIngredient
*/
public void setFdbDrugIngredient(String fdbDrugIngredient) {
this.fdbDrugIngredient = fdbDrugIngredient;
}
/**
*
* @return eplDrugIngredientFk
*/
public Long getEplDrugIngredientFk() {
return eplDrugIngredientFk;
}
/**
*
* @param eplDrugIngredientFk
*/
public void setEplDrugIngredientFk(Long eplDrugIngredientFk) {
this.eplDrugIngredientFk = eplDrugIngredientFk;
}
/**
*
*/
@Override
public String getCreatedBy() {
return this.createdBy;
}
/**
*
*/
@Override
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
*
*/
@Override
public Date getCreatedDtm() {
return this.createdDtm;
}
/**
*
*/
@Override
public void setCreatedDtm(Date createdDtm) {
this.createdDtm = createdDtm;
}
/**
* @return lastModifiedBy
*/
@Override
public String getLastModifiedBy() {
return this.lastModifiedBy;
}
/**
* @param lastModifiedDtm
*/
@Override
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
/**
* @return lastModifiedDtm
*/
@Override
public Date getLastModifiedDtm() {
return this.lastModifiedDtm;
}
/**
* @param lastModifiedDtm
*/
@Override
public void setLastModifiedDtm(Date lastModifiedDtm) {
this.lastModifiedDtm = lastModifiedDtm;
}
/* (non-Javadoc)
* @see gov.va.med.pharmacy.peps.domain.common.model.DataObject#toString()
*/
@Override
public String toString() {
return "EplFdbDrugIngredientDo [fdbDrugIngredient=" + fdbDrugIngredient
+ ", eplDrugIngredientFk=" + eplDrugIngredientFk + ", createdBy=" + createdBy + ", createdDtm=" + createdDtm
+ ", " + "lastModifiedBy=" + lastModifiedBy + ", lastModifiedDtm=" + lastModifiedDtm + "]";
}
/* (non-Javadoc)
* @see gov.va.med.pharmacy.peps.domain.common.model.DataObject#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((createdBy == null) ? 0 : createdBy.hashCode());
result = prime * result + ((createdDtm == null) ? 0 : createdDtm.hashCode());
result = prime * result + ((fdbDrugIngredient == null) ? 0 : fdbDrugIngredient.hashCode());
result = prime * result + ((eplDrugIngredientFk == null) ? 0 : eplDrugIngredientFk.hashCode());
result = prime * result + ((lastModifiedBy == null) ? 0 : lastModifiedBy.hashCode());
result = prime * result + ((lastModifiedDtm == null) ? 0 : lastModifiedDtm.hashCode());
return result;
}
/* (non-Javadoc)
* @see gov.va.med.pharmacy.peps.domain.common.model.DataObject#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
EplFdbDrugIngredientDo other = (EplFdbDrugIngredientDo) obj;
if (createdBy == null) {
if (other.createdBy != null)
return false;
} else if (!createdBy.equals(other.createdBy))
return false;
if (createdDtm == null) {
if (other.createdDtm != null)
return false;
} else if (!createdDtm.equals(other.createdDtm))
return false;
if (eplDrugIngredientFk == null) {
if (other.eplDrugIngredientFk != null)
return false;
} else if (!eplDrugIngredientFk.equals(other.eplDrugIngredientFk))
return false;
if (fdbDrugIngredient == null) {
if (other.fdbDrugIngredient != null)
return false;
} else if (!fdbDrugIngredient.equals(other.fdbDrugIngredient))
return false;
if (lastModifiedBy == null) {
if (other.lastModifiedBy != null)
return false;
} else if (!lastModifiedBy.equals(other.lastModifiedBy))
return false;
if (lastModifiedDtm == null) {
if (other.lastModifiedDtm != null)
return false;
} else if (!lastModifiedDtm.equals(other.lastModifiedDtm))
return false;
return true;
}
}
|
UTF-8
|
Java
| 6,798 |
java
|
EplFdbDrugIngredientDo.java
|
Java
|
[] | null |
[] |
package gov.va.med.pharmacy.peps.domain.common.model;
// Generated Nov 18, 2011 1:24:26 PM by Hibernate Tools 3.2.4.GA
import java.util.Date;
/**
* EplFdbDrugIngredientDo generated by hbm2java
*
* @hibernate.class
*
*/
public class EplFdbDrugIngredientDo extends gov.va.med.pharmacy.peps.domain.common.model.DataObject implements
java.io.Serializable {
public static final String FDB_DRUG_INGREDIENT = "fdbDrugIngredient";
public static final String EPL_DRUG_INGREDIENT_FK = "eplDrugIngredientFk";
private String fdbDrugIngredient;
private Long eplDrugIngredientFk;
private String createdBy;
private Date createdDtm;
private String lastModifiedBy;
private Date lastModifiedDtm;
private static final long serialVersionUID = 1L;
/**
* Default Constructor
*/
public EplFdbDrugIngredientDo() {
}
/**
* Minimal Constructor
*
* @param fdbHicseqn
* @param fdbDrugIngredient
* @param createdBy
* @param createdDtm
*/
public EplFdbDrugIngredientDo(String fdbDrugIngredient, String eplDrugIngredientFk,
String createdBy, Date createdDtm) {
this.fdbDrugIngredient = fdbDrugIngredient;
this.createdBy = createdBy;
this.createdDtm = createdDtm;
}
/**
* Full Constructor
*
* @param id
* @param fdbDrugIngredient
* @param createdBy
* @param createdDtm
* @param lastModifiedBy
* @param lastModifiedDtm
* @param eplFdbDrugIngredientAssocs
*/
public EplFdbDrugIngredientDo(String fdbDrugIngredient, Long eplDrugIngredientFk,
String createdBy, Date createdDtm, String lastModifiedBy, Date lastModifiedDtm) {
this.fdbDrugIngredient = fdbDrugIngredient;
this.eplDrugIngredientFk = eplDrugIngredientFk;
this.createdBy = createdBy;
this.createdDtm = createdDtm;
this.lastModifiedBy = lastModifiedBy;
this.lastModifiedDtm = lastModifiedDtm;
}
/**
*
* @return fdbDrugIngredient
*/
public String getFdbDrugIngredient() {
return this.fdbDrugIngredient;
}
/**
*
* @param fdbDrugIngredient
*/
public void setFdbDrugIngredient(String fdbDrugIngredient) {
this.fdbDrugIngredient = fdbDrugIngredient;
}
/**
*
* @return eplDrugIngredientFk
*/
public Long getEplDrugIngredientFk() {
return eplDrugIngredientFk;
}
/**
*
* @param eplDrugIngredientFk
*/
public void setEplDrugIngredientFk(Long eplDrugIngredientFk) {
this.eplDrugIngredientFk = eplDrugIngredientFk;
}
/**
*
*/
@Override
public String getCreatedBy() {
return this.createdBy;
}
/**
*
*/
@Override
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
*
*/
@Override
public Date getCreatedDtm() {
return this.createdDtm;
}
/**
*
*/
@Override
public void setCreatedDtm(Date createdDtm) {
this.createdDtm = createdDtm;
}
/**
* @return lastModifiedBy
*/
@Override
public String getLastModifiedBy() {
return this.lastModifiedBy;
}
/**
* @param lastModifiedDtm
*/
@Override
public void setLastModifiedBy(String lastModifiedBy) {
this.lastModifiedBy = lastModifiedBy;
}
/**
* @return lastModifiedDtm
*/
@Override
public Date getLastModifiedDtm() {
return this.lastModifiedDtm;
}
/**
* @param lastModifiedDtm
*/
@Override
public void setLastModifiedDtm(Date lastModifiedDtm) {
this.lastModifiedDtm = lastModifiedDtm;
}
/* (non-Javadoc)
* @see gov.va.med.pharmacy.peps.domain.common.model.DataObject#toString()
*/
@Override
public String toString() {
return "EplFdbDrugIngredientDo [fdbDrugIngredient=" + fdbDrugIngredient
+ ", eplDrugIngredientFk=" + eplDrugIngredientFk + ", createdBy=" + createdBy + ", createdDtm=" + createdDtm
+ ", " + "lastModifiedBy=" + lastModifiedBy + ", lastModifiedDtm=" + lastModifiedDtm + "]";
}
/* (non-Javadoc)
* @see gov.va.med.pharmacy.peps.domain.common.model.DataObject#hashCode()
*/
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((createdBy == null) ? 0 : createdBy.hashCode());
result = prime * result + ((createdDtm == null) ? 0 : createdDtm.hashCode());
result = prime * result + ((fdbDrugIngredient == null) ? 0 : fdbDrugIngredient.hashCode());
result = prime * result + ((eplDrugIngredientFk == null) ? 0 : eplDrugIngredientFk.hashCode());
result = prime * result + ((lastModifiedBy == null) ? 0 : lastModifiedBy.hashCode());
result = prime * result + ((lastModifiedDtm == null) ? 0 : lastModifiedDtm.hashCode());
return result;
}
/* (non-Javadoc)
* @see gov.va.med.pharmacy.peps.domain.common.model.DataObject#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
EplFdbDrugIngredientDo other = (EplFdbDrugIngredientDo) obj;
if (createdBy == null) {
if (other.createdBy != null)
return false;
} else if (!createdBy.equals(other.createdBy))
return false;
if (createdDtm == null) {
if (other.createdDtm != null)
return false;
} else if (!createdDtm.equals(other.createdDtm))
return false;
if (eplDrugIngredientFk == null) {
if (other.eplDrugIngredientFk != null)
return false;
} else if (!eplDrugIngredientFk.equals(other.eplDrugIngredientFk))
return false;
if (fdbDrugIngredient == null) {
if (other.fdbDrugIngredient != null)
return false;
} else if (!fdbDrugIngredient.equals(other.fdbDrugIngredient))
return false;
if (lastModifiedBy == null) {
if (other.lastModifiedBy != null)
return false;
} else if (!lastModifiedBy.equals(other.lastModifiedBy))
return false;
if (lastModifiedDtm == null) {
if (other.lastModifiedDtm != null)
return false;
} else if (!lastModifiedDtm.equals(other.lastModifiedDtm))
return false;
return true;
}
}
| 6,798 | 0.605031 | 0.6015 | 239 | 27.435146 | 26.095314 | 123 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.305439 | false | false |
7
|
206e0314b644fdb6af251c66ead02cc3d66fa371
| 3,934,190,043,694 |
faa6c07de8338881c6b5c27c93e0b977eeb1a203
|
/src/br/com/emmanuelneri/heranca/exercicios/exercicio5/Seguro.java
|
927b39fd326072d6b8aed647600484142af81e0c
|
[] |
no_license
|
emmanuelneri/orientacao-objetos
|
https://github.com/emmanuelneri/orientacao-objetos
|
7ca484cbb4840f15cacd94b06b18363a27358ddb
|
b7e2f6eca78abf6618f3b39bbb5c87306a37e133
|
refs/heads/master
| 2020-04-24T12:44:20.603000 | 2019-04-19T19:01:43 | 2019-04-19T19:01:43 | 171,964,914 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package br.com.emmanuelneri.heranca.exercicios.exercicio5;
public abstract class Seguro extends Servico {
private String apolice;
public Seguro(Cliente cliente, String nome, double valor) {
super(cliente, nome, valor);
}
public String getApolice() {
return apolice;
}
public void setApolice(String apolice) {
this.apolice = apolice;
}
}
|
UTF-8
|
Java
| 394 |
java
|
Seguro.java
|
Java
|
[
{
"context": "package br.com.emmanuelneri.heranca.exercicios.exercicio5;\n\npublic abstract c",
"end": 27,
"score": 0.978995144367218,
"start": 15,
"tag": "USERNAME",
"value": "emmanuelneri"
}
] | null |
[] |
package br.com.emmanuelneri.heranca.exercicios.exercicio5;
public abstract class Seguro extends Servico {
private String apolice;
public Seguro(Cliente cliente, String nome, double valor) {
super(cliente, nome, valor);
}
public String getApolice() {
return apolice;
}
public void setApolice(String apolice) {
this.apolice = apolice;
}
}
| 394 | 0.670051 | 0.667513 | 18 | 20.888889 | 21.273064 | 63 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.5 | false | false |
7
|
259842ff4b2c30948b98b5652d961e3090c5fbbf
| 16,106,127,375,530 |
4e4a4d694ab61dbff32787940e1a6bc66cdd81c0
|
/PetCare System/src/control/PessoaControl.java
|
11a4c357a888236c4a3d9b0ac20476abe892fe8b
|
[] |
no_license
|
uhconst/PetCare
|
https://github.com/uhconst/PetCare
|
7205330467bc70d1051803ce23ec50b0525d628d
|
f408bbbad4d1641c4582326c898632f0135b5e28
|
refs/heads/master
| 2021-01-12T08:26:55.702000 | 2017-02-02T00:33:32 | 2017-02-02T00:33:32 | 76,578,870 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package control;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.List;
import model.dao.PessoaDao;
import model.domain.Email;
import model.domain.Pessoa;
import model.domain.Telefone;
import org.jdesktop.observablecollections.ObservableCollections;
/**
*
* @author Constancio
*/
public class PessoaControl{
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
private Pessoa pessoaDigitado;
private Pessoa pessoaSelecionado;
private List<Pessoa> pessoasTabela;
private final PessoaDao pessoaDao;
public PessoaControl(){
pessoaDao = new PessoaDao();
pessoasTabela = ObservableCollections.observableList( new ArrayList<Pessoa>() );
novo();
pesquisar();
}
public void pesquisar(){
pessoasTabela.clear();
pessoasTabela.addAll(pessoaDao.pesquisar(pessoaDigitado));
}
public void salvar(){
//System.out.println("\nBotao salvar, dendo do control, data: " + pessoaDigitado.getNascimento());
//pessoaDigitado.novoEmail();
/*
* Tendo que setar o email como null primeiro, senão ele nao dava o
* commit no Dao.
*/
pessoaDigitado.setEmail( null);
//pessoaSelecionado.setEmail( null); //testeee
pessoaDao.salvarAtualizar( pessoaDigitado );
//pessoaDigitado.setEmail( new Email() ); //teste
novo();
pesquisar();
}
public void excluir(){
/* Setando os Telefones e emails como null, pq senão ao excluir
* primeiro o telefone, e email, quando exclui a pessoa ele ta vinculado
* a um telefone email não mais existente, caindo em uma excpetion e só
* não excluia a Pessoa. Setando como Null antes resolve o problema.
*/
//pessoaSelecionado.setEmails( null);
pessoaSelecionado.setTelefones( null);
pessoaDao.excluir( pessoaSelecionado );
novo();
pesquisar();
}
public void novo(){
setPessoaDigitado( new Pessoa() );
}
public Pessoa getPessoaDigitado(){
//System.out.println("\nPessoaDigitada: "+ pessoaDigitado.getNome() );
return pessoaDigitado;
}
public void setPessoaDigitado( Pessoa pessoaDigitado ){
Pessoa oldPessoaDigitado = this.pessoaDigitado;
this.pessoaDigitado = pessoaDigitado;
propertyChangeSupport.firePropertyChange( "pessoaDigitado", oldPessoaDigitado, pessoaDigitado);
}
public Pessoa getPessoaSelecionado(){
//System.out.println("\nPessoaSelecionada: "+ pessoaSelecionado.getNome() );
return pessoaSelecionado;
}
public void setPessoaSelecionado( Pessoa pessoaSelecionado ){
this.pessoaSelecionado = pessoaSelecionado;
if( this.pessoaSelecionado != null ){
setPessoaDigitado(pessoaSelecionado);
}
}
//test
/*public void teste(){
//test
//this.pessoaSelecionado.getAllEmails();
}*/
public List<Pessoa> getPessoasTabela(){
return pessoasTabela;
}
public void setPessoasTabela( List<Pessoa> pessoasTabela ){
this.pessoasTabela = pessoasTabela;
}
/*
* Retorna a lista de emails associada a pessoa que estara
* sendo excluida. Para assim excluir os emails tambem.
*//*
public List<Email> getEmailList(){
return pessoaSelecionado.getEmails();
}*/
public Email getEmail(){
return pessoaSelecionado.getEmail();
}
/*
* Retorna o email digitado para Salvar() o email.
*/
public Email getEmailDigitado(){
return pessoaDigitado.getEmail();
}
/*
* Retorna a lista de telefones associada a pessoa que estara
* sendo excluida. Para assim excluir os telefones tambem.
*/
public List<Telefone> getTelefoneList(){
return pessoaSelecionado.getTelefones();
}
public void addPropertyChangeListener(PropertyChangeListener e){
propertyChangeSupport.addPropertyChangeListener( e );
}
public void removePropertyChangeListener(PropertyChangeListener e) {
propertyChangeSupport.removePropertyChangeListener(e);
}
public void testPodeApagar(){
System.out.println("Email digitado dentro da classe pessoa: "+pessoaDigitado.getEmail().getEndereco_email());
//pessoaDigitado.getEmail();
//System.out.println("Pessoa digitado dentro da classe pessoa: "+pessoaDigitado.getNome());
}
}
|
UTF-8
|
Java
| 4,832 |
java
|
PessoaControl.java
|
Java
|
[
{
"context": "lections.ObservableCollections;\n\n/**\n *\n * @author Constancio\n */\npublic class PessoaControl{\n \n priv",
"end": 544,
"score": 0.9985777735710144,
"start": 534,
"tag": "NAME",
"value": "Constancio"
}
] | null |
[] |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package control;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.util.ArrayList;
import java.util.List;
import model.dao.PessoaDao;
import model.domain.Email;
import model.domain.Pessoa;
import model.domain.Telefone;
import org.jdesktop.observablecollections.ObservableCollections;
/**
*
* @author Constancio
*/
public class PessoaControl{
private final PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
private Pessoa pessoaDigitado;
private Pessoa pessoaSelecionado;
private List<Pessoa> pessoasTabela;
private final PessoaDao pessoaDao;
public PessoaControl(){
pessoaDao = new PessoaDao();
pessoasTabela = ObservableCollections.observableList( new ArrayList<Pessoa>() );
novo();
pesquisar();
}
public void pesquisar(){
pessoasTabela.clear();
pessoasTabela.addAll(pessoaDao.pesquisar(pessoaDigitado));
}
public void salvar(){
//System.out.println("\nBotao salvar, dendo do control, data: " + pessoaDigitado.getNascimento());
//pessoaDigitado.novoEmail();
/*
* Tendo que setar o email como null primeiro, senão ele nao dava o
* commit no Dao.
*/
pessoaDigitado.setEmail( null);
//pessoaSelecionado.setEmail( null); //testeee
pessoaDao.salvarAtualizar( pessoaDigitado );
//pessoaDigitado.setEmail( new Email() ); //teste
novo();
pesquisar();
}
public void excluir(){
/* Setando os Telefones e emails como null, pq senão ao excluir
* primeiro o telefone, e email, quando exclui a pessoa ele ta vinculado
* a um telefone email não mais existente, caindo em uma excpetion e só
* não excluia a Pessoa. Setando como Null antes resolve o problema.
*/
//pessoaSelecionado.setEmails( null);
pessoaSelecionado.setTelefones( null);
pessoaDao.excluir( pessoaSelecionado );
novo();
pesquisar();
}
public void novo(){
setPessoaDigitado( new Pessoa() );
}
public Pessoa getPessoaDigitado(){
//System.out.println("\nPessoaDigitada: "+ pessoaDigitado.getNome() );
return pessoaDigitado;
}
public void setPessoaDigitado( Pessoa pessoaDigitado ){
Pessoa oldPessoaDigitado = this.pessoaDigitado;
this.pessoaDigitado = pessoaDigitado;
propertyChangeSupport.firePropertyChange( "pessoaDigitado", oldPessoaDigitado, pessoaDigitado);
}
public Pessoa getPessoaSelecionado(){
//System.out.println("\nPessoaSelecionada: "+ pessoaSelecionado.getNome() );
return pessoaSelecionado;
}
public void setPessoaSelecionado( Pessoa pessoaSelecionado ){
this.pessoaSelecionado = pessoaSelecionado;
if( this.pessoaSelecionado != null ){
setPessoaDigitado(pessoaSelecionado);
}
}
//test
/*public void teste(){
//test
//this.pessoaSelecionado.getAllEmails();
}*/
public List<Pessoa> getPessoasTabela(){
return pessoasTabela;
}
public void setPessoasTabela( List<Pessoa> pessoasTabela ){
this.pessoasTabela = pessoasTabela;
}
/*
* Retorna a lista de emails associada a pessoa que estara
* sendo excluida. Para assim excluir os emails tambem.
*//*
public List<Email> getEmailList(){
return pessoaSelecionado.getEmails();
}*/
public Email getEmail(){
return pessoaSelecionado.getEmail();
}
/*
* Retorna o email digitado para Salvar() o email.
*/
public Email getEmailDigitado(){
return pessoaDigitado.getEmail();
}
/*
* Retorna a lista de telefones associada a pessoa que estara
* sendo excluida. Para assim excluir os telefones tambem.
*/
public List<Telefone> getTelefoneList(){
return pessoaSelecionado.getTelefones();
}
public void addPropertyChangeListener(PropertyChangeListener e){
propertyChangeSupport.addPropertyChangeListener( e );
}
public void removePropertyChangeListener(PropertyChangeListener e) {
propertyChangeSupport.removePropertyChangeListener(e);
}
public void testPodeApagar(){
System.out.println("Email digitado dentro da classe pessoa: "+pessoaDigitado.getEmail().getEndereco_email());
//pessoaDigitado.getEmail();
//System.out.println("Pessoa digitado dentro da classe pessoa: "+pessoaDigitado.getNome());
}
}
| 4,832 | 0.661487 | 0.661487 | 155 | 30.141935 | 27.295147 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.43871 | false | false |
7
|
6d5180618aa5c96e1ad8e1425ff314d7c99df9e0
| 5,540,507,843,564 |
366ddab5ab5a2d71f48184469a50bfb3309c7d8b
|
/commons/com.ibm.commons.xml/src/main/java/com/ibm/commons/xml/xpath/xml/XmlComplexExpression.java
|
4ea4fc3fe509b8487a3f4b113a8edf7f25f3e4fc
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
amanb87/SocialSDK
|
https://github.com/amanb87/SocialSDK
|
6544dbbac93c9f95e0d5dcc2ebf49d17ff7425ee
|
c9c02d449c296ba6648dc14ecf8ef67cb55e656c
|
refs/heads/master
| 2020-08-06T19:38:43.071000 | 2017-03-07T10:13:06 | 2017-03-07T10:13:06 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* © Copyright IBM Corp. 2012
*
* 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.
*/
/*
* Created on June 14, 2005
*
*/
package com.ibm.commons.xml.xpath.xml;
import java.util.Iterator;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.ibm.commons.xml.DOMUtil;
import com.ibm.commons.xml.NamespaceContext;
import com.ibm.commons.xml.XMLException;
import com.ibm.commons.xml.XPathContext;
import com.ibm.commons.xml.XResult;
import com.ibm.commons.xml.drivers.XMLParserDriver;
import com.ibm.commons.xml.xpath.AbstractExpression;
import com.ibm.commons.xml.xpath.XPathException;
/**
* @author Mark Wallace
* @author Eugene Konstantinov
*/
public class XmlComplexExpression extends AbstractExpression {
private XMLParserDriver domDriver;
private Object compiledXPath;
/**
* @param expression
*/
public XmlComplexExpression(XMLParserDriver domDriver, String expression, Object compiledXPath) {
super(expression);
this.domDriver = domDriver;
this.compiledXPath = compiledXPath;
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#supportsXPathContext()
*/
public boolean supportsXPathContext() {
return true;
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#pushXPathContext(java.lang.Object)
*/
public void pushXPathContext(Object node) throws XPathException {
try {
Document document = getDocument(node);
DOMUtil.pushXPathContext(document, getExpression());
}
catch (XMLException xe) {
throw new XPathException(xe);
}
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#popXPathContext(java.lang.Object)
*/
public void popXPathContext(Object node) throws XPathException {
try {
Document document = getDocument(node);
XPathContext context = DOMUtil.getXPathContext(document);
if (context != null && context.getExpression().equals(getExpression())) {
DOMUtil.popXPathContext(document);
}
}
catch (XMLException xe) {
throw new XPathException(xe);
}
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.AbstractExpression#resolveNamespaceContext(java.lang.Object, com.ibm.commons.xml.NamespaceContext)
*/
public NamespaceContext resolveNamespaceContext(Object node, NamespaceContext ns) {
return Utils.resolveNamespaceContext((Node)node, ns);
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#isValid(java.lang.Object)
*/
public boolean isValid(Object node) {
return false;
}
public Object valueOf(Object node) {
return node;
}
/* (non-Javadoc)
* @see com.ibm.xfaces.xpath.XPathExpression#isReadOnly(java.lang.Object)
*/
public boolean isReadOnly(Object node) {
return false;
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#isSimple()
*/
public boolean isSimple() {
return false;
}
public boolean isFromRoot() {
return getExpression().startsWith("/");
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#eval(java.lang.Object)
*/
protected XResult doEval(Object node, NamespaceContext namespaceContext) throws XPathException {
if (node instanceof Document) {
Document document = (Document)node;
XPathContext pathContext = DOMUtil.getXPathContext(document);
if (pathContext != null) {
node = pathContext.getContextNodes();
// create the context nodes if they don't exist
if (node == null) {
try {
pathContext.createNodes();
}
catch (XMLException xe) {
throw new XPathException(xe);
}
node = pathContext.getContextNodes();
}
}
}
if (node == null) {
throw new XPathException(new NullPointerException("Cannot evaluate an XPath on a null object")); // $NLS-XmlComplexExpression.CannotevaluateanXPathonanullobjec-1$
}
// WARN: Xerces is having Node also implementing NodeList
// We first check Node to be sure.
if (node instanceof Node) {
Node nodeObj = (Node)node;
namespaceContext = resolveNamespaceContext(nodeObj,namespaceContext);
return domDriver.evaluateXPath(nodeObj,compiledXPath,namespaceContext);
}
if (node instanceof NodeList) {
NodeList nodeList = (NodeList)node;
namespaceContext = resolveNamespaceContext(nodeList.item(0),namespaceContext);
XResult r = domDriver.evaluateXPath(nodeList,compiledXPath,namespaceContext);
return r;
}
throw new XPathException(null,"Try to evaluate an XPath on a object that is not a node or a node list"); // $NLS-XmlComplexExpression.TrytoevaluateanXPathonaobjectthat-1$
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#createNodes(java.lang.Object,
* java.lang.Object)
*/
protected Object doCreateNodes(Object node, NamespaceContext namespaceContext)
throws XPathException {
throw new XPathException(null,"CREATE nodes not supported by complex expressions."); // $NLS-XmlComplexExpression.CREATEnodesnotsupportedbycomplexe-1$
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#setValue(java.lang.Object,
* java.lang.Object)
*/
protected void doSetValue(Object node, Object value, NamespaceContext nsContext, boolean autoCreate) throws XPathException {
if (node == null) {
throw new XPathException(new NullPointerException("Cannot set a value on a null object")); // $NLS-XmlComplexExpression.Cannotsetavalueonanullobject-1$
}
if (!(node instanceof Node)) {
throw new XPathException(null,"Try to evaluate to set a value on a object that is not a node"); // $NLS-XmlComplexExpression.Trytoevaluatetosetavalueonaobject-1$
}
Node nodeObj = (Node)node;
nsContext = resolveNamespaceContext(nodeObj,nsContext);
XResult r = domDriver.evaluateXPath(nodeObj,compiledXPath,nsContext);
if(r.isEmpty()) {
throw new XPathException(null,"Cannot create XPath {0}",getExpression()); // $NLS-XmlComplexExpression.CannotcreateXPath0-1$
}
if(r.isValue()) {
throw new XPathException(null,"Cannot set a value on a value result, XPath={0}",getExpression()); // $NLS-XmlComplexExpression.CannotsetavalueonavalueresultXPat-1$
}
String strValue = Utils.getAsString(value);
for( Iterator it=r.getNodeIterator(); it.hasNext(); ) {
Object n = (Object)it.next();
if( n instanceof Node ) {
DOMUtil.setTextValue((Node)n, strValue);
}
}
}
protected Document getDocument(Object node) throws XMLException {
if (node instanceof Document) {
return (Document)node;
}
return ((Node)node).getOwnerDocument();
}
}
|
UTF-8
|
Java
| 7,961 |
java
|
XmlComplexExpression.java
|
Java
|
[
{
"context": ".commons.xml.xpath.XPathException;\n\n/**\n * @author Mark Wallace\n * @author Eugene Konstantinov\n */\npublic class X",
"end": 1175,
"score": 0.999856173992157,
"start": 1163,
"tag": "NAME",
"value": "Mark Wallace"
},
{
"context": "Exception;\n\n/**\n * @author Mark Wallace\n * @author Eugene Konstantinov\n */\npublic class XmlComplexExpression extends Abs",
"end": 1206,
"score": 0.9998161792755127,
"start": 1187,
"tag": "NAME",
"value": "Eugene Konstantinov"
}
] | null |
[] |
/*
* © Copyright IBM Corp. 2012
*
* 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.
*/
/*
* Created on June 14, 2005
*
*/
package com.ibm.commons.xml.xpath.xml;
import java.util.Iterator;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.ibm.commons.xml.DOMUtil;
import com.ibm.commons.xml.NamespaceContext;
import com.ibm.commons.xml.XMLException;
import com.ibm.commons.xml.XPathContext;
import com.ibm.commons.xml.XResult;
import com.ibm.commons.xml.drivers.XMLParserDriver;
import com.ibm.commons.xml.xpath.AbstractExpression;
import com.ibm.commons.xml.xpath.XPathException;
/**
* @author <NAME>
* @author <NAME>
*/
public class XmlComplexExpression extends AbstractExpression {
private XMLParserDriver domDriver;
private Object compiledXPath;
/**
* @param expression
*/
public XmlComplexExpression(XMLParserDriver domDriver, String expression, Object compiledXPath) {
super(expression);
this.domDriver = domDriver;
this.compiledXPath = compiledXPath;
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#supportsXPathContext()
*/
public boolean supportsXPathContext() {
return true;
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#pushXPathContext(java.lang.Object)
*/
public void pushXPathContext(Object node) throws XPathException {
try {
Document document = getDocument(node);
DOMUtil.pushXPathContext(document, getExpression());
}
catch (XMLException xe) {
throw new XPathException(xe);
}
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#popXPathContext(java.lang.Object)
*/
public void popXPathContext(Object node) throws XPathException {
try {
Document document = getDocument(node);
XPathContext context = DOMUtil.getXPathContext(document);
if (context != null && context.getExpression().equals(getExpression())) {
DOMUtil.popXPathContext(document);
}
}
catch (XMLException xe) {
throw new XPathException(xe);
}
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.AbstractExpression#resolveNamespaceContext(java.lang.Object, com.ibm.commons.xml.NamespaceContext)
*/
public NamespaceContext resolveNamespaceContext(Object node, NamespaceContext ns) {
return Utils.resolveNamespaceContext((Node)node, ns);
}
/* (non-Javadoc)
* @see com.ibm.commons.xml.xpath.XPathExpression#isValid(java.lang.Object)
*/
public boolean isValid(Object node) {
return false;
}
public Object valueOf(Object node) {
return node;
}
/* (non-Javadoc)
* @see com.ibm.xfaces.xpath.XPathExpression#isReadOnly(java.lang.Object)
*/
public boolean isReadOnly(Object node) {
return false;
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#isSimple()
*/
public boolean isSimple() {
return false;
}
public boolean isFromRoot() {
return getExpression().startsWith("/");
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#eval(java.lang.Object)
*/
protected XResult doEval(Object node, NamespaceContext namespaceContext) throws XPathException {
if (node instanceof Document) {
Document document = (Document)node;
XPathContext pathContext = DOMUtil.getXPathContext(document);
if (pathContext != null) {
node = pathContext.getContextNodes();
// create the context nodes if they don't exist
if (node == null) {
try {
pathContext.createNodes();
}
catch (XMLException xe) {
throw new XPathException(xe);
}
node = pathContext.getContextNodes();
}
}
}
if (node == null) {
throw new XPathException(new NullPointerException("Cannot evaluate an XPath on a null object")); // $NLS-XmlComplexExpression.CannotevaluateanXPathonanullobjec-1$
}
// WARN: Xerces is having Node also implementing NodeList
// We first check Node to be sure.
if (node instanceof Node) {
Node nodeObj = (Node)node;
namespaceContext = resolveNamespaceContext(nodeObj,namespaceContext);
return domDriver.evaluateXPath(nodeObj,compiledXPath,namespaceContext);
}
if (node instanceof NodeList) {
NodeList nodeList = (NodeList)node;
namespaceContext = resolveNamespaceContext(nodeList.item(0),namespaceContext);
XResult r = domDriver.evaluateXPath(nodeList,compiledXPath,namespaceContext);
return r;
}
throw new XPathException(null,"Try to evaluate an XPath on a object that is not a node or a node list"); // $NLS-XmlComplexExpression.TrytoevaluateanXPathonaobjectthat-1$
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#createNodes(java.lang.Object,
* java.lang.Object)
*/
protected Object doCreateNodes(Object node, NamespaceContext namespaceContext)
throws XPathException {
throw new XPathException(null,"CREATE nodes not supported by complex expressions."); // $NLS-XmlComplexExpression.CREATEnodesnotsupportedbycomplexe-1$
}
/*
* (non-Javadoc)
*
* @see com.ibm.xfaces.xpath.XPathExpression#setValue(java.lang.Object,
* java.lang.Object)
*/
protected void doSetValue(Object node, Object value, NamespaceContext nsContext, boolean autoCreate) throws XPathException {
if (node == null) {
throw new XPathException(new NullPointerException("Cannot set a value on a null object")); // $NLS-XmlComplexExpression.Cannotsetavalueonanullobject-1$
}
if (!(node instanceof Node)) {
throw new XPathException(null,"Try to evaluate to set a value on a object that is not a node"); // $NLS-XmlComplexExpression.Trytoevaluatetosetavalueonaobject-1$
}
Node nodeObj = (Node)node;
nsContext = resolveNamespaceContext(nodeObj,nsContext);
XResult r = domDriver.evaluateXPath(nodeObj,compiledXPath,nsContext);
if(r.isEmpty()) {
throw new XPathException(null,"Cannot create XPath {0}",getExpression()); // $NLS-XmlComplexExpression.CannotcreateXPath0-1$
}
if(r.isValue()) {
throw new XPathException(null,"Cannot set a value on a value result, XPath={0}",getExpression()); // $NLS-XmlComplexExpression.CannotsetavalueonavalueresultXPat-1$
}
String strValue = Utils.getAsString(value);
for( Iterator it=r.getNodeIterator(); it.hasNext(); ) {
Object n = (Object)it.next();
if( n instanceof Node ) {
DOMUtil.setTextValue((Node)n, strValue);
}
}
}
protected Document getDocument(Object node) throws XMLException {
if (node instanceof Document) {
return (Document)node;
}
return ((Node)node).getOwnerDocument();
}
}
| 7,942 | 0.641583 | 0.638065 | 224 | 34.535713 | 36.026508 | 178 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.477679 | false | false |
7
|
41876d1c3748cc2f8cc1f375aae1874374904b98
| 13,580,686,618,827 |
98a56f321a420d49a3da16c7efc9ee45bc00ca09
|
/Disciplina de Programacao 1/Segunda Lista/ex07.java
|
3b2a6b4cb51febd795906f9bfb476234cf2f86f0
|
[] |
no_license
|
Darlley/Java
|
https://github.com/Darlley/Java
|
4cefaea1fba5c8d7b767aedc8fe24a6c3da152c7
|
1a0b714464c450100ed5d99546f16d056b1c4bce
|
refs/heads/master
| 2023-08-15T00:51:56.882000 | 2021-09-16T21:24:14 | 2021-09-16T21:24:14 | 138,891,281 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
public class ex07{
public static void main(String[] args){
String nome1 = Input.readString("Informe o nome da primeira pessoa: ");
double peso1 = Input.readDouble("Informe o peso da primeira pessoa: ");
double altura1 = Input.readDouble("Informe a altura da primeira pessoa: ");
String nome2 = Input.readString("Informe o nome da segunda pessoa: ");
double peso2 = Input.readDouble("Informe o peso da segunda pessoa: ");
double altura2 = Input.readDouble("Informe a altura da segunda pessoa: ");
if(peso1 > peso2){
System.out.println(nome1 + "Tem o maior peso!");
}else{
System.out.println(nome2 + "Tem o maior peso!");
}
if(altura1 > altura2){
System.out.println(nome1 + "Tem a maior altura!");
}else{
System.out.println(nome2 + "Tem a maior altura!");
}
}
}
|
UTF-8
|
Java
| 843 |
java
|
ex07.java
|
Java
|
[] | null |
[] |
public class ex07{
public static void main(String[] args){
String nome1 = Input.readString("Informe o nome da primeira pessoa: ");
double peso1 = Input.readDouble("Informe o peso da primeira pessoa: ");
double altura1 = Input.readDouble("Informe a altura da primeira pessoa: ");
String nome2 = Input.readString("Informe o nome da segunda pessoa: ");
double peso2 = Input.readDouble("Informe o peso da segunda pessoa: ");
double altura2 = Input.readDouble("Informe a altura da segunda pessoa: ");
if(peso1 > peso2){
System.out.println(nome1 + "Tem o maior peso!");
}else{
System.out.println(nome2 + "Tem o maior peso!");
}
if(altura1 > altura2){
System.out.println(nome1 + "Tem a maior altura!");
}else{
System.out.println(nome2 + "Tem a maior altura!");
}
}
}
| 843 | 0.652432 | 0.633452 | 23 | 35.47826 | 30.292587 | 79 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.434783 | false | false |
7
|
d51136e7eba1791118908663d782eae5ff195e6f
| 33,079,838,129,035 |
e05543862c21c6605ea45d4b1f37d64e07d1406d
|
/src/main/java/com/example/PersonRepostroy.java
|
de4acb3d8ddb56ad8b92a4ac511d32c3339b01c9
|
[] |
no_license
|
pkpk1234/DataJpaTestSample
|
https://github.com/pkpk1234/DataJpaTestSample
|
159c349d3f008996ed7151966c41a05deb2de824
|
638eb75ccaf1f545ff5cf46b6186ffc4f4557f01
|
refs/heads/master
| 2021-01-20T07:52:11.540000 | 2017-05-03T13:53:59 | 2017-05-03T13:53:59 | 90,057,926 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by pkpk1234 on 2017/5/3.
*/
@Repository
public interface PersonRepostroy extends JpaRepository<Person,Long> {
}
|
UTF-8
|
Java
| 263 |
java
|
PersonRepostroy.java
|
Java
|
[
{
"context": "ramework.stereotype.Repository;\n\n/**\n * Created by pkpk1234 on 2017/5/3.\n */\n@Repository\npublic interface Per",
"end": 161,
"score": 0.9995207786560059,
"start": 153,
"tag": "USERNAME",
"value": "pkpk1234"
}
] | null |
[] |
package com.example;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
/**
* Created by pkpk1234 on 2017/5/3.
*/
@Repository
public interface PersonRepostroy extends JpaRepository<Person,Long> {
}
| 263 | 0.798479 | 0.760456 | 11 | 22.90909 | 24.999834 | 69 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.363636 | false | false |
7
|
ee727a22e74ad9f49fe5887212e5991c642824ca
| 33,079,838,129,524 |
473c4c9390c56632f4600a8d12410712895a9c76
|
/src/test/java/com/kapoorlabs/kiara/test/objects/SurveyTestObject.java
|
6dcf8dd1a7bdb9419bd707a2003405bcb50daabb
|
[
"Apache-2.0"
] |
permissive
|
kapoorlabs/kiara
|
https://github.com/kapoorlabs/kiara
|
6d54eb061e5e6d62ab0ebe48c0aa04a24508d1f7
|
40d11fb7e8d295c374f63d0e3b83d553d5374736
|
refs/heads/develop
| 2022-07-11T09:23:14.855000 | 2022-05-28T22:50:24 | 2022-05-28T22:50:24 | 247,748,485 | 14 | 0 |
Apache-2.0
| false | 2022-05-28T22:56:50 | 2020-03-16T15:34:26 | 2021-10-15T04:48:40 | 2022-05-28T22:56:49 | 2,324 | 13 | 0 | 0 |
Java
| false | false |
package com.kapoorlabs.kiara.test.objects;
import com.kapoorlabs.kiara.domain.annotations.NumericRange;
import lombok.Data;
@Data
public class SurveyTestObject {
private Long respondentId;
private String gender;
@NumericRange
private String ageRange;
@NumericRange
private String incomeRange;
private String education;
private String location;
}
|
UTF-8
|
Java
| 364 |
java
|
SurveyTestObject.java
|
Java
|
[] | null |
[] |
package com.kapoorlabs.kiara.test.objects;
import com.kapoorlabs.kiara.domain.annotations.NumericRange;
import lombok.Data;
@Data
public class SurveyTestObject {
private Long respondentId;
private String gender;
@NumericRange
private String ageRange;
@NumericRange
private String incomeRange;
private String education;
private String location;
}
| 364 | 0.796703 | 0.796703 | 24 | 14.166667 | 16.144314 | 60 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.708333 | false | false |
7
|
aebe69e5407a34c5d8661464070a4f814d8effeb
| 25,323,127,246,278 |
32172141876254be031a9f44d28a7d2eaed1f047
|
/src/main/java/com/codegym/controller/ProductController.java
|
dbb20a2974decfd485ab3af7cdd5c6ee868b8018
|
[] |
no_license
|
linh-phamdang21/app_ecommerce
|
https://github.com/linh-phamdang21/app_ecommerce
|
0ec157dc45148311d6a0701a571cf523a3385900
|
e8fc11af420d08a4c6bdf9c257e45a27a2dca154
|
refs/heads/master
| 2022-11-13T09:22:51.304000 | 2020-06-26T08:01:49 | 2020-06-26T08:01:49 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.codegym.controller;
import com.codegym.model.Brand;
import com.codegym.model.Category;
import com.codegym.model.Product;
import com.codegym.service.Brand.IBrandService;
import com.codegym.model.ProductType;
import com.codegym.repository.ITypeReposity;
import com.codegym.service.category.ICategoryService;
import com.codegym.service.product.IProduceService;
import com.codegym.service.type.IProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.Optional;
@Controller
@RequestMapping("/admin/product")
public class ProductController {
@Autowired
private IProduceService produceService;
@Autowired
private ICategoryService categoryService;
@Autowired
private IBrandService brandService;
@Autowired
Environment env;
@ModelAttribute("brand")
public Iterable<Brand> brands() {
return brandService.findAll();
}
@Autowired
private IProductTypeService typeService;
@ModelAttribute("categories")
public Iterable<Category> categories() {
return categoryService.findAll();
}
@ModelAttribute("types")
public Iterable<ProductType> types() {
return typeService.findAll();
}
@GetMapping("/list")
public ModelAndView listProduct(@RequestParam("s") Optional<String> s,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "5") int size) {
Pageable pageable = PageRequest.of(page, size);
Page<Product> products;
if (s.isPresent()) {
products = produceService.findAllByProductNameContaining(s.get(), pageable);
} else {
products = produceService.findAll(pageable);
}
ModelAndView modelAndView = new ModelAndView("product/listProduct");
modelAndView.addObject("products", products);
return modelAndView;
}
@GetMapping("/create-product")
public ModelAndView showCreateProduct() {
ModelAndView modelAndView = new ModelAndView("/product/createProduct");
modelAndView.addObject("product", new Product());
modelAndView.addObject("types", types());
return modelAndView;
}
//
// @PostMapping("/create-product")
// public ModelAndView createProduct(@ModelAttribute Product product) {
// ModelAndView modelAndView = new ModelAndView("/product/createProduct");
// produceService.save(product);
// modelAndView.addObject("message", "create success");
// return modelAndView;
// }
@PostMapping("/create-product")
public ModelAndView saveFile(@ModelAttribute Product product) throws Exception {
ModelAndView modelAndView = new ModelAndView("product/createProduct");
Product product1 = new Product(null,product.getProductName(),product.getPrice(),product.getDescribes(),
product.getCategory(),product.getBrand(),product.getType());
MultipartFile multipartFile = product.getImages();
String fileName= multipartFile.getOriginalFilename();
String fileUpLoad= env.getProperty("file_upload").toString();
try {
FileCopyUtils.copy(product.getImages().getBytes(), new File(fileUpLoad + fileName));
} catch (IOException e) {
e.printStackTrace();
}
product1.setImage(fileName);
Product product2 = produceService.save(product1);
if (product2 == null) {
modelAndView.addObject("message", "errors");
} else {
modelAndView.addObject("message", "ok");
}
modelAndView.addObject("product", new Product());
return modelAndView;
}
@GetMapping("edit-product/{id}")
public ModelAndView showEditProduct(@PathVariable Long id) {
ModelAndView modelAndView = new ModelAndView("/product/editProduct");
Optional<Product> product = produceService.getById(id);
if (product.isPresent()) {
Product product1 = new Product();
product1 = product.get();
modelAndView.addObject("product", product1);
} else {
modelAndView.addObject("product", new Product());
}
return modelAndView;
}
@PostMapping("edit-product")
public ModelAndView editProduct(@ModelAttribute Product products) {
ModelAndView modelAndView = new ModelAndView("/product/editProduct");
if (products.getId() != null) {
modelAndView.addObject("edit", "Edit success");
} else {
modelAndView.addObject("edit", "Edit no success");
}
produceService.save(products);
return modelAndView;
}
@GetMapping("delete-product/{id}")
public ModelAndView deleteProduct(@PathVariable Long id) {
produceService.remove(id);
return new ModelAndView("redirect:/admin/product/list");
}
}
|
UTF-8
|
Java
| 5,495 |
java
|
ProductController.java
|
Java
|
[] | null |
[] |
package com.codegym.controller;
import com.codegym.model.Brand;
import com.codegym.model.Category;
import com.codegym.model.Product;
import com.codegym.service.Brand.IBrandService;
import com.codegym.model.ProductType;
import com.codegym.repository.ITypeReposity;
import com.codegym.service.category.ICategoryService;
import com.codegym.service.product.IProduceService;
import com.codegym.service.type.IProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import java.awt.*;
import java.io.File;
import java.io.IOException;
import java.util.Optional;
@Controller
@RequestMapping("/admin/product")
public class ProductController {
@Autowired
private IProduceService produceService;
@Autowired
private ICategoryService categoryService;
@Autowired
private IBrandService brandService;
@Autowired
Environment env;
@ModelAttribute("brand")
public Iterable<Brand> brands() {
return brandService.findAll();
}
@Autowired
private IProductTypeService typeService;
@ModelAttribute("categories")
public Iterable<Category> categories() {
return categoryService.findAll();
}
@ModelAttribute("types")
public Iterable<ProductType> types() {
return typeService.findAll();
}
@GetMapping("/list")
public ModelAndView listProduct(@RequestParam("s") Optional<String> s,
@RequestParam(defaultValue = "0") int page,
@RequestParam(defaultValue = "5") int size) {
Pageable pageable = PageRequest.of(page, size);
Page<Product> products;
if (s.isPresent()) {
products = produceService.findAllByProductNameContaining(s.get(), pageable);
} else {
products = produceService.findAll(pageable);
}
ModelAndView modelAndView = new ModelAndView("product/listProduct");
modelAndView.addObject("products", products);
return modelAndView;
}
@GetMapping("/create-product")
public ModelAndView showCreateProduct() {
ModelAndView modelAndView = new ModelAndView("/product/createProduct");
modelAndView.addObject("product", new Product());
modelAndView.addObject("types", types());
return modelAndView;
}
//
// @PostMapping("/create-product")
// public ModelAndView createProduct(@ModelAttribute Product product) {
// ModelAndView modelAndView = new ModelAndView("/product/createProduct");
// produceService.save(product);
// modelAndView.addObject("message", "create success");
// return modelAndView;
// }
@PostMapping("/create-product")
public ModelAndView saveFile(@ModelAttribute Product product) throws Exception {
ModelAndView modelAndView = new ModelAndView("product/createProduct");
Product product1 = new Product(null,product.getProductName(),product.getPrice(),product.getDescribes(),
product.getCategory(),product.getBrand(),product.getType());
MultipartFile multipartFile = product.getImages();
String fileName= multipartFile.getOriginalFilename();
String fileUpLoad= env.getProperty("file_upload").toString();
try {
FileCopyUtils.copy(product.getImages().getBytes(), new File(fileUpLoad + fileName));
} catch (IOException e) {
e.printStackTrace();
}
product1.setImage(fileName);
Product product2 = produceService.save(product1);
if (product2 == null) {
modelAndView.addObject("message", "errors");
} else {
modelAndView.addObject("message", "ok");
}
modelAndView.addObject("product", new Product());
return modelAndView;
}
@GetMapping("edit-product/{id}")
public ModelAndView showEditProduct(@PathVariable Long id) {
ModelAndView modelAndView = new ModelAndView("/product/editProduct");
Optional<Product> product = produceService.getById(id);
if (product.isPresent()) {
Product product1 = new Product();
product1 = product.get();
modelAndView.addObject("product", product1);
} else {
modelAndView.addObject("product", new Product());
}
return modelAndView;
}
@PostMapping("edit-product")
public ModelAndView editProduct(@ModelAttribute Product products) {
ModelAndView modelAndView = new ModelAndView("/product/editProduct");
if (products.getId() != null) {
modelAndView.addObject("edit", "Edit success");
} else {
modelAndView.addObject("edit", "Edit no success");
}
produceService.save(products);
return modelAndView;
}
@GetMapping("delete-product/{id}")
public ModelAndView deleteProduct(@PathVariable Long id) {
produceService.remove(id);
return new ModelAndView("redirect:/admin/product/list");
}
}
| 5,495 | 0.679163 | 0.677343 | 155 | 34.451614 | 25.436371 | 111 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.625806 | false | false |
7
|
e0b36717933bbb557c204a247acd0378f3b91ec8
| 14,800,457,334,879 |
d258b5809ca843bf6b64829af0a605e364a7358f
|
/utils/src/main/java/by/kolyall/utils/DrawableUtils.java
|
9e0a06a857dbb8d8f80613e42748740df753e1b5
|
[] |
no_license
|
Kolyall/BaseUtils
|
https://github.com/Kolyall/BaseUtils
|
89bafd87407d6ba6a4375dd1de3cc6116a591c5e
|
c0f549fff4dd4ab071802ad008fcd7889d8dfa35
|
refs/heads/master
| 2021-06-24T11:55:31.211000 | 2019-06-20T07:05:01 | 2019-06-20T07:05:01 | 144,983,622 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package by.kolyall.utils;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.core.content.ContextCompat;
/**
* Created by Nick Unuchek on 22.01.2018.
*/
public class DrawableUtils {
public static Drawable getDrawable(Context context, @DrawableRes int drawableResId, @ColorRes int colorResId) {
Drawable drawable = ContextCompat.getDrawable(context, drawableResId).mutate();
drawable.setColorFilter(ContextCompat.getColor(context, colorResId), PorterDuff.Mode.SRC_ATOP);
return drawable;
}
}
|
UTF-8
|
Java
| 681 |
java
|
DrawableUtils.java
|
Java
|
[
{
"context": "idx.core.content.ContextCompat;\n\n/**\n * Created by Nick Unuchek on 22.01.2018.\n */\n\npublic class DrawableUtils {\n",
"end": 290,
"score": 0.9998658895492554,
"start": 278,
"tag": "NAME",
"value": "Nick Unuchek"
}
] | null |
[] |
package by.kolyall.utils;
import android.content.Context;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import androidx.annotation.ColorRes;
import androidx.annotation.DrawableRes;
import androidx.core.content.ContextCompat;
/**
* Created by <NAME> on 22.01.2018.
*/
public class DrawableUtils {
public static Drawable getDrawable(Context context, @DrawableRes int drawableResId, @ColorRes int colorResId) {
Drawable drawable = ContextCompat.getDrawable(context, drawableResId).mutate();
drawable.setColorFilter(ContextCompat.getColor(context, colorResId), PorterDuff.Mode.SRC_ATOP);
return drawable;
}
}
| 675 | 0.776799 | 0.765051 | 20 | 33.049999 | 33.0779 | 115 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.75 | false | false |
7
|
bdd1eb32e16133ba1e7253f7bffcd379c6d6e66c
| 2,723,009,333,978 |
7ee677655e2243b9927a81c2b3560a3cc39bfdb4
|
/wms-core/src/main/java/com/ffzx/wms/common/PickTaskBizClassNameEnum.java
|
1f61f662ed8925bcd77551d8057e9b7c49520c2f
|
[] |
no_license
|
smyz371/test
|
https://github.com/smyz371/test
|
5e20459539428684e6b9e70eec5784bf30d38b62
|
2ae4af4a25a2c67119e0d51910a81c87c2c654c3
|
refs/heads/master
| 2020-01-27T13:28:10.884000 | 2016-11-22T11:59:40 | 2016-11-22T11:59:40 | 73,365,825 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.ffzx.wms.common;
/**
* 根据拣货任务规则类型对应拣货任务组合算法类名
* @author tao.zhang
*/
public enum PickTaskBizClassNameEnum{
PICK_TASK_BIZ_TYPE_PARTNER("1", "pickTaskBizRulePartner"),
PICK_TASK_BIZ_TYPE_COUNTY("2", "pickTaskBizRuleCounty"),
PICK_TASK_BIZ_TYPE_TOWN("3", "pickTaskBizRuleTown"),
;
private String code;
private String message;
private PickTaskBizClassNameEnum(String code,String message){
this.code = code;
this.message = message;
}
public String getCode() {
return code;
}
public String getMessage() {
return message;
}
public static PickTaskBizClassNameEnum forCode(String code){
for(PickTaskBizClassNameEnum sourceTypeEnum : PickTaskBizClassNameEnum.values()){
if(sourceTypeEnum.getCode().equals(code)){
return sourceTypeEnum;
}
}
return null;
}
}
|
UTF-8
|
Java
| 852 |
java
|
PickTaskBizClassNameEnum.java
|
Java
|
[
{
"context": "s.common;\n/**\n * 根据拣货任务规则类型对应拣货任务组合算法类名\n * @author tao.zhang\n */\npublic enum PickTaskBizClassNameEnum{\n\tPICK_T",
"end": 79,
"score": 0.8192826509475708,
"start": 70,
"tag": "NAME",
"value": "tao.zhang"
}
] | null |
[] |
package com.ffzx.wms.common;
/**
* 根据拣货任务规则类型对应拣货任务组合算法类名
* @author tao.zhang
*/
public enum PickTaskBizClassNameEnum{
PICK_TASK_BIZ_TYPE_PARTNER("1", "pickTaskBizRulePartner"),
PICK_TASK_BIZ_TYPE_COUNTY("2", "pickTaskBizRuleCounty"),
PICK_TASK_BIZ_TYPE_TOWN("3", "pickTaskBizRuleTown"),
;
private String code;
private String message;
private PickTaskBizClassNameEnum(String code,String message){
this.code = code;
this.message = message;
}
public String getCode() {
return code;
}
public String getMessage() {
return message;
}
public static PickTaskBizClassNameEnum forCode(String code){
for(PickTaskBizClassNameEnum sourceTypeEnum : PickTaskBizClassNameEnum.values()){
if(sourceTypeEnum.getCode().equals(code)){
return sourceTypeEnum;
}
}
return null;
}
}
| 852 | 0.732673 | 0.72896 | 35 | 22.085714 | 22.084734 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.657143 | false | false |
7
|
896bb190150ece305bb11e6fd55aef5dd857ecc1
| 27,754,078,669,033 |
a6ae02b1c533fe2516f4fff2fa13be08f26b7317
|
/src/dao/MySqlJugadorDAO.java
|
35f70bca09260b74b5bed401261aef4c8aa218ce
|
[] |
no_license
|
MicK9323/eventos_deportivos_v4
|
https://github.com/MicK9323/eventos_deportivos_v4
|
4a7ef6f9b4c7afc7b3a29a3be894b2a3d9f2afbe
|
f1aa0dc977e258f86ca6188c04cf1824d64ec837
|
refs/heads/master
| 2021-08-23T12:42:20.244000 | 2017-12-04T23:23:35 | 2017-12-04T23:23:35 | 111,183,463 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package dao;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLType;
import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
import javax.sql.rowset.serial.SerialBlob;
import beans.JugadorDTO;
import interfaces.JugadorDAO;
import utils.Conexion;
import utils.Metodos;
public class MySqlJugadorDAO implements JugadorDAO {
Metodos met = new Metodos();
@Override
public String validarJugador(String dni, String codModalidad, String codEvento) throws SQLException {
String alerta = "";
Connection cn = null;
PreparedStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "Select validar(?,?,?)";
cstm = cn.prepareStatement(sql);
cstm.setString(1, dni);
cstm.setString(2, codModalidad);
cstm.setString(3, codEvento);
rs = cstm.executeQuery();
if (rs.next()) {
alerta = rs.getString(1);
}
} catch (SQLException e) {
alerta = e.getMessage();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
alerta = e2.getMessage();
}
}
return alerta;
}
@Override
public JugadorDTO datosJugador(String dni) throws SQLException {
JugadorDTO obj = null;
Connection cn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "{call sp_datosJugador(?)}";
cstm = cn.prepareCall(sql);
cstm.setString(1, dni);
rs = cstm.executeQuery();
obj = new JugadorDTO();
while (rs.next()) {
obj.setDni_jugador(rs.getString(1));
obj.setNom_jugador(rs.getString(2));
obj.setEdad(rs.getInt(3));
obj.setSexo(rs.getString(4));
obj.setNomSede(rs.getString(5));
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return obj;
}
@Override
public List<JugadorDTO> listaJugadores() {
List<JugadorDTO> lista = new ArrayList<JugadorDTO>();
Connection conn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
conn = Conexion.conectar();
String sql = "{ call sp_listaJugadores() }";
cstm = conn.prepareCall(sql);
rs = cstm.executeQuery();
JugadorDTO obj = null;
while (rs.next()) {
obj = new JugadorDTO();
obj.setDni_jugador(rs.getString(1));
obj.setNom_jugador(rs.getString(2));
obj.setEdad(rs.getInt(3));
obj.setSexo(rs.getString(4));
obj.setTelfMovil(rs.getString(5));
obj.setNomSede(rs.getString(6));
obj.setEstado(rs.getInt(7));
lista.add(obj);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return lista;
}
@Override
public String importarJugadores(ArrayList<JugadorDTO> data) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_importarJugador(?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
cstm = conn.prepareCall(sql);
for(JugadorDTO obj : data) {
cstm.setString(1, obj.getDni_jugador());
cstm.setString(2, obj.getClave());
cstm.setInt(3, obj.getIdRol());
cstm.setString(4, obj.getNom_jugador());
cstm.setString(5, obj.getApe_jugador());
cstm.setString(6, obj.getFec_nac());
cstm.setInt(7, obj.getEdad());
cstm.setString(8, obj.getSexo());
cstm.setString(9, obj.getEstCivil());
cstm.setString(10, obj.getTelfDomicilio());
cstm.setString(11, obj.getTelfMovil());
cstm.setString(12, obj.getDomicilio());
cstm.setString(13, obj.getEmail());
cstm.setString(14, obj.getCodSede());
estado = cstm.executeUpdate();
System.out.println(""+estado);
}
if(estado != -1) {
msg = "ok";
System.out.println(msg);
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public String regJugador(JugadorDTO obj) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_regJugador(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
cstm = conn.prepareCall(sql);
Blob blob = null;
String filename= null;
cstm.setString(1, obj.getDni_jugador());
cstm.setString(2, met.codificarBase64(obj.getDni_jugador()));
cstm.setInt(3, obj.getIdRol());
cstm.setString(4, obj.getNom_jugador());
cstm.setString(5, obj.getApe_jugador());
cstm.setString(6, obj.getFec_nac());
cstm.setInt(7, obj.getEdad());
cstm.setString(8, obj.getSexo());
cstm.setString(9, obj.getEstCivil());
cstm.setString(10, obj.getTelfDomicilio());
cstm.setString(11, obj.getTelfMovil());
cstm.setString(12, obj.getDomicilio());
cstm.setString(13, obj.getEmail());
cstm.setString(14, obj.getCodSede());
if(obj.getFotoByte() != null) {
blob = new SerialBlob(obj.getFotoByte());
filename = obj.getFotoFileName();
cstm.setBlob(15, blob);
cstm.setString(16, filename);
}else {
cstm.setNull(15, Types.BLOB);
cstm.setNull(16, Types.VARCHAR);
}
estado = cstm.executeUpdate();
if(estado != -1) {
msg = "ok";
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public String uptJugador(JugadorDTO obj) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_uptJugador(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
cstm = conn.prepareCall(sql);
Blob blob = null;
String filename= null;
cstm.setString(1, obj.getDni_jugador());
cstm.setString(2, met.codificarBase64(obj.getClave()));
cstm.setString(3, obj.getNom_jugador());
cstm.setString(4, obj.getApe_jugador());
cstm.setString(5, obj.getFec_nac());
cstm.setInt(6, obj.getEdad());
cstm.setString(7, obj.getSexo());
cstm.setString(8, obj.getEstCivil());
cstm.setString(9, obj.getTelfDomicilio());
cstm.setString(10, obj.getTelfMovil());
cstm.setString(11, obj.getDomicilio());
cstm.setString(12, obj.getEmail());
cstm.setString(13, obj.getCodSede());
if(obj.getFotoByte() != null) {
blob = new SerialBlob(obj.getFotoByte());
filename = obj.getFotoFileName();
cstm.setBlob(14, blob);
cstm.setString(15, filename);
}else {
cstm.setNull(14, Types.BLOB);
cstm.setNull(15, Types.VARCHAR);
}
System.out.println(obj.getEstado());
cstm.setInt(16, obj.getEstado());
estado = cstm.executeUpdate();
if(estado != -1) {
msg = "ok";
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public String delJugador(String dni) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_delJugador(?) }";
cstm = conn.prepareCall(sql);
cstm.setString(1, dni);
estado = cstm.executeUpdate();
if(estado != -1) {
msg = "ok";
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public JugadorDTO buscarJugador(String dni) {
JugadorDTO obj = null;
Connection cn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "{call sp_buscarJugador(?)}";
cstm = cn.prepareCall(sql);
cstm.setString(1, dni);
rs = cstm.executeQuery();
if(rs.next()) {
obj = new JugadorDTO();
obj.setDni_jugador(rs.getString(1));
obj.setClave(met.decodificarBase64(rs.getString(2)));
obj.setIdRol(rs.getInt(3));
obj.setNom_jugador(rs.getString(4));
obj.setApe_jugador(rs.getString(5));
obj.setFec_nac(rs.getString(6));
obj.setEdad(rs.getInt(7));
obj.setSexo(rs.getString(8));
obj.setEstCivil(rs.getString(9));
obj.setTelfDomicilio(rs.getString(10));
obj.setTelfMovil(rs.getString(11));
obj.setDomicilio(rs.getString(12));
obj.setEmail(rs.getString(13));
obj.setCodSede(rs.getString(14));
obj.setEstado(rs.getInt(15));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return obj;
}
@Override
public JugadorDTO buscarFoto(String dni) {
JugadorDTO obj = null;
Connection cn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "{call sp_buscarFoto(?)}";
cstm = cn.prepareCall(sql);
cstm.setString(1, dni);
rs = cstm.executeQuery();
if(rs.next()) {
obj = new JugadorDTO();
if(rs.getBlob(1)==null) {
obj.setFotoByte(null);
}else {
obj.setFotoByte(rs.getBlob(1).getBytes(1, (int) rs.getBlob(1).length()));
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return obj;
}
}
|
UTF-8
|
Java
| 10,235 |
java
|
MySqlJugadorDAO.java
|
Java
|
[] | null |
[] |
package dao;
import java.sql.Blob;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.SQLType;
import java.sql.Types;
import java.util.ArrayList;
import java.util.List;
import javax.sql.rowset.serial.SerialBlob;
import beans.JugadorDTO;
import interfaces.JugadorDAO;
import utils.Conexion;
import utils.Metodos;
public class MySqlJugadorDAO implements JugadorDAO {
Metodos met = new Metodos();
@Override
public String validarJugador(String dni, String codModalidad, String codEvento) throws SQLException {
String alerta = "";
Connection cn = null;
PreparedStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "Select validar(?,?,?)";
cstm = cn.prepareStatement(sql);
cstm.setString(1, dni);
cstm.setString(2, codModalidad);
cstm.setString(3, codEvento);
rs = cstm.executeQuery();
if (rs.next()) {
alerta = rs.getString(1);
}
} catch (SQLException e) {
alerta = e.getMessage();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
alerta = e2.getMessage();
}
}
return alerta;
}
@Override
public JugadorDTO datosJugador(String dni) throws SQLException {
JugadorDTO obj = null;
Connection cn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "{call sp_datosJugador(?)}";
cstm = cn.prepareCall(sql);
cstm.setString(1, dni);
rs = cstm.executeQuery();
obj = new JugadorDTO();
while (rs.next()) {
obj.setDni_jugador(rs.getString(1));
obj.setNom_jugador(rs.getString(2));
obj.setEdad(rs.getInt(3));
obj.setSexo(rs.getString(4));
obj.setNomSede(rs.getString(5));
}
} catch (SQLException e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return obj;
}
@Override
public List<JugadorDTO> listaJugadores() {
List<JugadorDTO> lista = new ArrayList<JugadorDTO>();
Connection conn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
conn = Conexion.conectar();
String sql = "{ call sp_listaJugadores() }";
cstm = conn.prepareCall(sql);
rs = cstm.executeQuery();
JugadorDTO obj = null;
while (rs.next()) {
obj = new JugadorDTO();
obj.setDni_jugador(rs.getString(1));
obj.setNom_jugador(rs.getString(2));
obj.setEdad(rs.getInt(3));
obj.setSexo(rs.getString(4));
obj.setTelfMovil(rs.getString(5));
obj.setNomSede(rs.getString(6));
obj.setEstado(rs.getInt(7));
lista.add(obj);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return lista;
}
@Override
public String importarJugadores(ArrayList<JugadorDTO> data) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_importarJugador(?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
cstm = conn.prepareCall(sql);
for(JugadorDTO obj : data) {
cstm.setString(1, obj.getDni_jugador());
cstm.setString(2, obj.getClave());
cstm.setInt(3, obj.getIdRol());
cstm.setString(4, obj.getNom_jugador());
cstm.setString(5, obj.getApe_jugador());
cstm.setString(6, obj.getFec_nac());
cstm.setInt(7, obj.getEdad());
cstm.setString(8, obj.getSexo());
cstm.setString(9, obj.getEstCivil());
cstm.setString(10, obj.getTelfDomicilio());
cstm.setString(11, obj.getTelfMovil());
cstm.setString(12, obj.getDomicilio());
cstm.setString(13, obj.getEmail());
cstm.setString(14, obj.getCodSede());
estado = cstm.executeUpdate();
System.out.println(""+estado);
}
if(estado != -1) {
msg = "ok";
System.out.println(msg);
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public String regJugador(JugadorDTO obj) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_regJugador(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
cstm = conn.prepareCall(sql);
Blob blob = null;
String filename= null;
cstm.setString(1, obj.getDni_jugador());
cstm.setString(2, met.codificarBase64(obj.getDni_jugador()));
cstm.setInt(3, obj.getIdRol());
cstm.setString(4, obj.getNom_jugador());
cstm.setString(5, obj.getApe_jugador());
cstm.setString(6, obj.getFec_nac());
cstm.setInt(7, obj.getEdad());
cstm.setString(8, obj.getSexo());
cstm.setString(9, obj.getEstCivil());
cstm.setString(10, obj.getTelfDomicilio());
cstm.setString(11, obj.getTelfMovil());
cstm.setString(12, obj.getDomicilio());
cstm.setString(13, obj.getEmail());
cstm.setString(14, obj.getCodSede());
if(obj.getFotoByte() != null) {
blob = new SerialBlob(obj.getFotoByte());
filename = obj.getFotoFileName();
cstm.setBlob(15, blob);
cstm.setString(16, filename);
}else {
cstm.setNull(15, Types.BLOB);
cstm.setNull(16, Types.VARCHAR);
}
estado = cstm.executeUpdate();
if(estado != -1) {
msg = "ok";
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public String uptJugador(JugadorDTO obj) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_uptJugador(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }";
cstm = conn.prepareCall(sql);
Blob blob = null;
String filename= null;
cstm.setString(1, obj.getDni_jugador());
cstm.setString(2, met.codificarBase64(obj.getClave()));
cstm.setString(3, obj.getNom_jugador());
cstm.setString(4, obj.getApe_jugador());
cstm.setString(5, obj.getFec_nac());
cstm.setInt(6, obj.getEdad());
cstm.setString(7, obj.getSexo());
cstm.setString(8, obj.getEstCivil());
cstm.setString(9, obj.getTelfDomicilio());
cstm.setString(10, obj.getTelfMovil());
cstm.setString(11, obj.getDomicilio());
cstm.setString(12, obj.getEmail());
cstm.setString(13, obj.getCodSede());
if(obj.getFotoByte() != null) {
blob = new SerialBlob(obj.getFotoByte());
filename = obj.getFotoFileName();
cstm.setBlob(14, blob);
cstm.setString(15, filename);
}else {
cstm.setNull(14, Types.BLOB);
cstm.setNull(15, Types.VARCHAR);
}
System.out.println(obj.getEstado());
cstm.setInt(16, obj.getEstado());
estado = cstm.executeUpdate();
if(estado != -1) {
msg = "ok";
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public String delJugador(String dni) {
String msg = "";
Connection conn = null;
CallableStatement cstm = null;
int estado = -1;
try {
conn = Conexion.conectar();
String sql = "{ call sp_delJugador(?) }";
cstm = conn.prepareCall(sql);
cstm.setString(1, dni);
estado = cstm.executeUpdate();
if(estado != -1) {
msg = "ok";
}
} catch (Exception e) {
msg = e.getMessage();
} finally {
try {
if (cstm != null)
cstm.close();
if (conn != null)
conn.close();
} catch (Exception e2) {
msg = e2.getMessage();
}
}
return msg;
}
@Override
public JugadorDTO buscarJugador(String dni) {
JugadorDTO obj = null;
Connection cn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "{call sp_buscarJugador(?)}";
cstm = cn.prepareCall(sql);
cstm.setString(1, dni);
rs = cstm.executeQuery();
if(rs.next()) {
obj = new JugadorDTO();
obj.setDni_jugador(rs.getString(1));
obj.setClave(met.decodificarBase64(rs.getString(2)));
obj.setIdRol(rs.getInt(3));
obj.setNom_jugador(rs.getString(4));
obj.setApe_jugador(rs.getString(5));
obj.setFec_nac(rs.getString(6));
obj.setEdad(rs.getInt(7));
obj.setSexo(rs.getString(8));
obj.setEstCivil(rs.getString(9));
obj.setTelfDomicilio(rs.getString(10));
obj.setTelfMovil(rs.getString(11));
obj.setDomicilio(rs.getString(12));
obj.setEmail(rs.getString(13));
obj.setCodSede(rs.getString(14));
obj.setEstado(rs.getInt(15));
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return obj;
}
@Override
public JugadorDTO buscarFoto(String dni) {
JugadorDTO obj = null;
Connection cn = null;
CallableStatement cstm = null;
ResultSet rs = null;
try {
cn = Conexion.conectar();
String sql = "{call sp_buscarFoto(?)}";
cstm = cn.prepareCall(sql);
cstm.setString(1, dni);
rs = cstm.executeQuery();
if(rs.next()) {
obj = new JugadorDTO();
if(rs.getBlob(1)==null) {
obj.setFotoByte(null);
}else {
obj.setFotoByte(rs.getBlob(1).getBytes(1, (int) rs.getBlob(1).length()));
}
}
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (rs != null)
rs.close();
if (cstm != null)
cstm.close();
if (cn != null)
cn.close();
} catch (Exception e2) {
e2.printStackTrace();
}
}
return obj;
}
}
| 10,235 | 0.614656 | 0.6 | 405 | 24.271605 | 14.747431 | 102 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 3.730864 | false | false |
7
|
f3e84c79dc1fdd55dab5c4b5dff5d1bcd93e0e0d
| 32,710,470,932,338 |
6bc3c6c1c6ac433e467e2cbdb9073d08934d3cbc
|
/15725.java
|
c8301ea41980c8c6ba058ae6d03dd50ba006a1ab
|
[] |
no_license
|
akalswl14/baekjoon
|
https://github.com/akalswl14/baekjoon
|
2fbe0d2b8071c0294e7b6797cf7bf206e981020b
|
ba21b63564b934b9cb8491668086f36a5c32e35b
|
refs/heads/master
| 2022-11-23T06:13:13.597000 | 2022-11-15T14:28:23 | 2022-11-15T14:28:23 | 163,743,355 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main {
static StringTokenizer st;
static String s;
static char tmp;
static int rtn=0;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
st = new StringTokenizer(br.readLine());
s = st.nextToken();
for(int i=0;i<s.length();i++) {
tmp = s.charAt(i);
if(tmp == 'x') {
if(i==0) {
rtn = 1;
}else if(s.charAt(i-1)=='-') {
rtn = -1;
}
else {
rtn = Integer.parseInt(s.substring(0, i));
}
i = s.length()+1;
break;
}
}
bw.write(Integer.toString(rtn));
bw.flush();
bw.close();
}
}
|
UTF-8
|
Java
| 914 |
java
|
15725.java
|
Java
|
[] | null |
[] |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.StringTokenizer;
public class Main {
static StringTokenizer st;
static String s;
static char tmp;
static int rtn=0;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
st = new StringTokenizer(br.readLine());
s = st.nextToken();
for(int i=0;i<s.length();i++) {
tmp = s.charAt(i);
if(tmp == 'x') {
if(i==0) {
rtn = 1;
}else if(s.charAt(i-1)=='-') {
rtn = -1;
}
else {
rtn = Integer.parseInt(s.substring(0, i));
}
i = s.length()+1;
break;
}
}
bw.write(Integer.toString(rtn));
bw.flush();
bw.close();
}
}
| 914 | 0.657549 | 0.648796 | 38 | 23.052631 | 18.532969 | 77 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 2.684211 | false | false |
7
|
71af13bdec41cc08efca03435198dba7d675a5bf
| 17,205,639,054,643 |
26b8ef4e420d420251490b9d2b2f4ca9ed297ac0
|
/src/main/java/com/coupon/demo/exception/BadClaims.java
|
1941ee0174f08fb575d1646e30e52ea0d454663e
|
[] |
no_license
|
3pleFly/CouponProject
|
https://github.com/3pleFly/CouponProject
|
d62c78bf21da6a16805b0954c5b62ee2120a76f6
|
90cbc8d912aa98a3369c716c808e69a5bc306d52
|
refs/heads/master
| 2023-05-12T03:38:43.127000 | 2020-12-09T07:13:41 | 2020-12-09T07:13:41 | 292,624,498 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.coupon.demo.exception;
public class BadClaims extends RuntimeException {
public BadClaims(String message) {
super(message);
}
}
|
UTF-8
|
Java
| 157 |
java
|
BadClaims.java
|
Java
|
[] | null |
[] |
package com.coupon.demo.exception;
public class BadClaims extends RuntimeException {
public BadClaims(String message) {
super(message);
}
}
| 157 | 0.713376 | 0.713376 | 7 | 21.428572 | 18.290178 | 49 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.285714 | false | false |
7
|
711ac7d96919f8a56d595ac8270442822eec1f6b
| 7,121,055,806,393 |
c6992ce8db7e5aab6fd959c0c448659ab91b16ce
|
/sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/fluent/models/CustomImageInner.java
|
4c183a014e1d38c1cce263a6711cb540b42b5257
|
[
"MIT",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause",
"CC0-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"LGPL-2.1-or-later"
] |
permissive
|
g2vinay/azure-sdk-for-java
|
https://github.com/g2vinay/azure-sdk-for-java
|
ae6d94d583cc2983a5088ec8f6146744ee82cb55
|
b88918a2ba0c3b3e88a36c985e6f83fc2bae2af2
|
refs/heads/master
| 2023-09-01T17:46:08.256000 | 2021-09-23T22:20:20 | 2021-09-23T22:20:20 | 161,234,198 | 3 | 1 |
MIT
| true | 2020-01-16T20:22:43 | 2018-12-10T20:44:41 | 2019-11-13T16:53:51 | 2020-01-16T19:50:34 | 397,442 | 0 | 0 | 0 |
Java
| false | false |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.devtestlabs.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesCustom;
import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromPlan;
import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm;
import com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
/** A custom image. */
@JsonFlatten
@Fluent
public class CustomImageInner extends Resource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageInner.class);
/*
* The virtual machine from which the image is to be created.
*/
@JsonProperty(value = "properties.vm")
private CustomImagePropertiesFromVm vm;
/*
* The VHD from which the image is to be created.
*/
@JsonProperty(value = "properties.vhd")
private CustomImagePropertiesCustom vhd;
/*
* The description of the custom image.
*/
@JsonProperty(value = "properties.description")
private String description;
/*
* The author of the custom image.
*/
@JsonProperty(value = "properties.author")
private String author;
/*
* The creation date of the custom image.
*/
@JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime creationDate;
/*
* The Managed Image Id backing the custom image.
*/
@JsonProperty(value = "properties.managedImageId")
private String managedImageId;
/*
* The Managed Snapshot Id backing the custom image.
*/
@JsonProperty(value = "properties.managedSnapshotId")
private String managedSnapshotId;
/*
* Storage information about the data disks present in the custom image
*/
@JsonProperty(value = "properties.dataDiskStorageInfo")
private List<DataDiskStorageTypeInfo> dataDiskStorageInfo;
/*
* Storage information about the plan related to this custom image
*/
@JsonProperty(value = "properties.customImagePlan")
private CustomImagePropertiesFromPlan customImagePlan;
/*
* Whether or not the custom images underlying offer/plan has been enabled
* for programmatic deployment
*/
@JsonProperty(value = "properties.isPlanAuthorized")
private Boolean isPlanAuthorized;
/*
* The provisioning status of the resource.
*/
@JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private String provisioningState;
/*
* The unique immutable identifier of a resource (Guid).
*/
@JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY)
private String uniqueIdentifier;
/**
* Get the vm property: The virtual machine from which the image is to be created.
*
* @return the vm value.
*/
public CustomImagePropertiesFromVm vm() {
return this.vm;
}
/**
* Set the vm property: The virtual machine from which the image is to be created.
*
* @param vm the vm value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withVm(CustomImagePropertiesFromVm vm) {
this.vm = vm;
return this;
}
/**
* Get the vhd property: The VHD from which the image is to be created.
*
* @return the vhd value.
*/
public CustomImagePropertiesCustom vhd() {
return this.vhd;
}
/**
* Set the vhd property: The VHD from which the image is to be created.
*
* @param vhd the vhd value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withVhd(CustomImagePropertiesCustom vhd) {
this.vhd = vhd;
return this;
}
/**
* Get the description property: The description of the custom image.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Set the description property: The description of the custom image.
*
* @param description the description value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withDescription(String description) {
this.description = description;
return this;
}
/**
* Get the author property: The author of the custom image.
*
* @return the author value.
*/
public String author() {
return this.author;
}
/**
* Set the author property: The author of the custom image.
*
* @param author the author value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withAuthor(String author) {
this.author = author;
return this;
}
/**
* Get the creationDate property: The creation date of the custom image.
*
* @return the creationDate value.
*/
public OffsetDateTime creationDate() {
return this.creationDate;
}
/**
* Get the managedImageId property: The Managed Image Id backing the custom image.
*
* @return the managedImageId value.
*/
public String managedImageId() {
return this.managedImageId;
}
/**
* Set the managedImageId property: The Managed Image Id backing the custom image.
*
* @param managedImageId the managedImageId value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withManagedImageId(String managedImageId) {
this.managedImageId = managedImageId;
return this;
}
/**
* Get the managedSnapshotId property: The Managed Snapshot Id backing the custom image.
*
* @return the managedSnapshotId value.
*/
public String managedSnapshotId() {
return this.managedSnapshotId;
}
/**
* Set the managedSnapshotId property: The Managed Snapshot Id backing the custom image.
*
* @param managedSnapshotId the managedSnapshotId value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withManagedSnapshotId(String managedSnapshotId) {
this.managedSnapshotId = managedSnapshotId;
return this;
}
/**
* Get the dataDiskStorageInfo property: Storage information about the data disks present in the custom image.
*
* @return the dataDiskStorageInfo value.
*/
public List<DataDiskStorageTypeInfo> dataDiskStorageInfo() {
return this.dataDiskStorageInfo;
}
/**
* Set the dataDiskStorageInfo property: Storage information about the data disks present in the custom image.
*
* @param dataDiskStorageInfo the dataDiskStorageInfo value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withDataDiskStorageInfo(List<DataDiskStorageTypeInfo> dataDiskStorageInfo) {
this.dataDiskStorageInfo = dataDiskStorageInfo;
return this;
}
/**
* Get the customImagePlan property: Storage information about the plan related to this custom image.
*
* @return the customImagePlan value.
*/
public CustomImagePropertiesFromPlan customImagePlan() {
return this.customImagePlan;
}
/**
* Set the customImagePlan property: Storage information about the plan related to this custom image.
*
* @param customImagePlan the customImagePlan value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withCustomImagePlan(CustomImagePropertiesFromPlan customImagePlan) {
this.customImagePlan = customImagePlan;
return this;
}
/**
* Get the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for
* programmatic deployment.
*
* @return the isPlanAuthorized value.
*/
public Boolean isPlanAuthorized() {
return this.isPlanAuthorized;
}
/**
* Set the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for
* programmatic deployment.
*
* @param isPlanAuthorized the isPlanAuthorized value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) {
this.isPlanAuthorized = isPlanAuthorized;
return this;
}
/**
* Get the provisioningState property: The provisioning status of the resource.
*
* @return the provisioningState value.
*/
public String provisioningState() {
return this.provisioningState;
}
/**
* Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
*
* @return the uniqueIdentifier value.
*/
public String uniqueIdentifier() {
return this.uniqueIdentifier;
}
/** {@inheritDoc} */
@Override
public CustomImageInner withLocation(String location) {
super.withLocation(location);
return this;
}
/** {@inheritDoc} */
@Override
public CustomImageInner withTags(Map<String, String> tags) {
super.withTags(tags);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (vm() != null) {
vm().validate();
}
if (vhd() != null) {
vhd().validate();
}
if (dataDiskStorageInfo() != null) {
dataDiskStorageInfo().forEach(e -> e.validate());
}
if (customImagePlan() != null) {
customImagePlan().validate();
}
}
}
|
UTF-8
|
Java
| 10,331 |
java
|
CustomImageInner.java
|
Java
|
[] | null |
[] |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.devtestlabs.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.annotation.JsonFlatten;
import com.azure.core.management.Resource;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesCustom;
import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromPlan;
import com.azure.resourcemanager.devtestlabs.models.CustomImagePropertiesFromVm;
import com.azure.resourcemanager.devtestlabs.models.DataDiskStorageTypeInfo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;
import java.util.Map;
/** A custom image. */
@JsonFlatten
@Fluent
public class CustomImageInner extends Resource {
@JsonIgnore private final ClientLogger logger = new ClientLogger(CustomImageInner.class);
/*
* The virtual machine from which the image is to be created.
*/
@JsonProperty(value = "properties.vm")
private CustomImagePropertiesFromVm vm;
/*
* The VHD from which the image is to be created.
*/
@JsonProperty(value = "properties.vhd")
private CustomImagePropertiesCustom vhd;
/*
* The description of the custom image.
*/
@JsonProperty(value = "properties.description")
private String description;
/*
* The author of the custom image.
*/
@JsonProperty(value = "properties.author")
private String author;
/*
* The creation date of the custom image.
*/
@JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY)
private OffsetDateTime creationDate;
/*
* The Managed Image Id backing the custom image.
*/
@JsonProperty(value = "properties.managedImageId")
private String managedImageId;
/*
* The Managed Snapshot Id backing the custom image.
*/
@JsonProperty(value = "properties.managedSnapshotId")
private String managedSnapshotId;
/*
* Storage information about the data disks present in the custom image
*/
@JsonProperty(value = "properties.dataDiskStorageInfo")
private List<DataDiskStorageTypeInfo> dataDiskStorageInfo;
/*
* Storage information about the plan related to this custom image
*/
@JsonProperty(value = "properties.customImagePlan")
private CustomImagePropertiesFromPlan customImagePlan;
/*
* Whether or not the custom images underlying offer/plan has been enabled
* for programmatic deployment
*/
@JsonProperty(value = "properties.isPlanAuthorized")
private Boolean isPlanAuthorized;
/*
* The provisioning status of the resource.
*/
@JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
private String provisioningState;
/*
* The unique immutable identifier of a resource (Guid).
*/
@JsonProperty(value = "properties.uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY)
private String uniqueIdentifier;
/**
* Get the vm property: The virtual machine from which the image is to be created.
*
* @return the vm value.
*/
public CustomImagePropertiesFromVm vm() {
return this.vm;
}
/**
* Set the vm property: The virtual machine from which the image is to be created.
*
* @param vm the vm value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withVm(CustomImagePropertiesFromVm vm) {
this.vm = vm;
return this;
}
/**
* Get the vhd property: The VHD from which the image is to be created.
*
* @return the vhd value.
*/
public CustomImagePropertiesCustom vhd() {
return this.vhd;
}
/**
* Set the vhd property: The VHD from which the image is to be created.
*
* @param vhd the vhd value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withVhd(CustomImagePropertiesCustom vhd) {
this.vhd = vhd;
return this;
}
/**
* Get the description property: The description of the custom image.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Set the description property: The description of the custom image.
*
* @param description the description value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withDescription(String description) {
this.description = description;
return this;
}
/**
* Get the author property: The author of the custom image.
*
* @return the author value.
*/
public String author() {
return this.author;
}
/**
* Set the author property: The author of the custom image.
*
* @param author the author value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withAuthor(String author) {
this.author = author;
return this;
}
/**
* Get the creationDate property: The creation date of the custom image.
*
* @return the creationDate value.
*/
public OffsetDateTime creationDate() {
return this.creationDate;
}
/**
* Get the managedImageId property: The Managed Image Id backing the custom image.
*
* @return the managedImageId value.
*/
public String managedImageId() {
return this.managedImageId;
}
/**
* Set the managedImageId property: The Managed Image Id backing the custom image.
*
* @param managedImageId the managedImageId value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withManagedImageId(String managedImageId) {
this.managedImageId = managedImageId;
return this;
}
/**
* Get the managedSnapshotId property: The Managed Snapshot Id backing the custom image.
*
* @return the managedSnapshotId value.
*/
public String managedSnapshotId() {
return this.managedSnapshotId;
}
/**
* Set the managedSnapshotId property: The Managed Snapshot Id backing the custom image.
*
* @param managedSnapshotId the managedSnapshotId value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withManagedSnapshotId(String managedSnapshotId) {
this.managedSnapshotId = managedSnapshotId;
return this;
}
/**
* Get the dataDiskStorageInfo property: Storage information about the data disks present in the custom image.
*
* @return the dataDiskStorageInfo value.
*/
public List<DataDiskStorageTypeInfo> dataDiskStorageInfo() {
return this.dataDiskStorageInfo;
}
/**
* Set the dataDiskStorageInfo property: Storage information about the data disks present in the custom image.
*
* @param dataDiskStorageInfo the dataDiskStorageInfo value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withDataDiskStorageInfo(List<DataDiskStorageTypeInfo> dataDiskStorageInfo) {
this.dataDiskStorageInfo = dataDiskStorageInfo;
return this;
}
/**
* Get the customImagePlan property: Storage information about the plan related to this custom image.
*
* @return the customImagePlan value.
*/
public CustomImagePropertiesFromPlan customImagePlan() {
return this.customImagePlan;
}
/**
* Set the customImagePlan property: Storage information about the plan related to this custom image.
*
* @param customImagePlan the customImagePlan value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withCustomImagePlan(CustomImagePropertiesFromPlan customImagePlan) {
this.customImagePlan = customImagePlan;
return this;
}
/**
* Get the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for
* programmatic deployment.
*
* @return the isPlanAuthorized value.
*/
public Boolean isPlanAuthorized() {
return this.isPlanAuthorized;
}
/**
* Set the isPlanAuthorized property: Whether or not the custom images underlying offer/plan has been enabled for
* programmatic deployment.
*
* @param isPlanAuthorized the isPlanAuthorized value to set.
* @return the CustomImageInner object itself.
*/
public CustomImageInner withIsPlanAuthorized(Boolean isPlanAuthorized) {
this.isPlanAuthorized = isPlanAuthorized;
return this;
}
/**
* Get the provisioningState property: The provisioning status of the resource.
*
* @return the provisioningState value.
*/
public String provisioningState() {
return this.provisioningState;
}
/**
* Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
*
* @return the uniqueIdentifier value.
*/
public String uniqueIdentifier() {
return this.uniqueIdentifier;
}
/** {@inheritDoc} */
@Override
public CustomImageInner withLocation(String location) {
super.withLocation(location);
return this;
}
/** {@inheritDoc} */
@Override
public CustomImageInner withTags(Map<String, String> tags) {
super.withTags(tags);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (vm() != null) {
vm().validate();
}
if (vhd() != null) {
vhd().validate();
}
if (dataDiskStorageInfo() != null) {
dataDiskStorageInfo().forEach(e -> e.validate());
}
if (customImagePlan() != null) {
customImagePlan().validate();
}
}
}
| 10,331 | 0.66857 | 0.66857 | 342 | 29.207602 | 28.485878 | 117 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.201754 | false | false |
7
|
fd8a28ab7bc247e6f34bc6cd737a87504cd3927f
| 26,465,588,499,124 |
179a5cda21216b75e644c18051a1e54e4a36b6e3
|
/src/kuxhausen/Project2.java
|
2dc654c5abd2157fb3e8bb7c9525726e8173ed96
|
[] |
no_license
|
ekux44/compiler-front-end
|
https://github.com/ekux44/compiler-front-end
|
c24462da2f30a3ad584dff231db6aed83fcb797e
|
674488e1b5c04f7042aea1c11d694f4e8ffdf4d2
|
refs/heads/master
| 2021-01-12T21:09:54.020000 | 2015-02-11T16:07:17 | 2015-02-11T16:07:17 | 27,890,520 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package kuxhausen;
import java.util.Scanner;
/**
* @author Eric Kuxhausen
*/
public class Project2 {
public static void main(String[] args) {
for (String filename : args) {
Scanner file = Lexar.getFile("input/" + filename + ".pas");
if (file != null) {
Lexar l = new Lexar(file);
Parser p = new Parser(l);
Utils.writeListingFile("output/" + filename + ".listing", p.getTokenList(),
l.getSourceBuffer());
Utils.writeTokenFile("output/" + filename + ".token", p.getTokenList());
}
}
}
}
|
UTF-8
|
Java
| 565 |
java
|
Project2.java
|
Java
|
[
{
"context": "hausen;\n\nimport java.util.Scanner;\n\n/**\n * @author Eric Kuxhausen\n */\npublic class Project2 {\n public static void ",
"end": 76,
"score": 0.9998504519462585,
"start": 62,
"tag": "NAME",
"value": "Eric Kuxhausen"
}
] | null |
[] |
package kuxhausen;
import java.util.Scanner;
/**
* @author <NAME>
*/
public class Project2 {
public static void main(String[] args) {
for (String filename : args) {
Scanner file = Lexar.getFile("input/" + filename + ".pas");
if (file != null) {
Lexar l = new Lexar(file);
Parser p = new Parser(l);
Utils.writeListingFile("output/" + filename + ".listing", p.getTokenList(),
l.getSourceBuffer());
Utils.writeTokenFile("output/" + filename + ".token", p.getTokenList());
}
}
}
}
| 557 | 0.587611 | 0.585841 | 23 | 23.565218 | 24.517653 | 83 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.434783 | false | false |
7
|
47dcc9647f971e04a1be537aede671ab64899aa3
| 14,671,608,318,012 |
bb85418d09ab09a3d7c082af2e5babeb5ba46ed9
|
/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/work/Catalina/localhost/myBlog/org/apache/jsp/singlePostView_jsp.java
|
3a4d1deb5d57517fa9f3abe81c25ccc22d6ec8a0
|
[] |
no_license
|
imrangthub/BlogUsingCoreJava
|
https://github.com/imrangthub/BlogUsingCoreJava
|
448c26ca093cfb2a1196d11d316e808b6dbfed0a
|
38e1dc74f67b2af2de55606f013687deebb928bf
|
refs/heads/master
| 2021-07-10T00:30:51.263000 | 2017-10-10T10:13:09 | 2017-10-10T10:13:09 | 106,386,818 | 1 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.55
* Generated at: 2016-12-23 13:34:42 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.dao.commentsCls;
import com.dao.adminCls;
import com.Models.adminModel;
import com.dao.adminCls;
import com.dao.postsCls;
import com.Models.adminModel;
import com.Models.PostsModel;
import java.util.ArrayList;
import com.dao.categoryCls;
import com.Models.CategoryModel;
import com.Models.CommentsModel;
import java.util.List;
public final class singlePostView_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\r\n");
out.write("\r\n");
out.write("<title>Project | Home</title>\r\n");
out.write("<style>\r\n");
out.write(".upDownButton {\r\n");
out.write(" background: url(\"imgFolder/up.png\") no-repeat scroll 0 0; bottom: 10px; right: 10px;\r\n");
out.write(" position: fixed; width: 50px; height: 50px;\r\n");
out.write(" cursor: pointer; display: none;\r\n");
out.write(" }\r\n");
out.write("</style>\r\n");
out.write("<!-- Bootstrap -->\r\n");
out.write(" <link href=\"css/bootstrap.min.css\" rel=\"stylesheet\">\r\n");
out.write(" <link href=\"css/style.css\" rel=\"stylesheet\">\r\n");
out.write(" \r\n");
out.write(" <!-- JQuery -->\r\n");
out.write(" <script src=\"js/jquery.min.js\"></script>\r\n");
out.write(" <script src=\"js/myScript.js\"></script>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" <script src=\"js/jquery.js\"></script>\r\n");
out.write(" <script src=\"js/jquery-ui.min.js\"></script> \r\n");
out.write(" <link rel=\"stylesheet\" href=\"css/jquery-ui.min.css\">\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("<body>\r\n");
out.write("<div class=\"main_container\">\r\n");
String loginId = (String) session.getAttribute("loginID");
if(!session.isNew() && session.getAttribute("loginID") != null){
adminCls adminClsObj = new adminCls();
List<adminModel> selectedAdmin = adminClsObj.getAdminInfo(loginId);
for(adminModel userInfo : selectedAdmin ){
out.write(" \r\n");
out.write("<!-- Admin login Navbar -->\r\n");
out.write(" \r\n");
out.write("<!-- End Admin login Navbar -->\r\n");
out.write("<nav class=\"navbar navbar-inverse navbar-default navbar-fixed-top\">\r\n");
out.write(" <div class=\"navbar-header\">\r\n");
out.write(" <a class=\"navbar-brand\" href=\"about.jsp\">Welcome : </a>\r\n");
out.write(" <a class=\"navbar-brand\" href=\"contact.jsp\">");
out.print(userInfo.getAdminName());
out.write("</a> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\r\n");
out.write(" <ul class=\"nav navbar-nav\">\r\n");
out.write(" <li><a href=\"admin/dashboard.jsp\">Dashboard</a></li> \r\n");
out.write(" </ul>\r\n");
out.write(" \r\n");
out.write(" <ul class=\"nav navbar-nav navbar-right\">\r\n");
out.write(" <li><a href=\"adminLogout?action=logout\">LOG OUT</a></li>\r\n");
out.write(" </ul>\r\n");
out.write(" </div>\r\n");
out.write("</nav>\r\n");
out.write("\r\n");
out.write("<nav class=\"adminNav\"></nav>\r\n");
out.write("\r\n");
out.write("\r\n");
// session.setAttribute("loginID", null);
}
}
out.write("\r\n");
out.write("\r\n");
out.write(" <div class=\"container\"> <!-- Start container -->\r\n");
out.write(" <header class=\"header_area\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"logo\">\r\n");
out.write(" <h2>Welcome to Blog</h2>\r\n");
out.write(" <p>This is a general blog web, anyway thank's for visiting our blog.</p>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </header> \r\n");
out.write(" <!-- Start Navigation bar -->\r\n");
out.write(" <nav class=\"navigation\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-xs-12 col-md-11 col-md-offset-1\">\r\n");
out.write(" <nav class=\"navbar navbar-default2\">\r\n");
out.write(" <div class=\"container-fluid\">\r\n");
out.write(" <!-- Brand and toggle get grouped for better mobile display -->\r\n");
out.write(" <div class=\"navbar-header\">\r\n");
out.write(" <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\r\n");
out.write(" <span class=\"sr-only\">Toggle navigation</span>\r\n");
out.write(" <span class=\"icon-bar\"></span>\r\n");
out.write(" <span class=\"icon-bar\"></span>\r\n");
out.write(" <span class=\"icon-bar\"></span>\r\n");
out.write(" </button>\r\n");
out.write(" </div>\r\n");
out.write("\r\n");
out.write(" <!-- Collect the nav links, forms, and other content for toggling -->\r\n");
out.write(" <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\r\n");
out.write(" <ul class=\"nav navbar-nav\">\r\n");
out.write(" <li><a href=\"index.jsp\">Home</a></li>\r\n");
out.write(" <li><a href=\"about.jsp\">About us</a></li>\r\n");
out.write(" <li><a href=\"contact.jsp\">Contact</a></li>\r\n");
out.write(" \r\n");
out.write(" </ul>\r\n");
out.write(" </div><!-- /.navbar-collapse -->\r\n");
out.write(" </div><!-- /.container-fluid -->\r\n");
out.write(" </nav>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </nav>\r\n");
out.write(" <!-- End Navigation bar -->\r\n");
out.write(" <!-- body contain section -->\r\n");
out.write(" <section class=\"content_area\">\r\n");
out.write(" \r\n");
out.write(" ");
int postId = Integer.parseInt(request.getParameter("id"));
postsCls postClsObj = new postsCls();
List<PostsModel> dataforSingleShow = postClsObj.singleShow(postId);
for(PostsModel singlePost : dataforSingleShow){
out.write("\r\n");
out.write(" \r\n");
out.write(" <!-- End Left side bar -->\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"single_content_post\">\r\n");
out.write(" <div class=\"post_view\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <h2>");
out.print(singlePost.getPostTitle());
out.write("</h2>\r\n");
out.write(" </div> \r\n");
out.write(" <div class=\"col-md-4\">\r\n");
out.write("<h4 style=\"color:red\">\r\n");
String msgError = (String) session.getAttribute("storeErrorMsg");
if(!session.isNew() && msgError != null){
out.print(msgError);
session.setAttribute("storeErrorMsg"," ");
}
out.write("\r\n");
out.write("</h4>\r\n");
out.write("<h4 style=\"color:green\">\r\n");
String msgSeccess = (String) session.getAttribute("storeSuccessMsg");
if(!session.isNew() && msgSeccess != null){
out.print(msgSeccess);
session.setAttribute("storeSuccessMsg"," ");
}
String updateSeccess = (String) session.getAttribute("updateSuccessMsg");
if(!session.isNew() && updateSeccess != null){
out.print(updateSeccess);
session.setAttribute("updateSuccessMsg"," ");
}
String deleteSeccess = (String) session.getAttribute("deleteSuccessMsg");
if(!session.isNew() && deleteSeccess != null){
out.print(deleteSeccess);
session.setAttribute("deleteSuccessMsg"," ");
}
out.write("\r\n");
out.write("</h4>\r\n");
out.write("</div>\r\n");
out.write(" </div>\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" \r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"single_post_image\">\r\n");
out.write(" ");
String img = singlePost.getPostImage().toString();
if(!img.equals("null")){
out.write(" \r\n");
out.write(" <img src=\"imgFolder/");
out.print(singlePost.getPostImage());
out.write("\" width=\"650px\" height=\"450px\"/> \t\r\n");
out.write(" ");
}
out.write(" \r\n");
out.write(" </div> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" \r\n");
out.write(" <div class=\"single_post_body\">\r\n");
out.write(" ");
out.print(singlePost.getPostBody());
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" <div class=\"row\"><!-- Comment box -->\r\n");
out.write(" <div class=\"col-md-10 col-md-offset-1\">\r\n");
out.write(" <hr>\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-6\">\r\n");
out.write(" \r\n");
out.write(" ");
String postID = request.getParameter("id");
commentsCls commentClsObj = new commentsCls();
List<CommentsModel> allComments = new ArrayList<CommentsModel>();
allComments = commentClsObj.index(postID);
out.write("\r\n");
out.write(" <div class=\"comment_view\">\r\n");
out.write(" <h4>Total commen:");
out.print(allComments.toArray().length);
out.write("</h4>\r\n");
out.write(" </div>\r\n");
out.write(" ");
for(CommentsModel singleComment : allComments){
out.write("\r\n");
out.write(" <div class=\"comment_body\">\r\n");
out.write(" <h6>");
out.print(singleComment.getEmail());
out.write("</h6>\r\n");
out.write(" <p>");
out.print(singleComment.getComment());
out.write("</p>\r\n");
out.write(" </div>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" <div class=\"col-md-4 col-md-offset-1\">\r\n");
out.write(" \r\n");
out.write(" <dl class=\"dl-horizontal\">\r\n");
out.write(" <dt>Public :</dt>\r\n");
out.write(" <dd>");
out.print(singlePost.getCreate_at());
out.write("</dd>\r\n");
out.write(" </dl>\r\n");
out.write(" <dl class=\"dl-horizontal\">\r\n");
out.write(" <dt>Category:</dt>\r\n");
out.write(" <dd>\r\n");
out.write(" ");
String allCatagory = singlePost.getCategory();
String[] allCategoryArr = allCatagory.split(",");
for(int i=0; i<allCategoryArr.length; i++){
int CategoryId = Integer.parseInt(allCategoryArr[i]);
categoryCls categoryClsObj = new categoryCls();
List<CategoryModel> dataforShow = categoryClsObj.singleShow(CategoryId);
for(CategoryModel singleCategory : dataforShow){
out.write("\r\n");
out.write("\t\t \r\n");
out.write("\t\t <p class=\"btn btn-default\">");
out.print(singleCategory.getCategory_title());
out.write("</p>\r\n");
out.write("\t\t \r\n");
out.write("\t ");
}
}
out.write("\r\n");
out.write(" </dd>\r\n");
out.write(" </dl> \r\n");
out.write(" \r\n");
out.write(" <dl class=\"dl-horizontal\">\r\n");
out.write(" <dt>Last update :</dt>\r\n");
out.write(" <dd>\r\n");
out.write(" ");
if(singlePost.getModify_at() == null){
out.print("Not yeat.");
}else{
out.print(singlePost.getModify_at());
}
out.write("\r\n");
out.write(" </dd>\r\n");
out.write("</dl>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" <div class=\"comment_box\">\r\n");
out.write(" <h4>Your comment:</h4>\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-6\">\r\n");
out.write(" <form action=\"createComments\" method=\"POST\">\r\n");
out.write(" <div class=\"form-group\"> \r\n");
out.write(" <label class=\"control-label\">Email:</label>\r\n");
out.write(" <input type=\"text\" id=\"title\" name=\"email\" class=\"form-control\"> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" <div class=\"form-group\"> \r\n");
out.write(" <label class=\"control-label\">Comment:</label>\r\n");
out.write(" <textarea id=\"body\" name=\"comment\" rows=\"5\" class=\"form-control\"> Type your message here.....</textarea> \r\n");
out.write(" </div>\r\n");
out.write(" <input type=\"hidden\" name=\"post_id\" value=\"");
out.print(singlePost.getId());
out.write("\"/>\r\n");
out.write(" <input type=\"submit\" value=\"Submit\" class=\"btn btn-success btn-lg btn-block\">\r\n");
out.write(" \r\n");
out.write(" </form>\r\n");
out.write(" </div> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" </div> \r\n");
out.write(" \r\n");
out.write(" </div><!-- end body row -->\r\n");
out.write(" ");
}
out.write(" \r\n");
out.write(" <div class=\"upDownButton\"></div> \r\n");
out.write(" </section>\r\n");
out.write(" <!-- End body contain section -->\r\n");
out.write(" \r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-10 col-md-offset-1\">\r\n");
out.write(" <footer class=\"footer_area\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"copyright\">\r\n");
out.write(" <p>© Copyright Md Imran hossain.</p>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </footer>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div> <!-- End main container -->\r\n");
out.write("\r\n");
out.write(" <script src=\"js/bootstrap.min.js\"></script>\r\n");
out.write(" <script src=\"js/jquery.min.js\"></script>\r\n");
out.write(" \r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
|
UTF-8
|
Java
| 20,895 |
java
|
singlePostView_jsp.java
|
Java
|
[
{
"context": "\" <p>© Copyright Md Imran hossain.</p>\\r\\n\");\n out.write(\" ",
"end": 19674,
"score": 0.6261110901832581,
"start": 19671,
"tag": "NAME",
"value": "ran"
}
] | null |
[] |
/*
* Generated by the Jasper component of Apache Tomcat
* Version: Apache Tomcat/7.0.55
* Generated at: 2016-12-23 13:34:42 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package org.apache.jsp;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.dao.commentsCls;
import com.dao.adminCls;
import com.Models.adminModel;
import com.dao.adminCls;
import com.dao.postsCls;
import com.Models.adminModel;
import com.Models.PostsModel;
import java.util.ArrayList;
import com.dao.categoryCls;
import com.Models.CategoryModel;
import com.Models.CommentsModel;
import java.util.List;
public final class singlePostView_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/html; charset=ISO-8859-1");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("\r\n");
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\r\n");
out.write("<html>\r\n");
out.write("<head>\r\n");
out.write("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\r\n");
out.write("\r\n");
out.write("<title>Project | Home</title>\r\n");
out.write("<style>\r\n");
out.write(".upDownButton {\r\n");
out.write(" background: url(\"imgFolder/up.png\") no-repeat scroll 0 0; bottom: 10px; right: 10px;\r\n");
out.write(" position: fixed; width: 50px; height: 50px;\r\n");
out.write(" cursor: pointer; display: none;\r\n");
out.write(" }\r\n");
out.write("</style>\r\n");
out.write("<!-- Bootstrap -->\r\n");
out.write(" <link href=\"css/bootstrap.min.css\" rel=\"stylesheet\">\r\n");
out.write(" <link href=\"css/style.css\" rel=\"stylesheet\">\r\n");
out.write(" \r\n");
out.write(" <!-- JQuery -->\r\n");
out.write(" <script src=\"js/jquery.min.js\"></script>\r\n");
out.write(" <script src=\"js/myScript.js\"></script>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" <script src=\"js/jquery.js\"></script>\r\n");
out.write(" <script src=\"js/jquery-ui.min.js\"></script> \r\n");
out.write(" <link rel=\"stylesheet\" href=\"css/jquery-ui.min.css\">\r\n");
out.write("</head>\r\n");
out.write("\r\n");
out.write("<body>\r\n");
out.write("<div class=\"main_container\">\r\n");
String loginId = (String) session.getAttribute("loginID");
if(!session.isNew() && session.getAttribute("loginID") != null){
adminCls adminClsObj = new adminCls();
List<adminModel> selectedAdmin = adminClsObj.getAdminInfo(loginId);
for(adminModel userInfo : selectedAdmin ){
out.write(" \r\n");
out.write("<!-- Admin login Navbar -->\r\n");
out.write(" \r\n");
out.write("<!-- End Admin login Navbar -->\r\n");
out.write("<nav class=\"navbar navbar-inverse navbar-default navbar-fixed-top\">\r\n");
out.write(" <div class=\"navbar-header\">\r\n");
out.write(" <a class=\"navbar-brand\" href=\"about.jsp\">Welcome : </a>\r\n");
out.write(" <a class=\"navbar-brand\" href=\"contact.jsp\">");
out.print(userInfo.getAdminName());
out.write("</a> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\r\n");
out.write(" <ul class=\"nav navbar-nav\">\r\n");
out.write(" <li><a href=\"admin/dashboard.jsp\">Dashboard</a></li> \r\n");
out.write(" </ul>\r\n");
out.write(" \r\n");
out.write(" <ul class=\"nav navbar-nav navbar-right\">\r\n");
out.write(" <li><a href=\"adminLogout?action=logout\">LOG OUT</a></li>\r\n");
out.write(" </ul>\r\n");
out.write(" </div>\r\n");
out.write("</nav>\r\n");
out.write("\r\n");
out.write("<nav class=\"adminNav\"></nav>\r\n");
out.write("\r\n");
out.write("\r\n");
// session.setAttribute("loginID", null);
}
}
out.write("\r\n");
out.write("\r\n");
out.write(" <div class=\"container\"> <!-- Start container -->\r\n");
out.write(" <header class=\"header_area\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"logo\">\r\n");
out.write(" <h2>Welcome to Blog</h2>\r\n");
out.write(" <p>This is a general blog web, anyway thank's for visiting our blog.</p>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </header> \r\n");
out.write(" <!-- Start Navigation bar -->\r\n");
out.write(" <nav class=\"navigation\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-xs-12 col-md-11 col-md-offset-1\">\r\n");
out.write(" <nav class=\"navbar navbar-default2\">\r\n");
out.write(" <div class=\"container-fluid\">\r\n");
out.write(" <!-- Brand and toggle get grouped for better mobile display -->\r\n");
out.write(" <div class=\"navbar-header\">\r\n");
out.write(" <button type=\"button\" class=\"navbar-toggle collapsed\" data-toggle=\"collapse\" data-target=\"#bs-example-navbar-collapse-1\" aria-expanded=\"false\">\r\n");
out.write(" <span class=\"sr-only\">Toggle navigation</span>\r\n");
out.write(" <span class=\"icon-bar\"></span>\r\n");
out.write(" <span class=\"icon-bar\"></span>\r\n");
out.write(" <span class=\"icon-bar\"></span>\r\n");
out.write(" </button>\r\n");
out.write(" </div>\r\n");
out.write("\r\n");
out.write(" <!-- Collect the nav links, forms, and other content for toggling -->\r\n");
out.write(" <div class=\"collapse navbar-collapse\" id=\"bs-example-navbar-collapse-1\">\r\n");
out.write(" <ul class=\"nav navbar-nav\">\r\n");
out.write(" <li><a href=\"index.jsp\">Home</a></li>\r\n");
out.write(" <li><a href=\"about.jsp\">About us</a></li>\r\n");
out.write(" <li><a href=\"contact.jsp\">Contact</a></li>\r\n");
out.write(" \r\n");
out.write(" </ul>\r\n");
out.write(" </div><!-- /.navbar-collapse -->\r\n");
out.write(" </div><!-- /.container-fluid -->\r\n");
out.write(" </nav>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </nav>\r\n");
out.write(" <!-- End Navigation bar -->\r\n");
out.write(" <!-- body contain section -->\r\n");
out.write(" <section class=\"content_area\">\r\n");
out.write(" \r\n");
out.write(" ");
int postId = Integer.parseInt(request.getParameter("id"));
postsCls postClsObj = new postsCls();
List<PostsModel> dataforSingleShow = postClsObj.singleShow(postId);
for(PostsModel singlePost : dataforSingleShow){
out.write("\r\n");
out.write(" \r\n");
out.write(" <!-- End Left side bar -->\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"single_content_post\">\r\n");
out.write(" <div class=\"post_view\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <h2>");
out.print(singlePost.getPostTitle());
out.write("</h2>\r\n");
out.write(" </div> \r\n");
out.write(" <div class=\"col-md-4\">\r\n");
out.write("<h4 style=\"color:red\">\r\n");
String msgError = (String) session.getAttribute("storeErrorMsg");
if(!session.isNew() && msgError != null){
out.print(msgError);
session.setAttribute("storeErrorMsg"," ");
}
out.write("\r\n");
out.write("</h4>\r\n");
out.write("<h4 style=\"color:green\">\r\n");
String msgSeccess = (String) session.getAttribute("storeSuccessMsg");
if(!session.isNew() && msgSeccess != null){
out.print(msgSeccess);
session.setAttribute("storeSuccessMsg"," ");
}
String updateSeccess = (String) session.getAttribute("updateSuccessMsg");
if(!session.isNew() && updateSeccess != null){
out.print(updateSeccess);
session.setAttribute("updateSuccessMsg"," ");
}
String deleteSeccess = (String) session.getAttribute("deleteSuccessMsg");
if(!session.isNew() && deleteSeccess != null){
out.print(deleteSeccess);
session.setAttribute("deleteSuccessMsg"," ");
}
out.write("\r\n");
out.write("</h4>\r\n");
out.write("</div>\r\n");
out.write(" </div>\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" \r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"single_post_image\">\r\n");
out.write(" ");
String img = singlePost.getPostImage().toString();
if(!img.equals("null")){
out.write(" \r\n");
out.write(" <img src=\"imgFolder/");
out.print(singlePost.getPostImage());
out.write("\" width=\"650px\" height=\"450px\"/> \t\r\n");
out.write(" ");
}
out.write(" \r\n");
out.write(" </div> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" \r\n");
out.write(" <div class=\"single_post_body\">\r\n");
out.write(" ");
out.print(singlePost.getPostBody());
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" \r\n");
out.write(" <div class=\"row\"><!-- Comment box -->\r\n");
out.write(" <div class=\"col-md-10 col-md-offset-1\">\r\n");
out.write(" <hr>\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-6\">\r\n");
out.write(" \r\n");
out.write(" ");
String postID = request.getParameter("id");
commentsCls commentClsObj = new commentsCls();
List<CommentsModel> allComments = new ArrayList<CommentsModel>();
allComments = commentClsObj.index(postID);
out.write("\r\n");
out.write(" <div class=\"comment_view\">\r\n");
out.write(" <h4>Total commen:");
out.print(allComments.toArray().length);
out.write("</h4>\r\n");
out.write(" </div>\r\n");
out.write(" ");
for(CommentsModel singleComment : allComments){
out.write("\r\n");
out.write(" <div class=\"comment_body\">\r\n");
out.write(" <h6>");
out.print(singleComment.getEmail());
out.write("</h6>\r\n");
out.write(" <p>");
out.print(singleComment.getComment());
out.write("</p>\r\n");
out.write(" </div>\r\n");
out.write(" ");
}
out.write("\r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" <div class=\"col-md-4 col-md-offset-1\">\r\n");
out.write(" \r\n");
out.write(" <dl class=\"dl-horizontal\">\r\n");
out.write(" <dt>Public :</dt>\r\n");
out.write(" <dd>");
out.print(singlePost.getCreate_at());
out.write("</dd>\r\n");
out.write(" </dl>\r\n");
out.write(" <dl class=\"dl-horizontal\">\r\n");
out.write(" <dt>Category:</dt>\r\n");
out.write(" <dd>\r\n");
out.write(" ");
String allCatagory = singlePost.getCategory();
String[] allCategoryArr = allCatagory.split(",");
for(int i=0; i<allCategoryArr.length; i++){
int CategoryId = Integer.parseInt(allCategoryArr[i]);
categoryCls categoryClsObj = new categoryCls();
List<CategoryModel> dataforShow = categoryClsObj.singleShow(CategoryId);
for(CategoryModel singleCategory : dataforShow){
out.write("\r\n");
out.write("\t\t \r\n");
out.write("\t\t <p class=\"btn btn-default\">");
out.print(singleCategory.getCategory_title());
out.write("</p>\r\n");
out.write("\t\t \r\n");
out.write("\t ");
}
}
out.write("\r\n");
out.write(" </dd>\r\n");
out.write(" </dl> \r\n");
out.write(" \r\n");
out.write(" <dl class=\"dl-horizontal\">\r\n");
out.write(" <dt>Last update :</dt>\r\n");
out.write(" <dd>\r\n");
out.write(" ");
if(singlePost.getModify_at() == null){
out.print("Not yeat.");
}else{
out.print(singlePost.getModify_at());
}
out.write("\r\n");
out.write(" </dd>\r\n");
out.write("</dl>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" <div class=\"comment_box\">\r\n");
out.write(" <h4>Your comment:</h4>\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-6\">\r\n");
out.write(" <form action=\"createComments\" method=\"POST\">\r\n");
out.write(" <div class=\"form-group\"> \r\n");
out.write(" <label class=\"control-label\">Email:</label>\r\n");
out.write(" <input type=\"text\" id=\"title\" name=\"email\" class=\"form-control\"> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" <div class=\"form-group\"> \r\n");
out.write(" <label class=\"control-label\">Comment:</label>\r\n");
out.write(" <textarea id=\"body\" name=\"comment\" rows=\"5\" class=\"form-control\"> Type your message here.....</textarea> \r\n");
out.write(" </div>\r\n");
out.write(" <input type=\"hidden\" name=\"post_id\" value=\"");
out.print(singlePost.getId());
out.write("\"/>\r\n");
out.write(" <input type=\"submit\" value=\"Submit\" class=\"btn btn-success btn-lg btn-block\">\r\n");
out.write(" \r\n");
out.write(" </form>\r\n");
out.write(" </div> \r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div>\r\n");
out.write(" </div> \r\n");
out.write(" \r\n");
out.write(" </div><!-- end body row -->\r\n");
out.write(" ");
}
out.write(" \r\n");
out.write(" <div class=\"upDownButton\"></div> \r\n");
out.write(" </section>\r\n");
out.write(" <!-- End body contain section -->\r\n");
out.write(" \r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-10 col-md-offset-1\">\r\n");
out.write(" <footer class=\"footer_area\">\r\n");
out.write(" <div class=\"row\">\r\n");
out.write(" <div class=\"col-md-12\">\r\n");
out.write(" <div class=\"copyright\">\r\n");
out.write(" <p>© Copyright Md Imran hossain.</p>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" </footer>\r\n");
out.write(" </div>\r\n");
out.write(" </div>\r\n");
out.write(" \r\n");
out.write(" </div> <!-- End main container -->\r\n");
out.write("\r\n");
out.write(" <script src=\"js/bootstrap.min.js\"></script>\r\n");
out.write(" <script src=\"js/jquery.min.js\"></script>\r\n");
out.write(" \r\n");
out.write("</body>\r\n");
out.write("</html>");
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try {
if (response.isCommitted()) {
out.flush();
} else {
out.clearBuffer();
}
} catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| 20,895 | 0.486624 | 0.481694 | 473 | 43.175476 | 28.547739 | 209 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.896406 | false | false |
7
|
b5f59b35d973f18d9b937f1206d5f4ba27473b55
| 25,048,249,324,470 |
7eb5904fd31c7b034ad9fe23e9c95a76f8c08698
|
/BirthdayReminder/app/src/main/java/com/example/emcako/birthdayreminder/FriendsListAdapter.java
|
461f95a5b2bfced84dcd760356730e9e1fe5d7f5
|
[] |
no_license
|
emcako/Birthday-Reminder-
|
https://github.com/emcako/Birthday-Reminder-
|
008cdbce5e9119df76c3b345b6fa0d5663626a8a
|
183651c9013be41a673de2ef09d7a1d5c8ca1bc1
|
refs/heads/master
| 2021-01-10T12:34:03.589000 | 2016-01-18T16:50:36 | 2016-01-18T16:50:36 | 49,637,307 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.example.emcako.birthdayreminder;
import android.app.Activity;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.emcako.birthdayreminder.database.DatabaseHelper;
import com.example.emcako.birthdayreminder.database.Friend;
import com.example.emcako.birthdayreminder.fragments.FriendsFragment;
import java.util.List;
public class FriendsListAdapter extends ArrayAdapter<Friend>
{
private final Activity activity;
private List<Friend> friends;
public FriendsListAdapter(Activity activity, int resource, List<Friend> friends) {
super(activity, resource, friends);
this.activity = activity;
this.friends = friends;
}
public View getView(final int position,View view,ViewGroup parent) {
LayoutInflater inflater=activity.getLayoutInflater();
View rowView=inflater.inflate(R.layout.mylist, null, true);
final int currentPosition = position;
// ImageButton btn= (ImageButton) rowView.findViewById(R.id.btn_delete);
// btn.setOnClickListener(new View.OnClickListener() {
//
// @Override
// public void onClick(View v) {
// // TODO Auto-generated method stub
//
// Friend friendToDelete = (Friend) friends.get(currentPosition);
// String name = friendToDelete.getName();
//
// DatabaseHelper db = new DatabaseHelper(getContext());
// db.deleteFriend(friendToDelete);
// friends.remove(position);
//
// FriendsFragment.adapter.notifyDataSetChanged();
//
// Toast.makeText(getContext(), "You just deleted " + name + " !", Toast.LENGTH_SHORT).show();
// }
// });
TextView txtTitle = (TextView) rowView.findViewById(R.id.item);
ImageView imageView = (ImageView) rowView.findViewById(R.id.photo_icon);
TextView extratxt = (TextView) rowView.findViewById(R.id.textView1);
txtTitle.setText(friends.get(position).getName());
extratxt.setText(friends.get(position).getBirthday());
String imgUriString = friends.get(position).getImagePath();
if (imgUriString == null || imgUriString == "")
{
imageView.setImageResource(R.drawable.android_300x300);
}
else
{
Uri imgUri = Uri.parse(imgUriString);
imageView.setImageURI(imgUri);
}
return rowView;
};
}
|
UTF-8
|
Java
| 2,727 |
java
|
FriendsListAdapter.java
|
Java
|
[] | null |
[] |
package com.example.emcako.birthdayreminder;
import android.app.Activity;
import android.net.Uri;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.emcako.birthdayreminder.database.DatabaseHelper;
import com.example.emcako.birthdayreminder.database.Friend;
import com.example.emcako.birthdayreminder.fragments.FriendsFragment;
import java.util.List;
public class FriendsListAdapter extends ArrayAdapter<Friend>
{
private final Activity activity;
private List<Friend> friends;
public FriendsListAdapter(Activity activity, int resource, List<Friend> friends) {
super(activity, resource, friends);
this.activity = activity;
this.friends = friends;
}
public View getView(final int position,View view,ViewGroup parent) {
LayoutInflater inflater=activity.getLayoutInflater();
View rowView=inflater.inflate(R.layout.mylist, null, true);
final int currentPosition = position;
// ImageButton btn= (ImageButton) rowView.findViewById(R.id.btn_delete);
// btn.setOnClickListener(new View.OnClickListener() {
//
// @Override
// public void onClick(View v) {
// // TODO Auto-generated method stub
//
// Friend friendToDelete = (Friend) friends.get(currentPosition);
// String name = friendToDelete.getName();
//
// DatabaseHelper db = new DatabaseHelper(getContext());
// db.deleteFriend(friendToDelete);
// friends.remove(position);
//
// FriendsFragment.adapter.notifyDataSetChanged();
//
// Toast.makeText(getContext(), "You just deleted " + name + " !", Toast.LENGTH_SHORT).show();
// }
// });
TextView txtTitle = (TextView) rowView.findViewById(R.id.item);
ImageView imageView = (ImageView) rowView.findViewById(R.id.photo_icon);
TextView extratxt = (TextView) rowView.findViewById(R.id.textView1);
txtTitle.setText(friends.get(position).getName());
extratxt.setText(friends.get(position).getBirthday());
String imgUriString = friends.get(position).getImagePath();
if (imgUriString == null || imgUriString == "")
{
imageView.setImageResource(R.drawable.android_300x300);
}
else
{
Uri imgUri = Uri.parse(imgUriString);
imageView.setImageURI(imgUri);
}
return rowView;
};
}
| 2,727 | 0.665933 | 0.663366 | 86 | 30.709303 | 28.349918 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.651163 | false | false |
7
|
3d3def9feee0e87cd61e6b5edc871c511356122b
| 14,577,119,041,574 |
fd7144415c176ca2457fabc002a6b24bdf2d8d88
|
/src/wl/test/MainTest.java
|
d86ea3063f4465e7ba14a8ca94d1ccf8b889f482
|
[] |
no_license
|
soj1998/webinfo
|
https://github.com/soj1998/webinfo
|
574e20c9d4f0e019f7c2f5a1d54ba32044f61214
|
1876252d20d096a150c0978986b49c46f5ebe084
|
refs/heads/master
| 2020-03-19T06:12:38.730000 | 2018-06-16T07:01:42 | 2018-06-16T07:01:42 | 136,000,189 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package wl.test;
import java.io.IOException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class MainTest {
public static void main(String[] args) {
WebDriver webDriver = new FirefoxDriver(); //创建火狐驱动(谷歌IE需下载驱动程序并添加浏览器插件,还有注意版本对应,比较麻烦,请百度版本对应)
webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
webDriver.get("http://www.chinatax.gov.cn/n810341/n810755/c3518520/content.html");
WebElement passLoginEle= webDriver.findElement(By.xpath("//a[@class='forget-pwd J_Quick2Static' and @target='_blank' and @href='']")); //密码登录
passLoginEle.click(); //显示账号密码表单域(模仿点击事件,将隐藏视图变为可见)
webDriver.findElement(By.id("J_SubmitStatic")).click(); //点击登录按钮
webDriver.switchTo().defaultContent();
}
}
|
GB18030
|
Java
| 1,253 |
java
|
MainTest.java
|
Java
|
[] | null |
[] |
package wl.test;
import java.io.IOException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class MainTest {
public static void main(String[] args) {
WebDriver webDriver = new FirefoxDriver(); //创建火狐驱动(谷歌IE需下载驱动程序并添加浏览器插件,还有注意版本对应,比较麻烦,请百度版本对应)
webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
webDriver.get("http://www.chinatax.gov.cn/n810341/n810755/c3518520/content.html");
WebElement passLoginEle= webDriver.findElement(By.xpath("//a[@class='forget-pwd J_Quick2Static' and @target='_blank' and @href='']")); //密码登录
passLoginEle.click(); //显示账号密码表单域(模仿点击事件,将隐藏视图变为可见)
webDriver.findElement(By.id("J_SubmitStatic")).click(); //点击登录按钮
webDriver.switchTo().defaultContent();
}
}
| 1,253 | 0.673733 | 0.653456 | 39 | 25.820513 | 33.328876 | 149 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.589744 | false | false |
7
|
00a2d4e41ee20cbe8f8efbe5989c3b878e8239f2
| 31,748,398,279,630 |
1c40f99b1bd796c46a936537cc463c26012b2acf
|
/investing-data-loader/src/main/java/com/nevex/investing/event/type/TickerAnalyzerUpdatedEvent.java
|
64ff423c54fa44d6afa0c24218047589586cd5dd
|
[] |
no_license
|
NeVeX/nevex_robo_investing
|
https://github.com/NeVeX/nevex_robo_investing
|
b15fd9501c7f4a519ff9b58e1be762c2ff3753c1
|
c2b07c371945fca37ea03f4a83e3b83c7168a95c
|
refs/heads/master
| 2021-01-23T12:53:50.145000 | 2017-11-27T03:14:05 | 2017-11-27T03:14:05 | 93,208,264 | 0 | 0 | null | false | 2017-09-15T08:20:28 | 2017-06-02T22:26:40 | 2017-06-02T22:26:40 | 2017-09-15T08:20:27 | 630 | 0 | 0 | 0 | null | null | null |
package com.nevex.investing.event.type;
import java.time.LocalDate;
/**
* Created by Mark Cunningham on 9/19/2017.
* <br>This event is used an analyzer has been updated
*/
public final class TickerAnalyzerUpdatedEvent extends TickerBasedEvent {
public TickerAnalyzerUpdatedEvent(int tickerId, LocalDate asOfDate) {
super(tickerId, asOfDate);
}
}
|
UTF-8
|
Java
| 369 |
java
|
TickerAnalyzerUpdatedEvent.java
|
Java
|
[
{
"context": "e;\n\nimport java.time.LocalDate;\n\n/**\n * Created by Mark Cunningham on 9/19/2017.\n * <br>This event is used an analyz",
"end": 103,
"score": 0.9998608827590942,
"start": 88,
"tag": "NAME",
"value": "Mark Cunningham"
}
] | null |
[] |
package com.nevex.investing.event.type;
import java.time.LocalDate;
/**
* Created by <NAME> on 9/19/2017.
* <br>This event is used an analyzer has been updated
*/
public final class TickerAnalyzerUpdatedEvent extends TickerBasedEvent {
public TickerAnalyzerUpdatedEvent(int tickerId, LocalDate asOfDate) {
super(tickerId, asOfDate);
}
}
| 360 | 0.745257 | 0.726287 | 15 | 23.6 | 26.297781 | 73 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.333333 | false | false |
7
|
8aee8f3723dc56c6eedcf7f5f68aa5c5a12dd9a3
| 12,214,887,000,997 |
9bea657980bf86452cd02bcfc68dbfd1c05fa660
|
/src/main/java/com/zlwh/hands/api/common/annotation/RequiredLogin.java
|
6c75d30b57398c6976a47bbd9767f63afd536bae
|
[
"Apache-2.0"
] |
permissive
|
qiuguoqiang/jeesite-api
|
https://github.com/qiuguoqiang/jeesite-api
|
3b5ac4fcc75e586d17aae0eab620d754c9fcb4a3
|
adce367553902732f6cf4c68acb98f20c6f3bb5a
|
refs/heads/master
| 2020-03-18T03:16:37.810000 | 2016-07-21T02:02:48 | 2016-07-21T02:02:48 | null | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.zlwh.hands.api.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 标识在Controller的方法上,用于标识该资源的访问权限。
* @see{UserInterceptor.isRequiredLogin}
* @author yuanjifeng
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface RequiredLogin {
}
|
UTF-8
|
Java
| 477 |
java
|
RequiredLogin.java
|
Java
|
[
{
"context": "* @see{UserInterceptor.isRequiredLogin}\n * @author yuanjifeng\n */\n@Target({ElementType.METHOD, ElementType.TYPE",
"end": 309,
"score": 0.9973388910293579,
"start": 299,
"tag": "USERNAME",
"value": "yuanjifeng"
}
] | null |
[] |
package com.zlwh.hands.api.common.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 标识在Controller的方法上,用于标识该资源的访问权限。
* @see{UserInterceptor.isRequiredLogin}
* @author yuanjifeng
*/
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface RequiredLogin {
}
| 477 | 0.804598 | 0.804598 | 16 | 26.1875 | 17.671371 | 47 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.375 | false | false |
7
|
49ad9c0349b6e9ccc0298363778fd5de1e534831
| 32,796,370,311,728 |
52419e97b7a819fc8a9cae64617567e518e3247f
|
/app/src/main/java/sameer/com/minghug/MainPage.java
|
a3888995296acee393505f307bad3c7a270bf087
|
[] |
no_license
|
SameerBunty1995/MindHug1
|
https://github.com/SameerBunty1995/MindHug1
|
131736272b5ca2ca28ac2479884029f62a287272
|
94c911e29e5a6daa3b000f8f85d0a06f20e90beb
|
refs/heads/master
| 2022-04-23T04:16:46.462000 | 2020-04-10T16:27:01 | 2020-04-10T16:27:01 | 254,679,175 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package sameer.com.minghug;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.firebase.client.Firebase;
import com.google.firebase.auth.FirebaseAuth;
public class MainPage extends AppCompatActivity implements View.OnClickListener {
private CardView partnership, therapists, blog, event, connect;
FirebaseAuth mAuth;
//partnership
//therapists
//blog
//event
//connect
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_main_page );
partnership = (CardView) findViewById( R.id.cv1 );
therapists = (CardView) findViewById( R.id.cv3 );
blog = (CardView) findViewById( R.id.cv4 );
event = (CardView) findViewById( R.id.cv5);
connect = (CardView) findViewById( R.id.cv6 );
partnership.setOnClickListener( this );
therapists.setOnClickListener( this );
blog.setOnClickListener( this );
event.setOnClickListener( this );
connect.setOnClickListener( this );
mAuth = FirebaseAuth.getInstance();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate( R.menu.activity_main_menu, menu );
return super.onCreateOptionsMenu( menu );
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.sign_out:
FirebaseAuth.getInstance().signOut();
startActivity(new Intent(this, Login.class));
finish();
break;
case R.id.contact_us:
startActivity(new Intent(this, Connect.class));
finish();
}
return true;
}
// if (item.getItemId() == R.id.Sign_Out) ;
// {
// FirebaseAuth.getInstance().signOut();
// finish();
// startActivity(new Intent(this, Login.class));
// break;
//
// }
// if (item.getItemId() == R.id.contact_us) ;
// {
// Intent intent = new Intent( getApplicationContext(), Connect.class );
// startActivity( intent );
//
// }
// return super.onOptionsItemSelected( item );
// }
// @Override
// public boolean onOptionsItemSelected(MenuItem item) {
//
// switch (item.getItemId()){
// case R.id.menuLogout:
// FirebaseAuth.getInstance().signOut();
// finish();
// startActivity(new Intent(this, LoginActivity.class));
// break;
// case R.id.Settings:
// FirebaseAuth.getInstance().getFirebaseAuthSettings();
// finish();
// startActivity(new Intent(this, SettingsActivity.class));
// break;
// case R.id.my_account:
//
// Intent intent = new Intent(this, MyAccountActivity.class);
// if(usertype.equals("admin"))intent.putExtra("admin", "admin");
// startActivity(intent);
// }
// return true;
// }
@Override
public void onClick(View v) {
Intent i;
switch (v.getId()) {
case R.id.cv1:
i = new Intent( this, Partnership.class );
startActivity( i );
break;
case R.id.cv3:
i = new Intent( this, Therapists.class );
startActivity( i );
break;
case R.id.cv4:
i = new Intent( this, BlogResearch.class );
startActivity( i );
break;
case R.id.cv5:
i = new Intent( this, Events.class );
startActivity( i );
break;
case R.id.cv6:
i = new Intent( this, Connect.class );
startActivity( i );
break;
default:
break;
}
}
}
|
UTF-8
|
Java
| 4,274 |
java
|
MainPage.java
|
Java
|
[] | null |
[] |
package sameer.com.minghug;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import com.firebase.client.Firebase;
import com.google.firebase.auth.FirebaseAuth;
public class MainPage extends AppCompatActivity implements View.OnClickListener {
private CardView partnership, therapists, blog, event, connect;
FirebaseAuth mAuth;
//partnership
//therapists
//blog
//event
//connect
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate( savedInstanceState );
setContentView( R.layout.activity_main_page );
partnership = (CardView) findViewById( R.id.cv1 );
therapists = (CardView) findViewById( R.id.cv3 );
blog = (CardView) findViewById( R.id.cv4 );
event = (CardView) findViewById( R.id.cv5);
connect = (CardView) findViewById( R.id.cv6 );
partnership.setOnClickListener( this );
therapists.setOnClickListener( this );
blog.setOnClickListener( this );
event.setOnClickListener( this );
connect.setOnClickListener( this );
mAuth = FirebaseAuth.getInstance();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate( R.menu.activity_main_menu, menu );
return super.onCreateOptionsMenu( menu );
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case R.id.sign_out:
FirebaseAuth.getInstance().signOut();
startActivity(new Intent(this, Login.class));
finish();
break;
case R.id.contact_us:
startActivity(new Intent(this, Connect.class));
finish();
}
return true;
}
// if (item.getItemId() == R.id.Sign_Out) ;
// {
// FirebaseAuth.getInstance().signOut();
// finish();
// startActivity(new Intent(this, Login.class));
// break;
//
// }
// if (item.getItemId() == R.id.contact_us) ;
// {
// Intent intent = new Intent( getApplicationContext(), Connect.class );
// startActivity( intent );
//
// }
// return super.onOptionsItemSelected( item );
// }
// @Override
// public boolean onOptionsItemSelected(MenuItem item) {
//
// switch (item.getItemId()){
// case R.id.menuLogout:
// FirebaseAuth.getInstance().signOut();
// finish();
// startActivity(new Intent(this, LoginActivity.class));
// break;
// case R.id.Settings:
// FirebaseAuth.getInstance().getFirebaseAuthSettings();
// finish();
// startActivity(new Intent(this, SettingsActivity.class));
// break;
// case R.id.my_account:
//
// Intent intent = new Intent(this, MyAccountActivity.class);
// if(usertype.equals("admin"))intent.putExtra("admin", "admin");
// startActivity(intent);
// }
// return true;
// }
@Override
public void onClick(View v) {
Intent i;
switch (v.getId()) {
case R.id.cv1:
i = new Intent( this, Partnership.class );
startActivity( i );
break;
case R.id.cv3:
i = new Intent( this, Therapists.class );
startActivity( i );
break;
case R.id.cv4:
i = new Intent( this, BlogResearch.class );
startActivity( i );
break;
case R.id.cv5:
i = new Intent( this, Events.class );
startActivity( i );
break;
case R.id.cv6:
i = new Intent( this, Connect.class );
startActivity( i );
break;
default:
break;
}
}
}
| 4,274 | 0.539541 | 0.537202 | 138 | 29.963768 | 22.461048 | 84 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.652174 | false | false |
7
|
714d8e6d778bfb66b070a89c5a31a466119ca2ba
| 1,855,425,922,171 |
140ce19df2046cb5a4bb5cf0582eac30045be3ad
|
/political-system-service/src/main/java/com/viettel/politicalsystem/document/form/VofficeResponse.java
|
d1fb1d60f5ad0d89d5b873e0fd1dd9e5f9e314f2
|
[] |
no_license
|
omko0o/ctct2
|
https://github.com/omko0o/ctct2
|
cccff52961abfd71963f07d7963b1fbfac097970
|
cb4f7aa870600819212ac0736ed8c0360304b8dd
|
refs/heads/master
| 2020-05-01T11:15:15.646000 | 2019-03-25T02:16:40 | 2019-03-25T02:16:40 | 177,438,010 | 0 | 1 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.viettel.politicalsystem.document.form;
public class VofficeResponse {
private String fileName;
private String message;
private String errorCode;
private String content;
private Object data;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
|
UTF-8
|
Java
| 824 |
java
|
VofficeResponse.java
|
Java
|
[] | null |
[] |
package com.viettel.politicalsystem.document.form;
public class VofficeResponse {
private String fileName;
private String message;
private String errorCode;
private String content;
private Object data;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getErrorCode() {
return errorCode;
}
public void setErrorCode(String errorCode) {
this.errorCode = errorCode;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Object getData() {
return data;
}
public void setData(Object data) {
this.data = data;
}
}
| 824 | 0.728155 | 0.728155 | 41 | 19.097561 | 14.569941 | 50 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.536585 | false | false |
7
|
6ec43503154a04cbb578a385db5f2499cf518d08
| 4,561,255,311,406 |
5057ca053dc9d4e03f3e2a2badcdb1f5c3ac5779
|
/IPRF/src/business/PessoaSimples.java
|
15954120e88136605102e98db6ea412d524fabdb
|
[] |
no_license
|
rodrigocgo/SIFUNDAMENTO
|
https://github.com/rodrigocgo/SIFUNDAMENTO
|
eaa03ac6cb3354ef9298cb1671b2b670e299b8a2
|
b837e29e78c78e0879dd4640522b3598102c9af9
|
refs/heads/master
| 2021-01-22T15:16:00.552000 | 2017-10-17T19:41:58 | 2017-10-17T19:41:58 | 102,379,502 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package business;
public class PessoaSimples extends Pessoa
{
private DeclaraoSimples oDeclaracaoSimples;
public PessoaSimples(String sNome, String sCPF,double dTotalRendimento,double dContruibuicaoPrevidenciaria)
{
super(sNome, sCPF,dContruibuicaoPrevidenciaria);
oDeclaracaoSimples = new DeclaraoSimples(dTotalRendimento,dContruibuicaoPrevidenciaria);
}
public double calculaImposto()
{
return oDeclaracaoSimples.CalculaImposto();
}
}
|
UTF-8
|
Java
| 455 |
java
|
PessoaSimples.java
|
Java
|
[] | null |
[] |
package business;
public class PessoaSimples extends Pessoa
{
private DeclaraoSimples oDeclaracaoSimples;
public PessoaSimples(String sNome, String sCPF,double dTotalRendimento,double dContruibuicaoPrevidenciaria)
{
super(sNome, sCPF,dContruibuicaoPrevidenciaria);
oDeclaracaoSimples = new DeclaraoSimples(dTotalRendimento,dContruibuicaoPrevidenciaria);
}
public double calculaImposto()
{
return oDeclaracaoSimples.CalculaImposto();
}
}
| 455 | 0.821978 | 0.821978 | 16 | 27.4375 | 33.005623 | 109 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.5625 | false | false |
7
|
d01913c9a5360b790bd502371432507adffe84d0
| 11,484,742,572,819 |
a402ff81ec07b125e0ae1aa087021302eac257c8
|
/src/main/java/de/mrapp/tries/datastructure/UnmodifiableSortedStringTrie.java
|
3030a27a0ca8504870941a3787154a6d22d642dc
|
[
"Apache-2.0"
] |
permissive
|
michael-rapp/Tries
|
https://github.com/michael-rapp/Tries
|
18cb1255fd92931aaa3484cccd778df69156f13d
|
0982fcf2a564978ff911384b9a104caf3617daa5
|
refs/heads/master
| 2021-03-24T09:28:07.636000 | 2019-07-31T22:57:00 | 2019-07-31T22:57:00 | 109,584,703 | 2 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
/*
* Copyright 2017 - 2019 Michael Rapp
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package de.mrapp.tries.datastructure;
import de.mrapp.tries.SortedStringTrie;
import org.jetbrains.annotations.NotNull;
import java.util.*;
/**
* An immutable {@link SortedStringTrie}.
*
* @param <ValueType> The type of the values, which are stored by the trie
* @author Michael Rapp
* @since 1.0.0
*/
public class UnmodifiableSortedStringTrie<ValueType> extends
AbstractUnmodifiableStringTrie<ValueType, SortedStringTrie<ValueType>> implements
SortedStringTrie<ValueType> {
/**
* The constant serial version UID.
*/
private static final long serialVersionUID = 5046452071336030045L;
/**
* Creates a new unmodifiable sorted string trie.
*
* @param trie The trie, which should be encapsulated, as an instance of the generic type {@link
* SortedStringTrie}. The trie may not be null
*/
public UnmodifiableSortedStringTrie(@NotNull final SortedStringTrie<ValueType> trie) {
super(trie);
}
@Override
public final Entry<String, ValueType> lowerEntry(final String key) {
return trie.lowerEntry(key);
}
@Override
public final String lowerKey(final String key) {
return trie.lowerKey(key);
}
@Override
public final Entry<String, ValueType> floorEntry(final String key) {
return trie.floorEntry(key);
}
@Override
public final String floorKey(final String key) {
return trie.floorKey(key);
}
@Override
public final Entry<String, ValueType> ceilingEntry(final String key) {
return trie.ceilingEntry(key);
}
@Override
public final String ceilingKey(final String key) {
return trie.ceilingKey(key);
}
@Override
public final Entry<String, ValueType> higherEntry(final String key) {
return trie.higherEntry(key);
}
@Override
public final String higherKey(final String key) {
return trie.higherKey(key);
}
@Override
public final Entry<String, ValueType> firstEntry() {
return trie.firstEntry();
}
@Override
public final Entry<String, ValueType> lastEntry() {
return trie.lastEntry();
}
@Override
public final Entry<String, ValueType> pollFirstEntry() {
throw new UnsupportedOperationException();
}
@Override
public final Entry<String, ValueType> pollLastEntry() {
throw new UnsupportedOperationException();
}
@Override
public final NavigableMap<String, ValueType> descendingMap() {
return Collections.unmodifiableNavigableMap(trie.descendingMap());
}
@NotNull
@Override
public final NavigableSet<String> navigableKeySet() {
return Collections.unmodifiableNavigableSet(trie.navigableKeySet());
}
@Override
public final NavigableSet<String> descendingKeySet() {
return Collections.unmodifiableNavigableSet(trie.descendingKeySet());
}
@Override
public final NavigableMap<String, ValueType> subMap(final String fromKey,
final boolean fromInclusive,
final String toKey,
final boolean toInclusive) {
return Collections
.unmodifiableNavigableMap(trie.subMap(fromKey, fromInclusive, toKey, toInclusive));
}
@Override
public final NavigableMap<String, ValueType> headMap(final String toKey,
final boolean inclusive) {
return Collections.unmodifiableNavigableMap(trie.headMap(toKey, inclusive));
}
@Override
public final NavigableMap<String, ValueType> tailMap(final String fromKey,
final boolean inclusive) {
return Collections.unmodifiableNavigableMap(trie.tailMap(fromKey, inclusive));
}
@Override
public final Comparator<? super String> comparator() {
return trie.comparator();
}
@Override
public final SortedMap<String, ValueType> subMap(final String fromKey, final String toKey) {
return Collections.unmodifiableSortedMap(trie.subMap(fromKey, toKey));
}
@NotNull
@Override
public final SortedMap<String, ValueType> headMap(final String toKey) {
return Collections.unmodifiableSortedMap(trie.headMap(toKey));
}
@NotNull
@Override
public final SortedMap<String, ValueType> tailMap(final String fromKey) {
return Collections.unmodifiableSortedMap(trie.tailMap(fromKey));
}
@Override
public final String firstKey() {
return trie.firstKey();
}
@Override
public final String lastKey() {
return trie.lastKey();
}
@NotNull
@Override
public final SortedStringTrie<ValueType> subTrie(@NotNull final String sequence) {
return new UnmodifiableSortedStringTrie<>(trie.subTrie(sequence));
}
}
|
UTF-8
|
Java
| 5,593 |
java
|
UnmodifiableSortedStringTrie.java
|
Java
|
[
{
"context": "/*\n * Copyright 2017 - 2019 Michael Rapp\n *\n * Licensed under the Apache License, Version ",
"end": 40,
"score": 0.9998445510864258,
"start": 28,
"tag": "NAME",
"value": "Michael Rapp"
},
{
"context": "he values, which are stored by the trie\n * @author Michael Rapp\n * @since 1.0.0\n */\npublic class UnmodifiableSort",
"end": 883,
"score": 0.999688446521759,
"start": 871,
"tag": "NAME",
"value": "Michael Rapp"
}
] | null |
[] |
/*
* Copyright 2017 - 2019 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package de.mrapp.tries.datastructure;
import de.mrapp.tries.SortedStringTrie;
import org.jetbrains.annotations.NotNull;
import java.util.*;
/**
* An immutable {@link SortedStringTrie}.
*
* @param <ValueType> The type of the values, which are stored by the trie
* @author <NAME>
* @since 1.0.0
*/
public class UnmodifiableSortedStringTrie<ValueType> extends
AbstractUnmodifiableStringTrie<ValueType, SortedStringTrie<ValueType>> implements
SortedStringTrie<ValueType> {
/**
* The constant serial version UID.
*/
private static final long serialVersionUID = 5046452071336030045L;
/**
* Creates a new unmodifiable sorted string trie.
*
* @param trie The trie, which should be encapsulated, as an instance of the generic type {@link
* SortedStringTrie}. The trie may not be null
*/
public UnmodifiableSortedStringTrie(@NotNull final SortedStringTrie<ValueType> trie) {
super(trie);
}
@Override
public final Entry<String, ValueType> lowerEntry(final String key) {
return trie.lowerEntry(key);
}
@Override
public final String lowerKey(final String key) {
return trie.lowerKey(key);
}
@Override
public final Entry<String, ValueType> floorEntry(final String key) {
return trie.floorEntry(key);
}
@Override
public final String floorKey(final String key) {
return trie.floorKey(key);
}
@Override
public final Entry<String, ValueType> ceilingEntry(final String key) {
return trie.ceilingEntry(key);
}
@Override
public final String ceilingKey(final String key) {
return trie.ceilingKey(key);
}
@Override
public final Entry<String, ValueType> higherEntry(final String key) {
return trie.higherEntry(key);
}
@Override
public final String higherKey(final String key) {
return trie.higherKey(key);
}
@Override
public final Entry<String, ValueType> firstEntry() {
return trie.firstEntry();
}
@Override
public final Entry<String, ValueType> lastEntry() {
return trie.lastEntry();
}
@Override
public final Entry<String, ValueType> pollFirstEntry() {
throw new UnsupportedOperationException();
}
@Override
public final Entry<String, ValueType> pollLastEntry() {
throw new UnsupportedOperationException();
}
@Override
public final NavigableMap<String, ValueType> descendingMap() {
return Collections.unmodifiableNavigableMap(trie.descendingMap());
}
@NotNull
@Override
public final NavigableSet<String> navigableKeySet() {
return Collections.unmodifiableNavigableSet(trie.navigableKeySet());
}
@Override
public final NavigableSet<String> descendingKeySet() {
return Collections.unmodifiableNavigableSet(trie.descendingKeySet());
}
@Override
public final NavigableMap<String, ValueType> subMap(final String fromKey,
final boolean fromInclusive,
final String toKey,
final boolean toInclusive) {
return Collections
.unmodifiableNavigableMap(trie.subMap(fromKey, fromInclusive, toKey, toInclusive));
}
@Override
public final NavigableMap<String, ValueType> headMap(final String toKey,
final boolean inclusive) {
return Collections.unmodifiableNavigableMap(trie.headMap(toKey, inclusive));
}
@Override
public final NavigableMap<String, ValueType> tailMap(final String fromKey,
final boolean inclusive) {
return Collections.unmodifiableNavigableMap(trie.tailMap(fromKey, inclusive));
}
@Override
public final Comparator<? super String> comparator() {
return trie.comparator();
}
@Override
public final SortedMap<String, ValueType> subMap(final String fromKey, final String toKey) {
return Collections.unmodifiableSortedMap(trie.subMap(fromKey, toKey));
}
@NotNull
@Override
public final SortedMap<String, ValueType> headMap(final String toKey) {
return Collections.unmodifiableSortedMap(trie.headMap(toKey));
}
@NotNull
@Override
public final SortedMap<String, ValueType> tailMap(final String fromKey) {
return Collections.unmodifiableSortedMap(trie.tailMap(fromKey));
}
@Override
public final String firstKey() {
return trie.firstKey();
}
@Override
public final String lastKey() {
return trie.lastKey();
}
@NotNull
@Override
public final SortedStringTrie<ValueType> subTrie(@NotNull final String sequence) {
return new UnmodifiableSortedStringTrie<>(trie.subTrie(sequence));
}
}
| 5,581 | 0.658323 | 0.652244 | 182 | 29.736263 | 31.16152 | 100 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 0.368132 | false | false |
7
|
9d462cec7d779e51ad83b8f9ce5d6640b69307e2
| 22,342,419,911,047 |
3fdee51ec5c59fed29af7e82c49dced75ec7cd86
|
/OlleTheJeju/src/main/java/com/olle/dto/etc/SupportDto.java
|
0c10db95e7f5e5b2c2b7d93e5c8eb4babc86138d
|
[
"MIT"
] |
permissive
|
bojjlee/OLLE_THE_JEJU
|
https://github.com/bojjlee/OLLE_THE_JEJU
|
cb0fbcac2f7934fe77602993c3468a3325b75c3a
|
0a0620a15b95d48a4fe4cc7ccdc8d98d22a75955
|
refs/heads/main
| 2023-07-30T05:38:11.750000 | 2021-09-27T14:05:43 | 2021-09-27T14:05:43 | 412,399,175 | 0 | 0 | null | null | null | null | null | null | null | null | null | null | null | null | null |
package com.olle.dto.etc;
import java.util.Date;
public class SupportDto {
private int sup_num;
private String chat_group;
private String from_user;
private String to_user;
private String sup_content;
private Date sup_regdate;
public SupportDto() {
super();
}
public SupportDto(int sup_num, String chat_group, String from_user, String to_user, String sup_content,
Date sup_regdate) {
super();
this.sup_num = sup_num;
this.chat_group = chat_group;
this.from_user = from_user;
this.to_user = to_user;
this.sup_content = sup_content;
this.sup_regdate = sup_regdate;
}
public int getSup_num() {
return sup_num;
}
public void setSup_num(int sup_num) {
this.sup_num = sup_num;
}
public String getChat_group() {
return chat_group;
}
public void setChat_group(String chat_group) {
this.chat_group = chat_group;
}
public String getFrom_user() {
return from_user;
}
public void setFrom_user(String from_user) {
this.from_user = from_user;
}
public String getTo_user() {
return to_user;
}
public void setTo_user(String to_user) {
this.to_user = to_user;
}
public String getSup_content() {
return sup_content;
}
public void setSup_content(String sup_content) {
this.sup_content = sup_content;
}
public Date getSup_regdate() {
return sup_regdate;
}
public void setSup_regdate(Date sup_regdate) {
this.sup_regdate = sup_regdate;
}
}
|
UTF-8
|
Java
| 1,465 |
java
|
SupportDto.java
|
Java
|
[] | null |
[] |
package com.olle.dto.etc;
import java.util.Date;
public class SupportDto {
private int sup_num;
private String chat_group;
private String from_user;
private String to_user;
private String sup_content;
private Date sup_regdate;
public SupportDto() {
super();
}
public SupportDto(int sup_num, String chat_group, String from_user, String to_user, String sup_content,
Date sup_regdate) {
super();
this.sup_num = sup_num;
this.chat_group = chat_group;
this.from_user = from_user;
this.to_user = to_user;
this.sup_content = sup_content;
this.sup_regdate = sup_regdate;
}
public int getSup_num() {
return sup_num;
}
public void setSup_num(int sup_num) {
this.sup_num = sup_num;
}
public String getChat_group() {
return chat_group;
}
public void setChat_group(String chat_group) {
this.chat_group = chat_group;
}
public String getFrom_user() {
return from_user;
}
public void setFrom_user(String from_user) {
this.from_user = from_user;
}
public String getTo_user() {
return to_user;
}
public void setTo_user(String to_user) {
this.to_user = to_user;
}
public String getSup_content() {
return sup_content;
}
public void setSup_content(String sup_content) {
this.sup_content = sup_content;
}
public Date getSup_regdate() {
return sup_regdate;
}
public void setSup_regdate(Date sup_regdate) {
this.sup_regdate = sup_regdate;
}
}
| 1,465 | 0.664164 | 0.664164 | 63 | 21.253969 | 17.548996 | 104 | false | false | 0 | 0 | 0 | 0 | 0 | 0 | 1.777778 | false | false |
7
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.