blob_id
stringlengths 40
40
| directory_id
stringlengths 40
40
| path
stringlengths 7
332
| content_id
stringlengths 40
40
| detected_licenses
listlengths 0
50
| license_type
stringclasses 2
values | repo_name
stringlengths 7
115
| snapshot_id
stringlengths 40
40
| revision_id
stringlengths 40
40
| branch_name
stringclasses 557
values | visit_date
timestamp[us] | revision_date
timestamp[us] | committer_date
timestamp[us] | github_id
int64 5.85k
684M
⌀ | star_events_count
int64 0
77.7k
| fork_events_count
int64 0
48k
| gha_license_id
stringclasses 17
values | gha_event_created_at
timestamp[us] | gha_created_at
timestamp[us] | gha_language
stringclasses 82
values | src_encoding
stringclasses 28
values | language
stringclasses 1
value | is_vendor
bool 1
class | is_generated
bool 2
classes | length_bytes
int64 7
5.41M
| extension
stringclasses 11
values | content
stringlengths 7
5.41M
| authors
listlengths 1
1
| author
stringlengths 0
161
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
318f1ce652461dbcd12d54978ce6772c69bb6548
|
702f9632466d768df937213bfdbbdf574ee4a8b5
|
/currency-exchange/src/test/java/com/skillUp/currencyexchange/CurrencyExchangeApplicationTests.java
|
e73c59a74ef0b3002216c519b868e66fc74ac136
|
[] |
no_license
|
prathap-ch/currency-exchange
|
29307b71de9914dd6bf80fbf7bc268b26b8b74d5
|
07c7f150b09e5bdf43033d9a0714f8c02223fe7d
|
refs/heads/master
| 2023-06-21T15:32:44.774964
| 2021-08-07T06:58:10
| 2021-08-07T06:58:10
| 392,546,382
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 230
|
java
|
package com.skillUp.currencyexchange;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class CurrencyExchangeApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"35505223+prathap-ch@users.noreply.github.com"
] |
35505223+prathap-ch@users.noreply.github.com
|
2def160f343fef56cbdd9af1db5490ce674e7bc0
|
77aad5cfdef11760289dd7428a18c8c05fe7c6dc
|
/src/main/java/com/new_afterwave/mc/dao/LoginSQLStatement.java
|
86817feef06ebd4f389f4e58130b501451463ac1
|
[] |
no_license
|
kisstherain8677/MCflu
|
4781f60cd7580310b41cbded683ad911851e279b
|
c10f3e5be0fb9b97a39e46dfb99f9aa6f5e5b938
|
refs/heads/master
| 2022-11-17T23:39:57.143758
| 2020-07-17T07:44:20
| 2020-07-17T07:44:20
| 276,129,641
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,277
|
java
|
package com.new_afterwave.mc.dao;
/**
* @author by
* @description:
* @date 2020/7/8 16:39
*/
public enum LoginSQLStatement
{
//这句话就算如果不存在TABLE1的表,创建之
//有以下列数
//int列,存储数据
//string列,存储字符串
//主键为int
CREATE_TABLE1(
"CREATE TABLE IF NOT EXISTS `LoginInfo` (" +
"`playerName` VARCHAR(30) NOT NULL," +
"`password` VARCHAR(30) NOT NULL," +
"PRIMARY KEY (`playerName`))"
),
ADD_DATA(
"INSERT INTO `LoginInfo` " +
"(`playerName`, `password`)" +
"VALUES (?, ?)"
),
//添加一行数据,包含2个值
DELETE_DATA(
"DELETE FROM `LoginInfo` WHERE `playerName` = ?"
),
//删除主键为[int]的一行数据
SELECT_DATA(
"SELECT * FROM `LoginInfo` WHERE `playerName` = ?"
);
//查找主键为[int]的一行数据
/*
* 这里可以添加更多的MySQL命令,格式如下
* COMMAND_NAME(
* "YOUR_COMMAND_HERE" +
* "YOUR_COMMAND_HERE"
* );
*/
private String statement;
LoginSQLStatement(String statement)
{
this.statement = statement;
}
public String getStatement()
{
return statement;
}
}
|
[
"842658636@qq.com"
] |
842658636@qq.com
|
7223a5fe51a6ecbc9a9ebb83198aa9e1275e5f12
|
3752b55c99df41fc67c85cc61e0a2a34955e501c
|
/bradypod.framework/bradypod.framework.vm/src/main/java/bradypod/framework/vm/anq/AnQ_2.java
|
0128b23eea0f45ca91f7dca5e09ec377be58771e
|
[] |
no_license
|
shineer/bradypod
|
cfb627b3a3d9bec738fa829a036c36d25d8ca803
|
77b424b358d5954d2657d6ea57573dd42acee198
|
refs/heads/master
| 2021-01-18T15:40:36.772019
| 2017-02-27T10:18:10
| 2017-02-27T10:18:10
| null | 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 734
|
java
|
package bradypod.framework.vm.anq;
import java.math.BigDecimal;
/**
* 解惑——2,找小数点
*
* @author xiangmin.zxm
*
*/
public class AnQ_2 {
public static void main(String[] args) {
// 1, 做金额扣减的时候,错误示例
System.out.println("错误示例: " + (2.0 - 1.1));
// 2, printf
System.out.printf("%.2f%n", 2.00 - 1.10);
// 3,转换为分为单位,int类型
System.out.println(200 - 110 + "分");
// 4,BigDecimal的字符串构造器,不用浮点构造否则会以浮点的精度录入
System.out.println(new BigDecimal("2.00").subtract(new BigDecimal("1.10")));
System.out.println("错误示例: " + new BigDecimal(2.00).subtract(new BigDecimal(1.10)));
}
}
|
[
"previous_yu@163.com"
] |
previous_yu@163.com
|
e10d612ba49382d7eaa54761c9f923f03bb550aa
|
979f258d9d98da2d6a0ce926c27b5605bd877da4
|
/app/src/test/java/com/example/homebrewrakia/ExampleUnitTest.java
|
c14ae4e1bc03ed71e3f89d861f920d3ab89672c9
|
[] |
no_license
|
julianjelev/HomebrewRakia
|
1899c7b8f5714351d04322f61af63c8e5f94369c
|
f1cf4b8c2e40eb7952987a7154835039dbb9b4cf
|
refs/heads/master
| 2022-12-16T23:29:17.021729
| 2020-09-02T14:49:14
| 2020-09-02T14:49:14
| 291,959,127
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 386
|
java
|
package com.example.homebrewrakia;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
|
[
"julian_jelev@hotmail.com"
] |
julian_jelev@hotmail.com
|
c6720aaa5608f537bcee49bc840b4f6b7f1b771c
|
37851cb3c2cae08f8f44d9a7f09b995b995fb58a
|
/tln_mazzei/simplenlg/src/Start.java
|
33c038cf514ee3d6c11902d85b8f5f4c41642b9a
|
[] |
no_license
|
rogerferrod/tln
|
b88680eca56ef9bd63d13969081b1a78df2318f4
|
8d50bbe4d3d352d6de84f553a2a0bf0b3242e1e8
|
refs/heads/master
| 2020-08-18T21:11:57.156711
| 2019-10-17T16:24:07
| 2019-10-17T16:24:07
| 215,834,310
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,543
|
java
|
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import java.io.*;
import java.util.ArrayList;
public class Start {
public static void main(String[] args) {
JSONParser jsonParser = new JSONParser();
File dir = new File("..\\python\\output\\");
File[] directoryListing = dir.listFiles();
ArrayList<String> sentences = new ArrayList<>();
if (directoryListing != null) {
for (File child : directoryListing) {
try {
JSONObject jsonObject = (JSONObject) jsonParser.parse(new FileReader(child));
NLGtree generator = new NLGtree(jsonObject.toString());
String sentence = generator.getRealisedSentence();
System.out.println(sentence);
sentences.add(sentence);
} catch (Exception e) {
e.printStackTrace();
}
}
writeSentencesOnFile(sentences);
}
}
public static void writeSentencesOnFile(ArrayList<String> sentences) {
String path;
for (int i = 0; i < sentences.size(); i++) {
path = "translation" + i + ".txt";
BufferedWriter writer;
try {
writer = new BufferedWriter(new FileWriter("output\\" + path));
writer.write(sentences.get(i));
writer.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
|
[
"roger.ferrod@edu.unito.it"
] |
roger.ferrod@edu.unito.it
|
fe70baaecea89e2a044c80c00cd7086917d7b130
|
3a8cbe4eec1e11ebfdcceb143cb7d832973551a6
|
/src/main/java/com/test/core/entity/user/User.java
|
1eda860acf3b8cd2606827d065b863b41b490e13
|
[] |
no_license
|
araksgyulumyan/SpringBootMVCAndSecurity
|
5d28714bbeaffe8e2385ce75a4e8e7e23502844e
|
38e9a0db1bf20fa1ed381c3e6d6479b8088f9ee5
|
refs/heads/master
| 2020-03-22T14:35:49.592343
| 2018-07-11T18:19:17
| 2018-07-11T18:19:17
| 140,191,276
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,301
|
java
|
package com.test.core.entity.user;
import com.test.core.entity.BaseEntity;
import com.test.core.service.user.common.UserRole;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import javax.persistence.*;
/**
* Created by araksgyulumyan
* Date - 7/2/18
* Time - 8:22 PM
*/
@Entity
@Table(name = "USERS")
public class User extends BaseEntity {
private static final long serialVersionUID = -4940077717749867439L;
// Properties
@Column(name = "userName", nullable = false, unique = true)
private String userName;
@Column(name = "password", nullable = false)
private String password;
@Enumerated(EnumType.STRING)
@Column(name = "role", nullable = false, updatable = false)
private UserRole userRole;
@Column(name = "firstName", nullable = false)
private String firstName;
@Column(name = "lastName", nullable = false)
private String lastName;
// Properties getters and setters
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public UserRole getUserRole() {
return userRole;
}
public void setUserRole(UserRole userRole) {
this.userRole = userRole;
}
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;
}
// Equals and Hashcode
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (obj == this) {
return true;
}
if (obj.getClass() != getClass()) {
return false;
}
User rhs = (User) obj;
return new EqualsBuilder()
.appendSuper(super.equals(obj))
.append(this.userName, rhs.userName)
.append(this.password, rhs.password)
.append(this.userRole, rhs.userRole)
.append(this.firstName, rhs.firstName)
.append(this.lastName, rhs.lastName)
.isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder()
.appendSuper(super.hashCode())
.append(userName)
.append(password)
.append(userRole)
.append(firstName)
.append(lastName)
.toHashCode();
}
// ToString
@Override
public String toString() {
return new ToStringBuilder(this)
.appendSuper(super.toString())
.append("userName", userName)
.append("password", password)
.append("userRole", userRole)
.append("firstName", firstName)
.append("lastName", lastName)
.toString();
}
}
|
[
"araksgyulumyan@alfred-macs-MacBook-Pro.local"
] |
araksgyulumyan@alfred-macs-MacBook-Pro.local
|
d56ffdcaa33f9746dd98ccab6da3151d32782438
|
89972779259818d76e3d249a52153e4f42dd9501
|
/old/vnm-selfcare-webapps-mega2-master/vnm-selfcare-core-2.0/src/main/java/com/gnv/vnm/selfcare/core/adapter/upcc/ws/SInSubscriberAccountParaVO.java
|
eb0bead71361c6223eed1d05b6799def878f2420
|
[] |
no_license
|
SM-Tiwari/Spring-Security
|
5514149eb7e082e04f04dab0cbcbf9fb1df5d84e
|
f0676d3a96748d476c226ba7e724896eab77fa71
|
refs/heads/master
| 2022-12-28T18:07:32.056655
| 2020-01-31T03:31:13
| 2020-01-31T03:31:13
| 237,351,143
| 0
| 0
| null | 2022-12-10T01:04:42
| 2020-01-31T03:10:35
|
Java
|
UTF-8
|
Java
| false
| false
| 2,682
|
java
|
package com.gnv.vnm.selfcare.core.adapter.upcc.ws;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for SInSubscriberAccountParaVO complex type.
*
* <p>The following schema fragment specifies the expected result contained within this class.
*
* <pre>
* <complexType name="SInSubscriberAccountParaVO">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="subscriber" type="{rm:type}SPccSubscriber"/>
* <element name="subscriberAccount" type="{rm:type}SSubscriberAccount" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SInSubscriberAccountParaVO", propOrder = {
"subscriber",
"subscriberAccount"
})
public class SInSubscriberAccountParaVO {
@XmlElement(required = true)
protected SPccSubscriber subscriber;
protected List<SSubscriberAccount> subscriberAccount;
/**
* Gets the value of the subscriber property.
*
* @return
* possible object is
* {@link SPccSubscriber }
*
*/
public SPccSubscriber getSubscriber() {
return subscriber;
}
/**
* Sets the value of the subscriber property.
*
* @param value
* allowed object is
* {@link SPccSubscriber }
*
*/
public void setSubscriber(SPccSubscriber value) {
this.subscriber = value;
}
/**
* Gets the value of the subscriberAccount property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the subscriberAccount property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSubscriberAccount().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SSubscriberAccount }
*
*
*/
public List<SSubscriberAccount> getSubscriberAccount() {
if (subscriberAccount == null) {
subscriberAccount = new ArrayList<SSubscriberAccount>();
}
return this.subscriberAccount;
}
}
|
[
"siddhesh.mani@infotelgroup.in"
] |
siddhesh.mani@infotelgroup.in
|
bbb5bf35d308b63052ca1a4e114a9aa31657b042
|
025803488ee6148d9ffc0509407b0ebf83eb5bcf
|
/exercicios/src/main/java/classes/AreaCirc.java
|
02c750a82f3a5a68c844b38db71e2d2616000c1e
|
[] |
no_license
|
gabikersul/curso-java-udemy
|
216f7ccae4727db2d5636108849031321a6ec06a
|
1cff944756e4ec3ef95029c386030b3fe930fc87
|
refs/heads/main
| 2023-06-26T13:24:32.918265
| 2021-07-25T22:43:24
| 2021-07-25T22:43:24
| 389,449,099
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 223
|
java
|
package classes;
public class AreaCirc {
double raio;
static final double PI = 3.14;;
AreaCirc(double raio){
this.raio = raio;
}
double area(){
return PI * Math.pow(raio, 2);
}
}
|
[
"gabriela.ilegra@terceiros.zenvia.com"
] |
gabriela.ilegra@terceiros.zenvia.com
|
199369d8a35a41fc332e1ecaad383fbaa6bb01c3
|
7cfde3b082522eeb5fb1d4546ebc6ab24a4f11a4
|
/wgames/gameserver/src/main/java/org/linlinjava/litemall/gameserver/data/vo/Vo_41009_0.java
|
db63ea1d2446a4d62b4ed850477fe085f0989858
|
[] |
no_license
|
miracle-ET/DreamInMiracle
|
9f784e7f373e78a7011aceb2b5b78ce6f5b7c268
|
2587221feb4fd152fc91cabd533b383c7e44b86f
|
refs/heads/master
| 2022-07-21T21:44:55.253764
| 2020-01-03T03:59:17
| 2020-01-03T03:59:17
| 231,498,544
| 0
| 2
| null | 2022-06-21T02:33:57
| 2020-01-03T02:41:06
|
Java
|
UTF-8
|
Java
| false
| false
| 130
|
java
|
package org.linlinjava.litemall.gameserver.data.vo;
public class Vo_41009_0 {
public int server_time;
public int time_zone;
}
|
[
"Administrator@DESKTOP-M4SH3SF"
] |
Administrator@DESKTOP-M4SH3SF
|
14a1272726ec05917bc3ae39ac83d97c93406bee
|
fa1408365e2e3f372aa61e7d1e5ea5afcd652199
|
/src/testcases/CWE129_Improper_Validation_of_Array_Index/s03/CWE129_Improper_Validation_of_Array_Index__getQueryString_Servlet_array_size_05.java
|
15483a2518247463716e777af7c5536a580a1614
|
[] |
no_license
|
bqcuong/Juliet-Test-Case
|
31e9c89c27bf54a07b7ba547eddd029287b2e191
|
e770f1c3969be76fdba5d7760e036f9ba060957d
|
refs/heads/master
| 2020-07-17T14:51:49.610703
| 2019-09-03T16:22:58
| 2019-09-03T16:22:58
| 206,039,578
| 1
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 11,219
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE129_Improper_Validation_of_Array_Index__getQueryString_Servlet_array_size_05.java
Label Definition File: CWE129_Improper_Validation_of_Array_Index.label.xml
Template File: sources-sinks-05.tmpl.java
*/
/*
* @description
* CWE: 129 Improper Validation of Array Index
* BadSource: getQueryString_Servlet Parse id param out of the URL query string (without using getParameter())
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: array_size
* GoodSink: data is used to set the size of the array and it must be greater than 0
* BadSink : data is used to set the size of the array, but it could be set to 0
* Flow Variant: 05 Control flow: if(privateTrue) and if(privateFalse)
*
* */
package testcases.CWE129_Improper_Validation_of_Array_Index.s03;
import testcasesupport.*;
import javax.servlet.http.*;
import java.util.StringTokenizer;
import java.util.logging.Level;
public class CWE129_Improper_Validation_of_Array_Index__getQueryString_Servlet_array_size_05 extends AbstractTestCaseServlet
{
/* The two variables below are not defined as "final", but are never
* assigned any other value, so a tool should be able to identify that
* reads of these will always return their initialized values.
*/
private boolean privateTrue = true;
private boolean privateFalse = false;
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
if (privateTrue)
{
data = Integer.MIN_VALUE; /* initialize data in case id is not in query string */
/* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */
{
StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&");
while (tokenizer.hasMoreTokens())
{
String token = tokenizer.nextToken(); /* a token will be like "id=33" */
if(token.startsWith("id=")) /* check if we have the "id" parameter" */
{
try
{
data = Integer.parseInt(token.substring(3)); /* set data to the int 33 */
}
catch(NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat);
}
break; /* exit while loop */
}
}
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (privateTrue)
{
int array[] = null;
/* POTENTIAL FLAW: Verify that data is non-negative, but still allow it to be 0 */
if (data >= 0)
{
array = new int[data];
}
else
{
IO.writeLine("Array size is negative");
}
/* do something with the array */
array[0] = 5;
IO.writeLine(array[0]);
}
}
/* goodG2B1() - use goodsource and badsink by changing first privateTrue to privateFalse */
private void goodG2B1(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
if (privateFalse)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
else
{
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
if (privateTrue)
{
int array[] = null;
/* POTENTIAL FLAW: Verify that data is non-negative, but still allow it to be 0 */
if (data >= 0)
{
array = new int[data];
}
else
{
IO.writeLine("Array size is negative");
}
/* do something with the array */
array[0] = 5;
IO.writeLine(array[0]);
}
}
/* goodG2B2() - use goodsource and badsink by reversing statements in first if */
private void goodG2B2(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
if (privateTrue)
{
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (privateTrue)
{
int array[] = null;
/* POTENTIAL FLAW: Verify that data is non-negative, but still allow it to be 0 */
if (data >= 0)
{
array = new int[data];
}
else
{
IO.writeLine("Array size is negative");
}
/* do something with the array */
array[0] = 5;
IO.writeLine(array[0]);
}
}
/* goodB2G1() - use badsource and goodsink by changing second privateTrue to privateFalse */
private void goodB2G1(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
if (privateTrue)
{
data = Integer.MIN_VALUE; /* initialize data in case id is not in query string */
/* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */
{
StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&");
while (tokenizer.hasMoreTokens())
{
String token = tokenizer.nextToken(); /* a token will be like "id=33" */
if(token.startsWith("id=")) /* check if we have the "id" parameter" */
{
try
{
data = Integer.parseInt(token.substring(3)); /* set data to the int 33 */
}
catch(NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat);
}
break; /* exit while loop */
}
}
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (privateFalse)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
IO.writeLine("Benign, fixed string");
}
else
{
/* Need to ensure that the array is of size > 3 and < 101 due to the GoodSource and the large_fixed BadSource */
int array[] = null;
/* FIX: Verify that data is non-negative AND greater than 0 */
if (data > 0)
{
array = new int[data];
}
else
{
IO.writeLine("Array size is negative");
}
/* do something with the array */
array[0] = 5;
IO.writeLine(array[0]);
}
}
/* goodB2G2() - use badsource and goodsink by reversing statements in second if */
private void goodB2G2(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
int data;
if (privateTrue)
{
data = Integer.MIN_VALUE; /* initialize data in case id is not in query string */
/* POTENTIAL FLAW: Parse id param out of the URL querystring (without using getParam) */
{
StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "&");
while (tokenizer.hasMoreTokens())
{
String token = tokenizer.nextToken(); /* a token will be like "id=33" */
if(token.startsWith("id=")) /* check if we have the "id" parameter" */
{
try
{
data = Integer.parseInt(token.substring(3)); /* set data to the int 33 */
}
catch(NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception reading id from query string", exceptNumberFormat);
}
break; /* exit while loop */
}
}
}
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (privateTrue)
{
/* Need to ensure that the array is of size > 3 and < 101 due to the GoodSource and the large_fixed BadSource */
int array[] = null;
/* FIX: Verify that data is non-negative AND greater than 0 */
if (data > 0)
{
array = new int[data];
}
else
{
IO.writeLine("Array size is negative");
}
/* do something with the array */
array[0] = 5;
IO.writeLine(array[0]);
}
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B1(request, response);
goodG2B2(request, response);
goodB2G1(request, response);
goodB2G2(request, response);
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"bqcuong2212@gmail.com"
] |
bqcuong2212@gmail.com
|
fa34fcd852f3a1ed5a966bcd86c90e615caa8a58
|
b5d5ffb9b6c8d2b7df80cb6bcd29f439214d2800
|
/sharding-jdbc/src/main/java/dang/demo/sharding/shardingjdbc/core/config/datasource/DatabaseShardingAlgorithm.java
|
ca2e92ca455b20693d75581daf37f6f653a54ad5
|
[] |
no_license
|
dangfugui/demo-root
|
ea9b4cd30e07d982301fa522a982f3dbfb4aba76
|
3ad709b4863db5dec3311331546e62a0b8554783
|
refs/heads/master
| 2021-05-11T04:57:27.312943
| 2019-01-25T06:51:45
| 2019-01-25T06:51:45
| 117,950,808
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 799
|
java
|
package dang.demo.sharding.shardingjdbc.core.config.datasource;
import io.shardingsphere.api.algorithm.sharding.PreciseShardingValue;
import io.shardingsphere.api.algorithm.sharding.standard.PreciseShardingAlgorithm;
import java.util.Collection;
/**
* 分库算法:
*/
public final class DatabaseShardingAlgorithm implements PreciseShardingAlgorithm<Integer> {
@Override
public String doSharding(final Collection<String> availableTargetNames, final PreciseShardingValue<Integer> shardingValue) {
int size = availableTargetNames.size();
for (String each : availableTargetNames) {
if (each.endsWith(shardingValue.getValue() % size + "")) {
return each;
}
}
throw new UnsupportedOperationException();
}
}
|
[
"dangfugui@163.com"
] |
dangfugui@163.com
|
b273f3cabfa89e2e835aeae042bbe938b9eaf3c2
|
57f41b43a04fc41b51e3e9da7aebec5f2c4aefa4
|
/Product/src/test/java/com/company/Product/ProductApplicationTests.java
|
7536e499bc50bd9ef86eacfa916b570d60d7d858
|
[] |
no_license
|
Mattlomet/Capstone-2
|
b9ddcb5d00c6dd5a912843f1550b0985e5dbe1b3
|
1c769bfb45f35fac51195e56f0213ad7360fd783
|
refs/heads/master
| 2022-07-15T02:07:01.082467
| 2019-12-18T07:29:01
| 2019-12-18T07:29:01
| 227,625,629
| 1
| 0
| null | 2022-06-21T02:28:13
| 2019-12-12T14:28:55
|
Java
|
UTF-8
|
Java
| false
| false
| 212
|
java
|
package com.company.Product;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ProductApplicationTests {
@Test
void contextLoads() {
}
}
|
[
"mattlomet@live.com"
] |
mattlomet@live.com
|
79dc8cf08735dc36d8e0bdef3696b6c8a55708ef
|
7ad7b22b81236b70e5ecca2e57e9353c769ed3bf
|
/day1/src/main/java/com/lijia/code/WaterVolume.java
|
012e809b71a9dfd41486696ddd2f1cfc8b74af0e
|
[] |
no_license
|
tawalisa/code
|
e2c961df191bff710f0219f30f0947a8c4219fd6
|
0743556d2db812d34ae3911fbbe6c65e108e9bf3
|
refs/heads/master
| 2022-10-24T08:32:46.419915
| 2021-03-23T08:20:43
| 2021-03-23T08:20:43
| 202,655,308
| 0
| 0
| null | 2022-10-05T18:22:55
| 2019-08-16T03:56:31
|
Java
|
UTF-8
|
Java
| false
| false
| 1,838
|
java
|
package com.lijia.code;
/**
* 有一组不同高度的台阶,有一个整数数组表示,数组中每个数是台阶的高度,\ 当开始下雨了(雨水足够多)台阶之间的水坑会积水多少呢?
* 如下图,可以表示为数组[0,1,0,2,1,0,1,3,2,1,2,1],返回水体积等于6
*
* @link <img src="water_volume.jpg" />
* @author tawalisa@163.com
*
*/
public class WaterVolume {
public static void main(String[] args) {
int v = waterVolumecal(new int[] { 0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1 });
System.out.println("sum:" + v);
v = waterVolumecal(new int[] { 0, 1, 2, 3, 3, 4, 5, 6, 6, 5, 4, 0 });
System.out.println("sum:" + v);
v = waterVolumecal(new int[] { 10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 0 });
System.out.println("sum:" + v);
}
private static int waterVolumecal(int[] is) {
int sum = 0;
int highL = 0;
int highR = 0;
for (int i = 1; i < is.length; i++) {
if (highL >= highR || i >= highR) {
highR = findRightHigh(i,highL, is);
if (highR < 0) {
return sum;
}
}
if (is[i] < is[highL]) {
if (highR > i) {
sum = sum + Math.max(Math.min(is[highL], is[highR]) - is[i], 0);
} else {
if (is[highR] >= is[highL]) {
highL = highR;
}
highR = findRightHigh(i,highL, is);
if (highR < 0) {
return sum;
}
}
} else {
highL = i;
}
}
return sum;
}
/**
*
* @param start
* @param highL
* @param is
* @return
*/
private static int findRightHigh(int start, int highL,int[] is) {
int ret = -1;
int currentMax = -1;
for (int i = start + 1; i < is.length; i++) {
if (is[i] >= is[highL]) {
return i;
}
if (is[i] > currentMax) {
ret = i;
currentMax = is[i];
}
}
return ret;
}
}
|
[
"jli13@tabzpgbzjw.asiapacific.hpqcorp.net"
] |
jli13@tabzpgbzjw.asiapacific.hpqcorp.net
|
9257dc6ab0e7f65b468b14d5000c186b810a199a
|
762d286a279aa1e7924ac3067e3d9d668062d67c
|
/src/main/java/org/linguafranca/pwdb/kdb/KdbCredentials.java
|
22c3cb18d5e4294a1cffdb4de989f52427631fda
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
specop0/KeePassJava2
|
82d81ef5a8c4b562e021cc18e7a4eaa0b4e925fb
|
111b3c1f8433fc058c5496927601610aba39fb7f
|
refs/heads/master
| 2020-04-01T22:13:50.058342
| 2016-05-19T11:57:38
| 2016-05-19T11:58:37
| 56,612,746
| 0
| 1
| null | 2016-04-19T16:17:06
| 2016-04-19T16:17:06
| null |
UTF-8
|
Java
| false
| false
| 1,310
|
java
|
/*
* Copyright 2015 Jo Rabin
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.linguafranca.pwdb.kdb;
import org.linguafranca.security.Credentials;
import org.linguafranca.security.Encryption;
import java.security.MessageDigest;
/**
* Has inner classes representing credentials appropriate to KDB files
*
* @author jo
*/
public interface KdbCredentials extends Credentials {
/**
* Password only credentials
*/
public static class Password implements KdbCredentials {
private byte [] key;
public Password(byte[] password) {
MessageDigest md = Encryption.getMessageDigestInstance();
this.key = md.digest(password);
}
@Override
public byte[] getKey() {
return key;
}
}
}
|
[
"jo@linguafranca.org"
] |
jo@linguafranca.org
|
3b090102579db37006a07a44b3dc4690ed689a2c
|
010760279dd970c8a13608da902b53f38aef651e
|
/16SessionChildActor/src/main/java/demo/SessionChildActor.java
|
048def0da47ed8e1de8d55a903522b7d9ad8600f
|
[] |
no_license
|
luciano-fs/slr203patterns
|
25562e06175148d16ae1f821f44314f25f06a9d3
|
60e566d117b90a4dc51318f5a62cdc5411379dab
|
refs/heads/master
| 2020-12-26T12:22:48.172437
| 2020-01-31T20:18:03
| 2020-01-31T20:18:03
| 237,508,387
| 0
| 0
| null | 2020-10-13T19:12:07
| 2020-01-31T20:12:56
|
Java
|
UTF-8
|
Java
| false
| false
| 1,272
|
java
|
package demo;
import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import demo.SessionManager.*;
import demo.Client.*;
/**
* @author Luciano Freitas
* @description
*/
public class SessionChildActor {
public static void main(String[] args) {
final ActorSystem system = ActorSystem.create("system");
final ActorRef client1 = system.actorOf(Client.createActor(), "client1");
final ActorRef sesMan = system.actorOf(SessionManager.createActor(system), "SessionManager");
endSession es = new endSession();
Request m1 = new Request("foo");
Response m2 = new Response("bar");
GetSession gs = new GetSession(sesMan);
GoTell gt1 = new GoTell(m1);
GoTell gt2 = new GoTell(m2);
client1.tell(gs, ActorRef.noSender());
client1.tell(gt1, ActorRef.noSender());
client1.tell(gt2, ActorRef.noSender());
sesMan.tell(es, client1);
// We wait 5 seconds before ending system (by default)
// But this is not the best solution.
try {
waitBeforeTerminate();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
system.terminate();
}
}
public static void waitBeforeTerminate() throws InterruptedException {
Thread.sleep(5000);
}
}
|
[
"lucianofdz@gmail.com"
] |
lucianofdz@gmail.com
|
e84fd5e92622f076fbfc3c8d74305246d83eb3d3
|
e00a7a926008680c267378aba327f1cc40a0d6f5
|
/src/main/java/com/testgroup/api/ShipmentDto.java
|
1e03d0577ad4bee303dd79b411de059cc5b6ba4e
|
[] |
no_license
|
SebastianBodzak/deliverysystem
|
37a586079f4d8de19e14721d4f8b0cea53f35c0a
|
d6e6bd5c2739f1e2f35044ac602f17fc325e0131
|
refs/heads/master
| 2020-06-10T18:10:01.541623
| 2016-12-15T14:33:37
| 2016-12-15T14:33:37
| 75,722,318
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,689
|
java
|
package com.testgroup.api;
import com.testgroup.domain.ParcelType;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by sbod on 06.12.16.
*/
public class ShipmentDto {
private Long shipmentId;
private Long parcelId;
private String date;
private Long senderId;
private Long recipientId;
private ParcelType parcelType;
public ShipmentDto(Long shipmentId, Long parcelId, Date date, Long senderId, Long recipientId, ParcelType parcelType) {
this.shipmentId = shipmentId;
this.parcelId = parcelId;
this.date = new SimpleDateFormat("yyyy/MM/dd").format(date);
this.senderId = senderId;
this.recipientId = recipientId;
this.parcelType = parcelType;
}
public Long getShipmentId() {
return shipmentId;
}
public void setShipmentId(Long shipmentId) {
this.shipmentId = shipmentId;
}
public Long getParcelId() {
return parcelId;
}
public void setParcelId(Long parcelId) {
this.parcelId = parcelId;
}
public Long getSenderId() {
return senderId;
}
public void setSenderId(Long senderId) {
this.senderId = senderId;
}
public Long getRecipientId() {
return recipientId;
}
public void setRecipientId(Long recipientId) {
this.recipientId = recipientId;
}
public ParcelType getParcelType() {
return parcelType;
}
public void setParcelType(ParcelType parcelType) {
this.parcelType = parcelType;
}
public String getDate() {
return date;
}
public void setDate(String date) {
this.date = date;
}
}
|
[
"sebastian.bodzak@impaqgroup.com"
] |
sebastian.bodzak@impaqgroup.com
|
85a35812c9e0856fc37bec878566505dbc592905
|
306621e63eb5a1eac304a90b085c09f83dfe35ed
|
/kodilla-patterns22/src/main/java/com/kodilla/patterns22/decorator/taxiportal/UberNetworkOrderDecorator.java
|
62294a2a347a90742dbeef450cbdf5ebe841b45e
|
[] |
no_license
|
hewww/My-first-steps-in-java
|
1efe6d8615139e29419c12231429a4faed449de2
|
458198c6c28a3b59faa164155a435de348037b63
|
refs/heads/master
| 2020-06-18T16:56:02.244166
| 2019-11-16T16:35:27
| 2019-11-16T16:35:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 476
|
java
|
package com.kodilla.patterns22.decorator.taxiportal;
import java.math.BigDecimal;
public class UberNetworkOrderDecorator extends AbstractTaxiOrderDecorator {
public UberNetworkOrderDecorator(TaxiOrder taxiOrder) {
super(taxiOrder);
}
@Override
public BigDecimal getCost() {
return super.getCost().add(new BigDecimal(20));
}
@Override
public String getDescription() {
return super.getDescription() + " by Uber";
}
}
|
[
"50962854+hewww@users.noreply.github.com"
] |
50962854+hewww@users.noreply.github.com
|
aacad08922af81c1082d3d4af8e60fec75907e73
|
85735f635e2f0ac0e099cb72575d18433f812d6f
|
/app/src/main/java/com/lzh/mdzhihudaily_mvp/AppConstants.java
|
df5f74cf69318498bf56522c05d41d271eb52b33
|
[
"Apache-2.0"
] |
permissive
|
lisuperhong/MDZhihuDaily
|
fe04e0677194f00c9d9ee373ad2f348eb1a05085
|
b9192b3a78beb769ed6ab583f1503eef81608a5c
|
refs/heads/master
| 2021-01-17T23:31:00.101101
| 2017-08-01T13:01:11
| 2017-08-01T13:01:11
| 62,735,140
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 256
|
java
|
package com.lzh.mdzhihudaily_mvp;
/**
* @author lzh
* @desc:
* @date Created on 2017/2/25 17:17
* @github: https://github.com/lisuperhong
*/
public class AppConstants {
public static final String BASE_URL = "http://news-at.zhihu.com/api/4/";
}
|
[
"lisuperhong@gmail.com"
] |
lisuperhong@gmail.com
|
2d31c0c0c191c78f034d031e08f585e85659158d
|
0045a198d7d4f5d0aecc0c4600f27e825007c2c9
|
/src/control/pharmacy_control.java
|
bbf6895682d083345e52dc752216eee0cd175c18
|
[] |
no_license
|
MoustafaElsaghier/MedicineWarehouse
|
d9b82079fa5834f17ef0972d1f5d7792da879f1e
|
609490b8a324d5c725b97b8a217c6f18cb59323b
|
refs/heads/master
| 2021-01-20T02:30:14.823826
| 2017-04-25T23:23:50
| 2017-04-25T23:23:50
| 89,415,758
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,176
|
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 control;
import java.sql.SQLException;
import model.pharmacy_attribute;
import model.pharmacy_db;
/**
*
* @author القدس
*/
public class pharmacy_control {
pharmacy_db db =new pharmacy_db();
public void insert_pharm(pharmacy_attribute pharm) throws SQLException {
db.insert_pharm(pharm);
}
public Object[][] getalldatapharm(pharmacy_attribute pharm) throws SQLException {
return db.getalldatapharm(pharm);
}
public void update_pharm(pharmacy_attribute pharm) throws SQLException {
db.update_pharm(pharm);
}
public void deletepharm(pharmacy_attribute pharm) throws SQLException {
db.deletepharm(pharm);
}
public Object[][] searchpharm(pharmacy_attribute pharm) throws SQLException {
return db.searchpharm(pharm);
}
}
|
[
"thedreamereng@gmail.com"
] |
thedreamereng@gmail.com
|
80108e988ac91cf75ee053cfc80e7d1d7ddbd769
|
fbae4df0b1687180b46c3ac8f883687d988a1d4b
|
/springdatajpa-demo/src/springdatajpatalk/spring/SpringConfiguration.java
|
909c5d93b9bb353ce7650363d704f79125573d25
|
[] |
no_license
|
xalbrech/examples_and_talks
|
81e50ac3e1838bdfa8b0e438626b7d70a9b37e5d
|
be9f978822bf7f517bedf7151560c7cfffd45791
|
refs/heads/master
| 2021-01-18T12:40:14.418308
| 2016-10-03T15:09:37
| 2016-10-03T15:09:37
| 48,951,405
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,222
|
java
|
package springdatajpatalk.spring;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import springdatajpatalk.repositories.DeveloperRepository;
@Configuration
@EnableTransactionManagement
@EnableJpaRepositories(basePackageClasses = {DeveloperRepository.class} )
public class SpringConfiguration {
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
factoryBean.setPersistenceUnitName("demo");
return factoryBean;
}
@Bean
public PlatformTransactionManager transactionManager() {
JpaTransactionManager txManager = new JpaTransactionManager();
txManager.setEntityManagerFactory(entityManagerFactory().getNativeEntityManagerFactory());
return txManager;
}
}
|
[
"d.albrecht@seznam.cz"
] |
d.albrecht@seznam.cz
|
c56dc979f7384535049ceaa515a45f71b29dd10e
|
6f8edf68044debaa9fa5662da0a71a00c5182581
|
/java/com/norbl/cbp/ppe/usermonitor/AuthorizationFrame.java
|
7922ece42b5324e9e9c877d792562cbdfae8afdb
|
[] |
no_license
|
cran/cloudRmpi
|
45e4be633688ba3bf1e07e0d1eb721b319b3c217
|
fd9ffa631ba612045aef04b66c0df6d27da23de1
|
refs/heads/master
| 2021-01-18T15:21:41.301819
| 2012-05-12T00:00:00
| 2012-05-12T00:00:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 9,656
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.norbl.cbp.ppe.usermonitor;
import com.norbl.cbp.ppe.*;
import com.norbl.util.gui.*;
import java.awt.event.*;
/**
*
* @author moi
*/
public class AuthorizationFrame extends javax.swing.JFrame {
AuthorizationClient client;
/**
* Creates new form AuthorizationFrame
*/
public AuthorizationFrame(AuthorizationClient client) {
this.client = client;
SwingDefaults.setIcon(this);
this.client = client;
this.setTitle("Billing Authorization");
initComponents();
WevHandler wev = new WevHandler();
this.addWindowListener(wev);
GuiUtil.centerOnScreen(this);
this.setVisible(true);
this.setAlwaysOnTop(true);
}
public String getEmailAddress() {
return(emailEntryJTextField.getText());
}
class WevHandler extends WindowAdapter {
public void windowClosing(WindowEvent e) {
client.windowClosed();
}
public void windowClosed(WindowEvent e) {
client.windowClosed();
}
}
static String text =
"<html>" +
"We charge " + ConstantsUM.PRICE_PIPH +
" per instance per hour for the use of our<br>" +
"most recent machine images (AMIs). This charge is in addition<br>" +
"to Amazon's instance and data transfer charges and is billed<br>" +
"<i>separately</i>, through Amazon's payment system.<br><br>" +
"To authorize billing, enter an email address, which we'll<br>" +
"use as your ID for billing purposes. This email address will<br>" +
"<i>not</i> added to any mailing lists and will <i>not</i> be given to<br>" +
"anyone. You will be billed monthly if and when the amount<br>" +
"due is > $10.00 US. If your total never exceeds $10.00 you will<br>" +
"never be billed and will not owe anything.<br><br>" +
"After you enter the email address, your browser will be<br>" +
"launched displaying Amazon's page for authorizing the billing."
+ "</html>";
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
titleJLabel = new javax.swing.JLabel();
textJLabel = new javax.swing.JLabel();
emailJLabel = new javax.swing.JLabel();
emailEntryJTextField = new javax.swing.JTextField();
cancelButton = new javax.swing.JButton();
continueButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
titleJLabel.setFont(new java.awt.Font("DejaVu Sans", 1, 15)); // NOI18N
titleJLabel.setText("Enter email address for billing authorization");
textJLabel.setText(text);
emailJLabel.setText("Email address");
cancelButton.setText("Cancel");
cancelButton.addActionListener(client);
cancelButton.setActionCommand("cancel");
continueButton.setText("Continue");
continueButton.addActionListener(client);
continueButton.setActionCommand("continue");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(emailJLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(emailEntryJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(cancelButton)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(continueButton)
.addGap(20, 20, 20))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(titleJLabel)
.addComponent(textJLabel))
.addGap(0, 22, Short.MAX_VALUE))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(titleJLabel)
.addGap(43, 43, 43)
.addComponent(textJLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 49, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(emailJLabel)
.addComponent(emailEntryJTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(44, 44, 44)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(cancelButton)
.addComponent(continueButton))
.addGap(20, 20, 20))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>//GEN-END:initComponents
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/*
* Set the Nimbus look and feel
*/
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the
* default look and feel. For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(AuthorizationFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(AuthorizationFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(AuthorizationFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(AuthorizationFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/*
* Create and display the form
*/
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
com.norbl.util.gui.GuiMetrics.init();
com.norbl.util.gui.SwingDefaults.setDefaults();
new AuthorizationFrame(null).setVisible(true);
}
catch(Exception xxx) { throw new RuntimeException(xxx); }
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cancelButton;
private javax.swing.JButton continueButton;
private javax.swing.JTextField emailEntryJTextField;
private javax.swing.JLabel emailJLabel;
private javax.swing.JPanel jPanel1;
private javax.swing.JLabel textJLabel;
private javax.swing.JLabel titleJLabel;
// End of variables declaration//GEN-END:variables
}
|
[
"csardi.gabor@gmail.com"
] |
csardi.gabor@gmail.com
|
e52e65e77bd41810084a5ea9e1d60f0b632533cb
|
82cc2675fdc5db614416b73307d6c9580ecbfa0c
|
/eb-service/core-service/src/main/java/cn/comtom/core/main/omd/dao/OmdRequestDao.java
|
6cbceaf47a7e769539f33eb72f7638ff800c7d5a
|
[] |
no_license
|
hoafer/ct-ewbsv2.0
|
2206000c4d7c3aaa2225f9afae84a092a31ab447
|
bb94522619a51c88ebedc0dad08e1fd7b8644a8c
|
refs/heads/master
| 2022-11-12T08:41:26.050044
| 2020-03-20T09:05:36
| 2020-03-20T09:05:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 569
|
java
|
package cn.comtom.core.main.omd.dao;
import cn.comtom.core.fw.BaseDao;
import cn.comtom.core.fw.CoreMapper;
import cn.comtom.core.main.omd.entity.dbo.OmdRequest;
import cn.comtom.core.main.omd.mapper.OmdRequestMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class OmdRequestDao extends BaseDao<OmdRequest,String> {
@Autowired
private OmdRequestMapper mapper;
@Override
public CoreMapper<OmdRequest, String> getMapper() {
return mapper;
}
}
|
[
"568656253@qq.com"
] |
568656253@qq.com
|
a72884b3bf907a650edcecd6e86553525b8a1e4f
|
97f84489075f7f5a724d3165b603b22414acc48f
|
/AL-Game/src/com/aionemu/gameserver/dao/InventoryDAO.java
|
b4d3f88c0881f95b8c6e4f434c81b197016f9a8e
|
[] |
no_license
|
ElrondEru/Aion-Energy-Life-
|
10433fb7750905059bcd9411e1b0bd5a6c0032d1
|
817835029b41d5a66824c222552dca43a0d1b10d
|
refs/heads/master
| 2020-06-05T02:40:46.970965
| 2010-10-26T16:51:36
| 2010-10-26T16:51:36
| 1,026,165
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,958
|
java
|
/*
* This file is part of aion-unique <aionu-unique.com>.
*
* aion-unique is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* aion-unique is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with aion-unique. If not, see <http://www.gnu.org/licenses/>.
*/
package com.aionemu.gameserver.dao;
import java.util.List;
import com.aionemu.gameserver.model.gameobjects.Item;
import com.aionemu.gameserver.model.gameobjects.player.Equipment;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.model.gameobjects.player.Storage;
import com.aionemu.gameserver.model.gameobjects.player.StorageType;
/**
* @author ATracer
*/
public abstract class InventoryDAO implements IDFactoryAwareDAO
{
/**
* @param player
* @param StorageType
* @return Storage
*/
public abstract Storage loadStorage(Player player, StorageType storageType);
/**
* @param player
* @return Equipment
*/
public abstract Equipment loadEquipment(Player player);
/**
* @param playerId
* @return
*/
public abstract List<Item> loadEquipment(int playerId);
/**
* @param inventory
*/
public abstract boolean store(Player player);
/**
* @param item
*/
public abstract boolean store(Item item, int playerId);
/**
* @param playerId
*/
public abstract boolean deletePlayerItems(int playerId);
@Override
public String getClassName()
{
return InventoryDAO.class.getName();
}
}
|
[
"Destinywars@5f6b67ec-ab53-48ec-8083-8baf883bdfaa"
] |
Destinywars@5f6b67ec-ab53-48ec-8083-8baf883bdfaa
|
e701a00d6f678cd91726a65c4dbbdc8bb34337ac
|
54bafa3495c01a9530a662d441d45f35652e062f
|
/src/main/java/cn/promore/bf/action/LogAction.java
|
890459e23f2570d48061d5989c57e806b92a75b7
|
[] |
no_license
|
zskang/tsj
|
d20f397762d230c487c0c9ce2e7a2863dd83050f
|
0ff6bafec55e77f86097b164fd4f0b48db35eeff
|
refs/heads/master
| 2021-07-13T12:46:51.300209
| 2017-10-18T09:57:45
| 2017-10-18T09:57:52
| 107,389,919
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,441
|
java
|
package cn.promore.bf.action;
/**
* @author huzd@si-tech.com.cn or ahhzd@vip.qq.com
*/
import java.util.Collection;
import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import javax.annotation.Resource;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.MDC;
import org.apache.log4j.spi.LoggerRepository;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cache.ehcache.EhCacheCache;
import org.springframework.cache.ehcache.EhCacheCacheManager;
import org.springframework.stereotype.Controller;
import cn.promore.bf.bean.Log;
import cn.promore.bf.bean.Page;
import cn.promore.bf.serivce.LogService;
import net.sf.ehcache.management.CacheStatistics;
@Controller
@Action(value="logAction")
@ParentPackage("huzdDefault")
@Results({@Result(name="result",type="json"),
@Result(name="list",type="json",params={"includeProperties","logs\\[\\d+\\]\\.(id|username|clientIp|operateModule|operateModuleName|operateType|operateTime|operateContent|operateResult),page\\.(\\w+),flag,message","excludeNullProperties","true"})
})
public class LogAction extends BaseAction{
public static Logger LOG = LoggerFactory.getLogger(LogAction.class);
private static final long serialVersionUID = -8613055080615406396L;
@Resource
LogService logService;
@Resource
EhCacheCacheManager ehCacheManager;
private Log log;
private boolean flag = true;
private String message;
private Page page;
private List<Log> logs;
private Date startDate;
private Date endDate;
public LogAction() {
MDC.put("operateModuleName","日志管理");
}
@RequiresPermissions("log:get")
public String list(){
if(null==page)page=new Page();
page.setTotalRecords(logService.findDatasNo(log, startDate, endDate));
logs = logService.findDatas(log, page, startDate, endDate);
MDC.put("operateContent","日志列表查询");
LOG.info("");
return "list";
}
public String changeLogLevel(){
LoggerRepository loggerRepository = org.apache.log4j.LogManager.getLoggerRepository();
System.out.println("===========getCurrentCategories============");
Enumeration<?> allCategories = loggerRepository.getCurrentCategories();
while(allCategories.hasMoreElements()){
org.apache.log4j.Logger logger = (org.apache.log4j.Logger)allCategories.nextElement();
if(logger.getName().indexOf("cn.promore")!=-1)System.out.println("------------"+logger.getName());
}
System.out.println("=================getCurrentLoggers======Threshold:" + loggerRepository.getThreshold());
Enumeration<?> allLoggers = loggerRepository.getCurrentLoggers();
while(allLoggers.hasMoreElements()){
org.apache.log4j.Logger logger = (org.apache.log4j.Logger)allLoggers.nextElement();
if(logger.getName().indexOf("cn.promore")!=-1){
System.out.println("------------"+logger.getName());
}else {
LogManager.getLogger(logger.getName()).setLevel(Level.OFF);
}
}
System.out.println("======================="+LogManager.getRootLogger().getLevel());
//LogManager.getLogger(DocumentAction.class.getName()).setLevel(Level.INFO);
return "result";
}
public String cache(){
Collection<String> caches = ehCacheManager.getCacheNames();
for(String cacheName:caches){
System.out.println("缓存名称:"+cacheName);
EhCacheCache cache = (EhCacheCache)ehCacheManager.getCache(cacheName);
CacheStatistics cacheStatistics = new CacheStatistics(cache.getNativeCache());
System.out.println("缓存命中率:缓存命中:"+cacheStatistics.getCacheHits()+",缓存未命中:"+cacheStatistics.getCacheMisses()+"["+cacheStatistics.getCacheHitPercentage()+"]");
System.out.println("缓存存储对象数:"+cacheStatistics.getMemoryStoreObjectCount());
System.out.println("getInMemoryHitPercentage"+cacheStatistics.getInMemoryHitPercentage());
System.out.println("getOffHeapHitPercentage"+cacheStatistics.getOffHeapHitPercentage());
System.out.println("getOnDiskHitPercentage"+cacheStatistics.getOnDiskHitPercentage());
}
return null;
}
public String cleanCache(){
Collection<String> caches = ehCacheManager.getCacheNames();
for(String cacheName:caches){
System.out.println("缓存名称:"+cacheName);
EhCacheCache cache = (EhCacheCache)ehCacheManager.getCache(cacheName);
cache.clear();
}
return null;
}
public Log getLog() {
return log;
}
public void setLog(Log log) {
this.log = log;
}
public boolean isFlag() {
return flag;
}
public void setFlag(boolean flag) {
this.flag = flag;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public Page getPage() {
return page;
}
public void setPage(Page page) {
this.page = page;
}
public List<Log> getLogs() {
return logs;
}
public void setLogs(List<Log> logs) {
this.logs = logs;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
}
|
[
"253479240@qq.com"
] |
253479240@qq.com
|
a3d5444260ccd86594de379f5e6a41b249d77b37
|
478d2c6f93b77a198d0f8c64b21e576c05b1de18
|
/Library/src/Library.java
|
0a2da68c22b63086619dfeef00883d2a93e226e8
|
[] |
no_license
|
kryan1622/Work
|
82b49ad1c29fc6e3eea937e508229d87a4e5eede
|
e542687a264178c3867956fe578bc71ddba3afc7
|
refs/heads/master
| 2021-07-03T19:59:41.412588
| 2019-06-03T09:37:37
| 2019-06-03T09:37:37
| 188,248,203
| 0
| 0
| null | 2020-10-13T13:36:06
| 2019-05-23T14:17:20
|
HTML
|
UTF-8
|
Java
| false
| false
| 110
|
java
|
public class Library {
private String inStock;
public String getinStock() {
return this.inStock;
}
}
|
[
"krystalryan95@hotmail.co.uk"
] |
krystalryan95@hotmail.co.uk
|
7510f498c036e5fbab6ccdf13b29b1620f9d3254
|
33dbbbbbcfa2c7c29ccf3738ba647241c1ba91a0
|
/src/ExplicityDemo.java
|
7dc0c7f3b9b74b7a94bd90bdac16af4a9972c5bf
|
[] |
no_license
|
Aishwarya338/Ash
|
d77c76a8496982d6990b6a454fc70cc6a7603c35
|
09bbbbb099b1c18e73f2e2a05bcaf973f85f6e3f
|
refs/heads/master
| 2023-03-02T16:07:46.243476
| 2021-02-09T11:15:11
| 2021-02-09T11:15:11
| 336,253,298
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 924
|
java
|
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
public class ExplicityDemo
{
public static void main(String[] args)
{
System.setProperty("webdriver.chrome.driver", "./Software/chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get("C:/Users/Aishwarya/Desktop/Selenium/HTML Files/Sam1.html");
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.name("textA")).sendKeys("name");
WebDriverWait ww = new WebDriverWait(driver,10);
ww.until(ExpectedConditions.textToBePresentInElementValue(By.name("textA"),"name"));
driver.findElement(By.name("textB")).sendKeys("ABC");
}
}
|
[
"Aishwarya@Akshay"
] |
Aishwarya@Akshay
|
c79d82b82d52bb5eaaca8d9dd0e7489f3a2858cf
|
a6b3e337b8c26f14d36b00f2df46a57fd20d6e2a
|
/src/desagil/model/AndGate.java
|
f636da48da7d1aab675f8ea5353bb7b8db5a5f33
|
[] |
no_license
|
joaoppc/DesAgil_Projeto2
|
eb0eb43634c733b052f029c4b2ff1637fb235138
|
2b01d86c1b97e38b9c51d5ce4aa6b4e63e7c29e3
|
refs/heads/master
| 2020-07-15T12:46:49.859456
| 2016-03-31T13:10:12
| 2016-03-31T13:10:12
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 342
|
java
|
package desagil.model;
public class AndGate extends LogicGate {
private InputPin pinA;
private InputPin pinB;
@Override
public boolean getOutputValue(int index) {
boolean sinalA = pinA.getSource().getOutputValue(pinA.getIndex());
boolean sinalB = pinB.getSource().getOutputValue(pinB.getIndex());
return sinalA && sinalB;
}
}
|
[
"pedrocc4@al.insper.edu.br"
] |
pedrocc4@al.insper.edu.br
|
4992f8d899b894fa3d3087a0964e0b29ba20b73a
|
f3a3bde3eb42afff21c85914a8aa91d511809532
|
/build/generated-sources/ap-source-output/entity/ProspectType_.java
|
12cf1631f1716398ff78fe0a762489e62d52c5ba
|
[] |
no_license
|
kldgarrido/GConsultores_Admin
|
8a2debf5c1a9b8b5860811ff3ff109190deb15ab
|
fdaa9737c8ea663202a465a522e475fd9735c08f
|
refs/heads/master
| 2020-06-10T19:01:55.781468
| 2017-04-29T14:30:02
| 2017-04-29T14:30:02
| 75,903,233
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 624
|
java
|
package entity;
import entity.Prospect;
import javax.annotation.Generated;
import javax.persistence.metamodel.CollectionAttribute;
import javax.persistence.metamodel.SingularAttribute;
import javax.persistence.metamodel.StaticMetamodel;
@Generated(value="EclipseLink-2.5.2.v20140319-rNA", date="2016-11-07T17:48:07")
@StaticMetamodel(ProspectType.class)
public class ProspectType_ {
public static volatile CollectionAttribute<ProspectType, Prospect> prospectCollection;
public static volatile SingularAttribute<ProspectType, String> name;
public static volatile SingularAttribute<ProspectType, String> id;
}
|
[
"kldgarrido@gmail.com"
] |
kldgarrido@gmail.com
|
72541f03f1b760069b610dd3e5e4d71c165875b6
|
34dd3bb7860850841d06bf718b76d2ce63a3d166
|
/hip-message-server-service/src/main/java/org/hl7/v3/QUMTIN020030PL/ObjectFactory.java
|
ce8a9660565374962294a2cbd17a8dd84cf8c049
|
[] |
no_license
|
birkh8792/hip-message-server
|
3723bc0ea3b47a6aaa45dbb10815a8cff5499698
|
87bf2d7987232282e89209c629334d0c89c0c1d3
|
refs/heads/master
| 2023-04-03T14:05:46.917073
| 2019-09-20T07:11:24
| 2019-09-20T07:11:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 9,089
|
java
|
//
// 此文件是由 JavaTM Architecture for XML Binding (JAXB) 引用实现 v2.2.8-b130911.1802 生成的
// 请访问 <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// 在重新编译源模式时, 对此文件的所有修改都将丢失。
// 生成时间: 2018.12.19 时间 11:15:34 AM CST
//
package org.hl7.v3.QUMTIN020030PL;
import javax.xml.bind.annotation.XmlRegistry;
/**
* This object contains factory methods for each
* Java content interface and Java element interface
* generated in the org.hl7.v3 package.
* <p>An ObjectFactory allows you to programatically
* construct new instances of the Java representation
* for XML content. The Java representation of XML
* content can consist of schema derived interfaces
* and classes representing the binding of schema
* type definitions, element declarations and model
* groups. Factory methods for each of these are
* provided in this class.
*
*/
@XmlRegistry
public class ObjectFactory {
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.hl7.v3
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link QUMTIN020030PL }
*
*/
public QUMTIN020030PL createQUMTIN020030PL() {
return new QUMTIN020030PL();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess }
*
*/
public QUMTIN020030PL.ControlActProcess createQUMTIN020030PLControlActProcess() {
return new QUMTIN020030PL.ControlActProcess();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter createQUMTIN020030PLControlActProcessQueryByParameter() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayload() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.StatusCodeParam }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.StatusCodeParam createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadStatusCodeParam() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.StatusCodeParam();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadEffectiveTime() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadEffectiveTimeValueT() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT();
}
/**
* Create an instance of {@link NewDataSet }
*
*/
public NewDataSet createNewDataSet() {
return new NewDataSet();
}
/**
* Create an instance of {@link Id }
*
*/
public Id createId() {
return new Id();
}
/**
* Create an instance of {@link Device }
*
*/
public Device createDevice() {
return new Device();
}
/**
* Create an instance of {@link StatusCode }
*
*/
public StatusCode createStatusCode() {
return new StatusCode();
}
/**
* Create an instance of {@link Value }
*
*/
public Value createValue() {
return new Value();
}
/**
* Create an instance of {@link QUMTIN020030PL.CreationTime }
*
*/
public QUMTIN020030PL.CreationTime createQUMTIN020030PLCreationTime() {
return new QUMTIN020030PL.CreationTime();
}
/**
* Create an instance of {@link QUMTIN020030PL.InteractionId }
*
*/
public QUMTIN020030PL.InteractionId createQUMTIN020030PLInteractionId() {
return new QUMTIN020030PL.InteractionId();
}
/**
* Create an instance of {@link QUMTIN020030PL.ProcessingCode }
*
*/
public QUMTIN020030PL.ProcessingCode createQUMTIN020030PLProcessingCode() {
return new QUMTIN020030PL.ProcessingCode();
}
/**
* Create an instance of {@link QUMTIN020030PL.ProcessingModeCode }
*
*/
public QUMTIN020030PL.ProcessingModeCode createQUMTIN020030PLProcessingModeCode() {
return new QUMTIN020030PL.ProcessingModeCode();
}
/**
* Create an instance of {@link QUMTIN020030PL.AcceptAckCode }
*
*/
public QUMTIN020030PL.AcceptAckCode createQUMTIN020030PLAcceptAckCode() {
return new QUMTIN020030PL.AcceptAckCode();
}
/**
* Create an instance of {@link QUMTIN020030PL.Receiver }
*
*/
public QUMTIN020030PL.Receiver createQUMTIN020030PLReceiver() {
return new QUMTIN020030PL.Receiver();
}
/**
* Create an instance of {@link QUMTIN020030PL.Sender }
*
*/
public QUMTIN020030PL.Sender createQUMTIN020030PLSender() {
return new QUMTIN020030PL.Sender();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.Code }
*
*/
public QUMTIN020030PL.ControlActProcess.Code createQUMTIN020030PLControlActProcessCode() {
return new QUMTIN020030PL.ControlActProcess.Code();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.ActId }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.ActId createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadActId() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.ActId();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.AuthorId }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.AuthorId createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadAuthorId() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.AuthorId();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.PatientId }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.PatientId createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadPatientId() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.PatientId();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.StatusCodeParam.ValueS }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.StatusCodeParam.ValueS createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadStatusCodeParamValueS() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.StatusCodeParam.ValueS();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT.Low }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT.Low createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadEffectiveTimeValueTLow() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT.Low();
}
/**
* Create an instance of {@link QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT.High }
*
*/
public QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT.High createQUMTIN020030PLControlActProcessQueryByParameterQueryByParameterPayloadEffectiveTimeValueTHigh() {
return new QUMTIN020030PL.ControlActProcess.QueryByParameter.QueryByParameterPayload.EffectiveTime.ValueT.High();
}
}
|
[
"451657937@qq.com"
] |
451657937@qq.com
|
aae160c77890e6c7e8f6486dd1f96621a847a23c
|
0bf868e61f22b7306dd3d97aa83fbff88094b434
|
/src/main/java/com/xd/service/UserService.java
|
123373de9b6d67d21b92907ef8f5df4c70ff93c4
|
[] |
no_license
|
jacobke/xd_book
|
3e06914e2c47d08c88e48a9e83a7aac66843924f
|
e0b95d814f93639d956958e79b8265a31d518d40
|
refs/heads/master
| 2020-12-26T03:35:03.964990
| 2015-12-08T06:35:23
| 2015-12-08T06:35:23
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,248
|
java
|
package com.xd.service;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.springframework.stereotype.Service;
import sun.misc.BASE64Encoder;
import com.xd.dao.user.UserDao;
import com.xd.model.Department;
import com.xd.model.User;
@Service
public class UserService {
private UserDao userDao;
// 初始化
public UserService() {
userDao = new UserDao();
}
/**
* 获取md5加密后的字符串
*/
private String getMD5String(String source){
String md5string="";
try {
MessageDigest md5 = MessageDigest.getInstance("MD5");
BASE64Encoder base64en = new BASE64Encoder();
md5string = base64en.encode(md5.digest(source.getBytes("utf-8")));
} catch (NoSuchAlgorithmException e) {
System.out.println("MD5加密异常1......");
e.printStackTrace();
}
catch (UnsupportedEncodingException e) {
System.out.println("MD5加密异常2......");
e.printStackTrace();
}
return md5string;
}
/**
* 判断登录名是否可用
* @param user
* @return
*/
private boolean checkLoginName(User user) {
User u=new User();
boolean result=false;
u.setLoginName(user.getLoginName());
int i=userDao.getUserCount(u);
if(i>=1){
result=false;//该登录名不可用
}else{
result=true;//登录名可用
}
return result;
}
/**
* 获取人员数量
*
* @param user
* @return 数量
*/
public int getUserCount(User user) {
String MD5Password="";
if(!"".equals(user.getPassword())&&user.getPassword()!=null){
MD5Password=getMD5String(user.getPassword());
user.setPassword(MD5Password);
}
return userDao.getUserCount(user);
}
/**
* 登录
*
* @param user
* @return
*/
public Map<String, String> doLogin(User user,HttpServletRequest request) {
String MD5Password="";
Map<String, String> map=new HashMap<String, String>();
if("".equals(user.getPassword())||user.getPassword()==null){
map.put("status", "error");
map.put("msg", "请填写密码!");
}else if ("".equals(user.getLoginName())||user.getLoginName()==null) {
map.put("status", "error");
map.put("msg", "请填写登录名!");
}else{
MD5Password=getMD5String(user.getPassword());
user.setPassword(MD5Password);
List<User> list=userDao.getUserList(user);
int count=list.size();
if(count>1){
map.put("status", "error");
map.put("msg", "改登录名有多人使用,无法登录,请与管理员联系!");
}else if(count==1){
int status=list.get(0).getStatus();
if(status==1){
map.put("status", "success");
map.put("msg", "登录成功....");
HttpSession session=request.getSession();
session.setAttribute("user",list.get(0));
}else if (status==0) {
map.put("status", "error");
map.put("msg", "该账号未通过审核,请与管理员联系");
}else {
map.put("status", "error");
map.put("msg", "该账号状态异常,禁止登录,请速与管理员联系!");
}
}else if (count==0) {
map.put("status", "error");
map.put("msg", "登录名或密码错误请重新登录!");
}else {
map.put("status", "error");
map.put("msg", "该账号状态存在异常,请速与管理员联系!");
}
}
return map;
}
/**
* 插入人员
* @param user
* @return
*/
private String insertUser(User user){
String result;
// MD5 encrypt
user.setPassword(getMD5String(user.getPassword()));
if(user.getEntry().equals("")){
user.setEntry(null);
}
if(user.getBirth().equals("")){
user.setBirth(null);
}
int i = userDao.insertUser(user);
if(i>0){
result="注册成功";
}else {
result="注册失败";
}
return result;
}
/**
* 更新人员信息
* @param user
* @return
*/
private String updateUser(User user){
String result="";
int i=0;
i = userDao.updateUser(user);
if(i==0){
result="修改失败";
}else {
result="修改成功";
}
return result;
}
/**
* 保存用户信息
*
* @param user
* @return
*/
public String saveUser(User user) {
String result = "";
if(user.getName().equals("")||user.getName()==null){
result="请填写真实姓名";
}else if(user.getLoginName().equals("")||user.getLoginName()==null) {
result="请填写登录名";
}
else {
boolean b=checkLoginName(user);
if(b){//登陆名可用
if (user.getId() == 0) {// 插入
result=insertUser(user);
}
else {// 更新
result=updateUser(user);
}
}else {//登录名被占用
result="该登陆名被占用!";
}
}
return result;
}
/**
* 获取部门
*/
public List<Department> getDepart(){
return userDao.getDepart();
}
public List<User> getUserList(User user){
user.setPageStart(user.getcurrentPage());
return userDao.getUserList(user);
}
/**
* 删除用户
* @return 删除id
*/
public Map<String,String> deleteUser(User user){
int i=userDao.checkUserForDelete(user);
Map<String,String> map=new HashMap<String, String>();
if(i==0){//未发现未还书籍,可以删除
i=userDao.deleteUser(user);
if(i>0){
map.put("status", "success");
map.put("msg", "删除成功");
}else {
map.put("status", "error");
map.put("msg", "删除失败");
}
}else if(i>0){//有未还书籍,无法删除
map.put("status", "error");
map.put("msg", "该成员还有"+i+"书没有还.");
}else {
System.out.println("查阅是否有未还书籍时异常.....");
map.put("status", "error");
map.put("msg", "程序出现异常,请联系工作人员.");
}
return map;
}
/**
* 审核通过
* @param id
* @return
*/
public Map<String, String> yesUserStatus(int id){
int i=userDao.yesUserStatus(id);
Map<String, String> map=new HashMap<String, String>();
if(i>0){
map.put("status", "success");
map.put("msg", "修改成功!");
}else {
map.put("status", "error");
map.put("msg", "修改失败!");
}
return map;
}
/**
* 审核不通过
* @param id
* @return
*/
public Map<String, String> noUserStatus(int id){
int i=userDao.noUserStatus(id);
Map<String, String> map=new HashMap<String, String>();
if(i>0){
map.put("status", "success");
map.put("msg", "修改成功!");
}else {
map.put("status", "error");
map.put("msg", "修改失败!");
}
return map;
}
/**
* 设置管理员
* @param id
* @return
*/
public Map<String, String> yesManager(int id){
int i=userDao.yesManager(id);
Map<String, String> map=new HashMap<String, String>();
if(i>0){
map.put("status", "success");
map.put("msg", "修改成功!");
}else {
map.put("status", "error");
map.put("msg", "修改失败!");
}
return map;
}
/**
* 取消管理员
* @param id
* @return
*/
public Map<String, String> noManager(int id){
int i=userDao.noManager(id);
Map<String, String> map=new HashMap<String, String>();
if(i>0){
map.put("status", "success");
map.put("msg", "修改成功!");
}else {
map.put("status", "error");
map.put("msg", "修改失败!");
}
return map;
}
}
|
[
"ske@Ctrip.com"
] |
ske@Ctrip.com
|
f2518db1744ba598d2358f3a235e136207cd05e0
|
34da44ea59fabe5ef7912b82ab6cc994ce632d27
|
/app/src/main/java/com/example/saurav/uber/DriverSettingsActivity.java
|
8350717b5f9a6c4ff726c9231442b5e49cca5f84
|
[] |
no_license
|
Gaurav2048/Uber-clone
|
50b58f2818e55f4a96917b5ba7d50a91246b2564
|
7008a6309ada9e6bb8537797c9885285a5cd81d3
|
refs/heads/master
| 2020-03-23T15:14:31.116692
| 2018-07-20T16:04:34
| 2018-07-20T16:04:34
| 141,731,715
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,027
|
java
|
package com.example.saurav.uber;
import android.*;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.provider.MediaStore;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import com.bumptech.glide.Glide;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.OnFailureListener;
import com.google.android.gms.tasks.OnSuccessListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.google.firebase.storage.FirebaseStorage;
import com.google.firebase.storage.StorageReference;
import com.google.firebase.storage.UploadTask;
import com.karumi.dexter.Dexter;
import com.karumi.dexter.MultiplePermissionsReport;
import com.karumi.dexter.PermissionToken;
import com.karumi.dexter.listener.PermissionRequest;
import com.karumi.dexter.listener.multi.MultiplePermissionsListener;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import id.zelory.compressor.Compressor;
public class DriverSettingsActivity extends AppCompatActivity {
EditText name;
EditText phone_no;
EditText mCarfield;
Button confirm, back;
private FirebaseAuth mAuth;
ImageView profile_image;
private DatabaseReference mDriverDatabase;
String nName, nPhone, profileImageUri;
String service = "";
private Uri resultUri;
RadioGroup radio_group;
private String user_id;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_driver_settings);
name = (EditText) findViewById(R.id.name_driver);
phone_no = (EditText) findViewById(R.id.phone_no_driver);
confirm = (Button) findViewById(R.id.confirm);
back = (Button) findViewById(R.id.back);
radio_group=(RadioGroup) findViewById(R.id.radio_group);
profile_image = (ImageView) findViewById(R.id.profile_image);
mCarfield= (EditText) findViewById(R.id.car);
Dexter.withActivity(DriverSettingsActivity.this)
.withPermissions(
android.Manifest.permission.READ_EXTERNAL_STORAGE,
android.Manifest.permission.WRITE_EXTERNAL_STORAGE
)
.withListener(new MultiplePermissionsListener() {
@Override
public void onPermissionsChecked(MultiplePermissionsReport report) {
}
@Override
public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) {
}
}).check();
mAuth = FirebaseAuth.getInstance();
user_id = mAuth.getCurrentUser().getUid();
mDriverDatabase = FirebaseDatabase.getInstance().getReference().child("Users").child("Drivers").child(user_id);
getUserInfo();
profile_image.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(Intent.ACTION_PICK);
intent.setType("image/*");
startActivityForResult(intent, 300);
}
});
confirm.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
saveUserInformation();
}
});
back.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
return;
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if(requestCode ==300 && resultCode == Activity.RESULT_OK){
resultUri = data.getData();
try {
File compressedImage = new Compressor(this)
.setMaxWidth(310)
.setMaxHeight(310)
.setQuality(60)
.setCompressFormat(Bitmap.CompressFormat.JPEG)
.compressToFile(new File(resultUri.getPath()));
resultUri = Uri.fromFile(compressedImage);
} catch (IOException e) {
e.printStackTrace();
}
profile_image.setImageURI(resultUri);
}
super.onActivityResult(requestCode, resultCode, data);
}
private void getUserInfo (){
mDriverDatabase.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
if(dataSnapshot.exists() && dataSnapshot.getChildrenCount()>0){
Map<String, Object> map = (Map<String, Object>) dataSnapshot.getValue();
if(map.get("name")!= null){
nName = map.get("name").toString();
name.setText(nName);
}
if(map.get("car")!= null){
mCarfield.setText(map.get("car").toString());
}
if(map.get("phone")!= null){
nPhone = map.get("phone").toString();
phone_no.setText(nPhone);
}
if(map.get("service")!= null){
service = map.get("service").toString();
switch (service){
case "uberX":
radio_group.check(R.id.uberX);
break;
case "uberBlack":
radio_group.check(R.id.uberBlack);
break;
case "uberXl":
radio_group.check(R.id.uberXl);
break;
}
}
if(map.get("profileImageUri")!= null){
profileImageUri = map.get("profileImageUri").toString();
Glide.with(getApplication())
.load(profileImageUri).into(profile_image);
}
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
}
private void saveUserInformation() {
int selectId = radio_group.getCheckedRadioButtonId();
RadioButton radioButton = (RadioButton) findViewById(selectId);
if(radioButton.getText()==null){
return;
}
service = radioButton.getText().toString();
Map userinfo = new HashMap();
nName = name.getText().toString();
nPhone = phone_no.getText().toString();
userinfo.put("name", nName);
userinfo.put("phone",nPhone);
userinfo.put("car", mCarfield.getText().toString());
userinfo.put("service", service);
mDriverDatabase.updateChildren(userinfo, new DatabaseReference.CompletionListener() {
@Override
public void onComplete(@Nullable DatabaseError databaseError, @NonNull DatabaseReference databaseReference) {
}
});
if(resultUri!= null){
StorageReference filepath = FirebaseStorage.getInstance().getReference().child("image_profile").child(user_id);
Bitmap bitmap = null;
try {
bitmap = MediaStore.Images.Media.getBitmap(getApplication().getContentResolver()
, resultUri);
} catch (IOException e) {
e.printStackTrace();
}
ByteArrayOutputStream boas = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.JPEG, 50, boas);
byte[] data = boas.toByteArray();
UploadTask uploadTask = filepath.putBytes(data);
uploadTask.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
finish();
return;
}
});
uploadTask.addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
Task<Uri> downloadUri = taskSnapshot.getMetadata().getReference().getDownloadUrl();
downloadUri.addOnCompleteListener(new OnCompleteListener<Uri>() {
@Override
public void onComplete(@NonNull Task<Uri> task) {
Map newImage = new HashMap();
Log.e( "onComplete: ",task.getResult().toString() );
Uri imri = task.getResult();
newImage.put("profileImageUri", imri.toString());
mDriverDatabase.updateChildren(newImage);
finish();
return;
}
});
}
});
}
}
}
|
[
"2012ecs40@smvdu.ac.in"
] |
2012ecs40@smvdu.ac.in
|
e6dfe2fad76d0ecdfce1ff4aea5032c1552008de
|
a497eb708e7b831d9ee5ed3ef25a0df4e4e9c7cb
|
/MediaStrip-model/src/main/java/com/mediastrip/components/Media.java
|
998384bfe7db2378ded6240c69ba672a655e926b
|
[] |
no_license
|
Takiguchi72/MediaStripFilRouge
|
73e32cd996c0db2305c8ccd4b4b8b3f74b8d676d
|
6eaaa4ed957343753742b46861e64b45b1aa831e
|
refs/heads/master
| 2016-09-14T10:33:39.022876
| 2016-05-21T16:20:25
| 2016-05-21T16:20:25
| 59,359,252
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,117
|
java
|
package com.mediastrip.components;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* The Class Media.
*/
public class Media {
/* ********************************************************************* */
/* Attributes */
/* ********************************************************************* */
/** The id. */
private int id;
/** The title. */
private String title;
/** The description. */
private String description;
/** The creation date. */
private Date creationDate;
/** The publique. */
private boolean publique;
/** The publisher. */
private User publisher;
/** The main tag. */
private Tag mainTag;
/** The tag list. */
private List<Tag> tagList;
/* ********************************************************************* */
/* Constructors */
/* ********************************************************************* */
/**
* Default contructor that init an empty media.<br/>
* <br/>
* The {@code tagList} attribute is initialized as a Tag {@code ArrayList}.<br/>
* The {@code creationDate} attribute is initialized with the today's date.
*
* @see java.util.ArrayList
*/
public Media() {
tagList = new ArrayList<Tag>();
}
/**
* Init a new media with the parameters.
*
* @param pTitle
* The media title.
* @param pDescription
* The media description.
* @param pPublisher
* The media publisher.
* @param pMainTag
* The media main tag.
*/
public Media(final String pTitle, final String pDescription, final User pPublisher, final Tag pMainTag) {
this();
title = pTitle;
description = pDescription;
publisher = pPublisher;
mainTag = pMainTag;
}
/* ********************************************************************* */
/* Getters & Setters */
/* ********************************************************************* */
/**
* Gets the id.
*
* @return the id
*/
public int getId() {
return id;
}
/**
* Sets the id.
*
* @param id
* the new id
*/
public void setId(int id) {
this.id = id;
}
/**
* Gets the title.
*
* @return the title
*/
public String getTitle() {
return title;
}
/**
* Sets the title.
*
* @param title
* the new title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Gets the description.
*
* @return the description
*/
public String getDescription() {
return description;
}
/**
* Sets the description.
*
* @param description
* the new description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Gets the creation date.
*
* @return the creation date
*/
public Date getCreationDate() {
return creationDate;
}
/**
* Sets the creation date.
*
* @param creationDate
* the new creation date
*/
public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}
/**
* Checks if is publique.
*
* @return true, if is publique
*/
public boolean isPublique() {
return publique;
}
/**
* Sets the publique.
*
* @param publique
* the new publique
*/
public void setPublique(boolean publique) {
this.publique = publique;
}
/**
* Gets the publisher.
*
* @return the publisher
*/
public User getPublisher() {
return publisher;
}
/**
* Sets the publisher.
*
* @param publisher
* the new publisher
*/
public void setPublisher(User publisher) {
this.publisher = publisher;
}
/**
* Gets the main tag.
*
* @return the main tag
*/
public Tag getMainTag() {
return mainTag;
}
/**
* Sets the main tag.
*
* @param mainTag
* the new main tag
*/
public void setMainTag(Tag mainTag) {
this.mainTag = mainTag;
}
/**
* Gets the tag list.
*
* @return the tag list
*/
public List<Tag> getTagList() {
return tagList;
}
/**
* Sets the tag list.
*
* @param tagList
* the new tag list
*/
public void setTagList(List<Tag> tagList) {
this.tagList = tagList;
}
}
|
[
"florian.thierry72@gmail.com"
] |
florian.thierry72@gmail.com
|
3852fd600c7045c5e16c166cf3d45c2610fb8e8e
|
3635b3375180628170cdecdb9686517161cb6c0e
|
/springboot-admin/adminserver/src/main/java/com/dewen/CustomNotifier.java
|
9a72253758c3717db88ee0bb98428b2581db7acd
|
[] |
no_license
|
sengeiou/springboot-study
|
ec737e5916e6da096a1a5c09a893bf7815769d21
|
320c9f147c54240fd18b40bf5c22502cc63fc0cc
|
refs/heads/main
| 2023-08-12T03:43:12.863038
| 2021-10-12T14:09:40
| 2021-10-12T14:09:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,425
|
java
|
package com.dewen;
import de.codecentric.boot.admin.server.domain.entities.Instance;
import de.codecentric.boot.admin.server.domain.entities.InstanceRepository;
import de.codecentric.boot.admin.server.domain.events.InstanceEvent;
import de.codecentric.boot.admin.server.domain.events.InstanceStatusChangedEvent;
import de.codecentric.boot.admin.server.notify.AbstractEventNotifier;
import de.codecentric.boot.admin.server.notify.LoggingNotifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import reactor.core.publisher.Mono;
@Component
public class CustomNotifier extends AbstractEventNotifier {
private static final Logger LOGGER = LoggerFactory.getLogger(LoggingNotifier.class);
public CustomNotifier(InstanceRepository repository) {
super(repository);
}
@Override
protected Mono<Void> doNotify(InstanceEvent event, Instance instance) {
return Mono.fromRunnable(() -> {
if (event instanceof InstanceStatusChangedEvent) {
LOGGER.info("Instance {} ({}) is {}", instance.getRegistration().getName(), event.getInstance(),
((InstanceStatusChangedEvent) event).getStatusInfo().getStatus());
} else {
LOGGER.info("Instance {} ({}) {}", instance.getRegistration().getName(), event.getInstance(), event.getType());
}
});
}
}
|
[
"863572313@qq.com"
] |
863572313@qq.com
|
5ddeb62e61c5017d9c402b6c6846e28f458409b7
|
a00326c0e2fc8944112589cd2ad638b278f058b9
|
/src/main/java/000/130/082/CWE190_Integer_Overflow__int_max_square_04.java
|
9a35bbcb2ed44b7c693b934cf76c95b45bf98a36
|
[] |
no_license
|
Lanhbao/Static-Testing-for-Juliet-Test-Suite
|
6fd3f62713be7a084260eafa9ab221b1b9833be6
|
b095b11c7cb6d4a5bb2b76181e35d6ee00e96e68
|
refs/heads/master
| 2020-08-24T13:34:04.004149
| 2019-10-25T09:26:00
| 2019-10-25T09:26:00
| 216,822,684
| 0
| 1
| null | 2019-11-08T09:51:54
| 2019-10-22T13:37:13
|
Java
|
UTF-8
|
Java
| false
| false
| 6,617
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__int_max_square_04.java
Label Definition File: CWE190_Integer_Overflow__int.label.xml
Template File: sources-sinks-04.tmpl.java
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: max Set data to the maximum value for int
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: square
* GoodSink: Ensure there will not be an overflow before squaring data
* BadSink : Square data, which can lead to overflow
* Flow Variant: 04 Control flow: if(PRIVATE_STATIC_FINAL_TRUE) and if(PRIVATE_STATIC_FINAL_FALSE)
*
* */
public class CWE190_Integer_Overflow__int_max_square_04 extends AbstractTestCase
{
/* The two variables below are declared "final", so a tool should
* be able to identify that reads of these will always return their
* initialized values.
*/
private static final boolean PRIVATE_STATIC_FINAL_TRUE = true;
private static final boolean PRIVATE_STATIC_FINAL_FALSE = false;
public void bad() throws Throwable
{
int data;
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* POTENTIAL FLAW: Use the maximum value for this type */
data = Integer.MAX_VALUE;
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* POTENTIAL FLAW: if (data*data) > Integer.MAX_VALUE, this will overflow */
int result = (int)(data * data);
IO.writeLine("result: " + result);
}
}
/* goodG2B1() - use goodsource and badsink by changing first PRIVATE_STATIC_FINAL_TRUE to PRIVATE_STATIC_FINAL_FALSE */
private void goodG2B1() throws Throwable
{
int data;
if (PRIVATE_STATIC_FINAL_FALSE)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
else
{
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* POTENTIAL FLAW: if (data*data) > Integer.MAX_VALUE, this will overflow */
int result = (int)(data * data);
IO.writeLine("result: " + result);
}
}
/* goodG2B2() - use goodsource and badsink by reversing statements in first if */
private void goodG2B2() throws Throwable
{
int data;
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* POTENTIAL FLAW: if (data*data) > Integer.MAX_VALUE, this will overflow */
int result = (int)(data * data);
IO.writeLine("result: " + result);
}
}
/* goodB2G1() - use badsource and goodsink by changing second PRIVATE_STATIC_FINAL_TRUE to PRIVATE_STATIC_FINAL_FALSE */
private void goodB2G1() throws Throwable
{
int data;
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* POTENTIAL FLAW: Use the maximum value for this type */
data = Integer.MAX_VALUE;
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (PRIVATE_STATIC_FINAL_FALSE)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
IO.writeLine("Benign, fixed string");
}
else
{
/* FIX: Add a check to prevent an overflow from occurring */
/* NOTE: Math.abs of the minimum int or long will return that same value, so we must check for it */
if ((data != Integer.MIN_VALUE) && (data != Long.MIN_VALUE) && (Math.abs(data) <= (long)Math.sqrt(Integer.MAX_VALUE)))
{
int result = (int)(data * data);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too large to perform squaring.");
}
}
}
/* goodB2G2() - use badsource and goodsink by reversing statements in second if */
private void goodB2G2() throws Throwable
{
int data;
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* POTENTIAL FLAW: Use the maximum value for this type */
data = Integer.MAX_VALUE;
}
else
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run
* but ensure data is inititialized before the Sink to avoid compiler errors */
data = 0;
}
if (PRIVATE_STATIC_FINAL_TRUE)
{
/* FIX: Add a check to prevent an overflow from occurring */
/* NOTE: Math.abs of the minimum int or long will return that same value, so we must check for it */
if ((data != Integer.MIN_VALUE) && (data != Long.MIN_VALUE) && (Math.abs(data) <= (long)Math.sqrt(Integer.MAX_VALUE)))
{
int result = (int)(data * data);
IO.writeLine("result: " + result);
}
else
{
IO.writeLine("data value is too large to perform squaring.");
}
}
}
public void good() throws Throwable
{
goodG2B1();
goodG2B2();
goodB2G1();
goodB2G2();
}
/* Below is the main(). It is only used when building this testcase on
* its own for testing or for building a binary to use in testing binary
* analysis tools. It is not used when compiling all the testcases as one
* application, which is how source code analysis tools are tested.
*/
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"anhtluet12@gmail.com"
] |
anhtluet12@gmail.com
|
64199a2cc77f8261bd855eeffec6c60cc9f23fec
|
9673cdbd0ade399da78650c169fe5921d171d40e
|
/eventuate-client-java-common-impl/src/main/java/io/eventuate/javaclient/commonimpl/schemametadata/EventSchemaMetadataManagerImpl.java
|
722d323afed25ca3955bff4543b6bdd19262dd3c
|
[
"Apache-2.0"
] |
permissive
|
dialtahi/eventuate-client-java
|
242d53816a0e974c5fc13d342d6bf4ac709790c9
|
62b8ae6f41894b582429704467325076a236a485
|
refs/heads/master
| 2020-09-05T13:04:32.728794
| 2019-11-07T00:17:12
| 2019-11-07T00:24:06
| 220,113,918
| 0
| 0
|
NOASSERTION
| 2019-11-07T00:04:09
| 2019-11-07T00:04:08
| null |
UTF-8
|
Java
| false
| false
| 1,480
|
java
|
package io.eventuate.javaclient.commonimpl.schemametadata;
import io.eventuate.javaclient.commonimpl.EventIdTypeAndData;
import java.util.List;
import java.util.Optional;
import static java.util.stream.Collectors.toList;
public class EventSchemaMetadataManagerImpl implements EventSchemaMetadataManager {
@Override
public Optional<String> currentVersion(Class clasz) {
throw new UnsupportedOperationException();
}
@Override
public List<EventIdTypeAndData> upcastEvents(Class clasz, List<EventIdTypeAndData> events) {
Optional<String> possibleVersion = currentVersion(clasz);
if (possibleVersion.isPresent()) {
return events.stream().map(event -> maybeUpcast(clasz, possibleVersion.get(), event)).collect(toList());
} else {
return events;
}
}
private EventIdTypeAndData maybeUpcast(Class clasz, String latestVersion, EventIdTypeAndData event) {
return eventVersion(event).map(currentVersion -> needsUpcast(latestVersion, currentVersion) ? upcast(event, latestVersion, currentVersion) : event).orElse(event);
}
private EventIdTypeAndData upcast(EventIdTypeAndData event, String latestVersion, String actualVersion) {
throw new UnsupportedOperationException();
}
private Optional<String> eventVersion(EventIdTypeAndData event) {
throw new UnsupportedOperationException();
}
private boolean needsUpcast(String latestVersion, String currentVersion) {
throw new UnsupportedOperationException();
}
}
|
[
"chris@chrisrichardson.net"
] |
chris@chrisrichardson.net
|
60eed82851e55e6bb7db427f4fd31b6736ea0a60
|
e56e5863b8cb49692cae552131ee9b565f1dcdd8
|
/edu/Design/Structure/Decorator/Test.java
|
4ac3bb0d6ec3f05312b48acce71da8ad30851015
|
[] |
no_license
|
jufangqi/JvavSE
|
bc9000ca68459667f0e3ded5be6923552392cc93
|
4bab8153bb9ae215b9ff1280b8ce925339be84e4
|
refs/heads/master
| 2021-01-20T02:41:52.400717
| 2016-06-26T09:44:29
| 2016-06-26T09:44:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 243
|
java
|
package edu.Design.Structure.Decorator;
/**
* Created by 存 on 2016/6/26.
*/
public class Test {
public static void main(String[] args) {
Sourceable decorator = new Decorator(new Source());
decorator.method();
}
}
|
[
"丁存"
] |
丁存
|
4dd2ba0374aa32b3cd58bfddd47b4135ef58a5fc
|
be0c5806775d0e06b66701d0cdc3ab610411b157
|
/hibernate-1/src/test/java/com/kaishengit/test/HibernateUserTestCase.java
|
c47bec3ab2d461f88d801a40e661557386ebc57b
|
[] |
no_license
|
lizhenqi/MyJava-1
|
7a6b58a721228e0eafe689444e4b4a3716989388
|
392b3a3fb9f5f09f55204130bed33668b423d6ba
|
refs/heads/master
| 2021-01-17T08:17:02.570164
| 2016-08-01T17:43:52
| 2016-08-01T17:43:52
| 63,957,383
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,496
|
java
|
package com.kaishengit.test;
import com.kaishengit.pojo.User;
import com.kaishengit.util.HibernateUtil;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
import org.junit.Test;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.List;
/**
* Created by Administrator on 2016/7/25.
*/
public class HibernateUserTestCase {
@Test
public void testSave() {
Configuration configuration = new Configuration().configure();
// hibernate 3.x用,现在已经不推荐用了
// SessionFactory sessionFactory=configuration.buildSessionFactory();
// hiberrnate 4.3以后才这样用
ServiceRegistry registry = new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build();
SessionFactory sessionFactory = configuration.buildSessionFactory(registry);
// session
Session session = sessionFactory.getCurrentSession();
Transaction transaction = session.beginTransaction();//session要求所有操作都要在事务中进行
User user = new User();
user.setUsername("李振起");
user.setPassword("密码");
session.save(user);
// session.getTransaction().commit();//事务的结束要么回滚,要么commit这两种都行。
// session.getTransaction().rollback();如果不想获取事务,可以在开始事务时候返回一个对象,直接回滚或是commit。
transaction.commit();//结束事务(会自动关闭连接池)
// session.close();//因为事务结束之后就会自动关闭这里就不要再次关闭了,否则会报错!
}
@Test
public void testFindById(){
// 步骤
Session session=HibernateUtil.getSession();//1:取Session
Transaction transaction=session.beginTransaction();//2:开始事务
//3:操作
User user= (User) session.get(User.class,51);
System.out.println(user);
//4:提交或回滚(包括关闭session)
transaction.commit();
}
@Test
public void testUpdate(){
// 步骤
Session session=HibernateUtil.getSession();//1:取Session
Transaction transaction=session.beginTransaction();//2:开始事务
//3:操作
User user= (User) session.get(User.class,51);
user.setUsername("Hibernate测试");//先出来再改
//4:提交或回滚(包括关闭session)
transaction.commit();
}
@Test
public void testDel(){
Session session=HibernateUtil.getSession();
Transaction transaction=session.beginTransaction();
User user= (User) session.get(User.class,52);
session.delete(user);//根据对象删除,不是id(先查出来再删除)
transaction.commit();
}
@Test
public void testFindAll(){
Session session=HibernateUtil.getSession();
Transaction transaction=session.beginTransaction();
String hql="from User";//是数据库对应的pojo中的对象,不是数据库的表。
Query query=session.createQuery(hql);
List<User> userList=query.list();
for(User user:userList){
System.out.println(user);
}
transaction.commit();
}
}
|
[
"565400895@qq.com"
] |
565400895@qq.com
|
de4fe3f0f032c4b6a352174a4dee36dd5e9caa8c
|
8be5a1abeda189ec68b1903df72e28ad386bcfa9
|
/adfs-hdfs-project/adfs-hdfs/src/main/java/com/taobao/adfs/file/FileCache.java
|
0c7280bd678861690a223eb7df4fc4c58c76518a
|
[
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
paulzhu8597/ADFS
|
994084d17f351176281e2e9fa8fe4e9a2b1f01f2
|
a52a3b070e3d9f7ff5a06e03408c7f01e9bde678
|
refs/heads/master
| 2020-03-19T07:32:21.438470
| 2012-06-26T09:06:01
| 2012-06-26T09:15:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 10,079
|
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 com.taobao.adfs.file;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicLong;
import com.taobao.adfs.distributed.DistributedDataCache;
import com.taobao.adfs.distributed.DistributedDataVersion;
import com.taobao.adfs.util.Cloneable;
import com.taobao.adfs.util.DeepArray;
import com.taobao.adfs.util.Utilities;
/**
* @author <a href=mailto:zhangwei.yangjie@gmail.com/jiwan@taobao.com>zhangwei/jiwan</a>
*/
public class FileCache extends DistributedDataCache {
AtomicLong getNumberOfId = new AtomicLong(0);
AtomicLong hitNumberOfId = new AtomicLong(0);
AtomicLong getNumberOfParentIdAndName = new AtomicLong(0);
AtomicLong hitNumberOfParentIdAndName = new AtomicLong(0);
Map<DeepArray, CacheValue> cacheOfId = new ConcurrentHashMap<DeepArray, CacheValue>();
Map<DeepArray, CacheValue> cacheOfParentIdAndName = new ConcurrentHashMap<DeepArray, CacheValue>();
public FileCache(int capacity, DistributedDataVersion version) {
super(capacity);
}
@Override
protected void addForInsertInternal(Cloneable value) {
if (value instanceof File) {
File file = (File) value;
addInternal("PRIMARY", new Object[] { file.id }, file);
addInternal("PID_NAME", new Object[] { file.parentId, file.name }, file);
}
}
@Override
protected void addForUpdateInternal(Cloneable oldValue, Cloneable newValue) {
if (oldValue instanceof File && newValue instanceof File) {
File oldFile = (File) oldValue;
File newFile = (File) newValue;
addInternal("PRIMARY", new Object[] { newFile.id }, newFile);
addInternal("PID_NAME", new Object[] { newFile.parentId, newFile.name }, newFile);
if (newFile.parentId != oldFile.parentId || !newFile.name.equals(oldFile.name))
addInternal("PID_NAME", new Object[] { oldFile.parentId, oldFile.name }, null);
}
}
@Override
protected void addForDeleteInternal(Cloneable value) {
if (value instanceof File) {
File file = (File) value;
addInternal("PRIMARY", new Object[] { file.id }, null);
addInternal("PID_NAME", new Object[] { file.parentId, file.name }, null);
}
}
@Override
protected void addInternal(String indexName, Object[] key, Cloneable value) {
if (indexName.equals("PRIMARY")) {
DeepArray deepArrayKey = new DeepArray(key.clone());
CacheValue cacheValue = new CacheValue(indexName, deepArrayKey, value == null ? null : ((File) value).clone());
cacheOfLog.offer(cacheValue);
sizeOfLog.getAndIncrement();
cacheOfId.put(deepArrayKey, cacheValue);
} else if (indexName.equals("PID_NAME") && key.length == 2) {
DeepArray deepArrayKey = new DeepArray(key.clone());
CacheValue cacheValue = new CacheValue(indexName, deepArrayKey, value == null ? null : ((File) value).clone());
cacheOfLog.offer(cacheValue);
sizeOfLog.getAndIncrement();
cacheOfParentIdAndName.put(deepArrayKey, cacheValue);
}
if (sizeOfLog.get() > capacity) {
CacheValue cacheValue = cacheOfLog.poll();
sizeOfLog.getAndDecrement();
if (cacheValue != null) {
if (cacheValue.getName().equals("PRIMARY")) cacheOfId.remove(cacheValue.getKey());
else if (cacheValue.getName().equals("PID_NAME")) cacheOfParentIdAndName.remove(cacheValue.getKey());
}
}
}
@Override
protected void removeInternal(Cloneable value) {
if (value instanceof File) {
File file = (File) value;
cacheOfId.remove(new DeepArray(file.id));
cacheOfParentIdAndName.remove(new DeepArray(file.parentId, file.name));
}
}
@Override
protected CacheValue getInternal(boolean updateHitRate, String indexName, Object... key) {
if (indexName.equals("PRIMARY")) {
CacheValue cacheValue = cacheOfId.get(new DeepArray(key));
if (updateHitRate) {
getNumberOfId.getAndIncrement();
if (cacheValue != null) hitNumberOfId.getAndIncrement();
}
Utilities.logDebug(logger, "threadId=", Thread.currentThread().getId(), "|threadName=", Thread.currentThread()
.getName(), "|get|", indexName, "|", key, "|", cacheValue, "|hitNumber=", hitNumberOfId.get(), "|getNumber=",
getNumberOfId.get(), "|hitRate=", hitNumberOfId.get() * 1.0 / getNumberOfId.get());
return cacheValue;
} else if (indexName.equals("PID_NAME") && key.length == 2) {
CacheValue cacheValue = cacheOfParentIdAndName.get(new DeepArray(key));
if (updateHitRate) {
getNumberOfParentIdAndName.getAndIncrement();
if (cacheValue != null) hitNumberOfParentIdAndName.getAndIncrement();
}
Utilities.logDebug(logger, "threadId=", Thread.currentThread().getId(), "|threadName=", Thread.currentThread()
.getName(), "|get|", indexName, "|", key, "|", cacheValue, "|hitNumber=", hitNumberOfParentIdAndName.get(),
"|getNumber=", getNumberOfParentIdAndName.get(), "|hitRate=", hitNumberOfParentIdAndName.get() * 1.0
/ getNumberOfParentIdAndName.get());
return cacheValue;
} else return null;
}
@Override
protected void closeInternal() {
cacheOfId.clear();
cacheOfParentIdAndName.clear();
}
@Override
protected String toStringInternal() {
String string = "cacheOfId-hitNumber=" + hitNumberOfId;
string += "\ncacheOfId-getNumber=" + getNumberOfId;
string += "\ncacheOfId-hitRate=" + hitNumberOfId.get() * 100.0F / getNumberOfId.get();
string += "\ncacheOfId[" + cacheOfId.size() + "]=" + (cacheOfId.size() > 10000 ? "too large" : cacheOfId);
string += "\ncacheOfParentIdAndName-hitNumber=" + hitNumberOfParentIdAndName;
string += "\ncacheOfParentIdAndName-getNumber=" + getNumberOfParentIdAndName;
string +=
"\ncacheOfParentIdAndName-hitRate=" + hitNumberOfParentIdAndName.get() * 100.0
/ getNumberOfParentIdAndName.get();
string +=
"\ncacheOfParentIdAndName[" + cacheOfParentIdAndName.size() + "]="
+ (cacheOfParentIdAndName.size() > 10000 ? "too large" : cacheOfParentIdAndName);
return string;
}
@Override
protected void updateMetricsInternal(String indexName, Object[] key, CacheValue cacheValue) {
if (indexName.equals("PRIMARY")) {
updateMetrics("FileById", cacheOfId, getNumberOfId, hitNumberOfId);
} else if (indexName.equals("PID_NAME") && key.length == 2) {
updateMetrics("FileByParentIdAndName", cacheOfParentIdAndName, getNumberOfParentIdAndName,
hitNumberOfParentIdAndName);
}
}
@Override
protected void lockForInsertInternal(Cloneable value) {
if (value instanceof File) {
File file = (File) value;
lockInternal("PRIMARY", file.id);
lockInternal("PID_NAME", file.parentId, file.name);
}
}
@Override
protected void lockForUpdateInternal(Cloneable oldValue, Cloneable newValue) {
if (oldValue instanceof File && newValue instanceof File) {
File oldFile = (File) oldValue;
File newFile = (File) newValue;
lockInternal("PRIMARY", newFile.id);
lockInternal("PID_NAME", newFile.parentId, newFile.name);
if (newFile.parentId != oldFile.parentId || !newFile.name.equals(oldFile.name))
lockInternal("PID_NAME", oldFile.parentId, oldFile.name);
}
}
protected void lockForDeleteInternal(Cloneable value) {
if (value instanceof File) {
File file = (File) value;
lockInternal("PRIMARY", file.id);
lockInternal("PID_NAME", file.parentId, file.name);
}
}
@Override
protected void lockInternal(String indexName, Object... key) {
if (indexName.equals("PRIMARY") || (indexName.equals("PID_NAME") && key.length == 2)) {
locker.lock(null, Long.MAX_VALUE, Long.MAX_VALUE, indexName, key);
}
}
@Override
protected boolean tryLockInternal(String indexName, Object... key) {
if (indexName.equals("PRIMARY") || (indexName.equals("PID_NAME") && key.length == 2))
return locker.tryLock(null, Long.MAX_VALUE, indexName, key) != null;
return false;
}
@Override
protected void unlockForInsertInternal(Cloneable value) {
if (value instanceof File) {
File file = (File) value;
unlockInternal("PID_NAME", file.parentId, file.name);
unlockInternal("PRIMARY", file.id);
}
}
@Override
protected void unlockForDeleteInternal(Cloneable value) {
if (value instanceof File) {
File file = (File) value;
unlockInternal("PID_NAME", file.parentId, file.name);
unlockInternal("PRIMARY", file.id);
}
}
@Override
protected void unlockForUpdateInternal(Cloneable oldValue, Cloneable newValue) {
if (oldValue instanceof File && newValue instanceof File) {
File oldFile = (File) oldValue;
File newFile = (File) newValue;
if (newFile.parentId != oldFile.parentId || !newFile.name.equals(oldFile.name))
unlockInternal("PID_NAME", oldFile.parentId, oldFile.name);
unlockInternal("PID_NAME", newFile.parentId, newFile.name);
unlockInternal("PRIMARY", newFile.id);
}
}
@Override
protected void unlockInternal(String indexName, Object... key) {
if (indexName.equals("PRIMARY") || (indexName.equals("PID_NAME") && key.length == 2)) {
locker.unlock(null, indexName, key);
}
}
}
|
[
"jiwan@taobao.com"
] |
jiwan@taobao.com
|
8957c7f9c6ac2a30225f1b9d3465de690086a35a
|
b40c95a98aab2f58fa265e7691c68befa5c1db32
|
/src/main/java/cz/cvut/springframework/security/endpoint/AbstractEndpoint.java
|
d2c29e61ed331d120d270fcad4db5f9bd7cf3034
|
[
"MIT"
] |
permissive
|
vitek499/spring-user-managment
|
84547b4a6e55b08997ee03b337816e6474e843cd
|
8167c7f8bf6d09e700ac92d413a50537569a0a9b
|
refs/heads/master
| 2021-01-09T06:35:18.559287
| 2017-02-05T15:49:51
| 2017-02-05T15:49:51
| 81,002,222
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,628
|
java
|
/*
* The MIT License
*
* Copyright 2016 Vit Stekly <stekly.vit@vs-point.cz>.
*
* 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 cz.cvut.springframework.security.endpoint;
import cz.cvut.springframework.security.common.messanger.UserMessanger;
import org.springframework.beans.factory.InitializingBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.util.Assert;
/**
*
* @author Vit Stekly <stekly.vit@vs-point.cz>
*/
abstract public class AbstractEndpoint implements InitializingBean {
protected final Log logger = LogFactory.getLog(getClass());
private UserDetailsService clientDetailsService;
private UserMessanger userMessanger;
@Override
public void afterPropertiesSet() {
Assert.state(clientDetailsService != null, "ClientDetailsService must be provided");
Assert.state(userMessanger != null, "UserMessanger must be provided");
}
public UserDetailsService getClientDetailsService() {
return clientDetailsService;
}
public void setClientDetailsService(UserDetailsService clientDetailsService) {
this.clientDetailsService = clientDetailsService;
}
/**
* @return the userMessanger
*/
public UserMessanger getUserMessanger() {
return userMessanger;
}
/**
* @param userMessanger the userMessanger to set
*/
public void setUserMessanger(UserMessanger userMessanger) {
this.userMessanger = userMessanger;
}
}
|
[
"stekly.vit@vs-point.cz"
] |
stekly.vit@vs-point.cz
|
aec3d394d6b06ff15d5dc3a3390af63689d21128
|
c7bf8c229060dba69f78455751b6d0b3794221ab
|
/src/test/java/guitests/guihandles/PersonProfilePageHandle.java
|
62a317455fa35987f34facf0872a3ab208519ddc
|
[
"MIT"
] |
permissive
|
CS2103-AY1819S1-W16-3/main
|
15fcb44e2ebc70e372cb6b713153eb3027ea1957
|
6a56dd66e19d07dea1718c1494282bdd96bea934
|
refs/heads/master
| 2020-03-28T19:15:06.856069
| 2018-11-15T12:12:21
| 2018-11-15T12:12:21
| 148,958,774
| 0
| 10
|
NOASSERTION
| 2018-11-15T12:12:22
| 2018-09-16T03:11:37
|
Java
|
UTF-8
|
Java
| false
| false
| 380
|
java
|
package guitests.guihandles;
import javafx.scene.Node;
/**
* A handle for the {@code PersonProfilePageHandle} in the GUI.
*/
public class PersonProfilePageHandle extends NodeHandle<Node> {
public static final String PERSON_PROFILE_PAGE_ID = "#personListView";
public PersonProfilePageHandle(Node personProfilePageNode) {
super(personProfilePageNode);
}
}
|
[
"kennethgoh96.989@gmail.com"
] |
kennethgoh96.989@gmail.com
|
cce12c9c71e0d5d7f6ea42356e2d6f75745073c1
|
f5635f18a2f112d697f37d14c5eeeba2511d769a
|
/app/src/main/java/com/example/inceptive/imageadapter/Activity/PrefTag.java
|
ce7f688731974065e9fcc9e194d845d0284beaf5
|
[] |
no_license
|
asmita457/jabil-outbound-android
|
b1284fa27e0a3290b2c0ef01623f4b36c92f5463
|
fbb4038f63e3cc097d93c405cac0d2264ab300a8
|
refs/heads/master
| 2020-09-20T03:43:43.440029
| 2019-01-02T10:41:48
| 2019-01-02T10:41:48
| 224,369,056
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 116
|
java
|
package com.example.inceptive.imageadapter.Activity;
class PrefTag
{
public static Object PART_NO="part_no";
}
|
[
"asmita.belhekar@inceptiveconsulting.com"
] |
asmita.belhekar@inceptiveconsulting.com
|
f244451ce97e1d701ce4885ce832430b40a22897
|
5d642a5aadfbcf5d876c3d22d6e9d16835ac91f6
|
/Sample035SelectionInsertion/src/Sort.java
|
0e4279c841ee58b9534545bc7edef87b158b32fd
|
[] |
no_license
|
theeverlastingconcubine/ooOooOoo
|
704f9ac4d156057fd22877d9d1b1b13333366cf5
|
40330fd5a2453286de7001bd79de558890317893
|
refs/heads/master
| 2021-01-11T09:16:36.834406
| 2017-06-19T16:37:37
| 2017-06-19T16:37:37
| 77,223,365
| 0
| 1
| null | 2017-01-09T21:23:59
| 2016-12-23T12:13:25
|
Java
|
UTF-8
|
Java
| false
| false
| 1,343
|
java
|
public class Sort {
public static void shell(Comparable[] a){
int N = a.length;
int h = 1;
while(h<N/3) h = 3*h + 1;
while(h>=1){
for(int i = h; i<N; i++){
for(int j = i; j>=h;j=j-h){
if(less(a, j, j-h)) swap(a,j,j-h);
}
}
h = h/3;
}
}
public static void bubble(Comparable[] a){
int k;
do{ k = 0;
for(int i=0; i<a.length-1; i++){
if(less(a,i+1,i)) {swap(a, i,i+1); k=1;}
}
}
while (k!=0);
}
public static void selection(Comparable[] a){
for(int i = 0; i<a.length-1; i++){
int min = i;
for(int j = i+1; j<a.length; j++){
if(less(a, j, min)) min = j;
}
swap(a, min, i);
}
}
public static void insertion(Comparable[] a){
for(int i = 1; i<a.length-1; i++){
for (int j=i+1; j>0; j--){
if(less(a, j, j-1)) swap(a,j,j-1);
}
}
}
private static void swap(Comparable[] a, int i, int j){
Comparable tmp = a[i];
a[i] = a[j];
a[j] = tmp;
}
private static boolean less(Comparable[] a, int i, int j){
return a[i].compareTo(a[j])<0;
}
public static boolean isSorted(Comparable[] a){
for(int i=0; i<a.length-1; i++){
if (less(a, i+1, i)) return false;
}
return true;
}
}
|
[
"oOo@oOo.oOo"
] |
oOo@oOo.oOo
|
9c9fdc70c10a8843248880777b0c605e1cce2e3f
|
bae5560835d8adcd3b9c838d60e320be61eea53b
|
/src/main/java/it/trade/model/reponse/CryptoTradeOrderDetails.java
|
0e2843b6a9ac7e74fc973b9a221147f1e089aea3
|
[
"Apache-2.0"
] |
permissive
|
tradingticket/JavaApi
|
76a99a6c4afd88f624d523cbe03b104034b3bce3
|
c40b169faa6abe43565a2c3489ca03b07a2720ea
|
refs/heads/develop
| 2021-03-27T15:28:58.932647
| 2019-02-20T06:48:50
| 2019-02-20T06:48:50
| 89,289,377
| 4
| 4
|
Apache-2.0
| 2019-02-20T11:50:32
| 2017-04-24T21:35:23
|
Java
|
UTF-8
|
Java
| false
| false
| 841
|
java
|
package it.trade.model.reponse;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
public class CryptoTradeOrderDetails {
@SerializedName("orderLimitPrice")
@Expose
public Double orderLimitPrice;
@SerializedName("orderStopPrice")
@Expose
public Double orderStopPrice;
@SerializedName("orderExpiration")
@Expose
public String orderExpiration;
@SerializedName("orderAction")
@Expose
public String orderAction;
@SerializedName("orderPair")
@Expose
public String orderPair;
@SerializedName("orderPriceType")
@Expose
public String orderPriceType;
@SerializedName("orderQuantity")
@Expose
public Double orderQuantity;
@SerializedName("orderQuantityType")
@Expose
public String orderQuantityType;
}
|
[
"guillaume.debavelaere@gmail.com"
] |
guillaume.debavelaere@gmail.com
|
f09ef2cb2d60dcebfa124937d37015ff61f7cae8
|
e7ee311e20b40c87bf6d23a53a1d7b11fd29d2c3
|
/src/chosun/ciis/ad/bas/rec/AD_BAS_3510_LCURLISTRecord.java
|
5b3d3b2760635351ba8d1a43946120b865f9a605
|
[] |
no_license
|
nosmoon/misdevteam
|
4e3695ef7bbdcd231bb84d7d8d7df54a23ff0a60
|
1829d5bd489eb6dd307ca244f0e183a31a1de773
|
refs/heads/master
| 2020-04-15T15:57:05.480056
| 2019-01-10T01:12:01
| 2019-01-10T01:12:01
| 164,812,547
| 1
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 2,672
|
java
|
/***************************************************************************************************
* 파일명 : .java
* 기능 : 독자우대-구독신청
* 작성일자 : 2007-05-22
* 작성자 : 김대섭
***************************************************************************************************/
/***************************************************************************************************
* 수정내역 :
* 수정자 :
* 수정일자 :
* 백업 :
***************************************************************************************************/
package chosun.ciis.ad.bas.rec;
/**
*
*/
public class AD_BAS_3510_LCURLISTRecord extends java.lang.Object implements java.io.Serializable{
public String oth_clsf;
public String pubc_dt;
public String pubc_side;
public String issu_ser_no;
public String std;
public String advcs;
public String advt_cont;
public String indt_clsf;
public String slcrg_pers;
public String pubc_amt;
public String pubc_seq;
public AD_BAS_3510_LCURLISTRecord(){}
public void setOth_clsf(String oth_clsf){
this.oth_clsf = oth_clsf;
}
public void setPubc_dt(String pubc_dt){
this.pubc_dt = pubc_dt;
}
public void setPubc_side(String pubc_side){
this.pubc_side = pubc_side;
}
public void setIssu_ser_no(String issu_ser_no){
this.issu_ser_no = issu_ser_no;
}
public void setStd(String std){
this.std = std;
}
public void setAdvcs(String advcs){
this.advcs = advcs;
}
public void setAdvt_cont(String advt_cont){
this.advt_cont = advt_cont;
}
public void setIndt_clsf(String indt_clsf){
this.indt_clsf = indt_clsf;
}
public void setSlcrg_pers(String slcrg_pers){
this.slcrg_pers = slcrg_pers;
}
public void setPubc_amt(String pubc_amt){
this.pubc_amt = pubc_amt;
}
public void setPubc_seq(String pubc_seq){
this.pubc_seq = pubc_seq;
}
public String getOth_clsf(){
return this.oth_clsf;
}
public String getPubc_dt(){
return this.pubc_dt;
}
public String getPubc_side(){
return this.pubc_side;
}
public String getIssu_ser_no(){
return this.issu_ser_no;
}
public String getStd(){
return this.std;
}
public String getAdvcs(){
return this.advcs;
}
public String getAdvt_cont(){
return this.advt_cont;
}
public String getIndt_clsf(){
return this.indt_clsf;
}
public String getSlcrg_pers(){
return this.slcrg_pers;
}
public String getPubc_amt(){
return this.pubc_amt;
}
public String getPubc_seq(){
return this.pubc_seq;
}
}
/* 작성시간 : Wed Apr 15 18:21:44 KST 2009 */
|
[
"DLCOM000@172.16.30.11"
] |
DLCOM000@172.16.30.11
|
3931bddeee17d977ad5f02c5bd6ec3424f493584
|
a6fc9dec68a1ccc5a874a7c5f221553c4313d6da
|
/library/src/main/java/io/netopen/hotbitmapgg/library/view/SpeedView.java
|
4202ff5662a5c796ac2ff7e1d8250f50a872a2fa
|
[] |
no_license
|
HotBitmapGG/SpeedView
|
035b23f7c0f51d444ff5acddac1a57e3279360cb
|
f82eb6f3850469afd8990f54dd56abad5a4a1790
|
refs/heads/master
| 2021-01-20T17:21:10.402894
| 2016-08-23T15:37:34
| 2016-08-23T15:37:34
| 64,356,154
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 655
|
java
|
package io.netopen.hotbitmapgg.library.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
/**
* Created by hcc on 16/7/25 20:08
* 100332338@qq.com
* <p/>
* 一个内存加速的View
*/
public class SpeedView extends View
{
public SpeedView(Context context)
{
this(context, null);
}
public SpeedView(Context context, AttributeSet attrs)
{
this(context, attrs, 0);
}
public SpeedView(Context context, AttributeSet attrs, int defStyleAttr)
{
super(context, attrs, defStyleAttr);
init();
}
private void init()
{
}
}
|
[
"100332338@qq.com"
] |
100332338@qq.com
|
f2763335f800c268e5ec12f5ec3ad22eccb172de
|
cc7303927dcf322df5f837477ab1f95bb4e7193e
|
/src/day12/java4/AnimalTest.java
|
e4d62ff5fedc2193b086fac41b97f80a43ff7a0c
|
[] |
no_license
|
hanxiaoluan/Java-bilibili
|
ccefd083f4085b07d67dfb46b02d138350c22b39
|
6f27f6d5367a46b4c46042d6a16110e782502d38
|
refs/heads/main
| 2023-05-27T18:50:47.502086
| 2021-06-19T13:05:16
| 2021-06-19T13:05:16
| 367,797,016
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,081
|
java
|
package day12.java4;
/**
* Created by apple on 6/4/21 8:07 PM Done is better than perfect!!
*/
public class AnimalTest {
public static void main(String[] args) {
AnimalTest test = new AnimalTest();
test.func(new Dog());
test.func(new Cat());
}
public void func(Animal animal) {
animal.eat();
animal.shout();
if (animal instanceof Dog) {
Dog d = (Dog)animal;
d.watchDoor();
}
}
}
class Animal {
public void eat() {
System.out.println("动物:进食");
}
public void shout() {
System.out.println("动物:叫");
}
}
class Dog extends Animal {
public void eat() {
System.out.println("狗吃骨头");
}
public void shout() {
System.out.println("汪汪汪");
}
public void watchDoor() {
System.out.println("看门");
}
}
class Cat extends Animal {
public void eat() {
System.out.println("猫吃鱼");
}
public void shout() {
System.out.println("喵喵买");
}
}
|
[
"1140279968@qq.com"
] |
1140279968@qq.com
|
5104d2ef8ea896bcd9402147824bdd933b566ade
|
af1f38e0169ade8700d5fe5c07d1839aeeaed359
|
/proj.android/src/com/test/littlerunner/littlerunner.java
|
4e04afcf7e04496eeaf9d18bc3bf57a1d7f6e512
|
[] |
no_license
|
MarkZhongsh/littlerunner
|
c15311070fd748bf6c466143f217ed7fc1dc094d
|
d42b7b9a79cecc661bc11df57aea698ef20e74ba
|
refs/heads/master
| 2020-12-24T13:36:21.620509
| 2019-05-09T08:41:24
| 2019-05-09T08:41:24
| 30,169,607
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,937
|
java
|
/****************************************************************************
Copyright (c) 2010-2011 cocos2d-x.org
http://www.cocos2d-x.org
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 com.test.littlerunner;
import org.cocos2dx.lib.Cocos2dxActivity;
import org.cocos2dx.lib.Cocos2dxGLSurfaceView;
import android.os.Bundle;
public class littlerunner extends Cocos2dxActivity{
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
}
public Cocos2dxGLSurfaceView onCreateView() {
Cocos2dxGLSurfaceView glSurfaceView = new Cocos2dxGLSurfaceView(this);
// littlerunner should create stencil buffer
glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
return glSurfaceView;
}
static {
System.loadLibrary("cocos2dcpp");
}
}
|
[
"MarkZhongsh@gmain.com"
] |
MarkZhongsh@gmain.com
|
a097a549223be6aa85ecab30249ddde9fc54c1b5
|
6e646a84ba2fad16ff5a823c764aa344572820c7
|
/advancedprogramming/src/main/java/org/moonzhou/advancedprogramming/concurrency/semaphore/Demo001.java
|
7cecf5a77b6ed60d32e701e1a43096184517f0c8
|
[] |
no_license
|
moon-zhou/advanced-java
|
c80721cd526f53339371d0f87c365cff98ac14ed
|
c88b0aace6cd4d874cb896e074bb59d8816ba73c
|
refs/heads/master
| 2023-08-28T14:09:00.695083
| 2023-08-23T07:55:44
| 2023-08-23T07:55:44
| 204,104,980
| 0
| 0
| null | 2023-02-07T14:12:34
| 2019-08-24T03:50:01
|
Java
|
UTF-8
|
Java
| false
| false
| 2,421
|
java
|
/*
* Copyright (C), 2002-2020, moon-zhou
* FileName: Demo001.java
* Author: moon-zhou
* Email: ayimin1989@163.com
* Date: 2020/10/10 8:37
* Description: //模块目的、功能描述
* History: //修改记录
* <author> <time> <version> <desc>
* 修改人姓名 修改时间 版本号 描述
*/
package org.moonzhou.advancedprogramming.concurrency.semaphore;
import java.util.concurrent.*;
/**
* 功能描述: 信号量示例<br>
* <p>
* 应用场景:用于流量控制,特别是公用资源有限的应用场景,比如数据库连接。
* 控制访问的流量(数量),超过的部分则会阻塞等待现有访问的线程执行完。执行完之后,阻塞线程或得到许可证即可进行执行。
* <p>
* 本示例来自《Java并发编程的艺术》
*
* @author moon-zhou
* @see [相关类/方法](可选)
* @since [产品/模块版本] (可选)
*/
public class Demo001 {
private static final int THREAD_COUNT = 30;
private static ExecutorService threadPool = Executors.newFixedThreadPool(THREAD_COUNT);
// 控制线程并发数为10,即使有30个线程
private static Semaphore semaphore = new Semaphore(10);
private static CountDownLatch cdl = new CountDownLatch(30);
public static void main(String[] args) {
for (int i = 0; i < THREAD_COUNT; i++) {
final int batchShow = i;
threadPool.execute(() -> {
try {
semaphore.acquire();
// 为方便查看输出信息,每10条(一批)打一行分隔符
if (batchShow % 10 == 0) {
System.out.println("===============");
}
System.out.println(Thread.currentThread().getName() + ":" + "save data");
// 模拟耗时处理
TimeUnit.SECONDS.sleep(5);
semaphore.release();
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
cdl.countDown();
}
});
}
try {
cdl.await();
System.out.println("\n" + "it is end, shutdown thread pool.");
threadPool.shutdown();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
|
[
"ayimin1989@163.com"
] |
ayimin1989@163.com
|
d8e599558e1c97bdb534fe1ff571b809643d51cb
|
0cf652eff6e7fc4428a0ef6268190840cacda10a
|
/src/digonet/Player.java
|
e329ea8a534ee49ed742a79cbc5eccadc8052e08
|
[] |
no_license
|
VijayEluri/digonet
|
e7c6a5f68e3a7a8b0e45e61424a13933ced0f764
|
e87638f0e9b5a46aa66e7b1be61ce068715796aa
|
refs/heads/master
| 2020-05-20T11:16:20.340971
| 2014-03-19T10:00:28
| 2014-03-19T10:00:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,132
|
java
|
package digonet;
import java.util.ArrayList;
import java.util.List;
public class Player implements Comparable {
String login;
String rank;
String website;
List<Game> games = null;
public Player(String s) {
String[] ss = s.split(";");
if (ss.length>=1)
login = ss[0];
else login = "unknown";
if (ss.length>=2)
rank = ss[1];
else rank = "20k";
if (ss.length>=3)
website = ss[2];
else website = "http://nosite.com/digonet.cor";
// load his games
games = new ArrayList<Game>();
for (int i=3;i<ss.length;i++) {
Game g = new Game(ss[i]);
games.add(g);
}
}
public boolean equals(Object o) {
Player p = (Player)o;
return (p.website.equals(website));
}
public int hashCode() {
return website.hashCode();
}
@Override
public int compareTo(Object o) {
Player p = (Player)o;
return website.compareTo(p.website);
}
public String toString() {
return login+" "+rank;
}
public String string4save() {
String s = login+";"+rank+";"+website;
for (Game g : games) {
s+=";"+g.string4save();
}
return s;
}
}
|
[
"xtof@rhapsody.loria.fr"
] |
xtof@rhapsody.loria.fr
|
1f5d29797001f37a9341190348e37beb5dfec33b
|
409287d0a58f58ca85185a94e564624c9dd87233
|
/gulimall-coupon/src/main/java/com/atguigu/gulimall/coupon/service/SkuBoundsService.java
|
8bb1f4b798a7bb16cd1eabaaeae22b9dff791679
|
[
"Apache-2.0"
] |
permissive
|
xuan25575/guliMall
|
8f5c9ed90a4450234180fabcf0a0920b8a350517
|
6b295c0ad446d811062f5ba32f75cb156139fbaa
|
refs/heads/master
| 2022-12-22T05:32:13.382713
| 2020-09-24T08:14:37
| 2020-09-24T08:14:37
| 294,621,518
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 471
|
java
|
package com.atguigu.gulimall.coupon.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.coupon.entity.SkuBoundsEntity;
import java.util.Map;
/**
* 商品spu积分设置
*
* @author huang_2
* @email huang_2@gmail.com
* @date 2020-09-12 00:23:05
*/
public interface SkuBoundsService extends IService<SkuBoundsEntity> {
PageUtils queryPage(Map<String, Object> params);
}
|
[
"xuanyu.huang@hand-china.com"
] |
xuanyu.huang@hand-china.com
|
d2e86dc5a6ef4afc340e85a45110f95e0c19f56f
|
68201af860fbb08b92a515de7115cbe5bd6c95e3
|
/producer/src/test/java/com/smalik/producer/contracts/MessagingBase.java
|
682ce60724235291746a292c0dd5d23b05ada7d3
|
[] |
no_license
|
maliksalman/spring-cloud-contract-sample
|
8abc9de41a9702f9544beaceacd22a7035203592
|
0e0417c94516315b8e3d2eaf93a0fe1e895fc12e
|
refs/heads/master
| 2020-04-06T20:23:51.405203
| 2019-05-13T05:36:22
| 2019-05-13T05:36:22
| 157,771,099
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,011
|
java
|
package com.smalik.producer.contracts;
import com.smalik.producer.Person;
import com.smalik.producer.ProducerApplication;
import com.smalik.producer.ProducerController;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.contract.verifier.messaging.boot.AutoConfigureMessageVerifier;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = { ProducerApplication.class })
@AutoConfigureMessageVerifier
@ActiveProfiles("test")
public abstract class MessagingBase {
@Autowired
private ProducerController controller;
public void personAddedIsCalled() {
Person person = new Person();
person.setAge(25);
person.setName("Peter Parker");
person.setCity("New York City");
controller.addPerson(person);
}
}
|
[
"smalik@pivotal.io"
] |
smalik@pivotal.io
|
84d6fac5def50ade88bc7145d2512f3024bbdeb5
|
710e9d109eddd7a11e6e6b62a3a3e47617c72bb5
|
/lubchenkoProj/src/test/java/parentTest/ParentTest.java
|
aec06a68e7900f911ca7cacc7df51e4f17b873ed
|
[] |
no_license
|
SeleniumQALight/G29Project
|
6e31bfe9e4357fdb6d8998f9ae734c43f22505ed
|
03774982ec2c3918d60e94afc364b3203775a6f7
|
refs/heads/master
| 2018-09-07T12:41:04.869381
| 2018-02-08T13:35:50
| 2018-02-08T13:35:50
| 113,195,098
| 0
| 0
| null | 2023-05-18T14:21:32
| 2017-12-05T14:52:03
|
Java
|
UTF-8
|
Java
| false
| false
| 1,130
|
java
|
package parentTest;
import org.junit.After;
import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import pages.LoginPage;
import pages.MainPage;
import pages.SparesPage;
import java.io.File;
import java.util.concurrent.TimeUnit;
public class ParentTest {
public WebDriver webDriver;
protected MainPage mainPage;
protected LoginPage loginPage;
protected SparesPage sparesPage;
@Before
public void setUp() {
File fileFF = new File("./drivers/chromedriver.exe");
System.setProperty("webdriver.chrome.driver", fileFF.getAbsolutePath());
webDriver = new ChromeDriver();
webDriver.manage().window().maximize();
webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);//пробуй каждые полсекунды сделать это на протяжении 10 секунд
mainPage = new MainPage(webDriver);
loginPage = new LoginPage(webDriver);
sparesPage = new SparesPage(webDriver);
}
@After
public void tearDown() {
webDriver.quit();
}
}
|
[
"marina.amado11@gmail.com"
] |
marina.amado11@gmail.com
|
8cce8b90a9ca2f00ddadc09155d45c435917870b
|
dd9b6696e0ecff32e457d5a29930029795dcf7db
|
/src/test/java/com/example/workshop/WorkshopApplicationTests.java
|
eb372266134449f3c80fe461ba9cee123b0ac72a
|
[] |
no_license
|
neboyatjian/workshop
|
bfc71e646c877e5172aeb4ab955a520ba7e513a1
|
884cb1cc9831a3b07155c26a9d4c5c73feffb379
|
refs/heads/master
| 2020-04-15T06:58:54.826994
| 2019-01-07T20:35:51
| 2019-01-07T20:35:51
| 164,482,668
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 340
|
java
|
package com.example.workshop;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class WorkshopApplicationTests {
@Test
public void contextLoads() {
}
}
|
[
"nboyatjian@gmail.com"
] |
nboyatjian@gmail.com
|
43debdc8ce1b1e86e715ea22932eaf1b674c572d
|
8cd7768a80ab7f4a130cb5174ca58d050884245c
|
/src/com/bignerdranch/android/geoquiz/QuizActivity.java
|
73f26fb64f9808b1817239427b24bb2c2ff0dc0d
|
[] |
no_license
|
tbadams/GeoQuiz
|
85e0f053e35ced9ee72d9c615b38b2734fa2a27a
|
ba1cd1181fcf82aa54f6e3a1e83e729040a3d221
|
HEAD
| 2016-09-06T07:51:49.598355
| 2014-03-07T22:08:16
| 2014-03-07T22:08:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,329
|
java
|
package com.bignerdranch.android.geoquiz;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
/**
* An activity consisting of a quiz on various geography questions. Users are informed by toasts
* whether there answers are correct, and buttons allow them to move forward and backwards through
* the questions.
* @author Tadams
*/
public class QuizActivity extends Activity {
private static final String TAG = "QuizActivity";
private static final String KEY_INDEX = "index";
/*
* Screen elements.
*/
private Button mTrueButton;
private Button mFalseButton;
private Button mNextButton;
private Button mCheatButton;
private TextView mQuestionTextView;
/*
* Array containing questions to be asked by activity, in the forms of TrueFalse objects.
*/
private TrueFalse[] mQuestionBank = new TrueFalse[] {
new TrueFalse(R.string.question_oceans, true),
new TrueFalse(R.string.question_mideast, false),
new TrueFalse(R.string.question_africa, false),
new TrueFalse(R.string.question_americas, true),
new TrueFalse(R.string.question_asia, true),
};
private int mCurrentIndex = 0;
private boolean mIsCheater;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);
mQuestionTextView = (TextView)findViewById(R.id.question_text_view);
mTrueButton = (Button)findViewById(R.id.true_button);
mTrueButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkAnswer(true);
}
});
mFalseButton = (Button)findViewById(R.id.false_button);
mFalseButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
checkAnswer(false);
}
});
NextListener nextListener = new NextListener();
mNextButton = (Button)findViewById(R.id.next_button);
mNextButton.setOnClickListener(nextListener);
mCheatButton = (Button)findViewById(R.id.cheatButton);
mCheatButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent i = new Intent(QuizActivity.this, CheatActivity.class);
i.putExtra(CheatActivity.EXTRA_ANSWER_IS_TRUE,
mQuestionBank[mCurrentIndex].isTrueQuestion());
startActivityForResult(i, 0);
}
});
if(savedInstanceState != null){
mCurrentIndex = savedInstanceState.getInt(KEY_INDEX, 0);
}
updateQuestion();
}
/**
* Inflates the options menu.
*/
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.quiz, menu);
return true;
}
private void updateQuestion(){
int question = mQuestionBank[mCurrentIndex].getQuestion();
mQuestionTextView.setText(question);
}
private void checkAnswer(boolean userPressedTrue) {
int toastTextId = 0;
if(mIsCheater) {
toastTextId = R.string.judgment_toast;
} else {
if(mQuestionBank[mCurrentIndex].isTrueQuestion() == userPressedTrue){
toastTextId = R.string.correct_toast;
} else {
toastTextId = R.string.incorrect_toast;
}
}
Toast.makeText(this, toastTextId, Toast.LENGTH_LONG).show();
}
private void incrementQuestion(int numToInc){
while(numToInc < 0){ numToInc += mQuestionBank.length;}
mCurrentIndex = (mCurrentIndex + numToInc) % mQuestionBank.length;
mIsCheater = false;
updateQuestion();
}
@Override
protected void onSaveInstanceState(Bundle savedInstanceState){
super.onSaveInstanceState(savedInstanceState);
Log.i(TAG, "onSaveInstanceState");
savedInstanceState.putInt(KEY_INDEX, mCurrentIndex);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (data == null) {
return;
}
mIsCheater = data.getBooleanExtra(CheatActivity.EXTRA_ANSWER_SHOWN, false);
}
private class NextListener implements View.OnClickListener {
@Override
public void onClick(View v) {
incrementQuestion(1);
}
}
}
|
[
"trevorbadams@gmail.com"
] |
trevorbadams@gmail.com
|
a4387e30aa71dc1590844c9c27bcecc45f56bca8
|
c2e2f238a7e3c421c30a7b794159a06bd823c91e
|
/src/main/java/com/luv2code/springsecurity/demo/services/MyUserDetailService.java
|
69b5daee4c0d0ccfb5aabf753edbcc3ec7f9a4c3
|
[] |
no_license
|
kolodziejgrzegorz/spring-security-demo
|
cf599c35adea52f64626137b4880943010f8de7a
|
ecd655b635dba553de7369bb8abe5c8e514cc63c
|
refs/heads/master
| 2021-08-29T16:23:00.520638
| 2017-12-14T09:41:19
| 2017-12-14T09:41:19
| 111,225,454
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,265
|
java
|
package com.luv2code.springsecurity.demo.services;
import java.util.Arrays;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import com.luv2code.springsecurity.demo.dao.UserDAO;
import com.luv2code.springsecurity.demo.entity.UserLoginInfo;
@Service
public class MyUserDetailService implements UserDetailsService {
@Autowired
private UserDAO userDAO;
@Override
public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException {
UserLoginInfo userLoginInfo = userDAO.getUserLoginInfo(userName);
GrantedAuthority authority = new SimpleGrantedAuthority(userLoginInfo.getRole());
UserDetails userDetails = (UserDetails)new User(userLoginInfo.getUserName(),
userLoginInfo.getPassword(),Arrays.asList(authority));
return userDetails;
}
}
|
[
"grzegorz.kolodziej.89@gmail.com"
] |
grzegorz.kolodziej.89@gmail.com
|
023ef0a487a0b837d49b4f2714d2c1925e086cbf
|
ab7791b3c8fa45ef6379f49fe142145b021f70e0
|
/app/src/main/java/com/moringaschool/allrecipe/models/NA_.java
|
17a2d8f1ab3f6801a1625c5cee4189fdb917ad44
|
[
"MIT"
] |
permissive
|
MUTHAKABRIAN/AllRecipe
|
6ef7fa93749bc1901d5a84a3c3eef79b32fc41d4
|
322717e1a64e21f605b609fc343ae4b03e78c2c0
|
refs/heads/master
| 2023-04-16T09:17:43.519992
| 2021-04-11T22:05:34
| 2021-04-11T22:05:34
| 349,459,318
| 0
| 0
| null | 2021-04-07T15:21:36
| 2021-03-19T14:54:25
|
Java
|
UTF-8
|
Java
| false
| false
| 1,187
|
java
|
package com.moringaschool.allrecipe.models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import org.parceler.Parcel;
@Parcel
public class NA_ {
@SerializedName("label")
@Expose
private String label;
@SerializedName("quantity")
@Expose
private Double quantity;
@SerializedName("unit")
@Expose
private String unit;
/**
* No args constructor for use in serialization
*
*/
public NA_() {
}
/**
*
* @param unit
* @param quantity
* @param label
*/
public NA_(String label, Double quantity, String unit) {
super();
this.label = label;
this.quantity = quantity;
this.unit = unit;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public Double getQuantity() {
return quantity;
}
public void setQuantity(Double quantity) {
this.quantity = quantity;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
}
|
[
"muthakabrian@gmail.com"
] |
muthakabrian@gmail.com
|
be86019b1d8b2a152a8ba20094b6ae69bd6650e1
|
1187b1872ef4e41ebb6a7bff76d5c855a21f6667
|
/src/main/java/com/makarewk/angulartutorial/webservice/repositories/EquipmentRepository.java
|
464889ee4173fd6a6b3068df2b96eca63d02f140
|
[] |
no_license
|
Makarion/angular-tutorial
|
9184bc291f207249fb61931e010d75aaf27d380e
|
b4b3f028853c42d374d9bfe7979cfb0932eacdef
|
refs/heads/master
| 2022-12-02T02:03:31.132978
| 2019-11-10T16:03:14
| 2019-11-10T16:03:14
| 220,813,613
| 0
| 0
| null | 2022-11-16T08:58:59
| 2019-11-10T16:01:03
|
Java
|
UTF-8
|
Java
| false
| false
| 264
|
java
|
package com.makarewk.angulartutorial.webservice.repositories;
import com.makarewk.angulartutorial.webservice.entities.*;
import org.springframework.data.repository.CrudRepository;
public interface EquipmentRepository extends CrudRepository<Equipment, Long> {
}
|
[
"kamilmakarewicz1996@gmail.com"
] |
kamilmakarewicz1996@gmail.com
|
45a72608a1ee86590052a68a282c0ac8d841726c
|
081614c4877a9eaacfa3cf3c20739cac4389b4f3
|
/jakobs_solutions/src/common/Utils.java
|
26700f4548ac567460e1462a6b2b537556068194
|
[] |
no_license
|
miscellus/cp2020
|
acea294c7eaf72e92d070ad77eda722dd9ca5e6d
|
4e2dbad925e01439fdb1940a96eebdb6db915405
|
refs/heads/master
| 2021-01-07T01:39:31.960433
| 2020-04-30T10:12:21
| 2020-04-30T10:12:21
| 241,541,444
| 0
| 0
| null | 2020-02-19T05:34:09
| 2020-02-19T05:34:08
| null |
UTF-8
|
Java
| false
| false
| 493
|
java
|
package common;
public class Utils
{
public static void doAndMeasure( Runnable runnable )
{
long t1 = System.currentTimeMillis();
runnable.run();
long t2 = System.currentTimeMillis();
System.out.println( "Elapsed time: " + (t2-t1) + "ms" );
}
public static void benchmark( Runnable runnable )
{
runnable.run();
long t1 = System.currentTimeMillis();
runnable.run();
long t2 = System.currentTimeMillis();
System.out.println( "Elapsed time: " + (t2-t1) + "ms" );
}
}
|
[
"jakob@miscellus.dk"
] |
jakob@miscellus.dk
|
15af9a68a9e9c26a3bcf87e25e6cc5bc9282e0a7
|
56066b71348c292dc622b9165ec6059f04339127
|
/src/main/java/id/robegf/inditex/exceptions/PriceNotFoundException.java
|
90eb9e7e2accc2d1f1ca2e1772ab25e49a58d82c
|
[] |
no_license
|
robegf/test-spring-ndtx
|
05cae849c64a1465a24b0f87fe6f2f8fd38fa9f3
|
dac181bd569d2ae6277ef88f5cf5516fea32b972
|
refs/heads/master
| 2023-03-28T10:16:08.425100
| 2021-03-23T01:50:09
| 2021-03-23T01:50:09
| 347,950,538
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 369
|
java
|
package id.robegf.inditex.exceptions;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ResponseStatus;
@ResponseStatus(HttpStatus.NOT_FOUND)
public class PriceNotFoundException extends RuntimeException {
private static final long serialVersionUID = -206695902115041739L;
public PriceNotFoundException() {
super();
}
}
|
[
"noreply@github.com"
] |
noreply@github.com
|
ca9aa0c00b0453ae60ed430d4188cd46f0c511d6
|
6fa701cdaa0d83caa0d3cbffe39b40e54bf3d386
|
/google/cloud/aiplatform/v1/google-cloud-aiplatform-v1-java/proto-google-cloud-aiplatform-v1-java/src/main/java/com/google/cloud/aiplatform/v1/BatchMigrateResourcesRequestOrBuilder.java
|
66edeaeadce0bea6a4399691dc630632bdb45fe5
|
[
"Apache-2.0"
] |
permissive
|
oltoco/googleapis-gen
|
bf40cfad61b4217aca07068bd4922a86e3bbd2d5
|
00ca50bdde80906d6f62314ef4f7630b8cdb6e15
|
refs/heads/master
| 2023-07-17T22:11:47.848185
| 2021-08-29T20:39:47
| 2021-08-29T20:39:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| true
| 3,491
|
java
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/aiplatform/v1/migration_service.proto
package com.google.cloud.aiplatform.v1;
public interface BatchMigrateResourcesRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:google.cloud.aiplatform.v1.BatchMigrateResourcesRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Required. The location of the migrated resource will live in.
* Format: `projects/{project}/locations/{location}`
* </pre>
*
* <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The parent.
*/
java.lang.String getParent();
/**
* <pre>
* Required. The location of the migrated resource will live in.
* Format: `projects/{project}/locations/{location}`
* </pre>
*
* <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }</code>
* @return The bytes for parent.
*/
com.google.protobuf.ByteString
getParentBytes();
/**
* <pre>
* Required. The request messages specifying the resources to migrate.
* They must be in the same location as the destination.
* Up to 50 resources can be migrated in one batch.
* </pre>
*
* <code>repeated .google.cloud.aiplatform.v1.MigrateResourceRequest migrate_resource_requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
java.util.List<com.google.cloud.aiplatform.v1.MigrateResourceRequest>
getMigrateResourceRequestsList();
/**
* <pre>
* Required. The request messages specifying the resources to migrate.
* They must be in the same location as the destination.
* Up to 50 resources can be migrated in one batch.
* </pre>
*
* <code>repeated .google.cloud.aiplatform.v1.MigrateResourceRequest migrate_resource_requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
com.google.cloud.aiplatform.v1.MigrateResourceRequest getMigrateResourceRequests(int index);
/**
* <pre>
* Required. The request messages specifying the resources to migrate.
* They must be in the same location as the destination.
* Up to 50 resources can be migrated in one batch.
* </pre>
*
* <code>repeated .google.cloud.aiplatform.v1.MigrateResourceRequest migrate_resource_requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
int getMigrateResourceRequestsCount();
/**
* <pre>
* Required. The request messages specifying the resources to migrate.
* They must be in the same location as the destination.
* Up to 50 resources can be migrated in one batch.
* </pre>
*
* <code>repeated .google.cloud.aiplatform.v1.MigrateResourceRequest migrate_resource_requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
java.util.List<? extends com.google.cloud.aiplatform.v1.MigrateResourceRequestOrBuilder>
getMigrateResourceRequestsOrBuilderList();
/**
* <pre>
* Required. The request messages specifying the resources to migrate.
* They must be in the same location as the destination.
* Up to 50 resources can be migrated in one batch.
* </pre>
*
* <code>repeated .google.cloud.aiplatform.v1.MigrateResourceRequest migrate_resource_requests = 2 [(.google.api.field_behavior) = REQUIRED];</code>
*/
com.google.cloud.aiplatform.v1.MigrateResourceRequestOrBuilder getMigrateResourceRequestsOrBuilder(
int index);
}
|
[
"bazel-bot-development[bot]@users.noreply.github.com"
] |
bazel-bot-development[bot]@users.noreply.github.com
|
3da388183a058cc49aee41da7f1c5e2c748dd3d1
|
093f50c2435a12f52dbe70c080c8b7add843d01a
|
/src/main/java/com/gail/dao/MaterialDao.java
|
6a4648f90a280705405e036747f48cc66da071f2
|
[] |
no_license
|
vikramshekhawat/Data_g_a_i_l
|
6b695db25f4460a38e80158997e4b8349efe79d9
|
a0a3f5d302182c01270b1a23048d74fa46a85f54
|
refs/heads/master
| 2020-04-07T11:32:13.902977
| 2018-11-20T04:25:11
| 2018-11-20T04:25:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 256
|
java
|
package com.gail.dao;
import java.util.List;
import com.gail.model.Material;
public interface MaterialDao extends GenericDao<Material, Long> {
public List<Material> getActiveMaterials();
public Material getMaterialByCode(String materialCode);
}
|
[
"vikram@wildnettechnologies.com"
] |
vikram@wildnettechnologies.com
|
0d8e825bc991fb3005b806d2d72a55d71b2ab5b7
|
656dd16f4859a815859390a9163266659fa1fff0
|
/src/main/java/com/soton/shopping_centre/service/UserServiceImpl.java
|
35358ae4b9f33e0bc3ce6dee572a121304dd04f0
|
[] |
no_license
|
GYSolver/shopping_centre
|
c0841b541e05c6e5d1fbc4d20e784005a3cd22ad
|
686f5f2c13c528d86969f7a22b42b915340cfb1c
|
refs/heads/master
| 2022-12-13T18:19:03.133551
| 2020-09-15T10:24:47
| 2020-09-15T10:24:47
| 285,608,616
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,599
|
java
|
package com.soton.shopping_centre.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.soton.shopping_centre.mapper.UserMapper;
import com.soton.shopping_centre.pojo.User;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.shiro.crypto.hash.Md5Hash;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {
@Autowired
UserMapper usermapper;
@Override
public List<User> queryAllUsers() { return usermapper.selectList(null); }
@Override
public User queryUserById(Integer id) {
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("id",id);
return usermapper.selectOne(queryWrapper);
}
@Override
public User queryUserByName(String username) {
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("username",username);
return usermapper.selectOne(queryWrapper);
}
@Override
public User queryUserByRoleName(String roleName) {
QueryWrapper<User> wrapper = new QueryWrapper<>();
wrapper.eq("role_name",roleName);
return usermapper.selectOne(wrapper);
}
@Override
public int addUser(User user) { return usermapper.insert(user); }
@Override
public int deleteUserById(Integer id) {
return usermapper.deleteById(id);
}
@Override
public int editUser(User user) {
return usermapper.updateById(user);
}
@Override
public int registerAdmin() {
if(this.queryUserByRoleName("admin")==null){
User user = new User();
user.setUsername("admin");
String salt = RandomStringUtils.randomNumeric(6);
user.setSalt(salt);
Md5Hash md5Hash = new Md5Hash("admin",salt); //encrypt
user.setPassword(md5Hash.toString());
user.setRoleName("admin");
return this.addUser(user);
}
return 0;
}
@Override
public int registerMember(User user) {
if(this.queryUserByName(user.getUsername())==null){
String salt = RandomStringUtils.randomNumeric(6);
user.setSalt(salt);
Md5Hash md5Hash = new Md5Hash(user.getPassword(),salt); //encrypt
user.setPassword(md5Hash.toString());
user.setRoleName("member");
return this.addUser(user);
}
else
return -1;//duplicated username
}
}
|
[
"liuguoyou1997@163.com"
] |
liuguoyou1997@163.com
|
fc188333b098d5aeeef6994a2f6ddbbf0a3ed181
|
0bc868d114710118e3f5dd01394cb4f0b0acf909
|
/verdi_core/src/anl/verdi/parser/ASTSind.java
|
fa1b4f296ca2837ec5e28c81528bbff34d15018a
|
[] |
no_license
|
gitter-badger/VERDI
|
043221fde65dd58075fb31df4063b5b6e1cbe398
|
dd765405f09aa690bdcee89f81322d655d8dff28
|
refs/heads/master
| 2020-12-30T18:29:45.418759
| 2016-03-13T20:58:20
| 2016-03-13T20:58:20
| 61,566,178
| 0
| 0
| null | 2016-06-20T17:16:02
| 2016-06-20T17:16:00
| null |
UTF-8
|
Java
| false
| false
| 784
|
java
|
/* Generated By:JJTree: Do not edit this line. ASTSind.java */
package anl.verdi.parser;
import anl.verdi.formula.IllegalFormulaException;
import anl.verdi.util.DoubleFunction;
import anl.verdi.util.FormulaArray;
public class ASTSind extends SimpleNode {
static class Sind implements DoubleFunction {
public double apply(double val) {
return Math.sin(Math.toRadians(val));
}
}
public ASTSind(int id) {
super(id);
}
public ASTSind(Parser p, int id) {
super(p, id);
}
/**
* Evaluates this Node.
*
* @param frame
* @return the result of the evaluation.
*/
@Override
public FormulaArray evaluate(Frame frame) throws IllegalFormulaException {
return jjtGetChild(0).evaluate(frame).foreach(new Sind());
}
}
|
[
"lizadams@b46c3202-f04a-0410-9bfd-f137835f981a"
] |
lizadams@b46c3202-f04a-0410-9bfd-f137835f981a
|
be9b3acd13a0c212c830652a917c8414555dbe82
|
cdd7caf09a7ec1b717ad3cd850151314451a5cd8
|
/src/main/java/com/ptun/app/apis/endpoints/models/Template.java
|
bff15229dc214e329cf842362d299b5b109055ee
|
[
"MIT"
] |
permissive
|
vianziro/PTUN-Report-Tool
|
842add0dc1fbba7a954efa45622dea22c54b31ff
|
5284f36ffc5bf507ae471efaf44016c56bac037c
|
refs/heads/master
| 2020-03-25T15:37:13.172031
| 2017-06-01T06:19:07
| 2017-06-01T06:19:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 456
|
java
|
package com.ptun.app.apis.endpoints.models;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
@Data
public class Template {
@SerializedName("pin")
@Expose
private String pin;
@SerializedName("idx")
@Expose
private int idx;
@SerializedName("alg_ver")
@Expose
private int algVer;
@SerializedName("template")
@Expose
private String template;
}
|
[
"ki65559@gmail.com"
] |
ki65559@gmail.com
|
59600ee2a6f7ad3c34130c2b4563d61fc26b3d70
|
a837948f0fd368e0adf6228c81d3e9d43ca36bcf
|
/Practice/src/calci.java
|
02553818bf3208cb65824c0c10cb7cadf32476ed
|
[] |
no_license
|
BalasahebNawale/JavaCodePractice
|
2b39ce91397d20684a003abc48dc53a87de93d34
|
26724b2496704b0ebfa38cc6b2090e51dddf57f3
|
refs/heads/master
| 2023-08-01T01:59:13.834553
| 2021-09-09T13:29:03
| 2021-09-09T13:29:03
| 332,228,439
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,576
|
java
|
import java.util.Scanner;
public class calci{
public static void main(String[] args) {
System.out.println("***********************************************");
Scanner ip = new Scanner(System.in);
System.out.println("Hello Aliens!! Welcome to java programming ");
System.out.println("***********************************************");
System.out.println("1:Addition ");
System.out.println("2:Substraction ");
System.out.println("3:Multiplication ");
System.out.println("4: Divission ");
System.out.println("Enter your choice: ");
int choice = ip.nextInt();
System.out.println("***********************************************");
ip.close();
switch(choice) {
case 1:
System.out.print("Enter num1: ");
int num1 = ip.nextInt();
System.out.print("Enter num2: ");
int num2 = ip.nextInt();
int sum = num1 +num2;
System.out.printf("The Addition is: %d",sum);
break;
case 2:
System.out.print("Enter num1: ");
num1 = ip.nextInt();
System.out.print("Enter num2: ");
num2 = ip.nextInt();
int sub = num1 -num2;
System.out.printf("The Addition is: %d",sub);
break;
case 3:
System.out.print("Enter num1: ");
num1 = ip.nextInt();
System.out.print("Enter num2: ");
num2 = ip.nextInt();
int mul = num1*num2;
System.out.printf("The Addition is: %d",mul);
break;
case 4:
System.out.print("Enter num1: ");
num1 = ip.nextInt();
System.out.print("Enter num2: ");
num2 = ip.nextInt();
float div = num1 /num2;
System.out.printf("The Addition is: %f",div);
break;
}
}
}
|
[
"nawalebalasaheb1234@gmail.com"
] |
nawalebalasaheb1234@gmail.com
|
5aea01f0f7b6bb97280a221563d5fe1334e23598
|
3e1f26983fca26a22916cadef39c0d2dfa2e0dd5
|
/pyg_parent/pojo/src/main/java/cn/itcast/core/vo/DaySaleVo.java
|
1a13ba7dbfd7b4db2f0f19d269a20b601a3efb24
|
[] |
no_license
|
YouAreMyLove995/pinyougou329
|
20495e48fe26244a15dbd478ef6e6af372148a3b
|
24a5149ba7a77ad6c80208fe5f0e03d0de52dbaf
|
refs/heads/master
| 2020-04-16T12:24:12.673668
| 2019-01-17T06:23:45
| 2019-01-17T06:23:45
| 165,577,549
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 836
|
java
|
package cn.itcast.core.vo;
import java.io.Serializable;
public class DaySaleVo implements Serializable {
private String dayTime; //日期
private Object daySale; //日销售额
public DaySaleVo() {
}
public DaySaleVo(String dayTime, Object daySale) {
this.dayTime = dayTime;
this.daySale = daySale;
}
@Override
public String toString() {
return "DaySaleVo{" +
"dayTime='" + dayTime + '\'' +
", daySale=" + daySale +
'}';
}
public String getDayTime() {
return dayTime;
}
public void setDayTime(String dayTime) {
this.dayTime = dayTime;
}
public Object getDaySale() {
return daySale;
}
public void setDaySale(Object daySale) {
this.daySale = daySale;
}
}
|
[
"youaremylove995@163.com"
] |
youaremylove995@163.com
|
ae7bc269e836f4d5b51f6dbb1896b923581940ed
|
e9affefd4e89b3c7e2064fee8833d7838c0e0abc
|
/aws-java-sdk-ioteventsdata/src/main/java/com/amazonaws/services/ioteventsdata/model/VariableDefinition.java
|
224ebdc42a6df570e689db1621d52992960661cc
|
[
"Apache-2.0"
] |
permissive
|
aws/aws-sdk-java
|
2c6199b12b47345b5d3c50e425dabba56e279190
|
bab987ab604575f41a76864f755f49386e3264b4
|
refs/heads/master
| 2023-08-29T10:49:07.379135
| 2023-08-28T21:05:55
| 2023-08-28T21:05:55
| 574,877
| 3,695
| 3,092
|
Apache-2.0
| 2023-09-13T23:35:28
| 2010-03-22T23:34:58
| null |
UTF-8
|
Java
| false
| false
| 5,174
|
java
|
/*
* Copyright 2018-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.ioteventsdata.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
* <p>
* The new value of the variable.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/iotevents-data-2018-10-23/VariableDefinition" target="_top">AWS
* API Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class VariableDefinition implements Serializable, Cloneable, StructuredPojo {
/**
* <p>
* The name of the variable.
* </p>
*/
private String name;
/**
* <p>
* The new value of the variable.
* </p>
*/
private String value;
/**
* <p>
* The name of the variable.
* </p>
*
* @param name
* The name of the variable.
*/
public void setName(String name) {
this.name = name;
}
/**
* <p>
* The name of the variable.
* </p>
*
* @return The name of the variable.
*/
public String getName() {
return this.name;
}
/**
* <p>
* The name of the variable.
* </p>
*
* @param name
* The name of the variable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VariableDefinition withName(String name) {
setName(name);
return this;
}
/**
* <p>
* The new value of the variable.
* </p>
*
* @param value
* The new value of the variable.
*/
public void setValue(String value) {
this.value = value;
}
/**
* <p>
* The new value of the variable.
* </p>
*
* @return The new value of the variable.
*/
public String getValue() {
return this.value;
}
/**
* <p>
* The new value of the variable.
* </p>
*
* @param value
* The new value of the variable.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public VariableDefinition withValue(String value) {
setValue(value);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getValue() != null)
sb.append("Value: ").append(getValue());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof VariableDefinition == false)
return false;
VariableDefinition other = (VariableDefinition) obj;
if (other.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == false)
return false;
if (other.getValue() == null ^ this.getValue() == null)
return false;
if (other.getValue() != null && other.getValue().equals(this.getValue()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getValue() == null) ? 0 : getValue().hashCode());
return hashCode;
}
@Override
public VariableDefinition clone() {
try {
return (VariableDefinition) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.ioteventsdata.model.transform.VariableDefinitionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}
|
[
""
] | |
dda66fac1a42efb3d778c1776b86ad81eb048246
|
590eaf46b47b0bb464a8728558e66d2cddbf4bec
|
/src/java/servlets/ServletLogInd.java
|
5726af459b4e72893d2f140147a35461bc4aef4b
|
[] |
no_license
|
Kiriian/Op
|
4f7a2a965cc5a795820f760bba7b505436bb31f9
|
266ead517d1892049bdcf3a6d499520a62764a51
|
refs/heads/master
| 2021-01-12T21:02:55.413224
| 2015-06-02T09:41:29
| 2015-06-02T09:41:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,611
|
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 servlets;
import control.BrugerDTO;
import control.InvalidDataException;
import control.controller;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
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 Pernille
*/
@WebServlet(name = "ServletLogInd", urlPatterns =
{
"/ServletLogInd"
})
public class ServletLogInd extends HttpServlet
{
private controller ctrl = new controller();
private String fornavn;
private String efternavn;
private String password;
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException, InvalidDataException
{
response.setContentType("text/html;charset=UTF-8");
fornavn = request.getParameter("Fornavn");
efternavn = request.getParameter("Efternavn");
password = request.getParameter("Password");
BrugerDTO sessionUser;
sessionUser = ctrl.validateLogin(fornavn,efternavn, password);
request.getSession().setAttribute("user", sessionUser);
if (sessionUser != null)
{
request.getRequestDispatcher("søgesiden.jsp").forward(request, response);
}
else
{
request.setAttribute("validateMsg", "Login information is incorrect - try again");
request.getRequestDispatcher("index.jsp").forward(request, response);
}
}
// <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
{
try
{
processRequest(request, response);
} catch (InvalidDataException ex)
{
Logger.getLogger(ServletLogInd.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* 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
{
try
{
processRequest(request, response);
} catch (InvalidDataException ex)
{
Logger.getLogger(ServletLogInd.class.getName()).log(Level.SEVERE, null, ex);
}
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo()
{
return "Short description";
}// </editor-fold>
}
|
[
"pernillejaco@gmail.com"
] |
pernillejaco@gmail.com
|
3807a749151c23c56530bdcb050845611b41c97f
|
856d7ae295bf45871c50292f121bcc5a1fe9bb70
|
/dl/testcases/BLGetDesignationCount.java
|
0707e7808c6d493c96246529bf16c60c4e3a2f35
|
[] |
no_license
|
rahulchoudhary1999/HR-Automation-System
|
55ab4a26dbd3d763faed4dcfd40fa8f420a26234
|
5a75caf03ad9f2c332a0533f6ed31f11a2878b74
|
refs/heads/main
| 2023-05-06T00:54:39.513552
| 2021-05-13T11:42:46
| 2021-05-13T11:42:46
| 367,024,996
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 830
|
java
|
import com.thinking.machines.hr.bl.interfaces.*;
import com.thinking.machines.hr.bl.pojo.*;
import com.thinking.machines.hr.bl.exceptions.*;
import com.thinking.machines.hr.bl.managers.*;
import java.util.*;
import com.thinking.machines.hr.dl.dao.*;
import com.thinking.machines.hr.dl.exceptions.*;
import com.thinking.machines.hr.dl.interfaces.*;
import com.thinking.machines.hr.dl.dto.*;
import com.thinking.machines.common.*;
class BLGetDesignationCount
{
public static void main(String gg[])
{
try
{
DesignationManagerInterface designationManager;
designationManager=DesignationManager.getDesignationManager();
int count;
count=designationManager.getCount();
System.out.printf("Designation Count:"+count);
}catch(BLException blException)
{
System.out.println(blException.getGenericException());
}
}
}
|
[
"noreply@github.com"
] |
noreply@github.com
|
e2fc939b98a6f6a32039e7acabe0063f8a78acd1
|
c541c396f40dbd9d822cde475aa3ead2373722ae
|
/src/main/java/com/example/devolution/server/domain/GameState.java
|
1677bf5e1cc53eb4bf9553b90408970cb41a2fa6
|
[] |
no_license
|
3m3sch/devolution-server
|
66a61bbc978c56f969f69e8dc22f994478b00530
|
44240f84646a7ec53aef83cd0c5ac5f5a415df9b
|
refs/heads/master
| 2022-12-31T01:21:59.080201
| 2020-10-20T08:42:07
| 2020-10-20T08:42:07
| 305,642,912
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 745
|
java
|
package com.example.devolution.server.domain;
public class GameState {
private Long gameId;
private Long currentPlayerId;
private int currentTurn;
private int turnLimit;
public long getGameId() {
return gameId;
}
public void setGameId(long gameId) {
this.gameId = gameId;
}
public int getCurrentTurn() {
return currentTurn;
}
public void setCurrentTurn(int currentTurn) {
this.currentTurn = currentTurn;
}
public int getTurnLimit() {
return turnLimit;
}
public void setTurnLimit(int turnLimit) {
this.turnLimit = turnLimit;
}
@Override
public int hashCode() {
return gameId.hashCode();
}
@Override
public boolean equals(Object other) {
return getGameId() == ((GameState)other).getGameId();
}
}
|
[
"martin.schulz@nokia.com"
] |
martin.schulz@nokia.com
|
b91f9f20ab7066307147aa214ef57adc103e47e9
|
18ca253fce5fa43cbaf94390654e2d295feaa846
|
/Java8/ex23/src/ex23.java
|
dfc8673cfa2e88b735fbf65c7ec29c5406b3afe4
|
[] |
no_license
|
Sudarsan-Sridharan/LiveLessons
|
d3586c3cc6e62857ee8d6bdbe87b9efc1feb2344
|
f194f56ec10cf34a6f8975850afd59adb0f03ad0
|
refs/heads/master
| 2021-08-15T15:24:59.527934
| 2017-11-17T23:00:17
| 2017-11-17T23:00:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,263
|
java
|
import utils.RunTimer;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.function.Supplier;
import java.util.stream.Stream;
import static java.util.stream.Collectors.toList;
import static utils.FuturesCollectorStream.toFuture;
/**
* This example shows the difference between calling join() on
* intermediate completable futures (which block and thus degrade
* performance) vs. simply making one call to join() (and thus
* enhancing greater parallelism). These tests demonstrate why join()
* shouldn't be used in a stream pipeline on a CompletableFuture that
* hasn't completed since it may impede parallelism.
*/
public class ex23 {
/**
* A counter used to monotonically/atomically generate a new value
* each time it's called.
*/
private static AtomicInteger mCounter = new AtomicInteger(0);
/**
* This supplier increments the atomic counter, sleeps for 1
* second, and then returns the incremented value.
*/
private static Supplier<Integer> mSupplier = () -> {
int result = mCounter.incrementAndGet();
display("enter Supplier with value "
+ result);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
display("leave Supplier");
return result;
};
/**
* This function returns even numbers passed to it and null if an
* odd number is passed to it.
*/
private static Function<Integer, Integer> mAction = i -> {
display("enter Function with value "
+ i);
display("leave Function");
return (i % 2) == 0 ? i : null;
};
/**
* Main entry point into the test program.
*/
public static void main (String[] argv) throws IOException {
// A list of suppliers that return integers.
List<Supplier<Integer>> suppliers =
Arrays.asList(mSupplier,
mSupplier,
mSupplier,
mSupplier);
// Run a test that makes multiple blocking join calls on
// completable futures.
RunTimer.timeRun(() -> testManyJoins(suppliers),
"testManyJoins()");
// Run a test that makes just one blocking join calls on
// completable futures.
RunTimer.timeRun(() -> testOneJoin(suppliers),
"testOneJoin()");
// Print the results.
System.out.println(RunTimer.getTimingResults());
}
/**
* This test makes multiple blocking join calls when processing a
* list of completable futures.
*/
private static void testManyJoins(List<Supplier<Integer>> suppliers) {
System.out.println(">>> testManyJoins()");
// A future to a stream of integer results.
CompletableFuture<Stream<Integer>> resultsFuture = suppliers
// Convert the list of suppliers into a stream of suppliers.
.stream()
// Run each supplier asynchronously.
.map(CompletableFuture::supplyAsync)
// Filter out any null results. join() causes the call to
// block, demonstrating the limitations of trying to use
// filter() in conjunction with completable futures.
.filter(intFuture -> intFuture.thenApply(mAction).join() != null)
// Trigger intermediate operations and return a future to
// a stream of results.
.collect(toFuture());
resultsFuture
// When all the futures associated with resultsFuture
// complete then display the results.
.thenAccept(stream ->
display("results = "
+ stream
// Trigger intermediate processing and
// return a list of results.
.collect(toList())))
// Block caller until all processing is complete.
.join();
System.out.println("<<< leave testManyJoins()");
}
/**
* This test makes just one blocking join call when processing a
* list of completable futures.
*/
private static void testOneJoin(List<Supplier<Integer>> suppliers) {
System.out.println(">>> enter testOneJoin()");
// A future to a stream of integer results.
CompletableFuture<Stream<Integer>> resultFuture = suppliers
// Convert the list of suppliers into a stream of suppliers.
.stream()
// Run each supplier asynchronously.
.map(CompletableFuture::supplyAsync)
// Asynchronously apply the action to the results of the
// previous completion stage.
.map(intFuture -> intFuture.thenApply(mAction))
// Trigger intermediate operations and return a future to
// a stream of results.
.collect(toFuture());
resultFuture
// When all the futures associated with resultsFuture
// complete then display the results.
.thenAccept(stream ->
display("results = "
+ stream
// Filter out any null results.
.filter(Objects::nonNull)
// Trigger intermediate processing and
// return a list of results.
.collect(toList())))
// Block caller until all processing is complete.
.join();
System.out.println("<<< leave testOneJoin()\n");
}
/**
* Display the {@code string} after prepending the thread id and
* curren time.
*/
private static void display(String string) {
System.out.println("["
+ Thread.currentThread().getId()
+ ", "
+ System.currentTimeMillis()
+ "] "
+ string);
}
}
|
[
"d.schmidt@vanderbilt.edu"
] |
d.schmidt@vanderbilt.edu
|
bb269f467a6e4a8a8ddc07260c473a2c761f8e3e
|
35e73bc9b4c508623b79d0ad5b215fb03023f4d7
|
/chapter_003/src/main/java/ru/job4j/collection/sort/JobAscByName.java
|
119f30e694b6caea36371eca0092ea9bebbb9e26
|
[
"Apache-2.0"
] |
permissive
|
Mammad88/job4j_elementary
|
990cc53a072cdeb3fb44e95f064f72eb3cae95d0
|
c1dd25986d5fc15d390bb43529e2be9a460abed8
|
refs/heads/master
| 2021-03-24T05:49:26.169964
| 2020-11-21T18:43:04
| 2020-11-21T18:43:04
| 191,439,215
| 0
| 0
|
Apache-2.0
| 2020-11-21T18:43:48
| 2019-06-11T19:47:26
|
Java
|
UTF-8
|
Java
| false
| false
| 463
|
java
|
package ru.job4j.collection.sort;
import java.util.Comparator;
/**
* class JobAscByName - сортировка компаратора по имени и по возрастанию.
*
* @author Bruki Mammad (bruki_mammad@mail.ru)
* @version $1.0$
* @since 24.03.2020
*/
public class JobAscByName implements Comparator<Job> {
@Override
public int compare(Job first, Job second) {
return first.getName().compareTo(second.getName());
}
}
|
[
"bruki_mammad@mail.ru"
] |
bruki_mammad@mail.ru
|
e6465e13646931b33936e5cab25df94939d12a22
|
a03bf0d72e038e7bebe19a66434b1f4540c996c0
|
/src/androidTest/java/com/space/testfuction/ExampleInstrumentedTest.java
|
e3bc8c03b9fc4abbd705ca425a4b38ba4c59cbfd
|
[] |
no_license
|
XuanSovreign/smallapp
|
7fcae2323b6195c341e35a0157af8972879caa62
|
5a7df7d7eea470a6f8a7d5fce052baaee855f713
|
refs/heads/master
| 2020-12-10T22:23:16.068403
| 2020-01-14T01:20:37
| 2020-01-14T01:20:37
| 233,729,133
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 769
|
java
|
package com.space.testfuction;
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() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.space.testfuction", appContext.getPackageName());
}
}
|
[
"tang779@sina.com"
] |
tang779@sina.com
|
f240816caa74c2784711e3eb5529d9b8a24f3748
|
ccb61753e9a54b870449b1790342ab05fb09d8e4
|
/Praktikum-2/MyIntent2/app/src/main/java/com/erpam/myintent/ActivityData1.java
|
9f469cfc7907404268728cef7479e2e1873dc627
|
[] |
no_license
|
erpambudi/Pemrograman-Mobile
|
b0dee37f577d7630f5bea0e5d4f0a554aa0017dc
|
c03882eec92c4422824e6c115b5e594275acfee2
|
refs/heads/master
| 2020-08-07T09:20:24.340555
| 2020-01-07T10:54:36
| 2020-01-07T10:54:36
| 212,946,479
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,172
|
java
|
package com.erpam.myintent;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
public class ActivityData1 extends AppCompatActivity implements View.OnClickListener {
EditText etData;
Button btnNext;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_data1);
etData = findViewById(R.id.et_data);
btnNext = findViewById(R.id.btn_input);
btnNext.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if(v.getId() == R.id.btn_input){
String data = etData.getText().toString();
if(TextUtils.isEmpty(data)){
etData.setError("Field Tidak Boleh Kosong");
}else {
Intent intent = new Intent(this, ActivityData2.class);
intent.putExtra(ActivityData2.EXTRA_DATA, data);
startActivity(intent);
}
}
}
}
|
[
"erpambudi76@gmail.com"
] |
erpambudi76@gmail.com
|
c00c3324e72596acb99556470e50ad397ad7e5c7
|
8c56096ab4e121d52954e1a9f4eb27eb76c3cfe9
|
/app/src/main/java/com/example/relativeayu/MainActivity.java
|
e8d1319c3dea26fe5719379f93386f99dccbc7c3
|
[] |
no_license
|
pemrograman-mobile-2019/02-relative-layout-istianaAyu28
|
086c2bf726cf1356fe87e01ed6ff9ab0897afe84
|
b24bbbb3bbca72fcedae12454a9bdefc2a1eb758
|
refs/heads/master
| 2020-04-22T21:03:31.914298
| 2019-02-14T13:36:56
| 2019-02-14T13:36:56
| 170,661,191
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 336
|
java
|
package com.example.relativeayu;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
|
[
"istianaayu28@gmail.com"
] |
istianaayu28@gmail.com
|
e2ffc74254d48d1af824db7a9ad7b74657925d0e
|
8093c2ba85a79b74a604d75ca907fdc31802ac46
|
/app/src/main/java/com/sion/zhdaily/views/views/CommentRecyclerView.java
|
c8d891c92d18a76cd3ee687eddfc9f05e97e5d0a
|
[] |
no_license
|
Memories0ff/ZHdaily
|
8613bb1c37eb676d545a11a3b6ce59e718a8e77d
|
431f7586d3121f0cef279c449cf8388f4ab29a5c
|
refs/heads/master
| 2020-08-13T09:47:51.563443
| 2019-12-19T11:06:27
| 2019-12-19T11:06:27
| 214,949,110
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,614
|
java
|
package com.sion.zhdaily.views.views;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
public class CommentRecyclerView extends RecyclerView {
public CommentRecyclerView(@NonNull Context context) {
this(context, null);
}
public CommentRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public CommentRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
addOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
if (!recyclerView.canScrollVertically(1)) {
if (onScrollToBottomListener != null) {
onScrollToBottomListener.scrollToBottom();
}
}
}
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
});
}
@FunctionalInterface
public interface OnScrollToBottomListener {
void scrollToBottom();
}
OnScrollToBottomListener onScrollToBottomListener = null;
public void setOnScrollToBottomListener(OnScrollToBottomListener onScrollToBottomListener) {
this.onScrollToBottomListener = onScrollToBottomListener;
}
}
|
[
"im.wwz@outlook.com"
] |
im.wwz@outlook.com
|
a39d1d6e06d98f95f9064342219df1b4e31fbb28
|
bb108b0437e5192e8b0f6641948e18eb150c310f
|
/springjdbc/src/main/java/txtest/bean/Account.java
|
7731d0820315beedadb5f732d72ad44658031d20
|
[] |
no_license
|
xdk-nj/Spring-simple-examples
|
ddd08df0182de206a5953f5280e01e070e09c496
|
380ab25c5d041979caa04bfa0f7bccbcfe537661
|
refs/heads/master
| 2023-02-25T11:01:47.414950
| 2021-01-27T01:17:52
| 2021-01-27T01:17:52
| 333,263,583
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 260
|
java
|
package txtest.bean;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Account {
private Integer id;
private String username;
private Integer money;
}
|
[
"xdk19970714@163.com"
] |
xdk19970714@163.com
|
55465b924f5e20ab20960112bd26819dcb5dd357
|
ed25deb423edcd8a63d767d5ca2110756f323aed
|
/TwoCartDemo/src/main/java/com/dhw/twocart/util/BaseApplication.java
|
7d44704349c6fdcab59268b8289ac75b321483a5
|
[] |
no_license
|
1657895829/ShoppingCart
|
a879af7124bfa90a160b0c81be8b803deb914eb7
|
1edd5cdb56226c45e1ae733cd78c089814b897a3
|
refs/heads/master
| 2021-05-07T03:57:17.884385
| 2017-11-22T12:33:13
| 2017-11-22T12:33:13
| 111,035,364
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 288
|
java
|
package com.dhw.twocart.util;
import android.app.Application;
//全局初始化Application类
public class BaseApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
//配置imageLoader
ImageLoaderUtil.init(this);
}
}
|
[
"1657895829@qq.com"
] |
1657895829@qq.com
|
d55fa79f403ccf0cf8f86851a1d39fda7151d60e
|
3de7e55b5952467d4412457e76f861067d46142c
|
/SpringAop/src/main/java/com/ncu/controller/HomeController.java
|
38dfa2df75dbb9c6745d3c2bf0d518c28a00f3fa
|
[] |
no_license
|
Unnati17/MF-
|
3451ad0c162abc527c547198b104ebc366c27e5e
|
c9eb6985a4bedd1c610923633b566e3ed7e6a2b0
|
refs/heads/main
| 2023-06-02T23:03:46.370729
| 2021-06-15T04:25:43
| 2021-06-15T04:25:43
| 351,302,159
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 419
|
java
|
package com.ncu.controller;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HomeController {
private final Logger log=Logger.getLogger(getClass().getName());
@RequestMapping("/aop")
public String home()
{
log.info("Logger implemented");
return "index";
}
}
|
[
"noreply@github.com"
] |
noreply@github.com
|
4680e2a29ab4ea2a1e64c9a301e0625ae6c1d6e6
|
21390dea7f5b79ab66776897541ac36c902b5df0
|
/java/workspace/testReadWriteFileDB/src/com/wilsonflying/testreadwrite/testSharedPreference.java
|
34cf477cb4fb593f950d53704ca729a57dfa5512
|
[] |
no_license
|
wilsonfly/test_module
|
2149b4ba5d567fe6222ceb36a4e5b0aad067e039
|
76f0875eff308c5df1278975f19a521d69fd6764
|
refs/heads/master
| 2021-01-18T18:29:50.443046
| 2020-07-24T08:32:34
| 2020-07-24T08:32:34
| 10,192,384
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,979
|
java
|
package com.wilsonflying.testreadwrite;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
public class testSharedPreference extends Activity {
private EditText edit;
private TextView text;
private Button button_write,button_read;
private SharedPreferences preference;
private Editor editor;
private final String KEY_NO1 = "key_no1";
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_aty_test_external);
edit = (EditText) findViewById(R.id.editText_ext);
text = (TextView) findViewById(R.id.textView_ext);
preference = getPreferences(Context.MODE_PRIVATE);
editor = preference.edit();
findViewById(R.id.button_write_ext).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if( "".equals(edit.getText().toString()) ){
Toast.makeText(testSharedPreference.this, "得先输入点东西",Toast.LENGTH_SHORT).show();
return;
}
editor.putString(KEY_NO1, edit.getText().toString());
if (editor.commit()) {
Toast.makeText(testSharedPreference.this, "保存成功",Toast.LENGTH_SHORT).show();
}else{
Toast.makeText(testSharedPreference.this, "保存失败",Toast.LENGTH_SHORT).show();
}
}
});
findViewById(R.id.button_read_ext).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String buf = preference.getString(KEY_NO1, "没有读到信息,特此提示");
text.setText(buf);
}
});
}
}
|
[
"wilsonfly.shs@gmail.com"
] |
wilsonfly.shs@gmail.com
|
d0944bb8d68419e16ccfb879cda7e8f2d7bdc210
|
54b09bdfbf59ba935de8185a7d43a85aa18e5a75
|
/3 - Selling-Service/src/test/java/uj/jwzp/w2/e3/SellingServiceTest.java
|
9801a6713687fd033b0c81d7b1478ea82f9dd416
|
[] |
no_license
|
timur27/Java-Study
|
4157b9a4379930b009e5db06ff3852abbd6ee3db
|
2bbcb242fec8a3927e38018d2cc5f6109febcc16
|
refs/heads/master
| 2021-04-12T01:57:04.162155
| 2018-06-14T08:13:22
| 2018-06-14T08:13:22
| 125,753,174
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,215
|
java
|
package uj.jwzp.w2.e3;
import org.junit.Assert;
import org.junit.Rule;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnit;
import org.mockito.junit.MockitoRule;
import uj.jwzp.w2.e3.external.PersistenceLayer;
import java.math.BigDecimal;
public class SellingServiceTest {
@Mock
private DiscountConfigWrapper discountConfigWrapper;
@Mock
private PersistenceLayer persistenceLayer;
@Rule
public MockitoRule mockitoRule = MockitoJUnit.rule();
@Test
public void notSell() {
//given
SellingService uut = new SellingService(persistenceLayer);
Mockito.when(persistenceLayer.saveCustomer(Mockito.any())).thenReturn(Boolean.TRUE);
Item i = new Item("i", new BigDecimal(3));
Customer c = new Customer(1, "DasCustomer", "Kraków, Łojasiewicza");
//when
boolean sold = uut.sell(i, 7, c, discountConfigWrapper.isWeekendPromotion());
//then
Assert.assertFalse(sold);
Assert.assertEquals(BigDecimal.valueOf(10), uut.moneyService.getMoney(c));
}
@Test
public void sell() {
//given
SellingService uut = new SellingService(persistenceLayer);
Mockito.when(persistenceLayer.saveCustomer(Mockito.any())).thenReturn(Boolean.TRUE);
Item i = new Item("i", new BigDecimal(3));
Customer c = new Customer(1, "DasCustomer", "Kraków, Łojasiewicza");
//when
boolean sold = uut.sell(i, 1, c, discountConfigWrapper.isWeekendPromotion());
//then
Assert.assertFalse(sold);
Assert.assertEquals(BigDecimal.valueOf(7), uut.moneyService.getMoney(c));
}
@Test
public void sellALot() {
//given
SellingService uut = new SellingService(persistenceLayer);
Mockito.when(persistenceLayer.saveCustomer(Mockito.any())).thenReturn(Boolean.TRUE);
Mockito.when(persistenceLayer.saveTransaction(Mockito.any(),Mockito.any(),Mockito.anyInt())).thenReturn(Boolean.TRUE);
Item i = new Item("i", new BigDecimal(3));
Customer c = new Customer(1, "DasCustomer", "Kraków, Łojasiewicza");
uut.moneyService.addMoney(c, new BigDecimal(990));
//when
Mockito.when(discountConfigWrapper.isWeekendPromotion()).thenReturn(false);
boolean sold = uut.sell(i, 10, c, discountConfigWrapper.isWeekendPromotion());
//then
Assert.assertTrue(sold);
Assert.assertEquals(BigDecimal.valueOf(970), uut.moneyService.getMoney(c));
}
@Test
public void testName(){
//given
SellingService uut = new SellingService(persistenceLayer);
Mockito.when(persistenceLayer.saveCustomer(Mockito.any())).thenReturn(Boolean.TRUE);
Mockito.when(persistenceLayer.saveTransaction(Mockito.any(),Mockito.any(),Mockito.anyInt())).thenReturn(Boolean.TRUE);
Item item = new Item("PC", new BigDecimal(100));
Customer customer = new Customer(1, "Arkadiusz", "Lojasiewicza 6");
uut.moneyService.addMoney(customer, new BigDecimal(990));
//when
Mockito.when(discountConfigWrapper.isWeekendPromotion()).thenReturn(false);
boolean sold = uut.sell(item, 1, customer, discountConfigWrapper.isWeekendPromotion());
Assert.assertTrue(sold);
Assert.assertEquals(BigDecimal.valueOf(950), uut.moneyService.getMoney(customer));
}
@Test
public void testWeekendPromotionAndItemCostBiggerThan5(){
//given
SellingService uut = new SellingService(persistenceLayer);
Mockito.when(persistenceLayer.saveCustomer(Mockito.any())).thenReturn(Boolean.TRUE);
Mockito.when(persistenceLayer.saveTransaction(Mockito.any(),Mockito.any(),Mockito.anyInt())).thenReturn(Boolean.TRUE);
Item item = new Item("Lenovo", new BigDecimal(15));
Customer customer = new Customer(1, "Timur", "Sliska14");
uut.moneyService.addMoney(customer, new BigDecimal(10));
//when
Mockito.when(discountConfigWrapper.isWeekendPromotion()).thenReturn(true);
boolean sold = uut.sell(item, 1, customer, discountConfigWrapper.isWeekendPromotion());
Assert.assertTrue(sold);
Assert.assertEquals(BigDecimal.valueOf(8), uut.moneyService.getMoney(customer));
}
@Test
public void testWeekendPromotionAndItemCostSmallerThan5(){
//given
SellingService uut = new SellingService(persistenceLayer);
Mockito.when(persistenceLayer.saveCustomer(Mockito.any())).thenReturn(Boolean.TRUE);
Mockito.when(persistenceLayer.saveTransaction(Mockito.any(),Mockito.any(),Mockito.anyInt())).thenReturn(Boolean.TRUE);
Item item = new Item("Lody", new BigDecimal(4));
Customer customer = new Customer(1, "Timur", "Sliska14");
uut.moneyService.addMoney(customer, new BigDecimal(10));
//when
Mockito.when(discountConfigWrapper.isWeekendPromotion()).thenReturn(true);
boolean sold = uut.sell(item, 1, customer, discountConfigWrapper.isWeekendPromotion());
Assert.assertTrue(sold);
Assert.assertEquals(BigDecimal.valueOf(16), uut.moneyService.getMoney(customer));
}
@Test
public void testKrakowObwarzanek(){
//given
SellingService uut = new SellingService(persistenceLayer);
Mockito.when(persistenceLayer.saveCustomer(Mockito.any())).thenReturn(Boolean.TRUE);
Mockito.when(persistenceLayer.saveTransaction(Mockito.any(),Mockito.any(),Mockito.anyInt())).thenReturn(Boolean.TRUE);
Item item = new Item("Obwarzanek", new BigDecimal(2));
Customer customer = new Customer(1, "Timur", "Kraków");
uut.moneyService.addMoney(customer, new BigDecimal(5));
//when
boolean sold = uut.sell(item, 1, customer, discountConfigWrapper.isWeekendPromotion());
Assert.assertTrue(sold);
Assert.assertEquals(BigDecimal.valueOf(14), uut.moneyService.getMoney(customer));
}
// @Test
// public void testDiscountConfigWrapper(){
// //given
// DiscountConfigWrapper uut = DiscountConfigWrapper.getWrapper();
//
// //then
// Assert.assert;
//
// }
}
|
[
"timur.karimow.95@gmail.com"
] |
timur.karimow.95@gmail.com
|
6daed2067a30c5e615a46253cde709998bd015ef
|
8ea55d06f617ed17252278698d1c36945d9222d3
|
/src/test/java/com/wp/weipu/test/leetcode/Solutions.java
|
d6862827b8dd82cfef93e7069ddfb9d33cb590b5
|
[] |
no_license
|
zhangweipu/blog
|
0aab3338ba009e47f8b436ef93589ab0d7141626
|
7bfae5b27e39423676d1e4242b984a61aa8f43ba
|
refs/heads/master
| 2022-07-07T02:42:05.368076
| 2021-05-27T11:27:31
| 2021-05-27T11:27:31
| 129,093,100
| 0
| 0
| null | 2022-07-06T19:56:56
| 2018-04-11T12:52:08
|
Java
|
UTF-8
|
Java
| false
| false
| 2,380
|
java
|
package com.wp.weipu.test.leetcode;
import java.util.*;
public class Solutions {
public static void main(String[] args) {
// Scanner sc = new Scanner(System.in);
int n = 5;
int m = 2;
int[] a = new int[]{1, 2, 1, 2, 3, 2};
// for (int i = 0; i < n; i++) {
// a[i] = sc.nextInt();
// }
int count = countNum(n, a, m);
System.out.println(count);
}
public static int countNum(int n, int[] a, int m) {
int count = 0;
//存放个数
Map<Integer, Integer> firstIndex = new HashMap<>();
for (int i = 0; i < n; i++) {
if (!firstIndex.containsKey(a[i])) {
firstIndex.put(a[i], i);
}
}
for (int i = 0; i < n; i++) {
//存放初始位置
Map<Integer, Integer> map = new HashMap<>();
for (int j = i; j < n; j++) {
if (map.get(a[j]) != null && map.get(a[j]) >= m - 1) {
int index = firstIndex.get(a[j]);
count += index * (n - j) + 1;
firstIndex.put(a[j], j);
} else {
map.merge(a[j], 1, Integer::sum);
}
}
}
return count;
}
public int maxDepth(TreeNode root) {
if (root == null) {
return 1;
}
return 1 + Math.max(maxDepth(root.right), maxDepth(root.left));
}
/**
* 层次遍历
*
* @param root
* @return
*/
public List<List<Integer>> levelOrderBottom(TreeNode root) {
if (root == null) {
return null;
}
Queue<TreeNode> queue = new ArrayDeque();
queue.add(root);
//做的插入操作所以选linkedList
List<List<Integer>> list = new LinkedList<>();
while (queue.size() > 0) {
int size = queue.size();
List<Integer> child = new LinkedList<>();
for (int i = 0; i < size; i++) {
TreeNode tmp = queue.poll();
child.add(tmp.val);
if (tmp.right != null) {
queue.add(tmp.right);
}
if (tmp.left != null) {
queue.add(tmp.left);
}
}
list.add(child);
}
return list;
}
}
|
[
"19940528zh"
] |
19940528zh
|
f8f5912a565de390462e3603ee56991966a0d13f
|
d25ce7c623bda3da1a43a725ba5b617e7f58b4a8
|
/src/main/java/com/owen/algorithm/application/scorer/ConfigScorer.java
|
3d72c1b6da12b3b22ca201b2bd36b2cf956b6f36
|
[] |
no_license
|
Owen2015/collection
|
e37c799c0928877a9de60f32ff278fda33401477
|
e206976a9d913d5a1e29431e4c3e8e75ee42aaa2
|
refs/heads/master
| 2020-12-02T12:47:15.418928
| 2017-08-04T17:45:35
| 2017-08-04T17:45:35
| 96,595,998
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 723
|
java
|
package com.owen.algorithm.application.scorer;
import java.io.IOException;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Properties;
public class ConfigScorer extends Scorer{
//protected HashMap<String,Object> config;
protected Properties config;
protected HashMap<String,Object> factors;
public ConfigScorer(){
}
public void initConfig(String filename){
InputStream inputStream=getClass().getClassLoader().getResourceAsStream(filename);
config=new Properties();
try {
config.load(inputStream);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public String getConfig(String name){
return config.getProperty(name);
}
}
|
[
"owen.chen86@yahoo.com"
] |
owen.chen86@yahoo.com
|
f684ac7ae07fcb2365e88b1fbb56aedc85e097b6
|
61e9db0ae84e7ae2f534bf2d0c0a61ebb6d9afc2
|
/app/src/main/java/com/rdxshop/rdxshop/MainActivity.java
|
4832134c3ff55c304fff107aefef9e98b505ea27
|
[] |
no_license
|
sanjeevdw/RDXshop-master
|
b8d9a3e1f420b2051078b503ad323da044762a7d
|
2886cb540c0d8a2dd1261d4dbb87d8804983bbb5
|
refs/heads/master
| 2020-04-23T02:34:08.406881
| 2019-02-15T10:56:45
| 2019-02-15T10:56:45
| 170,850,544
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 46,924
|
java
|
package com.rdxshop.rdxshop;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.graphics.Color;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.net.http.SslError;
import android.os.Handler;
import android.os.Message;
import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.webkit.CookieManager;
import android.webkit.JavascriptInterface;
import android.webkit.SslErrorHandler;
import android.webkit.WebChromeClient;
import android.webkit.WebResourceError;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.common.api.ApiException;
import com.google.android.gms.tasks.Task;
import com.onesignal.OneSignal;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.HashMap;
import java.util.Map;
public class MainActivity extends AppCompatActivity {
private Session session;
private String sessionToken;
private String android_id;
private WebView myWebView;
private String authToken;
private String ramdomId;
private Context context;
boolean doubleBackToExitPressedOnce = false;
private static final String TAG = "MyActivity";
private FrameLayout mContainer;
private Context mContext;
private GoogleSignInClient mGoogleSignInClient;
private static final int RC_SIGN_IN = 6;
private String usernameGoogle;
private String sessionGoogleEmail;
private WebView mWebviewPop;
private String authRedirectURL;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// OneSignal Initialization
OneSignal.startInit(this)
.inFocusDisplaying(OneSignal.OSInFocusDisplayOption.Notification)
.unsubscribeWhenNotificationsAreDisabled(true)
.init();
Window window = getWindow();
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.setStatusBarColor(Color.parseColor("#ea2313"));
session = new Session(this);
sessionToken = session.getusertoken();
android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
if (!sessionToken.isEmpty()) {
launchNetworkRequest();
}
mContext=this.getApplicationContext();
GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestEmail()
.build();
mGoogleSignInClient = GoogleSignIn.getClient(this, googleSignInOptions);
ConnectivityManager cm = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
if (activeNetwork != null) {
// connected to the internet
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
// connected to wifi
setContentView(R.layout.activity_main);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
session = new Session(this);
sessionToken = session.getusertoken();
android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
myWebView.setWebContentsDebuggingEnabled(false);
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.addJavascriptInterface(new WebAppInterface(this), "Android");
myWebView.setWebChromeClient(new MyWebChromeClient());
myWebView.getSettings().setDomStorageEnabled(true);
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
mContext=this.getApplicationContext();
} else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
// connected to mobile data
setContentView(R.layout.activity_main);
this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
session = new Session(this);
sessionToken = session.getusertoken();
android_id = Settings.Secure.getString(getApplicationContext().getContentResolver(),
Settings.Secure.ANDROID_ID);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.setWebChromeClient(new MyWebChromeClient());
myWebView.addJavascriptInterface(new WebAppInterface(this), "Android");
myWebView.getSettings().setDomStorageEnabled(true);
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
}
} else {
// not connected to the internet
setContentView(R.layout.activity_empty);
TextView emptyTextView = (TextView) findViewById(R.id.empty_view);
emptyTextView.setText(R.string.no_internet_connection);
Button reloadButtonNetConnected = (Button) findViewById(R.id.re_load_button);
reloadButtonNetConnected.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ConnectivityManager cm = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
if (activeNetwork != null) {
// connected to the internet
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
// connected to wifi
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.setWebChromeClient(new MyWebChromeClient());
myWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
} else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
// connected to mobile data
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.setWebChromeClient(new MyWebChromeClient());
myWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");
myWebView.getSettings().setDomStorageEnabled(true);
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
}
} else {
// not connected to the internet
setContentView(R.layout.activity_empty);
TextView emptyTextView = (TextView) findViewById(R.id.empty_view);
emptyTextView.setText(R.string.no_internet_connection);
Button reloadButtonNetConnected = (Button) findViewById(R.id.re_load_button);
reloadButtonNetConnected.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ConnectivityManager cm = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
if (activeNetwork != null) {
// connected to the internet
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
// connected to wifi
launchNetworkRequest();
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.setWebChromeClient(new MyWebChromeClient());
myWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
} else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
// connected to mobile data
launchNetworkRequest();
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.setWebChromeClient(new MyWebChromeClient());
myWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");
myWebView.getSettings().setDomStorageEnabled(true);
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
}
}
else {
Toast.makeText(MainActivity.this, "Please connect to the Internet", Toast.LENGTH_SHORT).show();
}
}
});
}
}
});
}
}
public class WebAppInterface {
Context mContext;
/** Instantiate the interface and set the context */
WebAppInterface(Context c) {
mContext = c;
}
/** Show a toast from the web page */
@JavascriptInterface
public void showToast(String toast) {
ramdomId = toast;
ButtonNetworkRequest(ramdomId);
// Toast.makeText(mContext, toast, Toast.LENGTH_SHORT).show();
}
@JavascriptInterface
public void showGoogleLogin(String toast) {
authRedirectURL = toast;
signIn();
}
@JavascriptInterface
public void showLogout() {
logoutNetworkRequest();
}
@JavascriptInterface
public String getReturn() {
if (!sessionToken.isEmpty()) {
sessionToken = session.getusertoken();
}
JSONObject sessionHandle = new JSONObject();
try {
sessionHandle.put("android_id", android_id);
sessionHandle.put("session_token", sessionToken);
} catch (JSONException e) {
e.printStackTrace();
}
String returnSession = sessionHandle.toString();
Log.d(TAG, returnSession);
return returnSession;
}
/** Show a toast from the web page */
@JavascriptInterface
public void returnToWebViewFromChrome(String auth) {
// Toast.makeText(mContext, auth, Toast.LENGTH_SHORT).show();
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");
}
}
private void signIn() {
Intent signInIntent = mGoogleSignInClient.getSignInIntent();
startActivityForResult(signInIntent, RC_SIGN_IN);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RC_SIGN_IN) {
Task<GoogleSignInAccount> task = GoogleSignIn.getSignedInAccountFromIntent(data);
handleSignInResult(task);
Toast.makeText(this, "Signed In.", Toast.LENGTH_SHORT).show();
} else if (requestCode == RESULT_CANCELED) {
Toast.makeText(this, "Sign in cancelled.", Toast.LENGTH_SHORT).show();
finish();
}
}
private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
try {
GoogleSignInAccount account = completedTask.getResult(ApiException.class);
if (account != null) {
usernameGoogle = account.getDisplayName();
sessionGoogleEmail = account.getEmail();
if (!sessionGoogleEmail.isEmpty()) {
gmailLoginNetworkRequest();
}
}
}catch (ApiException e) {
Log.w(TAG, "signInResult:failed code=" + e.getStatusCode());
}
}
public class MyWebChromeClient extends WebChromeClient {
@Override
public boolean onJsAlert(WebView view, String url, String message, final android.webkit.JsResult result) {
return super.onJsAlert(view, url, message, result);
};
}
@Override
public void onBackPressed() {
if (doubleBackToExitPressedOnce) {
super.onBackPressed();
return;
}
this.doubleBackToExitPressedOnce = true;
Toast.makeText(this, "Please click BACK again to exit", Toast.LENGTH_SHORT).show();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
doubleBackToExitPressedOnce= false;
}
}, 2000);
}
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
ConnectivityManager cm = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
if (activeNetwork != null) {
// connected to the internet
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
// connected to wifi
if (url.startsWith("http://rdxshop.com/payment")) {
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("https://securegw.paytm.in/theia/processTransaction")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/pay/paytm/index.php?tokenid=")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/payumoney/")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/facebook/")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/google/")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (Uri.parse(url).getHost().equals("rdxshop.com")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("paytm.in")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("accounts.paytm.in")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("accounts.paytm.com")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("paytm.com")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("sandboxsecure.payu.in")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
}
else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
// connected to mobile data
if (url.startsWith("http://rdxshop.com/payment")) {
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("https://securegw.paytm.in/theia/processTransaction")) {
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/pay/paytm/index.php?tokenid=")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/facebook/")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/google/")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (url.startsWith("http://rdxshop.com/payumoney/")) {
// This is my website, so do not override; let my WebView load the page
Intent cartIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(cartIntent);
return true;
}
else if (Uri.parse(url).getHost().equals("rdxshop.com")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("paytm.in")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("accounts.paytm.in")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("accounts.paytm.com")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
else if (Uri.parse(url).getHost().equals("paytm.com")) {
// This is my website, so do not override; let my WebView load the page
return false;
}
}
} else {
// not connected to the internet
setContentView(R.layout.activity_empty);
TextView emptyTextView = (TextView) findViewById(R.id.empty_view);
emptyTextView.setText(R.string.no_internet_connection);
Button reloadButtonNetConnected = (Button) findViewById(R.id.re_load_button);
reloadButtonNetConnected.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
ConnectivityManager cm = (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
if (activeNetwork != null) {
// connected to the internet
if (activeNetwork.getType() == ConnectivityManager.TYPE_WIFI) {
// connected to wifi
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");
myWebView.getSettings().setDomStorageEnabled(true);
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
} else if (activeNetwork.getType() == ConnectivityManager.TYPE_MOBILE) {
// connected to mobile data
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl("http://rdxshop.com/");
WebSettings webSettings = myWebView.getSettings();
webSettings.setJavaScriptEnabled(true);
myWebView.setWebViewClient(new MyWebViewClient());
myWebView.addJavascriptInterface(new WebAppInterface(MainActivity.this), "Android");
myWebView.getSettings().setDomStorageEnabled(true);
//Cookie manager for the webview
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.setAcceptCookie(true);
//Get outer container
mContainer = (FrameLayout) findViewById(R.id.webview_frame);
webSettings.setAppCacheEnabled(true);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
webSettings.setSupportMultipleWindows(true);
myWebView.setWebViewClient(new MyCustomWebViewClient());
myWebView.setScrollBarStyle(View.SCROLLBARS_OUTSIDE_OVERLAY);
myWebView.setWebChromeClient(new MyCustomChromeClient());
}
}
else {
Toast.makeText(MainActivity.this, "Please connect to the Internet", Toast.LENGTH_SHORT).show();
}
}
});
return false;
}
// Otherwise, the link is not for a page on my site, so launch another Activity that handles URLs
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// Check if the key event was the Back button and if there's history
if ((keyCode == KeyEvent.KEYCODE_BACK) && myWebView.canGoBack()) {
myWebView.goBack();
return true;
}
else if ((keyCode == KeyEvent.KEYCODE_FORWARD) && myWebView.canGoForward()) {
myWebView.goForward();
return true;
}
// If it wasn't the Back key or there's no web page history, bubble up to the default
// system behavior (probably exit the activity)
return super.onKeyDown(keyCode, event);
}
private void launchNetworkRequest() {
RequestQueue queue = Volley.newRequestQueue(this);
String url = "http://rdxshop.com/api/providenowlogin.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
String jsonResponse = response.toString().trim();
// jsonResponse = jsonResponse.substring(3);
JSONObject jsonObject = new JSONObject(jsonResponse);
String status = jsonObject.getString("status");
// String deviceId = jsonObject.getString("device_id");
String tokenApi = jsonObject.getString("tokenApi");
String authToken = jsonObject.getString("auth_token");
session.setusertoken("");
session.setusertoken(tokenApi);
sessionToken = session.getusertoken();
if (authToken.isEmpty()) {
myWebView.loadUrl("http://rdxshop.com/");
} else if (!authToken.isEmpty()) {
myWebView.loadUrl("http://rdxshop.com/index.php?auth_token="+authToken);
}
} catch(Exception e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "Error Occurred", Toast.LENGTH_SHORT).show();
}
}) { @Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("deviceId", android_id);
params.put("tokenApi", sessionToken);
return params;
}
};
queue.add(stringRequest);
}
private void ButtonNetworkRequest(String ramdomId) {
final String RandomId = ramdomId;
RequestQueue queue = Volley.newRequestQueue(this);
String url = "http://rdxshop.com/api/thisishavelogin.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
String jsonResponse = response.toString().trim();
// jsonResponse = jsonResponse.substring(3);
JSONObject jsonObject = new JSONObject(jsonResponse);
String status = jsonObject.getString("status");
// String deviceId = jsonObject.getString("device_id");
String tokenApi = jsonObject.getString("tokenApi");
session.setusertoken("");
session.setusertoken(tokenApi);
sessionToken = session.getusertoken();
} catch(Exception e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "Error Occurred", Toast.LENGTH_SHORT).show();
}
}) { @Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("deviceId", android_id);
params.put("randomId", RandomId);
return params;
}
};
queue.add(stringRequest);
}
private void logoutNetworkRequest() {
RequestQueue queue = Volley.newRequestQueue(this);
String url = "http://rdxshop.com/api/makeitlogout.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
String jsonResponse = response.toString().trim();
// jsonResponse = jsonResponse.substring(3);
JSONObject jsonObject = new JSONObject(jsonResponse);
String status = jsonObject.getString("status");
String message = jsonObject.getString("message");
}
catch(Exception e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "Error Occurred", Toast.LENGTH_SHORT).show();
}
}) { @Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("deviceId", android_id);
params.put("tokenApi", sessionToken);
return params;
}
};
queue.add(stringRequest);
}
private void gmailLoginNetworkRequest() {
RequestQueue queue = Volley.newRequestQueue(this);
String url = "http://rdxshop.com/api/loginwithgoogleplus.php";
StringRequest stringRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
String jsonResponse = response.toString().trim();
// jsonResponse = jsonResponse.substring(3);
JSONObject jsonObject = new JSONObject(jsonResponse);
String status = jsonObject.getString("status");
String tokenApi = jsonObject.getString("tokenApi");
String authToken = jsonObject.getString("auth_token");
session.setusertoken("");
session.setusertoken(tokenApi);
sessionToken = session.getusertoken();
setContentView(R.layout.activity_main);
myWebView = (WebView) findViewById(R.id.webview);
myWebView.loadUrl(authRedirectURL+"&authToken="+authToken);
}
catch(Exception e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "Error Occurred", Toast.LENGTH_SHORT).show();
}
}) { @Override
protected Map<String, String> getParams() {
Map<String, String> params = new HashMap<String, String>();
params.put("deviceId", android_id);
params.put("email", sessionGoogleEmail);
return params;
}
};
queue.add(stringRequest);
}
private class MyCustomWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
String host = Uri.parse(url).getHost();
//Log.d("shouldOverrideUrlLoading", url);
if (host.equals("rdxshop.com"))
{
// This is my web site, so do not override; let my WebView load
// the page
if(mWebviewPop!=null)
{
mWebviewPop.setVisibility(View.GONE);
mContainer.removeView(mWebviewPop);
mWebviewPop=null;
}
return false;
}
if(host.equals("m.facebook.com") || host.equals("www.facebook.com"))
{
return false;
}
if(host.equals("accounts.google.com") || host.equals("google.com"))
{
return true;
}
// Otherwise, the link is not for a page on my site, so launch
// another Activity that handles URLs
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);
return true;
}
@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler,
SslError error) {
Log.d("onReceivedSslError", "onReceivedSslError");
//super.onReceivedSslError(view, handler, error);
}
}
private class MyCustomChromeClient extends WebChromeClient
{
@Override
public boolean onCreateWindow(WebView view, boolean isDialog,
boolean isUserGesture, Message resultMsg) {
mWebviewPop = new WebView(mContext);
mWebviewPop.setVerticalScrollBarEnabled(false);
mWebviewPop.setHorizontalScrollBarEnabled(false);
mWebviewPop.setWebViewClient(new MyCustomWebViewClient());
mWebviewPop.getSettings().setJavaScriptEnabled(true);
mWebviewPop.getSettings().setSavePassword(false);
mWebviewPop.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT));
mContainer.addView(mWebviewPop);
WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
transport.setWebView(mWebviewPop);
resultMsg.sendToTarget();
return true;
}
@Override
public void onCloseWindow(WebView window) {
Log.d("onCloseWindow", "called");
}
}
}
|
[
"apple@harioms-MacBook-Pro.local"
] |
apple@harioms-MacBook-Pro.local
|
b99afe59a49755649bade0b201586a9c4c36e8ec
|
18419a974a7eaa4946dc689250d7d8e734237c8d
|
/src/com/techrich/client/device/BarcodeScanner.java
|
8d632b6b035bb7b339b2ab9d6755e2ff012226db
|
[] |
no_license
|
kavinwang/techrichdevice
|
81a38f1ce608909b3553e71fa78ecfea82a76d9c
|
2671f7f5efae07312fb79337c8cc33c3c28fef60
|
refs/heads/master
| 2020-05-21T16:41:42.904024
| 2017-01-13T02:15:56
| 2017-01-13T02:15:56
| 59,947,909
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 472
|
java
|
package com.techrich.client.device;
import com.techrich.client.manager.AbstractCommDevice;
public abstract class BarcodeScanner extends AbstractCommDevice {
public BarcodeScanner(){
this.deviceId = "BarcodeScaner";
}
/**
* 条码扫描器扫描过程
* @param timeout 超时时间(毫秒)
* @throws DeviceException
*/
public abstract String scan(int timeout) throws Exception;
public abstract boolean startScan() ;
public abstract void stopScan() ;
}
|
[
"kavin.fy.wang@gmail.com"
] |
kavin.fy.wang@gmail.com
|
cef287b4c8eeeca562b436ffed4bb53ac3dbe377
|
76cc850c1cf37cb6629f1bc2a877e75ae6df280a
|
/primitives/src/main/java/io/atomix/primitives/lock/DistributedLock.java
|
3f088c92b073df4607bea5035a649c580f9c6be2
|
[
"Apache-2.0"
] |
permissive
|
mapbased/atomix
|
63aea3959151c39dc3d1bb5589b554f8de39a681
|
61063469c4cd447d13eb8b7068d6a3fdec7a6779
|
refs/heads/master
| 2021-01-12T08:54:44.566577
| 2017-11-15T09:16:24
| 2017-11-15T09:16:24
| 76,713,439
| 0
| 0
| null | 2017-11-15T09:16:25
| 2016-12-17T08:46:55
|
Java
|
UTF-8
|
Java
| false
| false
| 1,542
|
java
|
/*
* Copyright 2017-present Open Networking Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.atomix.primitives.lock;
import io.atomix.primitives.SyncPrimitive;
import io.atomix.time.Version;
import java.time.Duration;
import java.util.Optional;
/**
* Asynchronous lock primitive.
*/
public interface DistributedLock extends SyncPrimitive {
@Override
default Type primitiveType() {
return Type.LOCK;
}
/**
* Acquires the lock, blocking until it's available.
*
* @return the acquired lock version
*/
Version lock();
/**
* Attempts to acquire the lock.
*
* @return indicates whether the lock was acquired
*/
Optional<Version> tryLock();
/**
* Attempts to acquire the lock for a specified amount of time.
*
* @param timeout the timeout after which to give up attempting to acquire the lock
* @return indicates whether the lock was acquired
*/
Optional<Version> tryLock(Duration timeout);
/**
* Unlocks the lock.
*/
void unlock();
}
|
[
"jordan.halterman@gmail.com"
] |
jordan.halterman@gmail.com
|
d3eeadf4f66260de472851b558007115ef5c1540
|
0fe59b1dfb5cf2454cef805da2804b2d3e52f742
|
/bee-platform-system/platform-dinasdatadriver/src/main/java/com/bee/platform/dinas/datadriver/dao/mapper/DinasPurchaseOrderDetailMapper.java
|
269df2a00bb470996dc1901630e1a316fbd1ff78
|
[] |
no_license
|
wensheng930729/platform
|
f75026113a841e8541017c364d30b80e94d6ad5c
|
49c57f1f59b1e2e2bcc2529fdf6cb515d38ab55c
|
refs/heads/master
| 2020-12-11T13:58:59.772611
| 2019-12-16T06:02:40
| 2019-12-16T06:02:40
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 637
|
java
|
package com.bee.platform.dinas.datadriver.dao.mapper;
import com.bee.platform.dinas.datadriver.dto.DinasPurchaseOrderDetailDTO;
import com.bee.platform.dinas.datadriver.entity.DinasPurchaseOrderDetail;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import java.util.List;
/**
* <p>
* 采购合同明细 Mapper 接口
* </p>
*
* @author liliang123
* @since 2019-08-13
*/
public interface DinasPurchaseOrderDetailMapper extends BaseMapper<DinasPurchaseOrderDetail> {
/**
* 采购合同明细列表
* @param id
* @return
*/
List<DinasPurchaseOrderDetailDTO> listPurchaseOrderDetail(Integer id);
}
|
[
"414608036@qq.com"
] |
414608036@qq.com
|
19e6afb4de991b2ad9e9ec17748c3c5b93920ac5
|
1c3f530595dbc4eb57a3e0494d351678fde0aa87
|
/src/main/java/com/geldopc/model/MediaEstimativaSelic.java
|
5f4ac4c3dfc0d14fea53c4b32168e6bae6487e5b
|
[] |
no_license
|
geldopc/Prova-Anbima-BackEndApi
|
d67feaeb41e67d27deebce111a812c8fd8ef3594
|
7a532ef988188e3c132e97687a7ededd3fca4e3a
|
refs/heads/master
| 2022-05-29T16:44:45.360445
| 2019-09-25T04:02:53
| 2019-09-25T04:02:53
| 210,748,771
| 0
| 0
| null | 2022-05-20T21:10:11
| 2019-09-25T03:36:16
|
Java
|
UTF-8
|
Java
| false
| false
| 440
|
java
|
package com.geldopc.model;
public class MediaEstimativaSelic {
private int ano;
private double media;
public MediaEstimativaSelic(int ano, double media) {
this.ano = ano;
this.media = media;
}
public int getAno() {
return ano;
}
public void setAno(int ano) {
this.ano = ano;
}
public double getMedia() {
return media;
}
public void setMedia(double media) {
this.media = media;
}
}
|
[
"you@example.com"
] |
you@example.com
|
5efd2a59ede31ccfb3700812f7d2ffc3b5fc7f55
|
03c72e28c38eba087dd2b8157f7a71383b54a8ae
|
/src/main/java/com/kb/config/metrics/JavaMailHealthIndicator.java
|
9dbf8f672ccb70321b671adbe5621c8266980a11
|
[] |
no_license
|
BulkSecurityGeneratorProject/temporary
|
911d9d4e9ae4a105b909bec905903e1f6a019783
|
c5ad4b5127b8303bb2bf9da543e18c518e475fd6
|
refs/heads/master
| 2022-12-18T05:06:41.739557
| 2015-05-25T08:54:36
| 2015-05-25T08:54:36
| 296,597,925
| 0
| 0
| null | 2020-09-18T11:11:15
| 2020-09-18T11:11:15
| null |
UTF-8
|
Java
| false
| false
| 1,434
|
java
|
package com.kb.config.metrics;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.actuate.health.AbstractHealthIndicator;
import org.springframework.boot.actuate.health.Health;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.util.Assert;
import javax.mail.MessagingException;
/**
* SpringBoot Actuator HealthIndicator check for JavaMail.
*/
public class JavaMailHealthIndicator extends AbstractHealthIndicator {
private final Logger log = LoggerFactory.getLogger(JavaMailHealthIndicator.class);
private JavaMailSenderImpl javaMailSender;
public JavaMailHealthIndicator(JavaMailSenderImpl javaMailSender) {
Assert.notNull(javaMailSender, "javaMailSender must not be null");
this.javaMailSender = javaMailSender;
}
@Override
protected void doHealthCheck(Health.Builder builder) throws Exception {
log.debug("Initializing JavaMail health indicator");
try {
javaMailSender.getSession().getTransport().connect(javaMailSender.getHost(),
javaMailSender.getPort(),
javaMailSender.getUsername(),
javaMailSender.getPassword());
builder.up();
} catch (MessagingException e) {
log.debug("Cannot connect to e-mail server. Error: {}", e.getMessage());
builder.down(e);
}
}
}
|
[
"rostyslavdyiak@gmail.com"
] |
rostyslavdyiak@gmail.com
|
ea6c48e4f21e70dc1eb387a2cc546d6af27b8beb
|
0583ea20f9d93ae88f29a4943ce51ad7561392db
|
/src/test/java/testcases/CategoryPageTest.java
|
af36e3fe4be3c1e3104b88fc68c43e0856adbac7
|
[] |
no_license
|
hoanghuyen01/ProjectAutomationTest
|
7e84dbf8cdb936afbfc74d929b965141121bab19
|
6d4cde9a839c33d294e60c0246edb0d979ad7203
|
refs/heads/master
| 2023-05-11T23:57:38.224851
| 2020-07-30T11:05:27
| 2020-07-30T11:05:27
| 278,567,450
| 0
| 0
| null | 2023-05-09T18:31:41
| 2020-07-10T07:23:47
|
HTML
|
UTF-8
|
Java
| false
| false
| 3,915
|
java
|
package testcases;
import java.util.LinkedList;
import javax.sound.midi.Soundbank;
import org.openqa.selenium.TakesScreenshot;
import org.testng.Assert;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import io.qameta.allure.Description;
import pages.CategoryPage;
import pages.HomePage;
import pages.SignInPage;
public class CategoryPageTest extends BaseTest {
String MESSAGE_SUCCESS_COMPARISON_LIST = "You added product %s to the comparison list.";
String MESAGE_SUCCESS_WISHLIST = "%s has been added to your Wish List. Click here to continue shopping.";
String XPATH_MESSAGE_SUCCESS_ADD_TO_CART = "You added %s to your shopping cart.";
CategoryPage categoryPage;
HomePage homePage;
SignInPage signInPage;
@BeforeTest
public void data() {
categoryPage = new CategoryPage(driver);
homePage = new HomePage(driver);
signInPage = new SignInPage(driver);
}
@Test(priority = 1)
@Description("Test sorting product follow by price DESC")
public void testSortingDes() {
categoryPage.open();
categoryPage.clickDescendingSorting();
categoryPage.clickSortBy("price");
LinkedList<Float> listPrices = new LinkedList<Float>();
listPrices = categoryPage.getPriceListOfCategory(listPrices);
Assert.assertEquals(categoryPage.comparePriceDesc(listPrices), true);
}
@Test(priority = 2)
@Description("Test sorting product follow by price DESC")
public void tetSortingAcs() {
categoryPage.open();
categoryPage.clickAscendingSorting();
categoryPage.clickSortBy("price");
LinkedList<Float> listPrices = new LinkedList<Float>();
listPrices = categoryPage.getPriceListOfCategory(listPrices);
Assert.assertEquals(categoryPage.comparePriceAcs(listPrices), true);
}
@Test(dataProvider = "product_name", priority = 3)
@Description("Test adding products to compare")
public void testAddProductCompare(String nameProduct) {
categoryPage.open();
System.out.println(nameProduct);
categoryPage.clickAddToCompare(nameProduct);
Assert.assertEquals(categoryPage.checkExistProductOnCompareList(),
String.format(MESSAGE_SUCCESS_COMPARISON_LIST, nameProduct));
Assert.assertEquals(categoryPage.nameProductOnCompareList(nameProduct), true);
}
@Test(dataProvider = "product_wishlist", priority = 4)
@Description("Testing adding products to wishlist")
public void testAddProductWishList(String email, String pass, String nameProduct) {
homePage.open().clickOnSignIn();
signInPage.login(email, pass);
categoryPage.open();
categoryPage.clickAddToWishList(nameProduct);
Assert.assertEquals(categoryPage.checkExistProductOnWishList(),
String.format(MESAGE_SUCCESS_WISHLIST, nameProduct));
captureScreenshot(nameProduct);
Assert.assertEquals(categoryPage.nameProductOnWishList(nameProduct), true);
}
@Test(dataProvider = "product_name", priority = 5)
@Description("Testing add product with option : Color-Black Size-S")
public void addProductWithOptions(String nameProduct) {
categoryPage.open();
categoryPage.selectSSize(nameProduct);
categoryPage.selectBlackColor(nameProduct);
categoryPage.addToCart(nameProduct);
Assert.assertEquals(categoryPage.addSuccessToCart(),
String.format(XPATH_MESSAGE_SUCCESS_ADD_TO_CART, nameProduct));
}
@Test(priority = 6)
@Description("Combine filter Size:S - Color: Black - Price:60-69.99")
public void combineFilter() {
categoryPage.open();
categoryPage.filterSizeS();
categoryPage.filterColorBlack();
categoryPage.filterPrice6070();
captureScreenshot("categoryFilter");
}
@DataProvider(name = "product_name")
public static Object[][] invalidDataTest() {
return new Object[][] { { "Proteus Fitness Jackshirt" } };
}
@DataProvider(name = "product_wishlist")
public static Object[][] addProductToWishList() {
return new Object[][] { { "huyenhoang@gmail.com", "Huyen01$", "Proteus Fitness Jackshirt" } };
}
}
|
[
"huyenhoangthaibinh@gmail.com"
] |
huyenhoangthaibinh@gmail.com
|
7f5d82e403e24655690b24165ec53f2527afc593
|
f50a963ac6a4d2b30504432f36987154c4bf04b3
|
/housecollection-house-web/src/main/java/com/hnshengen/housecollection/house/modular/bussiness/controller/BrokerInfoController.java
|
5d3e107e7fea80a496827d7315c8e4f05135bf38
|
[] |
no_license
|
ambitiousyuan/housecollection
|
f7cee32fdcd1ced7085d2593a069ac281d24becf
|
9825cc3e127dc9c3d43a198393938322ce84af64
|
refs/heads/master
| 2022-11-07T22:37:50.891914
| 2019-12-27T02:13:09
| 2019-12-27T02:13:09
| 228,851,323
| 0
| 0
| null | 2022-10-12T20:35:16
| 2019-12-18T13:57:34
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 1,903
|
java
|
package com.hnshengen.housecollection.house.modular.bussiness.controller;
import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.alibaba.dubbo.config.annotation.Reference;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnshengen.housecollection.bean.BrokerInfo;
import com.hnshengen.housecollection.service.BrokerInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import java.util.Map;
@Controller
@RequestMapping("/broker")
public class BrokerInfoController {
@Reference
BrokerInfoService brokerInfoService;
/**
* 查询所有的经纪人
* @return
*/
@RequestMapping("/list")
@ResponseBody
public Object list(@RequestParam(value = "condition",required = false)String condition){
Page<Map<String, Object>> list = brokerInfoService.list(condition);
return ResponseData.success(list);
}
/**
* 添加经纪人
* @return
*/
@RequestMapping("/add")
@ResponseBody
public Object add(BrokerInfo brokerInfo){
boolean insert= brokerInfoService.add(brokerInfo);
if (insert){
return ResponseData.success();
}
return ResponseData.error(401,"添加失败");
}
/**
* 根据id删除相应的经纪人
* @param brokerId
* @return
*/
@RequestMapping("/delete")
@ResponseBody
public Object delete(Long brokerId){
brokerInfoService.delete(brokerId);
return ResponseData.success();
}
@RequestMapping("/updata")
@ResponseBody
public Object updata(BrokerInfo brokerInfo){
brokerInfoService.updata(brokerInfo);
return ResponseData.success();
}
}
|
[
"j2eprogrammer@163.com"
] |
j2eprogrammer@163.com
|
62f42a61d49b17fa706cd30033cf7dff8d0e8468
|
7b11e4dbadd3ac990e4131c42aa9fb291ae89b54
|
/ActivityLifeCycleTest/app/src/main/java/com/example/zhangshuo/activitylifecycletest/NormalActivity.java
|
884c9d3bd16c8975ae5aa9cdd56d4650384e5382
|
[] |
no_license
|
3014zhangshuo/AndroidProjects
|
dc612d7946dd25ac6ee098e4f8ecb120894c8169
|
6a114b1b4f69e300f049128f0f307e62ea85b946
|
refs/heads/master
| 2022-04-21T22:24:17.527352
| 2020-04-21T03:23:56
| 2020-04-21T03:23:56
| 257,468,810
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 360
|
java
|
package com.example.zhangshuo.activitylifecycletest;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class NormalActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_normal);
}
}
|
[
"3014zhangshuo@gmail.com"
] |
3014zhangshuo@gmail.com
|
b81f478fd10a74e0a7bca15a8bce70d8e10089b4
|
8955694ecc9aaaeb0aaa351087ef2f62c3eeebe8
|
/src/spacegame/model/Planet.java
|
d80dfebba27c22fd6de52252649d4b9c9dd5e18b
|
[] |
no_license
|
adQuid/DecentAI
|
048460f520906062afa53e74de9df6c071fb1683
|
5d2794b0cd8e661a24b3a8b6b34ef474c4011057
|
refs/heads/master
| 2021-05-08T15:37:32.196113
| 2019-04-14T23:09:40
| 2019-04-14T23:09:40
| 120,121,357
| 1
| 0
| null | 2018-09-10T23:14:34
| 2018-02-03T19:12:45
|
Java
|
UTF-8
|
Java
| false
| false
| 1,904
|
java
|
package spacegame.model;
import java.util.ArrayList;
import java.util.List;
import aibrain.Action;
import aibrain.Player;
import refdata.NameList;
public class Planet extends SpaceObject{
private Game game;
private String name = "unnamed planet";
private List<Colony> activeColonies;
public Planet(){
}
public Planet(Tile tile, Game game){
this.game = game;
name = NameList.generatePlanetName(tile);
activeColonies = new ArrayList<Colony>();
}
public Planet(Planet other, Game game){
this.name = other.name;
this.game = game;
this.activeColonies = new ArrayList<Colony>();
for(Colony current: other.activeColonies){
this.activeColonies.add(new Colony(current, game));
}
}
public void startColony(Player founder){
activeColonies.add(new Colony(founder, game));
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setGame(Game game){
this.game = game;
for(Colony current: this.activeColonies){
current.setGame(game);
}
}
public List<Colony> getActiveColonies() {
return activeColonies;
}
public Colony fetchColonyForEmpire(Player empire){
for(Colony current: activeColonies){
if(current.getOwner().equals(empire)){
return current;
}
}
return null;
}
public void setActiveColonies(List<Colony> activeColonies) {
this.activeColonies = activeColonies;
}
@Override
public List<Action> returnActions(Player empire){
List<Action> retval = new ArrayList<Action>();
for(Colony current: activeColonies){
return current.returnActions(empire);
}
return retval;
}
public void processActions(Action action) {
for(Colony current: activeColonies){
current.processActions(action);
}
}
public void getResourceProfile() {
}
public void endRound(){
for(Colony current: activeColonies){
current.endRound();
}
}
}
|
[
"cricketfeir@gmail.com"
] |
cricketfeir@gmail.com
|
9582947850797c9f8c997d781164aab9ae25947d
|
592677ea8e83fb67cff662716c3b5810071e7153
|
/src/bike/dns/drops/filter/TranactionFilter.java
|
a0549b16706325dc729a60636f2d9f2f51ecc6fb
|
[] |
no_license
|
feng3/drops1.0
|
6c84b2303748bf42784286ac528407a6b3a445fd
|
89f44824e55c5da4a907e03b8f3f5f440bd7f341
|
refs/heads/master
| 2021-10-10T13:00:34.230626
| 2019-01-11T06:17:16
| 2019-01-11T06:17:16
| 106,804,777
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,600
|
java
|
package bike.dns.drops.filter;
import java.io.IOException;
import java.sql.Connection;
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.annotation.WebFilter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import bike.dns.drops.db.JDBCUtils;
import bike.dns.drops.web.ConnectionContext;
//存储过程
@WebFilter("/TranactionFilter")
public class TranactionFilter implements Filter {
public TranactionFilter() {
}
public void init(FilterConfig fConfig) throws ServletException {
}
public void destroy() {
}
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
Connection connection = null;
try {
connection = JDBCUtils.getConnection();
connection.setAutoCommit(false);
ConnectionContext.getInstance().bind(connection);
chain.doFilter(request, response);
connection.commit();
} catch (Exception e) {
e.printStackTrace();
try {
connection.rollback();
} catch (SQLException e2) {
e2.printStackTrace();
}
HttpServletRequest req = (HttpServletRequest) request;
HttpServletResponse resp = (HttpServletResponse) response;
resp.sendRedirect(req.getContextPath() + "/error.html");
} finally {
ConnectionContext.getInstance().remove();
JDBCUtils.release(connection);
}
}
}
|
[
"frank.shen@frankshen-03-PC.corp.vipshop.com"
] |
frank.shen@frankshen-03-PC.corp.vipshop.com
|
d072cb3c8f3c41a80a172fdfe2ec1ea401b64599
|
54bcbdc3250e6e8152ac1746f709ec134e798305
|
/src/com/sun/org/apache/xml/internal/security/signature/XMLSignatureInputDebugger.java
|
6dfb85c5056b740ae79b07ad0ec4048ab322dba0
|
[] |
no_license
|
TANGMONK-MEAT/jdk-src-demo
|
78bed79d8a3819bf48d5eed399b869ac090138a4
|
4b4fa0779b67c7079b8d263ada2bb514c366a3e8
|
refs/heads/master
| 2023-03-02T21:35:09.758995
| 2021-02-16T07:39:26
| 2021-02-16T07:39:26
| 268,969,374
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 19,521
|
java
|
/*
* Copyright (c) 2007, 2019, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
/**
* 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 com.sun.org.apache.xml.internal.security.signature;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.Set;
import com.sun.org.apache.xml.internal.security.c14n.helper.AttrCompare;
import com.sun.org.apache.xml.internal.security.utils.XMLUtils;
import org.w3c.dom.Attr;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.ProcessingInstruction;
/**
* Class XMLSignatureInputDebugger
*/
public class XMLSignatureInputDebugger {
/** Field _xmlSignatureInput */
private Set<Node> xpathNodeSet;
private Set<String> inclusiveNamespaces;
/** Field writer */
private Writer writer;
/** The HTML Prefix* */
static final String HTMLPrefix =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
+ "<html>\n"
+ "<head>\n"
+ "<title>Caninical XML node set</title>\n"
+ "<style type=\"text/css\">\n"
+ "<!-- \n"
+ ".INCLUDED { \n"
+ " color: #000000; \n"
+ " background-color: \n"
+ " #FFFFFF; \n"
+ " font-weight: bold; } \n"
+ ".EXCLUDED { \n"
+ " color: #666666; \n"
+ " background-color: \n"
+ " #999999; } \n"
+ ".INCLUDEDINCLUSIVENAMESPACE { \n"
+ " color: #0000FF; \n"
+ " background-color: #FFFFFF; \n"
+ " font-weight: bold; \n"
+ " font-style: italic; } \n"
+ ".EXCLUDEDINCLUSIVENAMESPACE { \n"
+ " color: #0000FF; \n"
+ " background-color: #999999; \n"
+ " font-style: italic; } \n"
+ "--> \n"
+ "</style> \n"
+ "</head>\n"
+ "<body bgcolor=\"#999999\">\n"
+ "<h1>Explanation of the output</h1>\n"
+ "<p>The following text contains the nodeset of the given Reference before it is canonicalized. There exist four different styles to indicate how a given node is treated.</p>\n"
+ "<ul>\n"
+ "<li class=\"INCLUDED\">A node which is in the node set is labeled using the INCLUDED style.</li>\n"
+ "<li class=\"EXCLUDED\">A node which is <em>NOT</em> in the node set is labeled EXCLUDED style.</li>\n"
+ "<li class=\"INCLUDEDINCLUSIVENAMESPACE\">A namespace which is in the node set AND in the InclusiveNamespaces PrefixList is labeled using the INCLUDEDINCLUSIVENAMESPACE style.</li>\n"
+ "<li class=\"EXCLUDEDINCLUSIVENAMESPACE\">A namespace which is in NOT the node set AND in the InclusiveNamespaces PrefixList is labeled using the INCLUDEDINCLUSIVENAMESPACE style.</li>\n"
+ "</ul>\n" + "<h1>Output</h1>\n" + "<pre>\n";
/** HTML Suffix * */
static final String HTMLSuffix = "</pre></body></html>";
static final String HTMLExcludePrefix = "<span class=\"EXCLUDED\">";
static final String HTMLIncludePrefix = "<span class=\"INCLUDED\">";
static final String HTMLIncludeOrExcludeSuffix = "</span>";
static final String HTMLIncludedInclusiveNamespacePrefix = "<span class=\"INCLUDEDINCLUSIVENAMESPACE\">";
static final String HTMLExcludedInclusiveNamespacePrefix = "<span class=\"EXCLUDEDINCLUSIVENAMESPACE\">";
private static final int NODE_BEFORE_DOCUMENT_ELEMENT = -1;
private static final int NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT = 0;
private static final int NODE_AFTER_DOCUMENT_ELEMENT = 1;
static final AttrCompare ATTR_COMPARE = new AttrCompare();
/**
* Constructor XMLSignatureInputDebugger
*
* @param xmlSignatureInput the signature to pretty print
*/
public XMLSignatureInputDebugger(XMLSignatureInput xmlSignatureInput) {
if (!xmlSignatureInput.isNodeSet()) {
this.xpathNodeSet = null;
} else {
this.xpathNodeSet = xmlSignatureInput.getInputNodeSet();
}
}
/**
* Constructor XMLSignatureInputDebugger
*
* @param xmlSignatureInput the signatur to pretty print
* @param inclusiveNamespace
*/
public XMLSignatureInputDebugger(
XMLSignatureInput xmlSignatureInput,
Set<String> inclusiveNamespace
) {
this(xmlSignatureInput);
this.inclusiveNamespaces = inclusiveNamespace;
}
/**
* Method getHTMLRepresentation
*
* @return The HTML Representation.
* @throws XMLSignatureException
*/
public String getHTMLRepresentation() throws XMLSignatureException {
if (this.xpathNodeSet == null || this.xpathNodeSet.isEmpty()) {
return HTMLPrefix + "<blink>no node set, sorry</blink>" + HTMLSuffix;
}
// get only a single node as anchor to fetch the owner document
Node n = this.xpathNodeSet.iterator().next();
Document doc = XMLUtils.getOwnerDocument(n);
try {
this.writer = new StringWriter();
this.canonicalizeXPathNodeSet(doc);
this.writer.close();
return this.writer.toString();
} catch (IOException ex) {
throw new XMLSignatureException(ex);
} finally {
this.xpathNodeSet = null;
this.writer = null;
}
}
/**
* Method canonicalizeXPathNodeSet
*
* @param currentNode
* @throws XMLSignatureException
* @throws IOException
*/
private void canonicalizeXPathNodeSet(Node currentNode)
throws XMLSignatureException, IOException {
int currentNodeType = currentNode.getNodeType();
switch (currentNodeType) {
case Node.ENTITY_NODE:
case Node.NOTATION_NODE:
case Node.DOCUMENT_FRAGMENT_NODE:
case Node.ATTRIBUTE_NODE:
throw new XMLSignatureException("empty", new Object[]{"An incorrect node was provided for c14n: " + currentNodeType});
case Node.DOCUMENT_NODE:
this.writer.write(HTMLPrefix);
for (Node currentChild = currentNode.getFirstChild();
currentChild != null; currentChild = currentChild.getNextSibling()) {
this.canonicalizeXPathNodeSet(currentChild);
}
this.writer.write(HTMLSuffix);
break;
case Node.COMMENT_NODE:
if (this.xpathNodeSet.contains(currentNode)) {
this.writer.write(HTMLIncludePrefix);
} else {
this.writer.write(HTMLExcludePrefix);
}
int position = getPositionRelativeToDocumentElement(currentNode);
if (position == NODE_AFTER_DOCUMENT_ELEMENT) {
this.writer.write("\n");
}
this.outputCommentToWriter((Comment) currentNode);
if (position == NODE_BEFORE_DOCUMENT_ELEMENT) {
this.writer.write("\n");
}
this.writer.write(HTMLIncludeOrExcludeSuffix);
break;
case Node.PROCESSING_INSTRUCTION_NODE:
if (this.xpathNodeSet.contains(currentNode)) {
this.writer.write(HTMLIncludePrefix);
} else {
this.writer.write(HTMLExcludePrefix);
}
position = getPositionRelativeToDocumentElement(currentNode);
if (position == NODE_AFTER_DOCUMENT_ELEMENT) {
this.writer.write("\n");
}
this.outputPItoWriter((ProcessingInstruction) currentNode);
if (position == NODE_BEFORE_DOCUMENT_ELEMENT) {
this.writer.write("\n");
}
this.writer.write(HTMLIncludeOrExcludeSuffix);
break;
case Node.TEXT_NODE:
case Node.CDATA_SECTION_NODE:
if (this.xpathNodeSet.contains(currentNode)) {
this.writer.write(HTMLIncludePrefix);
} else {
this.writer.write(HTMLExcludePrefix);
}
outputTextToWriter(currentNode.getNodeValue());
for (Node nextSibling = currentNode.getNextSibling();
nextSibling != null
&& (nextSibling.getNodeType() == Node.TEXT_NODE
|| nextSibling.getNodeType() == Node.CDATA_SECTION_NODE);
nextSibling = nextSibling.getNextSibling()) {
/*
* The XPath data model allows to select only the first of a
* sequence of mixed text and CDATA nodes. But we must output
* them all, so we must search:
*
* @see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6329
*/
this.outputTextToWriter(nextSibling.getNodeValue());
}
this.writer.write(HTMLIncludeOrExcludeSuffix);
break;
case Node.ELEMENT_NODE:
Element currentElement = (Element) currentNode;
if (this.xpathNodeSet.contains(currentNode)) {
this.writer.write(HTMLIncludePrefix);
} else {
this.writer.write(HTMLExcludePrefix);
}
this.writer.write("<");
this.writer.write(currentElement.getTagName());
this.writer.write(HTMLIncludeOrExcludeSuffix);
// we output all Attrs which are available
NamedNodeMap attrs = currentElement.getAttributes();
int attrsLength = attrs.getLength();
Attr attrs2[] = new Attr[attrsLength];
for (int i = 0; i < attrsLength; i++) {
attrs2[i] = (Attr)attrs.item(i);
}
Arrays.sort(attrs2, ATTR_COMPARE);
Object attrs3[] = attrs2;
for (int i = 0; i < attrsLength; i++) {
Attr a = (Attr) attrs3[i];
boolean included = this.xpathNodeSet.contains(a);
boolean inclusive = this.inclusiveNamespaces.contains(a.getName());
if (included) {
if (inclusive) {
// included and inclusive
this.writer.write(HTMLIncludedInclusiveNamespacePrefix);
} else {
// included and not inclusive
this.writer.write(HTMLIncludePrefix);
}
} else {
if (inclusive) {
// excluded and inclusive
this.writer.write(HTMLExcludedInclusiveNamespacePrefix);
} else {
// excluded and not inclusive
this.writer.write(HTMLExcludePrefix);
}
}
this.outputAttrToWriter(a.getNodeName(), a.getNodeValue());
this.writer.write(HTMLIncludeOrExcludeSuffix);
}
if (this.xpathNodeSet.contains(currentNode)) {
this.writer.write(HTMLIncludePrefix);
} else {
this.writer.write(HTMLExcludePrefix);
}
this.writer.write(">");
this.writer.write(HTMLIncludeOrExcludeSuffix);
// traversal
for (Node currentChild = currentNode.getFirstChild();
currentChild != null;
currentChild = currentChild.getNextSibling()) {
this.canonicalizeXPathNodeSet(currentChild);
}
if (this.xpathNodeSet.contains(currentNode)) {
this.writer.write(HTMLIncludePrefix);
} else {
this.writer.write(HTMLExcludePrefix);
}
this.writer.write("</");
this.writer.write(currentElement.getTagName());
this.writer.write(">");
this.writer.write(HTMLIncludeOrExcludeSuffix);
break;
case Node.DOCUMENT_TYPE_NODE:
default:
break;
}
}
/**
* Checks whether a Comment or ProcessingInstruction is before or after the
* document element. This is needed for prepending or appending "\n"s.
*
* @param currentNode
* comment or pi to check
* @return NODE_BEFORE_DOCUMENT_ELEMENT,
* NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT or
* NODE_AFTER_DOCUMENT_ELEMENT
* @see #NODE_BEFORE_DOCUMENT_ELEMENT
* @see #NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT
* @see #NODE_AFTER_DOCUMENT_ELEMENT
*/
private int getPositionRelativeToDocumentElement(Node currentNode) {
if (currentNode == null) {
return NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
}
Document doc = currentNode.getOwnerDocument();
if (currentNode.getParentNode() != doc) {
return NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
}
Element documentElement = doc.getDocumentElement();
if (documentElement == null) {
return NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
}
if (documentElement == currentNode) {
return NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT;
}
for (Node x = currentNode; x != null; x = x.getNextSibling()) {
if (x == documentElement) {
return NODE_BEFORE_DOCUMENT_ELEMENT;
}
}
return NODE_AFTER_DOCUMENT_ELEMENT;
}
/**
* Normalizes an {@link Attr}ibute value
*
* The string value of the node is modified by replacing
* <UL>
* <LI>all ampersands (&) with {@code &amp;}</LI>
* <LI>all open angle brackets (<) with {@code &lt;}</LI>
* <LI>all quotation mark characters with {@code &quot;}</LI>
* <LI>and the whitespace characters {@code #x9}, #xA, and #xD,
* with character references. The character references are written in
* uppercase hexadecimal with no leading zeroes (for example, {@code #xD}
* is represented by the character reference {@code &#xD;})</LI>
* </UL>
*
* @param name
* @param value
* @throws IOException
*/
private void outputAttrToWriter(String name, String value) throws IOException {
this.writer.write(" ");
this.writer.write(name);
this.writer.write("=\"");
int length = value.length();
for (int i = 0; i < length; i++) {
char c = value.charAt(i);
switch (c) {
case '&':
this.writer.write("&amp;");
break;
case '<':
this.writer.write("&lt;");
break;
case '"':
this.writer.write("&quot;");
break;
case 0x09: // '\t'
this.writer.write("&#x9;");
break;
case 0x0A: // '\n'
this.writer.write("&#xA;");
break;
case 0x0D: // '\r'
this.writer.write("&#xD;");
break;
default:
this.writer.write(c);
break;
}
}
this.writer.write("\"");
}
/**
* Normalizes a {@link org.w3c.dom.Comment} value
*
* @param currentPI
* @throws IOException
*/
private void outputPItoWriter(ProcessingInstruction currentPI) throws IOException {
if (currentPI == null) {
return;
}
this.writer.write("<?");
String target = currentPI.getTarget();
int length = target.length();
for (int i = 0; i < length; i++) {
char c = target.charAt(i);
switch (c) {
case 0x0D:
this.writer.write("&#xD;");
break;
case ' ':
this.writer.write("·");
break;
case '\n':
this.writer.write("¶\n");
break;
default:
this.writer.write(c);
break;
}
}
String data = currentPI.getData();
length = data.length();
if (length > 0) {
this.writer.write(" ");
for (int i = 0; i < length; i++) {
char c = data.charAt(i);
switch (c) {
case 0x0D:
this.writer.write("&#xD;");
break;
default:
this.writer.write(c);
break;
}
}
}
this.writer.write("?>");
}
/**
* Method outputCommentToWriter
*
* @param currentComment
* @throws IOException
*/
private void outputCommentToWriter(Comment currentComment) throws IOException {
if (currentComment == null) {
return;
}
this.writer.write("<!--");
String data = currentComment.getData();
int length = data.length();
for (int i = 0; i < length; i++) {
char c = data.charAt(i);
switch (c) {
case 0x0D:
this.writer.write("&#xD;");
break;
case ' ':
this.writer.write("·");
break;
case '\n':
this.writer.write("¶\n");
break;
default:
this.writer.write(c);
break;
}
}
this.writer.write("-->");
}
/**
* Method outputTextToWriter
*
* @param text
* @throws IOException
*/
private void outputTextToWriter(String text) throws IOException {
if (text == null) {
return;
}
int length = text.length();
for (int i = 0; i < length; i++) {
char c = text.charAt(i);
switch (c) {
case '&':
this.writer.write("&amp;");
break;
case '<':
this.writer.write("&lt;");
break;
case '>':
this.writer.write("&gt;");
break;
case 0xD:
this.writer.write("&#xD;");
break;
case ' ':
this.writer.write("·");
break;
case '\n':
this.writer.write("¶\n");
break;
default:
this.writer.write(c);
break;
}
}
}
}
|
[
"58246525+tangsengrou01@users.noreply.github.com"
] |
58246525+tangsengrou01@users.noreply.github.com
|
9bfcdc595e069d1f2d9c76785cee9282d7a953a6
|
3d63adbc4d81e6957350728c60f6955fecc058a3
|
/EDTService/src/main/java/com/evola/edt/service/dto/transformer/QuestionAnswerDTOTransformer.java
|
bb1a8c42d1db047a250f860d094c7c82219e630a
|
[] |
no_license
|
smrkela/edt
|
6ff6d76beffdbc32554c62ce1c7255696fcd0c85
|
45da37254292382a712a00b01757cebb0c3726a9
|
refs/heads/master
| 2020-03-30T21:21:23.728893
| 2018-10-04T21:57:59
| 2018-10-04T21:57:59
| 151,626,035
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,334
|
java
|
package com.evola.edt.service.dto.transformer;
import java.util.Arrays;
import javax.inject.Inject;
import javax.inject.Named;
import com.evola.edt.model.QuestionAnswer;
import com.evola.edt.model.dto.QuestionAnswerDTO;
/**
* @author Nikola 09.04.2013.
*
*/
@Named
public class QuestionAnswerDTOTransformer implements
DTOTransformer<QuestionAnswerDTO, QuestionAnswer> {
@Inject
private QuestionDTOTransformer questionDTOTransformer;
@Override
public QuestionAnswerDTO transformToDTO(QuestionAnswer qa, String... fetchFields) {
if (qa == null) {
return null;
}
QuestionAnswerDTO dto = new QuestionAnswerDTO();
dto.setId(qa.getId());
dto.setText(qa.getText());
dto.setCorrect(qa.getCorrect());
dto.setOrderIndex(qa.getOrderIndex());
if (Arrays.asList(fetchFields).contains("question")) {
dto.setQuestionDTO(questionDTOTransformer.transformToDTO(qa
.getQuestion()));
}
return dto;
}
@Override
public QuestionAnswer transformToEntity(QuestionAnswerDTO dto) {
if (dto == null) {
return null;
}
QuestionAnswer qa = new QuestionAnswer();
qa.setId(dto.getId());
qa.setText(dto.getText());
qa.setCorrect(dto.getCorrect());
qa.setQuestion(questionDTOTransformer.transformToEntity(dto.getQuestionDTO()));
qa.setOrderIndex(dto.getOrderIndex());
return qa;
}
}
|
[
"sasa.mrkela@runsimply.com"
] |
sasa.mrkela@runsimply.com
|
92d7491e63a6ba7ff54a7b1e302b3e2cc1faa793
|
25a557b04d8fcc0c5c71b75e735b3b5051bd28de
|
/src/main/java/org/ggp/base/player/gamer/statemachine/MCTS/manager/hybrid/strategies/aftermove/MastAfterMove.java
|
51f6d4d76f08d7c672d2b65cea984b61e991d983
|
[
"BSD-3-Clause"
] |
permissive
|
ljialin/GGP-Project
|
4d2f9e87df5d0b2cca954c0efbc9c61b7c47f4ce
|
135e0b2f4d6f9702e724d7980f7e04b81924be75
|
refs/heads/master
| 2020-03-28T14:05:48.168584
| 2018-08-30T16:08:43
| 2018-08-30T16:08:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,355
|
java
|
package org.ggp.base.player.gamer.statemachine.MCTS.manager.hybrid.strategies.aftermove;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Random;
import org.ggp.base.player.gamer.statemachine.GamerSettings;
import org.ggp.base.player.gamer.statemachine.MCS.manager.MoveStats;
import org.ggp.base.player.gamer.statemachine.MCTS.manager.hybrid.GameDependentParameters;
import org.ggp.base.player.gamer.statemachine.MCTS.manager.hybrid.SharedReferencesCollector;
import org.ggp.base.util.logging.GamerLogger;
import org.ggp.base.util.statemachine.structure.Move;
public class MastAfterMove extends AfterMoveStrategy {
private List<Map<Move, MoveStats>> mastStatistics;
private double decayFactor;
private boolean logMastStats;
//private int gameStep;
public MastAfterMove(GameDependentParameters gameDependentParameters, Random random,
GamerSettings gamerSettings, SharedReferencesCollector sharedReferencesCollector, String id) {
super(gameDependentParameters, random, gamerSettings, sharedReferencesCollector, id);
this.decayFactor = gamerSettings.getDoublePropertyValue("AfterMoveStrategy" + id + ".decayFactor");
this.logMastStats = gamerSettings.getBooleanPropertyValue("AfterMoveStrategy" + id + ".logMastStats");
//this.gameStep = 0;
}
@Override
public void setReferences(SharedReferencesCollector sharedReferencesCollector) {
this.mastStatistics = sharedReferencesCollector.getMastStatistics();
}
@Override
public void clearComponent() {
// Do nothing (because the MAST statistics will be already cleared by the strategy that populates them,
// i.e. the backpropagation strategy that uses the MastUpdater).
}
@Override
public void setUpComponent() {
//this.gameStep = 0;
}
@Override
public String getComponentParameters(String indentation) {
String params = indentation + "DECAY_FACTOR = " + this.decayFactor;
if(this.mastStatistics != null){
String mastStatisticsString = "[ ";
for(Map<Move, MoveStats> roleMastStats : this.mastStatistics){
mastStatisticsString += roleMastStats.size() + " entries, ";
}
mastStatisticsString += "]";
params += indentation + "mast_statistics = " + mastStatisticsString;
}else{
params += indentation + "mast_statistics = null";
}
return params;
}
@Override
public void afterMoveActions() {
/*
String toPrint2 = "MastStats[";
if(this.mastStatistics == null){
toPrint2 += "null]\n";
}else{
for(Entry<Move, MoveStats> mastStatistic : this.mastStatistics.entrySet()){
toPrint2 += "\n MOVE(" + mastStatistic.getKey().toString() + "), " + mastStatistic.getValue().toString();
}
toPrint2 += " ]\n";
}
toPrint2 += "]";
System.out.println(toPrint2);
*/
if(this.logMastStats){
this.logMastStats();
}
if(this.decayFactor == 0.0){ // If we want to throw away everything, we just clear all the stats. No need to iterate.
for(int roleIndex = 0; roleIndex < this.mastStatistics.size(); roleIndex++){
this.mastStatistics.get(roleIndex).clear();
}
}else if(this.decayFactor != 1.0){ // If the decay factor is 1.0 we keep everything without modifying anything.
// VERSION 1: decrease, then check if the visits became 0 and, if so, remove the statistic
// for the move. -> This means that if the move will be explored again in the next step of
// the search, a new entry for the move will be created. However it's highly likely that the
// number of visits decreases to 0 because this move is never explored again because the real
// game ended up in a part of the tree where this move will not be legal anymore. In this case
// we won't keep around statistics that we will never use again, but we risk also to end up
// removing the statistic object for a move that will be explored again during the next steps
// and we will have to recreate the object (in this case we'll consider as garbage an object
// that instead we would have needed again).
Iterator<Entry<Move,MoveStats>> iterator;
Entry<Move,MoveStats> theEntry;
for(int roleIndex = 0; roleIndex < this.mastStatistics.size(); roleIndex++){
iterator = this.mastStatistics.get(roleIndex).entrySet().iterator();
while(iterator.hasNext()){
theEntry = iterator.next();
theEntry.getValue().decreaseByFactor(this.decayFactor);
if(theEntry.getValue().getVisits() == 0){
iterator.remove();
}
}
}
}
if(this.logMastStats){
this.logMastStats();
}
//this.gameStep++;
/*
String toPrint = "MastStats[";
if(this.mastStatistics == null){
toPrint += "null]\n";
}else{
for(Entry<Move, MoveStats> mastStatistic : this.mastStatistics.entrySet()){
toPrint += "\n MOVE(" + mastStatistic.getKey().toString() + "), " + mastStatistic.getValue().toString();
}
toPrint += " ]\n";
}
toPrint += "]";
System.out.println(toPrint);
*/
// VERSION 2: decrease and don't check anything.
/*
for(MoveStats m : this.mastStatistics.values()){
m.decreaseByFactor(this.decayFactor);
}
*/
}
private void logMastStats(){
String toLog = "STEP=;" + this.gameDependentParameters.getGameStep() + ";\n";
if(this.mastStatistics == null){
for(int roleIndex = 0; roleIndex < this.mastStatistics.size(); roleIndex++){
toLog += ("ROLE=;" + this.gameDependentParameters.getTheMachine().convertToExplicitRole(this.gameDependentParameters.getTheMachine().getRoles().get(roleIndex)) + ";\n");
toLog += "null;\n";
}
}else{
double scoreSum;
double visits;
for(int roleIndex = 0; roleIndex < this.mastStatistics.size(); roleIndex++){
toLog += ("ROLE=;" + this.gameDependentParameters.getTheMachine().convertToExplicitRole(this.gameDependentParameters.getTheMachine().getRoles().get(roleIndex)) + ";\n");
for(Entry<Move, MoveStats> mastStatistic : this.mastStatistics.get(roleIndex).entrySet()){
scoreSum = mastStatistic.getValue().getScoreSum();
visits = mastStatistic.getValue().getVisits();
toLog += ("MOVE=;" + this.gameDependentParameters.getTheMachine().convertToExplicitMove(mastStatistic.getKey()) +
";SCORE_SUM=;" + scoreSum + ";VISITS=;" + visits + ";AVG_VALUE=;" + (scoreSum/visits) + ";\n");
}
}
}
toLog += "\n";
GamerLogger.log(GamerLogger.FORMAT.CSV_FORMAT, "MastStats", toLog);
}
}
|
[
"sironi.chiara.f@gmail.com"
] |
sironi.chiara.f@gmail.com
|
b70cb1b3da1bae99b0be41deaaab3896d1cbfbb0
|
0eb9ff3b7e9900c47507feeefe05eece7b5c844b
|
/src/com/dynamic/PlayWithWords.java
|
76c7caf4864d0777c58e365e7728a5c21925799d
|
[] |
no_license
|
mohitnitrr/HackerRankClasses
|
5d5302127ca5af039eba131827663d7cefa69d72
|
2e2ab0386dd3f6f5e5eb65ac20b3a90c9ff03d4a
|
refs/heads/master
| 2020-06-26T20:51:19.610347
| 2015-10-29T07:32:07
| 2015-10-29T07:32:07
| 42,062,854
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,057
|
java
|
package com.dynamic;
import java.util.Scanner;
public class PlayWithWords {
private static int [][] L ;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String str = in.next();
str.charAt(0);
int length = str.length();
int max = 0;
lps(str);
for(int i =0;i<str.length()-1;i++){
int first = L[0][i];
int second =L[i+1][length-1];
int temp = first*second;
if(temp>max)
max=temp;
}
System.out.println(max);
}
private static int lps(String str)
{
int n = str.length();
int i, j, cl;
L = new int[n][n];
for (i = 0; i < n; i++)
L[i][i] = 1;
for (cl=2; cl<=n; cl++)
{
for (i=0; i<n-cl+1; i++)
{
j = i+cl-1;
if (str.charAt(i) == str.charAt(j) && cl == 2)
L[i][j] = 2;
else if (str.charAt(i) == str.charAt(j))
L[i][j] = L[i+1][j-1] + 2;
else
L[i][j] = Math.max(L[i][j-1], L[i+1][j]);
}
}
return L[0][n-1];
}
}
|
[
"mohit.nitrr@gmail.com"
] |
mohit.nitrr@gmail.com
|
6513cc885a9510d1b3d8835febd872c66f6f8ff6
|
d24f9324c81b86e58a923341429e003c3957b86a
|
/src/BO/PatientBO.java
|
f5da9021b12f0360b845d184cc9dd606d6fa498c
|
[] |
no_license
|
DicoYoung/NEUHIS
|
50906975eb94e69a99aeeffdb4449384ccc5d57e
|
6de28e4b03fd83ca57c6cb2992d9a8bf4139f43b
|
refs/heads/master
| 2020-08-06T20:56:23.192901
| 2019-10-06T10:42:37
| 2019-10-06T10:42:37
| 213,150,192
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,851
|
java
|
package BO;
import DAO.LoginDAO;
import DAO.PatientDAO;
import VO.PatientVO;
import VO.UserVO;
import java.util.ArrayList;
/**
* 病人-业务层
*
* @author dico
*/
public class PatientBO {
public void GuaHao(PatientVO patientVO){//将病人挂号信息写入
PatientDAO patientDAO = new PatientDAO();
patientDAO.writeInfo(patientVO);
}
public ArrayList whichDoctor(UserVO userVO){//读取具体挂某个医生的号的病人
LoginDAO loginDAO = new LoginDAO();
UserVO userVO1 = loginDAO.CheckExist(userVO);
if (userVO1 != null){
if (userVO1.getUserCategory().equals("Doctor")){
PatientDAO patientDAO = new PatientDAO();
ArrayList arrayList = patientDAO.Duqu(userVO1);
return arrayList;
}
}
return null;
}
public UserVO returnDoc(UserVO userVO){//返回寻找到的医生用户
LoginDAO loginDAO = new LoginDAO();
return loginDAO.getDoctor(userVO);
}
public void writeNewPatient(PatientVO patientVO){//将开完药的病人写入到文件中去
PatientDAO patientDAO = new PatientDAO();
patientDAO.writePatient(patientVO);
}
public PatientVO findThePatient(PatientVO patientVO){//搜索病人信息并返回
PatientDAO patientDAO = new PatientDAO();
if (patientDAO.findPatient(patientVO) != null){
return patientDAO.findPatient(patientVO);
}
return null;
}
public void overWriteThePatient(PatientVO patientVO){//覆盖写入病人信息
PatientDAO patientDAO = new PatientDAO();
patientDAO.OverWrite(patientVO);
}
public void deleteThePatient(PatientVO patientVO){
PatientDAO patientDAO = new PatientDAO();
patientDAO.deletePatient(patientVO);
}
}
|
[
"547459120@qq.com"
] |
547459120@qq.com
|
84d8d4dc9ab6cc24f537b050be3e168dc39fa80c
|
6b255ae441ec41de82a7c59993f0389a4863203f
|
/pangolin-eclipse-core/src/main/java/pt/up/fe/pangolin/eclipse/core/launching/VMArgsLaunchConfiguration.java
|
f10b104f025333f9cb596b27f53e8e8d724ad5d0
|
[
"MIT"
] |
permissive
|
Bruno81930/pangolin
|
bf3e18735a6822622072362eb2f5b1dc09525f1e
|
30d30a5e6549f307e58399b77530a4256fcf3051
|
refs/heads/master
| 2020-07-06T20:38:46.570806
| 2019-08-19T08:49:16
| 2019-08-19T08:49:16
| 203,133,199
| 0
| 0
|
MIT
| 2019-08-19T08:42:02
| 2019-08-19T08:42:01
| null |
UTF-8
|
Java
| false
| false
| 5,293
|
java
|
package pt.up.fe.pangolin.eclipse.core.launching;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchDelegate;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
@SuppressWarnings({"unchecked", "rawtypes"})
public class VMArgsLaunchConfiguration implements ILaunchConfiguration {
private static final String VMA_KEY = IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS;
private final ILaunchConfiguration delegate;
private final String extraVMArg;
public VMArgsLaunchConfiguration(ILaunchConfiguration delegate, String extraVMArg) {
this.delegate = delegate;
this.extraVMArg = extraVMArg;
}
@Override
public boolean hasAttribute(String attributeName) throws CoreException {
return VMA_KEY.equals(attributeName) || delegate.hasAttribute(attributeName);
}
@Override
public String getAttribute(String attributeName, String defaultValue) throws CoreException {
if (VMA_KEY.equals(attributeName)) {
return getVMArguments();
} else {
return delegate.getAttribute(attributeName, defaultValue);
}
}
private String getVMArguments() throws CoreException {
final String original = delegate.getAttribute(VMA_KEY, "");
if (original.length() > 0) {
return original + " " +extraVMArg;
} else {
return extraVMArg;
}
}
public boolean isWorkingCopy() {
return false;
}
@Override
public Object getAdapter(Class adapter) {
return delegate.getAdapter(adapter);
}
@Override
public boolean contentsEqual(ILaunchConfiguration configuration) {
return delegate.contentsEqual(configuration);
}
@Override
public ILaunchConfigurationWorkingCopy copy(String name)
throws CoreException {
return delegate.copy(name);
}
@Override
public void delete() throws CoreException {
delegate.delete();
}
@Override
public boolean exists() {
return delegate.exists();
}
@Override
public boolean getAttribute(String attributeName, boolean defaultValue)
throws CoreException {
return delegate.getAttribute(attributeName, defaultValue);
}
@Override
public int getAttribute(String attributeName, int defaultValue)
throws CoreException {
return delegate.getAttribute(attributeName, defaultValue);
}
@Override
public List getAttribute(String attributeName, List defaultValue)
throws CoreException {
return delegate.getAttribute(attributeName, defaultValue);
}
@Override
public Set getAttribute(String attributeName, Set defaultValue)
throws CoreException {
return delegate.getAttribute(attributeName, defaultValue);
}
@Override
public Map getAttribute(String attributeName, Map defaultValue)
throws CoreException {
return delegate.getAttribute(attributeName, defaultValue);
}
@Override
public Map getAttributes() throws CoreException {
return delegate.getAttributes();
}
@Override
public String getCategory() throws CoreException {
return delegate.getCategory();
}
@Override
public IFile getFile() {
return delegate.getFile();
}
@SuppressWarnings("deprecation")
@Override
public IPath getLocation() {
return delegate.getLocation();
}
@Override
public IResource[] getMappedResources() throws CoreException {
return delegate.getMappedResources();
}
@Override
public String getMemento() throws CoreException {
return delegate.getMemento();
}
@Override
public String getName() {
return delegate.getName();
}
@Override
public Set getModes() throws CoreException {
return delegate.getModes();
}
@Override
public ILaunchDelegate getPreferredDelegate(Set modes) throws CoreException {
return delegate.getPreferredDelegate(modes);
}
@Override
public ILaunchConfigurationType getType() throws CoreException {
return delegate.getType();
}
@Override
public ILaunchConfigurationWorkingCopy getWorkingCopy()
throws CoreException {
return delegate.getWorkingCopy();
}
@Override
public boolean isLocal() {
return delegate.isLocal();
}
@Override
public boolean isMigrationCandidate() throws CoreException {
return delegate.isMigrationCandidate();
}
@Override
public ILaunch launch(String mode, IProgressMonitor monitor)
throws CoreException {
return delegate.launch(mode, monitor);
}
@Override
public ILaunch launch(String mode, IProgressMonitor monitor, boolean build)
throws CoreException {
return delegate.launch(mode, monitor, build);
}
@Override
public ILaunch launch(String mode, IProgressMonitor monitor, boolean build,
boolean register) throws CoreException {
return delegate.launch(mode, monitor, build, register);
}
@Override
public void migrate() throws CoreException {
delegate.migrate();
}
@Override
public boolean supportsMode(String mode) throws CoreException {
return delegate.supportsMode(mode);
}
@Override
public boolean isReadOnly() {
return delegate.isReadOnly();
}
}
|
[
"alexandrecperez@gmail.com"
] |
alexandrecperez@gmail.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.