blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 689M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 131 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 32 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 313 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
66dc5731736a461f009259db0edf680265c376d6 | 258de8e8d556901959831bbdc3878af2d8933997 | /utopia-service/utopia-feedback/utopia-feedback-impl/src/main/java/com/voxlearning/utopia/service/feedback/impl/dao/UserFeedbackPersistence.java | fd300b05545ae4c4bd3a2ce2c8c1887994ba5023 | [] | no_license | Explorer1092/vox | d40168b44ccd523748647742ec376fdc2b22160f | 701160b0417e5a3f1b942269b0e7e2fd768f4b8e | refs/heads/master | 2020-05-14T20:13:02.531549 | 2019-04-17T06:54:06 | 2019-04-17T06:54:06 | 181,923,482 | 0 | 4 | null | 2019-04-17T15:53:25 | 2019-04-17T15:53:25 | null | UTF-8 | Java | false | false | 2,077 | java | /*
* SHANGHAI SUNNY EDUCATION, INC. CONFIDENTIAL
*
* Copyright 2011-2017 Shanghai Sunny Education, Inc. All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains the property of
* Shanghai Sunny Education, Inc. and its suppliers, if any. The intellectual
* and technical concepts contained herein are proprietary to Shanghai Sunny
* Education, Inc. and its suppliers and may be covered by patents, patents
* in process, and are protected by trade secret or copyright law. Dissemination
* of this information or reproduction of this material is strictly forbidden
* unless prior written permission is obtained from Shanghai Sunny Education, Inc.
*/
package com.voxlearning.utopia.service.feedback.impl.dao;
import com.voxlearning.alps.annotation.cache.CacheBean;
import com.voxlearning.alps.annotation.cache.CacheMethod;
import com.voxlearning.alps.annotation.cache.CacheParameter;
import com.voxlearning.alps.dao.core.hql.Criteria;
import com.voxlearning.alps.dao.core.hql.Query;
import com.voxlearning.alps.dao.jdbc.dao.AlpsStaticJdbcDao;
import com.voxlearning.utopia.service.feedback.api.entities.UserFeedback;
import javax.inject.Named;
import java.util.Collection;
import java.util.List;
/**
* {@link UserFeedback} persistence implementation.
*
* @author RuiBao
* @version 0.1
* @since 13-8-21
*/
@Named("com.voxlearning.utopia.service.feedback.impl.dao.UserFeedbackPersistence")
@CacheBean(type = UserFeedback.class)
public class UserFeedbackPersistence extends AlpsStaticJdbcDao<UserFeedback, Long> {
@Override
protected void calculateCacheDimensions(UserFeedback document, Collection<String> dimensions) {
dimensions.add(UserFeedback.ck_id(document.getId()));
dimensions.add(UserFeedback.ck_userId(document.getUserId()));
}
@CacheMethod
public List<UserFeedback> findByUserId(@CacheParameter("userId") Long userId) {
Criteria criteria = Criteria.where("USER_ID").is(userId);
return query(Query.query(criteria));
}
}
| [
"wangahai@300.cn"
] | wangahai@300.cn |
a8185892ea68bba92d68163c8f0c56755d910a9d | 63489b9d7f48b5f95dd7823f1ee0e81beb88aba4 | /artrade/src/main/java/com/unionpay/mobile/android/net/b.java | 9ce50a839b0b8aec987e791e5244a47fa8db870d | [] | no_license | h4x0r139/MyApplication | 7f7b7b65c160cad5af5baa5727163fae5d26a2bb | b71648d2963761efdfdf66de72075e590781c835 | refs/heads/master | 2020-05-21T14:55:31.488110 | 2019-05-28T11:29:45 | 2019-05-28T11:29:45 | 63,512,880 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,531 | java | package com.unionpay.mobile.android.net;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import javax.net.ssl.X509TrustManager;
import javax.security.auth.x500.X500Principal;
public final class b
implements X509TrustManager
{
private X509TrustManager a = null;
public b()
throws NoSuchAlgorithmException, KeyStoreException
{
TrustManagerFactory localTrustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
localTrustManagerFactory.init(null);
TrustManager[] arrayOfTrustManager = localTrustManagerFactory.getTrustManagers();
if (arrayOfTrustManager.length == 0)
throw new NoSuchAlgorithmException("no trust manager found");
this.a = ((X509TrustManager)arrayOfTrustManager[0]);
}
public final void checkClientTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString)
throws CertificateException
{
this.a.checkClientTrusted(paramArrayOfX509Certificate, paramString);
}
public final void checkServerTrusted(X509Certificate[] paramArrayOfX509Certificate, String paramString)
throws CertificateException
{
this.a.checkServerTrusted(paramArrayOfX509Certificate, paramString);
try
{
X500Principal localX500Principal1 = paramArrayOfX509Certificate[0].getIssuerX500Principal();
if ((!localX500Principal1.getName().equals(HttpNative.a().getIssuer(0))) && (!localX500Principal1.getName().equals(HttpNative.a().getIssuer(1))) && (!localX500Principal1.getName().equals(HttpNative.a().getIssuer(2))))
throw new CertificateException();
}
catch (Exception localException)
{
throw new CertificateException();
}
X500Principal localX500Principal2 = paramArrayOfX509Certificate[0].getSubjectX500Principal();
if ((!localX500Principal2.getName().equals(HttpNative.a().getSubject(0))) && (!localX500Principal2.getName().equals(HttpNative.a().getSubject(1))) && (!localX500Principal2.getName().equals(HttpNative.a().getSubject(2))))
throw new CertificateException();
}
public final X509Certificate[] getAcceptedIssuers()
{
return this.a.getAcceptedIssuers();
}
}
/* Location: D:\yinxm\Android\work\拍卖\apktool\artrade\classes_dex2jar.jar
* Qualified Name: com.unionpay.mobile.android.net.b
* JD-Core Version: 0.6.2
*/ | [
"h4x0r_001@163.com"
] | h4x0r_001@163.com |
30bee29136596c1438d9cf134eb72ad407ed4fde | 869196e2c9c0f888ce5ca6f893fa287b282531fe | /01_Language/03_Java/j2ee/src/main/java/com/onevgo/mvc/db/JdbcUtils.java | ed9ac3999aca491dc6531d5e5617346ef63c390e | [
"MIT"
] | permissive | lizhenggan/TwentyFour | c669240643d94c9d531c374cc0fc3f74888f986d | 2c9848ca15c25092afdfea3b2fbb0d660e4fd446 | refs/heads/master | 2023-02-13T18:04:04.176787 | 2021-01-08T13:26:17 | 2021-01-08T13:26:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 727 | java | package com.onevgo.mvc.db;
import com.mchange.v2.c3p0.ComboPooledDataSource;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
public class JdbcUtils {
private static DataSource dataSource = new ComboPooledDataSource("mvc");
public static void releaseConnection(Connection connection) {
try {
if (connection != null) {
connection.close();
}
} catch (SQLException e) {
e.printStackTrace();
}
}
/**
* 返回数据源的一个Connection对象
*
* @return
*/
public static Connection getConnection() throws SQLException {
return dataSource.getConnection();
}
}
| [
"176462329@qq.com"
] | 176462329@qq.com |
f5107018867f8f952247bdd1c345165d464a41f1 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Jsoup-84/org.jsoup.helper.W3CDom/BBC-F0-opt-40/tests/25/org/jsoup/helper/W3CDom_ESTest.java | 49486f8db9b3a899fae9d2734c2179f4d358bae5 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 9,679 | java | /*
* This file was automatically generated by EvoSuite
* Fri Oct 22 23:53:34 GMT 2021
*/
package org.jsoup.helper;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.jsoup.helper.W3CDom;
import org.jsoup.nodes.DataNode;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.Node;
import org.jsoup.parser.Parser;
import org.junit.runner.RunWith;
import org.w3c.dom.DOMException;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class W3CDom_ESTest extends W3CDom_ESTest_scaffolding {
@Test(timeout = 4000)
public void test00() throws Throwable {
Document document0 = Parser.parseBodyFragment("Nnput", "Nnput");
W3CDom w3CDom0 = new W3CDom();
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
W3CDom.W3CBuilder w3CDom_W3CBuilder0 = new W3CDom.W3CBuilder(document1);
Element element0 = new Element(":lt(");
// Undeclared exception!
try {
w3CDom_W3CBuilder0.head(element0, 778);
fail("Expecting exception: DOMException");
} catch(DOMException e) {
}
}
@Test(timeout = 4000)
public void test01() throws Throwable {
Document document0 = Parser.parseBodyFragmentRelaxed("nth-l-of-typj", "nth-l-of-typj");
W3CDom w3CDom0 = new W3CDom();
document0.tagName("nth-l-of-typj");
document0.prependChild(document0);
// Undeclared exception!
w3CDom0.fromJsoup(document0);
}
@Test(timeout = 4000)
public void test02() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = Parser.parseBodyFragmentRelaxed("", "");
w3CDom0.factory = null;
// Undeclared exception!
try {
w3CDom0.fromJsoup(document0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.jsoup.helper.W3CDom", e);
}
}
@Test(timeout = 4000)
public void test03() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = new Document("");
// Undeclared exception!
try {
w3CDom0.fromJsoup(document0);
fail("Expecting exception: IndexOutOfBoundsException");
} catch(IndexOutOfBoundsException e) {
//
// Index: 0, Size: 0
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test04() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
// Undeclared exception!
try {
w3CDom0.fromJsoup((Document) null);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Object must not be null
//
verifyException("org.jsoup.helper.Validate", e);
}
}
@Test(timeout = 4000)
public void test05() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = new Document("");
Document document1 = document0.normalise();
// Undeclared exception!
try {
w3CDom0.convert(document1, (org.w3c.dom.Document) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test06() throws Throwable {
Document document0 = Document.createShell("5V\"VsOZ-");
W3CDom w3CDom0 = new W3CDom();
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
Element element0 = document0.attr("", true);
document0.prependChild(element0);
// Undeclared exception!
try {
w3CDom0.convert(document0, document1);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// String must not be empty
//
verifyException("org.jsoup.helper.Validate", e);
}
}
@Test(timeout = 4000)
public void test07() throws Throwable {
Document document0 = Document.createShell("5V\"VsOZ-");
W3CDom w3CDom0 = new W3CDom();
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
// Undeclared exception!
try {
w3CDom0.convert(document0, document1);
fail("Expecting exception: DOMException");
} catch(DOMException e) {
}
}
@Test(timeout = 4000)
public void test08() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = Parser.parseBodyFragment("gAs", "BYXC");
document0.prependElement(")2Xr*:ttxE[");
// Undeclared exception!
try {
w3CDom0.fromJsoup(document0);
fail("Expecting exception: DOMException");
} catch(DOMException e) {
}
}
@Test(timeout = 4000)
public void test09() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Parser parser0 = Parser.htmlParser();
Document document0 = parser0.parseInput("xmlns:", "xmlns:y!o6ll6=4xy})s");
Element element0 = document0.attr("xmlns:y!o6ll6=4xy})s", "1d=b\"t");
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
W3CDom.W3CBuilder w3CDom_W3CBuilder0 = new W3CDom.W3CBuilder(document1);
// Undeclared exception!
try {
w3CDom_W3CBuilder0.head(element0, 0);
fail("Expecting exception: DOMException");
} catch(DOMException e) {
}
}
@Test(timeout = 4000)
public void test10() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = Parser.parseBodyFragment("xmlns:org.jsou.nodes.elOment", "xmlns");
document0.attr("xmlns", "56#%<Q/:qTp,>'qK@un");
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
W3CDom.W3CBuilder w3CDom_W3CBuilder0 = new W3CDom.W3CBuilder(document1);
// Undeclared exception!
try {
w3CDom_W3CBuilder0.head(document0, 1503);
fail("Expecting exception: DOMException");
} catch(DOMException e) {
}
}
@Test(timeout = 4000)
public void test11() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = Parser.parseBodyFragmentRelaxed("<html>\n<head>\n<META http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n</head>\n<body>Y!O6lL6=4xy})S</body>\n</html>\n", "xmlns:yti$6");
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
assertNotNull(document1);
}
@Test(timeout = 4000)
public void test12() throws Throwable {
Document document0 = Parser.parseBodyFragment("%@qDDtj2Isr%'", "%@qDDtj2Isr%'");
document0.attr(".N2", ".N2");
W3CDom w3CDom0 = new W3CDom();
document0.tagName("org.jsoup.nodes.Comment");
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
W3CDom.W3CBuilder w3CDom_W3CBuilder0 = new W3CDom.W3CBuilder(document1);
// Undeclared exception!
try {
w3CDom_W3CBuilder0.head(document0, 1063);
fail("Expecting exception: DOMException");
} catch(DOMException e) {
}
}
@Test(timeout = 4000)
public void test13() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = Document.createShell("0");
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
W3CDom.W3CBuilder w3CDom_W3CBuilder0 = new W3CDom.W3CBuilder(document1);
w3CDom_W3CBuilder0.head((Node) null, (-1441842180));
}
@Test(timeout = 4000)
public void test14() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = Parser.parseBodyFragment("xmlns:", "xmlns:");
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
W3CDom.W3CBuilder w3CDom_W3CBuilder0 = new W3CDom.W3CBuilder(document1);
DataNode dataNode0 = new DataNode("IS");
// Undeclared exception!
try {
w3CDom_W3CBuilder0.head(dataNode0, 62);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test15() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = Parser.parseBodyFragment("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>", "[a-zA-Z_:][-a-zA-Z0-9_:.]*");
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
assertNotNull(document1);
}
@Test(timeout = 4000)
public void test16() throws Throwable {
W3CDom w3CDom0 = new W3CDom();
Document document0 = new Document("");
// Undeclared exception!
try {
w3CDom0.convert(document0, (org.w3c.dom.Document) null);
fail("Expecting exception: IndexOutOfBoundsException");
} catch(IndexOutOfBoundsException e) {
//
// Index: 0, Size: 0
//
verifyException("java.util.ArrayList", e);
}
}
@Test(timeout = 4000)
public void test17() throws Throwable {
Document document0 = Document.createShell("5V\"VsOZ-");
W3CDom w3CDom0 = new W3CDom();
org.w3c.dom.Document document1 = w3CDom0.fromJsoup(document0);
w3CDom0.asString(document1);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
62200c2330a0c160e2cfd61bf1a7b65d1e5c4ed7 | d57d9c045448dc1fb2b94e81fe54945d4807bf14 | /Assignment_1/AlphabetAPP/app/src/main/java/com/example/alphabetapp/MainActivityP.java | 266186b16f452785197f8738fc38fe08b529f738 | [] | no_license | RabiaMumtaz16/20210224 | 6ffc848746c1ce34061035bdeab008c2c2ccf0c5 | bdbb81e9fb21a5c9a1ce3fd693163dce797005fa | refs/heads/main | 2023-07-03T10:30:09.533816 | 2021-04-14T18:28:54 | 2021-04-14T18:28:54 | 342,936,469 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package com.example.alphabetapp;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivityP extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_p);
}
} | [
"rabia413@outlook.com"
] | rabia413@outlook.com |
f31cadc436220a3d42d70630674f59d98eede082 | 8833dde7981fde3c7ce4aba6f9f13bca005e3dff | /src/Posicion/Posicion.java | 2d0601740e4ec53e66411f9b8c0d988f40dc50d2 | [] | no_license | jk2212/CarreraCarros | d39d502988791111e96de7e9e23d322f79f653f4 | c653947f70c39df06c03cc35b498b1c8b0dbb19b | refs/heads/main | 2023-07-02T16:30:36.878568 | 2021-08-01T15:25:04 | 2021-08-01T15:25:04 | 391,556,115 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 579 | java |
package Posicion;
public class Posicion implements Props{
private Integer actual;
private Integer meta;
@Override
public Integer actual() {
return actual;
}
@Override
public Integer meta() {
return meta;
}
public void setActual(Integer actual) {
this.actual = actual;
}
public Posicion(Integer actual, Integer meta) {
this.actual = actual;
this.meta = meta;
}
}
interface Props {
public Integer actual();
public Integer meta();
}
| [
"noreply@github.com"
] | jk2212.noreply@github.com |
25ad8bc9c61599b2a8672de80e794987b24db67f | 1d41a283f7e3b7df3fc0c72e30134bffc7522cdf | /src/shop/entity/productDetail.java | 6e30213b478ad41e5474478d9573e33c3a4d1c04 | [] | no_license | truongquangkhai99/anshop | 55829cf3efe89e1c313907160b8091f95ad8ae9c | d92c7bbbc653df95c6d7b4a814c099e4f62d26bf | refs/heads/main | 2023-03-29T05:02:58.227887 | 2021-04-01T11:19:03 | 2021-04-01T11:19:03 | 479,907,100 | 1 | 0 | null | 2022-04-10T03:55:55 | 2022-04-10T03:55:54 | null | UTF-8 | Java | false | false | 1,433 | java | package shop.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@Table(name="ProductDetail")
public class productDetail {
@Id
@GeneratedValue
@Column(name="Id")
private Integer id;
@Column(name="Size")
private Integer size;
@Column(name="Quanlity")
private Integer quanlity;
@Column(name="Status")
private Integer status;
@ManyToOne
@JoinColumn(name="ProductId")
private product Product;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getSize() {
return size;
}
public void setSize(Integer size) {
this.size = size;
}
public Integer getQuanlity() {
return quanlity;
}
public void setQuanlity(Integer quanlity) {
this.quanlity = quanlity;
}
public product getProduct() {
return Product;
}
public void setProduct(product product) {
Product = product;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public productDetail(Integer id, Integer size, Integer quanlity, Integer status, product product) {
super();
this.id = id;
this.size = size;
this.quanlity = quanlity;
this.status = status;
Product = product;
}
public productDetail() {
super();
// TODO Auto-generated constructor stub
}
}
| [
"81751920+truongan99@users.noreply.github.com"
] | 81751920+truongan99@users.noreply.github.com |
cf13055f09e69400c90eca22f5c805e66d3802ba | 91e4ffcb4558c8bfdab60c5e66eabfb2833f0d5b | /N2020/src/br/main/Main.java | 28ce699b459a5b21427e54bdd16fe6d4b53c5896 | [] | no_license | GabrielBoro/Programacao-Orientada-a-Objetos | 0ca036c41258631a1694af3a5292cca706ec1999 | ce4b9da00c51c0b46a18fec8dcf4dd0d4755c133 | refs/heads/master | 2023-03-22T05:31:18.292999 | 2021-03-14T16:48:48 | 2021-03-14T16:48:48 | 281,995,412 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,728 | java | package br.main;
import br.metodos.Metodos;
import br.metodos.OpcaoException;
import br.pacientes.Paciente;
import javax.swing.*;
import java.util.LinkedList;
import java.util.List;
public class Main {
public static void main(String[] args) {
List<Paciente> filaPaciente = new LinkedList<>();
List<Paciente> filaRegistro = new LinkedList<>();
String sintomas[] = new String[]{"Febre", "Tosse seca", "Cansaço", "Falta de ar"};
Metodos m = new Metodos();
int resp = 0;
int qtdMaxInternamentos = 0;
qtdMaxInternamentos = m.setMaxInternamentos();
do {
try {
resp = m.telaPrincipal();
if (resp != 1 && resp != 5 && filaRegistro.isEmpty()) {
throw new OpcaoException();
}
switch (resp) {
case 1:
m.registrarPaciente(sintomas, filaPaciente, filaRegistro, qtdMaxInternamentos);
break;
case 2:
m.pesquisarPaciente(filaRegistro);
break;
case 3:
m.liberarPaciente(filaPaciente, filaRegistro);
break;
case 4:
m.listarPacientes(filaPaciente, filaRegistro);
break;
}
} catch (NumberFormatException e) {
JOptionPane.showMessageDialog(null, "A opção deve ser um número");
} catch (OpcaoException e){
JOptionPane.showMessageDialog(null, "Nenhum paciente registrado");
}
} while (resp != 5);
}
}
| [
"61744698+GabrielBoro@users.noreply.github.com"
] | 61744698+GabrielBoro@users.noreply.github.com |
4bcbdc831e08cda38be4b1f3ce5f6db0f4c29910 | 176811cab43c428cbf199dd6ffac1ee054b04c1b | /app/src/main/java/com/example/semana6/AuthActivity.java | b3637720ba3867a8d4efd02e9b27269a5839ee13 | [] | no_license | eduardo123x/Semana6 | 6741851904c7f6409ac2f9dc53582b6b32a2fe95 | 11f19359c30a6ef8995d61c9def464115af09c2e | refs/heads/master | 2020-09-13T14:41:04.851324 | 2020-01-09T03:05:13 | 2020-01-09T03:05:13 | 222,819,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,107 | java | package com.example.semana6;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.example.semana6.models.Users;
public class AuthActivity extends AppCompatActivity {
Button btnLogin;
EditText txtUser;
EditText txtPassword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_auth);
btnLogin=findViewById(R.id.btnLogin);
txtUser=findViewById(R.id.txtUser);
txtPassword=findViewById(R.id.txtPassword);
btnLogin.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if ( Users.passwodIsValid(txtUser.getText().toString() , txtPassword.getText().toString())){
Intent s = new Intent(AuthActivity.this, MainActivity.class);
startActivity(s);
}
}
});
}
}
| [
"Admin@IHR80PBF441.continental.edu.pe"
] | Admin@IHR80PBF441.continental.edu.pe |
1fe48e510960dd43e369281d2d19e9584cdacc5a | 1ac90710711521e1abfb839f1b3febdb27fbb6cd | /app/server/appsmith-interfaces/src/main/java/com/appsmith/external/helpers/restApiUtils/helpers/SmartSubstitutionUtils.java | a6add9675f7438c068b4d4c9add4a536ff97c733 | [
"Apache-2.0"
] | permissive | nisanthchunduru/appsmith | f1926b62e63c75d1830421b51061a4bd0dea6b9d | 221857aeb56475edc7a3e784a283f83c98d8eeb5 | refs/heads/master | 2023-09-04T07:24:39.491153 | 2023-08-11T15:43:17 | 2023-08-11T15:43:17 | 296,965,395 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,298 | java | package com.appsmith.external.helpers.restApiUtils.helpers;
import com.appsmith.external.models.Property;
import lombok.NoArgsConstructor;
import org.apache.commons.collections.CollectionUtils;
import java.util.List;
@NoArgsConstructor
public class SmartSubstitutionUtils {
public static final int SMART_SUBSTITUTION_INDEX = 0;
public boolean isSmartSubstitutionEnabled(List<Property> properties) {
boolean smartSubstitution;
if (CollectionUtils.isEmpty(properties)) {
// In case the smart json substitution configuration is missing, default to true
smartSubstitution = true;
// Since properties is not empty, we are guaranteed to find the first property.
} else if (properties.get(SMART_SUBSTITUTION_INDEX) != null) {
Object ssubValue = properties.get(SMART_SUBSTITUTION_INDEX).getValue();
if (ssubValue instanceof Boolean) {
smartSubstitution = (Boolean) ssubValue;
} else if (ssubValue instanceof String) {
smartSubstitution = Boolean.parseBoolean((String) ssubValue);
} else {
smartSubstitution = true;
}
} else {
smartSubstitution = true;
}
return smartSubstitution;
}
}
| [
"noreply@github.com"
] | nisanthchunduru.noreply@github.com |
1c2207de8f0f5ca841142e1c6eff4927f4c550a4 | ad21934baa88cb1abb0886aca154d0342537abdc | /awifi-np-biz-pub/src/main/java/com/awifi/np/biz/pub/system/location/controller/LocationController.java | 2b6d12e535991c5573002caef9a68e4a0ec3572a | [] | no_license | un-knower/awifi-np-biz | 5b74f89a1810d6d4accbfb3c52797f9adf9e00bb | ade4d0fa580100707325db0d8cfacee3f525ce21 | refs/heads/master | 2020-03-17T21:20:43.755520 | 2017-08-23T02:36:12 | 2017-08-23T02:36:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,023 | java | package com.awifi.np.biz.pub.system.location.controller;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.awifi.np.biz.api.client.dbcenter.location.util.LocationClient;
import com.awifi.np.biz.common.base.constants.RedisConstants;
import com.awifi.np.biz.common.base.controller.BaseController;
import com.awifi.np.biz.common.redis.util.RedisUtil;
import com.awifi.np.biz.common.security.user.model.SessionUser;
import com.awifi.np.biz.common.security.user.util.SessionUtil;
import com.awifi.np.biz.pub.system.location.service.LocationService;
/**
* 版权所有: 爱WiFi无线运营中心
* 创建日期:2017年1月22日 上午8:46:38
* 创建作者:周颖
* 文件名称:LocationController.java
* 版本: v1.0
* 功能:地区控制层
* 修改记录:
*/
@Controller
@SuppressWarnings("rawtypes")
public class LocationController extends BaseController {
/**地区服务层*/
@Resource(name = "locationService")
private LocationService locationService;
/**
* 地区缓存
* @param accessToken access_token
* @return 结果
* @author 周颖
* @throws Exception
* @date 2017年1月22日 上午9:26:15
*/
@RequestMapping(method = RequestMethod.GET,value = "/pubsrv/location/cache")
@ResponseBody
public Map cache(@RequestParam(value="access_token",required=true)String accessToken) throws Exception{
LocationClient.cache();//缓存地区数据
return this.successMsg();//返回
}
/**
* 清除地区缓存
* @param accessToken access_token
* @return 结果
* @author 周颖
* @date 2017年1月22日 上午11:09:01
*/
@RequestMapping(method = RequestMethod.GET,value = "/pubsrv/location/cache/clear")
@ResponseBody
public Map cacheClear(@RequestParam(value="access_token",required=true)String accessToken){
String key = RedisConstants.LOCATION + "*";//生成key
Set<String> keySet = RedisUtil.keys(key);//批量获取key
Long count = RedisUtil.delBatch(keySet);//批量删除
logger.debug("提示:redis共删除 "+ count +" 条数据");
return this.successMsg();//返回
}
/**
* 获取所有省
* @param accessToken access_token
* @param request 请求
* @return 省
* @author 周颖
* @throws Exception
* @date 2017年1月22日 下午1:48:35
*/
@RequestMapping(method = RequestMethod.GET,value = "/pubsrv/provinces")
@ResponseBody
public Map getProvinces(@RequestParam(value="access_token",required=true)String accessToken, HttpServletRequest request) throws Exception{
SessionUser sessionUser = SessionUtil.getCurSessionUser(request);
List<Map<String,Object>> provinceMap = locationService.getProvinces(sessionUser);//获取所有省
return this.successMsg(provinceMap);
}
/**
* 获取所有市
* @param accessToken access_token
* @param request 请求
* @param parentId 省id
* @return 市
* @throws Exception
* @author 周颖
* @date 2017年1月22日 下午3:03:30
*/
@RequestMapping(method = RequestMethod.GET,value = "/pubsrv/cities")
@ResponseBody
public Map getCities(@RequestParam(value="access_token",required=true)String accessToken, HttpServletRequest request,
@RequestParam(value="parentid",required=true) String parentId) throws Exception{
SessionUser sessionUser = SessionUtil.getCurSessionUser(request);
List<Map<String,Object>> cityMap = locationService.getCities(sessionUser,parentId);//获取所有市
return this.successMsg(cityMap);
}
/**
* 获取所有区县
* @param accessToken access_token
* @param request 请求
* @param parentId 市id
* @return 区县
* @throws Exception
* @author 周颖
* @date 2017年1月23日 上午9:07:37
*/
@RequestMapping(method = RequestMethod.GET,value = "/pubsrv/areas")
@ResponseBody
public Map getAreas(@RequestParam(value="access_token",required=true)String accessToken, HttpServletRequest request,
@RequestParam(value="parentid",required=true) String parentId) throws Exception{
SessionUser sessionUser = SessionUtil.getCurSessionUser(request);
List<Map<String,Object>> areaMap = locationService.getAreas(sessionUser,parentId);//获取所有区县
return this.successMsg(areaMap);
}
} | [
"fangzhiwei229@gmail.com"
] | fangzhiwei229@gmail.com |
1287914ea6bd454cb18453b61c67d3313cb81e1e | 8c22dbdf17d80fba11293db6786f740f093a66ea | /HardwareStorage/src/main/java/dto/clases/pedido.java | 9de13c2b842d6c976b1f522d69248cddb82edc0c | [] | no_license | gmgutierrez/Project | 734e5292308ec8e660407c57f14e9e2f16e2bf58 | dac72f28ccc6124abb348a0e1149a919d61ddbe4 | refs/heads/master | 2021-08-19T06:02:03.686312 | 2017-11-24T22:34:25 | 2017-11-24T22:34:25 | 111,960,141 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 689 | java | package dto.clases;
public class pedido {
private int codPedido;
private String fecha;
private float total;
public pedido(int codpedido,String fechas,float tot){
setCodPedido(codpedido);
setFecha(fechas);
setTotal(tot);
}
public void print(){
System.out.println(getCodPedido()+"////"+getFecha()+"////"+getTotal());
}
public int getCodPedido() {
return codPedido;
}
public void setCodPedido(int codPedido) {
this.codPedido = codPedido;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}
public float getTotal() {
return total;
}
public void setTotal(float total) {
this.total = total;
}
}
| [
"32947429+gmgutierrez@users.noreply.github.com"
] | 32947429+gmgutierrez@users.noreply.github.com |
c132b4ed10eee9c7ec3bd418a712c304765f48cf | e29869b152fe62df78c101982bda780c7387bca0 | /src/main/java/parsing/generateddocumentprocessor/package-info.java | 0b0e3026ba25daf3010e2adf94ba3957a66ee1e5 | [] | no_license | gemcfadyen/CVParsingWithTextKernal | 53d3a306b5ed0002a2a965ad19b8872b4d1cab02 | 66a43b8b85549b433f0129029fda8fbd1dee24d8 | refs/heads/master | 2020-05-24T03:35:29.404489 | 2017-03-15T13:48:37 | 2017-03-15T13:48:37 | 84,818,154 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 155 | java | @javax.xml.bind.annotation.XmlSchema(namespace = "http://home.textkernel.nl/sourcebox/soap/documentProcessor")
package parsing.generateddocumentprocessor;
| [
"gemcfadyen@hotmail.co.uk"
] | gemcfadyen@hotmail.co.uk |
fc8e474e51c32640dc2157d14692cdacb1b3d8d5 | 94777246e5eb432faaea8e60fcf9b9f44a4d9b91 | /src/main/java/SortedArrayImpl.java | 353b6432bdbfffdf1c5caff8a46472530ec9bfec | [] | no_license | BioStarts/Agorithms_ArrayListImplimentation_sortingEfficiency | f3650c8b5e89681b5c104207fad6bcec25fbfb15 | 21020c3bb22367e45e6dd6b536a2031ae4f0fd18 | refs/heads/master | 2020-04-23T01:27:07.838272 | 2019-02-18T12:39:51 | 2019-02-18T12:39:51 | 170,812,958 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 939 | java | public class SortedArrayImpl<E extends Object & Comparable<? super E>> extends ArrayImpl<E> {
@Override
public void add(E value){
checkGrow();
int index;
for (index = 0; index < currentSize; index++) {
if (data[index].compareTo(value) > 0)
break;
}
for (int i = currentSize; i > index; i--) {
data[i] = data[i-1];
}
data[index] = value;
currentSize++;
}
@Override
public int indexOf(E value) {
int low = 0;
int high = currentSize - 1;
while (low <= high) {
int mid = (low + high)/2;
if (data[mid].equals(value))
return mid;
if (value.compareTo(data[mid]) < 0){
high = mid - 1;
}
else {
low = mid + 1;
}
}
return INVALID_INDEX;
}
}
| [
"vstartsev@amulex.ru"
] | vstartsev@amulex.ru |
57f5e4ed6b86996e37b2c890c1a735ff251fc2ae | 57787a5b86164bd1ee22deab2f7a90c611f533c0 | /SistProgram/src/com/sist/main/DBUtil.java | ba8791a64578516b3c34225c7177b5250e840235 | [] | no_license | pys-durup/SistProgram | 34af972902aed70b750baee591e0016a6223bae5 | 8e2f3713b8432ca5736122ad057f3aaf23c14f88 | refs/heads/dev | 2023-04-08T00:56:48.277533 | 2021-03-26T09:08:00 | 2021-03-26T09:08:00 | 322,977,960 | 1 | 2 | null | 2021-01-04T00:33:43 | 2020-12-20T02:27:29 | Java | UTF-8 | Java | false | false | 1,398 | java | package com.sist.main;
import java.sql.Connection;
import java.sql.DriverManager;
public class DBUtil {
private static Connection conn;
/**
* 데이터베이스 연결 메서드 입니다
* @return 연결된 Connection 객체
*/
public static Connection open() {
String url = "jdbc:oracle:thin:@localhost:1521:xe";
String id = "hr";
String pw = "java1234";
try {
// java.lang.ClassNotFoundException: oracle.jdbc.driverr.OracleDriver
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(url, id, pw);
return conn;
} catch (Exception e) {
System.out.println("primaryDBUtil.enopen()");
e.printStackTrace();
}
return null;
}
/**
* 데이터베이스 연결 메서드 입니다
* @param server 접속할 서버 주소 입니다
* @param id 접속할 계정명 입니다
* @param pw 접속할 비밀번호 입니다
* @return 연결된 Connection 객체를 반환합니다
*/
public static Connection open(String server, String id, String pw) {
String url = "jdbc:oracle:thin:@" + server + ":1521:xe";
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(url, id, pw);
return conn;
} catch (Exception e) {
System.out.println("primaryDBUtil.enopen()");
e.printStackTrace();
}
return null;
}
}
| [
"enenfnq@gmail.com"
] | enenfnq@gmail.com |
18b23fbfda5705168299ff84320339825e020c50 | 1909f3737d8a327188003ed06b2236305d369567 | /asbestos-client/src/main/java/gov/nist/asbestos/client/events/UITask.java | bf17085a96763a3a9ff6a5634872869619017dba | [] | no_license | vnmcosta/asbestos | 83be4529671d6b0020827ee1a7347fa9c96d3586 | 2b16555cc4fbc6d608dc43288a9a9ba7e3f5496c | refs/heads/master | 2022-10-22T07:12:24.861189 | 2020-06-15T17:09:23 | 2020-06-15T17:09:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,225 | java | package gov.nist.asbestos.client.events;
import gov.nist.asbestos.client.Base.ProxyBase;
import gov.nist.asbestos.client.client.Format;
import gov.nist.asbestos.client.events.Reader;
import gov.nist.asbestos.client.resolver.ResourceWrapper;
import gov.nist.asbestos.http.headers.Header;
import gov.nist.asbestos.http.headers.Headers;
import java.io.File;
public class UITask {
private int index;
private String label;
private String description;
private String requestHeader;
private String requestBody;
private String responseHeader;
private String responseBody;
public UITask(File eventDir, String taskLabel) {
description = Reader.read(eventDir, taskLabel, "description.txt");
requestHeader = Reader.read(eventDir, taskLabel, "request_header.txt");
requestBody = Reader.read(eventDir, taskLabel, "request_body.txt");
responseHeader = Reader.read(eventDir, taskLabel, "response_header.txt");
responseBody = Reader.read(eventDir, taskLabel, "response_body.txt");
}
public UITask(ResourceWrapper wrapper) {
index = 0;
label = "";
description = wrapper.getRef().toString();
requestHeader = new Headers().withContentType(Format.JSON.getContentType()).toString();
requestBody = ProxyBase.encode(wrapper.getResource(), Format.JSON);
responseBody = "";
responseHeader = "";
}
public boolean isHTMLResponse() {
Headers headers = new Headers(responseHeader);
return headers.getContentType().getValue().contains("html");
}
public int getIndex() {
return index;
}
public String getLabel() {
return label;
}
public String getDescription() {
return description;
}
public String getRequestHeader() {
return requestHeader;
}
public String getRequestBody() {
return requestBody;
}
public String getResponseHeader() {
return responseHeader;
}
public String getResponseBody() {
return responseBody;
}
public void setIndex(int index) {
this.index = index;
}
public void setLabel(String label) {
this.label = label;
}
}
| [
"bmajur@gmail.com"
] | bmajur@gmail.com |
578bd5dae83ec30dd4fff844f50c253256949544 | 446373f0cb6f194c665cc23f532af1b6c4d42e8b | /src/com/simplecodestuffs/action/PieChartServlet1.java | 7a6e32d3e94cb39e7fb6e294b25b889bb96adc4a | [] | no_license | birajdarabhishek1/DigitalLocker | 1ff501f8547f8bdc6326657e86d7c7ef1967bd34 | 3ace55701f5f2cc4f20cb775dfa74727d2bcb96c | refs/heads/master | 2020-03-12T22:41:36.473885 | 2018-04-24T12:55:27 | 2018-04-24T12:55:27 | 130,851,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,910 | java | package com.simplecodestuffs.action;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.SQLException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.jdbc.JDBCCategoryDataset;
import org.jfree.data.jdbc.JDBCPieDataset;
import com.simplecodestuffs.jdbc.DataAccessObject;
public class PieChartServlet1 extends HttpServlet {
private static final long serialVersionUID = 1L;
private Connection dbConnection = null;
public PieChartServlet1() {
dbConnection = DataAccessObject.getConnection();
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
JDBCCategoryDataset dataset = new JDBCCategoryDataset(dbConnection);
try {
dataset.executeQuery("SELECT id,filename,recall FROM analysis");
JFreeChart chart = ChartFactory.createBarChart(
"Recall", "file number", "Recall",
dataset, PlotOrientation.VERTICAL, false, true, false);
chart.setBorderVisible(true);
if (chart != null) {
int width = 600;
int height = 400;
response.setContentType("image/jpeg");
OutputStream out = response.getOutputStream();
ChartUtilities.writeChartAsJPEG(out, chart, width, height);
}
}
catch (SQLException e) {
System.err.println(e.getMessage());
}
}
public void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
}
} | [
"noreply@github.com"
] | birajdarabhishek1.noreply@github.com |
c0396de1e7124ec0b1de993d944b235c9ea09e5f | 794993f5a2f4b089b117da24bf6ef82b9893785c | /src/org/apache/pig/builtin/PigDump.java | c0a92e66df9c8abe06c49dff4e51cc48f6893fa9 | [
"Apache-2.0"
] | permissive | bigfootproject/pig | c7d367a4118c70a4473ae8ffaa46a113c574c5b1 | 65320471bf8dcce638da89dd953c2ae3fdb49cb9 | refs/heads/master | 2021-01-21T09:02:47.620361 | 2010-10-06T20:21:40 | 2010-10-06T20:21:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,392 | java | /*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.pig.builtin;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.pig.StoreFunc;
import org.apache.pig.data.Tuple;
public class PigDump implements StoreFunc {
public static String recordDelimiter = "\n";
OutputStream os;
public void bindTo(OutputStream os) throws IOException {
this.os = os;
}
public void finish() throws IOException {
}
public void putNext(Tuple f) throws IOException {
os.write((f.toString() + recordDelimiter).getBytes());
}
}
| [
"gates@apache.org"
] | gates@apache.org |
262788eab7c79b0d9f0b1e544ef0baa1be63e2bf | 1369425aa14d237632bf90650a8f078a079c04e8 | /src/main/java/MailSender/MailCode.java | cd13d54afe8504ca5f1b5b323806b646f4afc9d4 | [] | no_license | liepieshov/MailBox | 19ae96d9b80c5dbcae9b78c0d9acdda407d4b1d3 | d221bf14c2ee53be54933b75b3a8dccaa214f270 | refs/heads/master | 2022-12-03T18:18:14.248106 | 2017-11-17T15:02:08 | 2017-11-17T15:02:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 92 | java | package MailSender;
public interface MailCode {
String generateEmail(Client client);
}
| [
"liepieshov@ucu.edu.ua"
] | liepieshov@ucu.edu.ua |
1c18856e6f06d445d6c0bfe3a6d155338cbc1ef6 | 8ef19577b66ffedbd232b847b25168d074cc6f0b | /app/src/main/java/com/jcodee/demobackground/easy/PIISaludResponse.java | d3e1cf1d27e9dcc85dd75e9c5aa927ac4127fc4e | [] | no_license | johannfjs/demo-background | 57601865c6fc2f8119be672ba2892635686f4f77 | 519c50ad4f9eea373b7def4325288289671f3673 | refs/heads/master | 2022-11-15T16:10:19.112160 | 2020-07-03T05:34:09 | 2020-07-03T05:34:09 | 276,815,929 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,652 | java | package com.jcodee.demobackground.easy;
//----------------------------------------------------
//
// Generated by www.easywsdl.com
// Version: 5.6.0.0
//
// Created by Quasar Development
//
//---------------------------------------------------
import java.util.Hashtable;
import org.ksoap2.serialization.*;
public class PIISaludResponse extends PIIResponse implements KvmSerializable
{
public PIIArrayOfTamizajeAnemia TamizajesAnemia;
@Override
public void loadFromSoap(Object paramObj, PIIExtendedSoapSerializationEnvelope __envelope)
{
if (paramObj == null)
return;
AttributeContainer inObj=(AttributeContainer)paramObj;
super.loadFromSoap(paramObj, __envelope);
}
@Override
protected boolean loadProperty(PropertyInfo info,SoapObject soapObject,PIIExtendedSoapSerializationEnvelope __envelope)
{
Object obj = info.getValue();
if (info.name.equals("TamizajesAnemia"))
{
if(obj!=null)
{
Object j = obj;
this.TamizajesAnemia = (PIIArrayOfTamizajeAnemia)__envelope.get(j,PIIArrayOfTamizajeAnemia.class,false);
}
return true;
}
return super.loadProperty(info,soapObject,__envelope);
}
@Override
public Object getProperty(int propertyIndex) {
int count = super.getPropertyCount();
//!!!!! If you have a compilation error here then you are using old version of ksoap2 library. Please upgrade to the latest version.
//!!!!! You can find a correct version in Lib folder from generated zip file!!!!!
if(propertyIndex==count+0)
{
return this.TamizajesAnemia!=null?this.TamizajesAnemia:SoapPrimitive.NullSkip;
}
return super.getProperty(propertyIndex);
}
@Override
public int getPropertyCount() {
return super.getPropertyCount()+1;
}
@Override
public void getPropertyInfo(int propertyIndex, @SuppressWarnings("rawtypes") Hashtable arg1, PropertyInfo info)
{
int count = super.getPropertyCount();
if(propertyIndex==count+0)
{
info.type = PropertyInfo.VECTOR_CLASS;
info.name = "TamizajesAnemia";
info.namespace= "http://schemas.datacontract.org/2004/07/CunaMas.Component.CoreCuidadoDiurno.Logic.Dto";
}
super.getPropertyInfo(propertyIndex,arg1,info);
}
@Override
public void setProperty(int arg0, Object arg1)
{
}
}
| [
"johannfjs@gmail.com"
] | johannfjs@gmail.com |
3e699bdd88461ef8f5a6d87298b638a7b68a752d | 0322beb3812d69218bed5dce0387fa0cc54cfe42 | /java/operator/Multiply.java | 84134c5cf6c96c64383a1ef047d22b368383e017 | [] | no_license | 1962301/1 | 85ce75544a2cf1fe646438d5b5b361559af5a04f | 9e65dfdac17aef0c6d76ae0a3485ea4b3ab1babc | refs/heads/master | 2023-01-24T07:31:55.108394 | 2019-09-13T02:23:29 | 2019-09-13T02:23:29 | 206,287,289 | 0 | 0 | null | 2023-01-07T09:21:48 | 2019-09-04T09:52:56 | JavaScript | UTF-8 | Java | false | false | 257 | java | package operator;
import java.math.BigDecimal;
public class Multiply implements Operator{
@Override
public String cal(String a, String b) {
BigDecimal a1=new BigDecimal(a);
BigDecimal b1=new BigDecimal(b);
return a1.multiply(b1).toString();
}
}
| [
"cc1962301@hotmail.com"
] | cc1962301@hotmail.com |
5551351cec6273a4bc1dfd1090f4d9d94bec569b | 3699bb8d3704aa543d8c38edd791e9e0006a196f | /CustomEventManager/src/EventExpenseDeleteRecordOperation/SecurityFeatureType.java | 789d7b150648f42f49bd9ab76c970e0630e3f99b | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] | permissive | blackbaud-community/Blackbaud-CRM-Custom-Event-Manager-With-BizOps--Java- | 71b2c21f8e9a64885b5cddfd8694c2613f3e48c4 | fc2de28f952e41b6b944fd1d6c4f5c4882202891 | refs/heads/master | 2021-01-22T05:57:23.389771 | 2014-12-10T13:50:38 | 2014-12-10T13:50:38 | 26,242,127 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,668 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2012.01.12 at 11:16:42 AM EST
//
package EventExpenseDeleteRecordOperation;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for SecurityFeatureType.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="SecurityFeatureType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="None"/>
* <enumeration value="Form"/>
* <enumeration value="DataList"/>
* <enumeration value="RecordOperation"/>
* <enumeration value="BusinessProcess"/>
* <enumeration value="Dashboard"/>
* <enumeration value="SearchList"/>
* <enumeration value="SimpleDataList"/>
* <enumeration value="Task"/>
* <enumeration value="SmartQuery"/>
* <enumeration value="AdHocQueryView"/>
* <enumeration value="BatchType"/>
* <enumeration value="AddCodeTableEntry"/>
* <enumeration value="UpdateCodeTableEntry"/>
* <enumeration value="DeleteCodeTableEntry"/>
* <enumeration value="Batch"/>
* <enumeration value="BatchTemplate"/>
* <enumeration value="Kpi"/>
* <enumeration value="MergeTask"/>
* <enumeration value="SmartField"/>
* <enumeration value="GlobalChange"/>
* <enumeration value="ReportParameter"/>
* <enumeration value="SystemPrivilege"/>
* <enumeration value="ConfigurationData"/>
* <enumeration value="BatchTemplateCustomize"/>
* <enumeration value="BatchProcessor"/>
* <enumeration value="Page"/>
* <enumeration value="MapEntity"/>
* <enumeration value="ExportDefinition"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "SecurityFeatureType")
@XmlEnum
public enum SecurityFeatureType {
@XmlEnumValue("None")
NONE("None"),
@XmlEnumValue("Form")
FORM("Form"),
@XmlEnumValue("DataList")
DATA_LIST("DataList"),
@XmlEnumValue("RecordOperation")
RECORD_OPERATION("RecordOperation"),
@XmlEnumValue("BusinessProcess")
BUSINESS_PROCESS("BusinessProcess"),
@XmlEnumValue("Dashboard")
DASHBOARD("Dashboard"),
@XmlEnumValue("SearchList")
SEARCH_LIST("SearchList"),
@XmlEnumValue("SimpleDataList")
SIMPLE_DATA_LIST("SimpleDataList"),
@XmlEnumValue("Task")
TASK("Task"),
@XmlEnumValue("SmartQuery")
SMART_QUERY("SmartQuery"),
@XmlEnumValue("AdHocQueryView")
AD_HOC_QUERY_VIEW("AdHocQueryView"),
@XmlEnumValue("BatchType")
BATCH_TYPE("BatchType"),
@XmlEnumValue("AddCodeTableEntry")
ADD_CODE_TABLE_ENTRY("AddCodeTableEntry"),
@XmlEnumValue("UpdateCodeTableEntry")
UPDATE_CODE_TABLE_ENTRY("UpdateCodeTableEntry"),
@XmlEnumValue("DeleteCodeTableEntry")
DELETE_CODE_TABLE_ENTRY("DeleteCodeTableEntry"),
@XmlEnumValue("Batch")
BATCH("Batch"),
@XmlEnumValue("BatchTemplate")
BATCH_TEMPLATE("BatchTemplate"),
@XmlEnumValue("Kpi")
KPI("Kpi"),
@XmlEnumValue("MergeTask")
MERGE_TASK("MergeTask"),
@XmlEnumValue("SmartField")
SMART_FIELD("SmartField"),
@XmlEnumValue("GlobalChange")
GLOBAL_CHANGE("GlobalChange"),
@XmlEnumValue("ReportParameter")
REPORT_PARAMETER("ReportParameter"),
@XmlEnumValue("SystemPrivilege")
SYSTEM_PRIVILEGE("SystemPrivilege"),
@XmlEnumValue("ConfigurationData")
CONFIGURATION_DATA("ConfigurationData"),
@XmlEnumValue("BatchTemplateCustomize")
BATCH_TEMPLATE_CUSTOMIZE("BatchTemplateCustomize"),
@XmlEnumValue("BatchProcessor")
BATCH_PROCESSOR("BatchProcessor"),
@XmlEnumValue("Page")
PAGE("Page"),
@XmlEnumValue("MapEntity")
MAP_ENTITY("MapEntity"),
@XmlEnumValue("ExportDefinition")
EXPORT_DEFINITION("ExportDefinition");
private final String value;
SecurityFeatureType(String v) {
value = v;
}
public String value() {
return value;
}
public static SecurityFeatureType fromValue(String v) {
for (SecurityFeatureType c: SecurityFeatureType.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"John.Lyons@blackbaud.com"
] | John.Lyons@blackbaud.com |
79ee78851b124e39dbc08e64135c139f879d9008 | 55378d37a907a43625c5566be1ab9f918bd8fefd | /TigerTest/build/generated/source/r/debug/com/google/android/gms/maps/R.java | 0c48ddb02bca12379fddc5aac9121a6c8c068007 | [] | no_license | xanderfehsenfeld/TigerTest | 2940ce66436aee75be1fb8761b57f673ed37b028 | c4991edf122f333d9cdef4072daad08026895ad8 | refs/heads/master | 2021-05-30T17:38:18.931927 | 2016-02-22T15:40:33 | 2016-02-22T15:40:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 19,562 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package com.google.android.gms.maps;
public final class R {
public static final class attr {
public static final int adSize = 0x7f010026;
public static final int adSizes = 0x7f010027;
public static final int adUnitId = 0x7f010028;
public static final int ambientEnabled = 0x7f01004e;
public static final int appTheme = 0x7f0100ec;
public static final int buttonSize = 0x7f010064;
public static final int buyButtonAppearance = 0x7f0100f3;
public static final int buyButtonHeight = 0x7f0100f0;
public static final int buyButtonText = 0x7f0100f2;
public static final int buyButtonWidth = 0x7f0100f1;
public static final int cameraBearing = 0x7f01003f;
public static final int cameraTargetLat = 0x7f010040;
public static final int cameraTargetLng = 0x7f010041;
public static final int cameraTilt = 0x7f010042;
public static final int cameraZoom = 0x7f010043;
public static final int circleCrop = 0x7f01003d;
public static final int colorScheme = 0x7f010065;
public static final int environment = 0x7f0100ed;
public static final int fragmentMode = 0x7f0100ef;
public static final int fragmentStyle = 0x7f0100ee;
public static final int imageAspectRatio = 0x7f01003c;
public static final int imageAspectRatioAdjust = 0x7f01003b;
public static final int liteMode = 0x7f010044;
public static final int mapType = 0x7f01003e;
public static final int maskedWalletDetailsBackground = 0x7f0100f6;
public static final int maskedWalletDetailsButtonBackground = 0x7f0100f8;
public static final int maskedWalletDetailsButtonTextAppearance = 0x7f0100f7;
public static final int maskedWalletDetailsHeaderTextAppearance = 0x7f0100f5;
public static final int maskedWalletDetailsLogoImageType = 0x7f0100fa;
public static final int maskedWalletDetailsLogoTextColor = 0x7f0100f9;
public static final int maskedWalletDetailsTextAppearance = 0x7f0100f4;
public static final int scopeUris = 0x7f010066;
public static final int uiCompass = 0x7f010045;
public static final int uiMapToolbar = 0x7f01004d;
public static final int uiRotateGestures = 0x7f010046;
public static final int uiScrollGestures = 0x7f010047;
public static final int uiTiltGestures = 0x7f010048;
public static final int uiZoomControls = 0x7f010049;
public static final int uiZoomGestures = 0x7f01004a;
public static final int useViewLifecycle = 0x7f01004b;
public static final int windowTransitionStyle = 0x7f01002f;
public static final int zOrderOnTop = 0x7f01004c;
}
public static final class color {
public static final int common_action_bar_splitter = 0x7f0b001a;
public static final int common_google_signin_btn_text_dark = 0x7f0b0069;
public static final int common_google_signin_btn_text_dark_default = 0x7f0b001b;
public static final int common_google_signin_btn_text_dark_disabled = 0x7f0b001c;
public static final int common_google_signin_btn_text_dark_focused = 0x7f0b001d;
public static final int common_google_signin_btn_text_dark_pressed = 0x7f0b001e;
public static final int common_google_signin_btn_text_light = 0x7f0b006a;
public static final int common_google_signin_btn_text_light_default = 0x7f0b001f;
public static final int common_google_signin_btn_text_light_disabled = 0x7f0b0020;
public static final int common_google_signin_btn_text_light_focused = 0x7f0b0021;
public static final int common_google_signin_btn_text_light_pressed = 0x7f0b0022;
public static final int common_plus_signin_btn_text_dark = 0x7f0b006b;
public static final int common_plus_signin_btn_text_dark_default = 0x7f0b0023;
public static final int common_plus_signin_btn_text_dark_disabled = 0x7f0b0024;
public static final int common_plus_signin_btn_text_dark_focused = 0x7f0b0025;
public static final int common_plus_signin_btn_text_dark_pressed = 0x7f0b0026;
public static final int common_plus_signin_btn_text_light = 0x7f0b006c;
public static final int common_plus_signin_btn_text_light_default = 0x7f0b0027;
public static final int common_plus_signin_btn_text_light_disabled = 0x7f0b0028;
public static final int common_plus_signin_btn_text_light_focused = 0x7f0b0029;
public static final int common_plus_signin_btn_text_light_pressed = 0x7f0b002a;
public static final int wallet_bright_foreground_disabled_holo_light = 0x7f0b0053;
public static final int wallet_bright_foreground_holo_dark = 0x7f0b0054;
public static final int wallet_bright_foreground_holo_light = 0x7f0b0055;
public static final int wallet_dim_foreground_disabled_holo_dark = 0x7f0b0056;
public static final int wallet_dim_foreground_holo_dark = 0x7f0b0057;
public static final int wallet_dim_foreground_inverse_disabled_holo_dark = 0x7f0b0058;
public static final int wallet_dim_foreground_inverse_holo_dark = 0x7f0b0059;
public static final int wallet_highlighted_text_holo_dark = 0x7f0b005a;
public static final int wallet_highlighted_text_holo_light = 0x7f0b005b;
public static final int wallet_hint_foreground_holo_dark = 0x7f0b005c;
public static final int wallet_hint_foreground_holo_light = 0x7f0b005d;
public static final int wallet_holo_blue_light = 0x7f0b005e;
public static final int wallet_link_text_light = 0x7f0b005f;
public static final int wallet_primary_text_holo_light = 0x7f0b006f;
public static final int wallet_secondary_text_holo_dark = 0x7f0b0070;
}
public static final class drawable {
public static final int cast_ic_notification_0 = 0x7f02003b;
public static final int cast_ic_notification_1 = 0x7f02003c;
public static final int cast_ic_notification_2 = 0x7f02003d;
public static final int cast_ic_notification_connecting = 0x7f02003e;
public static final int cast_ic_notification_on = 0x7f02003f;
public static final int common_full_open_on_phone = 0x7f020043;
public static final int common_google_signin_btn_icon_dark = 0x7f020044;
public static final int common_google_signin_btn_icon_dark_disabled = 0x7f020045;
public static final int common_google_signin_btn_icon_dark_focused = 0x7f020046;
public static final int common_google_signin_btn_icon_dark_normal = 0x7f020047;
public static final int common_google_signin_btn_icon_dark_pressed = 0x7f020048;
public static final int common_google_signin_btn_icon_light = 0x7f020049;
public static final int common_google_signin_btn_icon_light_disabled = 0x7f02004a;
public static final int common_google_signin_btn_icon_light_focused = 0x7f02004b;
public static final int common_google_signin_btn_icon_light_normal = 0x7f02004c;
public static final int common_google_signin_btn_icon_light_pressed = 0x7f02004d;
public static final int common_google_signin_btn_text_dark = 0x7f02004e;
public static final int common_google_signin_btn_text_dark_disabled = 0x7f02004f;
public static final int common_google_signin_btn_text_dark_focused = 0x7f020050;
public static final int common_google_signin_btn_text_dark_normal = 0x7f020051;
public static final int common_google_signin_btn_text_dark_pressed = 0x7f020052;
public static final int common_google_signin_btn_text_light = 0x7f020053;
public static final int common_google_signin_btn_text_light_disabled = 0x7f020054;
public static final int common_google_signin_btn_text_light_focused = 0x7f020055;
public static final int common_google_signin_btn_text_light_normal = 0x7f020056;
public static final int common_google_signin_btn_text_light_pressed = 0x7f020057;
public static final int common_ic_googleplayservices = 0x7f020058;
public static final int common_plus_signin_btn_icon_dark = 0x7f020059;
public static final int common_plus_signin_btn_icon_dark_disabled = 0x7f02005a;
public static final int common_plus_signin_btn_icon_dark_focused = 0x7f02005b;
public static final int common_plus_signin_btn_icon_dark_normal = 0x7f02005c;
public static final int common_plus_signin_btn_icon_dark_pressed = 0x7f02005d;
public static final int common_plus_signin_btn_icon_light = 0x7f02005e;
public static final int common_plus_signin_btn_icon_light_disabled = 0x7f02005f;
public static final int common_plus_signin_btn_icon_light_focused = 0x7f020060;
public static final int common_plus_signin_btn_icon_light_normal = 0x7f020061;
public static final int common_plus_signin_btn_icon_light_pressed = 0x7f020062;
public static final int common_plus_signin_btn_text_dark = 0x7f020063;
public static final int common_plus_signin_btn_text_dark_disabled = 0x7f020064;
public static final int common_plus_signin_btn_text_dark_focused = 0x7f020065;
public static final int common_plus_signin_btn_text_dark_normal = 0x7f020066;
public static final int common_plus_signin_btn_text_dark_pressed = 0x7f020067;
public static final int common_plus_signin_btn_text_light = 0x7f020068;
public static final int common_plus_signin_btn_text_light_disabled = 0x7f020069;
public static final int common_plus_signin_btn_text_light_focused = 0x7f02006a;
public static final int common_plus_signin_btn_text_light_normal = 0x7f02006b;
public static final int common_plus_signin_btn_text_light_pressed = 0x7f02006c;
public static final int ic_plusone_medium_off_client = 0x7f020084;
public static final int ic_plusone_small_off_client = 0x7f020085;
public static final int ic_plusone_standard_off_client = 0x7f020086;
public static final int ic_plusone_tall_off_client = 0x7f020087;
public static final int powered_by_google_dark = 0x7f020097;
public static final int powered_by_google_light = 0x7f020098;
}
public static final class id {
public static final int adjust_height = 0x7f0c0018;
public static final int adjust_width = 0x7f0c0019;
public static final int android_pay = 0x7f0c0049;
public static final int android_pay_dark = 0x7f0c0040;
public static final int android_pay_light = 0x7f0c0041;
public static final int android_pay_light_with_border = 0x7f0c0042;
public static final int auto = 0x7f0c0025;
public static final int book_now = 0x7f0c0039;
public static final int buyButton = 0x7f0c0036;
public static final int buy_now = 0x7f0c003a;
public static final int buy_with = 0x7f0c003b;
public static final int buy_with_google = 0x7f0c003c;
public static final int cast_notification_id = 0x7f0c0004;
public static final int classic = 0x7f0c0043;
public static final int dark = 0x7f0c0026;
public static final int donate_with = 0x7f0c003d;
public static final int donate_with_google = 0x7f0c003e;
public static final int google_wallet_classic = 0x7f0c0044;
public static final int google_wallet_grayscale = 0x7f0c0045;
public static final int google_wallet_monochrome = 0x7f0c0046;
public static final int grayscale = 0x7f0c0047;
public static final int holo_dark = 0x7f0c0030;
public static final int holo_light = 0x7f0c0031;
public static final int hybrid = 0x7f0c001a;
public static final int icon_only = 0x7f0c0022;
public static final int light = 0x7f0c0027;
public static final int logo_only = 0x7f0c003f;
public static final int match_parent = 0x7f0c0038;
public static final int monochrome = 0x7f0c0048;
public static final int none = 0x7f0c000f;
public static final int normal = 0x7f0c000b;
public static final int production = 0x7f0c0032;
public static final int sandbox = 0x7f0c0033;
public static final int satellite = 0x7f0c001b;
public static final int selectionDetails = 0x7f0c0037;
public static final int slide = 0x7f0c0014;
public static final int standard = 0x7f0c0023;
public static final int strict_sandbox = 0x7f0c0034;
public static final int terrain = 0x7f0c001c;
public static final int test = 0x7f0c0035;
public static final int wide = 0x7f0c0024;
public static final int wrap_content = 0x7f0c002a;
}
public static final class integer {
public static final int google_play_services_version = 0x7f0a0004;
}
public static final class raw {
public static final int gtm_analytics = 0x7f050001;
}
public static final class string {
public static final int accept = 0x7f060038;
public static final int auth_google_play_services_client_facebook_display_name = 0x7f06003a;
public static final int auth_google_play_services_client_google_display_name = 0x7f06003b;
public static final int cast_notification_connected_message = 0x7f06003c;
public static final int cast_notification_connecting_message = 0x7f06003d;
public static final int cast_notification_disconnect = 0x7f06003e;
public static final int common_android_wear_notification_needs_update_text = 0x7f06000d;
public static final int common_android_wear_update_text = 0x7f06000e;
public static final int common_android_wear_update_title = 0x7f06000f;
public static final int common_google_play_services_api_unavailable_text = 0x7f060010;
public static final int common_google_play_services_enable_button = 0x7f060011;
public static final int common_google_play_services_enable_text = 0x7f060012;
public static final int common_google_play_services_enable_title = 0x7f060013;
public static final int common_google_play_services_error_notification_requested_by_msg = 0x7f060014;
public static final int common_google_play_services_install_button = 0x7f060015;
public static final int common_google_play_services_install_text_phone = 0x7f060016;
public static final int common_google_play_services_install_text_tablet = 0x7f060017;
public static final int common_google_play_services_install_title = 0x7f060018;
public static final int common_google_play_services_invalid_account_text = 0x7f060019;
public static final int common_google_play_services_invalid_account_title = 0x7f06001a;
public static final int common_google_play_services_needs_enabling_title = 0x7f06001b;
public static final int common_google_play_services_network_error_text = 0x7f06001c;
public static final int common_google_play_services_network_error_title = 0x7f06001d;
public static final int common_google_play_services_notification_needs_update_title = 0x7f06001e;
public static final int common_google_play_services_notification_ticker = 0x7f06001f;
public static final int common_google_play_services_sign_in_failed_text = 0x7f060020;
public static final int common_google_play_services_sign_in_failed_title = 0x7f060021;
public static final int common_google_play_services_unknown_issue = 0x7f060022;
public static final int common_google_play_services_unsupported_text = 0x7f060023;
public static final int common_google_play_services_unsupported_title = 0x7f060024;
public static final int common_google_play_services_update_button = 0x7f060025;
public static final int common_google_play_services_update_text = 0x7f060026;
public static final int common_google_play_services_update_title = 0x7f060027;
public static final int common_google_play_services_updating_text = 0x7f060028;
public static final int common_google_play_services_updating_title = 0x7f060029;
public static final int common_open_on_phone = 0x7f06002a;
public static final int common_signin_button_text = 0x7f06002b;
public static final int common_signin_button_text_long = 0x7f06002c;
public static final int create_calendar_message = 0x7f06003f;
public static final int create_calendar_title = 0x7f060040;
public static final int decline = 0x7f060041;
public static final int store_picture_message = 0x7f06004d;
public static final int store_picture_title = 0x7f06004e;
public static final int wallet_buy_button_place_holder = 0x7f060033;
}
public static final class style {
public static final int Theme_IAPTheme = 0x7f0800df;
public static final int WalletFragmentDefaultButtonTextAppearance = 0x7f0800e7;
public static final int WalletFragmentDefaultDetailsHeaderTextAppearance = 0x7f0800e8;
public static final int WalletFragmentDefaultDetailsTextAppearance = 0x7f0800e9;
public static final int WalletFragmentDefaultStyle = 0x7f0800ea;
}
public static final class styleable {
public static final int[] AdsAttrs = { 0x7f010026, 0x7f010027, 0x7f010028 };
public static final int AdsAttrs_adSize = 0;
public static final int AdsAttrs_adSizes = 1;
public static final int AdsAttrs_adUnitId = 2;
public static final int[] CustomWalletTheme = { 0x7f01002f };
public static final int CustomWalletTheme_windowTransitionStyle = 0;
public static final int[] LoadingImageView = { 0x7f01003b, 0x7f01003c, 0x7f01003d };
public static final int LoadingImageView_circleCrop = 2;
public static final int LoadingImageView_imageAspectRatio = 1;
public static final int LoadingImageView_imageAspectRatioAdjust = 0;
public static final int[] MapAttrs = { 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045, 0x7f010046, 0x7f010047, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d, 0x7f01004e };
public static final int MapAttrs_ambientEnabled = 16;
public static final int MapAttrs_cameraBearing = 1;
public static final int MapAttrs_cameraTargetLat = 2;
public static final int MapAttrs_cameraTargetLng = 3;
public static final int MapAttrs_cameraTilt = 4;
public static final int MapAttrs_cameraZoom = 5;
public static final int MapAttrs_liteMode = 6;
public static final int MapAttrs_mapType = 0;
public static final int MapAttrs_uiCompass = 7;
public static final int MapAttrs_uiMapToolbar = 15;
public static final int MapAttrs_uiRotateGestures = 8;
public static final int MapAttrs_uiScrollGestures = 9;
public static final int MapAttrs_uiTiltGestures = 10;
public static final int MapAttrs_uiZoomControls = 11;
public static final int MapAttrs_uiZoomGestures = 12;
public static final int MapAttrs_useViewLifecycle = 13;
public static final int MapAttrs_zOrderOnTop = 14;
public static final int[] SignInButton = { 0x7f010064, 0x7f010065, 0x7f010066 };
public static final int SignInButton_buttonSize = 0;
public static final int SignInButton_colorScheme = 1;
public static final int SignInButton_scopeUris = 2;
public static final int[] WalletFragmentOptions = { 0x7f0100ec, 0x7f0100ed, 0x7f0100ee, 0x7f0100ef };
public static final int WalletFragmentOptions_appTheme = 0;
public static final int WalletFragmentOptions_environment = 1;
public static final int WalletFragmentOptions_fragmentMode = 3;
public static final int WalletFragmentOptions_fragmentStyle = 2;
public static final int[] WalletFragmentStyle = { 0x7f0100f0, 0x7f0100f1, 0x7f0100f2, 0x7f0100f3, 0x7f0100f4, 0x7f0100f5, 0x7f0100f6, 0x7f0100f7, 0x7f0100f8, 0x7f0100f9, 0x7f0100fa };
public static final int WalletFragmentStyle_buyButtonAppearance = 3;
public static final int WalletFragmentStyle_buyButtonHeight = 0;
public static final int WalletFragmentStyle_buyButtonText = 2;
public static final int WalletFragmentStyle_buyButtonWidth = 1;
public static final int WalletFragmentStyle_maskedWalletDetailsBackground = 6;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonBackground = 8;
public static final int WalletFragmentStyle_maskedWalletDetailsButtonTextAppearance = 7;
public static final int WalletFragmentStyle_maskedWalletDetailsHeaderTextAppearance = 5;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoImageType = 10;
public static final int WalletFragmentStyle_maskedWalletDetailsLogoTextColor = 9;
public static final int WalletFragmentStyle_maskedWalletDetailsTextAppearance = 4;
}
}
| [
"alexander.fehsenfeld@coloradocollege.edu"
] | alexander.fehsenfeld@coloradocollege.edu |
a32a0f721a0c6947b8457a4253366237d996a878 | 23115b9ddfcb2ac57d0c61816866251949c8cc95 | /app/src/main/java/com/example/farishy/aystesprojectv3/Instruksi.java | 9d857dadcc90559868bfcc2fbb2a9c85029a677e | [] | no_license | ilhmfauz/AYSTESprojectV3 | d93deb225de6f8aeaf01d9b1d0c2c13a9b23336e | f78265e50bddfcadb4768385fb92a99fd4017f7a | refs/heads/master | 2020-04-10T21:34:24.217048 | 2018-12-11T08:05:21 | 2018-12-11T08:05:21 | 161,298,296 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,242 | java | package com.example.farishy.aystesprojectv3;
import android.content.Intent;
import android.graphics.Typeface;
import android.media.MediaPlayer;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.SoundEffectConstants;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.ViewFlipper;
public class Instruksi extends AppCompatActivity implements View.OnClickListener {
ViewFlipper vf;
Button next;
Button previous;
Button mengerti;
MediaPlayer SoundEffect2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_instruksi);
SoundEffect2 = MediaPlayer.create(Instruksi.this, R.raw.click_effect);
vf = (ViewFlipper) findViewById(R.id.instruksi);
next = (Button) findViewById(R.id.btn_next);
previous = (Button) findViewById(R.id.btn_previous);
mengerti = (Button) findViewById(R.id.btn_mengerti);
TextView ts = (TextView) findViewById(R.id.tv_ip);
Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/akaChen.otf");
ts.setTypeface(tf);
next.setOnClickListener(this);
previous.setOnClickListener(this);
mengerti.setOnClickListener(this);
}
@Override
public void onClick(View v){
if (v == next){
vf.showNext();
SoundEffect2.start();
}else if(v == previous){
vf.showPrevious();
SoundEffect2.start();
}else if(v == mengerti){
SoundEffect2.start();
Intent i = new Intent(Instruksi.this, kategori.class);
i.putExtra("status"," ");
i.putExtra("status1"," ");
i.putExtra("status2"," ");
i.putExtra("status3"," ");
i.putExtra("status4"," ");
i.putExtra("status5"," ");
i.putExtra("status6"," ");
i.putExtra("status7"," ");
i.putExtra("status8"," ");
i.putExtra("status9"," ");
i.putExtra("level", "0");
i.putExtra("score", "0");
startActivity(i);
}
}
}
| [
"ilhmfauz08@gmail.com"
] | ilhmfauz08@gmail.com |
3873d4b636b922b82049aeecd48f8a231f852a9f | e2c1b343dd93428518607a064a0a653e7ea5ad03 | /Item.java | aefe7e5a6f7349358602691481bc0e57adb8dc2e | [] | no_license | aanQMUL/text-adventure-game | 7b23f274c0cc967f0b6deabf00fe541056f61684 | 46c1ad5db196c36cc2d61c81eeca5504a2ad42d7 | refs/heads/main | 2023-03-26T14:34:14.114735 | 2021-03-21T13:39:22 | 2021-03-21T13:39:22 | 350,008,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,823 | java | public class Item
{
private int visibility_modifier;
private int attackLevel_modifier;
private int defenseLevel_modifier;
private int health_modifier;
public Item(int visibility, int attackLevel, int defenseLevel, int health) {
visibility_modifier = visibility;
attackLevel_modifier = attackLevel;
defenseLevel_modifier = defenseLevel;
health_modifier = health;
}
public Item() {
visibility_modifier = 0;
attackLevel_modifier = 0;
defenseLevel_modifier = 0;
health_modifier = 0;
}
public int getVisibilityModifier() {
return visibility_modifier;
}
public int getAttackLevelModifier() {
return attackLevel_modifier;
}
public int getDefenseLevelModifier() {
return defenseLevel_modifier;
}
public int getHealthModifier() {
return health_modifier;
}
public void setVisibilityModifier(int change) {
visibility_modifier = change;
}
public void setAttackLevelModifier(int change) {
attackLevel_modifier = change;
}
public void setDefenseLevelModifier(int change) {
defenseLevel_modifier = change;
}
public void setHealthModifier(int change) {
health_modifier = change;
}
public void stats() {
setHealthModifier(0);
setVisibilityModifier(0);
setDefenseLevelModifier(0);
setAttackLevelModifier(0);
}
public void printDescription() {
System.out.println("An item is lying on the floor");
}
}
| [
"noreply@github.com"
] | aanQMUL.noreply@github.com |
1f385c111ebf42b087fccc7e676796b3b7c48420 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-ws/results/XWIKI-13372-13-26-Single_Objective_GGA-WeightedSum/org/xwiki/extension/handler/internal/DefaultExtensionHandlerManager_ESTest_scaffolding.java | 8423483cafce9ab14978faf8bc9e03b03b98aba5 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 471 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Tue Mar 31 08:47:52 UTC 2020
*/
package org.xwiki.extension.handler.internal;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class DefaultExtensionHandlerManager_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
d759b98f302516a12b0b98309efa334ce984e15e | e928bd1bf9cc83bb7cb94c4278b9a5e3f32023b9 | /src/pokemon/model/Eelithe.java | e0684735b12e4802fa4ec4e38b95e50076472326 | [] | no_license | AmberBullough/Pokemon-master | f6382b62bf6616bada9538826e9341f9a5ffd368 | bb51ebd85ffde90a73ee90ef97fd6d597556d084 | refs/heads/master | 2021-09-04T09:17:28.541084 | 2018-01-17T16:50:57 | 2018-01-17T16:50:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,118 | java | package pokemon.model;
public class Eelithe extends Pokemon implements Normal, Fire
{
public Eelithe()
{
super("Eelithe", 918);
}
public Eelithe(String name)
{
super(name, 918);
}
public Eelithe (int number, String name)
{
super(name, number);
setup();
}
protected void setup()
{
this.setAttackPoints(234);
this.setCanEvolve(false);
this.setEnchanceModifier(.89);
this.setHealthPoints(123);
}
private void setHealthPoints(int i) {
// TODO Auto-generated method stub
}
private void setEnchanceModifier(double d) {
// TODO Auto-generated method stub
}
public void setCanEvolve(boolean b) {
// TODO Auto-generated method stub
}
private void setAttackPoints(int i) {
// TODO Auto-generated method stub
}
@Override
public void fireType() {
// TODO Auto-generated method stub
}
@Override
public void normalType() {
// TODO Auto-generated method stub
}
@Override
public int attackMove(int amount) {
// TODO Auto-generated method stub
return 0;
}
@Override
public String sayName() {
// TODO Auto-generated method stub
return null;
}
} | [
"amber@bertbullough.com"
] | amber@bertbullough.com |
6188aa15350aa05d36b82b8a62c9010a7339d1d8 | 966e6efcd8c420598f4c451abaca5fd9f0370584 | /JavaRushHomeWork/JavaRushTasks/4.JavaCollections/src/com/javarush/task/task33/task3307/Solution.java | daf1d73ba98620fd53526a886eec7066901d4fa9 | [] | no_license | ivshebanov/JavaRush | 7c04329a12db0970cf72b97327c0108fe9412b15 | 778463f3339a565934b04df7b0f327c4178bf0bf | refs/heads/master | 2021-06-03T14:13:29.442321 | 2021-04-20T17:31:16 | 2021-04-20T17:31:16 | 83,684,136 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,413 | java | package com.javarush.task.task33.task3307;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.io.IOException;
import java.io.StringReader;
/*
Десериализация XML объекта
*/
public class Solution {
public static void main(String[] args) throws IOException, JAXBException {
String xmlData = "<cat><name>Murka</name><age>5</age><weight>4</weight></cat>";
Cat cat = convertFromXmlToNormal(xmlData, Cat.class);
System.out.println(cat);
}
public static <T> T convertFromXmlToNormal(String xmlData, Class<T> clazz) throws IOException, JAXBException {
StringReader reader = new StringReader(xmlData);
JAXBContext context = JAXBContext.newInstance(clazz);
Unmarshaller unmarshaller = context.createUnmarshaller();
return (T) unmarshaller.unmarshal(reader);
}
@XmlType(name = "cat")
@XmlRootElement
public static class Cat {
public String name;
public int age;
public int weight;
@Override
public String toString() {
return "Cat{" +
"name='" + name + '\'' +
", age=" + age +
", weight=" + weight +
'}';
}
}
}
| [
"ivshebanov@gmail.com"
] | ivshebanov@gmail.com |
8b68212ed42451023f9f137b0a29b9ddc4d1a303 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_1000771.java | 73ee241dfc9697a42c6663bd46d5b40c98255a3b | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,457 | java | @Override public Map<String,Map<String,Object>> load(String refer){
Map<String,Map<String,Object>> re=new HashMap<String,Map<String,Object>>();
re.put(Mvcs.DEFAULT_MSGS,new NutMap());
List<NutResource> allnrs=Scans.me().scan(refer,"^.+[.]properties$");
if (log.isDebugEnabled()) log.debugf("Load Messages in %s resource : [%s]",allnrs.size(),allnrs);
for ( NutResource nr : allnrs) {
try {
String name=nr.getName();
if (name.contains("/")) {
name=name.substring(name.lastIndexOf('/') + 1);
}
if (name.contains("\\")) {
name=name.substring(name.lastIndexOf('\\') + 1);
}
name=name.substring(0,name.length() - ".properties".length());
String langType=Mvcs.DEFAULT_MSGS;
if (name.contains("_")) {
langType=name.substring(name.indexOf('_') + 1);
}
Properties properties=new Properties();
properties.load(nr.getInputStream());
NutMap msgs=(NutMap)re.get(langType);
if (msgs == null) {
if (log.isDebugEnabled()) {
log.debug("add Message Locale : " + langType);
}
msgs=new NutMap();
re.put(langType,msgs);
}
for ( Map.Entry<Object,Object> en : properties.entrySet()) {
msgs.put(String.valueOf(en.getKey()),String.valueOf(en.getValue()));
}
}
catch ( Exception e) {
throw new RuntimeException("error when reading " + nr.getName(),e);
}
}
return re;
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
9a1bba247bfeeb88c45299973cc9ef8fb0672bae | 80552d844f54667b4d6f00845a667026d656e1ba | /zip/spring-framework-3.2.x/spring-jms/src/main/java/org/springframework/jms/support/converter/SimpleMessageConverter102.java | f1933f27f3f6e86b02be0fee8bde3b2db445857e | [
"Apache-2.0"
] | permissive | 13266764646/spring-framewrok3.2.x | e662e4d633adec91fcfca6d66e15a7555044429d | 84c238239ebd8cebdddee540c0fefa8e4755eac8 | refs/heads/master | 2020-05-03T15:38:25.422211 | 2019-08-26T02:44:12 | 2019-08-26T02:44:12 | 178,707,063 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,403 | java | /*
* Copyright 2002-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.jms.support.converter;
import java.io.ByteArrayOutputStream;
import javax.jms.BytesMessage;
import javax.jms.JMSException;
/**
* A subclass of {@link SimpleMessageConverter} for the JMS 1.0.2 specification,
* not relying on JMS 1.1 methods like SimpleMessageConverter itself.
* This class can be used for JMS 1.0.2 providers, offering the same functionality
* as SimpleMessageConverter does for JMS 1.1 providers.
*
* <p>The only difference to the default SimpleMessageConverter is that BytesMessage
* is handled differently: namely, without using the {@code getBodyLength()}
* method which has been introduced in JMS 1.1 and is therefore not available on a
* JMS 1.0.2 provider.
*
* @author Juergen Hoeller
* @since 1.1.1
* @see javax.jms.BytesMessage#getBodyLength()
* @deprecated as of Spring 3.0, in favor of the JMS 1.1 based {@link SimpleMessageConverter}
*/
@Deprecated
public class SimpleMessageConverter102 extends SimpleMessageConverter {
public static final int BUFFER_SIZE = 4096;
/**
* Overrides superclass method to copy bytes from the message into a
* ByteArrayOutputStream, using a buffer, to avoid using the
* {@code getBodyLength()} method which has been introduced in
* JMS 1.1 and is therefore not available on a JMS 1.0.2 provider.
* @see javax.jms.BytesMessage#getBodyLength()
*/
protected byte[] extractByteArrayFromMessage(BytesMessage message) throws JMSException {
ByteArrayOutputStream baos = new ByteArrayOutputStream(BUFFER_SIZE);
byte[] buffer = new byte[BUFFER_SIZE];
int bufferCount = -1;
while ((bufferCount = message.readBytes(buffer)) >= 0) {
baos.write(buffer, 0, bufferCount);
if (bufferCount < BUFFER_SIZE) {
break;
}
}
return baos.toByteArray();
}
}
| [
"972181522@qq.com"
] | 972181522@qq.com |
677c762b29a8b8a09e307c1e5321a701c6024b24 | e4c81bdbae663e1d168392768f299c9a550341ba | /eoms-web/src/main/java/com/lj/eoms/order/OrderRetireController.java | df4c186064d7ac1aa36008e7de28b8070900fdda | [] | no_license | wo510751575/kun | 995e75f03424d98d11c33fd2fe6681666108ec54 | 4907f79d1232ecea8ae5fe138809066a0fbc1212 | refs/heads/master | 2022-12-21T08:20:44.972860 | 2019-11-15T11:03:14 | 2019-11-15T11:03:14 | 219,097,605 | 0 | 1 | null | 2022-12-16T11:35:53 | 2019-11-02T03:22:39 | Java | UTF-8 | Java | false | false | 5,040 | java | /**
* Copyright © 2017-2020 All rights reserved.
*
* Licensed under the 深圳市小坤 License, Version 1.0 (the "License");
*
*/
package com.lj.eoms.order;
import java.util.List;
import org.apache.log4j.Logger;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.ape.common.web.BaseController;
import com.google.common.collect.Lists;
import com.lj.base.core.pagination.Page;
import com.lj.base.core.pagination.PageSortType;
import com.lj.eoms.utils.UserUtils;
import com.lj.eshop.dto.FindOrderRetirePage;
import com.lj.eshop.dto.OrderDto;
import com.lj.eshop.dto.OrderRetireDto;
import com.lj.eshop.emus.AccWaterPayType;
import com.lj.eshop.emus.AuditStatus;
import com.lj.eshop.emus.OrderInvoice;
import com.lj.eshop.emus.OrderRetireType;
import com.lj.eshop.emus.OrderStatus;
import com.lj.eshop.emus.RetireStatus;
import com.lj.eshop.service.IOrderRetireService;
import com.lj.eshop.service.IOrderService;
/**
*
*
* 类说明:订单退货@Controller
*
*
* <p>
* 详细描述:
*
* @Company:
* @author
*
* CreateDate: 2017年8月29日
*/
@Controller
@RequestMapping("${adminPath}/order/retire")
public class OrderRetireController extends BaseController {
public static final String LIST = "modules/order/retire/list";
public static final String FORM = "modules/order/retire/form";
public static final String EDIT = "modules/order/retire/edit";
public static final String VIEW = "modules/order/retire/view";
private Logger log = Logger.getLogger(getClass());
@Autowired
private IOrderRetireService orderRetireService;
@Autowired
private IOrderService orderService;
/** 列表 */
@RequiresPermissions("order:retire:view")
@RequestMapping(value = {"list",""}, method = {RequestMethod.GET,RequestMethod.POST})
public String list(FindOrderRetirePage findOrderRetirePage,Integer pageNo,Integer pageSize, Model model) {
try {
OrderRetireDto orderRetire=findOrderRetirePage.getParam();
if(orderRetire==null){
orderRetire=new OrderRetireDto();
}
findOrderRetirePage.setSortBy("create_time");
findOrderRetirePage.setSortDir(PageSortType.desc);
findOrderRetirePage.setParam(orderRetire);
if(pageNo!=null){
findOrderRetirePage.setStart((pageNo-1)*pageSize);
}
if(pageSize!=null){
findOrderRetirePage.setLimit(pageSize);
}
Page<OrderRetireDto> pageDto = orderRetireService.findOrderRetirePage(findOrderRetirePage);
List<OrderRetireDto> list = Lists.newArrayList();
list.addAll(pageDto.getRows());
com.ape.common.persistence.Page<OrderRetireDto> page=new com.ape.common.persistence.Page<OrderRetireDto>(pageNo==null?1:pageNo, pageDto.getLimit(), pageDto.getTotal(), list);
page.initialize();
model.addAttribute("page",page);
model.addAttribute("auditStatus", AuditStatus.values());
model.addAttribute("orderRetireTypes", OrderRetireType.values());
model.addAttribute("retireStatus", RetireStatus.values());
model.addAttribute("orderRetireParam", orderRetire);
} catch (Exception e) {
e.printStackTrace();
}
return LIST;
}
/** 视图 */
@RequiresPermissions("order:order:view")
@RequestMapping(value = {"form", "view"}, method = {RequestMethod.GET,RequestMethod.POST})
public String form(String code, Model model) {
try {
OrderRetireDto param = new OrderRetireDto();
param.setCode(code);
OrderRetireDto dto = orderRetireService.findOrderRetire(param);
model.addAttribute("data", dto);
model.addAttribute("auditStatus", AuditStatus.values());
} catch (Exception e) {
e.printStackTrace();
}
return VIEW;
}
/** 审核*/
@RequiresPermissions("order:retire:edit")
@RequestMapping(value = "/status")
public String status(String code,String failReason,String auditStatus, RedirectAttributes redirectAttributes) {
try {
OrderRetireDto parm = new OrderRetireDto();
parm.setCode(code);
OrderRetireDto retireDto= orderRetireService.findOrderRetire(parm);
/*构建退货对象*/
OrderRetireDto orderRetireDto = new OrderRetireDto();
orderRetireDto.setCode(code);
orderRetireDto.setFailReason(failReason);
orderRetireDto.setAuditor(UserUtils.getUser().getName());
orderRetireDto.setAuditStatus(auditStatus);
orderRetireDto.setOrderNo(retireDto.getOrderNo());
orderRetireDto.setRetireNo(retireDto.getRetireNo());
orderService.returns(orderRetireDto, orderRetireDto.getFailReason());
addMessage(redirectAttributes, "操作退单号:'"+orderRetireDto.getRetireNo()+"'成功");
} catch (Exception e) {
// log.error(e);
e.printStackTrace();
addMessage(redirectAttributes, e.toString());
}
return "redirect:" + adminPath + "/order/retire/list";
}
}
| [
"37724558+wo510751575@users.noreply.github.com"
] | 37724558+wo510751575@users.noreply.github.com |
e216c100c1f0ee1c6ad6cb4740ec53d23aff4347 | 94d65d07ae0c7f20e732735c25feedfe64e74a36 | /Setting/SettingsActivity.java | 13d2c8b3297c9151e5e86ffe2843163c17928f61 | [] | no_license | HuiHu826/Menu-Hub | bfff8536c9fe36a143978fca567758c94c5d5069 | fb2637d6bc796e22ab49427f2663b3230fcfdb57 | refs/heads/master | 2020-09-13T00:50:47.727246 | 2019-10-31T23:58:38 | 2019-10-31T23:58:38 | 222,610,911 | 0 | 0 | null | 2019-11-19T04:50:01 | 2019-11-19T04:50:01 | null | UTF-8 | Java | false | false | 1,052 | java | package com.example.menu;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_activity);
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.settings, new SettingsFragment())
.commit();
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
public static class SettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.root_preferences, rootKey);
}
}
} | [
"noreply@github.com"
] | HuiHu826.noreply@github.com |
de6e73deafa291246b2731fae1927d730644b5b6 | 65b264a145bf156394b57ccfc6467a618d040910 | /app/src/main/java/com/khierblogger/khierbloggerapp/MainClasses/Photo.java | babf3d4ecfe0d761c095e3d6fea1c21768b6cbe8 | [] | no_license | mostafa-abdullah/kheir-blogger-android | fd7f5dac0bc058c4c237ee704394836777165764 | 084364567108274653c0c64b965d2e08c574d731 | refs/heads/master | 2021-01-21T13:41:06.465837 | 2016-04-30T15:00:06 | 2016-04-30T15:00:06 | 55,774,611 | 0 | 0 | null | 2016-04-25T13:23:47 | 2016-04-08T11:39:20 | Java | UTF-8 | Java | false | false | 936 | java | package com.khierblogger.khierbloggerapp.MainClasses;
import java.util.Date;
public class Photo {
private long id;
private long event_id;
private String name;
private String caption;
private Date created_at;
private Date updated_at;
private Photo(long id, long event_id, String name, String caption, Date created_at, Date updated_at) {
this.id = id;
this.event_id = event_id;
this.name = name;
this.caption = caption;
this.created_at = created_at;
this.updated_at = updated_at;
}
public long getId() {
return id;
}
public long getEventId() {
return event_id;
}
public String getName() {
return name;
}
public String getCaption() {
return caption;
}
public Date getCreatedAt() {
return created_at;
}
public Date getUpdatedAt() {
return updated_at;
}
}
| [
"hossamShDesigns@gmail.com"
] | hossamShDesigns@gmail.com |
c0f309ac4b6b169cdbc087ef8cb605506ff614f0 | 544efe9d6fd5094e3e3c40c03a9ae419aa828b0c | /Uri1006.java | efa0fb0f43cf8da29ed53618bc5672c7e58fb07e | [] | no_license | claudiarpvicente/java | 4e2b90cf435620d2b8129d6f15625f6641d51554 | baa213a43e4eeced8342f309491f39bf4a6d0ae2 | refs/heads/master | 2023-04-26T21:06:38.528204 | 2021-05-07T19:37:10 | 2021-05-07T19:37:10 | 365,333,759 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 443 | java | import java.util.Scanner;
public class Uri1006{
public static void main(String arg[]){
Scanner teclado = new Scanner(System.in);
// define variaveis
Double A, B, C, Media;
// entrada de dados
A = teclado.nextDouble();
B = teclado.nextDouble();
C = teclado.nextDouble();
// processamento
Media = ((A*2) + (B*3) + (C*5)) / (2+3+5);
// saida
System.out.printf("MEDIA = %.1f\n",+Media);
}
} | [
"claudiarpvicente@gmail.com"
] | claudiarpvicente@gmail.com |
2f8a4b0ce709f1f40a424473276bdf46ed3c4889 | f54230c5e5f85a210c924b0fb1ce7fc3e07f9701 | /IMAGINE/src/hearth/codeMonk/dynamic/programming/SamuAndShopping.java | 6569d35fa242a2949185f020e99821c4e87361a2 | [] | no_license | pdhub/IMAGINE | 6823f545200ca6d107e8d02da2a8c6595627ca3a | 210a81e6e79c37d1a1b89543d9b6a3f37d8819d2 | refs/heads/master | 2021-01-10T05:30:23.594472 | 2017-10-16T19:18:25 | 2017-10-16T19:18:25 | 47,502,326 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,561 | java |
/**
https://www.hackerearth.com/code-monk-dynamic-programming/algorithm/samu-and-shopping/
*/
package hearth.codeMonk.dynamic.programming;
import java.io.BufferedReader;
import java.io.BufferedOutputStream;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.StringTokenizer;
class SamuShopping{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out), true);
int tc = sc.nextInt();
while(tc != 0){
int shops = sc.nextInt();
int[][] prices = new int[shops][3];
int[][] memoization = new int[shops][3];
int minimum = 0;
for(int i = 0; i < shops; i++){
for(int j = 0; j < 3; j++) prices[i][j] = sc.nextInt();
}
for(int i = 0; i < 3; i++) memoization[0][i] = prices[0][i];
for(int i = 1; i < shops; i++){
memoization[i][0] = ((memoization[i-1][1] < memoization[i-1][2]) ? memoization[i-1][1] : memoization[i-1][2]) + prices[i][0];
memoization[i][1] = ((memoization[i-1][0] < memoization[i-1][2]) ? memoization[i-1][0] : memoization[i-1][2]) + prices[i][1];
memoization[i][2] = ((memoization[i-1][0] < memoization[i-1][1]) ? memoization[i-1][0] : memoization[i-1][1]) + prices[i][2];
}
minimum = (memoization[shops-1][0] < memoization[shops-1][1]) ? memoization[shops-1][0] : memoization[shops-1][1];
if(minimum > memoization[shops-1][2]) minimum = memoization[shops-1][2];
out.println(minimum);
tc--;
}
}
} | [
"pdeb@manh.com"
] | pdeb@manh.com |
888a2653e8755b08afb936a8cd89ff8d65b70fc2 | 307df044913b7dd1e57b8c36f5be423a02faa522 | /BaseLib/src/main/java/com/bebeep/commontools/seclectcity/utils/CharacterParser.java | 20ff3ff8244fbfa706e04936a380764468c1c1f2 | [] | no_license | bebeep/wisdomPB | 93ce956d211c53ab31ee75f70b919eb4a8ba06a2 | 3b4c639158f2d7d590a68a9a7237ad83f71e7dcc | refs/heads/master | 2020-04-07T12:13:37.047296 | 2019-07-30T08:36:14 | 2019-07-30T08:36:14 | 158,359,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,230 | java | package com.bebeep.commontools.seclectcity.utils;
/**
* Created by Bebeep
* Time 2018/3/9 15:07
* Email 424468648@qq.com
* Tips
*/
public class CharacterParser {
private static int[] pyvalue = new int[]{-20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036, -20032,
-20026, -20002, -19990, -19986, -19982, -19976, -19805, -19784, -19775, -19774, -19763, -19756, -19751, -19746, -19741, -19739, -19728,
-19725, -19715, -19540, -19531, -19525, -19515, -19500, -19484, -19479, -19467, -19289, -19288, -19281, -19275, -19270, -19263, -19261,
-19249, -19243, -19242, -19238, -19235, -19227, -19224, -19218, -19212, -19038, -19023, -19018, -19006, -19003, -18996, -18977, -18961,
-18952, -18783, -18774, -18773, -18763, -18756, -18741, -18735, -18731, -18722, -18710, -18697, -18696, -18526, -18518, -18501, -18490,
-18478, -18463, -18448, -18447, -18446, -18239, -18237, -18231, -18220, -18211, -18201, -18184, -18183, -18181, -18012, -17997, -17988,
-17970, -17964, -17961, -17950, -17947, -17931, -17928, -17922, -17759, -17752, -17733, -17730, -17721, -17703, -17701, -17697, -17692,
-17683, -17676, -17496, -17487, -17482, -17468, -17454, -17433, -17427, -17417, -17202, -17185, -16983, -16970, -16942, -16915, -16733,
-16708, -16706, -16689, -16664, -16657, -16647, -16474, -16470, -16465, -16459, -16452, -16448, -16433, -16429, -16427, -16423, -16419,
-16412, -16407, -16403, -16401, -16393, -16220, -16216, -16212, -16205, -16202, -16187, -16180, -16171, -16169, -16158, -16155, -15959,
-15958, -15944, -15933, -15920, -15915, -15903, -15889, -15878, -15707, -15701, -15681, -15667, -15661, -15659, -15652, -15640, -15631,
-15625, -15454, -15448, -15436, -15435, -15419, -15416, -15408, -15394, -15385, -15377, -15375, -15369, -15363, -15362, -15183, -15180,
-15165, -15158, -15153, -15150, -15149, -15144, -15143, -15141, -15140, -15139, -15128, -15121, -15119, -15117, -15110, -15109, -14941,
-14937, -14933, -14930, -14929, -14928, -14926, -14922, -14921, -14914, -14908, -14902, -14894, -14889, -14882, -14873, -14871, -14857,
-14678, -14674, -14670, -14668, -14663, -14654, -14645, -14630, -14594, -14429, -14407, -14399, -14384, -14379, -14368, -14355, -14353,
-14345, -14170, -14159, -14151, -14149, -14145, -14140, -14137, -14135, -14125, -14123, -14122, -14112, -14109, -14099, -14097, -14094,
-14092, -14090, -14087, -14083, -13917, -13914, -13910, -13907, -13906, -13905, -13896, -13894, -13878, -13870, -13859, -13847, -13831,
-13658, -13611, -13601, -13406, -13404, -13400, -13398, -13395, -13391, -13387, -13383, -13367, -13359, -13356, -13343, -13340, -13329,
-13326, -13318, -13147, -13138, -13120, -13107, -13096, -13095, -13091, -13076, -13068, -13063, -13060, -12888, -12875, -12871, -12860,
-12858, -12852, -12849, -12838, -12831, -12829, -12812, -12802, -12607, -12597, -12594, -12585, -12556, -12359, -12346, -12320, -12300,
-12120, -12099, -12089, -12074, -12067, -12058, -12039, -11867, -11861, -11847, -11831, -11798, -11781, -11604, -11589, -11536, -11358,
-11340, -11339, -11324, -11303, -11097, -11077, -11067, -11055, -11052, -11045, -11041, -11038, -11024, -11020, -11019, -11018, -11014,
-10838, -10832, -10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533, -10519, -10331, -10329, -10328, -10322, -10315, -10309,
-10307, -10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254};
public static String[] pystr = new String[]{"a", "ai", "an", "ang", "ao", "ba", "bai", "ban", "bang", "bao", "bei", "ben", "beng", "bi", "bian",
"biao", "bie", "bin", "bing", "bo", "bu", "ca", "cai", "can", "cang", "cao", "ce", "ceng", "cha", "chai", "chan", "chang", "chao", "che",
"chen", "cheng", "chi", "chong", "chou", "chu", "chuai", "chuan", "chuang", "chui", "chun", "chuo", "ci", "cong", "cou", "cu", "cuan",
"cui", "cun", "cuo", "da", "dai", "dan", "dang", "dao", "de", "deng", "di", "dian", "diao", "die", "ding", "diu", "dong", "dou", "du",
"duan", "dui", "dun", "duo", "e", "en", "er", "fa", "fan", "fang", "fei", "fen", "feng", "fo", "fou", "fu", "ga", "gai", "gan", "gang",
"gao", "ge", "gei", "gen", "geng", "gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui", "gun", "guo", "ha", "hai", "han", "hang",
"hao", "he", "hei", "hen", "heng", "hong", "hou", "hu", "hua", "huai", "huan", "huang", "hui", "hun", "huo", "ji", "jia", "jian",
"jiang", "jiao", "jie", "jin", "jing", "jiong", "jiu", "ju", "juan", "jue", "jun", "ka", "kai", "kan", "kang", "kao", "ke", "ken",
"keng", "kong", "kou", "ku", "kua", "kuai", "kuan", "kuang", "kui", "kun", "kuo", "la", "lai", "lan", "lang", "lao", "le", "lei", "leng",
"li", "lia", "lian", "liang", "liao", "lie", "lin", "ling", "liu", "long", "lou", "lu", "lv", "luan", "lue", "lun", "luo", "ma", "mai",
"man", "mang", "mao", "me", "mei", "men", "meng", "mi", "mian", "miao", "mie", "min", "ming", "miu", "mo", "mou", "mu", "na", "nai",
"nan", "nang", "nao", "ne", "nei", "nen", "neng", "ni", "nian", "niang", "niao", "nie", "nin", "ning", "niu", "nong", "nu", "nv", "nuan",
"nue", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei", "pen", "peng", "pi", "pian", "piao", "pie", "pin", "ping", "po", "pu",
"qi", "qia", "qian", "qiang", "qiao", "qie", "qin", "qing", "qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao", "re",
"ren", "reng", "ri", "rong", "rou", "ru", "ruan", "rui", "run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sen", "seng", "sha",
"shai", "shan", "shang", "shao", "she", "shen", "sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang", "shui", "shun",
"shuo", "si", "song", "sou", "su", "suan", "sui", "sun", "suo", "ta", "tai", "tan", "tang", "tao", "te", "teng", "ti", "tian", "tiao",
"tie", "ting", "tong", "tou", "tu", "tuan", "tui", "tun", "tuo", "wa", "wai", "wan", "wang", "wei", "wen", "weng", "wo", "wu", "xi",
"xia", "xian", "xiang", "xiao", "xie", "xin", "xing", "xiong", "xiu", "xu", "xuan", "xue", "xun", "ya", "yan", "yang", "yao", "ye", "yi",
"yin", "ying", "yo", "yong", "you", "yu", "yuan", "yue", "yun", "za", "zai", "zan", "zang", "zao", "ze", "zei", "zen", "zeng", "zha",
"zhai", "zhan", "zhang", "zhao", "zhe", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu", "zhua", "zhuai", "zhuan", "zhuang", "zhui",
"zhun", "zhuo", "zi", "zong", "zou", "zu", "zuan", "zui", "zun", "zuo"};
private StringBuilder buffer;
private String resource;
private static CharacterParser characterParser = new CharacterParser();
public static CharacterParser getInstance() {
return characterParser;
}
public String getResource() {
return resource;
}
public void setResource(String resource) {
this.resource = resource;
}
/**
* 汉字转成ASCII码 * * @param chs * @return
*/
private int getChsAscii(String chs) {
int asc = 0;
try {
byte[] bytes = chs.getBytes("gb2312");
if (bytes == null || bytes.length > 2 || bytes.length <= 0) {
throw new RuntimeException("illegal resource string");
}
if (bytes.length == 1) {
asc = bytes[0];
}
if (bytes.length == 2) {
int hightByte = 256 + bytes[0];
int lowByte = 256 + bytes[1];
asc = (256 * hightByte + lowByte) - 256 * 256;
}
} catch (Exception e) {
System.out.println("ERROR:ChineseSpelling.class-getChsAscii(String chs)" + e);
}
return asc;
}
/**
* 单字解析 * * @param str * @return
*/
public String convert(String str) {
String result = null;
int ascii = getChsAscii(str);
if (ascii > 0 && ascii < 160) {
result = String.valueOf((char) ascii);
} else {
for (int i = (pyvalue.length - 1); i >= 0; i--) {
if (pyvalue[i] <= ascii) {
result = pystr[i];
break;
}
}
}
return result;
}
/**
* 词组解析 * * @param chs * @return
*/
public String getSelling(String chs) {
String key, value;
buffer = new StringBuilder();
for (int i = 0; i < chs.length(); i++) {
key = chs.substring(i, i + 1);
if (key.getBytes().length >= 2) {
value = (String) convert(key);
if (value == null) {
value = "unknown";
}
} else {
value = key;
}
buffer.append(value);
}
return buffer.toString();
}
public String getSpelling() {
return this.getSelling(this.getResource());
}
}
| [
"424468648@qq.com"
] | 424468648@qq.com |
613b2311c873bd74ab2934b16df484fd9aa3c875 | 1824a3ea8151f56e6d6cbffc7d5c56c1ee04bd2b | /src/main/java/me/Hazz/HazzBot/Commands/ComplexCommands/ReportCommands/ChangeReportCommand.java | 051cf3ccd920014f0ac7721e562569b4f8403026 | [] | no_license | Hazzaaa43/HazzBot | 1652b148d51e55cce87c35ba5df28661ee9cf58b | f23fd9e59f396c59bba85598a7b5c669d4b69fa4 | refs/heads/master | 2020-12-07T08:01:30.022926 | 2020-01-08T22:52:02 | 2020-01-08T23:03:07 | 232,679,192 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,392 | java | package me.Hazz.HazzBot.Commands.ComplexCommands.ReportCommands;
import me.Hazz.HazzBot.Database.Controllers.CReport;
import me.Hazz.HazzBot.Database.Objects.OReport;
import me.Hazz.HazzBot.Interfaces.ICommand;
import me.Hazz.HazzBot.Variables.Info;
import net.dv8tion.jda.api.EmbedBuilder;
import net.dv8tion.jda.api.entities.Role;
import net.dv8tion.jda.api.events.message.guild.GuildMessageReceivedEvent;
import java.awt.*;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static me.Hazz.HazzBot.Commands.ComplexCommands.ReportCommands.ReportCommand.getContent;
import static me.Hazz.HazzBot.Commands.ComplexCommands.ReportCommands.ReportCommand.getNumber;
public class ChangeReportCommand implements ICommand {
@Override
public String getName() {
return "changereport";
}
@Override
public String[] getAliases() {
return new String[]{"changenote"};
}
@Override
public boolean execute(String[] newArgs, GuildMessageReceivedEvent event) {
if (!event.getChannel().getId().equals("374060379619459083") // Pixelmon Staff
&& !event.getChannel().getId().equals("631323140475060251") // Vanilla Staff
&& !event.getChannel().getId().equals("632380912968925196")){ // Test Bot
return true;
}
int RankTester = 0;
List<Role> roles = event.getMember().getRoles();
for (Role r : roles) {
if (r.getName().equals(":::Manager:::") || r.getName().equals(":::Pixel RankHeads:::") || r.getName().equals("::Pixel Sr-Admin::") || r.getName().equals("::Pixel Admin::") || r.getName().equals("::Pixel Sr-Mod::") || r.getName().equals(":::Vanilla RankHeads:::") || r.getName().equals("::Vanilla Sr-Admin::") || r.getName().equals("::Vanilla Admin::") || r.getName().equals("::Vanilla Sr-Mod::")) {
RankTester = 1;
}
}
if (RankTester == 1) {
try {
String oldIGN = newArgs[0].substring(0, 1).toUpperCase() + newArgs[0].substring(1).toLowerCase();
String newIGN = newArgs[1].substring(0, 1).toUpperCase() + newArgs[1].substring(1).toLowerCase();
ArrayList<OReport> reports = CReport.findByIGN(oldIGN, event.getGuild());
for (OReport rep : reports){
rep.IGN = newIGN;
CReport.update(rep, event.getGuild());
}
ArrayList<OReport> report = CReport.findByIGN(newIGN, event.getGuild());
EmbedBuilder embed = new EmbedBuilder();
embed.setColor(new Color(0x3498db));
embed.addField("Players to Watch - " + newIGN.replace("_", "\\_"), getContent(report, event) + "\nNumber of Reports: `" + getNumber(report) + "`", false);
event.getChannel().sendMessage(embed.build()).queue(message -> {
long MessageID = report.get(0).MessageID;
event.getChannel().deleteMessageById(MessageID).queue(m -> {
}, throwable -> {
});
for (OReport rep : report) {
rep.MessageID = message.getIdLong();
CReport.update(rep, event.getGuild());
}
});
} catch (Throwable e) {
EmbedBuilder error = new EmbedBuilder();
error.setColor(new Color(0xff0000));
error.addField("Missing Arguments", "Correct Usage: `" + Info.PREFIX + "changereport [OldIGN] [NewIGN]`", false);
error.setFooter("Command ran by " + event.getMember().getUser().getAsTag(), event.getMember().getUser().getAvatarUrl());
event.getChannel().sendMessage(error.build()).queue(msg -> msg.delete().queueAfter(5, TimeUnit.SECONDS));
}
} else {
EmbedBuilder error = new EmbedBuilder();
error.setColor(new Color(0xff0000));
error.addField("No Permission", "You do not have permission to run this command.", false);
error.setFooter("Command ran by " + event.getMember().getUser().getAsTag(), event.getMember().getUser().getAvatarUrl());
event.getChannel().sendMessage(error.build()).queue(msg -> msg.delete().queueAfter(5, TimeUnit.SECONDS));
}
return true;
}
} | [
"unconfigured@null.spigotmc.org"
] | unconfigured@null.spigotmc.org |
c984f74c079db23b48fc488c1b6935394b7c703e | 1af048cb33ff887c649fded9c747e8108b13b586 | /example-springboot/springboot@Enable/src/main/java/com/edu/spring/springboot/User.java | d0916e99c597bc3eceaa98ee63a265a87e78578b | [] | no_license | bulidWorld/toturial | b2451453518b6d93aa40431bf3480f9675a8f73b | a7d57c174cd3a5b85a44f6c9a78053cdbde57366 | refs/heads/master | 2021-01-15T23:21:41.729629 | 2018-06-26T15:52:52 | 2018-06-26T15:52:52 | 99,930,958 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 59 | java | package com.edu.spring.springboot;
public class User {
}
| [
"782213745@qq.com"
] | 782213745@qq.com |
875062bb26b8d77a03d924a5f63f2ac14347dc26 | b4cbf815052fac35f938cb53bbb41ec8b1352098 | /MeetingSystem/src/com/lxm/dao/MeetingRoomMapper.java | f3453d30ee3f30a073d242503a03b58f01b4e386 | [] | no_license | canberry/MeetingSystem | d0f8757f175981086d45551fca46c1fefe734899 | 4802d9c4ea93e12779f9758adc4a5f7cd547b3dc | refs/heads/master | 2021-04-12T05:03:12.890595 | 2018-05-21T11:57:45 | 2018-05-21T11:57:45 | 125,952,298 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 954 | java | package com.lxm.dao;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.lxm.bean.MeetingRoom;
public interface MeetingRoomMapper {
public List<MeetingRoom> pagination(
@Param("meetingRoom") MeetingRoom meetingRoom,
@Param("pageStart") int pagestart, @Param("pageSize") int pageSize);
public int getRows(MeetingRoom meetingRoom);
public List<MeetingRoom> queryAvailable(
@Param("startTime") String startTime,
@Param("endTime") String endTime, @Param("capacity") int capacity);
public List<MeetingRoom> queryAvailableWithoutMid(@Param("mId") int mId,
@Param("startTime") String startTime,
@Param("endTime") String endTime, @Param("capacity") int capacity);
public MeetingRoom queryById(int mrId);
public int queryNumByNo(@Param("no") String no, @Param("mrId") int mrId);
public void modify(MeetingRoom meetingRoom);
public void add(MeetingRoom meetingRoom);
public void remove(int mrId);
}
| [
"413781768@qq.com"
] | 413781768@qq.com |
7de0ed68f5c08213c2c7f9321faf1b403b051c09 | 852164c49a8b1a8eded7db8624bf4fccb24ef35f | /mbse.project.tests/src/mbse/project/YAWLnets/tests/JoinTypeTest.java | 97308aee12ae44e5a0b65574c050b5fc0f77b0ee | [] | no_license | jeffyjahfar/mbse_yawlSimulator | e5ce5e2084312403dd1cbe6b8ca5d86c19f4d242 | b8ff2d6cbb100a7273d1d9bb574b6599193c3e86 | refs/heads/master | 2022-04-22T20:13:31.416641 | 2020-04-27T03:31:28 | 2020-04-27T03:31:28 | 259,193,030 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,761 | java | /**
*/
package mbse.project.YAWLnets.tests;
import junit.framework.TestCase;
import junit.textui.TestRunner;
import mbse.project.YAWLnets.JoinType;
import mbse.project.YAWLnets.YAWLnetsFactory;
/**
* <!-- begin-user-doc -->
* A test case for the model object '<em><b>Join Type</b></em>'.
* <!-- end-user-doc -->
* @generated
*/
public class JoinTypeTest extends TestCase {
/**
* The fixture for this Join Type test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected JoinType fixture = null;
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public static void main(String[] args) {
TestRunner.run(JoinTypeTest.class);
}
/**
* Constructs a new Join Type test case with the given name.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public JoinTypeTest(String name) {
super(name);
}
/**
* Sets the fixture for this Join Type test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void setFixture(JoinType fixture) {
this.fixture = fixture;
}
/**
* Returns the fixture for this Join Type test case.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected JoinType getFixture() {
return fixture;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#setUp()
* @generated
*/
@Override
protected void setUp() throws Exception {
setFixture(YAWLnetsFactory.eINSTANCE.createJoinType());
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see junit.framework.TestCase#tearDown()
* @generated
*/
@Override
protected void tearDown() throws Exception {
setFixture(null);
}
} //JoinTypeTest
| [
"jeffyjahfar@gmail.com"
] | jeffyjahfar@gmail.com |
0f91db2b818f3aec8d1d0ce2135979a8b68a6cd6 | b157b293910f4c6c96ebd531e63238e68b5a8a0c | /Basic Usage of elements/LocationonMap/app/src/main/java/com/example/kinny/locationonmap/MapsActivity.java | 767bbead7917f1bac7ca2b2cd66790d20afc2965 | [] | no_license | chintan992/Android | 23fa556f78f65ecc44fffeccdefee8f48b686735 | 1e5f2fb2222729fdd6366333d665d93c8b9619f9 | refs/heads/master | 2021-06-30T14:38:26.745655 | 2017-09-19T19:11:49 | 2017-09-19T19:11:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,393 | java | package com.example.kinny.locationonmap;
import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.support.v4.app.ActivityCompat;
import android.support.v4.app.FragmentActivity;
import android.os.Bundle;
import android.util.Log;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class MapsActivity extends FragmentActivity implements OnMapReadyCallback, LocationListener {
private GoogleMap mMap;
LocationManager locationManager;
String provider;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
// Obtain the SupportMapFragment and get notified when the map is ready to be used.
SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
.findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
provider = locationManager.getBestProvider(new Criteria(), false);
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
Location location = locationManager.getLastKnownLocation(provider);
if(location != null){
onLocationChanged(location);
}
}
@Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(-34, 151);
}
@Override
public void onLocationChanged(Location location) {
mMap.clear();
Double lat = location.getLatitude();
Double lng = location.getLongitude();
mMap.addMarker(new MarkerOptions().position(new LatLng(lat, lng)).title("Your location"));
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(lat, lng), 12));
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public void onProviderEnabled(String provider) {
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
protected void onPause() {
super.onPause();
locationManager.removeUpdates(this);
}
@Override
protected void onResume() {
super.onResume();
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
// TODO: Consider calling
// ActivityCompat#requestPermissions
// here to request the missing permissions, and then overriding
// public void onRequestPermissionsResult(int requestCode, String[] permissions,
// int[] grantResults)
// to handle the case where the user grants the permission. See the documentation
// for ActivityCompat#requestPermissions for more details.
return;
}
locationManager.requestLocationUpdates(provider, 400, 1, this);
}
}
| [
"ad.sam007@gmail.com"
] | ad.sam007@gmail.com |
c13c770261b134a21e6220841c887231d74f1f70 | 91df6cf1f0de8e3d0a6f85558536969a82189932 | /fgg/src/main/java/mandy/com/fgg/App.java | 4f99f3570af5ef1bdadf77f37a530e3b74b3313b | [] | no_license | hassankhaledboss/mandy-project | ef0af801eba44cdf59b85aadf413248cdd21ae28 | 298c7a37df1900df8b03de844ea963cb4cc539a7 | refs/heads/master | 2022-04-22T23:38:01.902536 | 2020-04-19T20:31:43 | 2020-04-19T20:31:43 | 257,067,919 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 225 | java | package mandy.com.fgg;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
WWEWomenDivision W = null;
System.out.println( W.CheckChampion() );
}
}
| [
"noreply@github.com"
] | hassankhaledboss.noreply@github.com |
0078b23085c7296dff994d4e3b0878340102187e | d5936d7c102c24af763f305203702a38ac96fd20 | /app/src/androidTest/java/com/example/quoctuan/demoall/ExampleInstrumentedTest.java | a2ce27a19c39d7cce4d56c6a0f252f47bd2c691e | [] | no_license | QuocTuan1998/DemoAllBasicControls | 0c9cb1b1cfa43cbdc7ff099ea8434c7a34d4610d | b85296ff44da1935131ee04b9c8fde1ff2cf4ceb | refs/heads/master | 2021-01-23T04:34:46.080007 | 2017-03-26T06:59:04 | 2017-03-26T06:59:04 | 86,213,889 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 760 | java | package com.example.quoctuan.demoall;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.quoctuan.demoall", appContext.getPackageName());
}
}
| [
"quoctuanb6@gmail.com"
] | quoctuanb6@gmail.com |
dde44705dd57aeaa76074d640c6eb4f6ca9739b4 | 6d93c9aff8cd3f4c4b822e2824989e912fbabe24 | /src/by/bsuir/webtech/task15_16/comparator/BookTitleComparator.java | 87df312abdfb878c7c4e2b0b6ab6502b0a7605a4 | [] | no_license | newvlad2001/WebTech_Lab1 | ec0450a477fa3b8f8fb9a750a14dc7ac959d16d8 | 20cf219a41dce4d563bbb3f21837fde424da6a02 | refs/heads/master | 2023-09-04T01:22:03.412236 | 2021-10-13T13:55:12 | 2021-10-13T13:55:12 | 410,624,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 309 | java | package by.bsuir.webtech.task15_16.comparator;
import by.bsuir.webtech.task15_16.entity.Book;
import java.util.Comparator;
public class BookTitleComparator implements Comparator<Book> {
@Override
public int compare(Book b1, Book b2) {
return b1.getTitle().compareTo(b2.getTitle());
}
}
| [
"newvlad2001@gmail.com"
] | newvlad2001@gmail.com |
2973c06439b4f1c0cd899714bca6cf705451afa4 | 68f3f6453652202c724dba5a1dbed6e46ddf2a1d | /softProcess/src/com/googlecode/exttag/tags/ext/grid/RowNumberer.java | 510b1c8f06b5fb4c66865e456452f3eae7497441 | [] | no_license | ErpProcess/25121981 | c5ecddfbdfbb97516bc3f57d8a6333a65b84a9f0 | d417b3e2287b6cc240dde747db7fd88824819f99 | refs/heads/master | 2023-08-05T10:03:50.378009 | 2023-07-29T19:39:09 | 2023-07-29T19:39:09 | 149,328,434 | 0 | 0 | null | 2023-03-08T06:58:27 | 2018-09-18T17:39:30 | JavaScript | UTF-8 | Java | false | false | 1,618 | java | package com.googlecode.exttag.tags.ext.grid;
import com.googlecode.exttag.Description;
import com.googlecode.exttag.Variable;
import com.googlecode.exttag.tags.AbstractMapTag;
@Description("This is a utility class that can be passed into a Ext.grid.ColumnModel as a column config that provides an automatic row numbering column."
+ "Usage:"
+ "// This is a typical column config with the first column providing row numbers"
+ " var colModel = new Ext.grid.ColumnModel(["
+ " new Ext.grid.RowNumberer(),"
+ " {header: 'Name', width: 80, sortable: true},"
+ " {header: 'Code', width: 50, sortable: true},"
+ " {header: 'Description', width: 200, sortable: true}" + " ]);")
public class RowNumberer extends AbstractMapTag {
private String header;
private Boolean sortable;
private String width;
public String getHeader() {
return header;
}
@Description("header : String "
+ "Any valid text or HTML fragment to display in the header cell for the row number column (defaults to ''). ")
public void setHeader(String header) {
this.header = header;
}
public Boolean isSortable() {
return sortable;
}
@Description("sortable : Boolean "
+ "True if the row number column is sortable (defaults to false). ")
public void setSortable(Boolean sortable) {
this.sortable = sortable;
}
@Variable
public String getWidth() {
return width;
}
@Description("width : Number "
+ "The default width in pixels of the row number column (defaults to 23). ")
public void setWidth(String width) {
this.width = width;
}
}
| [
"amira@amira-PC"
] | amira@amira-PC |
42674d937e90a623e0d34efa55f4147f76a7023a | 5e484dd26b1c198e3e3567443034aaf9b0ba048c | /src/main/java/services/accesspoint/VisualizationDesignAP.java | c37ce1849f4986f4d33242c75f4f254eca91b7f7 | [] | no_license | ILogre/Service-Integration-Rules-on-Drools | 4806e422cef677e18bb9aeb9cd4cecdbcc9cbacb | e6c9c0e9f15679984f52afad381e017f759e3070 | refs/heads/master | 2021-01-17T07:05:36.865721 | 2016-04-06T06:36:15 | 2016-04-06T06:36:15 | 35,490,831 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,458 | java | package services.accesspoint;
import java.io.IOException;
import message.CharacterizeVisuMsg;
import message.DeclareDashboardMsg;
import message.IsValidatedDashboardAsw;
import message.IsValidatedDashboardMsg;
import message.PlugDataMsg;
import message.PositionMsg;
import message.ValidateAndPersistDashboardMsg;
import domain.VisualizationDesign;
import errors.UnknownDashboardException;
public class VisualizationDesignAP {
/*
* This access point exposes the behavior of the Visualization Design domain accessible to the final user
* It is responsible for receiving the original message from the rule engine and transmit it to the domain implementation.
*/
public static void declareDashboard(DeclareDashboardMsg msg){
VisualizationDesign.declareDashboard(msg);
}
public static void characterizeVisu(CharacterizeVisuMsg msg) throws UnknownDashboardException{
VisualizationDesign.characterizeVisu(msg);
}
public static void plugData(PlugDataMsg msg) throws UnknownDashboardException{
VisualizationDesign.plugData(msg);
}
public static void position(PositionMsg msg) throws UnknownDashboardException{
VisualizationDesign.position(msg);
}
public static IsValidatedDashboardAsw isValidated(IsValidatedDashboardMsg msg){
return VisualizationDesign.isValidated(msg);
}
public static void validateAndPersist(ValidateAndPersistDashboardMsg msg) throws IOException {
VisualizationDesign.validateAndPersist(msg);
}
}
| [
"logre@polytech.unice.fr"
] | logre@polytech.unice.fr |
56c789c424ca53de8076a191b03ea8949c673219 | b834fa45f863aa9ce2f73a1a933400302eed2c03 | /services/src/main/java/by/pvt/academy/yarkovich/filters/ConfigFilter.java | 22e6d05c8d29cb45c701427b75a5e7f5e737d815 | [] | no_license | dpunk683/mvc | 8c2f30923022f20b5fb5e7e732f1b6875d876d6e | 54780825f8804c97b95bcddd8a4612b5e10f47b6 | refs/heads/master | 2020-04-12T03:57:49.228512 | 2016-08-10T17:51:58 | 2016-08-10T17:51:58 | 65,223,926 | 0 | 1 | null | 2016-08-11T18:45:57 | 2016-08-08T17:16:31 | Java | UTF-8 | Java | false | false | 4,316 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package by.pvt.academy.yarkovich.filters;
import java.io.IOException;
import java.sql.SQLException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import by.pvt.academy.yarkovich.constants.AccessLevels;
import by.pvt.academy.yarkovich.constants.AttributeNames;
import by.pvt.academy.yarkovich.constants.PageNames;
import by.pvt.academy.yarkovich.dao.PersonalDAO;
import by.pvt.academy.yarkovich.entity.Personal;
import by.pvt.academy.yarkovich.logger.RestLogger;
/**
* Фильтр исполняет две задачи: кодирует параметры request объекта в UTF-8 и
* анализирует куки в случае новой сессии.
*
* Filter stands for two tasks: encodes request object in UTF-8 and
* analyses cookies in case of new session.
*
*/
public class ConfigFilter implements Filter {
public static String ID = "id";
public static String LOCALE = "locale_";
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
//устанавливаем кодировку
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
HttpSession session = req.getSession();
Integer accesslevel = (Integer)session.getAttribute(AttributeNames.ACCESS_LEVEL_ATTRIBUTE);
req.setCharacterEncoding("UTF-8");
try {
//смотрим куки
initSession(((HttpServletRequest) req).getSession(), (HttpServletRequest) req);
} catch (RuntimeException e) {
RestLogger.getInstance(this.getClass()).writeError("Exception at ConfigFilter: " + e);
}
if (accesslevel == null ) {
accesslevel = AccessLevels.GUEST;
session.setAttribute(AttributeNames.ACCESS_LEVEL_ATTRIBUTE, accesslevel);
//RequestDispatcher dispatcher = request.getServletContext().getRequestDispatcher("/jsp/login.jsp");
//dispatcher.forward(req, resp);
resp.sendRedirect(req.getContextPath()+PageNames.INDEX_PAGE);
return;
}
chain.doFilter(req, resp);
}
private void initSession(HttpSession session, HttpServletRequest request) {
if (session.isNew()) {
Cookie[] cookies = request.getCookies();
boolean isFound = false;
if (cookies != null) {
for (Cookie c : cookies) {
//looking for user id (for authorize purpose)
if ((c.getName()).equals(ID)) {
try {
Personal personal = PersonalDAO.getInstance().getWaiter(Integer.parseInt(c.getValue()));
session.setAttribute(AttributeNames.ACCESS_LEVEL_ATTRIBUTE, personal.getType());
session.setAttribute(AttributeNames.USER_OBJECT_ATTRIBUTE, personal);
isFound = true;
} catch (SQLException e) {
RestLogger.getInstance(this.getClass()).writeError("Exception in EncodingFilter: " + e);
}
}
// looking for user specified locale
if ((c.getName()).equals(AttributeNames.SESSION_LOCALE_ATTRIBUTE)) {
session.setAttribute(AttributeNames.SESSION_LOCALE_ATTRIBUTE, LOCALE + c.getValue());
}
}//end of foreach loop
}//end of if(cookies != null)
if (!isFound) {
session.setAttribute(AttributeNames.ACCESS_LEVEL_ATTRIBUTE, AccessLevels.GUEST);
}
}//end of if(session)
}
public void init(FilterConfig filterConfig) throws ServletException {
}
public void destroy() {
}
}
| [
"dpunk683@gmail.com"
] | dpunk683@gmail.com |
996b5e40036191f38e23cb4c7005dbf2f93212a4 | 75081d436b5a0975ebddf4f37e0f20719d72e313 | /src/main/java/com/example/demo/config/CorsConfig.java | 5327895684fbd7205eb9b10ad80303960b2a1b54 | [] | no_license | AlettaChens/communicationBackend | 12bc248dcfe180371f0a22abec7036f11e5eec83 | 3d4a53f868234dcd5c56af1e2b056bf0a70a1e36 | refs/heads/master | 2020-05-29T22:33:27.814371 | 2019-05-30T12:59:38 | 2019-05-30T12:59:41 | 189,411,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 914 | java | package com.example.demo.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
@Configuration
public class CorsConfig {
private CorsConfiguration buildConfig() {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.addAllowedOrigin("*");
corsConfiguration.addAllowedHeader("*");
corsConfiguration.addAllowedMethod("*");
return corsConfiguration;
}
@Bean
public CorsFilter corsFilter() {
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", buildConfig());
return new CorsFilter(source);
}
} | [
"chenyj@Zencloud.net.cn"
] | chenyj@Zencloud.net.cn |
35a61380a0e3e1618dcedb083ff8c7475a46ec66 | 025bdfd7e584f13da7e497a3d5a9f101617bba4e | /cuco-parent/cuco-service/src/main/java/cn/cuco/service/order/OrderMemberCarUsedService.java | 59864e7fb03a9937159ec6a16c8addec5cf7afe1 | [] | no_license | syz133350475/githubRepertory | deb70cc8192404a2a85072d732f5ed6107118c9f | 4665f8a458dd7eb2921c20f1a6c67566c2bba2f3 | refs/heads/master | 2021-06-23T22:09:52.892806 | 2017-09-05T07:22:50 | 2017-09-05T07:22:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,233 | java | package cn.cuco.service.order;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import cn.cuco.entity.MemberCarUsedAddress;
import cn.cuco.entity.OrderMemberCarUsed;
import cn.cuco.page.PageResult;
/**
* @ClassName: OrderMemberCarUsedService
* @Description: 用户用车订单相关接口
* @author zc.du
* @date 2017年2月23日 上午10:40:12
*/
public interface OrderMemberCarUsedService {
/**
* @Title: getOrderMemberCarUsedNotComplete
* @Description: 查询用户待支付或者进行中的用车订单
* @param: orderMemberCarUsed
* @return: OrderMemberCarUsed
*/
public List<OrderMemberCarUsed> getOrderMemberCarUsedNotComplete(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: createOrderMemberCarUsedForApp
* @Description: app端发起用户用车
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed createOrderMemberCarUsedForApp(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedForChangeCar
* @Description: 用户换车
* @author zc.du
* @param memberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedForChangeCar(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedStatusByConfirmUse
* @Description: 确认用车
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedStatusByConfirmUse(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedStatusByConfirmPayment
* @Description: 确认支付
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedStatusByConfirmPayment(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderInfoBeforePayment
* @Description: 支付前,用户修改用户用车信息
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderInfoBeforePayment(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderForReturnCarAdvance
* @Description: 用户提前还车
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderForReturnCarAdvance(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderForReturnCarDelay
* @Description: 用户延期还车
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderForReturnCarDelay(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedStatusByUsing
* @Description: 修改用车记录状态为使用中
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedStatusByUsing(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedStatusByComplete
* @Description: 修改用车记录状态为已完成
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedStatusByComplete(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedStatusByCompleteForLose
* @Description: 修改用车记录状态已失联为已完成
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedStatusByCompleteForLose(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedStatusBycancel
* @Description: 修改用车记录状态为已取消
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedStatusBycancel(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedStatusByLose
* @Description: 修改用车记录状态为已失联
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedStatusByLose(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: getOrderMemberCarUsed
* @Description: 查询用户用车记录
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed getOrderMemberCarUsed(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: getOrderMemberCarUsedListByPage
* @Description: 分页查询指定用户用车列表
* @author zc.du
* @param orderMemberCarUsed
* @return PageResult<OrderMemberCarUsed>
*/
public PageResult<OrderMemberCarUsed> getOrderMemberCarUsedListByPage(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: getOrderMemberCarUsedCountByMemberId
* @Description: 根据用户ID查询用户用车次数
* @author zc.du
* @param memberId
* @return Integer
*/
public Integer getOrderMemberCarUsedCountByMemberId(Long memberId);
/**
* @Title: getOrderMemberCarUsedMileagesByMemberId
* @Description: 根据用户ID查询用户行驶里程
* @author zc.du
* @param memberId
* @return BigDecimal
*/
public BigDecimal getOrderMemberCarUsedMileagesByMemberId(Long memberId);
/**
* @Title: getMemberCarUsedHabit
* @Description: 根据用户ID获取用户用车里程统计
* @author zc.du
* @param memberId
* @return Map<String,Integer>
*/
public Map<String, Integer> getMemberDriveMileageStatistics(Long memberId);
/**
* @Title: getMemberCarTypeUsedStatistics
* @Description: 根据用户ID获取用户使用车型统计
* @author zc.du
* @param memberId
* @return Map<String,Integer>
*/
public Map<String, Integer> getMemberCarTypeUsedStatistics(Long memberId);
/**
* @Title: deleteMemberCarUsedAddress
* @Description: 删除用户用车地址
* @author zc.du
* @param memberCarUsedAddress
* @return Integer
*/
public Integer deleteMemberCarUsedAddress(MemberCarUsedAddress memberCarUsedAddress);
/**
* @Title: getMemberCarUsedAddressListByPage
* @Description: 分页查询用户用车地址列表
* @author zc.du
* @param memberCarUsedAddress
* @return PageResult<MemberCarUsedAddress>
*/
public PageResult<MemberCarUsedAddress> getMemberCarUsedAddressListByPage(MemberCarUsedAddress memberCarUsedAddress);
/**
* @Title: getLastOrderMemberCarUsedByMemberId
* @Description: 查询用户最后一次用车记录
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed getLastOrderMemberCarUsedByMemberId(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: getMemberCarusedListByCarIdAndDate
* @Description: 根据车辆ID、时间查询用车记录(违章专用)
* @author zc.du
* @param orderMemberCarUsed(caroperateId:车辆ID;startDate:日期)
* @return List<OrderMemberCarUsed>
*/
public List<OrderMemberCarUsed> getOrderMemberCarUsedListByCarIdAndDate(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: getCarUsedCountByDate
* @Description: 查询指定时间段内指定车型确认支付用车次数(统计用)
* @author zc.du
* @param orderMemberCarUsed
* @return Integer
*/
public Integer getCarUsedCountByDate(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: getCarUsedCostMoneyByDate
* @Description: 查询指定时间段内指定车型确认支付的用车金额
* @author zc.du
* @param orderMemberCarUsed
* @return BigDecimal
*/
public BigDecimal getCarUsedCostMoneyByDate(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: updateOrderMemberCarUsedForSettingCar
* @Description: 分配车辆
* @author zc.du
* @param orderMemberCarUsed
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed updateOrderMemberCarUsedForSettingCar(OrderMemberCarUsed orderMemberCarUsed);
/**
* @Title: getOrderMemberCarUsedByMobileAndCarPlateNum
* @Description: 根据手机号、车牌号查询使用中的用车记录(手机号、车牌号至少一个不为空)
* @author zc.du
* @param mobile
* @param carPlateNum
* @return OrderMemberCarUsed
*/
public OrderMemberCarUsed getOrderMemberCarUsedByMobileAndCarPlateNum(String mobile,String carPlateNum);
}
| [
"jiazhipeng@users.noreply.github.com"
] | jiazhipeng@users.noreply.github.com |
b3caaa386c19aef0ff0b6d29d77990684675524e | 752ab04dca700a93236e27b220916f81ce35e512 | /src/ui/frame/match/MatchDataPanel.java | 66402301a58056fb88cb74959ba1b8c7bd826c41 | [] | no_license | 131250131/NBAInfo | f96e0640069957dad4810bc617c17f13cc827028 | b98d7d0138c8b65866ee35e2f24d46e299d8e618 | refs/heads/master | 2021-01-15T19:28:14.655322 | 2015-08-10T09:40:06 | 2015-08-10T09:40:06 | 31,880,379 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,662 | java | package ui.frame.match;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.util.ArrayList;
import javax.swing.JPanel;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import ui.myUI.JSortTable;
import ui.myUI.MyTable;
import ui.system.DataTransform;
import ui.system.UIData;
import vo.MatchVO;
import vo.PlayerVO;
@SuppressWarnings("serial")
public class MatchDataPanel extends JPanel{
private MyTable table;
private DataOfPlayerPanel players;
private DataOfMatchPanel thismatch;
private MatchVO matchData;
public MatchDataPanel(MatchVO match){
this.setOpaque(false);
this.setLayout(null);
this.setVisible(true);
//各组件
table = new MyTable();
players = new DataOfPlayerPanel();
thismatch = new DataOfMatchPanel();
JSortTable.makeFace(table.getTable());
thismatch.setLocation((int) (0 * UIData.changeX), (int) (50 * UIData.changeY));
players.setLocation((int) (400 * UIData.changeX), (int) (50 * UIData.changeY));
table.setBounds((int) (400 * UIData.changeX), (int) (270 * UIData.changeY), (int) (850 * UIData.changeX), (int) (400 * UIData.changeY));
//单元格值变化事件监控输出球员姓名
ListSelectionModel cellSelectionModel = table.getJTable().getSelectionModel();
cellSelectionModel.addListSelectionListener(new ListSelectionListener(){
public void valueChanged(ListSelectionEvent e) {//单元格值变动事件
String s = table.getSign(1);
players.update(s);
}
});
this.add(thismatch, 0);
this.add(players, 1);
this.add(table, 2);
this.update(match);
thismatch.getTeam1().addMouseListener(new MouseListenerOfteam("left"));
thismatch.getTeam2().addMouseListener(new MouseListenerOfteam("right"));
thismatch.getName1().addMouseListener(new MouseListenerOfteam("left"));
thismatch.getName2().addMouseListener(new MouseListenerOfteam("right"));
mousePress("left");
}
/*更新比赛信息*/
public void update(MatchVO matchData){
this.matchData = matchData;
thismatch.update(matchData);
}
private void mousePress(String team){
ArrayList<PlayerVO> playerlist=null;
String[] columname = {"姓名", "分钟", "%", "命中", "出手", "三分%"
, "三分命中", "三分出手", "罚球%", "罚球命中", "罚球出手", "+/-", "进攻"
, "防守", "篮板", "助攻", "犯规", "抢断", "失误", "盖帽", "得分"};
//根据左右标志获取左右球队球员信息
if(team.equals("left")){
playerlist = matchData.getLeftplayerlist();
}
else{
playerlist = matchData.getRightplayerlist();
}
Object[][] data = new Object[playerlist.size()][21];
for(int i = 0; i < playerlist.size(); i++){
data[i][0] = playerlist.get(i).getPlayerName();
data[i][1] = playerlist.get(i).getPlayerPlayTime() / 60;
data[i][2] = DataTransform.transDoubleTopointXX(playerlist.get(i).getPlayerFGP());
data[i][3] = playerlist.get(i).getPlayerFG();
data[i][4] = playerlist.get(i).getPlayerFGTry();
data[i][5] = DataTransform.transDoubleTopointXX(playerlist.get(i).getPlayer3FGP());
data[i][6] = playerlist.get(i).getPlayer3FG();
data[i][7] = playerlist.get(i).getPlayer3FGTry();
data[i][8] = DataTransform.transDoubleTopointXX(playerlist.get(i).getPlayerFTGP());
data[i][9] = playerlist.get(i).getPlayerFTG();
data[i][10] = playerlist.get(i).getPlayerFTGTry();
data[i][11] = playerlist.get(i).getPlayerPER();
data[i][12] = playerlist.get(i).getPlayerOffenceRebounds();
data[i][13] = playerlist.get(i).getPlayerDeffenceRebounds();
data[i][14] = playerlist.get(i).getPlayerTotalRebounds();
data[i][15] = playerlist.get(i).getPlayerAssists();
data[i][16] = playerlist.get(i).getPlayerFouls();
data[i][17] = playerlist.get(i).getPlayerSteals();
data[i][18] = playerlist.get(i).getPlayerTurnovers();
data[i][19] = playerlist.get(i).getPlayerBlocks();
data[i][20] = playerlist.get(i).getPlayerScores();
if(i < 5){
data[i][0] = data[i][0] + "(先发)";
}
}
table.update(columname, data);
}
class MouseListenerOfteam implements MouseListener{
String team="";
public MouseListenerOfteam(String team){
this.team = team;
}
@Override
public void mouseClicked(MouseEvent e) {
}
@Override
public void mousePressed(MouseEvent e) {
mousePress(team);
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
}
}
}
| [
"657834200@qq.com"
] | 657834200@qq.com |
3d485f889be23ad2dc1dca5dd050217a9a4ad808 | 6c6a2494cf34668d9979f52dc985e61dc1a5fcdc | /WalletService/src/main/java/e_wallet/WalletService/Exception/WalletBadRequest.java | ed26c136834524b822285b2541e96eed9e5f4810 | [] | no_license | RoshanMitra06/e-wallet-app | f757ff1c01ce3903cd16de0d7501aed408348f19 | 4c3a686e78629e34e977bd32dc8e5bd15a961909 | refs/heads/master | 2022-11-21T01:39:45.300482 | 2020-07-27T12:03:07 | 2020-07-27T12:03:07 | 298,783,850 | 1 | 0 | null | 2020-09-26T09:48:19 | 2020-09-26T09:48:18 | null | UTF-8 | Java | false | false | 183 | java | package e_wallet.WalletService.Exception;
public class WalletBadRequest extends RuntimeException
{
public WalletBadRequest() {
super("WalletBadRequest");
}
}
| [
"noreply@github.com"
] | RoshanMitra06.noreply@github.com |
d8cabd39fa2e78dfb2afa27159d0c144adec9c94 | 471cd06a249f543a14ef415445b176eb76714650 | /mcp/temp/src/minecraft/net/minecraft/entity/ai/EntityAITarget.java | 1e234008b1c3bdf959dd0eeb67b560272a93cae0 | [
"BSD-3-Clause"
] | permissive | Fredster777/ExploreCraft | ec3102d0dd86b1e9683c30ee7b181e8d0d04e063 | db163ca7b40b1fd834d180c17cb8476c551a5540 | refs/heads/master | 2020-06-06T12:22:18.903600 | 2014-03-29T14:48:38 | 2014-03-29T14:48:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,917 | java | package net.minecraft.entity.ai;
import net.minecraft.entity.EntityCreature;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EntityOwnable;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.attributes.AttributeInstance;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.pathfinding.PathPoint;
import net.minecraft.util.MathHelper;
import org.apache.commons.lang3.StringUtils;
public abstract class EntityAITarget extends EntityAIBase {
protected EntityCreature field_75299_d;
protected boolean field_75297_f;
private boolean field_75303_a;
private int field_75301_b;
private int field_75302_c;
private int field_75298_g;
public EntityAITarget(EntityCreature p_i1669_1_, boolean p_i1669_2_) {
this(p_i1669_1_, p_i1669_2_, false);
}
public EntityAITarget(EntityCreature p_i1670_1_, boolean p_i1670_2_, boolean p_i1670_3_) {
this.field_75299_d = p_i1670_1_;
this.field_75297_f = p_i1670_2_;
this.field_75303_a = p_i1670_3_;
}
public boolean func_75253_b() {
EntityLivingBase var1 = this.field_75299_d.func_70638_az();
if(var1 == null) {
return false;
} else if(!var1.func_70089_S()) {
return false;
} else {
double var2 = this.func_111175_f();
if(this.field_75299_d.func_70068_e(var1) > var2 * var2) {
return false;
} else {
if(this.field_75297_f) {
if(this.field_75299_d.func_70635_at().func_75522_a(var1)) {
this.field_75298_g = 0;
} else if(++this.field_75298_g > 60) {
return false;
}
}
return true;
}
}
}
protected double func_111175_f() {
AttributeInstance var1 = this.field_75299_d.func_110148_a(SharedMonsterAttributes.field_111265_b);
return var1 == null?16.0D:var1.func_111126_e();
}
public void func_75249_e() {
this.field_75301_b = 0;
this.field_75302_c = 0;
this.field_75298_g = 0;
}
public void func_75251_c() {
this.field_75299_d.func_70624_b((EntityLivingBase)null);
}
protected boolean func_75296_a(EntityLivingBase p_75296_1_, boolean p_75296_2_) {
if(p_75296_1_ == null) {
return false;
} else if(p_75296_1_ == this.field_75299_d) {
return false;
} else if(!p_75296_1_.func_70089_S()) {
return false;
} else if(!this.field_75299_d.func_70686_a(p_75296_1_.getClass())) {
return false;
} else {
if(this.field_75299_d instanceof EntityOwnable && StringUtils.isNotEmpty(((EntityOwnable)this.field_75299_d).func_70905_p())) {
if(p_75296_1_ instanceof EntityOwnable && ((EntityOwnable)this.field_75299_d).func_70905_p().equals(((EntityOwnable)p_75296_1_).func_70905_p())) {
return false;
}
if(p_75296_1_ == ((EntityOwnable)this.field_75299_d).func_70902_q()) {
return false;
}
} else if(p_75296_1_ instanceof EntityPlayer && !p_75296_2_ && ((EntityPlayer)p_75296_1_).field_71075_bZ.field_75102_a) {
return false;
}
if(!this.field_75299_d.func_110176_b(MathHelper.func_76128_c(p_75296_1_.field_70165_t), MathHelper.func_76128_c(p_75296_1_.field_70163_u), MathHelper.func_76128_c(p_75296_1_.field_70161_v))) {
return false;
} else if(this.field_75297_f && !this.field_75299_d.func_70635_at().func_75522_a(p_75296_1_)) {
return false;
} else {
if(this.field_75303_a) {
if(--this.field_75302_c <= 0) {
this.field_75301_b = 0;
}
if(this.field_75301_b == 0) {
this.field_75301_b = this.func_75295_a(p_75296_1_)?1:2;
}
if(this.field_75301_b == 2) {
return false;
}
}
return true;
}
}
}
private boolean func_75295_a(EntityLivingBase p_75295_1_) {
this.field_75302_c = 10 + this.field_75299_d.func_70681_au().nextInt(5);
PathEntity var2 = this.field_75299_d.func_70661_as().func_75494_a(p_75295_1_);
if(var2 == null) {
return false;
} else {
PathPoint var3 = var2.func_75870_c();
if(var3 == null) {
return false;
} else {
int var4 = var3.field_75839_a - MathHelper.func_76128_c(p_75295_1_.field_70165_t);
int var5 = var3.field_75838_c - MathHelper.func_76128_c(p_75295_1_.field_70161_v);
return (double)(var4 * var4 + var5 * var5) <= 2.25D;
}
}
}
}
| [
"freddie.guthrie@googlemail.com"
] | freddie.guthrie@googlemail.com |
c9f0a924e1a3e4ec8da28d8bb7b98e75b7efc170 | 3045794360189d6ff68c2e7d6affd55e4eacb22c | /unixyz/src/br/com/unixyz/beans/Aluno.java | d91c1496bb7c8d35cc9e1b88afe0c75dd7c5e750 | [] | no_license | tplsouza/wsremoto | f66af6daaa549b3b2a0ec71fd871aa5cbb5d7ada | 8ce4b577ffb0774723e57de006c85e9d3f2f5998 | refs/heads/main | 2023-01-20T18:01:42.917552 | 2020-11-27T15:30:05 | 2020-11-27T15:30:05 | 312,378,252 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 822 | java | package br.com.unixyz.beans;
public class Aluno {
private int rm;
private String nome;
private String email;
public Aluno() {
super();
}
public Aluno(int rm, String nome, String email) {
super();
this.rm = rm;
this.nome = nome;
this.email = email;
}
public void setAll(int rm, String nome, String email) {
this.rm = rm;
this.nome = nome;
this.email = email;
}
public String getAll() {
return
"RM: "+ rm + "\n" +
"Nome: "+ nome + "\n" +
"Email: "+ email ;
}
public int getRm() {
return rm;
}
public void setRm(int rm) {
this.rm = rm;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
| [
"tiagopelicer@gmail.com"
] | tiagopelicer@gmail.com |
971ed66a79e46fe92318dc27041a4de74aab95d0 | cfae23984857c245ccee397704a3e5dc850c57f2 | /app/src/main/java/com/phuong/apptruyen/item/ContentApp.java | 64f4daba84dfe1a56ebcc564c9febf53337bced1 | [] | no_license | gnouhpuht/AppTruyen | 67ad82a16795e4110a7e8d1372af53c2c7c78cfb | 9a2857a17c246a8e70d3a1670e4fcce9a0d57f4d | refs/heads/master | 2020-06-04T01:20:37.949933 | 2019-06-13T18:16:41 | 2019-06-13T18:16:41 | 191,812,510 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 543 | java | package com.phuong.apptruyen.item;
public class ContentApp {
private String name;
private String contentApp;
public ContentApp(String name, String contentApp) {
this.name = name;
this.contentApp = contentApp;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getContentApp() {
return contentApp;
}
public void setContentApp(String contentApp) {
this.contentApp = contentApp;
}
}
| [
"quangtv.firecoals@gmail.com"
] | quangtv.firecoals@gmail.com |
d2d26ef10decea0f4fc612e1b1d5cc4534ad8756 | 501653006ab2cae6cc9ec4b0c7d951a8465d0510 | /app/src/main/java/onclicklisteners/ViewVisibilitySetter.java | c2309bb5584c373e75db2bb7b9157ddddef05dd1 | [] | no_license | pichiaro/ApplicazioneConsigliaViaggi | c23c9703111de1f63fa43226da6a064a7620f835 | 73e52d6136bc921f604ab7f4a9a64c3237ed283e | refs/heads/master | 2022-12-31T07:13:32.497434 | 2020-10-19T09:09:23 | 2020-10-19T09:09:23 | 305,326,039 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 978 | java | package onclicklisteners;
import android.view.View;
import android.view.View.OnClickListener;
public class ViewVisibilitySetter implements OnClickListener {
private View view;
private boolean isMakedVisible;
public ViewVisibilitySetter(View view, boolean isMakedVisible) {
this.view = view;
this.isMakedVisible = isMakedVisible;
}
public void setView(View view) {
this.view = view;
}
public View getView() {
return view;
}
public void setMakedVisible(boolean makedVisible) {
isMakedVisible = makedVisible;
}
public boolean isMakedVisible() {
return this.isMakedVisible;
}
@Override
public void onClick(View view) {
if (this.view != null) {
if (!this.isMakedVisible) {
this.view.setVisibility(View.INVISIBLE);
}
else {
this.view.setVisibility(View.VISIBLE);
}
}
}
} | [
"pi.chiaro@studenti.unina.it"
] | pi.chiaro@studenti.unina.it |
5ca274e803123492933a449c9bf1791f59af0638 | 5f3c98e9f57e466f4784243c21c725cff03f4e5f | /SpringBoot-hibernate-one-one-mapping/src/main/java/com/springboot/repository/UserRepository.java | 63b6de6f3076998b2d70b97d1a18fcf92125a62d | [] | no_license | itsrahulchaudhary/SpringBootSampleExample | f3ecfd1b1fd3ee6b6d28ed054b37779e92d6ecdc | 05dd341123368753e0c13759aad653f7d4e0885a | refs/heads/master | 2023-06-25T22:41:21.213508 | 2021-07-25T06:23:08 | 2021-07-25T06:23:08 | 348,810,947 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 268 | java | package com.springboot.repository;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
import com.springboot.entity.User;
@Repository
public interface UserRepository extends JpaRepository<User, Long>{
}
| [
"rahulcy49@gmail.com"
] | rahulcy49@gmail.com |
90d0e8403ced79e8a0faaab4d9fa210c443fe61c | ffe4e704cf13cc0f2abe9231cc809a05f9454a7e | /test/edu/unm/cs/venture/TestConcourse.java | 28ec93850f5c6396f15ec9d33e7c5b7ad437e350 | [] | no_license | khabbabs/airportSim | 27ddd56a77ef43e325b551f6597cca0cd331e4fb | 9959de6c9a4e7958e380226b4d1fc4e080af5586 | refs/heads/master | 2020-05-04T22:14:13.583881 | 2013-11-18T02:17:55 | 2013-11-18T02:17:55 | 14,479,746 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package edu.unm.cs.venture;
import static org.junit.Assert.*;
import java.awt.Dimension;
import org.junit.Test;
public class TestConcourse {
Dimension dim = new Dimension(0, 0);
@Test
public final void testConcourse() {
Concourse concourse = new Concourse(dim, dim);
// Display the output nodes of the concourse
System.err.println("Concourse " + concourse.getID() + " has output nodes: ");
for (Edge outputEdge : concourse.getOutputEdges()) {
System.err.print(outputEdge.getOutputNode().getID() + ": ");
// Display attached gates to each group
for (Edge outputEdge2 : outputEdge.getOutputNode().getOutputEdges()) {
System.err.print(outputEdge2.getOutputNode().getID() + ", ");
}
System.err.println();
}
}
}
| [
"khabbabs@gmail.com"
] | khabbabs@gmail.com |
0b0d315e3db8ebed42ddecde1071368fd8e51720 | cc0d17d500d8340d28969a5a08dabb954c2204ed | /OpenVPNAndroidLibrary/src/de/blinkt/openvpn/api/FileUtilities.java | 60afaf6d25e4b7cd5dddfebd1a528c25db605925 | [] | no_license | xi1314/OpenVPNLibrary | 9be86ff842cb4b4bd099fcb71c8e32c4105973fb | 6562c9aadf780148b8caa8fc91ae46819de2079c | refs/heads/master | 2021-01-20T16:22:26.014191 | 2014-05-14T11:21:17 | 2014-05-14T11:21:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,722 | java | package de.blinkt.openvpn.api;
/**
* Created by FL on 06.05.14.
*/
import android.content.Context;
import android.os.Environment;
import android.util.Log;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
public class FileUtilities {
private Writer writer;
private String absolutePath;
private final Context context;
public String mFile = "/temp_ovp/conf.ovpn";
public String mDir = "/temp_ovp";
public FileUtilities(Context context) {
super();
this.context = context;
}
public void write(String fileName, String data) {
File root = Environment.getExternalStorageDirectory();
File outDir = new File(root.getAbsolutePath() + File.separator + "temp_ovp");
if (!outDir.isDirectory()) {
outDir.mkdir();
}
try {
if (!outDir.isDirectory()) {
throw new IOException(
"Unable to create directory EZ_time_tracker. Maybe the SD card is mounted?");
}
File outputFile = new File(outDir, fileName);
writer = new BufferedWriter(new FileWriter(outputFile));
writer.write(data);
writer.close();
} catch (IOException e) {
Log.w("eztt", e.getMessage(), e);
}
}
public Writer getWriter() {
return writer;
}
public String getAbsolutePath() {
return absolutePath;
}
public void recursiveDelete(File fileOrDirectory) {
if (fileOrDirectory.isDirectory())
for (File child : fileOrDirectory.listFiles())
recursiveDelete(child);
fileOrDirectory.delete();
}
}
| [
"oles.falcon@gmail.com"
] | oles.falcon@gmail.com |
27af1551c5bbc9bf9ea66bdb0bb03c4d1200d4d4 | 95df12923ad7f26f46cf1ef0f1fa3028e82f0d8e | /src/SpikeLibrary/SpikeLEDButton.java | 6e1ffcedc0cb5af74038343f8f428ffe83f099c7 | [] | no_license | Team293/RecycleRush2 | d3b9a52dd613e53ab82808b85e73877483e723b0 | 0b38623857daf0ec4dffe944b17c5ceb9e00312e | refs/heads/master | 2021-03-12T20:20:33.710342 | 2015-02-16T19:48:33 | 2015-02-16T19:49:41 | 29,990,789 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 713 | java | package SpikeLibrary;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.Timer;
public class SpikeLEDButton extends SpikeButton{
private int outputNumber;
private Timer timer = new Timer();
private double periodLength = 0.25; //length of flashes in seconds
private boolean flashState = false;
public SpikeLEDButton(Joystick joystick, int buttonNumber, int outputNumber) {
super(joystick, buttonNumber);
this.joystick = joystick;
timer.start();
}
public void setOutput(boolean state) {
joystick.setOutput(outputNumber, state);
}
public void flash() {
if (timer.get() > periodLength) {
timer.reset();
flashState = !flashState;
setOutput(flashState);
}
}
}
| [
"293.First@gmail.com"
] | 293.First@gmail.com |
55114e6d302d9174e26f11e8d6a710c05d54fe24 | e8c3c9a360661cd0ef1a4473afef0e007aed8368 | /system-framework/src/main/java/com/system/framework/shiro/service/SysPasswordService.java | c697f6903cb97d14df72f931317b87b341ff1f30 | [] | no_license | chungfung/center-system | 7d37f02cd674ba08ff2cca7b65092e35968382a7 | 7787175c5ebccb5b234596df08bf8085c1651c31 | refs/heads/master | 2022-10-22T14:38:39.455049 | 2019-06-05T07:41:07 | 2019-06-05T07:41:07 | 187,584,304 | 0 | 1 | null | 2022-10-12T20:26:48 | 2019-05-20T06:55:20 | Java | UTF-8 | Java | false | false | 2,864 | java | package com.system.framework.shiro.service;
import com.system.framework.manager.AsyncManager;
import com.system.framework.manager.factory.AsyncFactory;
import com.system.common.constant.Constants;
import com.system.common.exception.user.UserPasswordNotMatchException;
import com.system.common.exception.user.UserPasswordRetryLimitExceedException;
import com.system.common.utils.MessageUtils;
import com.system.service.domain.SysUser;
import org.apache.shiro.cache.Cache;
import org.apache.shiro.cache.CacheManager;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 登录密码方法
*
* @author system
*/
@Component
public class SysPasswordService
{
@Autowired
private CacheManager cacheManager;
private Cache<String, AtomicInteger> loginRecordCache;
@Value(value = "${user.password.maxRetryCount}")
private String maxRetryCount;
@PostConstruct
public void init()
{
loginRecordCache = cacheManager.getCache("loginRecordCache");
}
public void validate(SysUser user, String password)
{
String loginName = user.getLoginName();
AtomicInteger retryCount = loginRecordCache.get(loginName);
if (retryCount == null)
{
retryCount = new AtomicInteger(0);
loginRecordCache.put(loginName, retryCount);
}
if (retryCount.incrementAndGet() > Integer.valueOf(maxRetryCount).intValue())
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.exceed", maxRetryCount)));
throw new UserPasswordRetryLimitExceedException(Integer.valueOf(maxRetryCount).intValue());
}
if (!matches(user, password))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(loginName, Constants.LOGIN_FAIL, MessageUtils.message("user.password.retry.limit.count", retryCount)));
loginRecordCache.put(loginName, retryCount);
throw new UserPasswordNotMatchException();
}
else
{
clearLoginRecordCache(loginName);
}
}
public boolean matches(SysUser user, String newPassword)
{
return user.getPassword().equals(encryptPassword(user.getLoginName(), newPassword, user.getSalt()));
}
public void clearLoginRecordCache(String username)
{
loginRecordCache.remove(username);
}
public String encryptPassword(String username, String password, String salt)
{
return new Md5Hash(username + password + salt).toHex().toString();
}
}
| [
"fy_java@163.com"
] | fy_java@163.com |
61ee25b082e36487d29638fb0a619f749212ea6a | 312fce6c392eafaf2cf14e8ea3d8ec5a6e15ede1 | /src/serendipitytranslator/translationWindow/TranslateTableRenderer.java | 57e3ad9faf911dd0ebc5d8fcc7a8afc9cd275af1 | [] | no_license | fugazza/SerendipityTranslator | 6991bbdcb3ac7a68eb266cd944ed31e3ce731384 | 2943ebbdabef4fd75d9e199eaa5932f0c148c17d | refs/heads/master | 2020-06-03T11:13:22.338113 | 2013-12-31T21:46:03 | 2013-12-31T21:46:03 | 2,796,823 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,587 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package serendipitytranslator.translationWindow;
import java.awt.Color;
import java.awt.Component;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
/**
*
* @author Vláďa
*/
public class TranslateTableRenderer extends DefaultTableCellRenderer {
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (!isSelected) {
TranslateRowStatus status = ((TranslateTableModel) table.getModel()).getRowStatus(row);
//System.out.println("row " + row + ": " + status);
if (status.equals(TranslateRowStatus.blank_english)) {
//System.out.println("yep, blank english");
c.setBackground(new Color(255,255,200));
} else if (status.equals(TranslateRowStatus.blank_local)) {
//System.out.println("ouh, blank local");
c.setBackground(new Color(255,200,200));
} else if (status.equals(TranslateRowStatus.equal)) {
//System.out.println("wtf the same?");
c.setBackground(new Color(200,255,200));
} else {
c.setBackground(new Color(255,255,255,255));
}
//System.out.println("BG color = " + c.getBackground());
}
return c;
}
}
| [
"vlada@ajgl.cz"
] | vlada@ajgl.cz |
f3b82c09f573a29993080d13795e81541218e9a4 | cdd9840b6833948df5715b456cea05ac5bddb17a | /src/main/java/SealedClass.java | 162d6f40622abbb02c05bb28de104fcc227ff3c8 | [] | no_license | InvincibleDudu/Random-Java-Mess | 63717395876648a7429a75698d8856a4f757c7b7 | ea07e92845859ce41cf25cbaf72cc7938905904e | refs/heads/master | 2023-03-01T23:26:55.810463 | 2021-02-03T06:23:59 | 2021-02-03T06:23:59 | 335,155,073 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 705 | java | import java.awt.*;
/**
* Created by InvincibleDudu on 08/26/2020 at 15:06
*/
//public sealed interface SealedClass permits SealedClassImpl {
// double area(double a, double b);
//}
//
//non-sealed class SealedClassImpl implements SealedClass {
//
// public static void main(String[] args) {
// System.out.println(new SealedClassImpl().area(3.2, 5.7));
// }
//
// @Override
// public double area(double a, double b) {
// return a * b;
// }
//}
//
//
//sealed interface Shape permits Shape.Circle, Shape.Rectangle {
//
// record Circle(Point center, int radius) implements Shape { }
//
// record Rectangle(Point lowerLeft, Point upperRight) implements Shape { }
//}
| [
"409174690@qq.com"
] | 409174690@qq.com |
61cd585bfc75d90e2853113e40484e63c34878e0 | fbb9a6bff1f30f73bcc7f16b44d813c3bd6b3d8d | /src/main/java/me/darksidecode/kantanj/types/Maps.java | 4b07df1a4261dfa5b204cf6fd9a5c93cccdbd488 | [
"Apache-2.0"
] | permissive | MeGysssTaa/kantanj | 2f5d8314fc412978e9ce443fac8007066ebfa02a | 1cbfc50d80ec521bf79afd83dfaa92d40e7731a3 | refs/heads/master | 2023-07-03T17:08:46.627660 | 2021-06-24T20:33:08 | 2021-06-24T20:33:08 | 172,130,150 | 3 | 3 | Apache-2.0 | 2023-06-14T22:29:06 | 2019-02-22T20:26:55 | Java | UTF-8 | Java | false | false | 1,607 | java | /*
* Copyright 2021 German Vekhorev (DarksideCode)
*
* 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 me.darksidecode.kantanj.types;
import java.util.Map;
public final class Maps {
private Maps() {}
public static <K, V> void copy(Map<K, V> src, Map<K, V> dest) {
Check.notNull(src, "source map cannot be null");
Check.notNull(dest, "destination map cannot be null");
src.forEach(dest::put);
}
public static <K, V> Map<K, V> copy(Map<K, V> src, Class<? extends Map> typeOfDestMap) {
Check.notNull(src, "source map cannot be null");
Check.notNull(typeOfDestMap, "type of destination map cannot be null");
Map<K, V> dest;
try {
dest = typeOfDestMap.newInstance();
} catch (InstantiationException | IllegalAccessException ex) {
throw new RuntimeException("failed to instantiate" +
"a new Map of type " + typeOfDestMap.getName(), ex);
}
src.forEach(dest::put);
return dest;
}
}
| [
"darksidecode@ya.ru"
] | darksidecode@ya.ru |
26280ec1ea455bfb9c15781cbc29597bffec7661 | 592eb3c39bbd5550c5406abdfd45f49c24e6fd6c | /autoweb/src/main/java/com/autosite/struts/action/PollVoteAction.java | ee3a4cf4111c7d086f02f8c371ff345acfa92a39 | [] | no_license | passionblue/autoweb | f77dc89098d59fddc48a40a81f2f2cf27cd08cfb | 8ea27a5b83f02f4f0b66740b22179bea4d73709e | refs/heads/master | 2021-01-17T20:33:28.634291 | 2016-06-17T01:38:45 | 2016-06-17T01:38:45 | 60,968,206 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 43,675 | java | package com.autosite.struts.action;
import java.util.ArrayList;
import java.util.Date;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import com.jtrend.util.WebParamUtil;
import com.jtrend.util.WebUtil;
import com.jtrend.util.JtStringUtil;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.json.JSONArray;
import org.json.JSONObject;
import com.autosite.db.PollVote;
import com.autosite.ds.PollVoteDS;
import com.autosite.db.Site;
import com.autosite.ds.SiteDS;
import com.autosite.session.AutositeSessionContext;
import com.autosite.db.AutositeUser;
import com.autosite.util.UserUtil;
import com.autosite.Constants;
import com.autosite.struts.form.PollVoteForm;
import com.autosite.struts.action.core.AutositeActionExtent;
import com.autosite.struts.action.core.AutositeCoreAction;
import com.autosite.util.web.DropMenuItem;
import com.autosite.util.web.DropMenuUtil;
import com.jtrend.session.WebProcManager;
import com.jtrend.session.webprocess.WebProcess;
import com.jtrend.util.TimeNow;
import com.autosite.util.RandomUtil;
public class PollVoteAction extends AutositeCoreAction {
public PollVoteAction(){
m_ds = PollVoteDS.getInstance();
m_actionExtent = (AutositeActionExtent)getActionExtent();
if ( m_actionExtent == null)
m_actionExtent = new AutositeActionExtent();
}
public ActionForward ex(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, boolean throwException) throws Exception {
PollVoteForm _PollVoteForm = (PollVoteForm) form;
HttpSession session = request.getSession();
setPage(session, "poll_result_single");
Site site = SiteDS.getInstance().registerSite(request.getServerName());
if (site == null ) {
sessionErrorText(session, "Internal error occurred. Please try once again");
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
AutositeSessionContext context = (AutositeSessionContext)getSessionContext(session);
AutositeUser autoUser = context.getUserObject();
boolean accessTestOkay = true;
if (!accessTestOkay ){
sessionErrorText(session, "Permission error occurred.");
setPage(session, "poll_display_default");
m_logger.error("Permission error occurred. Trying to access SuperAdmin/SiteAdmin operation without proper status");
return mapping.findForward("default");
}
try {
m_actionExtent.beforeMain(request, response);
}
catch (Exception e) {
if (throwException) throw e;
sessionErrorText(session, "Internal error occurred.");
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
m_logger.error(e.getMessage(),e);
return mapping.findForward("default");
}
PollVote _PollVote = null;
long cid = (long)0;
if (!hasRequestValue(request, "add", "true")) {
cid = WebParamUtil.getLongValue(request.getParameter("id"));
_PollVote = m_ds.getById(cid);
}
if (hasRequestValue(request, "edit", "true")||hasRequestValue(request, "ed", "true")||hasRequestValue(request, "act", "ed")) {
//long cid = WebParamUtil.getLongValue(request.getParameter("id"));
//PollVote _PollVote = m_ds.getById(cid);
if (_PollVote == null) {
sessionErrorText(session, "Internal error occurred.");
m_logger.warn("Failed. object not found for " + cid);
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
if (_PollVote.getSiteId() != site.getId()) {
sessionErrorText(session, "Internal error occurred.");
m_logger.warn("Failed. Attempt to delete other site. This Site=" + site.getId() + ", Attempted=" + _PollVote.getSiteId());
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
try{
edit(request, response, _PollVoteForm, _PollVote);
}
catch (Exception e) {
m_logger.error("Error occurred", e);
if (throwException) throw e;
sessionErrorText(session, "Internal error occurred.");
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
if (e instanceof ActionExtentException) setPage(session, ((ActionExtentException)e).getForwardPage());
return mapping.findForward("default");
}
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
return mapping.findForward("default");
} else if (hasRequestValue(request, "editfield", "true")||hasRequestValue(request, "ef", "true")||hasRequestValue(request, "act", "ef")) {
//long cid = WebParamUtil.getLongValue(request.getParameter("id"));
//PollVote _PollVote = m_ds.getById(cid);
if (_PollVote == null) {
sessionErrorText(session, "Internal error occurred.");
m_logger.warn("Failed. object not found for " + cid);
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
if (_PollVote.getSiteId() != site.getId()) {
sessionErrorText(session, "Internal error occurred.");
m_logger.warn("Failed. Attempt to delete other site. This Site=" + site.getId() + ", Attempted=" + _PollVote.getSiteId());
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
try{
editField(request, response, _PollVote);
}
catch (Exception e) {
m_logger.error("Error occurred", e);
if (throwException) throw e;
sessionErrorText(session, "Internal error occurred.");
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
if (e instanceof ActionExtentException) setPage(session, ((ActionExtentException)e).getForwardPage());
return mapping.findForward("default");
}
setPage(session, "poll_display_default");
return mapping.findForward("default");
} else if (hasRequestValue(request, "del", "true")||hasRequestValue(request, "de", "true")||hasRequestValue(request, "act", "del")) {
//long cid = WebParamUtil.getLongValue(request.getParameter("id"));
//PollVote _PollVote = m_ds.getById(cid);
if (_PollVote == null) {
sessionErrorText(session, "Internal error occurred.");
m_logger.warn("Failed. object not found for " + cid);
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
if (_PollVote.getSiteId() != site.getId()) {
sessionErrorText(session, "Internal error occurred.");
m_logger.warn("Failed. Attempt to delete other site. This Site=" + site.getId() + ", Attempted=" + _PollVote.getSiteId());
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
try {
m_actionExtent.beforeDelete(request, response, _PollVote);
}
catch (Exception e) {
if (throwException) throw e;
sessionErrorText(session, e.getMessage());
m_logger.error(e.getMessage(),e);
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
if (e instanceof ActionExtentException) setPage(session, ((ActionExtentException)e).getForwardPage());
return mapping.findForward("default");
}
m_ds.delete(_PollVote);
try {
m_actionExtent.afterDelete(request, response, _PollVote);
}
catch (Exception e) {
if (throwException) throw e;
sessionErrorText(session, e.getMessage());
//Default error page but will be overridden by exception specific error page
setPage(session, "poll_display_default");
if (e instanceof ActionExtentException) setPage(session, ((ActionExtentException)e).getForwardPage());
m_logger.error(e.getMessage(),e);
return mapping.findForward("default");
}
setPage(session, "poll_center");
} else if (hasRequestValue(request, "add", "true")) {
m_logger.info("Creating new PollVote" );
PollVote _PollVoteNew = new PollVote();
// Setting IDs for the object
_PollVoteNew.setSiteId(site.getId());
AutositeSessionContext ctx = (AutositeSessionContext)getSessionContext(session);
AutositeUser user = ctx.getUserObject();
if (user != null && ctx.isLogin() ){
m_logger.debug("Setting user id for this object to " + user.getId());
_PollVoteNew.setUserId(user.getId());
}
_PollVoteNew.setPollId(WebParamUtil.getLongValue(_PollVoteForm.getPollId()));
m_logger.debug("setting PollId=" +_PollVoteForm.getPollId());
_PollVoteNew.setAnswer(WebParamUtil.getLongValue(_PollVoteForm.getAnswer()));
m_logger.debug("setting Answer=" +_PollVoteForm.getAnswer());
_PollVoteNew.setMultipleAnswer(WebParamUtil.getStringValue(_PollVoteForm.getMultipleAnswer()));
m_logger.debug("setting MultipleAnswer=" +_PollVoteForm.getMultipleAnswer());
_PollVoteNew.setByGuest(WebParamUtil.getIntValue(_PollVoteForm.getByGuest()));
m_logger.debug("setting ByGuest=" +_PollVoteForm.getByGuest());
_PollVoteNew.setIpAddress(WebParamUtil.getStringValue(_PollVoteForm.getIpAddress()));
m_logger.debug("setting IpAddress=" +_PollVoteForm.getIpAddress());
_PollVoteNew.setPcid(WebParamUtil.getStringValue(_PollVoteForm.getPcid()));
m_logger.debug("setting Pcid=" +_PollVoteForm.getPcid());
_PollVoteNew.setDupCheckKey(WebParamUtil.getStringValue(_PollVoteForm.getDupCheckKey()));
m_logger.debug("setting DupCheckKey=" +_PollVoteForm.getDupCheckKey());
_PollVoteNew.setNote(WebParamUtil.getStringValue(_PollVoteForm.getNote()));
m_logger.debug("setting Note=" +_PollVoteForm.getNote());
_PollVoteNew.setOwnAnswer(WebParamUtil.getStringValue(_PollVoteForm.getOwnAnswer()));
m_logger.debug("setting OwnAnswer=" +_PollVoteForm.getOwnAnswer());
_PollVoteNew.setTimeCreated(WebParamUtil.getDateValue(_PollVoteForm.getTimeCreated()));
m_logger.debug("setting TimeCreated=" +_PollVoteForm.getTimeCreated());
try{
m_actionExtent.beforeAdd(request, response, _PollVoteNew);
}
catch (Exception e) {
if (throwException) throw e;
sessionErrorText(session, e.getMessage());
m_logger.error(e.getMessage(),e);
setPage(session, "poll_display_default");
if (e instanceof ActionExtentException) setPage(session, ((ActionExtentException)e).getForwardPage());
return mapping.findForward("default");
}
if (_PollVoteNew.skipPersist())
m_logger.info("Skipping new object by skipPersist()");
else
m_ds.put(_PollVoteNew);
try{
m_actionExtent.afterAdd(request, response, _PollVoteNew);
}
catch (Exception e) {
if (throwException) throw e;
sessionErrorText(session, e.getMessage());
m_logger.error(e.getMessage(),e);
setPage(session, "poll_display_default");
if (e instanceof ActionExtentException) setPage(session, ((ActionExtentException)e).getForwardPage());
return mapping.findForward("default");
}
//setPage(session, "poll_vote_home");
} else {
sessionErrorText(session, "Invalid request.");
m_logger.error("There was no proper command like add or update or delete");
setPage(session, "poll_display_default");
return mapping.findForward("default");
}
return mapping.findForward("default");
}
protected void edit(HttpServletRequest request, HttpServletResponse response, PollVoteForm _PollVoteForm, PollVote _PollVote) throws Exception{
// long cid = WebParamUtil.getLongValue(request.getParameter("id"));
// PollVote _PollVote = m_ds.getById(cid);
m_logger.debug("Before update " + PollVoteDS.objectToString(_PollVote));
_PollVote.setPollId(WebParamUtil.getLongValue(_PollVoteForm.getPollId()));
_PollVote.setAnswer(WebParamUtil.getLongValue(_PollVoteForm.getAnswer()));
_PollVote.setMultipleAnswer(WebParamUtil.getStringValue(_PollVoteForm.getMultipleAnswer()));
_PollVote.setByGuest(WebParamUtil.getIntValue(_PollVoteForm.getByGuest()));
_PollVote.setIpAddress(WebParamUtil.getStringValue(_PollVoteForm.getIpAddress()));
_PollVote.setPcid(WebParamUtil.getStringValue(_PollVoteForm.getPcid()));
_PollVote.setDupCheckKey(WebParamUtil.getStringValue(_PollVoteForm.getDupCheckKey()));
_PollVote.setNote(WebParamUtil.getStringValue(_PollVoteForm.getNote()));
_PollVote.setOwnAnswer(WebParamUtil.getStringValue(_PollVoteForm.getOwnAnswer()));
m_actionExtent.beforeUpdate(request, response, _PollVote);
m_ds.update(_PollVote);
m_actionExtent.afterUpdate(request, response, _PollVote);
m_logger.debug("After update " + PollVoteDS.objectToString(_PollVote));
}
protected void editField(HttpServletRequest request, HttpServletResponse response, PollVote _PollVote) throws Exception{
// long cid = WebParamUtil.getLongValue(request.getParameter("id"));
// PollVote _PollVote = m_ds.getById(cid);
if (!isMissing(request.getParameter("pollId"))) {
m_logger.debug("updating param pollId from " +_PollVote.getPollId() + "->" + request.getParameter("pollId"));
_PollVote.setPollId(WebParamUtil.getLongValue(request.getParameter("pollId")));
}
if (!isMissing(request.getParameter("userId"))) {
m_logger.debug("updating param userId from " +_PollVote.getUserId() + "->" + request.getParameter("userId"));
_PollVote.setUserId(WebParamUtil.getLongValue(request.getParameter("userId")));
}
if (!isMissing(request.getParameter("answer"))) {
m_logger.debug("updating param answer from " +_PollVote.getAnswer() + "->" + request.getParameter("answer"));
_PollVote.setAnswer(WebParamUtil.getLongValue(request.getParameter("answer")));
}
if (!isMissing(request.getParameter("multipleAnswer"))) {
m_logger.debug("updating param multipleAnswer from " +_PollVote.getMultipleAnswer() + "->" + request.getParameter("multipleAnswer"));
_PollVote.setMultipleAnswer(WebParamUtil.getStringValue(request.getParameter("multipleAnswer")));
}
if (!isMissing(request.getParameter("byGuest"))) {
m_logger.debug("updating param byGuest from " +_PollVote.getByGuest() + "->" + request.getParameter("byGuest"));
_PollVote.setByGuest(WebParamUtil.getIntValue(request.getParameter("byGuest")));
}
if (!isMissing(request.getParameter("ipAddress"))) {
m_logger.debug("updating param ipAddress from " +_PollVote.getIpAddress() + "->" + request.getParameter("ipAddress"));
_PollVote.setIpAddress(WebParamUtil.getStringValue(request.getParameter("ipAddress")));
}
if (!isMissing(request.getParameter("pcid"))) {
m_logger.debug("updating param pcid from " +_PollVote.getPcid() + "->" + request.getParameter("pcid"));
_PollVote.setPcid(WebParamUtil.getStringValue(request.getParameter("pcid")));
}
if (!isMissing(request.getParameter("dupCheckKey"))) {
m_logger.debug("updating param dupCheckKey from " +_PollVote.getDupCheckKey() + "->" + request.getParameter("dupCheckKey"));
_PollVote.setDupCheckKey(WebParamUtil.getStringValue(request.getParameter("dupCheckKey")));
}
if (!isMissing(request.getParameter("note"))) {
m_logger.debug("updating param note from " +_PollVote.getNote() + "->" + request.getParameter("note"));
_PollVote.setNote(WebParamUtil.getStringValue(request.getParameter("note")));
}
if (!isMissing(request.getParameter("ownAnswer"))) {
m_logger.debug("updating param ownAnswer from " +_PollVote.getOwnAnswer() + "->" + request.getParameter("ownAnswer"));
_PollVote.setOwnAnswer(WebParamUtil.getStringValue(request.getParameter("ownAnswer")));
}
if (!isMissing(request.getParameter("timeCreated"))) {
m_logger.debug("updating param timeCreated from " +_PollVote.getTimeCreated() + "->" + request.getParameter("timeCreated"));
_PollVote.setTimeCreated(WebParamUtil.getDateValue(request.getParameter("timeCreated")));
}
m_actionExtent.beforeUpdate(request, response, _PollVote);
m_ds.update(_PollVote);
m_actionExtent.afterUpdate(request, response, _PollVote);
}
protected String getField(HttpServletRequest request, HttpServletResponse response, PollVote _PollVote) {
// long cid = WebParamUtil.getLongValue(request.getParameter("id"));
// PollVote _PollVote = m_ds.getById(cid);
if (!isMissing(request.getParameter("pollId"))) {
return String.valueOf(_PollVote.getPollId());
}
if (!isMissing(request.getParameter("userId"))) {
return String.valueOf(_PollVote.getUserId());
}
if (!isMissing(request.getParameter("answer"))) {
return String.valueOf(_PollVote.getAnswer());
}
if (!isMissing(request.getParameter("multipleAnswer"))) {
return String.valueOf(_PollVote.getMultipleAnswer());
}
if (!isMissing(request.getParameter("byGuest"))) {
return String.valueOf(_PollVote.getByGuest());
}
if (!isMissing(request.getParameter("ipAddress"))) {
return String.valueOf(_PollVote.getIpAddress());
}
if (!isMissing(request.getParameter("pcid"))) {
return String.valueOf(_PollVote.getPcid());
}
if (!isMissing(request.getParameter("dupCheckKey"))) {
return String.valueOf(_PollVote.getDupCheckKey());
}
if (!isMissing(request.getParameter("note"))) {
return String.valueOf(_PollVote.getNote());
}
if (!isMissing(request.getParameter("ownAnswer"))) {
return String.valueOf(_PollVote.getOwnAnswer());
}
if (!isMissing(request.getParameter("timeCreated"))) {
return String.valueOf(_PollVote.getTimeCreated());
}
return null;
}
public Map exAjax(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) {
Map ret = new HashMap();
// // Request Processing
//
if (hasRequestValue(request, "edit", "true")||hasRequestValue(request, "ed", "true")||hasRequestValue(request, "act", "ed") ||
hasRequestValue(request, "del", "true")||hasRequestValue(request, "de", "true")||hasRequestValue(request, "act", "del") ||
hasRequestValue(request, "add", "true")||hasRequestValue(request, "ad", "true")||hasRequestValue(request, "act", "add") ||
hasRequestValue(request, "editfield", "true")||hasRequestValue(request, "ef", "true")||hasRequestValue(request, "act", "ef")) {
try {
ex(mapping, form, request, response, true);
}
catch (Exception e) {
m_logger.error(e.getMessage(),e);
ret.put("__error", "true");
ret.put("__errorMsg", e.getMessage());
}
}
// // Response Processing
//
if (hasRequestValue(request, "ajaxOut", "getfield")){
long id = WebParamUtil.getLongValue(request.getParameter("id"));
PollVote _PollVote = PollVoteDS.getInstance().getById(id);
if (_PollVote == null) {
ret.put("__error", "true");
ret.put("__errorMsg", "Object Not Found");
} else {
String field = getField(request, response, _PollVote);
if (field != null)
ret.put("__value", field);
}
} else if (hasRequestValue(request, "ajaxOut", "getmodalform")){
// Example <a href="/blogCommentAction.html?ajaxRequest=true&ajaxOut=getmodalform&formfieldlist=blogPostId,comment,email&blogPostId=111&forcehiddenlist=email&email=joshua@yahoo.com" rel="facebox">Ajax Add</a>
// Returns the form for modal form display
StringBuffer buf = new StringBuffer();
String _wpId = WebProcManager.registerWebProcess();
int randNum = RandomUtil.randomInt(1000000);
String fieldSetStr = request.getParameter("formfieldlist");
Set fieldSet = JtStringUtil.convertToSet(fieldSetStr);
String forceHiddenStr = request.getParameter("forcehiddenlist");
Set forceHiddenSet = JtStringUtil.convertToSet(forceHiddenStr);
boolean ignoreFieldSet = (fieldSetStr == null||fieldSetStr.equals("_all") ? true: false);
buf.append("<form name=\"ajaxSubmitForm"+randNum+"\" method=\"POST\" action=\"/pollVoteAction.html\" id=\"ajaxSubmitForm"+randNum+"\" >");
if ( ignoreFieldSet || fieldSet.contains("pollId")) {
String value = WebUtil.display(request.getParameter("pollId"));
if ( forceHiddenSet.contains("pollId")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"pollId\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Poll Id</div>");
buf.append("<INPUT NAME=\"pollId\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("answer")) {
String value = WebUtil.display(request.getParameter("answer"));
if ( forceHiddenSet.contains("answer")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"answer\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Answer</div>");
buf.append("<INPUT NAME=\"answer\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("multipleAnswer")) {
String value = WebUtil.display(request.getParameter("multipleAnswer"));
if ( forceHiddenSet.contains("multipleAnswer")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"multipleAnswer\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Multiple Answer</div>");
buf.append("<INPUT NAME=\"multipleAnswer\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("byGuest")) {
String value = WebUtil.display(request.getParameter("byGuest"));
if ( forceHiddenSet.contains("byGuest")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"byGuest\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">By Guest</div>");
buf.append("<select name=\"byGuest\">");
buf.append("<option value=\"0\" >No</option>");
buf.append("<option value=\"1\" >Yes</option>");
buf.append("</select><br/>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("ipAddress")) {
String value = WebUtil.display(request.getParameter("ipAddress"));
if ( forceHiddenSet.contains("ipAddress")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"ipAddress\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Ip Address</div>");
buf.append("<INPUT NAME=\"ipAddress\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("pcid")) {
String value = WebUtil.display(request.getParameter("pcid"));
if ( forceHiddenSet.contains("pcid")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"pcid\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Pcid</div>");
buf.append("<INPUT NAME=\"pcid\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("dupCheckKey")) {
String value = WebUtil.display(request.getParameter("dupCheckKey"));
if ( forceHiddenSet.contains("dupCheckKey")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"dupCheckKey\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Dup Check Key</div>");
buf.append("<INPUT NAME=\"dupCheckKey\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("note")) {
String value = WebUtil.display(request.getParameter("note"));
if ( forceHiddenSet.contains("note")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"note\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Note</div>");
buf.append("<INPUT NAME=\"note\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("ownAnswer")) {
String value = WebUtil.display(request.getParameter("ownAnswer"));
if ( forceHiddenSet.contains("ownAnswer")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"ownAnswer\" value=\""+value+"\">");
} else {
buf.append("<div class=\"ajaxFormLabel\" style=\"font-weight:bold;\">Own Answer</div>");
buf.append("<INPUT NAME=\"ownAnswer\" type=\"text\" size=\"70\" value=\""+value+"\"></INPUT>");
buf.append("<br/>");
}
}
if ( ignoreFieldSet || fieldSet.contains("timeCreated")) {
String value = WebUtil.display(request.getParameter("timeCreated"));
if ( forceHiddenSet.contains("timeCreated")){
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"timeCreated\" value=\""+value+"\">");
} else {
buf.append("<br/>");
}
}
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"ajaxRequest\" value=\"true\">");
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"ajaxOut\" value=\"getmodalstatus\">");
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"add\" value=\"true\">");
buf.append("<INPUT TYPE=\"HIDDEN\" NAME=\"wpid\" value=\""+ _wpId +"\">");
buf.append("</form>");
buf.append("<span id=\"ajaxSubmitResult\"></span>");
buf.append("<a id=\"ajaxSubmit\" href=\"javascript:sendFormAjax('/pollVoteAction.html','ajaxSubmitForm"+randNum+"', 'ajaxSubmit', 'ajaxSubmitResult');\">Submit</a>");
//cancel should close modal dialog
//buf.append("<a id=\"formSubmit\" href=\"\">Cancel</a>");
ret.put("__value", buf.toString());
} else if (hasRequestValue(request, "ajaxOut", "getmodalstatus")){
// Will handle submission from modal form. It will not display anything but just need to know the status.
// if everything was okay, return "0", if not error will be put into.
ret.put("__value", "Successfully received.");
} else if (hasRequestValue(request, "ajaxOut", "getlist")){
} else if (hasRequestValue(request, "ajaxOut", "gethtml") || hasRequestValue(request, "ajaxOut", "getlisthtml") ){
Site site = SiteDS.getInstance().registerSite(request.getServerName());
String arg = request.getParameter("ajaxOutArg");
PollVote _PollVote = null;
List list = PollVoteDS.getInstance().getBySiteId(site.getId());
if (arg == null || arg.equals("last")){
if (list.size() > 0)
_PollVote = (PollVote) list.get(list.size()-1);
} else if (arg.equals("first")) {
if (list.size() > 0)
_PollVote = (PollVote) list.get(0);
} else {
long id = WebParamUtil.getLongValue(arg);
_PollVote = PollVoteDS.getInstance().getById(id);
}
String fieldSetStr = request.getParameter("formfieldlist");
Set fieldSet = JtStringUtil.convertToSet(fieldSetStr);
boolean ignoreFieldSet = (fieldSetStr == null? true: false);
boolean returnList = hasRequestValue(request, "ajaxOut", "getlisthtml");
if (!returnList) {
list = new ArrayList();
list.add(_PollVote);
}
StringBuffer buf = new StringBuffer();
String tableStyleStr = "style=\"font: normal normal normal 11px verdana;color: #404040; width: 100%;background-color: #fafafa;border: 1px #6699CC solid;border-collapse: collapse;border-spacing: 0px;text-align: left; margin: 10px 10px 10px 0px;text-indent: 10px;\"";
String trStyleStr = "style=\"border-bottom: 1px #6699CC solid;\"";
String tdBoldStyleStr = "style=\"border-left: 1px #6699CC solid;text-align: left;padding: 5px 10px 5px 10px;background: #e5e5e5 url('http://www.uxsx.com:8080/images/reply-e5e5e5.gif') repeat-x scroll top; font-weight:bold;\"";
String tdStyleStr = "style=\"border-left: 1px #6699CC solid;text-align: left;padding: 5px 10px 5px 10px;background: #e5e5e5 url('http://www.uxsx.com:8080/images/reply-e5e5e5.gif') repeat-x scroll top;\"";
buf.append("<table "+ tableStyleStr +" >");
buf.append("<tr "+ trStyleStr +" >");
if ( ignoreFieldSet || fieldSet.contains("answer")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Answer");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("multipleAnswer")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Multiple Answer");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("byGuest")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("By Guest");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("ipAddress")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Ip Address");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("pcid")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Pcid");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("dupCheckKey")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Dup Check Key");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("note")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Note");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("ownAnswer")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Own Answer");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("timeCreated")) {
buf.append("<td "+ tdBoldStyleStr +" >");
buf.append("Time Created");
buf.append("</td>");
}
buf.append("</tr>");
for (Iterator iterator = list.iterator(); iterator.hasNext();) {
_PollVote = (PollVote) iterator.next();
buf.append("<tr "+ trStyleStr +" >");
if ( ignoreFieldSet || fieldSet.contains("answer")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getAnswer()));
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("multipleAnswer")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getMultipleAnswer()));
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("byGuest")) {
buf.append("<td "+ tdStyleStr +" >");
if (WebUtil.isTrue(_PollVote.getByGuest()))
buf.append("[<a href=\"javascript:sendFormAjaxSimple('/pollVoteAction.html?ef=true&id="+ _PollVote.getId()+"&byGuest=0&ajaxRequest=true&ajaxOut=getModalStatus', true);\">Set No</a>]");
else
buf.append("[<a href=\"javascript:sendFormAjaxSimple('/pollVoteAction.html?ef=true&id="+ _PollVote.getId()+"&byGuest=1&ajaxRequest=true&ajaxOut=getModalStatus', true);\">Set Yes</a>]");
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("ipAddress")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getIpAddress()));
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("pcid")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getPcid()));
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("dupCheckKey")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getDupCheckKey()));
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("note")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getNote()));
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("ownAnswer")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getOwnAnswer()));
buf.append("</td>");
}
if ( ignoreFieldSet || fieldSet.contains("timeCreated")) {
buf.append("<td "+ tdStyleStr +" >");
buf.append(WebUtil.display(_PollVote.getTimeCreated()));
buf.append("</td>");
}
buf.append("</tr>");
}
buf.append("</table >");
ret.put("__value", buf.toString());
return ret;
} else if (hasRequestValue(request, "ajaxOut", "getjson") || hasRequestValue(request, "ajaxOut", "getlistjson") ){
Site site = SiteDS.getInstance().registerSite(request.getServerName());
String arg = request.getParameter("ajaxOutArg");
PollVote _PollVote = null;
List list = PollVoteDS.getInstance().getBySiteId(site.getId());
if (arg == null || arg.equals("last")){
if (list.size() > 0)
_PollVote = (PollVote) list.get(list.size()-1);
} else if (arg.equals("first")) {
if (list.size() > 0)
_PollVote = (PollVote) list.get(0);
} else {
long id = WebParamUtil.getLongValue(arg);
_PollVote = PollVoteDS.getInstance().getById(id);
}
m_logger.debug("Getting the last PollVote=" + _PollVote.getId());
String fieldSetStr = request.getParameter("fieldlist");
Set fieldSet = JtStringUtil.convertToSet(fieldSetStr);
boolean ignoreFieldSet = (fieldSetStr == null? true: false);
boolean returnList = hasRequestValue(request, "ajaxOut", "getlistjson");
JSONObject top = new JSONObject();
if (returnList) {
top.put("count", ""+list.size());
JSONArray array = new JSONArray();
for (Iterator iterator = list.iterator(); iterator.hasNext();) {
_PollVote = (PollVote) iterator.next();
JSONObject json = new JSONObject();
// Fields
if ( ignoreFieldSet || fieldSet.contains("pollId"))
json.put("pollId", ""+_PollVote.getPollId());
if ( ignoreFieldSet || fieldSet.contains("answer"))
json.put("answer", ""+_PollVote.getAnswer());
if ( ignoreFieldSet || fieldSet.contains("multipleAnswer"))
json.put("multipleAnswer", ""+_PollVote.getMultipleAnswer());
if ( ignoreFieldSet || fieldSet.contains("byGuest"))
json.put("byGuest", ""+_PollVote.getByGuest());
if ( ignoreFieldSet || fieldSet.contains("ipAddress"))
json.put("ipAddress", ""+_PollVote.getIpAddress());
if ( ignoreFieldSet || fieldSet.contains("pcid"))
json.put("pcid", ""+_PollVote.getPcid());
if ( ignoreFieldSet || fieldSet.contains("dupCheckKey"))
json.put("dupCheckKey", ""+_PollVote.getDupCheckKey());
if ( ignoreFieldSet || fieldSet.contains("note"))
json.put("note", ""+_PollVote.getNote());
if ( ignoreFieldSet || fieldSet.contains("ownAnswer"))
json.put("ownAnswer", ""+_PollVote.getOwnAnswer());
array.put(json);
}
top.put("list", array);
} else {
top.put("id", ""+_PollVote.getId());
JSONArray array = new JSONArray();
// Fields
JSONObject jsonPollId = new JSONObject();
jsonPollId.put("name", "pollId");
jsonPollId.put("value", ""+_PollVote.getPollId());
array.put(jsonPollId);
JSONObject jsonAnswer = new JSONObject();
jsonAnswer.put("name", "answer");
jsonAnswer.put("value", ""+_PollVote.getAnswer());
array.put(jsonAnswer);
JSONObject jsonMultipleAnswer = new JSONObject();
jsonMultipleAnswer.put("name", "multipleAnswer");
jsonMultipleAnswer.put("value", ""+_PollVote.getMultipleAnswer());
array.put(jsonMultipleAnswer);
JSONObject jsonByGuest = new JSONObject();
jsonByGuest.put("name", "byGuest");
jsonByGuest.put("value", ""+_PollVote.getByGuest());
array.put(jsonByGuest);
JSONObject jsonIpAddress = new JSONObject();
jsonIpAddress.put("name", "ipAddress");
jsonIpAddress.put("value", ""+_PollVote.getIpAddress());
array.put(jsonIpAddress);
JSONObject jsonPcid = new JSONObject();
jsonPcid.put("name", "pcid");
jsonPcid.put("value", ""+_PollVote.getPcid());
array.put(jsonPcid);
JSONObject jsonDupCheckKey = new JSONObject();
jsonDupCheckKey.put("name", "dupCheckKey");
jsonDupCheckKey.put("value", ""+_PollVote.getDupCheckKey());
array.put(jsonDupCheckKey);
JSONObject jsonNote = new JSONObject();
jsonNote.put("name", "note");
jsonNote.put("value", ""+_PollVote.getNote());
array.put(jsonNote);
JSONObject jsonOwnAnswer = new JSONObject();
jsonOwnAnswer.put("name", "ownAnswer");
jsonOwnAnswer.put("value", ""+_PollVote.getOwnAnswer());
array.put(jsonOwnAnswer);
top.put("fields", array);
}
m_logger.debug(top.toString());
ret.put("__value", top.toString());
return ret;
} else{
try {
Map resultAjax = m_actionExtent.processAjax(request, response);
ret.put("__value", resultAjax.get("__value"));
}
catch (Exception e) {
m_logger.error(e.getMessage(),e);
ret.put("__error", "true");
}
}
return ret;
}
protected boolean loginRequired() {
return false;
}
protected PollVoteDS m_ds;
protected AutositeActionExtent m_actionExtent;
private static Logger m_logger = Logger.getLogger( PollVoteAction.class);
}
| [
"joshua@joshua-dell"
] | joshua@joshua-dell |
9a2695fc0abd4f8f6babe5963eacc44b6eaed870 | d4491944d2f4c06b93ec4bba05d2678012c2789a | /proyectoWebrepo/src/main/java/idat/edu/pe/daa2/proyectoWeb/ServletConfiguracion.java | 17201217d1e2f5dea9827ac295867f4db5f7d33c | [] | no_license | Elquis/RepoPrueba1 | 338d03e4f6ef1d3a8e5fe17ce7d10120f284e6bd | 0db9374b073ba46dd66c46a6478f9cbef860cfb9 | refs/heads/master | 2020-08-27T16:24:23.393876 | 2019-10-25T02:42:25 | 2019-10-25T02:42:25 | 217,432,306 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,171 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package idat.edu.pe.daa2.proyectoWeb;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author Administrador
*/
@WebServlet(name = "ServletConfiguracion", urlPatterns = {"/ServletConfiguracion"})
public class ServletConfiguracion extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</code>
* methods.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
try (PrintWriter out = response.getWriter()) {
/* TODO output your page here. You may use following sample code. */
out.println("<!DOCTYPE html>");
out.println("<html>");
out.println("<head>");
out.println("<title>Servlet ServletConfiguracion</title>");
out.println("</head>");
out.println("<body>");
out.println("<h1>Servlet ServletConfiguracion at " + request.getContextPath() + "</h1>");
out.println("</body>");
out.println("</html>");
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
| [
"Administrador@DESKTOP-5E85M15"
] | Administrador@DESKTOP-5E85M15 |
6c38e601d6f2195ffc4bd716d201bdc1cb3e8c29 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /newEvaluatedBugs/Jsoup_13_buggy/mutated/393/TokeniserState.java | 22165f87f7f5e90b09c6353275ce6e8cdaf6041c | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 59,525 | java | package org.jsoup.parser;
import java.util.Arrays;
/**
* States and transition activations for the Tokeniser.
*/
enum TokeniserState {
Data {
// in data state, gather characters until a character reference or tag is found
void read(Tokeniser t, CharacterReader r) {
switch (r.current()) {
case '&':
t.advanceTransition(CharacterReferenceInData);
break;
case '<':
t.advanceTransition(TagOpen);
break;
case nullChar:
t.error(this); // NOT replacement character (oddly?)
t.emit(r.consume());
break;
case eof:
t.emit(new Token.EOF());
break;
default:
String data = r.consumeData();
t.emit(data);
break;
}
}
},
CharacterReferenceInData {
// from & in data
void read(Tokeniser t, CharacterReader r) {
readCharRef(t, Data);
}
},
Rcdata {
/// handles data in title, textarea etc
void read(Tokeniser t, CharacterReader r) {
switch (r.current()) {
case '&':
t.advanceTransition(CharacterReferenceInRcdata);
break;
case '<':
t.advanceTransition(RcdataLessthanSign);
break;
case nullChar:
t.error(this);
r.advance();
t.emit(replacementChar);
break;
case eof:
t.emit(new Token.EOF());
break;
default:
String data = r.consumeToAny('&', '<', nullChar);
t.emit(data);
break;
}
}
},
CharacterReferenceInRcdata {
void read(Tokeniser t, CharacterReader r) {
readCharRef(t, Rcdata);
}
},
Rawtext {
void read(Tokeniser t, CharacterReader r) {
readData(t, r, this, RawtextLessthanSign);
}
},
ScriptData {
void read(Tokeniser t, CharacterReader r) {
readData(t, r, this, ScriptDataLessthanSign);
}
},
PLAINTEXT {
void read(Tokeniser t, CharacterReader r) {
switch (r.current()) {
case nullChar:
t.error(this);
r.advance();
t.emit(replacementChar);
break;
case eof:
t.emit(new Token.EOF());
break;
default:
String data = r.consumeTo(nullChar);
t.emit(data);
break;
}
}
},
TagOpen {
// from < in data
void read(Tokeniser t, CharacterReader r) {
switch (r.current()) {
case '!':
t.advanceTransition(MarkupDeclarationOpen);
break;
case '/':
t.advanceTransition(EndTagOpen);
break;
case '?':
t.advanceTransition(BogusComment);
break;
default:
if (r.matchesLetter()) {
t.createTagPending(true);
t.transition(TagName);
} else {
t.error(this);
t.emit('<'); // char that got us here
t.transition(Data);
}
break;
}
}
},
EndTagOpen {
void read(Tokeniser t, CharacterReader r) {
if (r.isEmpty()) {
t.eofError(this);
t.emit("</");
t.transition(Data);
} else if (r.matchesLetter()) {
t.createTagPending(false);
t.transition(TagName);
} else if (r.matches('>')) {
t.error(this);
t.advanceTransition(Data);
} else {
t.error(this);
t.advanceTransition(BogusComment);
}
}
},
TagName {
// from < or </ in data, will have start or end tag pending
void read(Tokeniser t, CharacterReader r) {
// previous TagOpen state did NOT consume, will have a letter char in current
//String tagName = r.consumeToAnySorted(tagCharsSorted).toLowerCase();
String tagName = r.consumeTagName().toLowerCase();
t.tagPending.appendTagName(tagName);
switch (r.consume()) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BeforeAttributeName);
break;
case '/':
t.transition(SelfClosingStartTag);
break;
case '>':
t.emitTagPending();
t.transition(Data);
break;
case nullChar: // replacement
t.tagPending.appendTagName(replacementStr);
break;
case eof: // should emit pending tag?
t.eofError(this);
t.transition(Data);
// no default, as covered with above consumeToAny
}
}
},
RcdataLessthanSign {
// from < in rcdata
void read(Tokeniser t, CharacterReader r) {
if (r.matches('/')) {
t.createTempBuffer();
t.advanceTransition(RCDATAEndTagOpen);
} else if (r.matchesLetter() && t.appropriateEndTagName() != null && !r.containsIgnoreCase("</" + t.appropriateEndTagName())) {
// diverge from spec: got a start tag, but there's no appropriate end tag (</title>), so rather than
// consuming to EOF; break out here
t.tagPending = t.createTagPending(false).name(t.appropriateEndTagName());
t.emitTagPending();
r.unconsume(); // undo "<"
t.transition(Data);
} else {
t.emit("<");
t.transition(Rcdata);
}
}
},
RCDATAEndTagOpen {
void read(Tokeniser t, CharacterReader r) {
if (r.matchesLetter()) {
t.createTagPending(false);
t.tagPending.appendTagName(Character.toLowerCase(r.current()));
t.dataBuffer.append(Character.toLowerCase(r.current()));
t.advanceTransition(RCDATAEndTagName);
} else {
t.emit("</");
t.transition(Rcdata);
}
}
},
RCDATAEndTagName {
void read(Tokeniser t, CharacterReader r) {
if (r.matchesLetter()) {
String name = r.consumeLetterSequence();
t.tagPending.appendTagName(name.toLowerCase());
t.dataBuffer.append(name);
return;
}
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
if (t.isAppropriateEndTagToken())
t.transition(BeforeAttributeName);
else
anythingElse(t, r);
break;
case '/':
if (t.isAppropriateEndTagToken())
t.transition(SelfClosingStartTag);
else
anythingElse(t, r);
break;
case '>':
if (t.isAppropriateEndTagToken()) {
t.emitTagPending();
t.transition(Data);
}
else
anythingElse(t, r);
break;
default:
anythingElse(t, r);
}
}
private void anythingElse(Tokeniser t, CharacterReader r) {
t.emit("</" + t.dataBuffer.toString());
r.unconsume();
t.transition(Rcdata);
}
},
RawtextLessthanSign {
void read(Tokeniser t, CharacterReader r) {
if (r.matches('/')) {
t.createTempBuffer();
t.advanceTransition(RawtextEndTagOpen);
} else {
t.emit('<');
t.transition(Rawtext);
}
}
},
RawtextEndTagOpen {
void read(Tokeniser t, CharacterReader r) {
readEndTag(t, r, RawtextEndTagName, Rawtext);
}
},
RawtextEndTagName {
void read(Tokeniser t, CharacterReader r) {
handleDataEndTag(t, r, Rawtext);
}
},
ScriptDataLessthanSign {
void read(Tokeniser t, CharacterReader r) {
switch (r.consume()) {
case '/':
t.createTempBuffer();
t.transition(ScriptDataEndTagOpen);
break;
case '!':
t.emit("<!");
t.transition(ScriptDataEscapeStart);
break;
default:
t.emit("<");
r.unconsume();
t.transition(ScriptData);
}
}
},
ScriptDataEndTagOpen {
void read(Tokeniser t, CharacterReader r) {
readEndTag(t, r, ScriptDataEndTagName, ScriptData);
}
},
ScriptDataEndTagName {
void read(Tokeniser t, CharacterReader r) {
handleDataEndTag(t, r, ScriptData);
}
},
ScriptDataEscapeStart {
void read(Tokeniser t, CharacterReader r) {
if (r.matches('-')) {
t.emit('-');
t.advanceTransition(ScriptDataEscapeStartDash);
} else {
t.transition(ScriptData);
}
}
},
ScriptDataEscapeStartDash {
void read(Tokeniser t, CharacterReader r) {
if (r.matches('-')) {
t.emit('-');
t.advanceTransition(ScriptDataEscapedDashDash);
} else {
t.transition(ScriptData);
}
}
},
ScriptDataEscaped {
void read(Tokeniser t, CharacterReader r) {
if (r.isEmpty()) {
t.eofError(this);
t.transition(Data);
return;
}
switch (r.current()) {
case '-':
t.emit('-');
t.advanceTransition(ScriptDataEscapedDash);
break;
case '<':
t.advanceTransition(ScriptDataEscapedLessthanSign);
break;
case nullChar:
t.error(this);
r.advance();
t.emit(replacementChar);
break;
default:
String data = r.consumeToAny('-', '<', nullChar);
t.emit(data);
}
}
},
ScriptDataEscapedDash {
void read(Tokeniser t, CharacterReader r) {
if (r.isEmpty()) {
t.eofError(this);
t.transition(Data);
return;
}
char c = r.consume();
switch (c) {
case '-':
t.emit(c);
t.transition(ScriptDataEscapedDashDash);
break;
case '<':
t.transition(ScriptDataEscapedLessthanSign);
break;
case nullChar:
t.error(this);
t.emit(replacementChar);
t.transition(ScriptDataEscaped);
break;
default:
t.emit(c);
t.transition(ScriptDataEscaped);
}
}
},
ScriptDataEscapedDashDash {
void read(Tokeniser t, CharacterReader r) {
if (r.isEmpty()) {
t.eofError(this);
t.transition(Data);
return;
}
char c = r.consume();
switch (c) {
case '-':
t.emit(c);
break;
case '<':
t.transition(ScriptDataEscapedLessthanSign);
break;
case '>':
t.emit(c);
t.transition(ScriptData);
break;
case nullChar:
t.error(this);
t.emit(replacementChar);
t.transition(ScriptDataEscaped);
break;
default:
t.emit(c);
t.transition(ScriptDataEscaped);
}
}
},
ScriptDataEscapedLessthanSign {
void read(Tokeniser t, CharacterReader r) {
if (r.matchesLetter()) {
t.createTempBuffer();
t.dataBuffer.append(Character.toLowerCase(r.current()));
t.emit("<" + r.current());
t.advanceTransition(ScriptDataDoubleEscapeStart);
} else if (r.matches('/')) {
t.createTempBuffer();
t.advanceTransition(ScriptDataEscapedEndTagOpen);
} else {
t.emit('<');
t.transition(ScriptDataEscaped);
}
}
},
ScriptDataEscapedEndTagOpen {
void read(Tokeniser t, CharacterReader r) {
if (r.matchesLetter()) {
t.createTagPending(false);
t.tagPending.appendTagName(Character.toLowerCase(r.current()));
t.dataBuffer.append(r.current());
t.advanceTransition(ScriptDataEscapedEndTagName);
} else {
t.emit("</");
t.transition(ScriptDataEscaped);
}
}
},
ScriptDataEscapedEndTagName {
void read(Tokeniser t, CharacterReader r) {
handleDataEndTag(t, r, ScriptDataEscaped);
}
},
ScriptDataDoubleEscapeStart {
void read(Tokeniser t, CharacterReader r) {
handleDataDoubleEscapeTag(t, r, ScriptDataDoubleEscaped, ScriptDataEscaped);
}
},
ScriptDataDoubleEscaped {
void read(Tokeniser t, CharacterReader r) {
char c = r.current();
switch (c) {
case '-':
t.emit(c);
t.advanceTransition(ScriptDataDoubleEscapedDash);
break;
case '<':
t.emit(c);
t.advanceTransition(ScriptDataDoubleEscapedLessthanSign);
break;
case nullChar:
t.error(this);
r.advance();
t.emit(replacementChar);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
default:
String data = r.consumeToAny('-', '<', nullChar);
t.emit(data);
}
}
},
ScriptDataDoubleEscapedDash {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '-':
t.emit(c);
t.transition(ScriptDataDoubleEscapedDashDash);
break;
case '<':
t.emit(c);
t.transition(ScriptDataDoubleEscapedLessthanSign);
break;
case nullChar:
t.error(this);
t.emit(replacementChar);
t.transition(ScriptDataDoubleEscaped);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
default:
t.emit(c);
t.transition(ScriptDataDoubleEscaped);
}
}
},
ScriptDataDoubleEscapedDashDash {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '-':
t.emit(c);
break;
case '<':
t.emit(c);
t.transition(ScriptDataDoubleEscapedLessthanSign);
break;
case '>':
t.emit(c);
t.transition(ScriptData);
break;
case nullChar:
t.error(this);
t.emit(replacementChar);
t.transition(ScriptDataDoubleEscaped);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
default:
t.emit(c);
t.transition(ScriptDataDoubleEscaped);
}
}
},
ScriptDataDoubleEscapedLessthanSign {
void read(Tokeniser t, CharacterReader r) {
if (r.matches('/')) {
t.emit('/');
t.createTempBuffer();
t.advanceTransition(ScriptDataDoubleEscapeEnd);
} else {
t.transition(ScriptDataDoubleEscaped);
}
}
},
ScriptDataDoubleEscapeEnd {
void read(Tokeniser t, CharacterReader r) {
handleDataDoubleEscapeTag(t,r, ScriptDataEscaped, ScriptDataDoubleEscaped);
}
},
BeforeAttributeName {
// from tagname <xxx
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
break; // ignore whitespace
case '/':
t.transition(SelfClosingStartTag);
break;
case '>':
t.emitTagPending();
t.transition(Data);
break;
case nullChar:
t.error(this);
t.tagPending.newAttribute();
r.unconsume();
t.transition(AttributeName);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
case '"':
case '\'':
case '<':
case '=':
t.error(this);
t.tagPending.newAttribute();
t.tagPending.appendAttributeName(c);
t.transition(AttributeName);
break;
default: // A-Z, anything else
t.tagPending.newAttribute();
r.unconsume();
t.transition(AttributeName);
}
}
},
AttributeName {
// from before attribute name
void read(Tokeniser t, CharacterReader r) {
String name = r.consumeToAnySorted(attributeNameCharsSorted);
t.tagPending.appendAttributeName(name.toLowerCase());
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(AfterAttributeName);
break;
case '/':
t.transition(SelfClosingStartTag);
break;
case '=':
t.transition(org.jsoup.parser.TokeniserState.ScriptDataEscapedDashDash);
break;
case '>':
t.emitTagPending();
t.transition(Data);
break;
case nullChar:
t.error(this);
t.tagPending.appendAttributeName(replacementChar);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
case '"':
case '\'':
case '<':
t.error(this);
t.tagPending.appendAttributeName(c);
// no default, as covered in consumeToAny
}
}
},
AfterAttributeName {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
// ignore
break;
case '/':
t.transition(SelfClosingStartTag);
break;
case '=':
t.transition(BeforeAttributeValue);
break;
case '>':
t.emitTagPending();
t.transition(Data);
break;
case nullChar:
t.error(this);
t.tagPending.appendAttributeName(replacementChar);
t.transition(AttributeName);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
case '"':
case '\'':
case '<':
t.error(this);
t.tagPending.newAttribute();
t.tagPending.appendAttributeName(c);
t.transition(AttributeName);
break;
default: // A-Z, anything else
t.tagPending.newAttribute();
r.unconsume();
t.transition(AttributeName);
}
}
},
BeforeAttributeValue {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
// ignore
break;
case '"':
t.transition(AttributeValue_doubleQuoted);
break;
case '&':
r.unconsume();
t.transition(AttributeValue_unquoted);
break;
case '\'':
t.transition(AttributeValue_singleQuoted);
break;
case nullChar:
t.error(this);
t.tagPending.appendAttributeValue(replacementChar);
t.transition(AttributeValue_unquoted);
break;
case eof:
t.eofError(this);
t.emitTagPending();
t.transition(Data);
break;
case '>':
t.error(this);
t.emitTagPending();
t.transition(Data);
break;
case '<':
case '=':
case '`':
t.error(this);
t.tagPending.appendAttributeValue(c);
t.transition(AttributeValue_unquoted);
break;
default:
r.unconsume();
t.transition(AttributeValue_unquoted);
}
}
},
AttributeValue_doubleQuoted {
void read(Tokeniser t, CharacterReader r) {
String value = r.consumeToAny(attributeDoubleValueCharsSorted);
if (value.length() > 0)
t.tagPending.appendAttributeValue(value);
else
t.tagPending.setEmptyAttributeValue();
char c = r.consume();
switch (c) {
case '"':
t.transition(AfterAttributeValue_quoted);
break;
case '&':
char[] ref = t.consumeCharacterReference('"', true);
if (ref != null)
t.tagPending.appendAttributeValue(ref);
else
t.tagPending.appendAttributeValue('&');
break;
case nullChar:
t.error(this);
t.tagPending.appendAttributeValue(replacementChar);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
// no default, handled in consume to any above
}
}
},
AttributeValue_singleQuoted {
void read(Tokeniser t, CharacterReader r) {
String value = r.consumeToAny(attributeSingleValueCharsSorted);
if (value.length() > 0)
t.tagPending.appendAttributeValue(value);
else
t.tagPending.setEmptyAttributeValue();
char c = r.consume();
switch (c) {
case '\'':
t.transition(AfterAttributeValue_quoted);
break;
case '&':
char[] ref = t.consumeCharacterReference('\'', true);
if (ref != null)
t.tagPending.appendAttributeValue(ref);
else
t.tagPending.appendAttributeValue('&');
break;
case nullChar:
t.error(this);
t.tagPending.appendAttributeValue(replacementChar);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
// no default, handled in consume to any above
}
}
},
AttributeValue_unquoted {
void read(Tokeniser t, CharacterReader r) {
String value = r.consumeToAnySorted(attributeValueUnquoted);
if (value.length() > 0)
t.tagPending.appendAttributeValue(value);
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BeforeAttributeName);
break;
case '&':
char[] ref = t.consumeCharacterReference('>', true);
if (ref != null)
t.tagPending.appendAttributeValue(ref);
else
t.tagPending.appendAttributeValue('&');
break;
case '>':
t.emitTagPending();
t.transition(Data);
break;
case nullChar:
t.error(this);
t.tagPending.appendAttributeValue(replacementChar);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
case '"':
case '\'':
case '<':
case '=':
case '`':
t.error(this);
t.tagPending.appendAttributeValue(c);
break;
// no default, handled in consume to any above
}
}
},
// CharacterReferenceInAttributeValue state handled inline
AfterAttributeValue_quoted {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BeforeAttributeName);
break;
case '/':
t.transition(SelfClosingStartTag);
break;
case '>':
t.emitTagPending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
default:
t.error(this);
r.unconsume();
t.transition(BeforeAttributeName);
}
}
},
SelfClosingStartTag {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '>':
t.tagPending.selfClosing = true;
t.emitTagPending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.transition(Data);
break;
default:
t.error(this);
t.transition(BeforeAttributeName);
}
}
},
BogusComment {
void read(Tokeniser t, CharacterReader r) {
// todo: handle bogus comment starting from eof. when does that trigger?
// rewind to capture character that lead us here
r.unconsume();
Token.Comment comment = new Token.Comment();
comment.bogus = true;
comment.data.append(r.consumeTo('>'));
// todo: replace nullChar with replaceChar
t.emit(comment);
t.advanceTransition(Data);
}
},
MarkupDeclarationOpen {
void read(Tokeniser t, CharacterReader r) {
if (r.matchConsume("--")) {
t.createCommentPending();
t.transition(CommentStart);
} else if (r.matchConsumeIgnoreCase("DOCTYPE")) {
t.transition(Doctype);
} else if (r.matchConsume("[CDATA[")) {
// todo: should actually check current namepspace, and only non-html allows cdata. until namespace
// is implemented properly, keep handling as cdata
//} else if (!t.currentNodeInHtmlNS() && r.matchConsume("[CDATA[")) {
t.transition(CdataSection);
} else {
t.error(this);
t.advanceTransition(BogusComment); // advance so this character gets in bogus comment data's rewind
}
}
},
CommentStart {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '-':
t.transition(CommentStartDash);
break;
case nullChar:
t.error(this);
t.commentPending.data.append(replacementChar);
t.transition(Comment);
break;
case '>':
t.error(this);
t.emitCommentPending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.emitCommentPending();
t.transition(Data);
break;
default:
t.commentPending.data.append(c);
t.transition(Comment);
}
}
},
CommentStartDash {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '-':
t.transition(CommentStartDash);
break;
case nullChar:
t.error(this);
t.commentPending.data.append(replacementChar);
t.transition(Comment);
break;
case '>':
t.error(this);
t.emitCommentPending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.emitCommentPending();
t.transition(Data);
break;
default:
t.commentPending.data.append(c);
t.transition(Comment);
}
}
},
Comment {
void read(Tokeniser t, CharacterReader r) {
char c = r.current();
switch (c) {
case '-':
t.advanceTransition(CommentEndDash);
break;
case nullChar:
t.error(this);
r.advance();
t.commentPending.data.append(replacementChar);
break;
case eof:
t.eofError(this);
t.emitCommentPending();
t.transition(Data);
break;
default:
t.commentPending.data.append(r.consumeToAny('-', nullChar));
}
}
},
CommentEndDash {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '-':
t.transition(CommentEnd);
break;
case nullChar:
t.error(this);
t.commentPending.data.append('-').append(replacementChar);
t.transition(Comment);
break;
case eof:
t.eofError(this);
t.emitCommentPending();
t.transition(Data);
break;
default:
t.commentPending.data.append('-').append(c);
t.transition(Comment);
}
}
},
CommentEnd {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '>':
t.emitCommentPending();
t.transition(Data);
break;
case nullChar:
t.error(this);
t.commentPending.data.append("--").append(replacementChar);
t.transition(Comment);
break;
case '!':
t.error(this);
t.transition(CommentEndBang);
break;
case '-':
t.error(this);
t.commentPending.data.append('-');
break;
case eof:
t.eofError(this);
t.emitCommentPending();
t.transition(Data);
break;
default:
t.error(this);
t.commentPending.data.append("--").append(c);
t.transition(Comment);
}
}
},
CommentEndBang {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '-':
t.commentPending.data.append("--!");
t.transition(CommentEndDash);
break;
case '>':
t.emitCommentPending();
t.transition(Data);
break;
case nullChar:
t.error(this);
t.commentPending.data.append("--!").append(replacementChar);
t.transition(Comment);
break;
case eof:
t.eofError(this);
t.emitCommentPending();
t.transition(Data);
break;
default:
t.commentPending.data.append("--!").append(c);
t.transition(Comment);
}
}
},
Doctype {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BeforeDoctypeName);
break;
case eof:
t.eofError(this);
// note: fall through to > case
case '>': // catch invalid <!DOCTYPE>
t.error(this);
t.createDoctypePending();
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.transition(BeforeDoctypeName);
}
}
},
BeforeDoctypeName {
void read(Tokeniser t, CharacterReader r) {
if (r.matchesLetter()) {
t.createDoctypePending();
t.transition(DoctypeName);
return;
}
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
break; // ignore whitespace
case nullChar:
t.error(this);
t.createDoctypePending();
t.doctypePending.name.append(replacementChar);
t.transition(DoctypeName);
break;
case eof:
t.eofError(this);
t.createDoctypePending();
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.createDoctypePending();
t.doctypePending.name.append(c);
t.transition(DoctypeName);
}
}
},
DoctypeName {
void read(Tokeniser t, CharacterReader r) {
if (r.matchesLetter()) {
String name = r.consumeLetterSequence();
t.doctypePending.name.append(name.toLowerCase());
return;
}
char c = r.consume();
switch (c) {
case '>':
t.emitDoctypePending();
t.transition(Data);
break;
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(AfterDoctypeName);
break;
case nullChar:
t.error(this);
t.doctypePending.name.append(replacementChar);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.doctypePending.name.append(c);
}
}
},
AfterDoctypeName {
void read(Tokeniser t, CharacterReader r) {
if (r.isEmpty()) {
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
return;
}
if (r.matchesAny('\t', '\n', '\r', '\f', ' '))
r.advance(); // ignore whitespace
else if (r.matches('>')) {
t.emitDoctypePending();
t.advanceTransition(Data);
} else if (r.matchConsumeIgnoreCase("PUBLIC")) {
t.transition(AfterDoctypePublicKeyword);
} else if (r.matchConsumeIgnoreCase("SYSTEM")) {
t.transition(AfterDoctypeSystemKeyword);
} else {
t.error(this);
t.doctypePending.forceQuirks = true;
t.advanceTransition(BogusDoctype);
}
}
},
AfterDoctypePublicKeyword {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BeforeDoctypePublicIdentifier);
break;
case '"':
t.error(this);
// set public id to empty string
t.transition(DoctypePublicIdentifier_doubleQuoted);
break;
case '\'':
t.error(this);
// set public id to empty string
t.transition(DoctypePublicIdentifier_singleQuoted);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.doctypePending.forceQuirks = true;
t.transition(BogusDoctype);
}
}
},
BeforeDoctypePublicIdentifier {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
break;
case '"':
// set public id to empty string
t.transition(DoctypePublicIdentifier_doubleQuoted);
break;
case '\'':
// set public id to empty string
t.transition(DoctypePublicIdentifier_singleQuoted);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.doctypePending.forceQuirks = true;
t.transition(BogusDoctype);
}
}
},
DoctypePublicIdentifier_doubleQuoted {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '"':
t.transition(AfterDoctypePublicIdentifier);
break;
case nullChar:
t.error(this);
t.doctypePending.publicIdentifier.append(replacementChar);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.doctypePending.publicIdentifier.append(c);
}
}
},
DoctypePublicIdentifier_singleQuoted {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\'':
t.transition(AfterDoctypePublicIdentifier);
break;
case nullChar:
t.error(this);
t.doctypePending.publicIdentifier.append(replacementChar);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.doctypePending.publicIdentifier.append(c);
}
}
},
AfterDoctypePublicIdentifier {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BetweenDoctypePublicAndSystemIdentifiers);
break;
case '>':
t.emitDoctypePending();
t.transition(Data);
break;
case '"':
t.error(this);
// system id empty
t.transition(DoctypeSystemIdentifier_doubleQuoted);
break;
case '\'':
t.error(this);
// system id empty
t.transition(DoctypeSystemIdentifier_singleQuoted);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.doctypePending.forceQuirks = true;
t.transition(BogusDoctype);
}
}
},
BetweenDoctypePublicAndSystemIdentifiers {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
break;
case '>':
t.emitDoctypePending();
t.transition(Data);
break;
case '"':
t.error(this);
// system id empty
t.transition(DoctypeSystemIdentifier_doubleQuoted);
break;
case '\'':
t.error(this);
// system id empty
t.transition(DoctypeSystemIdentifier_singleQuoted);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.doctypePending.forceQuirks = true;
t.transition(BogusDoctype);
}
}
},
AfterDoctypeSystemKeyword {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BeforeDoctypeSystemIdentifier);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case '"':
t.error(this);
// system id empty
t.transition(DoctypeSystemIdentifier_doubleQuoted);
break;
case '\'':
t.error(this);
// system id empty
t.transition(DoctypeSystemIdentifier_singleQuoted);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
}
}
},
BeforeDoctypeSystemIdentifier {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
break;
case '"':
// set system id to empty string
t.transition(DoctypeSystemIdentifier_doubleQuoted);
break;
case '\'':
// set public id to empty string
t.transition(DoctypeSystemIdentifier_singleQuoted);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.doctypePending.forceQuirks = true;
t.transition(BogusDoctype);
}
}
},
DoctypeSystemIdentifier_doubleQuoted {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '"':
t.transition(AfterDoctypeSystemIdentifier);
break;
case nullChar:
t.error(this);
t.doctypePending.systemIdentifier.append(replacementChar);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.doctypePending.systemIdentifier.append(c);
}
}
},
DoctypeSystemIdentifier_singleQuoted {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\'':
t.transition(AfterDoctypeSystemIdentifier);
break;
case nullChar:
t.error(this);
t.doctypePending.systemIdentifier.append(replacementChar);
break;
case '>':
t.error(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.doctypePending.systemIdentifier.append(c);
}
}
},
AfterDoctypeSystemIdentifier {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
break;
case '>':
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.eofError(this);
t.doctypePending.forceQuirks = true;
t.emitDoctypePending();
t.transition(Data);
break;
default:
t.error(this);
t.transition(BogusDoctype);
// NOT force quirks
}
}
},
BogusDoctype {
void read(Tokeniser t, CharacterReader r) {
char c = r.consume();
switch (c) {
case '>':
t.emitDoctypePending();
t.transition(Data);
break;
case eof:
t.emitDoctypePending();
t.transition(Data);
break;
default:
// ignore char
break;
}
}
},
CdataSection {
void read(Tokeniser t, CharacterReader r) {
String data = r.consumeTo("]]>");
t.emit(data);
r.matchConsume("]]>");
t.transition(Data);
}
};
abstract void read(Tokeniser t, CharacterReader r);
static final char nullChar = '\u0000';
private static final char[] attributeSingleValueCharsSorted = new char[]{'\'', '&', nullChar};
private static final char[] attributeDoubleValueCharsSorted = new char[]{'"', '&', nullChar};
private static final char[] attributeNameCharsSorted = new char[]{'\t', '\n', '\r', '\f', ' ', '/', '=', '>', nullChar, '"', '\'', '<'};
private static final char[] attributeValueUnquoted = new char[]{'\t', '\n', '\r', '\f', ' ', '&', '>', nullChar, '"', '\'', '<', '=', '`'};
private static final char replacementChar = Tokeniser.replacementChar;
private static final String replacementStr = String.valueOf(Tokeniser.replacementChar);
private static final char eof = CharacterReader.EOF;
static {
Arrays.sort(attributeSingleValueCharsSorted);
Arrays.sort(attributeDoubleValueCharsSorted);
Arrays.sort(attributeNameCharsSorted);
Arrays.sort(attributeValueUnquoted);
}
/**
* Handles RawtextEndTagName, ScriptDataEndTagName, and ScriptDataEscapedEndTagName. Same body impl, just
* different else exit transitions.
*/
private static void handleDataEndTag(Tokeniser t, CharacterReader r, TokeniserState elseTransition) {
if (r.matchesLetter()) {
String name = r.consumeLetterSequence();
t.tagPending.appendTagName(name.toLowerCase());
t.dataBuffer.append(name);
return;
}
boolean needsExitTransition = false;
if (t.isAppropriateEndTagToken() && !r.isEmpty()) {
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
t.transition(BeforeAttributeName);
break;
case '/':
t.transition(SelfClosingStartTag);
break;
case '>':
t.emitTagPending();
t.transition(Data);
break;
default:
t.dataBuffer.append(c);
needsExitTransition = true;
}
} else {
needsExitTransition = true;
}
if (needsExitTransition) {
t.emit("</" + t.dataBuffer.toString());
t.transition(elseTransition);
}
}
private static void readData(Tokeniser t, CharacterReader r, TokeniserState current, TokeniserState advance) {
switch (r.current()) {
case '<':
t.advanceTransition(advance);
break;
case nullChar:
t.error(current);
r.advance();
t.emit(replacementChar);
break;
case eof:
t.emit(new Token.EOF());
break;
default:
String data = r.consumeToAny('<', nullChar);
t.emit(data);
break;
}
}
private static void readCharRef(Tokeniser t, TokeniserState advance) {
char[] c = t.consumeCharacterReference(null, false);
if (c == null)
t.emit('&');
else
t.emit(c);
t.transition(advance);
}
private static void readEndTag(Tokeniser t, CharacterReader r, TokeniserState a, TokeniserState b) {
if (r.matchesLetter()) {
t.createTagPending(false);
t.transition(a);
} else {
t.emit("</");
t.transition(b);
}
}
private static void handleDataDoubleEscapeTag(Tokeniser t, CharacterReader r, TokeniserState primary, TokeniserState fallback) {
if (r.matchesLetter()) {
String name = r.consumeLetterSequence();
t.dataBuffer.append(name.toLowerCase());
t.emit(name);
return;
}
char c = r.consume();
switch (c) {
case '\t':
case '\n':
case '\r':
case '\f':
case ' ':
case '/':
case '>':
if (t.dataBuffer.toString().equals("script"))
t.transition(primary);
else
t.transition(fallback);
t.emit(c);
break;
default:
r.unconsume();
t.transition(fallback);
}
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
308929723e23977c95b688579deb5e86e000ef25 | 33b2fb1642932a7fb78728385007bb4eb6a5861e | /src/practice/search/YahooDynamic.java | b67b03fcd57b9615cfe7aa230a85a92c38eb549e | [] | no_license | Alihamza123/PracticeWork | f10d198b65f49667a61d9380264864fe98bd0fda | 17d9596f1f5657b279b6305c90f8bb21fac20ee5 | refs/heads/master | 2021-01-17T15:40:47.395965 | 2016-02-19T00:40:55 | 2016-02-19T00:40:55 | 51,279,658 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,763 | java | package practice.search;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class YahooDynamic {
static WebDriver driver;
public static void main(String[] args) throws InterruptedException {
driver = new FirefoxDriver();
driver.get("https://www.yahoo.com/");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
WebElement search = driver.findElement(By.xpath(".//*[@id='p_13838465-p']"));
search.sendKeys("penguin");
search.click();
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.presenceOfElementLocated(By.partialLinkText("penguin pictures")));
driver.findElement(By.partialLinkText("penguin pictures")).click();
/*
* Thread.sleep(5L); List<WebElement> xpaths =
* driver.findElements(By.xpath(
* "//*[starts-with(@id,'p_13838465-results')]"));
*
* // GET ALL RESULTS LENGTH System.out.println(" XPATHS LINK SIZE = " +
* xpaths.size());
*
* System.out.println(xpaths.get(0).getAttribute("href")); // GET 4TH
* INDEX LINK - PEN String expectedLink = "penguin pictures"; String
* actualLink = xpaths.get(4).getText(); if
* (actualLink.equals(expectedLink)) { System.out.println(
* " EXPECTED RESULT LINK IS SAME AS ACTUAL "); } else {
* System.out.println(" EXPECTED RESULT LINK IS NOT THE SAME AS ACTUAL "
* ); }
*
*/
// GET PEN PAGE TITLE
System.out.println(" Penguin pictures Page title = " + driver.getTitle());
driver.close();
}
}
| [
"AHIbrahim449@gmail.com"
] | AHIbrahim449@gmail.com |
033f562595c5abbd23332ea4fa5595a783565c19 | dc4edc45472964282614012d49543baed29eb01f | /cloud-provider-payment8001/src/main/java/com/atguigu/springcloud/service/PaymentService.java | 3d3e8b3d817728266a5fd0e23a392794c8f9a77e | [] | no_license | heyangang/cloud2020 | 806c73e3bf4928fb0651518204ed367577589561 | 2db7fd5bf7db8e01d4dd1536d2201f30f40673a5 | refs/heads/master | 2023-04-14T01:04:49.001789 | 2021-04-23T13:21:18 | 2021-04-23T13:21:18 | 286,670,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 260 | java | package com.atguigu.springcloud.service;
import com.atguigu.springcloud.entities.Payment;
import org.apache.ibatis.annotations.Param;
public interface PaymentService {
public int create(Payment payment);
public Payment getPaymentById( Long id);
}
| [
"604800374@qq.com"
] | 604800374@qq.com |
f35c6182d88a610cdfab73308963ac059f6da770 | aa979c24238207167010ee50f376684dc5bedcf0 | /service/src/test/java/uk/gov/defra/tracesx/tradetariff/dao/entities/heading/HeadingSectionTest.java | 301de7bfa023158dc6ee8faf88f7a586f74d128b | [] | no_license | avaddict/trade-tarrif-crawler | 0f8705796805ab9de9d866384a8b6e16a44129be | 1d90cc76435289bbac1974b7e6a6384bbc58cfe4 | refs/heads/master | 2020-04-14T20:22:18.091253 | 2019-01-04T10:23:53 | 2019-01-04T10:23:53 | 164,091,388 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,147 | java | package uk.gov.defra.tracesx.tradetariff.dao.entities.heading;
import uk.gov.defra.tracesx.tradetariff.dao.entities.heading.HeadingSection;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
public class HeadingSectionTest {
private static final int POSITION = new Double(Math.random()).intValue();
private static final String TITLE = "A fancy title!";
private static final String NUMERAL = "IV";
private static final String SECTION_NOTE = "A section note";
public HeadingSectionTest() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void verifySectionPositionProperty() {
//Given
HeadingSection section = new HeadingSection();
//When
section.setPosition(POSITION);
//Then
assertEquals(POSITION, section.getPosition());
}
@Test
public void verifySectionTitleProperty() {
//Given
HeadingSection section = new HeadingSection();
//When
section.setTitle(TITLE);
//Then
assertEquals(TITLE, section.getTitle());
}
@Test
public void verifySectionNumeralProperty() {
//Given
HeadingSection section = new HeadingSection();
//When
section.setNumeral(NUMERAL);
//Then
assertEquals(NUMERAL, section.getNumeral());
}
@Test
public void verifySectionSection_noteProperty() {
//Given
HeadingSection section = new HeadingSection();
//When
section.setSection_note(SECTION_NOTE);
//Then
assertEquals(SECTION_NOTE, section.getSection_note());
}
@Test
public void verifySectionToString() {
//Given
HeadingSection section = new HeadingSection();
String expResult = "HeadingSection{position=" + POSITION +
", title=" + TITLE +
", numeral=" + NUMERAL +
", section_note=" + SECTION_NOTE + '}';
//When
section.setPosition(POSITION);
section.setTitle(TITLE);
section.setNumeral(NUMERAL);
section.setSection_note(SECTION_NOTE);
//Then
assertEquals(expResult, section.toString());
}
}
| [
"howardk@kainos.com"
] | howardk@kainos.com |
0815dafe59731da21b4b896e10bfc0c083cc52b7 | 5f11cd3f0d7c85d2676d8ca4bf97940abd6d9849 | /src/sino/com/quanta/sino/yygl/dao/api/ISczsDAO.java | 34207dd0612da02eb667c2c6b38c0bf317ad123d | [] | no_license | 112067416/Sino | e479c945914875243f8b7de10c8826a3f2cff7bf | 167b85c81911ea6954b5d2698832f6ad1f412d8d | refs/heads/master | 2020-04-22T02:21:40.768749 | 2015-05-06T06:41:45 | 2015-05-06T06:41:45 | 35,143,663 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,510 | java | /**
*
*/
package com.quanta.sino.yygl.dao.api;
import java.io.Serializable;
import java.util.List;
import com.coco.core.persistence.query.QEntity;
import com.quanta.sino.orm.SczsTp;
/**
* <p>
* 生产指示单数据访问接口
* </p>
* <p>
* create: 2011-2-2 上午10:49:49
* </p>
*
* @author 张良[jimsonhappy@126.com]
* @version 1.0
*/
public interface ISczsDAO {
/**
* <p>
* 新增生产指示
* </p>
*
* @param entity
*/
public void save(SczsTp entity);
/**
* <p>
* </p>
*
* @param entities
*/
public void saveAll(List<SczsTp> entities);
/**
* <p>
* 更新生产指示
* </p>
*
* @param entity
*/
public void update(SczsTp entity);
/**
* <p>
* 根据中文件编号删除对应的信息
* </p>
*
* @param id
*/
public void delete(Serializable id);
/**
* 批量删除
*
* @param ids
*/
public void delete(List<String> ids);
/**
* <p>
* 查询生产指示
* </p>
*
* @param qentity
*/
public void query(QEntity<SczsTp> qentity);
/**
* <p>
* 获取生产指示
* </p>
*
* @param id
* @return SczsTp
*/
public SczsTp get(Serializable id);
/**
* <p>
* </p>
*
* @param ids
* @return
*/
public List<SczsTp> find(List<String> ids);
/**
* <p>
* 修改状态
* </p>
*
* @param stat
* @param ids
*/
public void updateStat(String stat, String[] ids);
}
| [
"112067416@qq.com"
] | 112067416@qq.com |
b75c5574f129cca63567c0f5e2c16a0ebb6fe08b | 44cf0de4f6b88e66c3efbe700172c420001dabc7 | /src/main/java/DiffArrays.java | 73ea1b3364a518deafdb5f4a28afdd9b6488ffbf | [] | no_license | bonham000/java-practice | c14158e22d36f67026169a87f4ee0767274e81f4 | 92c5a7d5a2f687921c689efb617e02c2bf216619 | refs/heads/master | 2021-05-07T09:12:15.346743 | 2017-12-04T07:07:45 | 2017-12-04T07:07:45 | 109,517,150 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 986 | java |
public class DiffArrays {
public static boolean arrayHasItem(long[] array, long target) {
for (long item:array) {
if (item == target) {
return true;
}
}
return false;
}
// return items not shared between both arrays
public static long[] diffArrays(long[] array1, long[] array2) {
long resultSize = 0;
for (long item:array1) if (!arrayHasItem(array2, item)) resultSize++;
for (long item:array2) if (!arrayHasItem(array1, item)) resultSize++;
long[] result = new long[(int)resultSize];
int index = 0;
for (long item:array1) {
if (!arrayHasItem(array2, item)) {
result[index] = item;
index++;
}
}
for (long item:array2) {
if (!arrayHasItem(array1, item)) {
result[index] = item;
index++;
}
}
return result;
}
}
| [
"sean.smith.2009@gmail.com"
] | sean.smith.2009@gmail.com |
0305a6a2415837d9db4fbffee944dd2d2d54cc2a | 691cf1badbf2b4d63522cf414466e36e5a4d867c | /src/main/java/mortar/api/tome/TomeHeader.java | 3f7a9937ab7292ac373acba8aec83373e653cb0c | [] | no_license | VolmitSoftware/Mortar | 90bdd9313a912af48e76048148e99cbf2994167b | 87dd2abbdaf4449994b7098cd5fb21fec2f1552c | refs/heads/master | 2023-06-26T10:09:13.664319 | 2022-11-23T11:00:18 | 2022-11-23T11:00:18 | 172,641,325 | 3 | 7 | null | 2023-06-13T23:56:14 | 2019-02-26T05:02:53 | Java | UTF-8 | Java | false | false | 271 | java | package mortar.api.tome;
import org.dom4j.Element;
public class TomeHeader extends TomeParagraph
{
@Override
public void construct(Element parent)
{
Element p = parent.addElement("header");
for(TomeComponent i : getComponents())
{
i.construct(p);
}
}
}
| [
"danielmillst@gmail.com"
] | danielmillst@gmail.com |
984e15bd83caa1f08ab15ebfef0689cdc75eb4bd | c4ceba95bfb1c737b27ad8600867355c2f19fbb6 | /webdeveloper_one/src/main/java/webdeveloper_one/doitjava/Hash_2.java | 4815aed6c29dd981723ea219f5ba64df3a49e8bc | [] | no_license | jslee6091/Java_basic | 88450e2e6af88f3a3be4cf59cba655d88b67ed16 | 367756214530556a9b1a07782d2841efbdb78f6d | refs/heads/master | 2023-08-26T08:39:32.091690 | 2021-10-18T08:14:41 | 2021-10-18T08:14:41 | 412,287,232 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,397 | java | package webdeveloper_one.doitjava;
import java.util.Hashtable;
public class Hash_2 {
public static void main(String[] args) {
/* key, value -> 1 : 1 -> 속도가 제일 빠르다
* Map은 hash의 부모이다
*/
Hashtable<Object, Object> hash = new Hashtable<Object, Object>();
hash.put(1, 1);
hash.put(2, 2);
hash.put(3, 3);
hash.put(4, 4);
hash.put(5, 5);
/* for loop */
for (int i = 0; i < hash.size(); i++) {
System.out.println(hash.get(i + 1));
}
System.out.println("-----------------");
// bean : 임시로 값을 저장한다
LoginBean bean = new LoginBean();
bean.setName("이재성");
bean.setAge(26);
bean.setAddress("대한민국");
LoginBean bean2 = new LoginBean();
bean2.setName("아무개");
bean2.setAge(20);
bean2.setAddress("서울시");
hash.clear();
hash.put(1, bean);
hash.put(2, bean2);
for(int i = 1; i <= hash.size(); i++) {
LoginBean dd = (LoginBean)hash.get(i);
System.out.println(dd.getAddress());
System.out.println(dd.getAge());
System.out.println(dd.getName());
System.out.println("-----------------");
}
// package:webdeveloper_one.doitjava
// class:InputLogin_A, InputLoginBean_A
// class:InputLogin_M, InputLoginBean_M
// 입력 이름, 나이, 주소, 이메일, 별명 5개 입력
// A는 Arraylist, M은 HashMap, Hashtable 등 사용
}
}
| [
"jslee6091@naver.com"
] | jslee6091@naver.com |
50cfcf73dd5671d3ad6b834a92497dafb059d561 | 772a025799e211aedef313002e906dd21951de0a | /febs-quartz/src/main/java/cc/mrbird/quartz/domain/Job.java | f36eff452e2ba1b484121f7ef7385c1b55bb084c | [
"Apache-2.0"
] | permissive | everhopingandwaiting/FEBS-Security | 6f3cb4dea3390f7b7d6509084b694118859ba85b | 2cc75c1eb265c7241b2832e58653fcfe67baeb93 | refs/heads/master | 2023-06-23T10:35:03.204069 | 2018-09-20T07:16:20 | 2018-09-20T07:16:20 | 149,702,562 | 2 | 0 | null | 2023-06-14T22:20:54 | 2018-09-21T03:06:26 | Java | UTF-8 | Java | false | false | 4,411 | java | package cc.mrbird.quartz.domain;
import cc.mrbird.common.annotation.ExportConfig;
import com.google.common.base.MoreObjects;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
@Table(name = "t_job")
public class Job implements Serializable {
private static final long serialVersionUID = 400066840871805700L;
/**
* 任务调度参数key
*/
public static final String JOB_PARAM_KEY = "JOB_PARAM_KEY";
public enum ScheduleStatus {
/**
* 正常
*/
NORMAL("0"),
/**
* 暂停
*/
PAUSE("1");
private String value;
private ScheduleStatus(String value) {
this.value = value;
}
public String getValue() {
return value;
}
}
@Id
@GeneratedValue(generator = "JDBC")
@Column(name = "JOB_ID")
@ExportConfig(value = "任务ID")
private Long jobId;
@Column(name = "BEAN_NAME")
@ExportConfig(value = "Bean名称")
private String beanName;
@Column(name = "METHOD_NAME")
@ExportConfig(value = "方法名称")
private String methodName;
@Column(name = "PARAMS")
@ExportConfig(value = "参数")
private String params;
@Column(name = "CRON_EXPRESSION")
@ExportConfig(value = "cron表达式")
private String cronExpression;
@Column(name = "STATUS")
@ExportConfig(value = "状态", convert = "s:0=正常,1=暂停")
private String status;
@Column(name = "REMARK")
@ExportConfig(value = "备注")
private String remark;
@Column(name = "CREATE_TIME")
@ExportConfig(value = "创建时间", convert = "c:cc.mrbird.common.util.poi.convert.TimeConvert")
private Date createTime;
/**
* @return JOB_ID
*/
public Long getJobId() {
return jobId;
}
/**
* @param jobId
*/
public void setJobId(Long jobId) {
this.jobId = jobId;
}
/**
* @return BEAN_NAME
*/
public String getBeanName() {
return beanName;
}
/**
* @param beanName
*/
public void setBeanName(String beanName) {
this.beanName = beanName == null ? null : beanName.trim();
}
/**
* @return METHOD_NAME
*/
public String getMethodName() {
return methodName;
}
/**
* @param methodName
*/
public void setMethodName(String methodName) {
this.methodName = methodName == null ? null : methodName.trim();
}
/**
* @return PARAMS
*/
public String getParams() {
return params;
}
/**
* @param params
*/
public void setParams(String params) {
this.params = params == null ? null : params.trim();
}
/**
* @return CRON_EXPRESSION
*/
public String getCronExpression() {
return cronExpression;
}
/**
* @param cronExpression
*/
public void setCronExpression(String cronExpression) {
this.cronExpression = cronExpression == null ? null : cronExpression.trim();
}
/**
* @return STATUS
*/
public String getStatus() {
return status;
}
/**
* @param status
*/
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
/**
* @return REMARK
*/
public String getRemark() {
return remark;
}
/**
* @param remark
*/
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
/**
* @return CREATE_TIME
*/
public Date getCreateTime() {
return createTime;
}
/**
* @param createTime
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
.add("jobId", jobId)
.add("beanName", beanName)
.add("methodName", methodName)
.add("params", params)
.add("cronExpression", cronExpression)
.add("status", status)
.add("remark", remark)
.add("createTime", createTime)
.toString();
}
} | [
"852252810@qq.com"
] | 852252810@qq.com |
1bc39ad2c5fdb8fd20dba8135e86d08bedbfaf71 | d715981bc6518c9e3a5c34e9757ed63792139f4c | /cdm/core/src/test/java/ucar/nc2/ncml/TestNcmlReaderProblems.java | 80be84f614bd5fed768e6d4ebe6ddb4e8365715d | [
"BSD-3-Clause"
] | permissive | dopplershift/netcdf-java | 4260de7caf172f3e31321587dad557f4d85b5c16 | 756848e75948c146a9c1ec743055683fded0f39a | refs/heads/master | 2022-09-14T00:32:58.372224 | 2019-11-19T01:43:33 | 2019-11-19T01:43:33 | 222,898,299 | 0 | 0 | BSD-3-Clause | 2019-11-20T09:20:42 | 2019-11-20T09:20:42 | null | UTF-8 | Java | false | false | 1,913 | java | /* Copyright Unidata */
package ucar.nc2.ncml;
import static com.google.common.truth.Truth.assertThat;
import java.io.IOException;
import java.lang.invoke.MethodHandles;
import java.util.Formatter;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import ucar.nc2.dataset.NetcdfDataset;
import ucar.nc2.internal.ncml.NcMLReaderNew;
import ucar.nc2.util.CompareNetcdf2;
/**
* Compare old and new NcmlReaders on specific problem datasets.
*
* @author caron
* @since 10/4/2019.
*/
public class TestNcmlReaderProblems {
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
@Test
public void problem() throws IOException {
// This appears to be wrong (time(31)) in NcmlReader, and correct NcmlReaderNew (time(59)).
// compare("file:" + TestNcMLRead.topDir + "exclude/aggExistingNoCoordsDir.xml");
// This used to fail in NcmlReader. Succeeds in NcmlReaderNew, but doesnt get the time coordinates right.
// compare("file:" + TestNcMLRead.topDir + "exclude/aggExistingNoCoordsDir.xml");
compare("file:" + TestNcMLRead.topDir + "standalone/enum.ncml");
}
private void compare(String ncmlLocation) throws IOException {
System.out.printf("Compare %s%n", ncmlLocation);
logger.info("TestNcmlReaders on {}%n", ncmlLocation);
try (NetcdfDataset org = NcMLReader.readNcML(ncmlLocation, null)) {
System.out.printf("NcMLReader == %s%n", org);
try (NetcdfDataset withBuilder = NcMLReaderNew.readNcML(ncmlLocation, null, null).build()) {
System.out.printf("NcMLReaderNew == %s%n", withBuilder);
Formatter f = new Formatter();
CompareNetcdf2 compare = new CompareNetcdf2(f, true, true, true);
boolean ok = compare.compare(org, withBuilder);
System.out.printf("%s %s%n", ok ? "OK" : "NOT OK", f);
assertThat(ok).isTrue();
}
}
}
}
| [
"jlcaron@google.com"
] | jlcaron@google.com |
e0a8d72f0cbcfb490c4bb49632f89c4f9a67d13a | f221c2e49affea38e59c56441a053f36693bfe82 | /app/src/main/java/com/aero/droid/dutyfree/talent/presenter/MyCollectPresenter.java | ddceb8d63d06fcedc6f638a652554d507b352f7d | [] | no_license | wangxp423/FreeMall | f39ded900a3b49c8c60553319ccf82f6cc94784f | b3d572deee13afd771d62470e3bf609fdb7e2092 | refs/heads/master | 2020-04-06T06:25:10.562265 | 2017-02-23T04:09:44 | 2017-02-23T04:09:44 | 82,882,256 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 438 | java | package com.aero.droid.dutyfree.talent.presenter;
/**
* Author : wangxp
* Date : 2015/12/4
* Desc : 我的收藏 逻辑控制器
*/
public interface MyCollectPresenter {
/**
* 获取收藏列表
*
* @param log_tag
*/
void getCollectList(String log_tag);
/**
* 删除收藏
*
* @param log_tag
* @param goodsId
*/
void clickDeleteCollect(String log_tag, String goodsId);
}
| [
"wangxiaopan@ihangmei.com"
] | wangxiaopan@ihangmei.com |
496e3f8b4d10ba1da7971979acd82201d21e53bc | 27cc58a708db52b2e28ff18a9102676e789609d9 | /app/src/androidTest/java/com/example/juankno4/intentimplicitos/ExampleInstrumentedTest.java | cb42aa90f60e9208a3ab2b776f03a0b28fab975a | [] | no_license | juanCano29/IntentImplicitos | 9f0374b4a67ce9d762f5e1e0b3c7f073ba384658 | 4479bfffb894522988b351382ed2fe3e86ea9df4 | refs/heads/master | 2020-04-21T11:14:33.410136 | 2019-02-07T04:04:24 | 2019-02-07T04:04:24 | 169,516,965 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 758 | java | package com.example.juankno4.intentimplicitos;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.example.juankno4.intentimplicitos", appContext.getPackageName());
}
}
| [
"juankno4@gmail.com"
] | juankno4@gmail.com |
1335352aeaa0274a209f1912a7755a6e8a1b6125 | 047e43885f1a29d467438e04d02363927cdbf1df | /MF0967_3/MF0967_3/src/com/ipartek/formacion/mf0967_3/controladores/LogoutServlet.java | 16c53c20540398f91880052fb4d4181ffc8ea82f | [] | no_license | ipartek/java_2019_0394 | 2cc28c80776860fb6cb321dc3ada570a5f530b57 | 84b26099186652393f5a0385575c95d3fce9729a | refs/heads/master | 2022-12-21T06:18:42.033221 | 2019-11-12T13:37:37 | 2019-11-12T13:37:37 | 191,704,777 | 1 | 4 | null | 2022-12-16T05:07:27 | 2019-06-13T06:33:27 | Java | UTF-8 | Java | false | false | 802 | java | package com.ipartek.formacion.mf0967_3.controladores;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/logout")
public class LogoutServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.getSession().invalidate();
response.sendRedirect(request.getContextPath() + "/login");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
}
| [
"jglete@gmail.com"
] | jglete@gmail.com |
35db1c48ae59b7f88e9f1cadd82d6bbb568477be | 58b1fb9090c4938a7eb6b8cbd1aed88794a78a50 | /org.afplib.afptext/src-gen/org/afplib/afpText/ESG.java | d336633bfa9f8bc5bf657e2e62933039b5b70c93 | [
"Apache-2.0"
] | permissive | yan74/afptext | 7750310189759d7ede7393e0bbdd726e3b81914a | 2d0a89be3d3dd1de981e522c2c6791d789894475 | refs/heads/master | 2020-07-28T09:04:05.789849 | 2019-09-22T09:36:22 | 2019-09-22T09:36:22 | 209,372,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,273 | java | /**
* generated by Xtext 2.19.0
*/
package org.afplib.afpText;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>ESG</b></em>'.
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* </p>
* <ul>
* <li>{@link org.afplib.afpText.ESG#getREGName <em>REG Name</em>}</li>
* </ul>
*
* @see org.afplib.afpText.AfpTextPackage#getESG()
* @model
* @generated
*/
public interface ESG extends structuredField
{
/**
* Returns the value of the '<em><b>REG Name</b></em>' attribute.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>REG Name</em>' attribute isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>REG Name</em>' attribute.
* @see #setREGName(String)
* @see org.afplib.afpText.AfpTextPackage#getESG_REGName()
* @model
* @generated
*/
String getREGName();
/**
* Sets the value of the '{@link org.afplib.afpText.ESG#getREGName <em>REG Name</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>REG Name</em>' attribute.
* @see #getREGName()
* @generated
*/
void setREGName(String value);
} // ESG
| [
"yan@hcsystems.de"
] | yan@hcsystems.de |
7638e806887a506432e0ca121850bccf37e7e181 | 5cdadec6e9fd06a02b4a263fb93d9163ed2ea5ee | /todolist-core/src/main/java/io/github/todolist/core/domain/User.java | ced16abccd3904c1c7e0407c3e41bdb22c481c58 | [
"MIT"
] | permissive | kssraju/todolist-mvc | 183618c6ccef7924fac37518bd57f42dfcb6931b | 32a2cc2a268b47c746792533b3014e0951beb8de | refs/heads/master | 2021-01-16T19:02:21.141137 | 2013-12-23T13:07:11 | 2013-12-23T13:07:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,047 | java | /*
* The MIT License
*
* Copyright (c) 2013, benas (md.benhassine@gmail.com)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package io.github.todolist.core.domain;
import javax.persistence.*;
import java.io.Serializable;
/**
* User entity.
* @author benas (md.benhassine@gmail.com)
*/
@Entity
@NamedQueries({
@NamedQuery(name = "findUserByEmail", query = "SELECT u FROM User u where u.email = :p_email"),
@NamedQuery(name = "findUserByEmailAndPassword", query = "SELECT u FROM User u where u.email = :p_email and u.password = :p_password")
})
public class User implements Serializable {
@Id
@GeneratedValue
private Long id;
private String firstname;
private String lastname;
private String email;
private String password;
public User() {
}
public User(String firstname, String lastname, String email, String password) {
this.firstname = firstname;
this.lastname = lastname;
this.email = email;
this.password = password;
}
public Long getId() {
return id;
}
public String getFirstname() {
return firstname;
}
public void setFirstname(String firstname) {
this.firstname = firstname;
}
public String getLastname() {
return lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "User[" +
"id=" + id +
", firstname='" + firstname + '\'' +
", lastname='" + lastname + '\'' +
", email='" + email + '\'' +
", password='" + password + '\'' +
']';
}
}
| [
"md.benhassine@gmail.com"
] | md.benhassine@gmail.com |
750467f3584c03c830fa7388eafa5146f794c303 | 66968f9348e80d3c55777af2b4d37e39fb4a67de | /microservice/src/main/java/com/telstra/codechallenge/git/common/GitResponse.java | 0b200e32731bcc6f4d4651d2b0ca39a1d0e5d18c | [] | no_license | RamMohan222/infosys-spring-boot-coding-exercise | bbf5babc7616561926137fdf1bce48ae4f8b39b5 | 3dea8ea7c7ec773c7d0535e69012accee3b74d82 | refs/heads/master | 2022-10-13T12:57:13.121152 | 2020-06-05T15:24:02 | 2020-06-05T15:24:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 715 | java | package com.telstra.codechallenge.git.common;
import java.util.List;
/**
* This is github api common response structure.
*
* @param <T>
*/
public class GitResponse<T> {
private long total_count;
private boolean incomplete_results;
private List<T> items;
public List<T> getItems() {
return items;
}
public void setItems(List<T> items) {
this.items = items;
}
public long getTotal_count() {
return total_count;
}
public void setTotal_count(long total_count) {
this.total_count = total_count;
}
public boolean isIncomplete_results() {
return incomplete_results;
}
public void setIncomplete_results(boolean incomplete_results) {
this.incomplete_results = incomplete_results;
}
}
| [
"ram222mohan@gmail.com"
] | ram222mohan@gmail.com |
bb55951fe6ef06d6f7e38fec0bf3b540b70c5d5c | 554f6638ff2f02818ed490c6120addff0581cb74 | /Back/src/main/java/com/example/demo/controller/PlayerController.java | 02e52b33f98d181bd4b520d16445977107ec71e2 | [] | no_license | james-falk/Full_Stack_Soccer_Directory | 9013d821287606e3fae48f37c04e09ba9b66b03f | 5c9f1716d50bf13810e9554ce5a752aa03ff4799 | refs/heads/main | 2023-06-19T07:09:21.766238 | 2021-07-12T17:10:56 | 2021-07-12T17:10:56 | 385,277,112 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,753 | java | package com.example.demo.controller;
import com.example.demo.entity.Player;
import com.example.demo.service.PlayerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.*;
import javax.persistence.GeneratedValue;
import java.util.List;
@CrossOrigin(origins = {"http://localhost:3000"})
@RestController
public class PlayerController {
private final PlayerService playerService;
//Constructor Injection: this is telling the spring framework to wire up your
//dependencies for the playerService
@Autowired
public PlayerController(@Qualifier("playerServiceIMPL") PlayerService playerService) {
this.playerService = playerService;
}
//This is a GET request that will read a list of all the players.
//http://localhost:8080/retrieveAllPlayers
@GetMapping("/retrieveAllPlayers")
public List<Player> findAll() {
return playerService.findAll();
}
//This is a GET request that will retrieve one player by id
//http://localhost:8080/retrievePlayer/1
@GetMapping("/retrievePlayer/{playerId}")
public Player findById(@PathVariable int playerId) {
return playerService.findById(playerId);
}
//This is a GET request that will retrieve one player by id
//http://localhost:8080/retrievePlayer/Ronaldo
@GetMapping("/retrievePlayer/{playerName}")
public List<Player> findByName(@PathVariable String playerName) {
return playerService.findByName(playerName);
}
//This is a POST request to add a new player.
//http://localhost:8080/addPlayer
@PostMapping("/addPlayer")
public Player addPlayer(@RequestBody Player thePlayer) {
//also just in case they pass an id in JSON .... set id to o
//this is to force a save of new item .... instead of update
thePlayer.setId(0);
//This will call the playerDaoImpl.save method to save a new employee
//through the playerService interface SPRING
playerService.saveOrUpdate(thePlayer);
return thePlayer;
}
//This is a PUT request to update an existing player.
//http://localhost:8080/updatePlayer
@PutMapping("/updatePlayer")
public Player updatePlayer(@RequestBody Player updatePlayer) {
playerService.saveOrUpdate(updatePlayer);
return updatePlayer;
}
//This is a DELETE request to delete an existing player.
//http://localhost:8080/deletePlayer/1
@DeleteMapping("/deletePlayer/{playerId}")
public String deletePlayer(@PathVariable int playerId) {
playerService.deleteById(playerId);
return "Deleted player id: " + playerId;
}
}
| [
"jamesfalk20@gmail.com"
] | jamesfalk20@gmail.com |
72b7955f9f2f1b4f52612508a47f15e908ec3788 | b0975a6b4860c60d74f3903f290f8bd1d828c5bf | /src/main/java/DataAcquisition/ILocator.java | 80fa663469b16a492dcf389fcc50f859595f855b | [] | no_license | sanfur/WebAppEngine | dffa851014e6ee9f2ed83bf417a77f92fd3d8e0e | 16c91a2930562ec0e037b1343fa6343db931b231 | refs/heads/master | 2020-04-06T18:51:38.295604 | 2018-12-26T00:21:01 | 2018-12-26T00:21:01 | 157,715,651 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package DataAcquisition;
import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
public interface ILocator {
public ArrayList<Sensor> getSensorCoordinates(InputStream inputStream) throws FileNotFoundException;
}
| [
"sandro.fuerer@gmail.com"
] | sandro.fuerer@gmail.com |
155a3e3c3bbc73802484594d2888be9024bd0391 | 6732796da80d70456091ec1c3cc1ee9748b97cc5 | /TS/gson/gson/src/test/java/com/google/gson/functional/DefaultTypeAdaptersTest.java | 8f28956332efcf5c9d122a56914c67197275a685 | [
"Apache-2.0"
] | permissive | nharrand/argo | f88c13a1fb759f44fab6dbc6614de3c0c0554549 | c09fccba668e222a1b349b95d34177b5964e78e1 | refs/heads/main | 2023-08-13T10:39:48.526694 | 2021-10-13T09:40:19 | 2021-10-13T09:40:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 30,219 | java | /*
* Copyright (C) 2008 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.gson.functional;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonNull;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSyntaxException;
import com.google.gson.TypeAdapter;
import com.google.gson.internal.JavaVersion;
import com.google.gson.reflect.TypeToken;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.URI;
import java.net.URL;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeSet;
import java.util.UUID;
import junit.framework.TestCase;
import static com.google.gson.JSONTestUtils.assertEquivalent;
/**
* Functional test for Json serialization and deserialization for common classes for which default
* support is provided in Gson. The tests for Map types are available in {@link MapTest}.
*
* @author Inderjeet Singh
* @author Joel Leitch
*/
public class DefaultTypeAdaptersTest extends TestCase {
private Gson gson;
private TimeZone oldTimeZone;
@Override
protected void setUp() throws Exception {
super.setUp();
this.oldTimeZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
Locale.setDefault(Locale.US);
gson = new Gson();
}
@Override
protected void tearDown() throws Exception {
TimeZone.setDefault(oldTimeZone);
super.tearDown();
}
public void testClassSerialization() {
try {
gson.toJson(String.class);
} catch (UnsupportedOperationException expected) {}
// Override with a custom type adapter for class.
gson = new GsonBuilder().registerTypeAdapter(Class.class, new MyClassTypeAdapter()).create();
//ARGO_PLACEBO
assertEquals("\"java.lang.String\"", gson.toJson(String.class));
}
public void testClassDeserialization() {
try {
gson.fromJson("String.class", String.class.getClass());
} catch (UnsupportedOperationException expected) {}
// Override with a custom type adapter for class.
gson = new GsonBuilder().registerTypeAdapter(Class.class, new MyClassTypeAdapter()).create();
//ARGO_PLACEBO
assertEquals(String.class, gson.fromJson("java.lang.String", Class.class));
}
public void testUrlSerialization() throws Exception {
String urlValue = "http://google.com/";
URL url = new URL(urlValue);
//ARGO_PLACEBO
assertEquals("\"http://google.com/\"", gson.toJson(url));
}
public void testUrlDeserialization() {
String urlValue = "http://google.com/";
String json = "'http:\\/\\/google.com\\/'";
URL target = gson.fromJson(json, URL.class);
//ARGO_PLACEBO
assertEquals(urlValue, target.toExternalForm());
gson.fromJson('"' + urlValue + '"', URL.class);
//ARGO_PLACEBO
assertEquals(urlValue, target.toExternalForm());
}
public void testUrlNullSerialization() throws Exception {
ClassWithUrlField target = new ClassWithUrlField();
//ARGO_PLACEBO
assertEquals("{}", gson.toJson(target));
}
public void testUrlNullDeserialization() {
String json = "{}";
ClassWithUrlField target = gson.fromJson(json, ClassWithUrlField.class);
//ARGO_PLACEBO
assertNull(target.url);
}
private static class ClassWithUrlField {
URL url;
}
public void testUriSerialization() throws Exception {
String uriValue = "http://google.com/";
URI uri = new URI(uriValue);
//ARGO_PLACEBO
assertEquals("\"http://google.com/\"", gson.toJson(uri));
}
public void testUriDeserialization() {
String uriValue = "http://google.com/";
String json = '"' + uriValue + '"';
URI target = gson.fromJson(json, URI.class);
//ARGO_PLACEBO
assertEquals(uriValue, target.toASCIIString());
}
public void testNullSerialization() throws Exception {
testNullSerializationAndDeserialization(Boolean.class);
testNullSerializationAndDeserialization(Byte.class);
testNullSerializationAndDeserialization(Short.class);
testNullSerializationAndDeserialization(Integer.class);
testNullSerializationAndDeserialization(Long.class);
testNullSerializationAndDeserialization(Double.class);
testNullSerializationAndDeserialization(Float.class);
testNullSerializationAndDeserialization(Number.class);
testNullSerializationAndDeserialization(Character.class);
testNullSerializationAndDeserialization(String.class);
testNullSerializationAndDeserialization(StringBuilder.class);
testNullSerializationAndDeserialization(StringBuffer.class);
testNullSerializationAndDeserialization(BigDecimal.class);
testNullSerializationAndDeserialization(BigInteger.class);
testNullSerializationAndDeserialization(TreeSet.class);
testNullSerializationAndDeserialization(ArrayList.class);
testNullSerializationAndDeserialization(HashSet.class);
testNullSerializationAndDeserialization(Properties.class);
testNullSerializationAndDeserialization(URL.class);
testNullSerializationAndDeserialization(URI.class);
testNullSerializationAndDeserialization(UUID.class);
testNullSerializationAndDeserialization(Locale.class);
testNullSerializationAndDeserialization(InetAddress.class);
testNullSerializationAndDeserialization(BitSet.class);
testNullSerializationAndDeserialization(Date.class);
testNullSerializationAndDeserialization(GregorianCalendar.class);
testNullSerializationAndDeserialization(Calendar.class);
testNullSerializationAndDeserialization(Time.class);
testNullSerializationAndDeserialization(Timestamp.class);
testNullSerializationAndDeserialization(java.sql.Date.class);
testNullSerializationAndDeserialization(Enum.class);
testNullSerializationAndDeserialization(Class.class);
}
private void testNullSerializationAndDeserialization(Class<?> c) {
//ARGO_PLACEBO
assertEquals("null", gson.toJson(null, c));
//ARGO_PLACEBO
assertEquals(null, gson.fromJson("null", c));
}
public void testUuidSerialization() throws Exception {
String uuidValue = "c237bec1-19ef-4858-a98e-521cf0aad4c0";
UUID uuid = UUID.fromString(uuidValue);
//ARGO_PLACEBO
assertEquals('"' + uuidValue + '"', gson.toJson(uuid));
}
public void testUuidDeserialization() {
String uuidValue = "c237bec1-19ef-4858-a98e-521cf0aad4c0";
String json = '"' + uuidValue + '"';
UUID target = gson.fromJson(json, UUID.class);
//ARGO_PLACEBO
assertEquals(uuidValue, target.toString());
}
public void testLocaleSerializationWithLanguage() {
Locale target = new Locale("en");
//ARGO_PLACEBO
assertEquals("\"en\"", gson.toJson(target));
}
public void testLocaleDeserializationWithLanguage() {
String json = "\"en\"";
Locale locale = gson.fromJson(json, Locale.class);
//ARGO_PLACEBO
assertEquals("en", locale.getLanguage());
}
public void testLocaleSerializationWithLanguageCountry() {
Locale target = Locale.CANADA_FRENCH;
//ARGO_PLACEBO
assertEquals("\"fr_CA\"", gson.toJson(target));
}
public void testLocaleDeserializationWithLanguageCountry() {
String json = "\"fr_CA\"";
Locale locale = gson.fromJson(json, Locale.class);
//ARGO_PLACEBO
assertEquals(Locale.CANADA_FRENCH, locale);
}
public void testLocaleSerializationWithLanguageCountryVariant() {
Locale target = new Locale("de", "DE", "EURO");
String json = gson.toJson(target);
//ARGO_PLACEBO
assertEquals("\"de_DE_EURO\"", json);
}
public void testLocaleDeserializationWithLanguageCountryVariant() {
String json = "\"de_DE_EURO\"";
Locale locale = gson.fromJson(json, Locale.class);
//ARGO_PLACEBO
assertEquals("de", locale.getLanguage());
//ARGO_PLACEBO
assertEquals("DE", locale.getCountry());
//ARGO_PLACEBO
assertEquals("EURO", locale.getVariant());
}
public void testBigDecimalFieldSerialization() {
ClassWithBigDecimal target = new ClassWithBigDecimal("-122.01e-21");
String json = gson.toJson(target);
String actual = json.substring(json.indexOf(':') + 1, json.indexOf('}'));
//ARGO_PLACEBO
assertEquals(target.value, new BigDecimal(actual));
}
public void testBigDecimalFieldDeserialization() {
ClassWithBigDecimal expected = new ClassWithBigDecimal("-122.01e-21");
String json = expected.getExpectedJson();
ClassWithBigDecimal actual = gson.fromJson(json, ClassWithBigDecimal.class);
//ARGO_PLACEBO
assertEquals(expected.value, actual.value);
}
public void testBadValueForBigDecimalDeserialization() {
try {
gson.fromJson("{\"value\"=1.5e-1.0031}", ClassWithBigDecimal.class);
//ARGO_PLACEBO
fail("Exponent of a BigDecimal must be an integer value.");
} catch (JsonParseException expected) { }
}
public void testBigIntegerFieldSerialization() {
ClassWithBigInteger target = new ClassWithBigInteger("23232323215323234234324324324324324324");
String json = gson.toJson(target);
//ARGO_PLACEBO
assertEquals(target.getExpectedJson(), json);
}
public void testBigIntegerFieldDeserialization() {
ClassWithBigInteger expected = new ClassWithBigInteger("879697697697697697697697697697697697");
String json = expected.getExpectedJson();
ClassWithBigInteger actual = gson.fromJson(json, ClassWithBigInteger.class);
//ARGO_PLACEBO
assertEquals(expected.value, actual.value);
}
public void testOverrideBigIntegerTypeAdapter() throws Exception {
gson = new GsonBuilder()
.registerTypeAdapter(BigInteger.class, new NumberAsStringAdapter(BigInteger.class))
.create();
//ARGO_PLACEBO
assertEquals("\"123\"", gson.toJson(new BigInteger("123"), BigInteger.class));
//ARGO_PLACEBO
assertEquals(new BigInteger("123"), gson.fromJson("\"123\"", BigInteger.class));
}
public void testOverrideBigDecimalTypeAdapter() throws Exception {
gson = new GsonBuilder()
.registerTypeAdapter(BigDecimal.class, new NumberAsStringAdapter(BigDecimal.class))
.create();
//ARGO_PLACEBO
assertEquals("\"1.1\"", gson.toJson(new BigDecimal("1.1"), BigDecimal.class));
//ARGO_PLACEBO
assertEquals(new BigDecimal("1.1"), gson.fromJson("\"1.1\"", BigDecimal.class));
}
public void testSetSerialization() throws Exception {
Gson gson = new Gson();
HashSet<String> s = new HashSet<String>();
s.add("blah");
String json = gson.toJson(s);
//ARGO_PLACEBO
assertEquals("[\"blah\"]", json);
json = gson.toJson(s, Set.class);
//ARGO_PLACEBO
assertEquals("[\"blah\"]", json);
}
public void testBitSetSerialization() throws Exception {
Gson gson = new Gson();
BitSet bits = new BitSet();
bits.set(1);
bits.set(3, 6);
bits.set(9);
String json = gson.toJson(bits);
//ARGO_PLACEBO
assertEquals("[0,1,0,1,1,1,0,0,0,1]", json);
}
public void testBitSetDeserialization() throws Exception {
BitSet expected = new BitSet();
expected.set(0);
expected.set(2, 6);
expected.set(8);
Gson gson = new Gson();
String json = gson.toJson(expected);
//ARGO_PLACEBO
assertEquals(expected, gson.fromJson(json, BitSet.class));
json = "[1,0,1,1,1,1,0,0,1,0,0,0]";
//ARGO_PLACEBO
assertEquals(expected, gson.fromJson(json, BitSet.class));
json = "[\"1\",\"0\",\"1\",\"1\",\"1\",\"1\",\"0\",\"0\",\"1\"]";
//ARGO_PLACEBO
assertEquals(expected, gson.fromJson(json, BitSet.class));
json = "[true,false,true,true,true,true,false,false,true,false,false]";
//ARGO_PLACEBO
assertEquals(expected, gson.fromJson(json, BitSet.class));
}
public void testDefaultDateSerialization() {
Date now = new Date(1315806903103L);
String json = gson.toJson(now);
if (JavaVersion.isJava9OrLater()) {
//ARGO_PLACEBO
assertEquals("\"Sep 11, 2011, 10:55:03 PM\"", json);
} else {
//ARGO_PLACEBO
assertEquals("\"Sep 11, 2011 10:55:03 PM\"", json);
}
}
public void testDefaultDateDeserialization() {
String json = "'Dec 13, 2009 07:18:02 AM'";
Date extracted = gson.fromJson(json, Date.class);
//ARGO_PLACEBO
assertEqualsDate(extracted, 2009, 11, 13);
//ARGO_PLACEBO
assertEqualsTime(extracted, 7, 18, 2);
}
// Date can not directly be compared with another instance since the deserialization loses the
// millisecond portion.
@SuppressWarnings("deprecation")
private void assertEqualsDate(Date date, int year, int month, int day) {
assertEquals(year-1900, date.getYear());
assertEquals(month, date.getMonth());
assertEquals(day, date.getDate());
}
@SuppressWarnings("deprecation")
private void assertEqualsTime(Date date, int hours, int minutes, int seconds) {
assertEquals(hours, date.getHours());
assertEquals(minutes, date.getMinutes());
assertEquals(seconds, date.getSeconds());
}
public void testDefaultJavaSqlDateSerialization() {
java.sql.Date instant = new java.sql.Date(1259875082000L);
String json = gson.toJson(instant);
//ARGO_PLACEBO
assertEquals("\"Dec 3, 2009\"", json);
}
public void testDefaultJavaSqlDateDeserialization() {
String json = "'Dec 3, 2009'";
java.sql.Date extracted = gson.fromJson(json, java.sql.Date.class);
//ARGO_PLACEBO
assertEqualsDate(extracted, 2009, 11, 3);
}
public void testDefaultJavaSqlTimestampSerialization() {
Timestamp now = new java.sql.Timestamp(1259875082000L);
String json = gson.toJson(now);
if (JavaVersion.isJava9OrLater()) {
//ARGO_PLACEBO
assertEquals("\"Dec 3, 2009, 1:18:02 PM\"", json);
} else {
//ARGO_PLACEBO
assertEquals("\"Dec 3, 2009 1:18:02 PM\"", json);
}
}
public void testDefaultJavaSqlTimestampDeserialization() {
String json = "'Dec 3, 2009 1:18:02 PM'";
Timestamp extracted = gson.fromJson(json, Timestamp.class);
//ARGO_PLACEBO
assertEqualsDate(extracted, 2009, 11, 3);
//ARGO_PLACEBO
assertEqualsTime(extracted, 13, 18, 2);
}
public void testDefaultJavaSqlTimeSerialization() {
Time now = new Time(1259875082000L);
String json = gson.toJson(now);
//ARGO_PLACEBO
assertEquals("\"01:18:02 PM\"", json);
}
public void testDefaultJavaSqlTimeDeserialization() {
String json = "'1:18:02 PM'";
Time extracted = gson.fromJson(json, Time.class);
//ARGO_PLACEBO
assertEqualsTime(extracted, 13, 18, 2);
}
public void testDefaultDateSerializationUsingBuilder() throws Exception {
Gson gson = new GsonBuilder().create();
Date now = new Date(1315806903103L);
String json = gson.toJson(now);
if (JavaVersion.isJava9OrLater()) {
//ARGO_PLACEBO
assertEquals("\"Sep 11, 2011, 10:55:03 PM\"", json);
} else {
//ARGO_PLACEBO
assertEquals("\"Sep 11, 2011 10:55:03 PM\"", json);
}
}
public void testDefaultDateDeserializationUsingBuilder() throws Exception {
Gson gson = new GsonBuilder().create();
Date now = new Date(1315806903103L);
String json = gson.toJson(now);
Date extracted = gson.fromJson(json, Date.class);
//ARGO_PLACEBO
assertEquals(now.toString(), extracted.toString());
}
public void testDefaultCalendarSerialization() throws Exception {
Gson gson = new GsonBuilder().create();
String json = gson.toJson(Calendar.getInstance());
//ARGO_PLACEBO
assertTrue(json.contains("year"));
//ARGO_PLACEBO
assertTrue(json.contains("month"));
//ARGO_PLACEBO
assertTrue(json.contains("dayOfMonth"));
//ARGO_PLACEBO
assertTrue(json.contains("hourOfDay"));
//ARGO_PLACEBO
assertTrue(json.contains("minute"));
//ARGO_PLACEBO
assertTrue(json.contains("second"));
}
public void testDefaultCalendarDeserialization() throws Exception {
Gson gson = new GsonBuilder().create();
String json = "{year:2009,month:2,dayOfMonth:11,hourOfDay:14,minute:29,second:23}";
Calendar cal = gson.fromJson(json, Calendar.class);
//ARGO_PLACEBO
assertEquals(2009, cal.get(Calendar.YEAR));
//ARGO_PLACEBO
assertEquals(2, cal.get(Calendar.MONTH));
//ARGO_PLACEBO
assertEquals(11, cal.get(Calendar.DAY_OF_MONTH));
//ARGO_PLACEBO
assertEquals(14, cal.get(Calendar.HOUR_OF_DAY));
//ARGO_PLACEBO
assertEquals(29, cal.get(Calendar.MINUTE));
//ARGO_PLACEBO
assertEquals(23, cal.get(Calendar.SECOND));
}
public void testDefaultGregorianCalendarSerialization() throws Exception {
Gson gson = new GsonBuilder().create();
GregorianCalendar cal = new GregorianCalendar();
String json = gson.toJson(cal);
//ARGO_PLACEBO
assertTrue(json.contains("year"));
//ARGO_PLACEBO
assertTrue(json.contains("month"));
//ARGO_PLACEBO
assertTrue(json.contains("dayOfMonth"));
//ARGO_PLACEBO
assertTrue(json.contains("hourOfDay"));
//ARGO_PLACEBO
assertTrue(json.contains("minute"));
//ARGO_PLACEBO
assertTrue(json.contains("second"));
}
public void testDefaultGregorianCalendarDeserialization() throws Exception {
Gson gson = new GsonBuilder().create();
String json = "{year:2009,month:2,dayOfMonth:11,hourOfDay:14,minute:29,second:23}";
GregorianCalendar cal = gson.fromJson(json, GregorianCalendar.class);
//ARGO_PLACEBO
assertEquals(2009, cal.get(Calendar.YEAR));
//ARGO_PLACEBO
assertEquals(2, cal.get(Calendar.MONTH));
//ARGO_PLACEBO
assertEquals(11, cal.get(Calendar.DAY_OF_MONTH));
//ARGO_PLACEBO
assertEquals(14, cal.get(Calendar.HOUR_OF_DAY));
//ARGO_PLACEBO
assertEquals(29, cal.get(Calendar.MINUTE));
//ARGO_PLACEBO
assertEquals(23, cal.get(Calendar.SECOND));
}
public void testDateSerializationWithPattern() throws Exception {
String pattern = "yyyy-MM-dd";
Gson gson = new GsonBuilder().setDateFormat(DateFormat.FULL).setDateFormat(pattern).create();
Date now = new Date(1315806903103L);
String json = gson.toJson(now);
//ARGO_PLACEBO
assertEquals("\"2011-09-11\"", json);
}
@SuppressWarnings("deprecation")
public void testDateDeserializationWithPattern() throws Exception {
String pattern = "yyyy-MM-dd";
Gson gson = new GsonBuilder().setDateFormat(DateFormat.FULL).setDateFormat(pattern).create();
Date now = new Date(1315806903103L);
String json = gson.toJson(now);
Date extracted = gson.fromJson(json, Date.class);
//ARGO_PLACEBO
assertEquals(now.getYear(), extracted.getYear());
//ARGO_PLACEBO
assertEquals(now.getMonth(), extracted.getMonth());
//ARGO_PLACEBO
assertEquals(now.getDay(), extracted.getDay());
}
public void testDateSerializationWithPatternNotOverridenByTypeAdapter() throws Exception {
String pattern = "yyyy-MM-dd";
Gson gson = new GsonBuilder()
.setDateFormat(pattern)
.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
public Date deserialize(JsonElement json, Type typeOfT,
JsonDeserializationContext context)
throws JsonParseException {
return new Date(1315806903103L);
}
})
.create();
Date now = new Date(1315806903103L);
String json = gson.toJson(now);
//ARGO_PLACEBO
assertEquals("\"2011-09-11\"", json);
}
// http://code.google.com/p/google-gson/issues/detail?id=230
public void testDateSerializationInCollection() throws Exception {
Type listOfDates = new TypeToken<List<Date>>() {}.getType();
TimeZone defaultTimeZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
Locale defaultLocale = Locale.getDefault();
Locale.setDefault(Locale.US);
try {
Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
List<Date> dates = Arrays.asList(new Date(0));
String json = gson.toJson(dates, listOfDates);
//ARGO_PLACEBO
assertEquals("[\"1970-01-01\"]", json);
//ARGO_PLACEBO
assertEquals(0L, gson.<List<Date>>fromJson("[\"1970-01-01\"]", listOfDates).get(0).getTime());
} finally {
TimeZone.setDefault(defaultTimeZone);
Locale.setDefault(defaultLocale);
}
}
// http://code.google.com/p/google-gson/issues/detail?id=230
public void testTimestampSerialization() throws Exception {
TimeZone defaultTimeZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
Locale defaultLocale = Locale.getDefault();
Locale.setDefault(Locale.US);
try {
Timestamp timestamp = new Timestamp(0L);
Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
String json = gson.toJson(timestamp, Timestamp.class);
//ARGO_PLACEBO
assertEquals("\"1970-01-01\"", json);
//ARGO_PLACEBO
assertEquals(0, gson.fromJson("\"1970-01-01\"", Timestamp.class).getTime());
} finally {
TimeZone.setDefault(defaultTimeZone);
Locale.setDefault(defaultLocale);
}
}
// http://code.google.com/p/google-gson/issues/detail?id=230
public void testSqlDateSerialization() throws Exception {
TimeZone defaultTimeZone = TimeZone.getDefault();
TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
Locale defaultLocale = Locale.getDefault();
Locale.setDefault(Locale.US);
try {
java.sql.Date sqlDate = new java.sql.Date(0L);
Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd").create();
String json = gson.toJson(sqlDate, Timestamp.class);
//ARGO_PLACEBO
assertEquals("\"1970-01-01\"", json);
//ARGO_PLACEBO
assertEquals(0, gson.fromJson("\"1970-01-01\"", java.sql.Date.class).getTime());
} finally {
TimeZone.setDefault(defaultTimeZone);
Locale.setDefault(defaultLocale);
}
}
public void testJsonPrimitiveSerialization() {
//ARGO_PLACEBO
assertEquals("5", gson.toJson(new JsonPrimitive(5), JsonElement.class));
//ARGO_PLACEBO
assertEquals("true", gson.toJson(new JsonPrimitive(true), JsonElement.class));
//ARGO_PLACEBO
assertEquals("\"foo\"", gson.toJson(new JsonPrimitive("foo"), JsonElement.class));
//ARGO_PLACEBO
assertEquals("\"a\"", gson.toJson(new JsonPrimitive('a'), JsonElement.class));
}
public void testJsonPrimitiveDeserialization() {
//ARGO_PLACEBO
assertEquals(new JsonPrimitive(5), gson.fromJson("5", JsonElement.class));
//ARGO_PLACEBO
assertEquals(new JsonPrimitive(5), gson.fromJson("5", JsonPrimitive.class));
//ARGO_PLACEBO
assertEquals(new JsonPrimitive(true), gson.fromJson("true", JsonElement.class));
//ARGO_PLACEBO
assertEquals(new JsonPrimitive(true), gson.fromJson("true", JsonPrimitive.class));
//ARGO_PLACEBO
assertEquals(new JsonPrimitive("foo"), gson.fromJson("\"foo\"", JsonElement.class));
//ARGO_PLACEBO
assertEquals(new JsonPrimitive("foo"), gson.fromJson("\"foo\"", JsonPrimitive.class));
//ARGO_PLACEBO
assertEquals(new JsonPrimitive('a'), gson.fromJson("\"a\"", JsonElement.class));
//ARGO_PLACEBO
assertEquals(new JsonPrimitive('a'), gson.fromJson("\"a\"", JsonPrimitive.class));
}
public void testJsonNullSerialization() {
//ARGO_PLACEBO
assertEquals("null", gson.toJson(JsonNull.INSTANCE, JsonElement.class));
//ARGO_PLACEBO
assertEquals("null", gson.toJson(JsonNull.INSTANCE, JsonNull.class));
}
public void testNullJsonElementSerialization() {
//ARGO_PLACEBO
assertEquals("null", gson.toJson(null, JsonElement.class));
//ARGO_PLACEBO
assertEquals("null", gson.toJson(null, JsonNull.class));
}
public void testJsonArraySerialization() {
JsonArray array = new JsonArray();
array.add(new JsonPrimitive(1));
array.add(new JsonPrimitive(2));
array.add(new JsonPrimitive(3));
//ARGO_ORIGINAL
assertEquals("[1,2,3]", gson.toJson(array, JsonElement.class));
}
public void testJsonArrayDeserialization() {
JsonArray array = new JsonArray();
array.add(new JsonPrimitive(1));
array.add(new JsonPrimitive(2));
array.add(new JsonPrimitive(3));
String json = "[1,2,3]";
//ARGO_EQUIVALENT
assertEquivalent(array, gson.fromJson(json, JsonElement.class));
//ARGO_EQUIVALENT
assertEquivalent(array, gson.fromJson(json, JsonArray.class));
}
public void testJsonObjectSerialization() {
JsonObject object = new JsonObject();
object.add("foo", new JsonPrimitive(1));
object.add("bar", new JsonPrimitive(2));
//ARGO_EQUIVALENT
assertEquivalent("{\"foo\":1,\"bar\":2}", gson.toJson(object, JsonElement.class), gson);
}
public void testJsonObjectDeserialization() {
JsonObject object = new JsonObject();
object.add("foo", new JsonPrimitive(1));
object.add("bar", new JsonPrimitive(2));
String json = "{\"foo\":1,\"bar\":2}";
JsonElement actual = gson.fromJson(json, JsonElement.class);
//ARGO_EQUIVALENT
assertEquivalent(object, actual);
JsonObject actualObj = gson.fromJson(json, JsonObject.class);
//ARGO_EQUIVALENT
assertEquivalent(object, actualObj);
}
public void testJsonNullDeserialization() {
//ARGO_PLACEBO
assertEquals(JsonNull.INSTANCE, gson.fromJson("null", JsonElement.class));
//ARGO_PLACEBO
assertEquals(JsonNull.INSTANCE, gson.fromJson("null", JsonNull.class));
}
public void testJsonElementTypeMismatch() {
try {
gson.fromJson("\"abc\"", JsonObject.class);
//ARGO_PLACEBO
fail();
} catch (JsonSyntaxException expected) {
assertEquals("Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive",
expected.getMessage());
}
}
private static class ClassWithBigDecimal {
BigDecimal value;
ClassWithBigDecimal(String value) {
this.value = new BigDecimal(value);
}
String getExpectedJson() {
return "{\"value\":" + value.toEngineeringString() + "}";
}
}
private static class ClassWithBigInteger {
BigInteger value;
ClassWithBigInteger(String value) {
this.value = new BigInteger(value);
}
String getExpectedJson() {
return "{\"value\":" + value + "}";
}
}
public void testPropertiesSerialization() {
Properties props = new Properties();
props.setProperty("foo", "bar");
String json = gson.toJson(props);
String expected = "{\"foo\":\"bar\"}";
//ARGO_PLACEBO
assertEquals(expected, json);
}
public void testPropertiesDeserialization() {
String json = "{foo:'bar'}";
Properties props = gson.fromJson(json, Properties.class);
//ARGO_PLACEBO
assertEquals("bar", props.getProperty("foo"));
}
public void testTreeSetSerialization() {
TreeSet<String> treeSet = new TreeSet<String>();
treeSet.add("Value1");
String json = gson.toJson(treeSet);
//ARGO_PLACEBO
assertEquals("[\"Value1\"]", json);
}
public void testTreeSetDeserialization() {
String json = "['Value1']";
Type type = new TypeToken<TreeSet<String>>() {}.getType();
TreeSet<String> treeSet = gson.fromJson(json, type);
//ARGO_PLACEBO
assertTrue(treeSet.contains("Value1"));
}
public void testStringBuilderSerialization() {
StringBuilder sb = new StringBuilder("abc");
String json = gson.toJson(sb);
//ARGO_PLACEBO
assertEquals("\"abc\"", json);
}
public void testStringBuilderDeserialization() {
StringBuilder sb = gson.fromJson("'abc'", StringBuilder.class);
//ARGO_PLACEBO
assertEquals("abc", sb.toString());
}
public void testStringBufferSerialization() {
StringBuffer sb = new StringBuffer("abc");
String json = gson.toJson(sb);
//ARGO_PLACEBO
assertEquals("\"abc\"", json);
}
public void testStringBufferDeserialization() {
StringBuffer sb = gson.fromJson("'abc'", StringBuffer.class);
//ARGO_PLACEBO
assertEquals("abc", sb.toString());
}
@SuppressWarnings("rawtypes")
private static class MyClassTypeAdapter extends TypeAdapter<Class> {
@Override
public void write(JsonWriter out, Class value) throws IOException {
out.value(value.getName());
}
@Override
public Class read(JsonReader in) throws IOException {
String className = in.nextString();
try {
return Class.forName(className);
} catch (ClassNotFoundException e) {
throw new IOException(e);
}
}
}
static class NumberAsStringAdapter extends TypeAdapter<Number> {
private final Constructor<? extends Number> constructor;
NumberAsStringAdapter(Class<? extends Number> type) throws Exception {
this.constructor = type.getConstructor(String.class);
}
@Override public void write(JsonWriter out, Number value) throws IOException {
out.value(value.toString());
}
@Override public Number read(JsonReader in) throws IOException {
try {
return constructor.newInstance(in.nextString());
} catch (Exception e) {
throw new AssertionError(e);
}
}
}
}
| [
"nicolas.harrand@gmail.com"
] | nicolas.harrand@gmail.com |
228e3120cb0954ea37364aa3c185f9cbf2543a50 | 669024559d8065ecf3dd248ebcfb0639712715bb | /src/main/java/com/api/person/dto/request/PersonDTO.java | 030be376ff698e0010086f9b889a006601249f4a | [] | no_license | gabrielsalvi/person-api | 13a5c46266bd6df5b9ad125e2c7d1dbb192f286c | b9f8054294da5db8f3cf7f49bf2cc202a82422b8 | refs/heads/master | 2023-07-28T12:10:47.614240 | 2021-09-04T16:16:29 | 2021-09-04T16:16:29 | 402,241,639 | 0 | 0 | null | 2021-09-03T15:20:09 | 2021-09-02T00:34:21 | Java | UTF-8 | Java | false | false | 790 | java | package com.api.person.dto.request;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.br.CPF;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PersonDTO
{
private Long id;
@NotEmpty
@Size(min = 2, max = 100)
private String firstName;
@NotEmpty
@Size(min = 2, max = 100)
private String lastName;
@NotEmpty
@CPF
private String cpf;
@NotNull
private String birthDate;
@Valid
@NotEmpty
private List<PhoneDTO> phones;
} | [
"gabriel.z.salvi@gmail.com"
] | gabriel.z.salvi@gmail.com |
0ac80a230b647a6662f7c72ee2805f92d3c36d0d | 3f43202f0f3f584e530bfd14b000768d086dece1 | /Microservices/16-service-discovery/item-service/src/main/java/lk/titanium/shoppingcloud/itemservice/ItemServiceApplication.java | 904637bfa613ef50397294fcd43ddfbcfea8dca1 | [] | no_license | TheTechTitan/Krish_SE_training | cad491476dd6efb7cf2cb0be6b214ba77e4bf18a | b2c8ce88bbede0a059ca11e12738ee60cf1daa0c | refs/heads/master | 2023-03-12T07:58:49.624994 | 2021-02-16T12:52:33 | 2021-02-16T12:52:33 | 332,441,903 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 473 | java | package lk.titanium.shoppingcloud.itemservice;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
@SpringBootApplication
@EntityScan(basePackages = "lk.titanium.shoppingcloud.model.item")
public class ItemServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ItemServiceApplication.class, args);
}
}
| [
"telan17@gmail.com"
] | telan17@gmail.com |
4c677f3c3fb77485f695a00da37b7b9a1fcb09e9 | 2714a5ab13ed3e76860cf463f9b8410346610270 | /taco-cloud/src/main/java/com/srikanth/tacos/controller/HomeController.java | 1672208dc977e04341d1f5a03ac7949fa03b163a | [] | no_license | Srikanth9142/taco-cloud | 46280314f375087f1ca8ddeda85d68e211a2b300 | de63017209f7587b4d425a7b49e5cabde7e74c1a | refs/heads/master | 2023-02-03T15:40:11.682546 | 2020-12-11T04:25:11 | 2020-12-11T04:25:11 | 320,464,956 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 273 | java | package com.srikanth.tacos.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class HomeController {
@GetMapping("/")
public String home() {
return "home";
}
}
| [
"srikanthtumpudi1999@gmail.com"
] | srikanthtumpudi1999@gmail.com |
f61b645cd6f3943fd7c471ea904c658da399178a | 63f81a392a80206b4cfed5d19e66d3e582e4bee4 | /iCommerce-Delivery-Service/src/test/java/com/icommerce/nab/deliver/service/controller/DeliverControllerTest.java | 01f5f302830dd2d6cde910477906b5fed8c9ccef | [] | no_license | chuongnguyen1512/iCommerce-NAB | 7e27915b6a59dec0985ba23cfab506c437d089b9 | 7104d7fabdd8e8f26ffdd6084560a64ef66fd3ff | refs/heads/master | 2022-11-08T03:52:28.754288 | 2020-06-27T03:44:26 | 2020-06-27T03:44:26 | 274,323,093 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,251 | java | package com.icommerce.nab.deliver.service.controller;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.icommerce.nab.deliver.service.MockDataUtils;
import com.icommerce.nab.deliver.service.service.DeliverService;
import com.icommerce.nab.dto.builder.RestfulRequestBuilder;
import com.icommerce.nab.dto.builder.RestfulResponseBuilder;
import com.icommerce.nab.dto.dto.OrderDTO;
import com.icommerce.nab.dto.restful.ICommerceRequest;
import com.icommerce.nab.dto.restful.ICommerceResponse;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import java.util.List;
import java.util.UUID;
import static com.icommerce.nab.common.constant.ICommerceConstants.TRANSACTION_ID;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@RunWith(SpringRunner.class)
@SpringBootTest
@AutoConfigureMockMvc
public class DeliverControllerTest {
@Autowired
private MockMvc mockMvc;
@MockBean
private DeliverService deliverService;
private Gson gson;
@Before
public void init() {
gson = new GsonBuilder()
.disableHtmlEscaping()
.setDateFormat("yyyy-MM-dd")
.create();
}
@Test
public void shouldDeliverOrdersSuccessfully() throws Exception {
List<OrderDTO> orderDTO = MockDataUtils.prepareOrderDTOs(1);
ICommerceRequest request = RestfulRequestBuilder.buildICommerceRequest(UUID.randomUUID().toString(), orderDTO);
ICommerceResponse response = RestfulResponseBuilder.buildSuccessResponse(UUID.randomUUID().toString(), orderDTO);
String textResponse = gson.toJson(response, ICommerceResponse.class);
Mockito.when(deliverService.deliverOrders(Mockito.anyString(), Mockito.anyList())).thenReturn(response);
this.mockMvc.perform(
post("/deliverOrders")
.header(TRANSACTION_ID, UUID.randomUUID().toString())
.header(HttpHeaders.AUTHORIZATION, "Basic Y2h1b25nOjEyMw==")
.content(gson.toJson(request))
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andDo(print())
.andExpect(status().isOk())
.andExpect(content().json(textResponse));
Mockito.verify(deliverService, Mockito.times(1)).deliverOrders(Mockito.anyString(), Mockito.anyList());
}
} | [
"chuongnguyen1512@gmail.com"
] | chuongnguyen1512@gmail.com |
1fde134ca5ffe198298b460b8b1f59cc73e0564d | 87b9e59b09ec80eb0acd08fb579aa9a2f1a012b7 | /core/src/main/java/pl/sii/spring/core/xml/HelloWorld.java | df2b84ac930d1ee9ac597ab671ed79ed61636f38 | [] | no_license | klimas7/SiiSpringIIINew | 376c1df1b7cdfcf1c97358d1fde270cdfed81f97 | 522e6615503287dce51ed0957b099a67ed61259c | refs/heads/master | 2022-05-05T04:32:13.230609 | 2019-11-30T14:02:45 | 2019-11-30T14:02:45 | 224,932,092 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 393 | java | package pl.sii.spring.core.xml;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
public class HelloWorld {
private String message;
private String message2;
public void print() {
System.out.println("Your message: " + message + " : " + message2);
}
}
| [
"klimas7@gmail.com"
] | klimas7@gmail.com |
a2b23ae7fa5635edc9b87881178e24c8e3133187 | 0d7e7635dbd730d91544605f88d8fc54d2cd1d58 | /syml/dev_projects/formsappdevv/syml-odoo-middle/src/com/syml/mortgage/application/MortgageForm3Servlet.java | 8a79fb1e1d928f6790b6e10404d037f30b3502f7 | [] | no_license | Manoj-leela/manoj1 | 8febf318c3b592975d416716dc827dcd8873012f | 804b91a20a1280bab6ca185bc348be5e3da24de4 | refs/heads/master | 2021-01-20T20:09:14.386232 | 2016-07-29T06:53:49 | 2016-07-29T06:53:49 | 64,456,932 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 51,042 | java | package com.syml.mortgage.application;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Iterator;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
//import org.apache.catalina.connector.Request;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.syml.addressgroup.pojo.Incomes;
import com.syml.addressgroup.pojo.PropertyGrouping;
import com.syml.constants.SymlConstant;
import com.syml.couchbase.CouchBaseOperation;
import com.syml.helper.GenericHelperClass;
import com.syml.openerp.CreateApplicant;
import com.syml.openerp.CreateLead;
public class MortgageForm3Servlet extends HttpServlet{
@Override
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
Logger log = LoggerFactory.getLogger(MortgageForm3Servlet.class);
SymlConstant sc=new SymlConstant();
HashMap dataStoreValue=new HashMap();
CouchBaseOperation storeData=null;
try{
log.info("inside service method of mortgageFormServlet3");
//String uniId=req.getParameter("unniid");
String formType ="Mortgage Application";
String subForm ="Mortgage Application 3";
String uniid=req.getParameter("uniid");
//get the session attribute
HttpSession ses1=req.getSession(true);
String form1UniqueId1=(String)ses1.getAttribute("form1uniqueId");
String applicantID=(String)ses1.getAttribute("applicantID");
String ip=req.getRemoteAddr();
if(uniid.equals(form1UniqueId1)){
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
//get current date time with Calendar()
Calendar cal = Calendar.getInstance();
String currentDateTime=(dateFormat.format(cal.getTime()));
String property1=req.getParameter("doyou"); //Property1
log.debug(" property 1 : "+property1);
CreateApplicant createLead = new CreateApplicant();
//grouping properties
ArrayList<PropertyGrouping> listOfProperties = new ArrayList<PropertyGrouping>();
// max no. of property set (there total of 6)
PropertyGrouping properti1 = null;
PropertyGrouping properti2 = null;
PropertyGrouping properti3 = null;
PropertyGrouping properti4 = null;
PropertyGrouping properti5 = null;
PropertyGrouping properti6 = null;
dataStoreValue.put("Applicant-doYouHaveProperty",property1);
//if proprty1 i.e do you own any real state is true
if(property1 != null && property1.equalsIgnoreCase("yes")){
log.debug("1. do you own real estate? -> yes");
String address1=req.getParameter("whatis135"); // address1
String mortgageYesNo1=req.getParameter("doesthe"); //mortgageYesNo1
String rentalYesNo1=req.getParameter("doyou160"); //rentalYesNo1
String condoYesNo1=req.getParameter("doesthe161"); //condoYesNo1
String condoFees1=req.getParameter("howmuch"); //condoFees1
String sellingYesNo1=req.getParameter("areyou155"); //sellingYesNo1
String additionalYesNo1=req.getParameter("doyou137"); // additionalYesNo1
log.debug("old unique id is "+uniid);
//showing all valuses :
log.debug("address1 : "+address1+", mortgageYesNo1 : "+mortgageYesNo1+", rentalYesNo1 : "
+rentalYesNo1+", condoYesNo1 : "+condoYesNo1+", condofee1 : "+condoFees1+", sellingYesNo1 : "
+sellingYesNo1+", additionalYesNo1 : "+additionalYesNo1);
dataStoreValue.put("Applicant-address1",address1);
dataStoreValue.put("Applicant-mortgageYesNo1",mortgageYesNo1);
dataStoreValue.put("Applicant-additionalYesNo1",additionalYesNo1);
dataStoreValue.put("Applicant-sellingYesNo1",sellingYesNo1);
dataStoreValue.put("Applicant-condoYesNo1",condoYesNo1);
dataStoreValue.put("Applicant-condoFees1",condoFees1);
dataStoreValue.put("Applicant-rentalYesNo1",rentalYesNo1);
if(additionalYesNo1.equalsIgnoreCase("no")){
properti1 = new PropertyGrouping(address1,mortgageYesNo1,rentalYesNo1,condoYesNo1,condoFees1,sellingYesNo1,additionalYesNo1);
listOfProperties.add(properti1);
if(mortgageYesNo1 != null && mortgageYesNo1.equalsIgnoreCase("yes") && sellingYesNo1 != null && sellingYesNo1.equalsIgnoreCase("yes")){
log.debug("both mortgagae and selling set to yes");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address1, propertyconter, sellingYesNo1);
log.debug("Going to CouchBAse");
if(condoYesNo1 != null && condoYesNo1.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address1, condoFees1,propertyconter,sellingYesNo1);
//logDebug
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address1, "-1",propertyconter,sellingYesNo1);
}
}else if(mortgageYesNo1 != null && mortgageYesNo1.equalsIgnoreCase("yes") && sellingYesNo1 != null && sellingYesNo1.equalsIgnoreCase("no")){
log.debug("when mortgage is true and selling is false");
int propertyconter=GenericHelperClass.getPropertyCounter();
if(rentalYesNo1 !=null && rentalYesNo1.equalsIgnoreCase("no")){
log.debug("rental value is : "+rentalYesNo1);
createLead.createApplicantMortgage(applicantID, address1,propertyconter, sellingYesNo1);
log.debug("CouchBase");
if(condoYesNo1 != null && condoYesNo1.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address1, condoFees1,propertyconter,sellingYesNo1);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address1, "-1",propertyconter,sellingYesNo1);
log.debug("CouchBase");
}
}else{
log.debug("rental value is : "+rentalYesNo1);
int propertyconter1=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter1);
createLead.createApplicantMortgageRental(applicantID, address1,propertyconter1, sellingYesNo1,"1");
//
createLead.createIncomeApplicantRental(applicantID,9,address1,"Landlord","12",false,true,propertyconter1);
if(condoYesNo1 != null && condoYesNo1.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address1, condoFees1,propertyconter1,sellingYesNo1);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address1, "-1",propertyconter1,sellingYesNo1);
}
}// rentalyesno1 if else end
}else if(mortgageYesNo1 != null && mortgageYesNo1.equalsIgnoreCase("no") && sellingYesNo1 != null && sellingYesNo1.equalsIgnoreCase("yes")){
log.debug("when mortgage is no and selling is true");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address1,propertyconter, sellingYesNo1);
if(condoYesNo1 != null && condoYesNo1.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address1, condoFees1,propertyconter,sellingYesNo1);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address1, "-1",propertyconter,sellingYesNo1);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("when mortgage is no and selling is false");
if(rentalYesNo1 != null && rentalYesNo1.equalsIgnoreCase("no")){
createLead.createApplicantMortgage(applicantID, address1,propertyconter, sellingYesNo1);
if(condoYesNo1 != null && condoYesNo1.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address1, condoFees1,propertyconter,sellingYesNo1);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address1, "-1",propertyconter,sellingYesNo1);
}
}else{
int propertyconter11=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter11);
createLead.createApplicantMortgageRental(applicantID, address1,propertyconter11, sellingYesNo1,"1");
log.debug("calling income for rental");
createLead.createIncomeApplicantRental(applicantID,9,address1,"Landlord","12",false,true ,propertyconter11);
if(condoYesNo1 != null && condoYesNo1.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address1, condoFees1,propertyconter11,sellingYesNo1);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address1, "-1",propertyconter11,sellingYesNo1);
}
}//end of if else rentalyesno1
}//end of else (mortgage and seeling logic
//TODO couchbase operation
}else {
log.debug("2. do you own aditional property? -> yes");
String address2=req.getParameter("whatis138");//address2
String mortgageYesNo2=req.getParameter("doesthe139");//mortgageYesNo2
String rentalYesNo2=req.getParameter("doyou163");//rentalYesNo2
String condoYesNo2=req.getParameter("doesthe164");//condoYesNo2
String condoFees2=req.getParameter("howmuch165");//condoFees2
String sellingYesNo2=req.getParameter("areyou");//sellingYesNo2
String additionalYesNo2=req.getParameter("doyou140"); // additionalYesNo2
if(additionalYesNo2 !=null && additionalYesNo2.equalsIgnoreCase("no")){
properti1 = new PropertyGrouping(address1,mortgageYesNo1,rentalYesNo1,condoYesNo1,condoFees1,sellingYesNo1,additionalYesNo1);
properti2 = new PropertyGrouping(address2,mortgageYesNo2,rentalYesNo2,condoYesNo2,condoFees2,sellingYesNo2,additionalYesNo2);
listOfProperties.add(properti1);
listOfProperties.add(properti2);
Iterator iterate = listOfProperties.iterator();
int i=1;
while(iterate.hasNext()){
log.debug("inside while loop with 2 values");
PropertyGrouping property = (PropertyGrouping)iterate.next();
// getting all properties stored in property Group
String address = property.getAddress();
String mortgageYesNo = property.getMortgageYesNo();
String rentalYesNo = property.getRentalYesNo();
String condoYesNo = property.getCondoYesNo();
String condofee = property.getCondoFees();
String sellingYesNo = property.getSellingYesNo();
dataStoreValue.put("Applicant-address"+i,address);
dataStoreValue.put("Applicant-mortgageYesNo"+i,mortgageYesNo);
dataStoreValue.put("Applicant-sellingYesNo"+i,sellingYesNo);
dataStoreValue.put("Applicant-condoYesNo"+i,condoYesNo);
dataStoreValue.put("Applicant-condoFees"+i,condofee);
dataStoreValue.put("Applicant-rentalYesNo"+i,rentalYesNo);
//showing all valuses :
log.debug("address : "+address+", mortgageYesNo : "+mortgageYesNo+", rentalYesNo : "
+rentalYesNo+", condoYesNo : "+condoYesNo+", condofee : "+condofee+", sellingYesNo : "+sellingYesNo);
//now mortgage and selling logic
if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("both mortgagae and selling set to yes");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address, propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("no")){
log.debug("when mortgage is true and selling is false");
if(rentalYesNo2 != null && rentalYesNo2.equalsIgnoreCase("no")){
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("rentalyesno2 value : "+rentalYesNo2);
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
log.debug("CouchBase");
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
log.debug("rentalyesno2 value : "+rentalYesNo2);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter, sellingYesNo,"1");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9,address,"Landlord","12",false,true,propertyconter );
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
log.debug("CouchBase");
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}//rentayesNo2 if else end
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("no") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("when mortgage is no and selling is true");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
log.debug("when mortgage is no and selling is false");
int propertyconter=GenericHelperClass.getPropertyCounter();
if(rentalYesNo2.equalsIgnoreCase("no") && rentalYesNo2 != null){
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo1);
log.debug("CouchBase");
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter2=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter2);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter2, sellingYesNo1,"1");
log.debug("CouchBase");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9,address,"Landlord","12",false,true,propertyconter2);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter2,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter2,sellingYesNo);
}
}//end of if else rentalyesno2
}//end of else (mortgage and selling logic)
//TODO couchbase operation
i=i+1;
}// end of while
}else{
log.debug("3. do you own additional properties? --> yes");
String address3=req.getParameter("whatis141");//address3
String mortgageYesNo3=req.getParameter("doesthe142");//mortgageYesNo3
String rentalYesNo3=req.getParameter("doyou166");//rentalYesNo3
String condoYesNo3=req.getParameter("doesthe167");//condoYesNo3
String condoFees3=req.getParameter("howmuch168");//condoFees3
String sellingYesNo3=req.getParameter("areyou156");//sellingYesNo3
String additionalYesNo3=req.getParameter("doyou143"); // additionalYesNo3
if(additionalYesNo3 !=null && additionalYesNo3.equalsIgnoreCase("no")){
properti1 = new PropertyGrouping(address1,mortgageYesNo1,rentalYesNo1,condoYesNo1,condoFees1,sellingYesNo1,additionalYesNo1);
properti2 = new PropertyGrouping(address2,mortgageYesNo2,rentalYesNo2,condoYesNo2,condoFees2,sellingYesNo2,additionalYesNo2);
properti3 = new PropertyGrouping(address3,mortgageYesNo3,rentalYesNo3,condoYesNo3,condoFees3,sellingYesNo3,additionalYesNo3);
listOfProperties.add(properti1);
listOfProperties.add(properti2);
listOfProperties.add(properti3);
Iterator iterate = listOfProperties.iterator();
int i=1;
while(iterate.hasNext()){
log.debug("inside while loop with 3 values");
PropertyGrouping property = (PropertyGrouping)iterate.next();
// getting all properties stored in property Group
String address = property.getAddress();
String mortgageYesNo = property.getMortgageYesNo();
String rentalYesNo = property.getRentalYesNo();
String condoYesNo = property.getCondoYesNo();
String condofee = property.getCondoFees();
String sellingYesNo = property.getSellingYesNo();
dataStoreValue.put("Applicant-address"+i,address);
dataStoreValue.put("Applicant-mortgageYesNo"+i,mortgageYesNo);
dataStoreValue.put("Applicant-sellingYesNo"+i,sellingYesNo);
dataStoreValue.put("Applicant-condoYesNo"+i,condoYesNo);
dataStoreValue.put("Applicant-condoFees"+i,condofee);
dataStoreValue.put("Applicant-rentalYesNo"+i,rentalYesNo);
//showing all valuses :
log.debug("address : "+address+", mortgageYesNo : "+mortgageYesNo+", rentalYesNo : "
+rentalYesNo+", condoYesNo : "+condoYesNo+", condofee : "+condofee+", sellingYesNo : "+sellingYesNo);
//now mortgage and selling logic
if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("both mortgagae and selling set to yes");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address, propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("no")){
log.debug("when mortgage is true and selling is false");
if(rentalYesNo3.equalsIgnoreCase("no") && rentalYesNo3 != null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
log.debug("CouchBase");
if(condoYesNo != null && condoYesNo1.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter, sellingYesNo,"1");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID, 9, address3, "Landlord","12", false, true,propertyconter);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("no") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("when mortgage is no and selling is true");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
log.debug("when mortgage is no and selling is false");
if(rentalYesNo3.equalsIgnoreCase("no") && rentalYesNo3 != null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo1);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo1);
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID, 9, address3, "Landlord","12",false,true,propertyconter);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}
}//end of else (mortgage and selling logic)
//TODO couchbase operation
i=i+1;
}// end of while
}else{
log.debug("4. do you own additional properties? --> yes");
String address4=req.getParameter("whatis144");//address4
String mortgageYesNo4=req.getParameter("doesthe145");//mortgageYesNo4
String rentalYesNo4=req.getParameter("doyou169");//rentalYesNo4
String condoYesNo4=req.getParameter("doesthe170");//condoYesNo4
String condoFees4=req.getParameter("howmuch171");//condoFees4
String sellingYesNo4=req.getParameter("areyou157");//sellingYesNo4
String additionalYesNo4=req.getParameter("doyou146"); // additionalYesNo4
if(additionalYesNo4 !=null && additionalYesNo4.equalsIgnoreCase("no")){
properti1 = new PropertyGrouping(address1,mortgageYesNo1,rentalYesNo1,condoYesNo1,condoFees1,sellingYesNo1,additionalYesNo1);
properti2 = new PropertyGrouping(address2,mortgageYesNo2,rentalYesNo2,condoYesNo2,condoFees2,sellingYesNo2,additionalYesNo2);
properti3 = new PropertyGrouping(address3,mortgageYesNo3,rentalYesNo3,condoYesNo3,condoFees3,sellingYesNo3,additionalYesNo3);
properti4 = new PropertyGrouping(address4,mortgageYesNo4,rentalYesNo4,condoYesNo4,condoFees4,sellingYesNo4,additionalYesNo4);
listOfProperties.add(properti1);
listOfProperties.add(properti2);
listOfProperties.add(properti3);
listOfProperties.add(properti4);
Iterator iterate = listOfProperties.iterator();
int i=1;
while(iterate.hasNext()){
log.debug("inside while loop with 4 values");
PropertyGrouping property = (PropertyGrouping)iterate.next();
// getting all properties stored in property Group
String address = property.getAddress();
String mortgageYesNo = property.getMortgageYesNo();
String rentalYesNo = property.getRentalYesNo();
String condoYesNo = property.getCondoYesNo();
String condofee = property.getCondoFees();
String sellingYesNo = property.getSellingYesNo();
dataStoreValue.put("Applicant-address"+i,address);
dataStoreValue.put("Applicant-mortgageYesNo"+i,mortgageYesNo);
dataStoreValue.put("Applicant-sellingYesNo"+i,sellingYesNo);
dataStoreValue.put("Applicant-condoYesNo"+i,condoYesNo);
dataStoreValue.put("Applicant-condoFees"+i,condofee);
dataStoreValue.put("Applicant-rentalYesNo"+i,rentalYesNo);
//showing all valuses :
log.debug("address : "+address+", mortgageYesNo : "+mortgageYesNo+", rentalYesNo : "
+rentalYesNo+", condoYesNo : "+condoYesNo+", condofee : "+condofee+", sellingYesNo : "+sellingYesNo);
//now mortgage and selling logic
if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("both mortgagae and selling set to yes");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address, propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("no")){
log.debug("when mortgage is true and selling is false");
//TODO add rental logic here, be careful
if(rentalYesNo4.equalsIgnoreCase("no") && rentalYesNo4!=null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
log.debug("inside Rental Logic 4");
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgageRental(applicantID,address,propertyconter, sellingYesNo, "1");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9, address, "Landlord", "12", false,true,propertyconter);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("no") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("when mortgage is no and selling is true");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
log.debug("when mortgage is no and selling is false");
//please add rental4 logic here
if(rentalYesNo4.equalsIgnoreCase("no") && rentalYesNo4!=null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo1);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter, sellingYesNo, "1");
log.debug("Logic for Rental Else block");
log.debug("CouchBase");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9,address,"Landlord","12",false,true,propertyconter );
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}
}//end of else (mortgage and selling logic)
//TODO couchbase operation
i=i+1;
}// end of while
}else{
log.debug("5. do you own additional properties? --> yes");
String address5=req.getParameter("whatis147");//address5
String mortgageYesNo5=req.getParameter("doesthe148");//mortgageYesNo5
String rentalYesNo5=req.getParameter("doyou172");//rentalYesNo5
String condoYesNo5=req.getParameter("doesthe173");//condoYesNo5
String condoFees5=req.getParameter("howmuch174");//condoFees5
String sellingYesNo5=req.getParameter("areyou158");//sellingYesNo5
String additionalYesNo5=req.getParameter("doyou149"); // additionalYesNo5
if(additionalYesNo5 !=null && additionalYesNo5.equalsIgnoreCase("no")){
properti1 = new PropertyGrouping(address1,mortgageYesNo1,rentalYesNo1,condoYesNo1,condoFees1,sellingYesNo1,additionalYesNo1);
properti2 = new PropertyGrouping(address2,mortgageYesNo2,rentalYesNo2,condoYesNo2,condoFees2,sellingYesNo2,additionalYesNo2);
properti3 = new PropertyGrouping(address3,mortgageYesNo3,rentalYesNo3,condoYesNo3,condoFees3,sellingYesNo3,additionalYesNo3);
properti4 = new PropertyGrouping(address4,mortgageYesNo4,rentalYesNo4,condoYesNo4,condoFees4,sellingYesNo4,additionalYesNo4);
properti5 = new PropertyGrouping(address5,mortgageYesNo5,rentalYesNo5,condoYesNo5,condoFees5,sellingYesNo5,additionalYesNo5);
listOfProperties.add(properti1);
listOfProperties.add(properti2);
listOfProperties.add(properti3);
listOfProperties.add(properti4);
listOfProperties.add(properti5);
Iterator iterate = listOfProperties.iterator();
int i=1;
while(iterate.hasNext()){
log.debug("inside while loop with 5 values");
PropertyGrouping property = (PropertyGrouping)iterate.next();
// getting all properties stored in property Group
String address = property.getAddress();
String mortgageYesNo = property.getMortgageYesNo();
String rentalYesNo = property.getRentalYesNo();
String condoYesNo = property.getCondoYesNo();
String condofee = property.getCondoFees();
String sellingYesNo = property.getSellingYesNo();
dataStoreValue.put("Applicant-address"+i,address);
dataStoreValue.put("Applicant-mortgageYesNo"+i,mortgageYesNo);
dataStoreValue.put("Applicant-sellingYesNo"+i,sellingYesNo);
dataStoreValue.put("Applicant-condoYesNo"+i,condoYesNo);
dataStoreValue.put("Applicant-condoFees"+i,condofee);
dataStoreValue.put("Applicant-rentalYesNo"+i,rentalYesNo);
//showing all valuses :
log.debug("address : "+address+", mortgageYesNo : "+mortgageYesNo+", rentalYesNo : "
+rentalYesNo+", condoYesNo : "+condoYesNo+", condofee : "+condofee+", sellingYesNo : "+sellingYesNo);
//now mortgage and selling logic
if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("both mortgagae and selling set to yes");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address, propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("no")){
log.debug("when mortgage is true and selling is false");
//TODO rental 5 logic here
if(rentalYesNo5.equalsIgnoreCase("no") && rentalYesNo5!=null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter, sellingYesNo1,"1");
log.debug("CouchBase");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9,address,"Landlord","12",false,true,propertyconter);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("no") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("when mortgage is no and selling is true");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
log.debug("when mortgage is no and selling is false");
//TODO renatal 5 logic here
if(rentalYesNo5.equalsIgnoreCase("no") && rentalYesNo5!=null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo1);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter, sellingYesNo1,"1");
log.debug("CouchBase");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9,address,"Landlord","12",false,true ,propertyconter);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}//end of loop 5 Rental
}//end of else (mortgage and selling logic)
//TODO couchbase operation
}// end of while
}else {
log.debug("6. do you own additional properties? --> yes");
String address6=req.getParameter("whatis150");//address6
String mortgageYesNo6=req.getParameter("doesthe151");//mortgageYesNo6
String rentalYesNo6=req.getParameter("doyou175");//rentalYesNo6
String condoYesNo6=req.getParameter("doesthe176");//condoYesNo6
String condoFees6=req.getParameter("howmuch177");//condoFees6
String sellingYesNo6=req.getParameter("areyou159");//sellingYesNo6
properti1 = new PropertyGrouping(address1,mortgageYesNo1,rentalYesNo1,condoYesNo1,condoFees1,sellingYesNo1,additionalYesNo1);
properti2 = new PropertyGrouping(address2,mortgageYesNo2,rentalYesNo2,condoYesNo2,condoFees2,sellingYesNo2,additionalYesNo2);
properti3 = new PropertyGrouping(address3,mortgageYesNo3,rentalYesNo3,condoYesNo3,condoFees3,sellingYesNo3,additionalYesNo3);
properti4 = new PropertyGrouping(address4,mortgageYesNo4,rentalYesNo4,condoYesNo4,condoFees4,sellingYesNo4,additionalYesNo4);
properti5 = new PropertyGrouping(address5,mortgageYesNo5,rentalYesNo5,condoYesNo5,condoFees5,sellingYesNo5,additionalYesNo5);
properti6 = new PropertyGrouping(address6,mortgageYesNo6,rentalYesNo6,condoYesNo6,condoFees6,sellingYesNo6);
listOfProperties.add(properti1);
listOfProperties.add(properti2);
listOfProperties.add(properti3);
listOfProperties.add(properti4);
listOfProperties.add(properti5);
listOfProperties.add(properti6);
Iterator iterate = listOfProperties.iterator();
int i=1;
while(iterate.hasNext()){
log.debug("inside while loop with 6 values");
PropertyGrouping property = (PropertyGrouping)iterate.next();
// getting all properties stored in property Group
String address = property.getAddress();
String mortgageYesNo = property.getMortgageYesNo();
String rentalYesNo = property.getRentalYesNo();
String condoYesNo = property.getCondoYesNo();
String condofee = property.getCondoFees();
String sellingYesNo = property.getSellingYesNo();
dataStoreValue.put("Applicant-address"+i,address);
dataStoreValue.put("Applicant-mortgageYesNo"+i,mortgageYesNo);
dataStoreValue.put("Applicant-sellingYesNo"+i,sellingYesNo);
dataStoreValue.put("Applicant-condoYesNo"+i,condoYesNo);
dataStoreValue.put("Applicant-condoFees"+i,condofee);
dataStoreValue.put("Applicant-rentalYesNo"+i,rentalYesNo);
//showing all valuses :
log.debug("address : "+address+", mortgageYesNo : "+mortgageYesNo+", rentalYesNo : "
+rentalYesNo+", condoYesNo : "+condoYesNo+", condofee : "+condofee+", sellingYesNo : "+sellingYesNo);
//now mortgage and selling logic
if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("both mortgagae and selling set to yes");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address, propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("yes") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("no")){
log.debug("when mortgage is true and selling is false");
//TODO rental 5 logic here
if(rentalYesNo6.equalsIgnoreCase("no") && rentalYesNo6!=null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
log.debug("CouchBase");
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter, sellingYesNo1,"1");
log.debug("CouchBase");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9,address,"Landlord","12",false,true ,propertyconter);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}
}else if(mortgageYesNo != null && mortgageYesNo.equalsIgnoreCase("no") && sellingYesNo != null && sellingYesNo.equalsIgnoreCase("yes")){
log.debug("when mortgage is no and selling is true");
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condofee,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
log.debug("when mortgage is no and selling is false");
//TODO renatal 5 logic here
if(rentalYesNo6.equalsIgnoreCase("no") && rentalYesNo6!=null){
int propertyconter=GenericHelperClass.getPropertyCounter();
createLead.createApplicantMortgage(applicantID, address,propertyconter, sellingYesNo1);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}else{
int propertyconter=GenericHelperClass.getPropertyCounter();
log.debug("propertycounet value if rental is yes nad selling is no : "+propertyconter);
createLead.createApplicantMortgageRental(applicantID, address,propertyconter, sellingYesNo1,"1");
log.debug("CouchBase");
log.debug("calling rental income");
createLead.createIncomeApplicantRental(applicantID,9,address,"Landlord","12",false,true ,propertyconter);
if(condoYesNo != null && condoYesNo.equalsIgnoreCase("yes")){
log.debug("condo values set to yes");
createLead.createApplicantProperties(applicantID, address, condoFees1,propertyconter,sellingYesNo);
}else{
log.debug("condo values set to no");
createLead.createApplicantProperties(applicantID, address, "-1",propertyconter,sellingYesNo);
}
}//end of loop 6 Rental
}//end of else (mortgage and selling logic)
//TODO couchbase operation
i=i+1;
}// end of while
}//6. you own additional properties ? -->
}//5. do you own additional properties? --> yes
}//4. do you own additional properties? --> yes
}//3. do you own additional properties? --> yes
}//2. do you own additional properties? --> yes
}//1. do you own additional properties?--> yes
CouchBaseOperation appendData=new CouchBaseOperation();
dataStoreValue.put("Applicant-subForm-3", subForm);
appendData.appendDataInCouchBase("Applicant_"+applicantID, dataStoreValue);
req.setAttribute("uniid",uniid);
//req.setAttribute("applicantId",applicantId);
req.getRequestDispatcher("MortgageApplication4.jsp").include(req, res);
//res.sendRedirect("http://form.jotformpro.com/form/50265051738958?unniid="+form1UniqueId1+"&applicantId="+applicantID);
}else{
req.setAttribute("message", " We are sorry, but it seems the security and reliability of your internet connection may have been weakened. To protect your identity and the security of your information, can you please submit this application again");
req.getRequestDispatcher("MortgageApplicationSucess.jsp").forward(req, res);
}
}catch(Exception e){
log.error("error in service : "+e);
}
}
} | [
"abhishek.kumar@bizruntime.com"
] | abhishek.kumar@bizruntime.com |
3836d169c21a8c6aac0db0ae0476b8b3b94ef8d7 | 3fe2578f719f5758a70d42dc06f29a739578db5f | /thread/src/club/banyaun/countfori/Demo7.java | 2be410862d441495552d4ee666e66b7d161b6889 | [] | no_license | foreverym/studydemo | e4a18c86a9c64481f22329e176c1f91504a83ace | 7d4d61ebf0bd802965e0ea006873c0d42aeab9bd | refs/heads/master | 2022-12-31T02:18:16.030448 | 2020-10-23T07:03:21 | 2020-10-23T07:03:21 | 297,961,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,726 | java | package club.banyaun.countfori;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
/**
* 有四个线程,其中A,B线程对i加1操作,C,D线程每次对i减1操作
*
* C D D-- C--
*
* A B A++ B++
*
* 而不是这样:
* A++ D-- C-- B++
* D-- B++ A++ C--
*/
public class Demo7 implements Runnable {
//为了解决高并发的问题 CountDownLatch 类似于一个线程计数器 使一个线程或者多个线程完成各自的工作然后再继续执行
CountDownLatch countDownLatch=new CountDownLatch(2);// 2表示有两个线程计数器
private int i;
private String threadName;
private static Thread next;
private static final Object lock = new Object();
public Demo7(int i, String threadName) {
this.i = i;
this.threadName = threadName;
}
public int getI() {
return i;
}
public void setI(int i) {
this.i = i;
}
public String getThreadName() {
return threadName;
}
public void setThreadName(String threadName) {
this.threadName = threadName;
}
@Override
public void run() {
synchronized (lock) {
if (Thread.currentThread().getName().equals("A") || Thread.currentThread().getName().equals("B")) {
try {
lock.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
if (Thread.currentThread().getName().equals("C") || Thread.currentThread().getName().equals("D")) {
}
i++;
}
}
}
}
| [
"1132454270@qq.com"
] | 1132454270@qq.com |
75c3a0f8896e41d010d95e27a7a97758bbdbf974 | a43c4c07c61af15a1e77e3ccdb7edafb679d405a | /Simple Search Engine/task/src/search/ISearchMethod.java | b2a5ff1af83ff77dfe2e7decbfc0239927128886 | [] | no_license | MartijntenCaat/Simple_Search_Engine | cb80e614cbbe5df89f446d805943e2d8b33fc130 | 5536d453952d5d4b0f5cfc1e5f3b2209c5aa51b9 | refs/heads/master | 2023-03-25T20:50:39.297938 | 2021-03-19T15:06:06 | 2021-03-19T15:06:06 | 258,101,311 | 0 | 0 | null | 2020-04-24T04:33:22 | 2020-04-23T05:15:59 | Java | UTF-8 | Java | false | false | 511 | java | package search;
import java.util.ArrayList;
/**
* Interface for implementation of n search algorithms.
*/
public interface ISearchMethod {
/**
* Method to be implemented in every subclass of a different search algorithm
*
* @param queryParts incoming query split up in parts to be searched for
* @param searchIndex the total index to be searched in
* @return results of the search in a list
*/
ArrayList<String> search(String[] queryParts, SearchIndex searchIndex);
} | [
"martijn.tencaat@edsn.nl"
] | martijn.tencaat@edsn.nl |
0ae06db023e46a1eb47d42ccf188b345b74d5500 | 6e30c5b230dfefdcd029c00729b550973f915428 | /Projeto/ProjetoDistribuidora-master/distribuidora/src/main/java/br/com/distribuidora/service/ProdutoService.java | 28779973429e0834e2cbf352408a6922f7b87f4e | [] | no_license | GabrielTertulino/Projeto-completo-Swagger | 9e6b5e66e44b1e033f0ff5e45ef2e5f86cdb4b5a | 1f6f96445cd1855084760cb1831c92bee2ca07e6 | refs/heads/main | 2023-01-23T21:40:18.451107 | 2020-12-09T22:25:35 | 2020-12-09T22:25:35 | 320,094,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 373 | java | /**
*
*/
package br.com.distribuidora.service;
import java.util.List;
import br.com.distribuidora.model.Produto;
/**
* @author Gabriel Tertulino
*
*/
public interface ProdutoService {
Produto salvar(Produto produto);
List<Produto> listarProduto();
void removerProduto(Produto produto);
void removerPorId(int idProduto);
Produto buscarPorId(int idProduto);
} | [
"noreply@github.com"
] | GabrielTertulino.noreply@github.com |
fd98b754900615a8e09bce5ff31a8b3c814b7d02 | f145e05f3f8c2f59d1e81da9f9a7189157f5bc56 | /src/main/java/net/k40s/DatabaseHandler.java | 8c5121ce21ae6f3871aa2a995ad4f6b841622c7e | [] | no_license | lfuelling/music | d2625216bee2295cf96ada713f75c04ae981132f | 119777b788c5c5d010df29202eaa4b84a4732760 | refs/heads/master | 2020-04-05T22:53:29.273379 | 2015-02-06T07:03:21 | 2015-02-06T07:03:21 | 28,870,144 | 0 | 1 | null | 2015-02-06T07:03:21 | 2015-01-06T15:46:45 | Java | UTF-8 | Java | false | false | 1,341 | java | package net.k40s;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
public class DatabaseHandler {
private Connection connect = null;
private String dbUsername = Storage.getDbUsername();
private String dbPassword = Storage.getDbPassword();
private String dbName = Storage.getDbName();
private String connectionURI = "jdbc:mysql://localhost/" + dbName + "?" + "user=" + dbUsername + "&password=" + dbPassword;
public ResultSet executeQuery(String query) throws Exception {
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager
.getConnection(connectionURI);
Statement statement = connect.createStatement();
ResultSet resultSet = statement.executeQuery(query);
return resultSet;
}
public void executeStatement(String statement) throws SQLException, ClassNotFoundException {
// This will load the MySQL driver, each DB has its own driver
Class.forName("com.mysql.jdbc.Driver");
connect = DriverManager.getConnection(connectionURI);
PreparedStatement preparedStmt = connect.prepareStatement(statement);
preparedStmt.execute();
connect.close();
}
} | [
"lukas@k40s.net"
] | lukas@k40s.net |
f00f3d3ff271d7f6f80cdbaba8f4945229355f2d | 920a6cd8bd5fb097620660251a7dc5ab6f5570ff | /singleLinkedList/Main.java | e86b82984a96cccb73b779c69bc40fb375cc04ed | [] | no_license | Sirusho/tasks | ccd3a5ae6365eb91f83db64dc6a55beb01b3614c | 182c8d7849210cb9fca14be31579bf916adce2fc | refs/heads/master | 2023-06-02T17:28:41.734742 | 2021-06-24T14:45:20 | 2021-06-24T14:45:20 | 363,864,743 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 49 | java | package singleLinkedList;
public class Main {
}
| [
"sirushokamavosyan@gmail.com"
] | sirushokamavosyan@gmail.com |
08176a23b2fcf018b9ba9ba5f2537e7ec21cf216 | 933831b0ef0a7aac315e9c4ececc7d44e4946deb | /Mock_Questions/src/practice/Demo.java | 65a8f1a041010be58294f705117a980d97ea8109 | [] | no_license | vikramvino1995/MyProjects | 7d9fdb86f2e0a309e4db4a2dcb74ea52a29391ba | bc41e86c13fd065dbfcff0ffc48ef3c7225e1fe3 | refs/heads/main | 2023-08-14T14:37:36.643348 | 2021-08-30T14:50:22 | 2021-08-30T14:50:22 | 401,375,502 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 104 | java | package practice;
public class Demo {
public void eat() {
System.out.println("Ok");
}
}
| [
"80097336+vikramvino1995@users.noreply.github.com"
] | 80097336+vikramvino1995@users.noreply.github.com |
c5d196472da015c63cec8104806d7aace61f4234 | c63ae41f7381bf753af04e5150939f28a1e0d0bc | /week7-week7_03.Calculator/src/Reader.java | f8042f6a3343b79603df9976430c5f9281604684 | [] | no_license | swifferwarrior/mooc-2013-OOProgrammingWithJava-PART2 | eef8f03dc6491a45bf9aa8fe76da04f42142277c | 6a596dacd171f5ad5d40a6cd23decae6c6bb35ad | refs/heads/master | 2020-05-19T05:44:28.979801 | 2019-10-14T02:08:00 | 2019-10-14T02:08:00 | 184,855,604 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 564 | java | import java.util.Scanner;
public class Reader {
private Scanner reader = new Scanner(System.in);
public Reader(){
Scanner reader = new Scanner(System.in);
}
public String readString(){
return reader.nextLine();
}
public int readInteger(){
return Integer.parseInt(reader.nextLine());
}
}
/* POST*SUBMIT NOTES */
/*
1. INITIALIZING VARIABLES IN THE METHODS
In this case, both readString and readInteger don't need a variable to
store the info. Just return what is given.
*/ | [
"kdhailey21@gmail.com"
] | kdhailey21@gmail.com |
056da7ab26bbb78f24b5ccef3687cafe963b2b04 | 033342d634ecda26bee9e7240012e36758f2afa9 | /app/src/main/java/com/amasaemi/javashikiapp/modules/base/ui/fragments/BaseFragment.java | f46b060f33d2649a170e24abd740a1187bb23268 | [] | no_license | nionoku/JavaShikiApp | 13b0c45f326b7ce42a3af35a97435882800966cc | 1ad18961c6e7f1c09ed032a5ac19df43f2d7a7c0 | refs/heads/master | 2021-04-15T13:27:11.930732 | 2018-04-21T11:23:17 | 2018-04-21T11:23:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,261 | java | package com.amasaemi.javashikiapp.modules.base.ui.fragments;
import com.amasaemi.javashikiapp.modules.base.mvp.views.ShikiView;
import com.amasaemi.javashikiapp.modules.base.ui.activities.BaseActivity;
import com.arellomobile.mvp.MvpAppCompatFragment;
import com.arellomobile.mvp.MvpFragment;
/**
* Created by Alex on 31.01.2018.
*/
public abstract class BaseFragment extends MvpAppCompatFragment implements ShikiView {
// фрагмент запущен впервые
protected boolean mFragmentIsFirstRun = true;
protected int getOrientation() {
return getResources().getConfiguration().orientation;
}
protected double getScreenSize() {
return Math.sqrt(Math.pow((getResources().getDisplayMetrics().widthPixels
/ getResources().getDisplayMetrics().densityDpi), 2.0)
+ Math.pow((getResources().getDisplayMetrics().heightPixels
/ getResources().getDisplayMetrics().densityDpi), 2.0));
}
@Override
public void showDialog(String title, String message) {
stateLoadIndicator(false);
((BaseActivity) getActivity()).showDialog(title, message).create().show();
}
public boolean onBackPressed() {
return true;
}
}
| [
"amasaemi@gmail.com"
] | amasaemi@gmail.com |
0bf4c8f1dbef3c596862f91311d7b672947a213c | 60e8969641cac38641afa78797ff7851600bee25 | /src/main/java/chess/domain/piece/WhitePiecesFactory.java | 9a005ed16a6f0285cf074a26c2faf59680598fe7 | [] | no_license | dks301/java-chess | 08ae0e91ff148ebebb3ceec3f54c3532edb518ff | d95951a878fbf6270c28990fdf46028f834fb9b9 | refs/heads/master | 2021-04-19T13:51:20.338935 | 2020-03-31T10:20:09 | 2020-03-31T10:20:09 | 249,609,781 | 0 | 0 | null | 2020-03-24T04:07:28 | 2020-03-24T04:07:28 | null | UTF-8 | Java | false | false | 1,553 | java | package chess.domain.piece;
import java.util.HashMap;
import java.util.Map;
import chess.domain.board.File;
import chess.domain.board.Position;
import chess.domain.piece.state.Initial;
public class WhitePiecesFactory {
public static Pieces create() {
Map<Position, Piece> pieces = new HashMap<>();
initWhitePawn(pieces);
initWhiteRook(pieces);
initWhiteBishop(pieces);
initWhiteKnight(pieces);
initWhiteQueen(pieces);
initWhiteKing(pieces);
return new Pieces(pieces);
}
private static void initWhiteKing(Map<Position, Piece> pieces) {
pieces.put(Position.of("e1"), new King(new Initial(), "k"));
}
private static void initWhiteQueen(Map<Position, Piece> pieces) {
pieces.put(Position.of("d1"), new Queen(new Initial(), "q"));
}
private static void initWhiteKnight(Map<Position, Piece> pieces) {
pieces.put(Position.of("b1"), new Knight(new Initial(), "n"));
pieces.put(Position.of("g1"), new Knight(new Initial(), "n"));
}
private static void initWhiteBishop(Map<Position, Piece> pieces) {
pieces.put(Position.of("c1"), new Bishop(new Initial(), "b"));
pieces.put(Position.of("f1"), new Bishop(new Initial(), "b"));
}
private static void initWhiteRook(Map<Position, Piece> pieces) {
pieces.put(Position.of("a1"), new Rook(new Initial(), "r"));
pieces.put(Position.of("h1"), new Rook(new Initial(), "r"));
}
private static void initWhitePawn(Map<Position, Piece> pieces) {
for (File file : File.values()) {
pieces.put(Position.of(file.getFile() + "2"), new Pawn(new Initial(), "p"));
}
}
}
| [
"noreply@github.com"
] | dks301.noreply@github.com |
0a4441766d54e453dfc35873bc370275cd2d03fa | fa30e0f9e4725b3eb5e49926fb2a2f1d2817e45f | /week-02/day-8/src/DivideByZero.java | 3eceffa6952b5731b7861bbf1a692aa9474ace6a | [] | no_license | green-fox-academy/LRobin92 | 9355d9c43d423ce7633080c241be4d52f6e44ac2 | 035f6850095b0002d89b0b63721abd45e369edb4 | refs/heads/master | 2021-02-15T07:48:41.344761 | 2020-06-02T06:42:56 | 2020-06-02T06:42:56 | 244,878,901 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | import java.util.Scanner;
public class DivideByZero {
public static void main(String[] args) {
Scanner scanner = new Scanner (System.in);
int userInput = scanner.nextInt();
try{
int result = 10 / userInput;
System.out.println("its: " + result);
}catch (ArithmeticException e){
System.out.println("Fail");
}
// Create a function that takes a number
// divides ten with it,
// and prints the result.
// It should print "fail" if the parameter is 0
}
}
| [
"laszlorobin@gmail.com"
] | laszlorobin@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.