blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 390 | content_id stringlengths 40 40 | detected_licenses listlengths 0 35 | license_type stringclasses 2 values | repo_name stringlengths 6 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 539 values | visit_date timestamp[us]date 2016-08-02 21:09:20 2023-09-06 10:10:07 | revision_date timestamp[us]date 1990-01-30 01:55:47 2023-09-05 21:45:37 | committer_date timestamp[us]date 2003-07-12 18:48:29 2023-09-05 21:45:37 | github_id int64 7.28k 684M ⌀ | star_events_count int64 0 77.7k | fork_events_count int64 0 48k | gha_license_id stringclasses 13 values | gha_event_created_at timestamp[us]date 2012-06-11 04:05:37 2023-09-14 21:59:18 ⌀ | gha_created_at timestamp[us]date 2008-05-22 07:58:19 2023-08-28 02:39:21 ⌀ | gha_language stringclasses 62 values | src_encoding stringclasses 26 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 128 12.8k | extension stringclasses 11 values | content stringlengths 128 8.19k | authors listlengths 1 1 | author_id stringlengths 1 79 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f84b9fe50c89cddbac0fccf18f409f66ea419569 | 708825aeee9c4b5884aeb7ce306c02e2af214699 | /src/main/java/org/cugxdy/controller/ExceptionHandler.java | ef468a98b29497d6838b62a229ec81895a83b815 | [] | no_license | cugxdy/HttpServer | 3fac2368c08414b739f5335e9054d33595db4058 | 87dbcfc998ab5eaca6c14a8f8e5723be0edb3d0d | refs/heads/master | 2022-06-21T20:08:52.154733 | 2019-06-12T09:01:47 | 2019-06-12T09:01:47 | 191,532,234 | 0 | 0 | null | 2022-06-17T02:13:35 | 2019-06-12T08:41:05 | Java | UTF-8 | Java | false | false | 154 | java | package org.cugxdy.controller;
public interface ExceptionHandler {
/**
* 处理异常
* @param e
*/
void doHandle(Exception e);
}
| [
"cugxdy@163.com"
] | cugxdy@163.com |
3265b6d99fd8618f30382445bcf2c72fa2893be8 | 000e9ddd9b77e93ccb8f1e38c1822951bba84fa9 | /java/classes3/com/ziroom/ziroomcustomer/pay/uniondk/bean/UnionDKCheckMessage.java | df5f55fe1374a11313390fc633a9e3d9241494db | [
"Apache-2.0"
] | permissive | Paladin1412/house | 2bb7d591990c58bd7e8a9bf933481eb46901b3ed | b9e63db1a4975b614c422fed3b5b33ee57ea23fd | refs/heads/master | 2021-09-17T03:37:48.576781 | 2018-06-27T12:39:38 | 2018-06-27T12:41:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package com.ziroom.ziroomcustomer.pay.uniondk.bean;
public class UnionDKCheckMessage
extends UnionDKBaseJson
{
private boolean data;
public boolean isData()
{
return this.data;
}
public void setData(boolean paramBoolean)
{
this.data = paramBoolean;
}
}
/* Location: /Users/gaoht/Downloads/zirom/classes3-dex2jar.jar!/com/ziroom/ziroomcustomer/pay/uniondk/bean/UnionDKCheckMessage.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"ght163988@autonavi.com"
] | ght163988@autonavi.com |
6ebe1fcf29813d489167f7ca20519b09d8bf39dd | 58c0529be1ee5ad274292184cc0fc19c7d0e0fd2 | /HHTask/src/com/task/entity/OutLib.java | 33065e63fdd435dbae0a39fdd487cb328ed2f3a3 | [] | no_license | hbliyafei/nianfojishu | 6dc348fdca415d2e7aa328c76f0cbfb9b3aba9c3 | 0a8a125e661f0d582245a4c2586d57f85e496399 | refs/heads/master | 2023-03-17T15:03:03.247703 | 2019-05-14T07:56:20 | 2019-05-14T07:56:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,656 | java | package com.task.entity;
import java.io.Serializable;
import java.util.Date;
/**
* @ClassName: OutLib
* @Description: 出库
* @author Damon
* @date 2013-4-24 上午09:17:59
*
* add relaction Fields
* private Store store 关系:OutLib(many-to-one) : Store(one-to-many)
* private COnsuming con 关系:OutLib(one-to-one) : Consuming(one-to-one);
*/
public class OutLib implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
private Integer id; //主键
private Date date;//日期
private String cardNum; //卡号
private String dept; //部门
private String peopleName;//姓名
private String matetag;
private String format;//规格
private String unit;//单位
private String storehouse;//仓库
private String parClass;//分类
private String place;//位置
private Float num;//数量
private Float price;//价格
private Float money;//金额
private String detail;//描述
private Integer adminId;//管理员iD
private String admin;//管理员
private String mix;//合成主码
private String danjuhao;//单据号
private String more;//备注
private Store store;
private Consuming con;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
public String getDept() {
return dept;
}
public void setDept(String dept) {
this.dept = dept;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getStorehouse() {
return storehouse;
}
public void setStorehouse(String storehouse) {
this.storehouse = storehouse;
}
public String getParClass() {
return parClass;
}
public void setParClass(String parClass) {
this.parClass = parClass;
}
public Float getNum() {
return num;
}
public void setNum(Float num) {
this.num = num;
}
public Float getPrice() {
return price;
}
public void setPrice(Float price) {
this.price = price;
}
public Float getMoney() {
return money;
}
public void setMoney(Float money) {
this.money = money;
}
public String getDetail() {
return detail;
}
public void setDetail(String detail) {
this.detail = detail;
}
public Integer getAdminId() {
return adminId;
}
public void setAdminId(Integer adminId) {
this.adminId = adminId;
}
public String getAdmin() {
return admin;
}
public void setAdmin(String admin) {
this.admin = admin;
}
public String getMix() {
return mix;
}
public void setMix(String mix) {
this.mix = mix;
}
public String getDanjuhao() {
return danjuhao;
}
public void setDanjuhao(String danjuhao) {
this.danjuhao = danjuhao;
}
public String getMore() {
return more;
}
public void setMore(String more) {
this.more = more;
}
public Store getStore() {
return store;
}
public void setStore(Store store) {
this.store = store;
}
public Consuming getCon() {
return con;
}
public void setCon(Consuming con) {
this.con = con;
}
public String getCardNum() {
return cardNum;
}
public void setCardNum(String cardNum) {
this.cardNum = cardNum;
}
public String getPeopleName() {
return peopleName;
}
public void setPeopleName(String peopleName) {
this.peopleName = peopleName;
}
public String getMatetag() {
return matetag;
}
public void setMatetag(String matetag) {
this.matetag = matetag;
}
public String getPlace() {
return place;
}
public void setPlace(String place) {
this.place = place;
}
}
| [
"horsexming.sina.com"
] | horsexming.sina.com |
ef2844437ab6530dcd7df0cc17ccc216d5aa9795 | b529e6e088268e01953a6ce75f4585d8706d4148 | /src/main/java/info/ivicel/augmented/repository/SteamReviewsRepository.java | 4ec59774827bef27308a262b6bec162c1b887577 | [] | no_license | ivicel/Augmented-Server-Java | 945f5cefb58eb241f2186a19956544e2e7f7b8b8 | 51d58587f23064451f4df12aacfe53ac26dc5e3c | refs/heads/master | 2021-06-12T06:32:55.777001 | 2019-08-28T01:38:09 | 2019-08-28T01:38:09 | 196,945,276 | 0 | 0 | null | 2021-06-04T02:09:38 | 2019-07-15T07:17:01 | Java | UTF-8 | Java | false | false | 397 | java | package info.ivicel.augmented.repository;
import info.ivicel.augmented.core.model.entity.SteamReviews;
import java.util.Optional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface SteamReviewsRepository extends JpaRepository<SteamReviews, Long> {
Optional<SteamReviews> findByAppid(Integer appid);
}
| [
"31336040+ivicel@users.noreply.github.com"
] | 31336040+ivicel@users.noreply.github.com |
2d4c55b0676420cfdda6d409e454e23a5394b196 | 95cd04bc9043734031590eaf2bdae6ac4f4f3dad | /cobranzaElfecMobile/src/main/java/com/elfec/cobranza/model/enums/DataExchangeStatus.java | 0930728c757210e82b8a10e0cdfe82dad921eb0b | [] | no_license | diegoRodriguezAguila/Cobranza.Elfec.Mobile | 5d5f4693ae881458e690979455fee4cfe3a273a1 | 11fe3fd1ac5d4acba26323493d9449db8feb5be2 | refs/heads/master | 2021-06-23T22:17:47.099270 | 2017-04-12T18:31:34 | 2017-04-12T18:31:34 | 31,078,904 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 877 | java | package com.elfec.cobranza.model.enums;
/**
* Describe los estados de la carga/descarga de datos
* @author drodriguez
*
*/
public enum DataExchangeStatus {
/**
* Estado que indica que una ruta ha sido importada del servidor al dispositivo
*/
IMPORTED,
/**
* Estado que indica que una ruta ya ha sido exportada del dispositivo al servidor
*/
EXPORTED,
/**
* Estado que indica que una ruta ha sido eliminada del dispositivo
*/
DELETED;
/**
* Obtiene el estado de carga/descarga de datos, equivalente al short provisto
* @param status
* @return
*/
public static DataExchangeStatus get(short status)
{
return DataExchangeStatus.values()[status-1];
}
/**
* Convierte el estado de carga/descarga de datos a su short equivalente
* @return Short equivalente al estado
*/
public short toShort()
{
return (short) (this.ordinal()+1);
}
}
| [
"diroag@gmail.com"
] | diroag@gmail.com |
65f9d4d02f641c586bce4f11c975534d2c233460 | f787964b2eb70971c558892c37f3036dda7f5cb8 | /.JETEmitters/src/org/talend/designer/codegen/translators/processing/TSqlRowSparkcodeJava.java | 961715cbda90fbf8f4bc84c1ca9ef7f15578c2cf | [] | no_license | sharrake/SampleTalendWorkspace | 1746e1600ec667efc8a929c8fc33ca1e3d1f09f5 | b518c24aca165408eaef0353a7bb208ac4c9bd96 | refs/heads/master | 2021-01-10T04:19:48.039640 | 2015-11-23T11:16:36 | 2015-11-23T11:16:36 | 46,714,207 | 0 | 4 | null | null | null | null | UTF-8 | Java | false | false | 6,543 | java | package org.talend.designer.codegen.translators.processing;
import org.talend.core.model.process.INode;
import org.talend.core.model.process.IConnection;
import org.talend.core.model.metadata.IMetadataColumn;
import org.talend.designer.common.BigDataCodeGeneratorArgument;
import org.talend.designer.common.tsqlrow.TSqlRowUtil;
public class TSqlRowSparkcodeJava
{
protected static String nl;
public static synchronized TSqlRowSparkcodeJava create(String lineSeparator)
{
nl = lineSeparator;
TSqlRowSparkcodeJava result = new TSqlRowSparkcodeJava();
nl = null;
return result;
}
public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
protected final String TEXT_1 = "public static class ";
protected final String TEXT_2 = "_FromRowTo";
protected final String TEXT_3 = " implements org.apache.spark.api.java.function.Function<org.apache.spark.sql.Row, ";
protected final String TEXT_4 = "> {" + NL + "" + NL + " public ";
protected final String TEXT_5 = " call(org.apache.spark.sql.Row row) {";
protected final String TEXT_6 = NL + " ";
protected final String TEXT_7 = " result = new ";
protected final String TEXT_8 = "();" + NL + " org.apache.spark.sql.types.StructField[] structFields = row.schema().fields();" + NL + " for (int i = 0; i < structFields.length; i++) {" + NL + " org.apache.avro.Schema.Field avroField = ";
protected final String TEXT_9 = ".getClassSchema().getField(structFields[i].name());" + NL + " if (avroField != null){" + NL + " result.put(avroField.pos(), row.get(i));" + NL + " }" + NL + " }" + NL + " return result;" + NL + " }" + NL + "}";
protected final String TEXT_10 = NL + NL + "public static class ";
protected final String TEXT_11 = "_From";
protected final String TEXT_12 = "To";
protected final String TEXT_13 = " implements org.apache.spark.api.java.function.Function<";
protected final String TEXT_14 = ", ";
protected final String TEXT_15 = "> {" + NL + " " + NL + "\tpublic ";
protected final String TEXT_16 = " call(";
protected final String TEXT_17 = " input) {" + NL + "\t\t";
protected final String TEXT_18 = " result = new ";
protected final String TEXT_19 = "();";
protected final String TEXT_20 = NL + "\t\tif(input.";
protected final String TEXT_21 = " != null) {" + NL + "\t\t\tresult.";
protected final String TEXT_22 = " = new java.sql.Date(input.";
protected final String TEXT_23 = ".getTime());" + NL + "\t\t} else {" + NL + "\t\t\tresult.";
protected final String TEXT_24 = " = null;" + NL + "\t\t}";
protected final String TEXT_25 = NL + "\t\tresult.";
protected final String TEXT_26 = " = input.";
protected final String TEXT_27 = ";";
protected final String TEXT_28 = NL + "\t\treturn result;" + NL + "\t}" + NL + "}";
protected final String TEXT_29 = NL;
public String generate(Object argument)
{
final StringBuffer stringBuffer = new StringBuffer();
BigDataCodeGeneratorArgument codeGenArgument = (BigDataCodeGeneratorArgument)argument;
INode node = (INode)codeGenArgument.getArgument();
String cid = node.getUniqueName();
TSqlRowUtil tSqlRowUtil = new TSqlRowUtil(node);
String outStructName = codeGenArgument.getRecordStructName(tSqlRowUtil.getOutgoingConnection());
stringBuffer.append(TEXT_1);
stringBuffer.append(cid);
stringBuffer.append(TEXT_2);
stringBuffer.append(outStructName);
stringBuffer.append(TEXT_3);
stringBuffer.append(outStructName);
stringBuffer.append(TEXT_4);
stringBuffer.append(outStructName);
stringBuffer.append(TEXT_5);
stringBuffer.append(TEXT_6);
stringBuffer.append(outStructName);
stringBuffer.append(TEXT_7);
stringBuffer.append(outStructName);
stringBuffer.append(TEXT_8);
stringBuffer.append(outStructName);
stringBuffer.append(TEXT_9);
// If the incoming rowStruct contains a Date field (always typed as java.util.Date),
// we must generate a new structure which replaces these java.util.Date instances by
// java.sql.Date instances since DataFrames only support java.sql.Date.
org.talend.designer.bigdata.avro.AvroRecordStructGenerator avroRecordStructGenerator = (org.talend.designer.bigdata.avro.AvroRecordStructGenerator) codeGenArgument.getRecordStructGenerator();
for(IConnection incomingConnection : tSqlRowUtil.getIncomingConnections()) {
if(tSqlRowUtil.containsDateFields(incomingConnection)) {
java.util.List<IMetadataColumn> columns = tSqlRowUtil.getColumns(incomingConnection);
String originalStructName = codeGenArgument.getRecordStructName(incomingConnection);
String suggestedDfStructName = "DF_"+originalStructName;
String dfStructName = avroRecordStructGenerator.generateRecordStructForDataFrame(suggestedDfStructName, originalStructName);
stringBuffer.append(TEXT_10);
stringBuffer.append(cid);
stringBuffer.append(TEXT_11);
stringBuffer.append(originalStructName);
stringBuffer.append(TEXT_12);
stringBuffer.append(dfStructName);
stringBuffer.append(TEXT_13);
stringBuffer.append(originalStructName);
stringBuffer.append(TEXT_14);
stringBuffer.append(dfStructName);
stringBuffer.append(TEXT_15);
stringBuffer.append(dfStructName);
stringBuffer.append(TEXT_16);
stringBuffer.append(originalStructName);
stringBuffer.append(TEXT_17);
stringBuffer.append(dfStructName);
stringBuffer.append(TEXT_18);
stringBuffer.append(dfStructName);
stringBuffer.append(TEXT_19);
for(IMetadataColumn column : columns) {
if(tSqlRowUtil.isDateField(column)) {
stringBuffer.append(TEXT_20);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_21);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_22);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_23);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_24);
} else {
stringBuffer.append(TEXT_25);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_26);
stringBuffer.append(column.getLabel());
stringBuffer.append(TEXT_27);
}
} // end for(IMetadataColumn column : columns)
stringBuffer.append(TEXT_28);
} // end if(tSqlRowUtil.containsDateFields(incomingConnection))
} // end for(IConnection incomingConnection : tSqlRowUtil.getIncomingConnections())
stringBuffer.append(TEXT_29);
return stringBuffer.toString();
}
}
| [
"rakesh.ramotra@gmail.com"
] | rakesh.ramotra@gmail.com |
1809a08eab15a8e6369a515063c93c51c6f66de9 | 33ed051ada99b4bbf32890f2c965f056ab443464 | /JavaAdvClass/src/main/java/DateTime/InstantDurationPeriodExample.java | 80b22a09a936a1dcb49801d2abd7ed9c31102cef | [] | no_license | SamoraJourdan/Java-Advanced | 48098b05de2a11f37cbe644cb703b4038e218f74 | c68d8b2baba7231ea57c5feb4703fad89b9be2d6 | refs/heads/main | 2023-07-29T11:22:47.524552 | 2021-09-06T16:50:44 | 2021-09-06T16:50:44 | 394,545,001 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,227 | 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 DateTime;
import java.time.Duration;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import static java.time.Month.*;
import static java.time.temporal.ChronoUnit.*;
import java.time.Period;
import java.time.ZoneId;
import java.time.ZonedDateTime;
/**
*
* @author tmcginn
*/
public class InstantDurationPeriodExample {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws InterruptedException {
// Instant
Instant now = Instant.now();
Thread.sleep(0, 1);
Instant later = Instant.now();
System.out.println("now is before later? " + now.isBefore(later));
System.out.println("Now: " + now);
System.out.println("Later: " + later);
System.out.println("");
// Period
Period oneDay = Period.ofDays(1);
System.out.println("Period of one day: " + oneDay);
LocalDateTime beforeDST = LocalDateTime.of(2014, MARCH, 8, 12, 00);
ZonedDateTime newYorkTime = ZonedDateTime.of(beforeDST, ZoneId.of("America/New_York"));
System.out.println("Before: " + newYorkTime);
System.out.println("After: " + newYorkTime.plus(oneDay));
System.out.println("");
// Duration
Duration one24hourDay = Duration.ofDays(1);
System.out.println("Duration of one day: " + one24hourDay);
beforeDST = LocalDateTime.of(2014, MARCH, 8, 12, 00);
newYorkTime = ZonedDateTime.of(beforeDST, ZoneId.of("America/New_York"));
System.out.println("Before: " + newYorkTime);
System.out.println("After: " + newYorkTime.plus(one24hourDay));
System.out.println("");
// Temporal
LocalDate christmas = LocalDate.of(2014, DECEMBER, 25);
LocalDate today = LocalDate.now();
long days = DAYS.between(today, christmas);
System.out.println("There are " + days + " shopping days til Christmas");
Period tilXMas = Period.between(today, christmas);
System.out.println("There are " + tilXMas.getMonths() + " months and " + tilXMas.getDays() + " days til Christmas");
}
}
| [
"samorajourdan@gmail.com"
] | samorajourdan@gmail.com |
b13365b08300ba5be6d7405787c9b33d994b34b8 | ece1a8336e83dc94cf8252bdcb8a0871744bde2d | /src/pr2/Person.java | aa9f877113bbea216685cfa3fde8845e6d90b631 | [] | no_license | herctzinos/project2 | df43a9c39692aaaf1cb47f1747b45704cad6c2db | 35bada3d1ae06e5e4809dc47bdc96d4fd79b2f25 | refs/heads/master | 2020-04-07T03:07:12.818007 | 2018-11-17T16:32:08 | 2018-11-17T16:32:08 | 158,003,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,099 | java | package pr2;
//commecntxpogjrojgregjoergjergoegijeojrgoejgreojg
public class Person {
private String firstName;
private String lastName;
Person(String firstName, String lastName) {
setLastName(lastName);
setFirstName(firstName);
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
if ((firstName.matches("[a-zA-Z]+")) && (firstName.length() > 2)) {
firstName = firstName.substring(0, 1).toUpperCase() + firstName.substring(1);
this.firstName = firstName;
} else {
this.firstName = "error";
}
}
public void setLastName(String lastName) {
if ((lastName.matches("[a-zA-Z]+")) && (lastName.length() > 3)) {
lastName = lastName.substring(0, 1).toUpperCase() + lastName.substring(1);
this.lastName = lastName;
} else {
this.lastName = "error";
}
}
public String getLastName() {
return lastName;
}
}
| [
"you@example.com"
] | you@example.com |
a7aa413768ba312d941071ac4e65603fb203e6bd | 03fa839049232561fddeb726fb09adaf5bad2f4e | /basex-core/src/main/java/org/basex/query/func/ft/FtMark.java | 61a02f527730053a347d4b3dbbb4d6b62261b86a | [
"BSD-3-Clause"
] | permissive | cuongpd95/basex | 96791206e7a41537c90b1d2d567238850fd201b3 | 05d975432d78b90946813cd416e78186ab45a8bb | refs/heads/master | 2021-08-30T16:30:17.551857 | 2017-12-18T16:36:28 | 2017-12-18T16:36:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,547 | java | package org.basex.query.func.ft;
import static org.basex.query.QueryError.*;
import org.basex.data.*;
import org.basex.query.*;
import org.basex.query.func.*;
import org.basex.query.iter.*;
import org.basex.query.util.*;
import org.basex.query.util.ft.*;
import org.basex.query.value.item.*;
import org.basex.query.value.seq.*;
import org.basex.query.value.type.*;
import org.basex.util.*;
import org.basex.util.list.*;
/**
* Function implementation.
*
* @author BaseX Team 2005-17, BSD License
* @author Christian Gruen
*/
public class FtMark extends StandardFunc {
/** Marker element. */
private static final byte[] MARK = Token.token("mark");
@Override
public Iter iter(final QueryContext qc) throws QueryException {
return mark(qc, false);
}
/**
* Performs the mark function.
* @param qc query context
* @param ex extract flag
* @return iterator
* @throws QueryException query exception
*/
final Iter mark(final QueryContext qc, final boolean ex) throws QueryException {
byte[] m = MARK;
int l = ex ? 150 : Integer.MAX_VALUE;
if(exprs.length > 1) {
// name of the marker element; default is <mark/>
m = toToken(exprs[1], qc);
if(!XMLToken.isQName(m)) throw valueError(AtomType.QNM, m, info);
}
if(exprs.length > 2) {
l = (int) toLong(exprs[2], qc);
}
final byte[] mark = m;
final int len = l;
return new Iter() {
final FTPosData ftd = new FTPosData();
Iter iter;
BasicIter<Item> ir;
@Override
public Item next() throws QueryException {
while(true) {
if(ir != null) {
final Item item = ir.next();
if(item != null) return item;
ir = null;
}
final FTPosData tmp = qc.ftPosData;
try {
qc.ftPosData = ftd;
if(iter == null) iter = exprs[0].iter(qc);
final Item item = iter.next();
if(item == null) return null;
// copy node to main memory data instance
final MemData md = new MemData(qc.context.options);
final DataBuilder db = new DataBuilder(md, qc);
db.ftpos(mark, qc.ftPosData, len).build(toDBNode(item));
final IntList il = new IntList();
final int s = md.meta.size;
for(int p = 0; p < s; p += md.size(p, md.kind(p))) il.add(p);
ir = DBNodeSeq.get(il, md, false, false).iter();
} finally {
qc.ftPosData = tmp;
}
}
}
};
}
}
| [
"christian.gruen@gmail.com"
] | christian.gruen@gmail.com |
ab7b9870b01a42534a8e0a8b5250361681eabb53 | f4c521ca1e8a33d6d80134a63df6c2bdc57298fd | /XsdToJavaAPIRoot/FasterApi/RegexApi/src/main/java/org/xmlet/regexapi/MatchPreviousBetweenComplete.java | 6a2671c1f5a9f67b5078abce440f57b673077659 | [
"MIT"
] | permissive | lcduarte/XsdToJavaAPI | 222fdd89a124234deb261b94ccdb7b9550c405f2 | c35d390df19c4dbe85ff907930a36c8eae349d34 | refs/heads/master | 2021-07-18T05:41:26.238355 | 2018-11-28T18:49:00 | 2018-11-28T18:49:00 | 110,739,522 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,498 | java | package org.xmlet.regexapi;
import java.util.function.Consumer;
public class MatchPreviousBetweenComplete<Z extends Element> implements CustomAttributeGroup<MatchPreviousBetweenComplete<Z>, Z> {
protected final Z parent;
protected final ElementVisitor visitor;
public MatchPreviousBetweenComplete(ElementVisitor visitor) {
this.visitor = visitor;
this.parent = null;
}
public MatchPreviousBetweenComplete(Z parent) {
this.parent = parent;
this.visitor = parent.getVisitor();
}
protected MatchPreviousBetweenComplete(Z parent, ElementVisitor visitor, boolean shouldVisit) {
this.parent = parent;
this.visitor = visitor;
}
public Z __() {
this.visitor.visitParentMatchPreviousBetweenComplete(this);
return this.parent;
}
public final MatchPreviousBetweenComplete<Z> dynamic(Consumer<MatchPreviousBetweenComplete<Z>> consumer) {
this.visitor.visitOpenDynamic();
consumer.accept(this);
this.visitor.visitCloseDynamic();
return this;
}
public final MatchPreviousBetweenComplete<Z> of(Consumer<MatchPreviousBetweenComplete<Z>> consumer) {
consumer.accept(this);
return this;
}
public Z getParent() {
return this.parent;
}
public final ElementVisitor getVisitor() {
return this.visitor;
}
public String getName() {
return "matchPreviousBetween";
}
public final MatchPreviousBetweenComplete<Z> self() {
return this;
}
}
| [
"lois_duarte@msn.com"
] | lois_duarte@msn.com |
358dbd7eb1f465a30d6a7e1202b7362eb4efb370 | 25b5cccaf51f44d4116af8886128ade5ebf2b788 | /ChannelSaleMan/app/src/main/java/com/zlove/bean/message/MessageCustomerProgressListData.java | 8e307d8f898c3cfcfe9d3f1cac8ecea91752a060 | [] | no_license | ZLOVE320483/ChannelSpace | 8f8e5668b335bda8a4bc48118d44c26f7d0b23d0 | 74610334b2b4b0bb65de3d4d9a5ff2c443ba6b37 | refs/heads/master | 2021-05-18T01:01:25.383994 | 2020-03-29T13:31:02 | 2020-03-29T13:31:02 | 251,036,899 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 651 | java | package com.zlove.bean.message;
import java.io.Serializable;
import java.util.List;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import com.zlove.bean.common.CommonPageInfo;
@JsonIgnoreProperties(ignoreUnknown = true)
public class MessageCustomerProgressListData implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1114478467237301897L;
private CommonPageInfo page_info;
private List<MessageCustomerProgressListItem> message_list;
public CommonPageInfo getPage_info() {
return page_info;
}
public List<MessageCustomerProgressListItem> getMessage_list() {
return message_list;
}
}
| [
"zhanglei320483@163.com"
] | zhanglei320483@163.com |
84dd82841e8f29b01e4fe051476804d4ecbfeee9 | ded3c68963f57a4816286c16248b8523814c71d6 | /petservice_front/app/src/main/java/com/hellom/petserviceandroid/home/HomePageAdapter.java | 5ffaaf0122cedc9798bd9881b93d11befb04ec49 | [
"ICU"
] | permissive | HelloMMMMM/petservice_2019_3 | 1a9b9f504af45ad603ad220d42b293fb79011914 | 4f6b8e51a653f5c0058d55d104fde0acb101a0a6 | refs/heads/master | 2020-05-19T17:30:52.267397 | 2019-05-06T06:30:42 | 2019-05-06T06:30:42 | 185,136,182 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 642 | java | package com.hellom.petserviceandroid.home;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import java.util.List;
public class HomePageAdapter extends FragmentPagerAdapter {
private List<Fragment> fragments;
public HomePageAdapter(FragmentManager fm, List<Fragment> fragments) {
super(fm);
this.fragments = fragments;
}
@Override
public Fragment getItem(int i) {
return fragments.get(i);
}
@Override
public int getCount() {
return fragments == null ? 0 : fragments.size();
}
}
| [
"1694327880@qq.com"
] | 1694327880@qq.com |
ba9ed1d90fe855788ac92c0dc694e76ff2b56cc5 | 2d1f125578ec412defe1a279c5e487b885e685b5 | /src/main/java/org/onvif/ver10/schema/VideoEncoderOptionsExtension2.java | 62bd6ed335c66ad5aa3c32c0b2a542be32b06193 | [] | no_license | fengxiaobu/liveclient | 3b43ee7b474026c1018a22a6a1be8c89c1c0eb42 | a28a0129d244cd49d72b4b781157ac9f964091fa | refs/heads/master | 2020-04-11T20:07:15.175695 | 2018-12-17T01:54:45 | 2018-12-17T01:54:45 | 162,060,421 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,229 | java | //
// Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.5-2 generiert
// Siehe <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// �nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren.
// Generiert: 2014.02.04 um 12:22:03 PM CET
//
package org.onvif.ver10.schema;
import org.w3c.dom.Element;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
* Java-Klasse f�r VideoEncoderOptionsExtension2 complex type.
*
* <p>
* Das folgende Schemafragment gibt den erwarteten Content an, der in dieser Klasse enthalten ist.
*
* <pre>
* <complexType name="VideoEncoderOptionsExtension2">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <any processContents='lax' namespace='http://www.onvif.org/ver10/schema' maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "VideoEncoderOptionsExtension2", propOrder = {"any"})
public class VideoEncoderOptionsExtension2 {
@XmlAnyElement(lax = true)
protected List<java.lang.Object> any;
/**
* Gets the value of the any 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 any property.
*
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
* getAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list {@link Element } {@link java.lang.Object }
*/
public List<java.lang.Object> getAny() {
if (any == null) {
any = new ArrayList<java.lang.Object>();
}
return this.any;
}
}
| [
"luopanfeng@benefitech.cn"
] | luopanfeng@benefitech.cn |
071248ad566031350aa6e1268473ba424d798d20 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/64/org/apache/commons/math/linear/BlockRealMatrix_copy_299.java | 849992d8539d369c36740fe889f030a86a00d7f0 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 3,097 | java |
org apach common math linear
cach friendli implement real matrix realmatrix flat arrai store
squar block matrix
implement special design cach friendli squar block
store small arrai effici travers data row major direct
column major direct block time greatli increas perform
algorithm cross direct loop multipl transposit
size squar block paramet tune cach
size target comput processor rule thumb largest
block simultan cach
matrix multipl 52x52 block suit
processor 64k cach block hold valu byte
lower 36x36 processor 32k cach
regular block repres link block size link block size squar block
hand side bottom side smaller fit matrix dimens squar
block flatten row major order singl dimens arrai
link block size element regular block block
organ row major order
block size 52x52 100x60 matrix store block
block arrai hold upper left 52x52 squar block
arrai hold upper 52x8 rectangl block
arrai hold lower left 48x52 rectangl block arrai
hold lower 48x8 rectangl
layout complex overhead versu simpl map matric java
arrai neglig small matric gain cach effici lead
fold improv matric moder larg size
version revis date
block real matrix blockrealmatrix abstract real matrix abstractrealmatrix serializ
inherit doc inheritdoc
overrid
block real matrix blockrealmatrix copi
creat empti matrix
block real matrix blockrealmatrix copi block real matrix blockrealmatrix row column
copi block
block length
system arraycopi block copi block block length
copi
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
2313e06691f2b834ba2d050011d3ef8578a11d78 | f443adebbf5f1c9a11a20d5def51639dd89a3362 | /ecotourism/ecotourism-manage/src/main/java/com/ecotourism/manage/product/controller/ProductSecondTypeController.java | 9a0320683a241ea7c53f59f7985af84df99193b6 | [] | no_license | yaozhili1997/repo1 | 6f8dc2d260d7e762817438e51e3191ca56a590e1 | 41ff2f9d869561c05474d00c6cf31533a9b650b4 | refs/heads/master | 2022-12-23T09:11:58.739090 | 2020-02-22T12:51:31 | 2020-02-22T12:51:33 | 242,442,154 | 1 | 0 | null | 2022-12-16T04:25:33 | 2020-02-23T02:13:50 | JavaScript | UTF-8 | Java | false | false | 4,310 | java | package com.ecotourism.manage.product.controller;
import com.ecotourism.manage.common.controller.BaseController;
import com.ecotourism.manage.common.domain.Tree;
import com.ecotourism.manage.common.utils.PageUtils;
import com.ecotourism.manage.common.utils.Query;
import com.ecotourism.manage.common.utils.R;
import com.ecotourism.manage.product.domain.ProductTypeDO;
import com.ecotourism.manage.product.service.impl.ProductSecondTypeServiceImpl;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 产品子类型管理
*
* @author chqy
* @email chqy_ljy@163.com
* @date 2018-06-15 09:47:13
*/
@Controller
@RequestMapping("/product/productSecondType")
public class ProductSecondTypeController extends BaseController{
@Autowired
private ProductSecondTypeServiceImpl productTypeService;
@GetMapping()
@RequiresPermissions("product:productSecondType:productSecondType")
String ProductType(){
return "product/productSecondType/productType";
}
@ResponseBody
@GetMapping("/list")
@RequiresPermissions("product:productSecondType:productSecondType")
public PageUtils list(@RequestParam Map<String, Object> params){
//查询列表数据
params.put("children","0");
Query query = new Query(params);
List<ProductTypeDO> productTypeList = productTypeService.list(query);
int total = productTypeService.count(query);
PageUtils pageUtils = new PageUtils(productTypeList, total);
return pageUtils;
}
@GetMapping("/add")
@RequiresPermissions("product:productSecondType:add")
String add(Model model){
Map<String, Object> map = new HashMap<>();
map.put("parentTypeNo","0");
model.addAttribute("parentTypeNos", productTypeService.list(map));
return "product/productSecondType/add";
}
@GetMapping("/edit/{id}")
@RequiresPermissions("product:productSecondType:edit")
String edit(@PathVariable("id") Integer id,Model model){
ProductTypeDO productType = productTypeService.get(id);
Map<String, Object> map = new HashMap<>();
map.put("parentTypeNo","0");
model.addAttribute("parentTypeNos", productTypeService.list(map));
model.addAttribute("productSecondType", productType);
return "product/productSecondType/edit";
}
/**
* 保存
*/
@ResponseBody
@PostMapping("/save")
@RequiresPermissions("product:productSecondType:add")
public R save(@RequestParam("file") MultipartFile[] files,@RequestParam("iconFile") MultipartFile iconFile, ProductTypeDO productType){
productType.setCompanyNo(getComPanyNo());
String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ request.getContextPath();
productType.setBaseUrl(basePath);
return productTypeService.save(productType,iconFile,files);
}
/**
* 修改
*/
@ResponseBody
@RequestMapping("/update")
@RequiresPermissions("product:productSecondType:edit")
public R update( @RequestParam("file") MultipartFile[] files,@RequestParam("iconFile") MultipartFile iconFile,ProductTypeDO productType){
String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ request.getContextPath();
productType.setBaseUrl(basePath);
productTypeService.update(productType,iconFile,files);
return R.ok();
}
/**
* 删除
*/
@PostMapping( "/remove")
@ResponseBody
@RequiresPermissions("product:productSecondType:remove")
public R remove( Integer id){
return productTypeService.remove(id);
}
/**
* 删除
*/
@PostMapping( "/batchRemove")
@ResponseBody
@RequiresPermissions("product:productSecondType:batchRemove")
public R remove(@RequestParam("ids[]") Integer[] ids){
return productTypeService.batchRemove(ids);
}
@GetMapping("/tree")
@ResponseBody
public Tree<ProductTypeDO> tree() {
Map<String, Object> query = new HashMap<>(16);
query.put("parentTypeNo","0");
Tree<ProductTypeDO> tree = new Tree<ProductTypeDO>();
tree = productTypeService.getTree(query);
return tree;
}
}
| [
"1144946637@qq.com"
] | 1144946637@qq.com |
8b7b7f8aede05b47cd627bc70d16e78c759c9b26 | 00e06fc1f1dd9933994d42b5d9bd6b46e2b35543 | /dailyhelper-mvc/src/main/java/com/easytoolsoft/dailyhelper/mvc/controller/PageController.java | 0b8717ed28340c19367f47d45df9f37619765967 | [
"MIT"
] | permissive | xianrendzw/DailyHelper | 27ea283d5eaa9f61cb8fbe8f7a5ac337c225c876 | 44cce92ebbbe453550e89f1dec7241814c1bfe5b | refs/heads/master | 2021-01-12T03:13:20.874983 | 2017-03-23T10:45:38 | 2017-03-23T10:45:38 | 78,180,034 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,536 | java | /*
* Copyright (c) 2017 Tom Deng
*
* 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.easytoolsoft.dailyhelper.mvc.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
* @author tomdeng on 17/1/10.
*/
@Slf4j
@Controller
@RequestMapping(value = "/pages")
public class PageController {
}
| [
"14068728@qq.com"
] | 14068728@qq.com |
25f812213e45ded1617525e8c316cedd36b4b69a | 307e8af4f5d4f9bc77a4e5305325c7c9e1855c41 | /src/main/java/de/mosmann/topics/Topic.java | bd87994daf49067aa464518abeb7e62f0afebee0 | [
"Apache-2.0"
] | permissive | michaelmosmann/wicket-in-3-days | 9754a77f3d813052cabf785edcee9cabd92a3ae1 | f2ce86267c2d21e0bd3208d45c3b40e54125f7f4 | refs/heads/master | 2016-09-11T09:02:13.513144 | 2013-12-04T15:47:32 | 2013-12-04T15:47:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,363 | java | package de.mosmann.topics;
import java.util.Objects;
import org.apache.wicket.markup.html.WebPage;
import de.mosmann.topics.advanced.persistence.ManageUsersPage;
import de.mosmann.topics.basics.components.ComponentOverviewPage;
import de.mosmann.topics.basics.events.EventsPage;
import de.mosmann.topics.basics.forms.FormsPage;
import de.mosmann.topics.basics.markupmagic.MarkupMagicPage;
import de.mosmann.topics.basics.models.ModelsPage;
import de.mosmann.topics.basics.validations.ValidationsPage;
import de.mosmann.topics.converter.ConverterPage;
import de.mosmann.topics.forms.FormValidationComponentsPage;
import de.mosmann.topics.paging.PagingPage;
import de.mosmann.topics.playground.PlaygroundPage;
public enum Topic {
Components(ComponentOverviewPage.class),
MarkupMagic(MarkupMagicPage.class),
Forms(FormsPage.class),
Validation(ValidationsPage.class),
Events(EventsPage.class),
Models(ModelsPage.class),
FormValidationComponents(FormValidationComponentsPage.class),
//Behaviors
Converter(ConverterPage.class),
Paging(PagingPage.class),
Persistence(ManageUsersPage.class),
Playground(PlaygroundPage.class);
private final Class<? extends WebPage> _page;
private Topic(Class<? extends WebPage> page) {
_page = Objects.requireNonNull(page,"page is null");
}
public Class<? extends WebPage> page() {
return _page;
}
}
| [
"michael@mosmann.de"
] | michael@mosmann.de |
a805c2081a58cd7f38139dd59934a4ffe5894675 | 5f2fb08c46b2acdfe52583cf95925325b36c6820 | /OpenGLlibrary/src/main/java/com/joe/camera2recorddemo/OpenGL/WrapRenderer.java | bcf021d80fd6f6eb88e5e5e88d7addaf77c9df42 | [] | no_license | 309925753/xinfuyouyue | 7324fb7062c126156ee350a0e14b8b18bed7afe6 | 0bc8f8bb387d2203b74af05bfcc6733cde51cda2 | refs/heads/master | 2022-11-30T23:46:53.082249 | 2020-05-19T11:48:55 | 2020-05-19T11:48:55 | 287,436,362 | 3 | 6 | null | null | null | null | UTF-8 | Java | false | false | 1,948 | java | package com.joe.camera2recorddemo.OpenGL;
import com.joe.camera2recorddemo.OpenGL.Filter.OesFilter;
import com.joe.camera2recorddemo.Utils.MatrixUtils;
/**
* Created by aiya on 2017/9/12.
*/
class WrapRenderer implements Renderer{
private Renderer mRenderer;
private OesFilter mFilter;
private FrameBuffer mFrameBuffer;
public static final int TYPE_MOVE=0;
public static final int TYPE_CAMERA=1;
public static final int TYPE_SURFACE=2;
public WrapRenderer(Renderer renderer){
this.mRenderer=renderer;
mFrameBuffer=new FrameBuffer();
mFilter=new OesFilter();
if(renderer!=null){
MatrixUtils.flip(mFilter.getVertexMatrix(),false,true);
}
}
public OesFilter getmFilter() {
return mFilter;
}
public void setFlag(int flag){
if(flag==TYPE_SURFACE){
mFilter.setVertexCo(MatrixUtils.getSurfaceVertexCo());
}else if(flag==TYPE_CAMERA){
mFilter.setVertexCo(MatrixUtils.getCameraVertexCo());
}else if(flag==TYPE_MOVE){
mFilter.setVertexCo(MatrixUtils.getMoveVertexCo());
}
}
public float[] getTextureMatrix(){
return mFilter.getTextureMatrix();
}
@Override
public void create() {
mFilter.create();
if(mRenderer!=null){
mRenderer.create();
}
}
@Override
public void sizeChanged(int width, int height) {
mFilter.sizeChanged(width, height);
if(mRenderer!=null){
mRenderer.sizeChanged(width, height);
}
}
@Override
public void draw(int texture) {
if(mRenderer!=null){
mRenderer.draw(mFilter.drawToTexture(texture));
}else{
mFilter.draw(texture);
}
}
@Override
public void destroy() {
if(mRenderer!=null){
mRenderer.destroy();
}
mFilter.destroy();
}
}
| [
"309925753@qq.com"
] | 309925753@qq.com |
30c7808040a15b7689c501f415f7d359a25a8517 | e0647b4d261ce90dafcb6157c87965a98b7d2521 | /app/src/main/java/razerdp/demo/popup/BlurSlideFromBottomPopup.java | 63a2ac4d74625cd76e3fb4bda45778c78ee11e31 | [
"Apache-2.0"
] | permissive | BojunBlue/BasePopup | a2dd611429589a3e8b93871af302548e4c31a5d0 | 1323127997d25dd9dbd15f721a550a7533d6620c | refs/heads/master | 2021-09-26T10:11:40.819584 | 2018-10-29T03:01:40 | 2018-10-29T03:01:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,665 | java | package razerdp.demo.popup;
import android.app.Activity;
import android.view.View;
import android.view.animation.Animation;
import razerdp.basepopup.BasePopupWindow;
import razerdp.basepopup.R;
import razerdp.demo.utils.ToastUtils;
/**
* Created by 大灯泡 on 2017/12/27.
* 从底部滑上来同时模糊的popup
*/
public class BlurSlideFromBottomPopup extends BasePopupWindow implements View.OnClickListener {
private View popupView;
public BlurSlideFromBottomPopup(Activity context) {
super(context);
bindEvent();
}
@Override
protected Animation onCreateShowAnimation() {
return getTranslateVerticalAnimation(1f, 0f, 300);
}
@Override
protected Animation onCreateDismissAnimation() {
return getTranslateVerticalAnimation(0f, 1f, 300);
}
@Override
public View onCreateContentView() {
return createPopupById(R.layout.popup_blur_slide_from_bottom);
}
private void bindEvent() {
findViewById(R.id.tx_1).setOnClickListener(this);
findViewById(R.id.tx_2).setOnClickListener(this);
findViewById(R.id.tx_3).setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.tx_1:
ToastUtils.ToastMessage(getContext(), "click tx_1");
break;
case R.id.tx_2:
ToastUtils.ToastMessage(getContext(), "click tx_2");
break;
case R.id.tx_3:
ToastUtils.ToastMessage(getContext(), "click tx_3");
break;
default:
break;
}
}
}
| [
"razerdp123@gmail.com"
] | razerdp123@gmail.com |
4180575fe67744fa775d00b9170eff5e4b14d2e2 | 30ea2d6f6dcfd3d2677630577f7ff13c3a144f1a | /src/com/shtick/utils/scratch/runner/core/AbstractSpriteListener.java | 7e90aa26cb747a7b2ee4b831ef1b6286c962ef11 | [
"MIT"
] | permissive | seanmcox/scratch-runner-core | 78c86bd704c071aec4270d07a0520c756151a792 | 9b73628ff1197339e0feb53882c595e5518fd9b8 | refs/heads/master | 2021-04-27T00:53:28.248090 | 2019-02-04T07:19:37 | 2019-02-04T07:19:37 | 122,661,850 | 0 | 0 | MIT | 2019-02-04T07:19:38 | 2018-02-23T19:08:07 | Java | UTF-8 | Java | false | false | 1,688 | java | /**
*
*/
package com.shtick.utils.scratch.runner.core;
import java.awt.geom.Point2D;
/**
* @author sean.cox
*
*/
public class AbstractSpriteListener implements SpriteListener {
/* (non-Javadoc)
* @see com.shtick.utils.scratch.runner.core.SpriteListener#costumeChanged(int, java.lang.String, int, java.lang.String)
*/
@Override
public void costumeChanged(int oldSceneIndex, String oldSceneName, int newSceneIndex, String newSceneName) {}
/* (non-Javadoc)
* @see com.shtick.utils.scratch.runner.core.SpriteListener#scaleChanged(double, double)
*/
@Override
public void scaleChanged(double oldValue, double newValue) {}
/* (non-Javadoc)
* @see com.shtick.utils.scratch.runner.core.SpriteListener#headingChanged(double, double)
*/
@Override
public void headingChanged(double oldValue, double newValue) {}
/* (non-Javadoc)
* @see com.shtick.utils.scratch.runner.core.SpriteListener#rotationStyleChanged(java.lang.String, java.lang.String)
*/
@Override
public void rotationStyleChanged(String oldValue, String newValue) {}
/* (non-Javadoc)
* @see com.shtick.utils.scratch.runner.core.SpriteListener#positionChanged(java.awt.geom.Point2D, java.awt.geom.Point2D)
*/
@Override
public void positionChanged(Point2D oldPoint, Point2D newPoint) {}
/* (non-Javadoc)
* @see com.shtick.utils.scratch.runner.core.SpriteListener#effectChanged(java.lang.String, double, double)
*/
@Override
public void effectChanged(String effect, double oldValue, double newValue) {}
/* (non-Javadoc)
* @see com.shtick.utils.scratch.runner.core.SpriteListener#visibilityChanged(boolean)
*/
@Override
public void visibilityChanged(boolean newVisibility) {}
}
| [
"git@smcox.com"
] | git@smcox.com |
19609b5a25d8e10bc18f0d068a974a07782dfcd4 | d2f78fba359a999e132d8eb924902153abb9009b | /src/main/java/NioTcp单线程入门实例/ServerTest.java | 10f4a764ef7848c1b571ccc37ead6fb1edba42ec | [] | no_license | darkaquarius/testdemo | d737051a7b4817b4234a7093fb6cfc64cefd7fbe | 5dee2686a24cb575c9b719e79cc2eb3d48813121 | refs/heads/master | 2022-12-23T02:03:31.041105 | 2020-06-06T08:22:04 | 2020-06-06T08:22:04 | 159,659,070 | 1 | 1 | null | 2022-11-16T06:58:55 | 2018-11-29T11:56:39 | Java | UTF-8 | Java | false | false | 2,575 | java | package NioTcp单线程入门实例;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.Iterator;
public class ServerTest {
private Selector selector;
private boolean running;
private static int count;
public void init()
{
try
{
ServerSocketChannel server = ServerSocketChannel.open();
server.configureBlocking(false);
server.bind(new InetSocketAddress(2222));
this.selector = Selector.open();
server.register(selector, SelectionKey.OP_ACCEPT);
this.running = true;
count = 0;
}catch(Exception e)
{
e.printStackTrace();
}
System.out.println("server start");
}
public void work()
{
while(this.running)
{
try {
while(selector.select()>0)
{
Iterator<SelectionKey> iter = selector.selectedKeys().iterator();
while(iter.hasNext())
{
SelectionKey key = iter.next();
iter.remove();
if(!key.isValid())
{
continue;
}
if(key.isAcceptable())
{
SocketChannel channel = ((ServerSocketChannel)(key.channel())).accept();
channel.configureBlocking(false);
channel.register(selector, SelectionKey.OP_READ);
System.out.println("---new client connect---");
count++;
System.out.println("---total:"+count+"---");
channel.write(ByteBuffer.wrap("Hello Client\r\n".getBytes()));
}
if(key.isReadable())
{
SocketChannel channel = (SocketChannel)key.channel();
ByteBuffer buffer = ByteBuffer.allocate(1024);
int len;
while((len = channel.read(buffer))>0)
{
System.out.println("from client-->"+new String(buffer.array(), 0, len));;
buffer.clear();
}
System.out.print("input message: ");
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String line = reader.readLine();
channel.write(ByteBuffer.wrap((line+"\r\n").getBytes()));
}
}
}
} catch (IOException e) {
this.running = false;
e.printStackTrace();
}
}
}
public static void main(String[] args) {
ServerTest st = new ServerTest();
st.init();
st.work();
}
}
| [
"darkaquarius88@163.com"
] | darkaquarius88@163.com |
32012d9873002dcac8c799436d84cc27188a1084 | a61dd82929de8b10fdcf5867eaa9d1ed64815133 | /src/main/java/io/swagger/client/model/TimezoneRegionTimezone.java | 647218e605fa87784165023f76bc8896ff902f2e | [
"MIT"
] | permissive | jcsvall/isilon_sdk_java | 2fbc49bb76acc515f53b82a7b29b8ab38a36a38e | a2d0a2c262afae481418a26e7a10f2b86534c011 | refs/heads/master | 2020-09-06T02:46:32.006925 | 2018-04-20T00:12:46 | 2018-04-20T00:12:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,030 | java | /*
* Isilon SDK
* Isilon SDK - Language bindings for the OneFS API
*
* OpenAPI spec version: 5
* Contact: sdk@isilon.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package io.swagger.client.model;
import java.util.Objects;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* TimezoneRegionTimezone
*/
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2018-04-19T15:41:52.549-07:00")
public class TimezoneRegionTimezone {
@SerializedName("abbreviation")
private String abbreviation = null;
@SerializedName("path")
private String path = null;
public TimezoneRegionTimezone abbreviation(String abbreviation) {
this.abbreviation = abbreviation;
return this;
}
/**
* The abbreviation for this timezone.
* @return abbreviation
**/
@ApiModelProperty(value = "The abbreviation for this timezone.")
public String getAbbreviation() {
return abbreviation;
}
public void setAbbreviation(String abbreviation) {
this.abbreviation = abbreviation;
}
public TimezoneRegionTimezone path(String path) {
this.path = path;
return this;
}
/**
* The timezone path. This is the unique identifier for the timezone.
* @return path
**/
@ApiModelProperty(required = true, value = "The timezone path. This is the unique identifier for the timezone.")
public String getPath() {
return path;
}
public void setPath(String path) {
this.path = path;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
TimezoneRegionTimezone timezoneRegionTimezone = (TimezoneRegionTimezone) o;
return Objects.equals(this.abbreviation, timezoneRegionTimezone.abbreviation) &&
Objects.equals(this.path, timezoneRegionTimezone.path);
}
@Override
public int hashCode() {
return Objects.hash(abbreviation, path);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class TimezoneRegionTimezone {\n");
sb.append(" abbreviation: ").append(toIndentedString(abbreviation)).append("\n");
sb.append(" path: ").append(toIndentedString(path)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"Brandon.Krueger@isilon.com"
] | Brandon.Krueger@isilon.com |
e677fe60c61e7c81b9019482978347d28e6d36fe | db605dd526b5bbf694da8716b7056de39e3e1b50 | /src/main/java/li/cil/tis3d/common/module/execution/target/TargetInterfaceLast.java | 0407a81a735781460a417e5910daee34ee9b0ee1 | [
"CC0-1.0",
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | josephcsible/TIS-3D | b2ff7ae9e87d9b52824880ba835f07927d84555f | 7d3910a091ce4635d9c627ff182fd6d3001a7e36 | refs/heads/master-MC1.11 | 2021-06-30T04:04:04.151209 | 2017-09-08T18:08:56 | 2017-09-08T18:08:56 | 103,871,203 | 0 | 0 | null | 2017-09-17T23:58:20 | 2017-09-17T23:58:20 | null | UTF-8 | Java | false | false | 1,904 | java | package li.cil.tis3d.common.module.execution.target;
import li.cil.tis3d.api.machine.Face;
import li.cil.tis3d.common.module.ModuleExecution;
import li.cil.tis3d.common.module.execution.Machine;
/**
* Interface for the {@link Target#LAST} target.
* <p>
* Provides read and write on the pipe of the port that was last read from
* or written to. This is set whenever a read or write operation <em>on a
* real port</em> completes.
* <p>
* Since this is not set upon startup, there needs to be a default behavior,
* that being it behaves exactly like {@link Target#NIL}.
*/
public final class TargetInterfaceLast extends AbstractTargetInterfaceSide {
public TargetInterfaceLast(final Machine machine, final ModuleExecution module, final Face face) {
super(machine, module, face);
}
// --------------------------------------------------------------------- //
// TargetInterface
@Override
public boolean beginWrite(final short value) {
getState().last.ifPresent(port -> beginWrite(port, value));
return !getState().last.isPresent();
}
@Override
public boolean isWriting() {
return getState().last.map(this::isWriting).orElse(false);
}
@Override
public void beginRead() {
getState().last.ifPresent(this::beginRead);
}
@Override
public boolean isReading() {
return getState().last.map(this::isReading).orElse(false);
}
@Override
public boolean canTransfer() {
return getState().last.map(this::canTransfer).orElse(true);
}
@Override
public short read() {
return getState().last.map(this::read).orElse((short) 0);
}
// --------------------------------------------------------------------- //
// Object
@Override
public String toString() {
return "LAST [" + getState().last.map(Enum::name).orElse("NIL") + "]";
}
}
| [
"florian@nuecke.de"
] | florian@nuecke.de |
bfcbcb7b6fbd6e3a1f160309906ea2e1b36e59bf | bbe7eae301fd2289fad3b62b97a68162c6f71e41 | /SpringMvc/src/main/java/com/mnt/erp/service/EmpTimeSheetServiceImpl.java | 9be07624a340d94c1a5e9f4fd9674de71c9f45fc | [] | no_license | venkateshpavuluri/organization | a083e7d283f5f49f49fbd7c3738c888a95159d9e | 0bd0ce4eae6abc6aea7f174f7fbc8b224feada00 | refs/heads/master | 2021-01-19T20:18:36.911359 | 2014-06-14T10:55:54 | 2014-06-14T10:55:54 | 20,830,205 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,773 | java | package com.mnt.erp.service;
import java.util.List;
import com.mnt.erp.dao.EmpTimeSheetDao;
/**
* @author devi
*
*/
public class EmpTimeSheetServiceImpl implements EmpTimeSheetService{
String brmessage;
List<Object[]> objects;
EmpTimeSheetDao etsDao;
public EmpTimeSheetDao getEtsDao() {
return etsDao;
}
public void setEtsDao(EmpTimeSheetDao etsDao) {
this.etsDao = etsDao;
}
public String saveEmpTimeSheet(Object breakTimeobject,String userId,String userName) {
try{
brmessage=etsDao.saveEmpTimeSheet(breakTimeobject, userId, userName);
}catch(Exception e){
e.printStackTrace();
}
return brmessage;
}
public List<Object[]> selectEmpTimeSheet() {
try{
objects=etsDao.selectEmpTimeSheet();
}catch(Exception e){
e.printStackTrace();
}
return objects;
}
public List<Object[]> searchEmpTimeSheetWithId(int id) {
try{
objects=etsDao.searchEmpTimeSheetWithId(id);
}catch(Exception e){
e.printStackTrace();
}
return objects;
}
public List<Object[]> searchEmpTimeSheet() {
try{
objects=etsDao.searchEmpTimeSheet();
}catch(Exception e){
e.printStackTrace();
}
return objects;
}
public String updateEmpTimeSheet(Object updatebtservice) {
try{
brmessage=etsDao.updateEmpTimeSheet(updatebtservice);
}catch(Exception e){
e.printStackTrace();
}
return brmessage;
}
public String deleteEmpTimeSheet(int id) {
try{
brmessage=etsDao.deleteEmpTimeSheet(id);
}catch(Exception e){
e.printStackTrace();
}
return brmessage;
}
public Long getEmpTimeSheetCount(String name) {
Long iid=0l;
try{
iid=etsDao.getEmpTimeSheetCount(name);
}catch(Exception e){
e.printStackTrace();
}
return iid;
}
public Long getEmpTimeSheetCountEdit(String name, int breakTimeId) {
Long iid=0l;
try{
iid=etsDao.getEmpTimeSheetCountEdit(name, breakTimeId);
}catch(Exception e){
e.printStackTrace();
}
return iid;
}
public List<Object[]> basicSearchEmpTimeSheet(String label, String operator,
String searchName) {
try {
objects = etsDao.basicSearchEmpTimeSheet(label, operator, searchName);
} catch (Exception e) {
e.printStackTrace();
}
// TODO Auto-generated method stub
return objects;
}
public List<Object[]> selectEmpService() {
try{
objects=etsDao.getEmployeeIds();
}catch(Exception e){
e.printStackTrace();
}
return objects;
}
public List<Object[]> selectActivityService() {
try{
objects=etsDao.getActivityIds();
}catch(Exception e){
e.printStackTrace();
}
return objects;
}
}
| [
"pavuluri.venki@gmail.com"
] | pavuluri.venki@gmail.com |
73a0c1726905814e1e6b9ab82b7e1b1e0186d616 | fc0879f1a64a9b12f191b46f3ee08f32114519af | /gameserver/src/ru/catssoftware/gameserver/model/quest/pack/ai/Sailren.java | 1212529336c7f6a4a2e6c5a543341fb17fd3b1c6 | [] | no_license | Snikers0309/lucera2 | b26f59953edec905aefeb2c4273f3dec17e88a9d | 53d623903322e177cc7eb34a7e292878cbc74841 | refs/heads/master | 2023-03-23T00:25:53.002593 | 2013-01-30T01:11:33 | 2013-01-30T01:11:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,744 | java | package ru.catssoftware.gameserver.model.quest.pack.ai;
import ru.catssoftware.gameserver.datatables.SpawnTable;
import ru.catssoftware.gameserver.instancemanager.grandbosses.SailrenManager;
import ru.catssoftware.gameserver.model.L2Spawn;
import ru.catssoftware.gameserver.model.actor.instance.L2NpcInstance;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
import ru.catssoftware.gameserver.model.quest.Quest;
import ru.catssoftware.gameserver.model.quest.QuestState;
import ru.catssoftware.gameserver.model.zone.L2BossZone;
import ru.catssoftware.gameserver.model.zone.L2Zone;
public class Sailren extends Quest
{
//NPC
private int STATUE = 32109;
public static int VELOCIRAPTOR = 22218;
public static int PTEROSAUR = 22199;
public static int TYRANNOSAURUS = 22217;
public static int SAILREN = 29065;
public static String QUEST = "sailren";
//ITEM
private int GAZKH = 8784;
public Sailren()
{
super(-1, QUEST, "ai");
for (L2Spawn s : SpawnTable.getInstance().findAllNpc(TYRANNOSAURUS)) {
SpawnTable.getInstance().deleteSpawn(s,true);
}
addStartNpc(STATUE);
addTalkId(STATUE);
addKillId(VELOCIRAPTOR);
addKillId(PTEROSAUR);
addKillId(TYRANNOSAURUS);
addKillId(SAILREN);
}
public String onKill (L2NpcInstance npc, L2PcInstance player, boolean isPet)
{
L2BossZone zone = (L2BossZone)npc.getZone("Boss");
if(zone==null || zone.getBoss()!=L2Zone.Boss.SAILREN)
return null;
int npcId = npc.getNpcId();
if (npcId == VELOCIRAPTOR)
SailrenManager.getInstance().setSailrenSpawnTask(PTEROSAUR);
else if (npcId == PTEROSAUR)
SailrenManager.getInstance().setSailrenSpawnTask(TYRANNOSAURUS);
else if (npcId == TYRANNOSAURUS)
SailrenManager.getInstance().setSailrenSpawnTask(SAILREN);
else if (npcId == SAILREN)
SailrenManager.getInstance().setCubeSpawn();
return null;
}
public String onTalk(L2NpcInstance npc,L2PcInstance player)
{
QuestState st = player.getQuestState("sailren");
if (st==null)
return "<html><body>You are either not on a quest that involves this NPC, or you don't meet this NPC's minimum quest requirements.</body></html>";
int npcId = npc.getNpcId();
if (npcId == STATUE)
{
if (st.getQuestItemsCount(GAZKH)!=0)
{
int ENTRY_SATAT = SailrenManager.getInstance().canIntoSailrenLair(player);
if (ENTRY_SATAT == 1 || ENTRY_SATAT == 2)
{
st.exitQuest(true);
return "<html><body>Shilen's Stone Statue:<br>Another adventurers have already fought against the sailren. Do not obstruct them.</body></html>";
}
else if (ENTRY_SATAT == 3)
{
st.exitQuest(true);
return "<html><body>Shilen's Stone Statue:<br>The sailren is very powerful now. It is not possible to enter the inside.</body></html>";
}
else if (ENTRY_SATAT == 4)
{
st.exitQuest(true);
return "<html><body>Shilen's Stone Statue:<br>You seal the sailren alone? You should not do so! Bring the companion.</body></html>";
}
else if (ENTRY_SATAT == 0)
{
st.takeItems(GAZKH,1);
SailrenManager.getInstance().entryToSailrenLair(player);
return "<html><body>Shilen's Stone Statue:<br>Please seal the sailren by your ability.</body></html>";
}
}
else
{
st.exitQuest(true);
return "<html><body>Shilen's Stone Statue:<br><font color=\"LEVEL\">Gazkh</font> is necessary for seal the sailren.</body></html>";
}
}
return null;
}
}
| [
"topp3000@mail.ru"
] | topp3000@mail.ru |
b352284e8b3e69be45f385c1dd94ae194814c607 | 9af5abe79a9d2d38b2d6d34c4d821a07935e3339 | /src/main/java/com/phonemetra/turbo/internal/jdbc/JdbcResultSetMetadata.java | aa9eed0c10f18a94a7336b03f9666b66d318a5ff | [
"Apache-2.0"
] | permissive | Global-localhost/TurboSQL | a66b70a8fdb4cd67642dda0dad132986f2b9165c | 10dd81a36a0e25b1f786e366eb3ed9af0e5e325b | refs/heads/master | 2022-12-17T05:48:16.652086 | 2019-04-16T23:02:00 | 2019-04-16T23:02:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,044 | 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.phonemetra.turbo.internal.jdbc;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.List;
/**
* JDBC result set metadata implementation.
*
* @deprecated Using TurboSQL client node based JDBC driver is preferable.
* See documentation of {@link com.phonemetra.turbo.TurboSQLJdbcDriver} for details.
*/
@Deprecated
public class JdbcResultSetMetadata implements ResultSetMetaData {
/** Column width. */
private static final int COL_WIDTH = 30;
/** Table names. */
private final List<String> tbls;
/** Column names. */
private final List<String> cols;
/** Class names. */
private final List<String> types;
/**
* @param tbls Table names.
* @param cols Column names.
* @param types Types.
*/
JdbcResultSetMetadata(List<String> tbls, List<String> cols, List<String> types) {
assert cols != null;
assert types != null;
this.tbls = tbls;
this.cols = cols;
this.types = types;
}
/** {@inheritDoc} */
@Override public int getColumnCount() throws SQLException {
return cols.size();
}
/** {@inheritDoc} */
@Override public boolean isAutoIncrement(int col) throws SQLException {
return false;
}
/** {@inheritDoc} */
@Override public boolean isCaseSensitive(int col) throws SQLException {
return false;
}
/** {@inheritDoc} */
@Override public boolean isSearchable(int col) throws SQLException {
return false;
}
/** {@inheritDoc} */
@Override public boolean isCurrency(int col) throws SQLException {
return false;
}
/** {@inheritDoc} */
@Override public int isNullable(int col) throws SQLException {
return columnNullable;
}
/** {@inheritDoc} */
@Override public boolean isSigned(int col) throws SQLException {
return true;
}
/** {@inheritDoc} */
@Override public int getColumnDisplaySize(int col) throws SQLException {
return COL_WIDTH;
}
/** {@inheritDoc} */
@Override public String getColumnLabel(int col) throws SQLException {
return cols.get(col - 1);
}
/** {@inheritDoc} */
@Override public String getColumnName(int col) throws SQLException {
return cols.get(col - 1);
}
/** {@inheritDoc} */
@Override public String getSchemaName(int col) throws SQLException {
return "";
}
/** {@inheritDoc} */
@Override public int getPrecision(int col) throws SQLException {
return 0;
}
/** {@inheritDoc} */
@Override public int getScale(int col) throws SQLException {
return 0;
}
/** {@inheritDoc} */
@Override public String getTableName(int col) throws SQLException {
return tbls != null ? tbls.get(col - 1) : "";
}
/** {@inheritDoc} */
@Override public String getCatalogName(int col) throws SQLException {
return "";
}
/** {@inheritDoc} */
@Override public int getColumnType(int col) throws SQLException {
return JdbcUtils.type(types.get(col - 1));
}
/** {@inheritDoc} */
@Override public String getColumnTypeName(int col) throws SQLException {
return JdbcUtils.typeName(types.get(col - 1));
}
/** {@inheritDoc} */
@Override public boolean isReadOnly(int col) throws SQLException {
return true;
}
/** {@inheritDoc} */
@Override public boolean isWritable(int col) throws SQLException {
return false;
}
/** {@inheritDoc} */
@Override public boolean isDefinitelyWritable(int col) throws SQLException {
return false;
}
/** {@inheritDoc} */
@Override public String getColumnClassName(int col) throws SQLException {
return types.get(col - 1);
}
/** {@inheritDoc} */
@Override public <T> T unwrap(Class<T> iface) throws SQLException {
if (!isWrapperFor(iface))
throw new SQLException("Result set meta data is not a wrapper for " + iface.getName());
return (T)this;
}
/** {@inheritDoc} */
@Override public boolean isWrapperFor(Class<?> iface) throws SQLException {
return iface == ResultSetMetaData.class;
}
} | [
"devteam@phonemetra.com"
] | devteam@phonemetra.com |
0302559d5aadc7efdfe171c3cf0138956331e650 | 6e966225b3b05b07dc6208abc2cf27c4041db38a | /src/main/java/me/vilsol/nmswrapper/wraps/unparsed/NMSBlockSponge.java | c77cd44563558f23aa7d0dc26dcaca4b9a820123 | [
"Apache-2.0"
] | permissive | Vilsol/NMSWrapper | a73a2c88fe43384139fefe4ce2b0586ac6421539 | 4736cca94f5a668e219a78ef9ae4746137358e6e | refs/heads/master | 2021-01-10T14:34:41.673024 | 2016-04-11T13:02:21 | 2016-04-11T13:02:22 | 51,975,408 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,470 | java | package me.vilsol.nmswrapper.wraps.unparsed;
import me.vilsol.nmswrapper.NMSWrapper;
import me.vilsol.nmswrapper.reflections.ReflectiveClass;
import me.vilsol.nmswrapper.reflections.ReflectiveMethod;
@ReflectiveClass(name = "BlockSponge")
public class NMSBlockSponge extends NMSBlock {
public NMSBlockSponge(Object nmsObject){
super(nmsObject);
}
/**
* @see net.minecraft.server.v1_9_R1.BlockSponge#doPhysics(net.minecraft.server.v1_9_R1.World, net.minecraft.server.v1_9_R1.BlockPosition, net.minecraft.server.v1_9_R1.IBlockData, net.minecraft.server.v1_9_R1.Block)
*/
@ReflectiveMethod(name = "doPhysics", types = {NMSWorld.class, NMSBlockPosition.class, NMSIBlockData.class, NMSBlock.class})
public void doPhysics(NMSWorld world, NMSBlockPosition blockPosition, NMSIBlockData iBlockData, NMSBlock block){
NMSWrapper.getInstance().exec(nmsObject, world, blockPosition, iBlockData, block);
}
/**
* TODO Find correct name
* @see net.minecraft.server.v1_9_R1.BlockSponge#e(net.minecraft.server.v1_9_R1.World, net.minecraft.server.v1_9_R1.BlockPosition, net.minecraft.server.v1_9_R1.IBlockData)
*/
@ReflectiveMethod(name = "e", types = {NMSWorld.class, NMSBlockPosition.class, NMSIBlockData.class})
public void e(NMSWorld world, NMSBlockPosition blockPosition, NMSIBlockData iBlockData){
NMSWrapper.getInstance().exec(nmsObject, world, blockPosition, iBlockData);
}
/**
* @see net.minecraft.server.v1_9_R1.BlockSponge#fromLegacyData(int)
*/
@ReflectiveMethod(name = "fromLegacyData", types = {int.class})
public NMSIBlockData fromLegacyData(int i){
return (NMSIBlockData) NMSWrapper.getInstance().createApplicableObject(NMSWrapper.getInstance().exec(nmsObject, i));
}
/**
* @see net.minecraft.server.v1_9_R1.BlockSponge#getDropData(net.minecraft.server.v1_9_R1.IBlockData)
*/
@ReflectiveMethod(name = "getDropData", types = {NMSIBlockData.class})
public int getDropData(NMSIBlockData iBlockData){
return (int) NMSWrapper.getInstance().exec(nmsObject, iBlockData);
}
/**
* @see net.minecraft.server.v1_9_R1.BlockSponge#getName()
*/
@ReflectiveMethod(name = "getName", types = {})
public String getName(){
return (String) NMSWrapper.getInstance().exec(nmsObject);
}
/**
* @see net.minecraft.server.v1_9_R1.BlockSponge#getStateList()
*/
@ReflectiveMethod(name = "getStateList", types = {})
public NMSBlockStateList getStateList(){
return new NMSBlockStateList(NMSWrapper.getInstance().exec(nmsObject));
}
/**
* @see net.minecraft.server.v1_9_R1.BlockSponge#onPlace(net.minecraft.server.v1_9_R1.World, net.minecraft.server.v1_9_R1.BlockPosition, net.minecraft.server.v1_9_R1.IBlockData)
*/
@ReflectiveMethod(name = "onPlace", types = {NMSWorld.class, NMSBlockPosition.class, NMSIBlockData.class})
public void onPlace(NMSWorld world, NMSBlockPosition blockPosition, NMSIBlockData iBlockData){
NMSWrapper.getInstance().exec(nmsObject, world, blockPosition, iBlockData);
}
/**
* @see net.minecraft.server.v1_9_R1.BlockSponge#toLegacyData(net.minecraft.server.v1_9_R1.IBlockData)
*/
@ReflectiveMethod(name = "toLegacyData", types = {NMSIBlockData.class})
public int toLegacyData(NMSIBlockData iBlockData){
return (int) NMSWrapper.getInstance().exec(nmsObject, iBlockData);
}
} | [
"vilsol2000@gmail.com"
] | vilsol2000@gmail.com |
b1587c811a37e1caa5e83393f52c1937bffd8fdf | 1b66fbdbdfe90b77be56f0765edc00b6ac30463f | /src/com/sina/http/httpclientandroidlib/impl/client/cache/RequestProtocolError.java | 3b761223fb6e00cb4791b65c42b92834835d9353 | [] | no_license | vdiskmobile/SinaStorage-SDK-Java | c9cddaaca6feb8503c6b3877895bce6abbae0dfd | 123213e5956390119d3c203dcdce8754304b0369 | refs/heads/master | 2021-01-25T08:48:38.377963 | 2014-06-04T07:28:19 | 2014-06-04T07:28:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,455 | 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.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package com.sina.http.httpclientandroidlib.impl.client.cache;
/**
* @since 4.1
*/
enum RequestProtocolError {
UNKNOWN,
BODY_BUT_NO_LENGTH_ERROR,
WEAK_ETAG_ON_PUTDELETE_METHOD_ERROR,
WEAK_ETAG_AND_RANGE_ERROR,
NO_CACHE_DIRECTIVE_WITH_FIELD_NAME
}
| [
"poorevil@gmail.com"
] | poorevil@gmail.com |
a8f815caef905b4dcd0a9f861391e6f7eb87badc | fb5ae75a9101ebd2ec586a3e2f3465f8afdeff21 | /src/aggregateOperationsOracle/BulkDataOperationsExamples.java | 7239e3faacff4b920ba230af40c9ad3f9c45b225 | [] | no_license | RenjithKI/stream.methodreferenceFP | 14cdb01413b8edcdc58cdd54d413b76632793d9d | 8accdb6637eadd9b2c4520e8d2dfffeeefde274c | refs/heads/master | 2020-03-18T09:46:10.021506 | 2018-05-24T01:09:54 | 2018-05-24T01:09:54 | 134,579,382 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,657 | java | package aggregateOperationsOracle;
/*
*https://docs.oracle.com/javase/tutorial/collections/streams/
*/
import java.lang.Iterable;
import java.lang.Number;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.function.BinaryOperator;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
/**
* @author Renjith
*A stream is a sequence of elements. Unlike a collection,
*it is not a data structure that stores elements. Instead,
*a stream carries values from a source through a pipeline. This example creates
*a stream from the collection roster by invoking the method stream.
*/
public class BulkDataOperationsExamples {
public static void main(String... args) {
// Create sample data
List<Person> roster = Person.createRoster();
// 1. Print names of members, for-each loop
System.out.println("Members of the collection (for-each loop):");
for (Person p : roster) {
System.out.println(p.getName());
}
// 2. Print names of members, forEach operation
System.out.println("Members of the collection (bulk data operations):");
roster
.stream()
.forEach(e -> System.out.println(e.getName()));
// 3. Print names of male members, forEach operation
System.out.println(
"Male members of the collection (bulk data operations):");
roster
.stream()
.filter(e -> e.getGender() == Person.Sex.MALE)
.forEach(e -> System.out.println(e.getName()));
// 4. Print names of male members, for-each loop
System.out.println("Male members of the collection (for-each loop):");
for (Person p : roster) {
if (p.getGender() == Person.Sex.MALE) {
System.out.println(p.getName());
}
}
// 5. Get average age of male members of the collection:
double average = roster
.stream()
.filter(p -> p.getGender() == Person.Sex.MALE)
.mapToInt(Person::getAge)
.average()
.getAsDouble();
double average2 = roster
.stream()
.filter(p -> p.getGender() == Person.Sex.MALE)
.mapToInt(Person::getAge)
.average()
.getAsDouble();
System.out.println(
"Average age of male members (bulk data operations): " +
average);
}
} | [
"renjith.kachappilly@gmail.com"
] | renjith.kachappilly@gmail.com |
c2d1ded096726968bb431ebd58515810b4bbb482 | 4c01db9b8deeb40988d88f9a74b01ee99d41b176 | /easymallTest/study/src/test2/MySCListener.java | da3684ec84c4737f7c4615f960c6cc01c22f4b42 | [] | no_license | GGPay/- | 76743bf63d059cbf34c058b55edfdb6a58a41f71 | 20b584467142c6033ff92549fd77297da8ae6bfc | refs/heads/master | 2020-04-29T10:24:29.949835 | 2018-04-07T04:34:19 | 2018-04-07T04:34:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 480 | java | package test2;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
/**
* Created by tarena on 2016/9/6.
*/
public class MySCListener implements ServletContextListener {
public void contextInitialized(ServletContextEvent servletContextEvent){
System.out.println("服务器启动了");
}
public void contextDestroyed(ServletContextEvent servletContextEvent){
System.out.println("服务器要停滞了");
}
}
| [
"pinggaimuir@sina.com"
] | pinggaimuir@sina.com |
c00a0ea3451884ca9d6cabfac525a4cb187dc36f | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/64/3035.java | d2b5bc4f20436c40d3b8d8212ee8be9f60dff4be | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,424 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
int m;
int n;
int i;
int k;
int s = 0;
int p;
int q;
double[] c = new double[45];
double e;
double[][] d = new double[10][3];
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
for (m = 0;m < n;m++)
{
for (i = 0;i < 3;i++)
{
String tempVar2 = ConsoleInput.scanfRead();
if (tempVar2 != null)
{
(d[m][i]) = Double.parseDouble(tempVar2);
}
}
}
for (m = 0;m < n;m++)
{
for (k = m + 1;k < n;k++)
{
c[s] = Math.sqrt((d[m][0] - d[k][0]) * (d[m][0] - d[k][0]) + (d[m][1] - d[k][1]) * (d[m][1] - d[k][1]) + (d[m][2] - d[k][2]) * (d[m][2] - d[k][2]));
s = s + 1;
}
}
for (p = 1;p <= s;p++)
{
for (i = 0;i < s - p;i++)
{
if (c[i] > c[i + 1])
{
e = c[i + 1];
c[i + 1] = c[i];
c[i] = e;
}
}
}
for (q = s - 1;q >= 0;q--)
{
for (m = 0;m < n;m++)
{
for (k = m + 1;k < n;k++)
{
if (Math.sqrt((d[m][0] - d[k][0]) * (d[m][0] - d[k][0]) + (d[m][1] - d[k][1]) * (d[m][1] - d[k][1]) + (d[m][2] - d[k][2]) * (d[m][2] - d[k][2])) == c[q])
{
System.out.printf("(%.0lf,%.0lf,%.0lf)-(%.0lf,%.0lf,%.0lf)=%.2lf\n", d[m][0], d[m][1], d[m][2], d[k][0],d[k][1], d[k][2],c[q]);
}
}
}
for (p = q;p > 0;p = p - 1)
{
if (c[p] == c[p - 1])
{
q = q - 1;
}
else
{
break;
}
}
}
return 0;
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
f405ab5dc012aea5c2e9c411a7b8404381a40e64 | 0ea271177f5c42920ac53cd7f01f053dba5c14e4 | /5.5.0/sources/com/google/p098a/p100b/C1726d.java | 3df9b4bce25e6e74f94787aca08b4e455d444ff6 | [] | no_license | alireza-ebrahimi/telegram-talaeii | 367a81a77f9bc447e729b2ca339f9512a4c2860e | 68a67e6f104ab8a0888e63c605e8bbad12c4a20e | refs/heads/master | 2020-03-21T13:44:29.008002 | 2018-12-09T10:30:29 | 2018-12-09T10:30:29 | 138,622,926 | 12 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,271 | java | package com.google.p098a.p100b;
import com.google.p098a.C1668x;
import com.google.p098a.C1670w;
import com.google.p098a.C1747b;
import com.google.p098a.C1749c;
import com.google.p098a.C1768f;
import com.google.p098a.p099a.C1660a;
import com.google.p098a.p099a.C1663d;
import com.google.p098a.p099a.C1664e;
import com.google.p098a.p102d.C1678a;
import com.google.p098a.p102d.C1681c;
import com.google.p098a.p103c.C1748a;
import java.lang.reflect.Field;
import java.util.Collections;
import java.util.List;
/* renamed from: com.google.a.b.d */
public final class C1726d implements C1668x, Cloneable {
/* renamed from: a */
public static final C1726d f5293a = new C1726d();
/* renamed from: b */
private double f5294b = -1.0d;
/* renamed from: c */
private int f5295c = 136;
/* renamed from: d */
private boolean f5296d = true;
/* renamed from: e */
private boolean f5297e;
/* renamed from: f */
private List<C1747b> f5298f = Collections.emptyList();
/* renamed from: g */
private List<C1747b> f5299g = Collections.emptyList();
/* renamed from: a */
private boolean m8317a(C1663d c1663d) {
return c1663d == null || c1663d.m8083a() <= this.f5294b;
}
/* renamed from: a */
private boolean m8318a(C1663d c1663d, C1664e c1664e) {
return m8317a(c1663d) && m8319a(c1664e);
}
/* renamed from: a */
private boolean m8319a(C1664e c1664e) {
return c1664e == null || c1664e.m8084a() > this.f5294b;
}
/* renamed from: a */
private boolean m8320a(Class<?> cls) {
return !Enum.class.isAssignableFrom(cls) && (cls.isAnonymousClass() || cls.isLocalClass());
}
/* renamed from: b */
private boolean m8321b(Class<?> cls) {
return cls.isMemberClass() && !m8322c(cls);
}
/* renamed from: c */
private boolean m8322c(Class<?> cls) {
return (cls.getModifiers() & 8) != 0;
}
/* renamed from: a */
protected C1726d m8323a() {
try {
return (C1726d) super.clone();
} catch (CloneNotSupportedException e) {
throw new AssertionError();
}
}
/* renamed from: a */
public boolean m8324a(Class<?> cls, boolean z) {
if (this.f5294b != -1.0d && !m8318a((C1663d) cls.getAnnotation(C1663d.class), (C1664e) cls.getAnnotation(C1664e.class))) {
return true;
}
if (!this.f5296d && m8321b(cls)) {
return true;
}
if (m8320a((Class) cls)) {
return true;
}
for (C1747b a : z ? this.f5298f : this.f5299g) {
if (a.m8355a((Class) cls)) {
return true;
}
}
return false;
}
/* renamed from: a */
public boolean m8325a(Field field, boolean z) {
if ((this.f5295c & field.getModifiers()) != 0) {
return true;
}
if (this.f5294b != -1.0d && !m8318a((C1663d) field.getAnnotation(C1663d.class), (C1664e) field.getAnnotation(C1664e.class))) {
return true;
}
if (field.isSynthetic()) {
return true;
}
if (this.f5297e) {
C1660a c1660a = (C1660a) field.getAnnotation(C1660a.class);
if (c1660a == null || (z ? !c1660a.m8079a() : !c1660a.m8080b())) {
return true;
}
}
if (!this.f5296d && m8321b(field.getType())) {
return true;
}
if (m8320a(field.getType())) {
return true;
}
List<C1747b> list = z ? this.f5298f : this.f5299g;
if (!list.isEmpty()) {
C1749c c1749c = new C1749c(field);
for (C1747b a : list) {
if (a.m8354a(c1749c)) {
return true;
}
}
}
return false;
}
protected /* synthetic */ Object clone() {
return m8323a();
}
public <T> C1670w<T> create(C1768f c1768f, C1748a<T> c1748a) {
Class a = c1748a.m8359a();
final boolean a2 = m8324a(a, true);
final boolean a3 = m8324a(a, false);
if (!a2 && !a3) {
return null;
}
final C1768f c1768f2 = c1768f;
final C1748a<T> c1748a2 = c1748a;
return new C1670w<T>(this) {
/* renamed from: e */
final /* synthetic */ C1726d f5291e;
/* renamed from: f */
private C1670w<T> f5292f;
/* renamed from: a */
private C1670w<T> m8316a() {
C1670w<T> c1670w = this.f5292f;
if (c1670w != null) {
return c1670w;
}
c1670w = c1768f2.m8388a(this.f5291e, c1748a2);
this.f5292f = c1670w;
return c1670w;
}
public T read(C1678a c1678a) {
if (!a3) {
return m8316a().read(c1678a);
}
c1678a.mo1270n();
return null;
}
public void write(C1681c c1681c, T t) {
if (a2) {
c1681c.mo1284f();
} else {
m8316a().write(c1681c, t);
}
}
};
}
}
| [
"alireza.ebrahimi2006@gmail.com"
] | alireza.ebrahimi2006@gmail.com |
d6c714c242cbed35e683b395f5cbb7698745f456 | 00dc269e23eb565d6627fcdc4bfe2ed33a8047e4 | /src/test/java/joptsimple/ArgumentAcceptingOptionSpecTest.java | b4ff899349f834c5ac59fbe0d3eabe7b69fac27d | [
"MIT"
] | permissive | rbarnard/jopt-simple | 1b15ea55b9889a6b18ec1ccfe38d79ef6f3f3840 | aed744136377cfa5fc85942c5d2478182f73678f | refs/heads/master | 2020-12-25T02:39:16.651514 | 2011-07-07T15:17:27 | 2011-07-07T15:17:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,564 | java | /*
The MIT License
Copyright (c) 2004-2011 Paul R. Holser, Jr.
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 joptsimple;
import static org.infinitest.toolkit.Assertions.*;
import static org.junit.Assert.*;
import org.infinitest.toolkit.Block;
import org.junit.Test;
/**
* @author <a href="mailto:pholser@alumni.rice.edu">Paul Holser</a>
*/
public class ArgumentAcceptingOptionSpecTest {
@Test( expected = NullPointerException.class )
public void requiredArgOfNullType() {
new RequiredArgumentOptionSpec<Void>( "a" ).ofType( null );
}
@Test( expected = NullPointerException.class )
public void optionalArgOfNullType() {
new OptionalArgumentOptionSpec<Void>( "verbose" ).ofType( null );
}
@Test( expected = IllegalArgumentException.class )
public void requiredArgOfNonValueType() {
new RequiredArgumentOptionSpec<Void>( "threshold" ).ofType( Object.class );
}
@Test( expected = IllegalArgumentException.class )
public void optionalArgOfNonValueType() {
new OptionalArgumentOptionSpec<Void>( "max" ).ofType( Object.class );
}
@Test
public void requiredArgOfValueTypeBasedOnValueOf() {
assertNoException( new Block() {
public void execute() {
new RequiredArgumentOptionSpec<Void>( "threshold" ).ofType( ValueOfHaver.class );
}
} );
}
@Test
public void optionalArgOfValueTypeBasedOnValueOf() {
assertNoException( new Block() {
public void execute() {
new OptionalArgumentOptionSpec<Void>( "abc" ).ofType( ValueOfHaver.class );
}
} );
}
@Test
public void requiredArgOfValueTypeBasedOnCtor() {
assertNoException( new Block() {
public void execute() {
new RequiredArgumentOptionSpec<Void>( "threshold" ).ofType( Ctor.class );
}
} );
}
@Test
public void optionalArgOfValueTypeBasedOnCtor() {
final OptionalArgumentOptionSpec<Ctor> spec =
new OptionalArgumentOptionSpec<Ctor>( "abc" );
assertNoException( new Block() {
public void execute() {
spec.ofType( Ctor.class );
assertEquals( "foo", spec.convert( "foo" ).getS() );
}
} );
}
@Test( expected = IllegalArgumentException.class )
public void shouldRejectUnicodeZeroAsValueSeparatorForRequiredArgument() {
new RequiredArgumentOptionSpec<Void>( "a" ).withValuesSeparatedBy( '\u0000' );
}
@Test( expected = IllegalArgumentException.class )
public void shouldRejectUnicodeZeroAsValueSeparatorForOptionalArgument() {
new OptionalArgumentOptionSpec<Void>( "b" ).withValuesSeparatedBy( '\u0000' );
}
@Test( expected = NullPointerException.class )
public void shouldRejectNullConverter() {
new RequiredArgumentOptionSpec<Void>( "c" ).withValuesConvertedBy( null );
}
@Test( expected = NullPointerException.class )
public void shouldRejectNullDefaultValue() {
new RequiredArgumentOptionSpec<Integer>( "d" ).defaultsTo( null );
}
@Test( expected = NullPointerException.class )
public void shouldRejectNullDefaultValueRemainder() {
new RequiredArgumentOptionSpec<Integer>( "d" ).defaultsTo( 2, (Integer[]) null );
}
@Test( expected = NullPointerException.class )
public void shouldRejectNullInDefaultValueRemainder() {
new RequiredArgumentOptionSpec<Integer>( "d" ).defaultsTo( 2, 3, null );
}
}
| [
"pholser@alumni.rice.edu"
] | pholser@alumni.rice.edu |
c14778af50eea6d758fc8a213c681d894ab7e1ce | 87901d9fd3279eb58211befa5357553d123cfe0c | /bin/ext-template/yacceleratorfulfilmentprocess/src/de/hybris/platform/yacceleratorfulfilmentprocess/events/AuthorizationFailedEvent.java | f79faad3777a6e5cfc6ce4576de5e75804248681 | [] | no_license | prafullnagane/learning | 4d120b801222cbb0d7cc1cc329193575b1194537 | 02b46a0396cca808f4b29cd53088d2df31f43ea0 | refs/heads/master | 2020-03-27T23:04:17.390207 | 2014-02-27T06:19:49 | 2014-02-27T06:19:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 908 | java | /*
* [y] hybris Platform
*
* Copyright (c) 2000-2013 hybris AG
* All rights reserved.
*
* This software is the confidential and proprietary information of hybris
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with hybris.
*
*
*/
package de.hybris.platform.yacceleratorfulfilmentprocess.events;
import de.hybris.platform.orderprocessing.events.OrderProcessingEvent;
import de.hybris.platform.orderprocessing.model.OrderProcessModel;
/**
* Event representing failure to authorise a payment.
*/
public class AuthorizationFailedEvent extends OrderProcessingEvent
{
private static final long serialVersionUID = 8181864059445399549L;
public AuthorizationFailedEvent(final OrderProcessModel process)
{
super(process);
}
}
| [
"admin1@neev31.(none)"
] | admin1@neev31.(none) |
24267c82c760a3f733c12b0f3e230014ce16b8ca | 2b94fb946ee8f48183d9b8064f3cc9cd361dcebc | /src/main/java/hprose/io/serialize/ShortArraySerializer.java | 8e3bad3c8d70a2a3a72b2add0bbda7d5c2f68382 | [
"MIT"
] | permissive | smilechenchen/hprose-java | 13e982c27c79c9bae2afa2c22c1789dc440ee5e3 | 3556360b2363197164db8c1279a3ed6436feeaae | refs/heads/master | 2021-04-15T18:29:42.478786 | 2016-07-07T08:54:46 | 2016-07-07T08:54:46 | 62,849,040 | 1 | 0 | null | 2016-07-08T01:22:25 | 2016-07-08T01:22:24 | null | UTF-8 | Java | false | false | 2,243 | java | /**********************************************************\
| |
| hprose |
| |
| Official WebSite: http://www.hprose.com/ |
| http://www.hprose.org/ |
| |
\**********************************************************/
/**********************************************************\
* *
* ShortArraySerializer.java *
* *
* short array serializer class for Java. *
* *
* LastModified: Apr 17, 2016 *
* Author: Ma Bingyao <andot@hprose.com> *
* *
\**********************************************************/
package hprose.io.serialize;
import static hprose.io.HproseTags.TagClosebrace;
import static hprose.io.HproseTags.TagList;
import static hprose.io.HproseTags.TagOpenbrace;
import java.io.IOException;
import java.io.OutputStream;
final class ShortArraySerializer implements Serializer<short[]> {
public final static ShortArraySerializer instance = new ShortArraySerializer();
public final static void write(OutputStream stream, WriterRefer refer, short[] array) throws IOException {
if (refer != null) refer.set(array);
int length = array.length;
stream.write(TagList);
if (length > 0) {
ValueWriter.writeInt(stream, length);
}
stream.write(TagOpenbrace);
for (int i = 0; i < length; ++i) {
ValueWriter.write(stream, array[i]);
}
stream.write(TagClosebrace);
}
public final void write(Writer writer, short[] obj) throws IOException {
OutputStream stream = writer.stream;
WriterRefer refer = writer.refer;
if (refer == null || !refer.write(stream, obj)) {
write(stream, refer, obj);
}
}
}
| [
"mabingyao@gmail.com"
] | mabingyao@gmail.com |
fd1cd374ab10d9d27fab1204e50ab44f8cfd96ee | bba1ebf0b3023e1827deaec37ec593e6d3e23af3 | /catalogo-web/src/main/java/br/com/vivo/catalogoPRS/ws/catalogoProduto/sn/DesassociarProdModDesabilitarVariaveisRequest.java | 5a9137cd9658a969db3d99138e028708d186f53b | [] | no_license | douglasikoshima/teste-repositorio | 91a2844c2b8a7cc4f5d423ed25bfd24bfd1eff28 | c85512ec57b9a1fd450bba950b6e71c019ca14c3 | refs/heads/master | 2021-01-19T09:00:23.590328 | 2017-02-15T19:46:02 | 2017-02-15T19:46:02 | 82,079,552 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,825 | java | /**
* DesassociarProdModDesabilitarVariaveisRequest.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package br.com.vivo.catalogoPRS.ws.catalogoProduto.sn;
public class DesassociarProdModDesabilitarVariaveisRequest implements java.io.Serializable {
private br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesassociarProdutoModelo parametrosDesassociarProdutoModelo;
private br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesabilitarVariaveis parametrosDesabilitarVariaveis;
public DesassociarProdModDesabilitarVariaveisRequest() {
}
public DesassociarProdModDesabilitarVariaveisRequest(
br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesassociarProdutoModelo parametrosDesassociarProdutoModelo,
br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesabilitarVariaveis parametrosDesabilitarVariaveis) {
this.parametrosDesassociarProdutoModelo = parametrosDesassociarProdutoModelo;
this.parametrosDesabilitarVariaveis = parametrosDesabilitarVariaveis;
}
/**
* Gets the parametrosDesassociarProdutoModelo value for this DesassociarProdModDesabilitarVariaveisRequest.
*
* @return parametrosDesassociarProdutoModelo
*/
public br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesassociarProdutoModelo getParametrosDesassociarProdutoModelo() {
return parametrosDesassociarProdutoModelo;
}
/**
* Sets the parametrosDesassociarProdutoModelo value for this DesassociarProdModDesabilitarVariaveisRequest.
*
* @param parametrosDesassociarProdutoModelo
*/
public void setParametrosDesassociarProdutoModelo(br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesassociarProdutoModelo parametrosDesassociarProdutoModelo) {
this.parametrosDesassociarProdutoModelo = parametrosDesassociarProdutoModelo;
}
/**
* Gets the parametrosDesabilitarVariaveis value for this DesassociarProdModDesabilitarVariaveisRequest.
*
* @return parametrosDesabilitarVariaveis
*/
public br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesabilitarVariaveis getParametrosDesabilitarVariaveis() {
return parametrosDesabilitarVariaveis;
}
/**
* Sets the parametrosDesabilitarVariaveis value for this DesassociarProdModDesabilitarVariaveisRequest.
*
* @param parametrosDesabilitarVariaveis
*/
public void setParametrosDesabilitarVariaveis(br.com.vivo.catalogoPRS.ws.catalogoProduto.sn.ParametrosDesabilitarVariaveis parametrosDesabilitarVariaveis) {
this.parametrosDesabilitarVariaveis = parametrosDesabilitarVariaveis;
}
private java.lang.Object __equalsCalc = null;
public synchronized boolean equals(java.lang.Object obj) {
if (!(obj instanceof DesassociarProdModDesabilitarVariaveisRequest)) return false;
DesassociarProdModDesabilitarVariaveisRequest other = (DesassociarProdModDesabilitarVariaveisRequest) obj;
if (obj == null) return false;
if (this == obj) return true;
if (__equalsCalc != null) {
return (__equalsCalc == obj);
}
__equalsCalc = obj;
boolean _equals;
_equals = true &&
((this.parametrosDesassociarProdutoModelo==null && other.getParametrosDesassociarProdutoModelo()==null) ||
(this.parametrosDesassociarProdutoModelo!=null &&
this.parametrosDesassociarProdutoModelo.equals(other.getParametrosDesassociarProdutoModelo()))) &&
((this.parametrosDesabilitarVariaveis==null && other.getParametrosDesabilitarVariaveis()==null) ||
(this.parametrosDesabilitarVariaveis!=null &&
this.parametrosDesabilitarVariaveis.equals(other.getParametrosDesabilitarVariaveis())));
__equalsCalc = null;
return _equals;
}
private boolean __hashCodeCalc = false;
public synchronized int hashCode() {
if (__hashCodeCalc) {
return 0;
}
__hashCodeCalc = true;
int _hashCode = 1;
if (getParametrosDesassociarProdutoModelo() != null) {
_hashCode += getParametrosDesassociarProdutoModelo().hashCode();
}
if (getParametrosDesabilitarVariaveis() != null) {
_hashCode += getParametrosDesabilitarVariaveis().hashCode();
}
__hashCodeCalc = false;
return _hashCode;
}
// Type metadata
private static org.apache.axis.description.TypeDesc typeDesc =
new org.apache.axis.description.TypeDesc(DesassociarProdModDesabilitarVariaveisRequest.class, true);
static {
typeDesc.setXmlType(new javax.xml.namespace.QName("http://www.vivo.com.br/SN/CatalogoProduto", ">desassociarProdModDesabilitarVariaveisRequest"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("parametrosDesassociarProdutoModelo");
elemField.setXmlName(new javax.xml.namespace.QName("http://www.vivo.com.br/SN/CatalogoProduto", "ParametrosDesassociarProdutoModelo"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.vivo.com.br/SN/CatalogoProduto", ">ParametrosDesassociarProdutoModelo"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("parametrosDesabilitarVariaveis");
elemField.setXmlName(new javax.xml.namespace.QName("http://www.vivo.com.br/SN/CatalogoProduto", "ParametrosDesabilitarVariaveis"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.vivo.com.br/SN/CatalogoProduto", ">ParametrosDesabilitarVariaveis"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
/**
* Return type metadata object
*/
public static org.apache.axis.description.TypeDesc getTypeDesc() {
return typeDesc;
}
/**
* Get Custom Serializer
*/
public static org.apache.axis.encoding.Serializer getSerializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanSerializer(
_javaType, _xmlType, typeDesc);
}
/**
* Get Custom Deserializer
*/
public static org.apache.axis.encoding.Deserializer getDeserializer(
java.lang.String mechType,
java.lang.Class _javaType,
javax.xml.namespace.QName _xmlType) {
return
new org.apache.axis.encoding.ser.BeanDeserializer(
_javaType, _xmlType, typeDesc);
}
}
| [
"vfabio@indracompany.com"
] | vfabio@indracompany.com |
1ba0ab63ec57edd62826e1e20ccdc8aab5ead0bf | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/13/13_2e5521153c44369a177bc98ea44c0320a933df15/ResponseErrorWrapper/13_2e5521153c44369a177bc98ea44c0320a933df15_ResponseErrorWrapper_t.java | d366b96725fb33240c4ece7ed83281224827a67e | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,266 | java | /*
* Copyright 2007 Open Source Applications 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 org.osaf.cosmo.filters;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
/**
* HttpServletResponseWrapper that catchs calls to sendError() and
* delays invoking sendError on the wrapped response until
* flushError() is called. This allows a call to sendError() to
* be voided.
*/
public class ResponseErrorWrapper extends HttpServletResponseWrapper {
private String msg = null;
private Integer code = null;
public ResponseErrorWrapper(HttpServletResponse response) throws IOException {
super(response);
}
@Override
public void sendError(int code, String msg) throws IOException {
this.code = code;
this.msg = msg;
}
@Override
public void sendError(int code) throws IOException {
this.code = code;
}
/**
* Invoke sendError() on wrapped response if sendError() was
* invoked on wrapper.
* @returns true if an error was flushed, otherwise false
* @throws IOException
*/
public boolean flushError() throws IOException {
if(code!=null && msg!=null) {
super.sendError(code, msg);
clearError();
return true;
}
else if(code!=null) {
super.sendError(code);
clearError();
return true;
}
return false;
}
/**
* Clear error, voiding sendError().
*/
public void clearError() {
code = null;
msg = null;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
968205beb18df58313a80a32ddeb8a04190627a9 | fa4cc150076c1f621bc9c581829ae1d9cf6dfc26 | /app/src/main/java/com/neuqer/fitornot/network/converter/GsonResponseBodyConverter.java | 22d84f772f087e3ff729c1b36d23a761ae8eacf5 | [] | no_license | BoldFruit/FirOrNotxly | 45a2c1a041f0addfd9fe2b499762bcc3f9ef59f9 | aafaba28d653d80c3b740ebcae4731909ecf3dda | refs/heads/master | 2022-11-22T23:23:26.074526 | 2020-07-27T10:56:50 | 2020-07-27T10:56:50 | 282,869,363 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,521 | java | package com.neuqer.fitornot.network.converter;
import android.support.annotation.Nullable;
import com.google.gson.Gson;
import com.neuqer.fitornot.common.ApiException;
import com.neuqer.fitornot.common.Config;
import com.neuqer.fitornot.network.response.ApiResponse;
import java.io.IOException;
import java.lang.reflect.Type;
import okhttp3.ResponseBody;
import retrofit2.Converter;
/**
* @author YangZhaoxin.
* @since 2019/5/1 21:31.
* email yangzhaoxin@hrsoft.net.
*/
public class GsonResponseBodyConverter<T> implements Converter<ResponseBody, T> {
private final Gson gson;
private final Type type;
GsonResponseBodyConverter(Gson gson, Type type) {
this.gson = gson;
this.type = type;
}
@Nullable
@Override
public T convert(ResponseBody value) throws IOException {
//将返回的json数据储存在String类型的response中
String response = value.string();
//将外层的数据解析到ApiResponse中
ApiResponse apiResponse;
apiResponse = gson.fromJson(response, ApiResponse.class);
//遍历正确码
for (int code : Config.NET_CORRECT_CODE) {
if (apiResponse.getErrorCode() == code) {
//直接解析,正确请求不会导致json解析异常
return gson.fromJson(response, type);
}
}
//通过抛出自定义异常传递错误码及错误信息
throw (ApiException) gson.fromJson(response, ApiException.class);
}
}
| [
"798382030@qq.com"
] | 798382030@qq.com |
3237479fa59d0c264a8bb87d33337a1baba813cb | d2a47cef10bd35ed406f36bee98e5a068f4e5f4a | /jpa-eclipselink-25/src/main/java/com/github/lburgazzoli/examples/karaf/jpa/eclipselink25/cmd/AMItemAddCommand.java | 031e8ea2cc9c7841b15bf86de0e8e602e6b85262 | [
"Apache-2.0"
] | permissive | osgi-forks/lb-karaf-examples-jpa | 7c568f3a3d6a2dd14f136356ffd8512ace772182 | ea891218d1db9d460c5d813f0166ac1f1a15b9d4 | refs/heads/master | 2021-01-20T23:09:07.819238 | 2015-01-06T18:47:57 | 2015-01-06T18:47:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,380 | java | /**
*
* Copyright 2013 lb
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.github.lburgazzoli.examples.karaf.jpa.eclipselink25.cmd;
import com.github.lburgazzoli.examples.karaf.jpa.eclipselink25.data.Item;
import org.apache.felix.gogo.commands.Argument;
import org.apache.felix.gogo.commands.Command;
/**
*
*/
@Command(scope = "item", name = "eclipselink-am-add", description = "Add and item (AM)")
public class AMItemAddCommand extends AbstractItemCommand {
@Argument(index=0,required=true,multiValued=false,name="Name",description="Item Name")
String name;
@Argument(index=1,required=true,multiValued=false,name="Description",description="Item Description")
String description;
@Override
public Object doExecute() throws Exception {
getDataService().add(new Item(name,description));
return null;
}
}
| [
"lburgazzoli@gmail.com"
] | lburgazzoli@gmail.com |
1b22f10defe6e68827a927a41063da3e38c7ce82 | df5d6a911400cbc26a990349891310f2ee118ef1 | /smoothcsv-app-modules/smoothcsv-core/src/main/java/com/smoothcsv/core/filter/FixedValue.java | 2dc9d6f28789f4b75453d628f134f437e4921d49 | [
"Apache-2.0"
] | permissive | k-hatano/smoothcsv | 8df0eb4a9d66e24e08b547f5aa20d6cbb2b8254c | ab37ddd2c9f45d05872c8bf1d43ff49e3de2c18a | refs/heads/master | 2022-05-22T17:35:16.465561 | 2020-06-06T01:28:18 | 2020-06-06T01:39:45 | 204,708,583 | 1 | 0 | null | 2019-08-27T22:24:14 | 2019-08-27T13:24:13 | null | UTF-8 | Java | false | false | 1,641 | java | /*
* Copyright 2016 kohii
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.smoothcsv.core.filter;
import java.math.BigDecimal;
import java.util.List;
import com.smoothcsv.core.find.Regex;
/**
* @author kohii
*/
public class FixedValue implements IValue {
private final String text;
private BigDecimal numericVal;
private Regex regexVal;
public FixedValue(String text) {
this.text = text;
}
@Override
public String toString() {
return '"' + text + '"';
}
@Override
public String getValue(List<String> list) {
return text;
}
@Override
public BigDecimal getNumericValue(List<String> list) {
if (numericVal == null) {
numericVal = IValue.super.getNumericValue(list);
}
return numericVal;
}
@Override
public Regex getRegexValue(List<String> list, boolean caseSensitive) {
if (regexVal == null) {
String stringVal = getValue(list);
regexVal = new Regex(stringVal, caseSensitive);
}
return regexVal;
}
@Override
public String getText() {
return text;
}
}
| [
"kohii.git@gmail.com"
] | kohii.git@gmail.com |
bc4a68473438eff2e2898af22c2066abf1c0a95b | 252cfdf0d0513a6258c0706421cc184086537caa | /design/DesignPattern/create/Singleton.java | e53eb8c86c39c55206acbe89e6f0c3b2dd34a047 | [] | no_license | telucis/a_leetcode | 37d99d4987fad6bfa90c2fc602cdfa4d8cc6f77a | aa46769587023e98b80a2c06c14c90b0f8e2c9e5 | refs/heads/master | 2021-08-19T03:16:44.889909 | 2021-07-14T14:06:49 | 2021-07-14T14:06:49 | 190,832,551 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,436 | java | /**
* 单例(Singleton)
*
* Intent
*
* 确保一个类只有一个实例,并提供该实例的全局访问点。
*
* Class Diagram
*
* 使用一个私有构造函数、一个私有静态变量以及一个公有静态函数来实现。
*
* 私有构造函数保证了不能通过构造函数来创建对象实例,只能通过公有静态函数返回唯一的私有静态变量。
*/
/**
* 懒汉式 - 线程不安全
*/
public class Singleton {
private static Singleton uniqueInstance;
private Singleton() {}
public static Singleton getUniqueIsntance() {
if (uniqueInstance == null) {
uniqueInstance = new Singleton();
}
return uniqueInstance;
}
}
/**
* 饿汉式 - 线程安全
*/
public class Singleton {
private static Singleton uniqueInstance = new Singleton();
private Singleton() {}
public static Singleton getUniqueIsntance() {
return uniqueInstance;
}
}
/**
* 懒汉式 - 线程安全
*/
public class Singleton {
private static Singleton uniqueInstance;
private Singleton() {}
public static synchronized Singleton getUniqueIsntance() {
if (uniqueInstance == null) {
uniqueInstance = new Singleton();
}
return uniqueInstance;
}
}
/**
* 双重校验锁 - 线程安全
*
* uniqueInstance 采用 volatile 关键字修饰也是很有必要的, uniqueInstance = new Singleton(); 这段代码其实是分为三步执行:
*
* 为 uniqueInstance 分配内存空间
* 初始化 uniqueInstance
* 将 uniqueInstance 指向分配的内存地址
*
* 使用 volatile 可以禁止 JVM 的指令重排,保证在多线程环境下也能正常运行
*/
public class Singleton {
private volatile static Singleton uniqueInstance;
private Singleton() {}
public static Singleton getUniqueIsntance() {
if (uniqueInstance == null) {
synchronized(Singleton.class) {
if (uniqueInstance == null) {
uniqueInstance = new Singleton();
}
}
}
return uniqueInstance;
}
}
/**
* 内部静态类
*
* 当 Singleton 类被加载时,静态内部类 SingletonHolder 没有被加载进内存。
* 只有当调用 getUniqueInstance() 方法从而触发 SingletonHolder.INSTANCE 时 SingletonHolder 才会被加载
* 此时初始化 INSTANCE 实例,
* 并且 JVM 能确保 INSTANCE 只被实例化一次
*/
public class Singleton {
private Singleton() {}
private static class SingletonHolder {
private static final Singleton INSTANCE = new Singleton();
}
public static Singleton getUniqueIsntance() {
return SingletonHolder.INSTANCE;
}
}
/**
* 枚举实现
*
* 该实现可以防止反射攻击。
* 在其它实现中,通过 setAccessible() 方法可以将私有构造函数的访问级别设置为 public,
* 然后调用构造函数从而实例化对象,
* 如果要防止这种攻击,需要在构造函数中添加防止多次实例化的代码。
* 该实现是由 JVM 保证只会实例化一次,因此不会出现上述的反射攻击。
*
* 该实现在多次序列化和序列化之后,不会得到多个实例。
* 而其它实现需要使用 transient 修饰所有字段,并且实现序列化和反序列化的方法。
*/
public enum Singleton {
INSTANCE;
private String objName;
public String getObjName() {return objName}
public void setObjName(String objName) {this.objName = objName;}
public static void main(String[] args) {
// 单例测试
Singleton firstSingleton = Singleton.INSTANCE;
firstSingleton.setObjName("firstName");
System.out.println(firstSingleton.getObjName());
Singleton secondSingleton = Singleton.INSTANCE;
secondSingleton.setObjName("secondName");
System.out.println(firstSingleton.getObjName());
System.out.println(secondSingleton.getObjName());
// 反射获取实例测试
try {
Singleton[] enumConstants = Singleton.class.getEnumConstants();
for (Singleton enumConstant : enumConstants) {
System.out.println(enumConstant.getObjName());
}
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* firstName
* secondName
* secondName
* secondName
*/
}
| [
"telucis@yangdeMacBook-Air.local"
] | telucis@yangdeMacBook-Air.local |
3fb28d7661fbaaae0657ecbedb4307cb07ef6f88 | 8c586b7577de660a102645e5f5e6d0aedbb106a6 | /biomixer/src/org/thechiselgroup/biomixer/client/core/resources/ResourceCategorizerToMultiCategorizerAdapter.java | e8974d831fa8ac591a17a276985834fdbf5c7f9c | [
"Apache-2.0",
"BSD-3-Clause",
"MIT",
"LicenseRef-scancode-public-domain"
] | permissive | humanrelationshins/biomixer | 77bb728a22662a879d7a18032ae6e3a72669b92d | 08753031c670759d0279146e84288aa1b4781f46 | refs/heads/master | 2021-01-17T22:47:17.330584 | 2014-05-05T18:26:30 | 2014-05-05T18:26:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,596 | java | /*******************************************************************************
* Copyright 2009, 2010 Lars Grammel
*
* 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.thechiselgroup.biomixer.client.core.resources;
import java.util.HashSet;
import java.util.Set;
public class ResourceCategorizerToMultiCategorizerAdapter implements
ResourceMultiCategorizer {
private ResourceCategorizer categorizer;
public ResourceCategorizerToMultiCategorizerAdapter(
ResourceCategorizer categorizer) {
this.categorizer = categorizer;
}
@Override
public boolean canCategorize(Resource resource) {
// TODO this still needs to be implemented
return true;
}
@Override
public Set<String> getCategories(Resource resource) {
Set<String> categories = new HashSet<String>();
categories.add(categorizer.getCategory(resource));
return categories;
}
} | [
"lars.grammel@gmail.com"
] | lars.grammel@gmail.com |
23a63363b4dff48881954571f7e9763afddfcaa2 | 4fc2858a02172926fd24459305ce481cdd324a40 | /algorithm-leetcode-master/src/Problem_0738_单调递增的数字.java | d4b6c6921d50056b26e4bf737dcd36f6764a84a7 | [] | no_license | qqxqqbot/algorithmzuo | ecb3fd4505862d3d6e8bfd8955778a7152c77960 | ef76cb207cc490d0aa34590ab57821c0b6063c90 | refs/heads/master | 2023-05-08T09:42:17.244171 | 2021-06-06T11:06:26 | 2021-06-06T11:06:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,189 | java | /**
* @author cuilihuan
* @data 2021/4/12 10:44
*/
public class Problem_0738_单调递增的数字 {
public static void main(String[] args) {
System.out.println(new Problem_0738_单调递增的数字().monotoneIncreasingDigits(10));
}
public int monotoneIncreasingDigits(int N) {
char[] c = String.valueOf(N).toCharArray();
int i = 1;
for (; i < c.length; i++) {
if (c[i] < c[i - 1])
break;
}
if (i == c.length)
return N;
int index = i - 1;
for (int j = index; j >= 0; j--) {
c[j] = (char) (c[j] - 1);
if (j == 0 || c[j] >= c[j - 1]) {
index = j;
break;
}
}
for (int j = index + 1; j < c.length; j++) {
c[j] = '9';
}
int sum = 0;
for (int j = 0; j < c.length; j++) {
sum = sum * 10 + c[j] - '0';
}
if (sum > N)
sum = sum / 10;
return sum;
}
} | [
"1738127840@qq.com"
] | 1738127840@qq.com |
fa4b92ca42f8eb71bc5fba8d73cc760d31e9e253 | 7c21c81e21f465b8e131cc991fdcd4af7846b981 | /src/main/java/vazkii/quark/automation/feature/AnimalsEatFloorFood.java | 82863570e9f646258c360645415407355cb865b4 | [
"Apache-2.0"
] | permissive | lumien231/Quark | 0f5446febdf8964a44db8209707f845eec3b669a | 89400b45ee6d37eaec885725cf82040b15700d60 | refs/heads/master | 2021-05-14T12:41:39.601749 | 2018-01-01T17:39:38 | 2018-01-01T17:39:38 | 116,417,439 | 2 | 0 | null | 2018-01-05T19:02:02 | 2018-01-05T19:02:01 | null | UTF-8 | Java | false | false | 1,519 | java | package vazkii.quark.automation.feature;
import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import vazkii.quark.base.module.Feature;
public class AnimalsEatFloorFood extends Feature {
@SubscribeEvent
public void onEntityTick(LivingUpdateEvent event) {
if(event.getEntityLiving() instanceof EntityAnimal) {
EntityAnimal animal = (EntityAnimal) event.getEntityLiving();
if(animal.getGrowingAge() == 0 && !animal.isInLove() && !animal.isDead) {
double range = 2;
List<EntityItem> nearbyFood = animal.getEntityWorld().<EntityItem>getEntitiesWithinAABB(EntityItem.class, animal.getEntityBoundingBox().expand(range, 0, range),
(EntityItem i) -> !i.getItem().isEmpty() && !i.isDead && animal.isBreedingItem(i.getItem()) && i.getItem().getItem() != Items.ROTTEN_FLESH);
if(!nearbyFood.isEmpty()) {
EntityItem e = nearbyFood.get(0);
ItemStack stack = e.getItem();
stack.shrink(1);
e.setItem(stack);
if(stack.isEmpty())
e.setDead();
animal.setInLove(null);
}
}
}
}
@Override
public String[] getIncompatibleMods() {
return new String[] { "betterwithmods", "easybreeding" };
}
@Override
public boolean hasSubscriptions() {
return true;
}
}
| [
"vazkii@hotmail.com"
] | vazkii@hotmail.com |
0a7e2bfc193908f12b902257f53264b2487fe2c1 | 5623e8a84dedabf84f685a3275ddf6c4bc7ca1d1 | /src/main/java/config/webRestApi/WebConfig.java | ef91b27a64428d6af369b977727e23c2bc692c4d | [] | no_license | jesusjaferlo/SPRING | 8f6df88fa193d8a9967b43e548136787089ed6b8 | 356c9f659a7cffa5a5b82ca3e639efe11345c011 | refs/heads/master | 2020-04-06T04:00:54.929468 | 2017-02-20T04:59:14 | 2017-02-20T04:59:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,207 | java | package config.webRestApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
import org.thymeleaf.spring4.SpringTemplateEngine;
import org.thymeleaf.spring4.view.ThymeleafViewResolver;
import org.thymeleaf.templateresolver.ServletContextTemplateResolver;
import org.thymeleaf.templateresolver.TemplateResolver;
import config.MailConfig;
import config.PackageNames;
import config.SecurityConfig;
import restApi.TimeBasedAccessInterceptor;
import restApi.Uris;
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = {PackageNames.REST_API, PackageNames.WEB})
@Import(value = {MailConfig.class, SecurityConfig.class})
public class WebConfig extends WebMvcConfigurerAdapter {
// Se configuran los interceptores
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new TimeBasedAccessInterceptor()).addPathPatterns(Uris.SERVLET_MAP + Uris.ADMINS + "/**")
.excludePathPatterns("/foo/**");
}
// CORS
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*").maxAge(3600);
}
// Web presenters
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/static/**").addResourceLocations("/static/");
}
// Thymeleaf
@Bean
public TemplateResolver templateResolver() {
ServletContextTemplateResolver templateResolver = new ServletContextTemplateResolver();
templateResolver.setPrefix("/WEB-INF/views/");
templateResolver.setSuffix(".html");
templateResolver.setTemplateMode("HTML5");
return templateResolver;
}
// <bean id="templateResolver" class="org.thymeleaf.templateresolver.ServletContextTemplateResolver">
// <property name="prefix" value="/WEB-INF/views/" />
// <property name="suffix" value=".html" />
// <property name="templateMode" value="HTML5" />
// </bean>
// Thymeleaf
@Bean
public SpringTemplateEngine templateEngine() {
SpringTemplateEngine templateEngine = new SpringTemplateEngine();
templateEngine.setTemplateResolver(templateResolver());
return templateEngine;
}
// Thymeleaf
@Bean
public ViewResolver thymeleafViewResolver() {
ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
viewResolver.setTemplateEngine(templateEngine());
viewResolver.setOrder(1);
viewResolver.setViewNames(new String[] {"thymeleaf/*"});
return viewResolver;
}
// JSP
@Bean
public ViewResolver jspViewResolver() {
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
viewResolver.setViewClass(JstlView.class);
viewResolver.setPrefix("/WEB-INF/views/");
viewResolver.setSuffix(".jsp");
viewResolver.setOrder(2);
// Incompatible con "redirect:/action"
viewResolver.setViewNames("jsp/*", "bootstrap/*");
return viewResolver;
}
// <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
// <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
// <property name="prefix" value="/WEB-INF/jsp/"/>
// <property name="suffix" value=".jsp"/>
// </bean>
}
| [
"jbernal@etsisi.upm.es"
] | jbernal@etsisi.upm.es |
3187de8547162525a0d9f05b9e53aa0250b57d50 | a81de9488ddee499b368a486159650d8896bcdd6 | /org.emftext.language.arithm.resource.arithm/src-gen/org/emftext/language/arithm/resource/arithm/mopp/ArithmTextToken.java | e770f17afd89b53139441ed3ca569f6671601465 | [] | no_license | AresEkb/EMFTextArithm | beb1a4ee745c3f9c36d52b1012314d1865841702 | 603c3c5f90f22422405df50a0d10cc5bc0224d1f | refs/heads/master | 2021-01-04T14:07:11.115260 | 2013-11-12T18:54:15 | 2013-11-12T18:54:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,138 | java | /**
* <copyright>
* </copyright>
*
*
*/
package org.emftext.language.arithm.resource.arithm.mopp;
public class ArithmTextToken implements org.emftext.language.arithm.resource.arithm.IArithmTextToken {
private String name;
private String text;
private int offset;
private int length;
private int line;
private int column;
private boolean canBeUsedForSyntaxHighlighting;
public ArithmTextToken(String name, String text, int offset, int length, int line, int column, boolean canBeUsedForSyntaxHighlighting) {
super();
this.name = name;
this.text = text;
this.offset = offset;
this.length = length;
this.line = line;
this.column = column;
this.canBeUsedForSyntaxHighlighting = canBeUsedForSyntaxHighlighting;
}
public String getName() {
return name;
}
public String getText() {
return text;
}
public int getOffset() {
return offset;
}
public int getLength() {
return length;
}
public int getLine() {
return line;
}
public int getColumn() {
return column;
}
public boolean canBeUsedForSyntaxHighlighting() {
return canBeUsedForSyntaxHighlighting;
}
}
| [
"denis.nikif@gmail.com"
] | denis.nikif@gmail.com |
d41f20fea43926de82c567e4fe50474e2319f11f | 9bc4c9e0bf43d159220c4b0fb09e4c0a089f919b | /src/main/test/kontraktor/remoting/SPATest.java | e4fd28e5a06d0fce82ed30fc575e2c8371813215 | [] | no_license | RuedigerMoeller/4k | fc4bc2e978f84718054a71c1433613e7e3ca7b9d | c402d92983c4c147c3ed19d9ee71a5436642ba85 | refs/heads/kontraktor3 | 2021-01-20T00:58:36.902992 | 2015-06-08T20:44:11 | 2015-06-08T20:44:11 | 26,135,910 | 1 | 0 | null | 2015-05-01T20:02:16 | 2014-11-03T19:54:37 | Java | UTF-8 | Java | false | false | 1,724 | java | package kontraktor.remoting;
import io.undertow.server.handlers.resource.ResourceHandler;
import org.junit.Test;
import org.nustaq.kontraktor.Actors;
import org.nustaq.kontraktor.remoting.SerializerType;
import org.nustaq.kontraktor.remoting.javascript.DependencyResolver;
import org.nustaq.kontraktor.remoting.spa.AppConf;
import org.nustaq.kontraktor.undertow.Knode;
import myapp.SPAServer;
import org.nustaq.kontraktor.undertow.javascript.DynamicResourceManager;
import org.nustaq.serialization.FSTConfiguration;
import java.util.Map;
import java.util.function.Consumer;
/**
* Created by ruedi on 07/04/15.
*/
public class SPATest {
@Test
public void run() throws InterruptedException {
Knode knode = new Knode();
knode.mainStub(new String[] {"-p",""+8080});
SPAServer mySpa = Actors.AsActor(SPAServer.class);
String appRootDirectory = "/home/ruedi/projects/kontraktor/k-undertow/src/main/test/myapp/";
String appRootPath = "myapp/";
Map<String,DependencyResolver> loader = mySpa.$main(appRootDirectory).await();
AppConf conf = mySpa.$getConf().await();
knode.publishOnHttp(appRootPath+"http/", "api", mySpa);
Consumer<FSTConfiguration> configurator = mySpa.$getRemotingConfigurator().await();
knode.publishOnWebsocket(appRootPath+"ws/", SerializerType.MinBin, mySpa, configurator, true);
loader.forEach( (relPath, deploader) -> {
DynamicResourceManager man = new DynamicResourceManager(true, deploader.getRootComponent(), deploader);
knode.getPathHandler().addPrefixPath(appRootPath, new ResourceHandler(man));
});
Thread.sleep(1000000);
knode.stop();
}
}
| [
"moru0011@gmail.com"
] | moru0011@gmail.com |
fd0a7d5225e0c00cfd56cabfea408891098a752b | de12a61f864303688d2c9e748eb58e319c26e52d | /Incubation/org.emftext.commons.jsglr/src-jjtraveler/jjtraveler/Descendant.java | ab6f0437f516dd4a3eef5b4ddec620cc9799bdd2 | [] | no_license | DevBoost/EMFText | 800701e60c822b9cea002f3a8ffed18d011d43b1 | 79d1f63411e023c2e4ee75aaba99299c60922b35 | refs/heads/master | 2020-05-22T01:12:40.750399 | 2019-06-02T17:23:44 | 2019-06-02T19:06:28 | 5,324,334 | 6 | 10 | null | 2016-03-21T20:05:01 | 2012-08-07T06:36:34 | Java | UTF-8 | Java | false | false | 811 | java | package jjtraveler;
/**
* Go down the tree until the condition succeeds
* on a node -- then apply the descendant action
* to the children of that node.
* The search does not recurse in nodes below
* those that meet the condition.
* <p>
* This allows expressions such as
* Descendant(ProcedureBodyRecognizer, Descendant(SwitchRecognizer, Action))
* which would apply an Action to all switch statements that in
* turn are contained within ProceduresBodies.
* <p>
* See also the Child combinator.
*
* @author Arie van Deursen; Jun 30, 2003
* @version $Id: Descendant.java 12575 2004-02-10 20:31:58Z arie $
*/
public class Descendant extends DefinedCombinator {
public Descendant(Visitor condition, Visitor action) {
setDefinition(
new TopDownUntil(condition, new All(action))
);
}
}
| [
"jendrik.johannes@devboost.de"
] | jendrik.johannes@devboost.de |
cd2835f52439aa6bc56d35b1136c9683ddd68319 | 7559bead0c8a6ad16f016094ea821a62df31348a | /src/com/vmware/connection/helpers/BaseHelper.java | 80f02ff64275c796b48c5add1f6374e7d0978ff9 | [] | no_license | ZhaoxuepengS/VsphereTest | 09ba2af6f0a02d673feb9579daf14e82b7317c36 | 59ddb972ce666534bf58d84322d8547ad3493b6e | refs/heads/master | 2021-07-21T13:03:32.346381 | 2017-11-01T12:30:18 | 2017-11-01T12:30:18 | 109,128,993 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,108 | java | /*
* *****************************************************
* Copyright VMware, Inc. 2010-2012. All Rights Reserved.
* *****************************************************
*
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
* WARRANTIES OR CONDITIONS # OF ANY KIND, WHETHER ORAL OR WRITTEN,
* EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY # DISCLAIMS ANY IMPLIED
* WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY # QUALITY,
* NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
*/
package com.vmware.connection.helpers;
import com.vmware.connection.Connection;
import com.vmware.vim25.ServiceContent;
import com.vmware.vim25.VimPortType;
public abstract class BaseHelper {
final Connection connection;
public BaseHelper(final Connection connection) {
try {
this.connection = connection.connect();
} catch (Throwable t) {
throw new HelperException(t);
}
}
public class HelperException extends RuntimeException {
public HelperException(Throwable cause) {
super(cause);
}
}
}
| [
"495149700@qq.com"
] | 495149700@qq.com |
8a7f8514312e21cc83ee753277c75ab16fdad1a0 | 04e9dfd9d98b429b00559c4926dec5372e68fe94 | /src/com/haxademic/demo/hardware/midi/Demo_LaunchPad.java | 9dbcb4f08ae72e03ac66b3eb090ed99a0c3efc9b | [
"MIT"
] | permissive | Cynthiaevansusa/haxademic | c29fc3d877f0a242d909fab316fc7192001006f3 | 5ea49f658f79a93102cf24fa2b36043545cf9703 | refs/heads/master | 2020-03-28T14:28:54.765971 | 2018-09-10T20:46:04 | 2018-09-10T20:46:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,814 | java | package com.haxademic.demo.hardware.midi;
import com.haxademic.core.app.P;
import com.haxademic.core.app.PAppletHax;
import com.haxademic.core.constants.AppSettings;
import com.haxademic.core.hardware.midi.devices.LaunchControl;
import com.haxademic.core.hardware.midi.devices.LaunchPad;
import com.haxademic.core.hardware.midi.devices.NovationColors;
public class Demo_LaunchPad
extends PAppletHax {
public static void main(String args[]) { PAppletHax.main(Thread.currentThread().getStackTrace()[1].getClassName()); }
protected void overridePropsFile() {
p.appConfig.setProperty(AppSettings.MIDI_DEVICE_IN_INDEX, 0 );
p.appConfig.setProperty(AppSettings.MIDI_DEVICE_OUT_INDEX, 1 );
}
public void drawApp() {
p.background(0);
// p.midi.isMidiButtonOn(LaunchControl.PAD_01)
// print debug
p.midiState.printButtons();
p.midiState.printCC();
// outgoing midi changes the LED color on the launch control
p.midiState.sendMidiOut(true, 0, LaunchPad.gridMidiNote(0, 0), NovationColors.colors[P.round((NovationColors.colors.length - 1) * P.p.audioFreq(1) )]);
p.midiState.sendMidiOut(true, 0, LaunchPad.gridMidiNote(1, 1), NovationColors.colors[P.round((NovationColors.colors.length - 1) * P.p.audioFreq(100) )]);
p.midiState.sendMidiOut(true, 0, LaunchPad.gridMidiNote(2, 4), NovationColors.colors[P.round((NovationColors.colors.length - 1) * P.p.audioFreq(131) )]);
p.midiState.sendMidiOut(true, 0, LaunchPad.groupRowMidiNote(7), P.round(P.p.audioFreq(106) * 150f));
p.midiState.sendMidiOut(true, 0, LaunchPad.groupRowMidiNote(8), P.round(P.p.audioFreq(120) * 150f));
p.midiState.sendMidiOut(true, 0, LaunchPad.headerColMidiNote(0), P.round(P.p.audioFreq(105) * 150f));
p.midiState.sendMidiOut(true, 0, LaunchPad.headerColMidiNote(1), P.round(P.p.audioFreq(107) * 150f));
}
} | [
"cacheflowe@cacheflowe.com"
] | cacheflowe@cacheflowe.com |
891e6fc3da3a316c07a7e9cfbff0a984bd36f2e1 | 3efa417c5668b2e7d1c377c41d976ed31fd26fdc | /src/br/com/mind5/stats/statsCustomerSchedule/customerScheduleMonthAggr/model/checker/CustamonagrCheckWrite.java | 96f5879540a1f5e473ddfa751535cd46f8adc76f | [] | no_license | grazianiborcai/Agenda_WS | 4b2656716cc49a413636933665d6ad8b821394ef | e8815a951f76d498eb3379394a54d2aa1655f779 | refs/heads/master | 2023-05-24T19:39:22.215816 | 2023-05-15T15:15:15 | 2023-05-15T15:15:15 | 109,902,084 | 0 | 0 | null | 2022-06-29T19:44:56 | 2017-11-07T23:14:21 | Java | UTF-8 | Java | false | false | 1,069 | java | package br.com.mind5.stats.statsCustomerSchedule.customerScheduleMonthAggr.model.checker;
import java.sql.Connection;
import br.com.mind5.common.SystemCode;
import br.com.mind5.model.checker.ModelCheckerOption;
import br.com.mind5.model.checker.ModelCheckerTemplateSimple;
import br.com.mind5.stats.statsCustomerSchedule.customerScheduleMonthAggr.info.CustamonagrInfo;
public final class CustamonagrCheckWrite extends ModelCheckerTemplateSimple<CustamonagrInfo> {
public CustamonagrCheckWrite(ModelCheckerOption option) {
super(option);
}
@Override protected boolean checkHook(CustamonagrInfo recordInfo, Connection conn, String schemaName) {
if (recordInfo.codOwner <= 0 ||
recordInfo.codCustomer <= 0 ||
recordInfo.calmonth == null ||
recordInfo.username == null ||
recordInfo.codLanguage == null )
return super.FAILED;
return super.SUCCESS;
}
@Override protected int getCodMsgOnResultFalseHook() {
return SystemCode.STAT_CUS_SCH_MTH_AGGR_MANDATORY_FIELD_EMPTY;
}
}
| [
"mmaciel@mind5.com.br"
] | mmaciel@mind5.com.br |
4e1f28e15bec790e98abe39495fe2e127e9749f0 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_e23ad4b48a28de8aced5d286035851677b848761/SidePanel/1_e23ad4b48a28de8aced5d286035851677b848761_SidePanel_s.java | a06b4a3c465ba0dbf4b8e302e7bbcb8f5025367b | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,396 | java |
/***************************************************************************
* Copyright 2006-2007 by Christian Ihle *
* kontakt@usikkert.net *
* *
* This program 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 2 of the License, or *
* (at your option) any later version. *
* *
* This program 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 this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
package net.usikkert.kouchat.ui.swing;
import java.awt.BorderLayout;
import java.awt.Point;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.ActionListener;
import javax.swing.JList;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
import net.usikkert.kouchat.Constants;
import net.usikkert.kouchat.misc.NickDTO;
import net.usikkert.kouchat.misc.NickList;
import net.usikkert.kouchat.misc.Settings;
import net.usikkert.kouchat.util.Tools;
public class SidePanel extends JPanel implements ActionListener, MouseListener, FileDropSource
{
private static final long serialVersionUID = 1L;
private JPopupMenu nickMenu;
private JMenuItem infoMI, sendfileMI, privchatMI;
private JScrollPane nickSP;
private JList nickL;
private NickListModel nickDLM;
private Mediator mediator;
private NickDTO me;
private FileTransferHandler fileTransferHandler;
public SidePanel( ButtonPanel buttonP )
{
setLayout( new BorderLayout( 2, 2 ) );
fileTransferHandler = new FileTransferHandler( this );
nickDLM = new NickListModel();
nickL = new JList( nickDLM );
nickL.setCellRenderer( new CellRenderer() );
nickL.setFixedCellWidth( 110 );
nickL.addMouseListener( this );
nickL.setTransferHandler( fileTransferHandler );
nickSP = new JScrollPane( nickL );
add( nickSP, BorderLayout.CENTER );
add( buttonP, BorderLayout.SOUTH );
nickMenu = new JPopupMenu ();
infoMI = new JMenuItem( "Information" );
infoMI.setMnemonic( 'I' );
infoMI.addActionListener( this );
sendfileMI = new JMenuItem( "Send file" );
sendfileMI.setMnemonic( 'S' );
sendfileMI.addActionListener( this );
privchatMI = new JMenuItem( "Private chat" );
privchatMI.setMnemonic( 'P' );
privchatMI.addActionListener( this );
nickMenu.add( infoMI );
nickMenu.add( sendfileMI );
nickMenu.add( privchatMI );
me = Settings.getSettings().getMe();
}
public void setMediator( Mediator mediator )
{
this.mediator = mediator;
fileTransferHandler.setMediator( mediator );
}
public void setNickList( NickList nickList )
{
nickDLM.setNickList( nickList );
}
@Override
public NickDTO getUser()
{
return (NickDTO) nickL.getSelectedValue();
}
public JList getNicList()
{
return nickL;
}
@Override
public void actionPerformed( ActionEvent e )
{
if ( e.getSource() == infoMI )
{
SwingUtilities.invokeLater( new Runnable()
{
@Override
public void run()
{
NickDTO user = (NickDTO) nickDLM.getElementAt( nickL.getSelectedIndex() );
String info = "Information about " + user.getNick();
if ( user.isAway() )
info += " (Away)";
info += ".\n\nIP address: " + user.getIpAddress() +
"\nClient: " + user.getClient() +
"\nOperating System: " + user.getOperatingSystem() +
"\n\nOnline: " + Tools.howLongFromNow( user.getLogonTime() );
if ( user.isAway() )
info += "\nAway message: " + user.getAwayMsg();
JOptionPane.showMessageDialog( null, info, Constants.APP_NAME + " - Info", JOptionPane.INFORMATION_MESSAGE );
}
} );
}
else if ( e.getSource() == sendfileMI )
{
SwingUtilities.invokeLater( new Runnable()
{
@Override
public void run()
{
mediator.sendFile( getUser(), null );
}
} );
}
else if ( e.getSource() == privchatMI )
{
SwingUtilities.invokeLater( new Runnable()
{
@Override
public void run()
{
NickDTO user = (NickDTO) nickDLM.getElementAt( nickL.getSelectedIndex() );
mediator.showPrivChat( user );
}
} );
}
}
@Override
public void mouseClicked( MouseEvent e ) {}
@Override
public void mouseEntered( MouseEvent e ) {}
@Override
public void mouseExited( MouseEvent e ) {}
@Override
public void mousePressed( MouseEvent e )
{
if ( e.getSource() == nickL )
{
Point p = e.getPoint();
int index = nickL.locationToIndex( p );
if ( index != -1 )
{
Rectangle r = nickL.getCellBounds( index, index );
if ( r.x <= p.x && p.x <= r.x + r.width && r.y <= p.y && p.y <= r.y + r.height )
{
nickL.setSelectedIndex( index );
}
else
{
nickL.clearSelection();
}
}
}
}
@Override
public void mouseReleased( MouseEvent e )
{
if ( e.getSource() == nickL )
{
if ( nickMenu.isPopupTrigger( e ) && nickL.getSelectedIndex() != -1 )
{
NickDTO temp = (NickDTO) nickDLM.getElementAt( nickL.getSelectedIndex() );
if ( temp.isMe() )
{
sendfileMI.setVisible( false );
privchatMI.setVisible( false );
}
else if ( temp.isAway() || me.isAway() )
{
sendfileMI.setVisible( true );
sendfileMI.setEnabled( false );
privchatMI.setVisible( true );
if ( temp.getPrivateChatPort() == 0 )
privchatMI.setEnabled( false );
else
privchatMI.setEnabled( true );
}
else
{
sendfileMI.setVisible( true );
sendfileMI.setEnabled( true );
privchatMI.setVisible( true );
if ( temp.getPrivateChatPort() == 0 )
privchatMI.setEnabled( false );
else
privchatMI.setEnabled( true );
}
nickMenu.show( nickL, e.getX(), e.getY() );
}
else if ( e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2 && nickL.getSelectedIndex() != -1 )
{
NickDTO user = (NickDTO) nickDLM.getElementAt( nickL.getSelectedIndex() );
if ( user != me && user.getPrivateChatPort() != 0 )
mediator.showPrivChat( user );
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
1fc970075a964ca7e03de779ed45e16e95c5e7f1 | a8929b397f2145c4ff0d2111dfe94ea289c56066 | /customview/src/main/java/com/example/yangjw/customview/CustomView01.java | 6fef2206517e547328218fa22925c512a11693ca | [] | no_license | yangjingwen2/MyAndroidDemo | 36933913388a9cf14cdcefb89dae6dcd7a1e3454 | bd4316bc1a52f0ef3381742e85ebf4cdd73ec4ec | refs/heads/master | 2021-01-10T01:22:42.265351 | 2016-03-09T06:18:28 | 2016-03-09T06:18:28 | 53,464,910 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,119 | java | package com.example.yangjw.customview;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.os.Handler;
import android.os.Message;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import java.util.Calendar;
public class CustomView01 extends View {
private Paint mPaint;
private int width;
private int height;
private int secondsDefrees = 6;
private int hours = 3;
private int munites = 35;
private int second = 40;
private boolean isClick;
private Handler mHandler = new Handler() {
@Override
public void handleMessage(Message msg) {
Calendar calendar = Calendar.getInstance();
if (!isClick) {
hours = calendar.get(Calendar.HOUR);
munites = calendar.get(Calendar.MINUTE);
second = calendar.get(Calendar.SECOND);
invalidate();
sendEmptyMessageDelayed(1, 1000);
} else {
if (hours <= 12) {
hours++;
}
if (munites <= 60) {
munites++;
}
if (hours >= 12 && munites >= 60) {
isClick = false;
}
invalidate();
sendEmptyMessageDelayed(1, 500);
}
}
};
public CustomView01(Context context) {
super(context);
// TODO Auto-generated constructor stub
mPaint = new Paint();
mHandler.sendEmptyMessageDelayed(1, 2000);
}
public CustomView01(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
// TODO Auto-generated constructor stub
mPaint = new Paint();
mHandler.sendEmptyMessageDelayed(1, 2000);
}
public CustomView01(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
mPaint = new Paint();
mHandler.sendEmptyMessageDelayed(1, 2000);
}
/**
* �ؼ�����Ҫ��ˮƽ�ռ�ʹ�ֱ�ռ�
*/
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
Log.d("demo", "--->" + widthMeasureSpec);
Log.d("demo", "--->" + heightMeasureSpec);
Log.d("demo", "---size-->" + MeasureSpec.getSize(widthMeasureSpec));
Log.d("demo", "---mode-->" + MeasureSpec.getMode(widthMeasureSpec));
// Log.d("demo", "---AT_MOST-->"+MeasureSpec.AT_MOST);
// Log.d("demo", "---EXACTLY-->"+MeasureSpec.EXACTLY);
// Log.d("demo", "---UNSPECIFIED-->"+MeasureSpec.UNSPECIFIED);
// Log.d("demo", "---MAX-->"+Integer.MAX_VALUE);
// Log.d("demo", "---MAX>>2-->"+(Integer.MAX_VALUE>>2));
// TODO Auto-generated method stub
// super.onMeasure(widthMeasureSpec, heightMeasureSpec);s
// int defaultSize = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec);
// Log.d("demo", "---defaultSize-->"+defaultSize);
// Log.d("demo", "---defaultSize1-->"+MeasureSpec.getSize(defaultSize));
// int spec=MeasureSpec.makeMeasureSpec(200, MeasureSpec.EXACTLY);
// Log.d("demo", "---spec-->"+spec);
// setMeasuredDimension(widthMeasureSpec, heightMeasureSpec);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
// int measuredWidth = MeasureSpec.makeMeasureSpec(200, MeasureSpec.AT_MOST);
// int measuredHeight = MeasureSpec.makeMeasureSpec(300, MeasureSpec.AT_MOST);
// setMeasuredDimension(measuredWidth, measuredHeight);
width = getDefaultSize(getSuggestedMinimumWidth(), widthMeasureSpec);
height = getDefaultSize(getSuggestedMinimumHeight(), heightMeasureSpec);
}
@Override
protected void onLayout(boolean changed, int left, int top, int right,
int bottom) {
// TODO Auto-generated method stub
super.onLayout(changed, left, top, right, bottom);
Log.d("demo", "---changed-->" + changed);
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
// super.onDraw(canvas);
mPaint.setColor(Color.BLACK);
mPaint.setAntiAlias(true);
mPaint.setStrokeWidth(10);
mPaint.setStyle(Paint.Style.STROKE);
// mPaint.setTextSize(14);
// canvas.rotate(30);
// canvas.drawText("abcdddddd", 0, 15, mPaint);
// canvas.restore();
canvas.drawCircle(width / 2, height / 2, width / 2 - 40, mPaint);
mPaint.setStrokeWidth(5);
canvas.drawCircle(width / 2, height / 2, width / 2 - 50, mPaint);
mPaint.setColor(Color.GRAY);
for (int i = 0; i < 12; i++) {
canvas.save();
canvas.rotate(360 / 12 * i, width / 2, height / 2);
canvas.drawLine(60, height / 2, 70, height / 2, mPaint);
canvas.restore();
}
//ʱ��
canvas.save();
canvas.rotate(360 / 12 * hours + munites * 0.5F, width / 2, height / 2);
canvas.drawLine(width / 2, height / 2, width / 2, height / 2 - 50, mPaint);
canvas.restore();
mPaint.setStrokeWidth(3);
//����
canvas.save();
canvas.rotate(munites * 6, width / 2, height / 2);
canvas.drawLine(width / 2, height / 2, width / 2, height / 2 - 70, mPaint);
canvas.restore();
//����
mPaint.setStrokeWidth(1);
canvas.save();
canvas.rotate(second * 6, width / 2, height / 2);
canvas.drawLine(width / 2, height / 2, width / 2, height / 2 - 100, mPaint);
canvas.restore();
}
@Override
public boolean onTouchEvent(MotionEvent event) {
// TODO Auto-generated method stub
switch (event.getAction()) {
case MotionEvent.ACTION_UP:
Log.d("demo", "--->UP");
isClick = true;
hours = 0;
munites = 0;
break;
}
return true;
}
}
| [
"yangwen8701@126.com"
] | yangwen8701@126.com |
344af4d37ad21863c7e5ea7bf144c66cef7d3b01 | d915b9be7fac28eb81c5457e6d5e0f0f2ab59b5f | /plugin_module/src/main/java/com/lanshifu/plugin/ClassToBeLoad.java | fe3b658eab32d1d4f716a81060c77cd7cd348a56 | [] | no_license | lanshifu/BaseLibrary_Master | aff6f553f02347bd21809f934d54d4303ee4e0f6 | 5cc51fa0c3d8660e468888c865fc52de709ba4a9 | refs/heads/master | 2021-05-11T22:24:37.702546 | 2019-12-14T17:22:44 | 2019-12-14T17:22:44 | 117,492,522 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 218 | java | package com.lanshifu.plugin;
import android.util.Log;
public class ClassToBeLoad {
public void method(){
Log.e("ClassToBeLoad", "called method of class " + ClassToBeLoad.class.getName());
}
}
| [
"lanxiaobin@jiaxincloud.com"
] | lanxiaobin@jiaxincloud.com |
0181ef68d4309e208a0cdf92ec39a26abeac2376 | fc6d64bbb3c3e28287cd2001390938db94e778e1 | /src/main/java/com/zhou/leetcode_anwser/interview/Question5.java | 855544e89c9375a24b5049bc41632754b27bbfac | [] | no_license | xmwh171/leetcode_anwser | f70b89391790e821638e4ccb577022baf49b444b | 19467b66ddbf8928d19c19ace322ec1a358c6850 | refs/heads/master | 2021-01-04T08:09:19.329449 | 2020-02-17T03:31:12 | 2020-02-17T03:31:12 | 240,457,706 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 598 | java | package com.zhou.leetcode_anwser.interview;
/**
* @Description 最长回文子串
* @Author xiaohu
* @Date 2020/1/16 13:02
*/
public class Question5 {
/**
*
给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 的最大长度为 1000。
示例 1:
输入: "babad"
输出: "bab"
注意: "aba" 也是一个有效答案。
示例 2:
输入: "cbbd"
输出: "bb"
*/
/**
* 动态规划
* @param s
* @return
*/
public String longestPalindrome(String s) {
return "";
}
}
| [
"1209325963@qq.com"
] | 1209325963@qq.com |
59717e28c96e82b30ab0a944e805366e99bf1a9b | 5636e23ca013f1c6d1b88e1715ec038035013f12 | /org.osgi.impl.service.jndi/src/org/osgi/impl/service/jndi/JNDIContextManagerImpl.java | 9931aeeeb66f88fdb15c666c66cfe1edad111f8a | [
"EPL-1.0",
"Apache-2.0",
"EPL-2.0",
"CPL-1.0"
] | permissive | osgi/osgi | b897163557738fb40d03c368a3259b5e670a7d5a | 0ec08abcda0a75a8efc99b5f4a178497f73f143c | refs/heads/main | 2023-08-31T11:29:00.133907 | 2023-08-02T15:55:38 | 2023-08-02T15:55:38 | 255,701,604 | 76 | 36 | Apache-2.0 | 2023-09-06T23:45:13 | 2020-04-14T19:09:53 | Java | UTF-8 | Java | false | false | 4,668 | java | /*******************************************************************************
* Copyright (c) Contributors to the Eclipse 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.
*
* SPDX-License-Identifier: Apache-2.0
*******************************************************************************/
package org.osgi.impl.service.jndi;
import java.util.Collections;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.naming.NoInitialContextException;
import javax.naming.directory.DirContext;
import javax.naming.spi.InitialContextFactory;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
class JNDIContextManagerImpl implements CloseableJNDIContextManager {
private static final Logger logger = Logger.getLogger(JNDIContextManagerImpl.class.getName());
private final OSGiInitialContextFactoryBuilder m_builder;
/* list of Context implementations */
private final List<Context> m_listOfContexts = Collections
.synchronizedList(new LinkedList<>());
JNDIContextManagerImpl(Bundle callingBundle, BundleContext implBundleContext) {
// create a new builder for each client bundle
// since the JNDI services (factories) should be accessed
// by the JNDIContextManager service on behalf of the calling bundle
m_builder = new OSGiInitialContextFactoryBuilder(callingBundle.getBundleContext(), implBundleContext);
}
@Override
public Context newInitialContext() throws NamingException {
synchronized (m_builder) {
final Context initialContext = createNewInitialContext(
new Hashtable<>());
m_listOfContexts.add(initialContext);
return initialContext;
}
}
@Override
public Context newInitialContext(Map<String, ? > environment)
throws NamingException {
synchronized (m_builder) {
final Context initialContext = createNewInitialContext(environment);
m_listOfContexts.add(initialContext);
return initialContext;
}
}
@Override
public DirContext newInitialDirContext() throws NamingException {
synchronized (m_builder) {
Context contextToReturn = createNewInitialContext(
new Hashtable<>());
if (contextToReturn instanceof DirContext) {
m_listOfContexts.add(contextToReturn);
return (DirContext) contextToReturn;
}
}
throw new NoInitialContextException("DirContext could not be created. The matching InitialContextFactory did not create a matching type.");
}
@Override
public DirContext newInitialDirContext(Map<String, ? > environment)
throws NamingException {
synchronized (m_builder) {
Context context = createNewInitialContext(environment);
if (context instanceof DirContext) {
m_listOfContexts.add(context);
return (DirContext) context;
}
}
throw new NoInitialContextException("DirContext could not be created. The matching InitialContextFactory did not create a matching type.");
}
/**
* Closes all the known context implementations that have
* been provided by this service.
*/
@Override
public void close() {
// close known Context implementations
synchronized (m_listOfContexts) {
Iterator<Context> iterator = m_listOfContexts.iterator();
// call close() on all known contexts
while (iterator.hasNext()) {
Context context = iterator.next();
try {
context.close();
}
catch (NamingException e) {
logger.log(Level.INFO,
"NamingException occurred while trying to close an existing JNDI Context",
e);
}
}
}
m_listOfContexts.clear();
synchronized (m_builder) {
// close the Builder implementation
m_builder.close();
}
}
private Context createNewInitialContext(final Map<String, ? > environment)
throws NamingException {
final Hashtable<String,Object> jndiEnvironment = new Hashtable<>(
environment);
InitialContextFactory factory =
m_builder.createInitialContextFactory(jndiEnvironment);
return factory.getInitialContext(jndiEnvironment);
}
}
| [
"hargrave@us.ibm.com"
] | hargrave@us.ibm.com |
12dad5dd5967bf88a7b92ef6ff7a1cd1f602319f | 71b6f25a08a2325a65445f2dedb40075f8562a02 | /TLRPC$Photo.java | 2e88a704b77821831537b33cfcbf4180e430663a | [] | no_license | CustomIcon/tgnet | 7bb8a81700e66a2255a94ff3bb07beb211996a1d | 10567a64d33f846c552a4ea98d576925484f875b | refs/heads/main | 2023-09-01T02:42:07.693180 | 2021-09-09T07:52:29 | 2021-09-09T07:52:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,961 | java | package org.telegram.tgnet;
import java.util.ArrayList;
public abstract class TLRPC$Photo extends TLObject {
public long access_hash;
public String caption;
public int date;
public int dc_id;
public byte[] file_reference;
public int flags;
public TLRPC$GeoPoint geo;
public boolean has_stickers;
public long id;
public ArrayList<TLRPC$PhotoSize> sizes = new ArrayList<>();
public long user_id;
public ArrayList<TLRPC$VideoSize> video_sizes = new ArrayList<>();
public static TLRPC$Photo TLdeserialize(AbstractSerializedData abstractSerializedData, int i, boolean z) {
TLRPC$Photo tLRPC$Photo;
switch (i) {
case -1836524247:
tLRPC$Photo = new TLRPC$TL_photo_layer82();
break;
case -1673036328:
tLRPC$Photo = new TLRPC$TL_photo_layer97();
break;
case -1014792074:
tLRPC$Photo = new TLRPC$TL_photo_old2();
break;
case -840088834:
tLRPC$Photo = new TLRPC$TL_photo_layer55();
break;
case -797637467:
tLRPC$Photo = new TLRPC$TL_photo_layer115();
break;
case -82216347:
tLRPC$Photo = new TLRPC$TL_photo();
break;
case 582313809:
tLRPC$Photo = new TLRPC$TL_photo_old();
break;
case 590459437:
tLRPC$Photo = new TLRPC$TL_photoEmpty();
break;
default:
tLRPC$Photo = null;
break;
}
if (tLRPC$Photo != null || !z) {
if (tLRPC$Photo != null) {
tLRPC$Photo.readParams(abstractSerializedData, z);
}
return tLRPC$Photo;
}
throw new RuntimeException(String.format("can't parse magic %x in Photo", Integer.valueOf(i)));
}
}
| [
"aman_a@aol.com"
] | aman_a@aol.com |
c3fde808ba13c40413147a8c5c28bbc816580be4 | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/1/1076.java | 4d47dd056acdeac6bbef6cdd323c32f059db4fef | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 566 | java | package <missing>;
public class GlobalMembers
{
public static int decomposition(int m,int k)
{
int res = 1;
for (int i = k;i * i <= m;i++)
{
if (m % i == 0 && m / i >= i)
{
res += decomposition(m / i, i);
}
}
return res;
}
public static int Main()
{
int n;
while (scanf("%d", n) == 1)
{
for (int i = 0;i < n;i++)
{
int m;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
m = Integer.parseInt(tempVar);
}
System.out.printf("%d\n",decomposition(m, 2));
}
}
return 0;
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
29734d5b65650ebe5caebaccc758574ca779e4de | 347449626effc62f50353edf5623b658bdeb78b0 | /spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/filter/TypeExcludeFilters.java | 40d7270a6ed878c75da3875d0d896022dec019b2 | [
"Apache-2.0"
] | permissive | huseyincelik/spring-boot | d7e775674627b3189155afd102f3b7da795beb2b | b15ba428d8e845e02e74d3b563d6b98fb3a50d20 | refs/heads/master | 2020-05-29T10:22:54.120841 | 2016-03-25T08:47:30 | 2016-03-25T08:47:30 | 54,705,254 | 1 | 0 | null | 2016-03-25T08:21:27 | 2016-03-25T08:21:26 | null | UTF-8 | Java | false | false | 1,793 | java | /*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.springframework.boot.test.autoconfigure.filter;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.TypeExcludeFilter;
/**
* Annotation that can on tests to define a set of {@link TypeExcludeFilter } classes that
* should be applied to {@link SpringBootApplication @SpringBootApplication} component
* scanning.
*
* @author Phillip Webb
* @since 1.4.0
* @see TypeExcludeFilter
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface TypeExcludeFilters {
/**
* Specifies {@link TypeExcludeFilter} classes that should be applied to
* {@link SpringBootApplication @SpringBootApplication} component scanning. Classes
* specified here can either have a no-arg constructor or accept a single
* {@code Class<?>} argument if then need access to the {@code testClass}.
* @see TypeExcludeFilter
*/
Class<? extends TypeExcludeFilter>[] value();
}
| [
"pwebb@pivotal.io"
] | pwebb@pivotal.io |
c6041d14dbada9269f5283055d9c78952810bfd4 | 4d017ef6ad6c6282a0fa65422e7c95d220edfe46 | /Java-OOP/Exam - 15 December 2019 High Quality Structure/src/aquarium/repositories/DecorationRepository.java | 9ce379c782fc0850b179c4f7fe5c176825f9bd5c | [] | no_license | Spand0x/SoftUni | 53e204929f21dc21fb92dee745aa4993ad0c9d0c | 40af6ae71acfb04506fdd407e17c0a13e97f1f5c | refs/heads/master | 2022-07-08T01:29:25.008798 | 2020-04-23T14:29:06 | 2020-04-23T14:29:06 | 231,943,127 | 0 | 0 | null | 2022-06-21T03:17:25 | 2020-01-05T16:13:56 | Java | UTF-8 | Java | false | false | 1,075 | java | package aquarium.repositories;
import aquarium.models.decorations.Decoration;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
public class DecorationRepository implements Repository {
private Collection<Decoration> decorations;
public DecorationRepository() {
this.decorations = new ArrayList<>();
}
@Override
public void add(Decoration decoration) {
this.decorations.add(decoration);
}
@Override
public boolean remove(Decoration decoration) {
return this.decorations.remove(decoration);
}
@Override
public Decoration findByType(String type) {
Decoration decor = null;
for (Decoration decoration : decorations) {
if(decoration.getClass().getSimpleName().equals(type)){
decor = decoration;
break;
}
}
//todo check again
return decor;
}
public Collection<Decoration> getDecorations() {
return Collections.unmodifiableCollection(decorations);
}
}
| [
"gexna97@gmail.com"
] | gexna97@gmail.com |
72edb81e0deb4409f8df0c7561130e26ed0c213d | 74ff740a11efa8c1a69af91a090b2b36773b3b24 | /app/src/main/java/com/wxb/jianbao11/activity/Register.java | 55adf3a715e52f9ec9c702e638012942de4c5c8d | [] | no_license | wangxingbin/JianBao1.1 | 3c6cec57a9ba044c87e93809659656ec658e6af5 | 75a9a86d60fb814ed093b10d110ee00e234e4677 | refs/heads/master | 2021-01-13T15:53:15.952174 | 2016-12-29T07:38:45 | 2016-12-29T07:38:45 | 76,837,093 | 1 | 0 | null | 2016-12-21T08:38:19 | 2016-12-19T07:05:24 | Java | UTF-8 | Java | false | false | 6,639 | java | package com.wxb.jianbao11.activity;
import android.app.Activity;
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 android.widget.TextView;
import com.wxb.jianbao11.R;
import com.wxb.jianbao11.bean.RegisterBeen;
import com.wxb.jianbao11.contants.Contant;
import com.wxb.jianbao11.utils.CustomProgress;
import com.wxb.jianbao11.utils.PhotoNumberJudge;
import com.wxb.jianbao11.utils.PhotoPostUtils;
import com.wxb.jianbao11.utils.ResgiterUtils;
import com.wxb.jianbao11.utils.ShowToastUtils;
import java.io.File;
import java.util.HashMap;
/**
* Created by 孙贝贝 on 2016/11/28.
*/
public class Register extends Activity implements View.OnClickListener {
private static final String TAG = "Register";
protected Button upload;
private EditText username;
private EditText password;
private EditText name;
private EditText code;
private RadioGroup group;
private String yonghu;
private String mima;
private String xingming;
private String inivite_code;
private RadioButton rb;
private String gender;
private Button register_btn;
private String path;
private File file;
private HashMap<String, String> map;
private String status;
private TextView toolname;
private ImageView back;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.register_view);
initview();
getGenderData();
}
private void getGenderData() {
group.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(RadioGroup radioGroup, int i) {
rb = (RadioButton) findViewById(i);
//gender 性别
gender = rb.getText().toString().trim();
ShowToastUtils.showToast(Register.this, gender);
}
});
}
private void initData() {
yonghu = username.getText().toString().trim();
mima = password.getText().toString().trim();
xingming = name.getText().toString().trim();
inivite_code = code.getText().toString().trim();
// SharedPreferences sharepath = getSharedPreferences("PATH", MODE_PRIVATE);
// path = sharepath.getString("path", "");
// Log.i(TAG,path+"_______________________________+++++++++++++++++++++++++");
// file = new File(path);
//
// if (file == null) {
// ShowToastUtils.showToast(Register.this,"请另选一张图片");
// }
map = new HashMap<>();
map.put("code", inivite_code);
if (!PhotoNumberJudge.isPhoneNumberValid(yonghu)){
ShowToastUtils.showToast(Register.this,"手机格式不正确");
return;
}else {
map.put("mobile", yonghu);
}
map.put("name", xingming);
map.put("password", mima);
map.put("gender", gender);
Log.i(TAG, path + "___________________________________________________________");
}
private void initview() {
toolname = (TextView) findViewById(R.id.bar_tv_name);
toolname.setText("注册");
back = (ImageView) findViewById(R.id.bar_iv_back);
back.setOnClickListener(this);
username = (EditText) findViewById(R.id.username_edit);
password = (EditText) findViewById(R.id.password_edit);
name = (EditText) findViewById(R.id.name);
code = (EditText) findViewById(R.id.invite_code_edit);
group = (RadioGroup) findViewById(R.id.grop);
register_btn = (Button) findViewById(R.id.register_button);
register_btn.setOnClickListener(this);
// upload = (Button) findViewById(R.id.upload_photo);
// upload.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
// case R.id.upload_photo:
// startActivity(new Intent(Register.this, Camera.class));
// break;
case R.id.register_button:
initData();
if (yonghu.equals("")||password.equals("")||name.equals("")||code.equals("")||gender.equals("")){
ShowToastUtils.showToast(Register.this,"请完善你的信息");
return;
}else if(yonghu.equals("")&&password.equals("")&&name.equals("")&&code.equals("")&&gender.equals("")){
ShowToastUtils.showToast(Register.this,"请填写你的用户信息");
return;
}
CustomProgress.getPrgressDolilog(Register.this,"正在注册","请稍等....");
upLoadPhoto();
break;
case R.id.bar_iv_back:
finish();
break;
}
}
private void upLoadPhoto() {
String path = Contant.RESGISTER;
ResgiterUtils.getData(new PhotoPostUtils.GetRegisterData() {
@Override
public void setRegisterData(Object o) {
RegisterBeen data = (RegisterBeen) o;
status = data.getStatus();
if (status.equals("200")) {
runOnUiThread(new Runnable() {
@Override
public void run() {
CustomProgress.dissPrgress();
ShowToastUtils.showToast(Register.this, "注册成功");
finish();
}
});
}else if(status.equals("201")){
runOnUiThread(new Runnable() {
@Override
public void run() {
CustomProgress.dissPrgress();
ShowToastUtils.showToast(Register.this,"此号码已注册请换号");
}
});
return;
}else if(status.equals("206")){
runOnUiThread(new Runnable() {
@Override
public void run() {
CustomProgress.dissPrgress();
ShowToastUtils.showToast(Register.this,"邀请码已使用");
}
});
return;
}
}
});
ResgiterUtils.upLoad(this,path,map,RegisterBeen.class);
}
}
| [
"930184501@qq.com"
] | 930184501@qq.com |
6ff00a0c44a55db0a4f16cbbbdf8d76be7d95f2f | 4371760ea7563c4bf653c6ce353ff479fa60b8ea | /JAXRS/RESTEasyWeek3/src/service/register/RegisterApplication.java | 09b05a2cf4f5ab789ed96ebe021adba7b06fca26 | [] | no_license | huseyinsaglam/JAXRS | 08e54a6597b3c4e7973c537cf3a2bb4304db8cb5 | e77c5fc86c03be7302d28a6cb22b6d9980380647 | refs/heads/master | 2020-04-07T20:23:08.587947 | 2018-11-22T11:02:10 | 2018-11-22T11:02:10 | 158,685,701 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 567 | java | package service.register;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import _01.encoded.EmployeeResource;
import _02.ContextResource;
@ApplicationPath("/root-path")
public class RegisterApplication extends Application{
public Set<Object> singletions = new HashSet<Object>();
public RegisterApplication()
{
singletions.add(new EmployeeResource());
singletions.add(new ContextResource());
}
@Override
public Set<Object> getSingletons() {
return singletions;
}
}
| [
"hsaglam001@gmail.com"
] | hsaglam001@gmail.com |
c753ddc918e69cb304bd15034c148c2976506601 | 41738bbc29db248db606efe6e5dac01dbcfd7bb2 | /serialization-tests/src/test/java/com/gs/collections/impl/block/procedure/AtomicCountProcedureSerializationTest.java | 9c4d39fab6dd1122530fee15289dd432d069bf2a | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | cnxtech/gs-collections | d27d7d28c45ba50e4a6a90e821315da9bf5e810d | fa8bf3e103689efa18bca2ab70203e71cde34b52 | refs/heads/master | 2022-05-22T07:44:42.234768 | 2016-02-19T17:18:59 | 2016-02-19T17:18:59 | 189,935,865 | 0 | 0 | Apache-2.0 | 2022-05-01T14:23:59 | 2019-06-03T04:46:55 | Java | UTF-8 | Java | false | false | 1,520 | java | /*
* Copyright 2014 Goldman Sachs.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.gs.collections.impl.block.procedure;
import com.gs.collections.impl.test.Verify;
import org.junit.Test;
public class AtomicCountProcedureSerializationTest
{
@Test
public void serializedForm()
{
Verify.assertSerializedForm(
1L,
"rO0ABXNyADxjb20uZ3MuY29sbGVjdGlvbnMuaW1wbC5ibG9jay5wcm9jZWR1cmUuQXRvbWljQ291\n"
+ "bnRQcm9jZWR1cmUAAAAAAAAAAQIAAkwABWNvdW50dAArTGphdmEvdXRpbC9jb25jdXJyZW50L2F0\n"
+ "b21pYy9BdG9taWNJbnRlZ2VyO0wACXByZWRpY2F0ZXQAMkxjb20vZ3MvY29sbGVjdGlvbnMvYXBp\n"
+ "L2Jsb2NrL3ByZWRpY2F0ZS9QcmVkaWNhdGU7eHBzcgApamF2YS51dGlsLmNvbmN1cnJlbnQuYXRv\n"
+ "bWljLkF0b21pY0ludGVnZXJWP17MjGwWigIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKG\n"
+ "rJUdC5TgiwIAAHhwAAAAAHA=",
new AtomicCountProcedure<Object>(null));
}
}
| [
"craig.motlin@gs.com"
] | craig.motlin@gs.com |
5768bf8594054e2945399e86b621025cff77f9f5 | ab5b571f38ae6911c22d75c4bd4c807b4ad77d8d | /azure-service-bus/src/main/java/com/glqdlt/ex/servicebusexample/topic/EventIdentity.java | 7c769243e2ea3fce53424648161785847b2f668e | [] | no_license | glqdlt/ex-service-bus | 37b3dd47c97a6198b1b469bdae6b9ad32da80843 | b576f5d1e5563b12aee6e5bcf5dedc7b9bfe4ea5 | refs/heads/master | 2023-05-23T07:12:36.670451 | 2021-06-10T07:09:58 | 2021-06-10T07:36:37 | 370,629,123 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 158 | java | package com.glqdlt.ex.servicebusexample.topic;
public interface EventIdentity {
String getId();
String getDescription();
String getWriter();
}
| [
"dlfdnd0725@gmail.com"
] | dlfdnd0725@gmail.com |
03a940fc711a40aee4a38b0a09db66244fc15726 | 4b0bf4787e89bcae7e4759bde6d7f3ab2c81f849 | /aliyun-java-sdk-vcs/src/main/java/com/aliyuncs/vcs/transform/v20200515/UnbindCorpGroupResponseUnmarshaller.java | 59cc51d53c709101a6b1c5790d4b810ed59b5ca9 | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-java-sdk | a263fa08e261f12d45586d1b3ad8a6609bba0e91 | e19239808ad2298d32dda77db29a6d809e4f7add | refs/heads/master | 2023-09-03T12:28:09.765286 | 2023-09-01T09:03:00 | 2023-09-01T09:03:00 | 39,555,898 | 1,542 | 1,317 | NOASSERTION | 2023-09-14T07:27:05 | 2015-07-23T08:41:13 | Java | UTF-8 | Java | false | false | 1,316 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.vcs.transform.v20200515;
import com.aliyuncs.vcs.model.v20200515.UnbindCorpGroupResponse;
import com.aliyuncs.transform.UnmarshallerContext;
public class UnbindCorpGroupResponseUnmarshaller {
public static UnbindCorpGroupResponse unmarshall(UnbindCorpGroupResponse unbindCorpGroupResponse, UnmarshallerContext _ctx) {
unbindCorpGroupResponse.setRequestId(_ctx.stringValue("UnbindCorpGroupResponse.RequestId"));
unbindCorpGroupResponse.setMessage(_ctx.stringValue("UnbindCorpGroupResponse.Message"));
unbindCorpGroupResponse.setCode(_ctx.stringValue("UnbindCorpGroupResponse.Code"));
unbindCorpGroupResponse.setSuccess(_ctx.booleanValue("UnbindCorpGroupResponse.Success"));
return unbindCorpGroupResponse;
}
} | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
171d0243149bac1f33c4530fdb1d6c771c52c72c | 139960e2d7d55e71c15e6a63acb6609e142a2ace | /mobile_app1/module646/src/main/java/module646packageJava0/Foo59.java | cb750ee5ab0ec1b2751b161da84955096e55956a | [
"Apache-2.0"
] | permissive | uber-common/android-build-eval | 448bfe141b6911ad8a99268378c75217d431766f | 7723bfd0b9b1056892cef1fef02314b435b086f2 | refs/heads/master | 2023-02-18T22:25:15.121902 | 2023-02-06T19:35:34 | 2023-02-06T19:35:34 | 294,831,672 | 83 | 7 | Apache-2.0 | 2021-09-24T08:55:30 | 2020-09-11T23:27:37 | Java | UTF-8 | Java | false | false | 1,356 | java | package module646packageJava0;
import java.lang.Integer;
public class Foo59 {
Integer int0;
Integer int1;
Integer int2;
Integer int3;
Integer int4;
public void foo0() {
new module646packageJava0.Foo58().foo27();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
public void foo6() {
foo5();
}
public void foo7() {
foo6();
}
public void foo8() {
foo7();
}
public void foo9() {
foo8();
}
public void foo10() {
foo9();
}
public void foo11() {
foo10();
}
public void foo12() {
foo11();
}
public void foo13() {
foo12();
}
public void foo14() {
foo13();
}
public void foo15() {
foo14();
}
public void foo16() {
foo15();
}
public void foo17() {
foo16();
}
public void foo18() {
foo17();
}
public void foo19() {
foo18();
}
public void foo20() {
foo19();
}
public void foo21() {
foo20();
}
public void foo22() {
foo21();
}
public void foo23() {
foo22();
}
public void foo24() {
foo23();
}
public void foo25() {
foo24();
}
public void foo26() {
foo25();
}
public void foo27() {
foo26();
}
}
| [
"oliviern@uber.com"
] | oliviern@uber.com |
bc0a3ddc54281ebc3b9f606d3590f2868ba40485 | b40e4055d50d36f307bf2a800b12d377917f4f8e | /src/main/java/com/shengsiyuan/demo6_protobuf/TestClient.java | df2c8a34e6ff260ca724c207ccb3b4326bacc78a | [] | no_license | quyixiao/netty_lecture | c795177acc57b73b9bff232d825f40ea0c234043 | 681cf3beb79dd7241ef1fa28f8c230c013aeac99 | refs/heads/master | 2021-02-12T07:42:02.267157 | 2020-03-16T12:45:54 | 2020-03-16T12:45:54 | 244,574,476 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 848 | java | package com.shengsiyuan.demo6_protobuf;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.ChannelFuture;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioSocketChannel;
public class TestClient {
public static void main(String[] args) throws Exception {
EventLoopGroup eventLoopGroup = new NioEventLoopGroup();
try {
Bootstrap bootstrap = new Bootstrap();
bootstrap.group(eventLoopGroup).channel(NioSocketChannel.class).
handler(new TestClientInitializer());
ChannelFuture channelFuture = bootstrap.connect("localhost", 8899).sync();
channelFuture.channel().closeFuture().sync();
} finally {
eventLoopGroup.shutdownGracefully();
}
}
}
| [
"2621048238@qq.com"
] | 2621048238@qq.com |
5148e3af76becde14666dc4b37e9a9eca7a7fe5d | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/mockito/2016/4/JUnitRuleTest.java | 88c75e243837aa26157d2c780de8a4e97d1fbdc3 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 5,606 | java | package org.mockito.internal.junit;
import org.junit.Test;
import org.junit.runners.model.Statement;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.mockito.exceptions.misusing.UnfinishedStubbingException;
import org.mockito.internal.util.SimpleMockitoLogger;
import org.mockitousage.IMethods;
import static org.junit.Assert.*;
public class JUnitRuleTest {
private SimpleMockitoLogger logger = new SimpleMockitoLogger();
private JUnitRule jUnitRule = new JUnitRule(logger);
private InjectTestCase injectTestCase = new InjectTestCase();
@Test
public void shouldInjectIntoTestCase() throws Throwable {
jUnitRule.apply(new DummyStatement(), injectTestCase).evaluate();
assertNotNull("@Mock mock object created", injectTestCase.getInjected());
assertNotNull("@InjectMocks object created", injectTestCase.getInjectInto());
assertNotNull("Mock injected into the object", injectTestCase.getInjectInto().getInjected());
}
@Test
public void shouldRethrowException() throws Throwable {
try {
jUnitRule.apply(new ExceptionStatement(), injectTestCase).evaluate();
fail("Should throw exception");
} catch (RuntimeException e) {
assertEquals("Correct message", "Statement exception", e.getMessage());
}
}
@Test
public void shouldDetectUnfinishedStubbing() throws Throwable {
try {
jUnitRule.apply(new UnfinishedStubbingStatement(), injectTestCase).evaluate();
fail("Should detect invalid Mockito usage");
} catch (UnfinishedStubbingException e) {
}
}
@Test
public void shouldWarnAboutUnusedStubsWhenFailed() throws Throwable {
try {
jUnitRule.apply(new Statement() {
public void evaluate() throws Throwable {
IMethods mock = Mockito.mock(IMethods.class);
declareUnusedStub(mock);
throw new AssertionError("x");
}
}, injectTestCase).evaluate();
fail();
} catch (AssertionError e) {
assertEquals("x", e.getMessage());
assertEquals(removeLineNo(logger.getLoggedInfo()), removeLineNo(
"[Mockito] Additional stubbing information (see javadoc for StubbingInfo class):\n" +
"[Mockito]\n" +
"[Mockito] Unused stubbing (perhaps can be removed from the test?):\n" +
"[Mockito]\n" +
"[Mockito] 1. -> at org.mockito.internal.junit.JUnitRuleTest.declareUnusedStub(JUnitRuleTest.java:82)")
);
}
}
private String removeLineNo(String text) {
//This handy method is useful for making the tests stable
//we can change this class and the assertions will still work correctly
//otherwise, changing the class will change line numbers and some assertons would fail
String name = this.getClass().getSimpleName();
return text.replaceAll(name + "\\.java:(\\d)+", name + ".java:100");
}
@Test
public void can_remove_line_numbers() throws Throwable {
assertEquals(
"[Mockito] 1. -> at org.mockito.internal.junit.JUnitRuleTest.declareUnusedStub(JUnitRuleTest.java:100)",
removeLineNo("[Mockito] 1. -> at org.mockito.internal.junit.JUnitRuleTest.declareUnusedStub(JUnitRuleTest.java:82)"));
}
@Test
public void shouldNotWarnAboutUnusedStubsWhenPassed() throws Throwable {
jUnitRule.apply(new Statement() {
public void evaluate() throws Throwable {
IMethods mock = Mockito.mock(IMethods.class);
declareUnusedStub(mock);
}
}, injectTestCase).evaluate();
assertEquals("", logger.getLoggedInfo());
}
private static void declareUnusedStub(IMethods mock) {
Mockito.when(mock.simpleMethod("foo")).thenReturn("bar");
}
private static class DummyStatement extends Statement {
@Override
public void evaluate() throws Throwable {
}
}
private static class ExceptionStatement extends Statement {
@Override
public void evaluate() throws Throwable {
throw new RuntimeException("Statement exception");
}
}
private static class UnfinishedStubbingStatement extends Statement {
@Override
public void evaluate() throws Throwable {
InjectTestCase injectTestCase = new InjectTestCase();
MockitoAnnotations.initMocks(injectTestCase);
injectTestCase.unfinishedStubbingThrowsException();
}
}
public static class InjectTestCase {
@Mock
private Injected injected;
@InjectMocks
private InjectInto injectInto;
@Test
public void dummy() throws Exception {
}
public void unfinishedStubbingThrowsException() throws Exception {
Mockito.when(injected.stringMethod());
}
public Injected getInjected() {
return injected;
}
public InjectInto getInjectInto() {
return injectInto;
}
public static class Injected {
public String stringMethod() {
return "string";
}
}
public static class InjectInto {
private Injected injected;
public Injected getInjected() {
return injected;
}
}
}
} | [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
10fe16acec2d492a73be309ea7348e19a2122eed | f609cb34b3538f6dac07d2d8144ce45b14ca8ac2 | /src/coding/temp/_0351_Android_Unlock_Patterns.java | 2546f98da2be0638a9ad96820abbf2711aeef586 | [] | no_license | sahilmutreja/Algorithms | ca8f6f59039b01ea2c0ea7f7f6e51de7e9982141 | a24f6e73c1ad4c863c67e957fcba781c4953ac80 | refs/heads/master | 2023-02-10T08:00:13.729659 | 2021-01-04T08:02:12 | 2021-01-04T08:02:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,304 | java | /**
* @author: Yunxiang He
* @date : 2018-06-27
*/
package coding.temp;
/*
Given an Android 3x3 key lock screen and two integers m and n, where 1 ≤ m ≤ n ≤ 9, count the total number of unlock patterns of the Android lock screen,
which consist of minimum of m keys and maximum n keys.
Rules for a valid pattern:
Each pattern must connect at least m keys and at most n keys.
All the keys must be distinct.
If the line connecting two consecutive keys in the pattern passes through any other keys, the other keys must have previously selected in the pattern.
No jumps through non selected key is allowed.
The order of keys used matters.
Explanation:
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |
Invalid move: 4 - 1 - 3 - 6
Line 1 - 3 passes through key 2 which had not been selected in the pattern.
Invalid move: 4 - 1 - 9 - 2
Line 1 - 9 passes through key 5 which had not been selected in the pattern.
Valid move: 2 - 4 - 1 - 3 - 6
Line 1 - 3 is valid because it passes through key 2, which had been selected in the pattern
Valid move: 6 - 5 - 4 - 1 - 9 - 2
Line 1 - 9 is valid because it passes through key 5, which had been selected in the pattern.
Example:
Given m = 1, n = 1, return 9.
*/
public class _0351_Android_Unlock_Patterns {
}
| [
"155028525@qq.com"
] | 155028525@qq.com |
6744cdea3f2b0ee77dd1fc9889f2b3eaf4cb7aba | f048e3e0338af90ee4e9dc237357698813c790a8 | /NovateHttp/src/main/java/com/ddy/novatehttp/http/gsoncover/CustomGsonConverterFactory.java | 71c6aa63d1b4d2b5774b0a7f5e4d59158a2a2eeb | [] | no_license | dengdaoyus/NovateHttp | 2295365ba54d64aaf50b082907c2d432c707a5fa | 192820215a085625a949a5bb347fd5e37f892300 | refs/heads/master | 2021-01-21T08:02:20.649267 | 2017-11-15T09:35:39 | 2017-11-15T09:35:39 | 101,951,785 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,470 | java | package com.ddy.novatehttp.http.gsoncover;
import com.google.gson.Gson;
import com.google.gson.TypeAdapter;
import com.google.gson.reflect.TypeToken;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Converter;
import retrofit2.Retrofit;
/**
* Created by Administrator on 2017/6/23 0023.
*/
public class CustomGsonConverterFactory extends Converter.Factory {
private final Gson gson;
private CustomGsonConverterFactory(Gson gson) {
if (gson == null) throw new NullPointerException("gson == null");
this.gson = gson;
}
public static CustomGsonConverterFactory create() {
return create(new Gson());
}
public static CustomGsonConverterFactory create(Gson gson) {
return new CustomGsonConverterFactory(gson);
}
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) {
TypeAdapter<?> adapter = gson.getAdapter(TypeToken.get(type));
return new CustomGsonResponseBodyConverter<>(gson, adapter);
}
@Override
public Converter<?, RequestBody> requestBodyConverter(Type type, Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) {
TypeAdapter<?> adapter = gson.getAdapter(TypeToken.get(type));
return new CustomGsonRequestBodyConverter<>(gson, adapter);
}
} | [
"980322048@qq.com"
] | 980322048@qq.com |
8df09432ffda36d191703d14196d91d5a32eb68c | e4aea93f2988e2cf1be4f96a39f6cc3328cbbd50 | /src/com/flagleader/repository/rlm/condition/RuleLogConditionToken.java | 1d70fe382b85d23d05b3b236153016340210259b | [] | no_license | lannerate/ruleBuilder | 18116282ae55e9d56e9eb45d483520f90db4a1a6 | b5d87495990aa1988adf026366e92f7cbb579b19 | refs/heads/master | 2016-09-05T09:13:43.879603 | 2013-11-10T08:32:58 | 2013-11-10T08:32:58 | 14,231,127 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,066 | java | package com.flagleader.repository.rlm.condition;
import com.flagleader.repository.IElement;
import com.flagleader.repository.rlm.ModifyToken;
import com.flagleader.repository.tree.IPackageElement;
import com.flagleader.repository.tree.IRuleContainer;
import java.util.List;
public class RuleLogConditionToken extends MultiConditionToken
implements IRuleContainer
{
protected ConditionToken d()
{
LogConditionToken localLogConditionToken = new LogConditionToken();
localLogConditionToken.init();
addChildElement(localLogConditionToken);
return localLogConditionToken;
}
public RuleLogConditionToken()
{
}
public RuleLogConditionToken(int paramInt)
{
super(paramInt);
}
public RuleLogConditionToken(RuleLogConditionToken paramRuleLogConditionToken)
{
super(paramRuleLogConditionToken);
}
public boolean pasteElement(IElement paramIElement)
{
return super.pasteElement(paramIElement);
}
public void addChildElement(IElement paramIElement)
{
if ((paramIElement instanceof ConditionToken))
{
int i = a().size();
for (int j = 0; j < i; j++)
{
if ((!(a().get(j) instanceof ConditionToken)) || (!((ConditionToken)a().get(j)).getUuid().equals(paramIElement.getUuid())))
continue;
paramIElement.setUuid(null);
}
}
super.addChildElement(paramIElement);
}
public IElement deepClone()
{
return new RuleLogConditionToken(this);
}
protected ConditionToken e()
{
LogConditionToken localLogConditionToken = new LogConditionToken();
localLogConditionToken.init();
addChildElement(localLogConditionToken);
return localLogConditionToken;
}
public ModifyToken getConditionModifyToken()
{
if (this.a == null)
setConditionModifyToken(new RuleLogConditionToken.AppendToken(this, "&addCondition", new r(this)));
return this.a;
}
public String getName()
{
return "RuleLogConditionToken";
}
public IRuleContainer getRoot()
{
return this;
}
public IPackageElement getRuleTree()
{
if ((getParent() instanceof IPackageElement))
return (IPackageElement)getParent();
return null;
}
public boolean isChangeLine(String paramString)
{
return false;
}
public boolean isEmpty()
{
return getConditionList().size() == 0;
}
public boolean paste(IElement paramIElement)
{
return super.pasteElement(paramIElement);
}
public void setModified(boolean paramBoolean)
{
if ((paramBoolean) && (getRuleTree() != null))
getRuleTree().setModified(paramBoolean);
}
public String getNote()
{
return getText();
}
public void setNeedSave()
{
if (getRuleTree() != null)
getRuleTree().setNeedSave();
}
}
/* Location: D:\Dev_tools\ruleEngine\rbuilder.jar
* Qualified Name: com.flagleader.repository.rlm.condition.RuleLogConditionToken
* JD-Core Version: 0.6.0
*/ | [
"zhanghuizaizheli@hotmail.com"
] | zhanghuizaizheli@hotmail.com |
8053ab3e6ebb26436503c9122db09d1aee228b69 | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /P9-8.0/src/main/java/sun/nio/fs/LinuxFileSystem.java | ebea0030dceb402fff25a02aed8ae3d914becaa6 | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,464 | java | package sun.nio.fs;
import java.io.IOException;
import java.nio.file.FileStore;
import java.nio.file.WatchService;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
class LinuxFileSystem extends UnixFileSystem {
private static class SupportedFileFileAttributeViewsHolder {
static final Set<String> supportedFileAttributeViews = supportedFileAttributeViews();
private SupportedFileFileAttributeViewsHolder() {
}
private static Set<String> supportedFileAttributeViews() {
Set<String> result = new HashSet();
result.addAll(UnixFileSystem.standardFileAttributeViews());
result.-java_util_stream_Collectors-mthref-4("dos");
result.-java_util_stream_Collectors-mthref-4("user");
return Collections.unmodifiableSet(result);
}
}
LinuxFileSystem(UnixFileSystemProvider provider, String dir) {
super(provider, dir);
}
public WatchService newWatchService() throws IOException {
return new LinuxWatchService(this);
}
public Set<String> supportedFileAttributeViews() {
return SupportedFileFileAttributeViewsHolder.supportedFileAttributeViews;
}
void copyNonPosixAttributes(int ofd, int nfd) {
LinuxUserDefinedFileAttributeView.copyExtendedAttributes(ofd, nfd);
}
/* JADX WARNING: Missing block: B:7:?, code:
sun.nio.fs.LinuxNativeDispatcher.endmntent(r2);
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
Iterable<UnixMountEntry> getMountEntries(String fstab) {
ArrayList<UnixMountEntry> entries = new ArrayList();
long fp;
try {
fp = LinuxNativeDispatcher.setmntent(Util.toBytes(fstab), Util.toBytes("r"));
while (true) {
UnixMountEntry entry = new UnixMountEntry();
if (LinuxNativeDispatcher.getmntent(fp, entry) < 0) {
break;
}
entries.add(entry);
}
} catch (UnixException e) {
} catch (Throwable th) {
LinuxNativeDispatcher.endmntent(fp);
}
return entries;
}
Iterable<UnixMountEntry> getMountEntries() {
return getMountEntries("/proc/mounts");
}
FileStore getFileStore(UnixMountEntry entry) throws IOException {
return new LinuxFileStore(this, entry);
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
3d88ca2c2f2909c913b7fa7f9985fda0e07d6150 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project39/src/test/java/org/gradle/test/performance39_3/Test39_251.java | 5b5715ab794c7228547af17ba0fb46240cfe28ee | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance39_3;
import static org.junit.Assert.*;
public class Test39_251 {
private final Production39_251 production = new Production39_251("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
6a7b093eb07ebdd73bd0ea5d57c996eedbcfef5d | d450b62e0cebfcfc592350192cd424009c347733 | /jOOQ-mp/output/hsqldb/src/main/java/org/jooq/mp/hsqldb/test/tables/records/T65812Record.java | 36095a8fd5c9299e13b56adbb5067483882a98a7 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | rtincar/jOOQ | 9ccec69ff0d4af5217829413c1132a0d08acded8 | d0304fdfa77c0a8fd79614f7ff72b558783ec6a8 | refs/heads/master | 2020-12-25T11:21:22.173304 | 2012-03-01T16:32:48 | 2012-03-01T16:32:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,537 | java |
/**
* This class is generated by minuteproject 4 jOOQ
*/
package org.jooq.mp.hsqldb.test.tables.records;
import org.jooq.impl.UpdatableRecordImpl;
import org.jooq.mp.hsqldb.test.tables.T65812;
import org.jooq.mp.hsqldb.test.Test;
import org.jooq.mp.hsqldb.test.Keys;
import java.sql.*;
//MP-MANAGED-ADDED-AREA-BEGINNING @import@
//MP-MANAGED-ADDED-AREA-ENDING @import@
//MP-MANAGED-ADDED-AREA-BEGINNING @class-annotation@
//MP-MANAGED-ADDED-AREA-ENDING @class-annotation@
@javax.annotation.Generated(value = {"http://www.jooq.org", "2.0.4"},
comments = "This class is generated by minuteproject 4 jOOQ")
public class T65812Record extends UpdatableRecordImpl<org.jooq.mp.hsqldb.test.tables.records.T65812Record> {
private static final long serialVersionUID = 123456789;
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @jooq-record-pk-test@
/**
* An uncommented item
*
* PRIMARY KEY
*/
public void setId(java.lang.String value) {
setValue(org.jooq.mp.hsqldb.test.tables.T65812.__T_658_12.ID, value);
}
/**
* An uncommented item
*
* PRIMARY KEY
*/
public java.lang.String getId() {
return getValue(org.jooq.mp.hsqldb.test.tables.T65812.__T_658_12.ID);
}
//MP-MANAGED-UPDATABLE-ENDING
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @jooq-record-child-T658Refs-test@
/**
* An uncommented item
*
*/
public java.util.List<org.jooq.mp.hsqldb.test.tables.records.T658RefRecord> fetchT658RefsList() {
return create()
.selectFrom(org.jooq.mp.hsqldb.test.tables.T658Ref.__T_658_REF)
.where(org.jooq.mp.hsqldb.test.tables.T658Ref.__T_658_REF.REF_12.equal(getValue(org.jooq.mp.hsqldb.test.tables.T65812.__T_658_12.ID)))
.fetch();
}
//MP-MANAGED-UPDATABLE-ENDING
//many2many
//MP-MANAGED-UPDATABLE-BEGINNING-DISABLE @jooq-record-attribute-org.jooq.mp.hsqldb.test.tables.T65812.__T_658_12.CD-test@
/**
* mapping CD setter
*/
public void setCd(java.lang.String value) {
setValue(org.jooq.mp.hsqldb.test.tables.T65812.__T_658_12.CD, value);
}
/**
* mapping CD getter
*/
public java.lang.String getCd() {
return getValue(org.jooq.mp.hsqldb.test.tables.T65812.__T_658_12.CD);
}
//MP-MANAGED-UPDATABLE-ENDING
/**
* Create a detached T65812Record
*/
public T65812Record() {
super(org.jooq.mp.hsqldb.test.tables.T65812.__T_658_12);
}
//MP-MANAGED-ADDED-AREA-BEGINNING @implementation@
//MP-MANAGED-ADDED-AREA-ENDING @implementation@
}
| [
"lukas.eder@gmail.com"
] | lukas.eder@gmail.com |
bc6059f436018759d26631ec3ae4f07e01a72ae4 | e461611c69fe9187a8e44609df182dd00d8f5875 | /algorithm/src/newcode_jianzhiOffer/Demo16.java | d5b076b76195775a6daab61ec649f5730ea76186 | [] | no_license | songjiawang/myCoding | a704d8b94733f3591eb4150ff8658a17e0165cc0 | fa31efcba4816ca5b079a9dcff30c3f98dfad3e7 | refs/heads/master | 2020-03-29T01:01:05.200374 | 2018-09-19T00:08:47 | 2018-09-19T00:08:47 | 149,367,114 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,181 | java | package newcode_jianzhiOffer;
/*
* 输入两个单调递增的链表,输出两个链表合成后的链表,当然我们需要合成后的链表满足单调不减规则。
*/
public class Demo16 {
public ListNode Merge(ListNode list1,ListNode list2) {
if(list1==null)return list2;
if(list2==null)return list1;
ListNode tmp1= new ListNode(0);
tmp1.next = list1;
ListNode tmp2= new ListNode(0);
tmp2.next = list2;
ListNode min = new ListNode(0);
ListNode tmp3= min;
tmp2.next = list2;
while(tmp1.next!=null || tmp2.next!=null){
if(tmp1.next==null){
tmp3.next=tmp2.next;
return min.next;
}
if(tmp2.next==null){
tmp3.next=tmp1.next;
return min.next;
}
if(tmp1.next.val>tmp2.next.val){
tmp3.next = new ListNode(tmp2.next.val);
tmp3=tmp3.next;
tmp2=tmp2.next;
}else{
tmp3.next = new ListNode(tmp1.next.val);
tmp3=tmp3.next;
tmp1=tmp1.next;
}
}
return min.next;
}
public ListNode Merge2(ListNode list1,ListNode list2) {
if(list2==null)return list1;
if(list1==null)return list2;
ListNode head = null;
if(list1.val<list2.val){
head = list1;
head.next = Merge2(list1.next,list2);
}else{
head = list2;
head.next = Merge2(list1,list2.next);
}
return head;
}
public ListNode Merge3(ListNode list1,ListNode list2) {
if(list2==null)return list1;
if(list1==null)return list2;
ListNode head = new ListNode(0);
ListNode tmp = head;
ListNode index1 = list1;
ListNode index2 = list2;
while(index1!=null && index2!=null){
if(index1.val>index2.val){
head.next=index2;
index2 = index2.next;
head = head.next;
}else{
head.next = index1;
index1 = index1.next;
head = head.next;
}
}
if(index1!=null){
head.next = index1;
}else if(index2!=null){
head.next = index2;
}
return tmp.next;
}
}
| [
"33470505+songjiawang@users.noreply.github.com"
] | 33470505+songjiawang@users.noreply.github.com |
ce4dee879240a958713bc89f62f80285533dae8a | cf2ca24953a6003d31faa30cc647835db7058769 | /hbm/be/src/test/java/com/hginfo/hbm/be/validator/NotSpacesValidator.java | 6c50a9d2a131f2fb16057aa309bb349f5d0c94ba | [] | no_license | 18luohann/TESTHBM | 6da94c2c57b269abf87f4db284e29a13e66fe767 | 1603cd10b2887bdcff2046cefba243618530a17b | refs/heads/master | 2020-05-16T23:59:21.349969 | 2019-04-25T07:50:02 | 2019-04-25T07:50:02 | 183,385,236 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 620 | java | package com.hginfo.hbm.be.validator;
import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
/**
* 自定义validator校验是否有空格
* @author shichengqun
*
*/
public class NotSpacesValidator implements ConstraintValidator<NotSpaces, String>{
/**
* 初始参数,可获取其中的值
*/
public void initialize(NotSpaces constraintAnnotation) {
}
@Override
public boolean isValid(String value, ConstraintValidatorContext context) {
if(value != null && value.indexOf(" ") > 0){
return false;
}
return true;
}
}
| [
"874449766@qq.com"
] | 874449766@qq.com |
37d3dff917def1bb25505747208f152a86462567 | e0b9cd8646ad93f201b065885e8bb8ce614deebd | /src/dk/brics/tajs/analysis/nativeobjects/concrete/ConcreteNullOrUndefined.java | b2329c807c39f17a01e8233bc89a4fc753109ecc | [
"Apache-2.0"
] | permissive | enchaowu/TAJS | 5555cc18defc5b21d58081767d0a9a55d5f953a8 | ebbba0c60121a711736029cca20fa2134908a1ce | refs/heads/master | 2022-11-16T15:58:47.730083 | 2020-06-23T21:22:09 | 2020-06-23T21:27:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,185 | java | /*
* Copyright 2009-2020 Aarhus University
*
* 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 dk.brics.tajs.analysis.nativeobjects.concrete;
public class ConcreteNullOrUndefined implements PrimitiveConcreteValue {
@Override
public String toSourceCode() {
return "<null|undefined>";
}
@Override
public <T> T accept(ConcreteValueVisitor<T> v) {
return v.visit(this);
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
return true;
}
@Override
public int hashCode() {
return 0;
}
}
| [
"amoeller@cs.au.dk"
] | amoeller@cs.au.dk |
844b77c7e301c474a6416fdb246830b8c92b34c7 | 83c38b307e241eb18ddc0455cf42b8cb1491fe02 | /app/src/main/java/com/zhuye/ershoufang/data/GetData.java | 2682b49927f8d548f3f44910335c381fea2a2d6e | [] | no_license | hsdzqs1992/fangzi | c73adc32576aec889a9ccaf496551b35eed03bcd | 8633695601ebbb277942ddcbc74024549445aa85 | refs/heads/master | 2020-03-13T20:48:06.730844 | 2018-06-01T11:37:00 | 2018-06-01T11:37:00 | 131,282,028 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,458 | java | package com.zhuye.ershoufang.data;
import com.zhuye.ershoufang.bean.Base;
import java.io.File;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* Created by Administrator on 2018/3/27 0027.
*/
public class GetData {
// public static void getCode(String mobile,BaseView baseView,int requestcode){
// CommonApi.getInstance().getCode(mobile).subscribeOn(Schedulers.newThread())
// .observeOn(AndroidSchedulers.mainThread()).subscribe(new MyObserver<Base>(baseView,requestcode) {
// @Override
// public void onNext(Base base) {
// if (base.getCode()==200){
// baseView.success(requestcode,base);
// }else {
// baseView.error(base);
// }
// baseView.finishLoding();
// }
// });
// }
//
// public static void getCode2(String mobile,BaseView baseView,int requestcode){
// // TODO: 2018/3/27 0027 线程切换的代码 多余 操作符
// CommonApi.getInstance().getCode(mobile).subscribeOn(Schedulers.newThread())
// .observeOn(AndroidSchedulers.mainThread()).subscribe(new MyObserver<Base>(baseView,requestcode) {
// });
// }
// 公共处理方法
public static void sub(Observable observable,BaseView baseView, int requestcode){
observable.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread()).subscribe(new MyObserver<Base>(baseView,requestcode));
}
public static void getCode3(String mobile, BaseView baseView, int requestcode){
// TODO: 2018/3/27 0027 线程切换的代码 多余 操作符 流式操作 四步可能会多一点
// 装饰一下
GetData.sub(CommonApi.getInstance().getCode(mobile),baseView,requestcode);
// return this;
}
public static void getRegeister(String mobile , String password, String zpassword, String code ,int type, BaseView baseView,int requestcode){
// TODO: 2018/3/27 0027 线程切换的代码 多余 操作符 流式操作 四步可能会多一点
GetData.sub(CommonApi.getInstance().getRegeister(mobile,password,zpassword,code,type),baseView,requestcode);
}
public static void upimg(String token , File filepath, BaseView baseView, int requestcode){
CommonApi.getInstance().upimg(token,filepath).subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread()).subscribe(new MyObserver<Base>(baseView,requestcode));
}
public static void user_data(String token,String true_name,String card
, String card_img,int main_business,String scope_work,String license,String city_id,String shop, BaseView baseView, int requestcode){
CommonApi.getInstance().user_data(token,true_name,card,card_img,main_business,scope_work,license,city_id,shop).subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread()).subscribe(new MyObserver<Base>(baseView,requestcode));
}
public static void login(String mobile, String password, BaseView baseView,int requestcode){
// TODO: 2018/3/27 0027 线程切换的代码 多余 操作符 流式操作 四步可能会多一点
GetData.sub(CommonApi.getInstance().login(mobile,password),baseView,requestcode);
}
}
| [
"619593527@qq.com"
] | 619593527@qq.com |
b0c433d6e5e1cf834d71c41f1590a9461a05236f | 8553367f97586cfb9e878fcaffe7a11b912dbc96 | /jdk-source/jdk1.8/src/main/java/org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java | 4cafd145719a7ff9de88e07a29a13cf19d7b2f6f | [] | no_license | GoldWater16/GoldWater | 92abb6b4f2e448469408771d8aad96a9b412aa0a | 8180d5689c8059c0fe9fbbe2770e8f6947d35c73 | refs/heads/master | 2023-07-20T12:30:06.481550 | 2022-05-21T15:27:09 | 2022-05-21T15:27:09 | 174,562,633 | 2 | 3 | null | 2023-07-13T17:02:44 | 2019-03-08T15:36:04 | Java | UTF-8 | Java | false | false | 2,409 | java | package org.omg.PortableInterceptor;
/**
* org/omg/PortableInterceptor/ObjectReferenceFactoryHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from c:/re/workspace/8-2-build-windows-amd64-cygwin/jdk8u60/4407/corba/src/share/classes/org/omg/PortableInterceptor/Interceptors.idl
* Tuesday, August 4, 2015 11:07:53 AM PDT
*/
/** The object reference factory. This provides the capability of
* creating an object reference.
*/
abstract public class ObjectReferenceFactoryHelper
{
private static String _id = "IDL:omg.org/PortableInterceptor/ObjectReferenceFactory:1.0";
public static void insert (org.omg.CORBA.Any a, org.omg.PortableInterceptor.ObjectReferenceFactory that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static org.omg.PortableInterceptor.ObjectReferenceFactory extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
private static boolean __active = false;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
synchronized (org.omg.CORBA.TypeCode.class)
{
if (__typeCode == null)
{
if (__active)
{
return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
}
__active = true;
org.omg.CORBA.ValueMember[] _members0 = new org.omg.CORBA.ValueMember[0];
org.omg.CORBA.TypeCode _tcOf_members0 = null;
__typeCode = org.omg.CORBA.ORB.init ().create_value_tc (_id, "ObjectReferenceFactory", org.omg.CORBA.VM_ABSTRACT.value, null, _members0);
__active = false;
}
}
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static org.omg.PortableInterceptor.ObjectReferenceFactory read (org.omg.CORBA.portable.InputStream istream)
{
return (org.omg.PortableInterceptor.ObjectReferenceFactory)((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (id ());
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.PortableInterceptor.ObjectReferenceFactory value)
{
((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, id ());
}
}
| [
"huzewu@lecloudpay.com"
] | huzewu@lecloudpay.com |
30b8e45d5470d759f38d2b88d7366f091defca9b | b1cd026dd89e46949b905f480bc05e33b230698b | /src/org/openrtk/idl/epp02/host/epp_HostCheckRsp.java | 762f8a3a3fdbe6fdea17802bb290d7905ccbe9e5 | [] | no_license | davidlighty/EPPLibrary | 4b0f508764768c5e6ded623638cc6fc5ac459476 | db715f29cf4ad75eb8436128f0c0b4e6c8f879e3 | refs/heads/master | 2021-01-25T10:44:11.809621 | 2013-09-19T15:34:14 | 2013-09-19T15:34:14 | 12,819,957 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,193 | java | package org.openrtk.idl.epp02.host;
/**
* org/openrtk/idl/epp/host/epp_HostCheckRsp.java
* Generated by the IDL-to-Java compiler (portable), version "3.0"
* from epp_host.idl
* Thursday, July 26, 2001 6:26:10 PM EDT
*/
public class epp_HostCheckRsp implements org.omg.CORBA.portable.IDLEntity
{
public org.openrtk.idl.epp02.epp_Response m_rsp = null;
public org.openrtk.idl.epp02.epp_CheckResult m_results[] = null;
public epp_HostCheckRsp ()
{
} // ctor
public epp_HostCheckRsp (org.openrtk.idl.epp02.epp_Response _m_rsp, org.openrtk.idl.epp02.epp_CheckResult[] _m_results)
{
m_rsp = _m_rsp;
m_results = _m_results;
} // ctor
public void setRsp(org.openrtk.idl.epp02.epp_Response value) { m_rsp = value; }
public org.openrtk.idl.epp02.epp_Response getRsp() { return m_rsp; }
public void setResults(org.openrtk.idl.epp02.epp_CheckResult[] value) { m_results = value; }
public org.openrtk.idl.epp02.epp_CheckResult[] getResults() { return m_results; }
public String toString() { return this.getClass().getName() + ": { m_rsp ["+m_rsp+"] m_results ["+(m_results != null ? java.util.Arrays.asList(m_results) : null)+"] }"; }
} // class epp_HostCheckRsp
| [
"david.lighty@gmail.com"
] | david.lighty@gmail.com |
c55adb3fd0014a3f7da4c10e3928af3db199da4c | d4934bd5dd7d5ab6d70ed03992d8af3d235b468d | /src/rush/recursos/gerais/TitleDeBoasVindas.java | 93ccf0c46604537f8a05a589e584be3eace9e991 | [] | no_license | Animexpvp/System | 06983be597b49cd5343e244f8fde24bd6680ca16 | e7864d4f1f94e0999b9c3a2ee2119eff4cccd121 | refs/heads/master | 2020-03-21T03:37:24.858434 | 2018-05-15T15:15:12 | 2018-05-15T15:15:12 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 697 | java | package rush.recursos.gerais;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import rush.utils.ConfigManager;
public class TitleDeBoasVindas implements Listener {
@SuppressWarnings("deprecation")
@EventHandler
public void aoEntrar(PlayerJoinEvent e) {
Player p = e.getPlayer();
String nome = p.getName();
p.sendTitle(
ConfigManager.getConfig("settings").getString("Title-De-Boas-Vindas.Titulo").replace("&", "§").replace("%player%", nome),
ConfigManager.getConfig("settings").getString("Title-De-Boas-Vindas.Subtitulo").replace("&", "§").replace("%player%", nome));
}
}
| [
"eduardo-mior@hotmail.com"
] | eduardo-mior@hotmail.com |
845220ab611e6d60d566b5d89d4056af2a8ea294 | 13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3 | /crash-reproduction-new-fitness/results/XRENDERING-422-1-26-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage-opt/org/xwiki/rendering/listener/chaining/EmptyBlockChainingListener_ESTest.java | 82a341e2ad850b885a95781f031ab1336cb163c4 | [
"MIT",
"CC-BY-4.0"
] | permissive | STAMP-project/Botsing-basic-block-coverage-application | 6c1095c6be945adc0be2b63bbec44f0014972793 | 80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da | refs/heads/master | 2022-07-28T23:05:55.253779 | 2022-04-20T13:54:11 | 2022-04-20T13:54:11 | 285,771,370 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,557 | java | /*
* This file was automatically generated by EvoSuite
* Fri Oct 29 15:59:39 UTC 2021
*/
package org.xwiki.rendering.listener.chaining;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.Map;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import org.xwiki.rendering.listener.Format;
import org.xwiki.rendering.listener.Listener;
import org.xwiki.rendering.listener.chaining.ChainingListener;
import org.xwiki.rendering.listener.chaining.EmptyBlockChainingListener;
import org.xwiki.rendering.listener.chaining.ListenerChain;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class EmptyBlockChainingListener_ESTest extends EmptyBlockChainingListener_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
ListenerChain listenerChain0 = mock(ListenerChain.class, new ViolatedAssumptionAnswer());
doReturn((ChainingListener) null).when(listenerChain0).getNextListener(nullable(java.lang.Class.class));
EmptyBlockChainingListener emptyBlockChainingListener0 = new EmptyBlockChainingListener(listenerChain0);
Format format0 = Format.STRIKEDOUT;
Map<String, String> map0 = Listener.EMPTY_PARAMETERS;
// Undeclared exception!
emptyBlockChainingListener0.endFormat(format0, map0);
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
fc1f2e2f7f1290981e0d9c3e0d4a86a07b197e65 | 95379ba98e777550a5e7bf4289bcd4be3c2b08a3 | /java/net/sf/l2j/gameserver/handler/itemhandlers/Elixir.java | 5f31f6f23d831eeac95a3786e7d1803dc86cab4e | [] | no_license | l2brutal/aCis_gameserver | 1311617bd8ce0964135e23d5ac2a24f83023f5fb | 5fa7fe086940343fb4ea726a6d0138c130ddbec7 | refs/heads/master | 2021-01-03T04:10:26.192831 | 2019-03-19T19:44:09 | 2019-03-19T19:44:09 | 239,916,465 | 0 | 1 | null | 2020-02-12T03:12:34 | 2020-02-12T03:12:33 | null | UTF-8 | Java | false | false | 692 | java | package net.sf.l2j.gameserver.handler.itemhandlers;
import net.sf.l2j.gameserver.model.actor.Playable;
import net.sf.l2j.gameserver.model.actor.instance.Player;
import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
import net.sf.l2j.gameserver.network.SystemMessageId;
import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
public class Elixir extends ItemSkills
{
@Override
public void useItem(Playable playable, ItemInstance item, boolean forceUse)
{
if (!(playable instanceof Player))
{
playable.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.ITEM_NOT_FOR_PETS));
return;
}
super.useItem(playable, item, forceUse);
}
} | [
"vicawnolasco@gmail.com"
] | vicawnolasco@gmail.com |
dbbd3a45caf6a83b286f7298cd24cdf1195186a9 | dc7e0d68cf290ce63ee7f12eb1d7d347dbf606d0 | /PublicComponent/src/main/java/com/arialyy/aria/core/loader/IInfoTask.java | ee7da5ef0318b9b2a4d38150b76a169557dc81b6 | [
"Apache-2.0"
] | permissive | Louiswang86/Aria | 5fa5fd75725ff9672e9413a95aecc6b817f9fc74 | 1a04a6d221ac532fbdbe5b64fd994ad4c5f48355 | refs/heads/master | 2022-11-27T18:12:05.976191 | 2020-08-12T00:52:00 | 2020-08-12T00:52:00 | 286,897,946 | 1 | 0 | Apache-2.0 | 2020-08-12T02:36:46 | 2020-08-12T02:36:45 | null | UTF-8 | Java | false | false | 1,323 | java | /*
* Copyright (C) 2016 AriaLyy(https://github.com/AriaLyy/Aria)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.arialyy.aria.core.loader;
import com.arialyy.aria.core.common.AbsEntity;
import com.arialyy.aria.core.common.CompleteInfo;
import com.arialyy.aria.exception.AriaException;
/**
* 任务信息采集
*/
public interface IInfoTask extends ILoaderComponent {
/**
* 执行任务
*/
void run();
/**
* 设置回调
*/
void setCallback(Callback callback);
interface Callback {
/**
* 处理完成
*
* @param info 一些回调的信息
*/
void onSucceed(String key, CompleteInfo info);
/**
* 请求失败
*
* @param e 错误信息
*/
void onFail(AbsEntity entity, AriaException e, boolean needRetry);
}
}
| [
"511455842@qq.com"
] | 511455842@qq.com |
2234e16fa64aafdc739d94d76885535f243c043a | b94b3bfdccaf132e091bd88206169ef701d50456 | /2003/BOA_new/src/com/boa/eagls/government/taglib/pagedList/PreviousButtonTag.java | cd847b5fb7bc0bf1b7e50cf003e99ed2af528a2b | [] | no_license | ildar66/WSAD5_BOA | f6b87c0bbd2db40b410b657e819f99ec40f7c792 | a8a8e3bd80f2660676c6fb0a7d91b483db4840ca | refs/heads/master | 2020-12-02T09:58:51.906254 | 2017-07-09T07:18:34 | 2017-07-09T07:18:34 | 96,667,614 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,707 | java | package com.boa.eagls.government.taglib.pagedList;
import com.boa.eagls.government.exceptions.system.EaglsDAOError;
import com.boa.eagls.government.util.pagedList.ValueListIterator;
import org.apache.log4j.Logger;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
/**
* Tag for rendering previous button in PagedList. It may render nothing if no
* previous records are exist.
* User: OlegK
* Date: 06.07.2003
* @author Oleg Klimenko
*/
public class PreviousButtonTag extends TagSupport {
private static Logger logger = Logger.getLogger(PreviousButtonTag.class);
private String searchParameter;
public String getSearchParameter() {
return searchParameter;
}
public void setSearchParameter(String searchParameter) {
this.searchParameter = searchParameter;
}
/**
* It's a simple tag. So it writes to output during startTag processing.
* It doesn't have a body.
* @return <code>SKIP_BODY</code> constant to define bodyless tag
* @throws JspException
*/
public int doStartTag() throws JspException {
try {
ValueListIterator valueListIterator = PageListUtil.lookupForIterator(pageContext);
if (valueListIterator.hasPrevious(50)) {
logger.debug("IS PREV");
pageContext.getOut().print("<INPUT TYPE='BUTTON' name='prev' value='Previous' ");
if (searchParameter == null) {
pageContext.getOut().print("onclick='window.location=\""+
((HttpServletRequest)(pageContext.getRequest())).getRequestURL()+"?Previous=Previous\"'/>");
} else {
pageContext.getOut().print("onclick='window.location=\""+
((HttpServletRequest)(pageContext.getRequest())).getRequestURL()+"?Previous=Previous&searchType="+searchParameter+"\"'/>");
}
} else {
logger.debug("IS NOT PREV");
pageContext.getOut().print(" ");
}
} catch (EaglsDAOError eaglsDAOError) {
logger.error(eaglsDAOError.getMessage(), eaglsDAOError);
PageListUtil.handleDaoError(eaglsDAOError.getMessage(), eaglsDAOError, this);
} catch (IOException e) {
logger.error(e.getMessage(), e);
throw new JspException(e.getMessage(), e);
}
return SKIP_BODY;
}
/**
* sets flag to indicate following page processing
* @return <code>EVAL_PAGE</code> constant
*/
public int doEndTag() {
return EVAL_PAGE;
}
}
| [
"ildar66@inbox.ru"
] | ildar66@inbox.ru |
91b0045d509e3fd32f4676b7017e8b21f1aabf1b | ca030864a3a1c24be6b9d1802c2353da4ca0d441 | /classes7.dex_source_from_JADX/com/facebook/friendsharing/souvenirs/models/SouvenirVideoItem.java | b583b8ae46407431846c1073c17dd5a519ec01c0 | [] | no_license | pxson001/facebook-app | 87aa51e29195eeaae69adeb30219547f83a5b7b1 | 640630f078980f9818049625ebc42569c67c69f7 | refs/heads/master | 2020-04-07T20:36:45.758523 | 2018-03-07T09:04:57 | 2018-03-07T09:04:57 | 124,208,458 | 4 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,932 | java | package com.facebook.friendsharing.souvenirs.models;
import android.os.Parcel;
import android.os.Parcelable.Creator;
import com.facebook.common.json.AutoGenJsonDeserializer;
import com.facebook.common.json.AutoGenJsonHelper;
import com.facebook.common.json.FbSerializerProvider;
import com.facebook.friendsharing.souvenirs.models.SouvenirItem.Deserializer;
import com.facebook.ipc.media.data.HasLocalMediaData;
import com.facebook.ipc.media.data.LocalMediaData;
import com.facebook.ipc.media.data.MediaData;
import com.facebook.ipc.media.data.MediaData.Type;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.google.common.base.Preconditions;
import java.util.Locale;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@AutoGenJsonDeserializer(baseDeserializer = "com.facebook.friendsharing.souvenirs.models.SouvenirUriItemDeserializer")
@JsonDeserialize(using = Deserializer.class)
@Immutable
@JsonSerialize(using = Serializer.class)
/* compiled from: REVEALED */
public final class SouvenirVideoItem extends SouvenirUriItem implements HasLocalMediaData {
public static final Creator<SouvenirVideoItem> CREATOR = new C20971();
@JsonProperty("duration")
final long mDurationMsecs;
@JsonProperty(a = true, value = "media_data")
final LocalMediaData mLocalMediaData;
/* compiled from: REVEALED */
final class C20971 implements Creator<SouvenirVideoItem> {
C20971() {
}
public final Object createFromParcel(Parcel parcel) {
return new SouvenirVideoItem(parcel);
}
public final Object[] newArray(int i) {
return new SouvenirVideoItem[i];
}
}
/* compiled from: REVEALED */
public class Serializer extends JsonSerializer<SouvenirVideoItem> {
public final void m26201a(Object obj, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) {
SouvenirVideoItem souvenirVideoItem = (SouvenirVideoItem) obj;
if (souvenirVideoItem == null) {
throw new IllegalArgumentException("SouvenirVideoItem.serialize");
}
jsonGenerator.b(SouvenirVideoItem.class.getSimpleName());
jsonGenerator.f();
m26200b(souvenirVideoItem, jsonGenerator, serializerProvider);
jsonGenerator.g();
}
static {
FbSerializerProvider.a(SouvenirVideoItem.class, new Serializer());
}
private static void m26200b(SouvenirVideoItem souvenirVideoItem, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) {
AutoGenJsonHelper.a(jsonGenerator, serializerProvider, "media_data", souvenirVideoItem.mLocalMediaData);
AutoGenJsonHelper.a(jsonGenerator, "duration", Long.valueOf(souvenirVideoItem.mDurationMsecs));
}
}
public SouvenirVideoItem(LocalMediaData localMediaData, long j) {
boolean z;
this.mLocalMediaData = localMediaData;
if (m26203b().mType == Type.Video) {
z = true;
} else {
z = false;
}
Preconditions.checkArgument(z);
this.mDurationMsecs = j;
}
public final LocalMediaData m26202a() {
return this.mLocalMediaData;
}
public final MediaData m26203b() {
return this.mLocalMediaData.b();
}
public final SouvenirItem.Type hw_() {
return SouvenirItem.Type.Video;
}
public final long m26204d() {
return this.mDurationMsecs;
}
public final boolean equals(@Nullable Object obj) {
if (obj == this) {
return true;
}
if ((obj instanceof SouvenirVideoItem) && ((SouvenirVideoItem) obj).m26186c().equals(m26186c())) {
return true;
}
return false;
}
public final int hashCode() {
return ((m26186c().hashCode() + 85) * 17) + hw_().name().hashCode();
}
public final String toString() {
return String.format(Locale.US, "{SouvenirVideoItem %s}", new Object[]{this.mLocalMediaData.toString()});
}
private SouvenirVideoItem() {
this.mLocalMediaData = null;
this.mDurationMsecs = 0;
}
public SouvenirVideoItem(Parcel parcel) {
super((byte) 0);
this.mLocalMediaData = (LocalMediaData) parcel.readParcelable(LocalMediaData.class.getClassLoader());
this.mDurationMsecs = parcel.readLong();
}
public final void writeToParcel(Parcel parcel, int i) {
super.writeToParcel(parcel, i);
parcel.writeParcelable(this.mLocalMediaData, i);
parcel.writeLong(this.mDurationMsecs);
}
}
| [
"son.pham@jmango360.com"
] | son.pham@jmango360.com |
e27ec57fe0b19d904772afe139a2435bd78243e6 | 3628306c6cd34f36a90904996a08b4353a1fa602 | /src/java/com/bds/wpn/dto/IbPerfilesPilotoDTO.java | 1f6a8ac35f0cb90874c08a7ab7de1e9827e91030 | [] | no_license | duna05/bdspnweb | c167cc64a827d50e1c39b084fae77f8f2c5d385b | 8e9839fa96f8f2629cccb84447634134ff09f0be | refs/heads/master | 2020-05-22T00:52:16.791469 | 2019-05-11T21:07:48 | 2019-05-11T21:07:48 | 186,181,605 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,961 | 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 com.bds.wpn.dto;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Collection;
/**
*
* @author juan.faneite
*/
public class IbPerfilesPilotoDTO implements Serializable {
private static final long serialVersionUID = 1L;
private BigDecimal id;
private String nombre;
private Collection<IbTransaccionesPerfilesDTO> ibTransaccionesPerfilesDTOCollection;
private Collection<IbUsuariosPerfilPilotoDTO> ibUsuariosPerfilPilotoDTOCollection;
private RespuestaDTO respuestaDTO; //todos los DTO deben tener este objeto
/**
* Obtener respuesta
*
* @return RespuestaDTO
*/
public RespuestaDTO getRespuestaDTO() {
return respuestaDTO;
}
/**
* Asignar respuesta
*
* @param respuestaDTO
*/
public void setRespuestaDTO(RespuestaDTO respuestaDTO) {
this.respuestaDTO = respuestaDTO;
}
/**
* Obtener id
*
* @return BigDecimal
*/
public BigDecimal getId() {
return id;
}
/**
* Asignar id
*
* @param id BigDecimal
*/
public void setId(BigDecimal id) {
this.id = id;
}
/**
* Obtener nombre
*
* @return String
*/
public String getNombre() {
return nombre;
}
/**
* Asignar nombre
*
* @param nombre String
*/
public void setNombre(String nombre) {
this.nombre = nombre;
}
/**
* Obtener listado de las transacciones de los perfiles
*
* @return Collection<IbTransaccionesPerfilesDTO>
*/
public Collection<IbTransaccionesPerfilesDTO> getIbTransaccionesPerfilesDTOCollection() {
return ibTransaccionesPerfilesDTOCollection;
}
/**
* Asignar listado de las transacciones de los perfiles
*
* @param ibTransaccionesPerfilesDTOCollection
* Collection<IbTransaccionesPerfilesDTO>
*/
public void setIbTransaccionesPerfilesDTOCollection(Collection<IbTransaccionesPerfilesDTO> ibTransaccionesPerfilesDTOCollection) {
this.ibTransaccionesPerfilesDTOCollection = ibTransaccionesPerfilesDTOCollection;
}
/**
* Obtener listado de los usuarios
*
* @return Collection<IbUsuariosPerfilPilotoDTO>
*/
public Collection<IbUsuariosPerfilPilotoDTO> getIbUsuariosPerfilPilotoDTOCollection() {
return ibUsuariosPerfilPilotoDTOCollection;
}
/**
* Asignar listado de usuarios
*
* @param ibUsuariosPerfilPilotoDTOCollection
*/
public void setIbUsuariosPerfilPilotoDTOCollection(Collection<IbUsuariosPerfilPilotoDTO> ibUsuariosPerfilPilotoDTOCollection) {
this.ibUsuariosPerfilPilotoDTOCollection = ibUsuariosPerfilPilotoDTOCollection;
}
}
| [
"audra.zapata@delsur.com.ve"
] | audra.zapata@delsur.com.ve |
5087e465c8e671bbf0956470d57c09f7064bb162 | a41405e9debd44c33e154e7745c1d7cf38c2217f | /discovery-common/src/main/java/com/nepxion/discovery/common/constant/DiscoveryConstant.java | 67e4068310046cc47059b886353ba5f15af6199b | [
"Apache-2.0"
] | permissive | liulongqiang1984/Discovery | 24f123d746eb70c39fce65ee663f78b3fbb1dfba | f367319fc639dab6556e22ea1e9690e3bc9e3bd0 | refs/heads/master | 2020-05-27T14:03:56.784855 | 2019-05-26T04:03:30 | 2019-05-26T04:03:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,982 | java | package com.nepxion.discovery.common.constant;
/**
* <p>Title: Nepxion Discovery</p>
* <p>Description: Nepxion Discovery</p>
* <p>Copyright: Copyright (c) 2017-2050</p>
* <p>Company: Nepxion</p>
* @author Haojun Ren
* @version 1.0
*/
public class DiscoveryConstant {
public static final String DISCOVERY_VERSION = "4.8.8";
public static final String SPRING_APPLICATION_DISCOVERY_PLUGIN = "spring.application.discovery.plugin";
public static final String SPRING_APPLICATION_DISCOVERY_VERSION = "spring.application.discovery.version";
public static final String SPRING_APPLICATION_REGISTER_CONTROL_ENABLED = "spring.application.register.control.enabled";
public static final String SPRING_APPLICATION_DISCOVERY_CONTROL_ENABLED = "spring.application.discovery.control.enabled";
public static final String SPRING_APPLICATION_CONFIG_REST_CONTROL_ENABLED = "spring.application.config.rest.control.enabled";
public static final String SPRING_APPLICATION_CONFIG_FORMAT = "spring.application.config.format";
public static final String SPRING_APPLICATION_CONFIG_PATH = "spring.application.config.path";
public static final String SPRING_APPLICATION_GROUP_KEY = "spring.application.group.key";
public static final String SPRING_APPLICATION_CONTEXT_PATH = "spring.application.context-path";
public static final String SPRING_APPLICATION_NAME = "spring.application.name";
public static final String GROUP = "group";
public static final String SERVICE_ID = "serviceId";
public static final String HOST = "host";
public static final String PORT = "port";
public static final String METADATA = "metadata";
public static final String REGION = "region";
public static final String VERSION = "version";
public static final String DYNAMIC_VERSION = "dynamicVersion";
public static final String RULE = "rule";
public static final String DYNAMIC_RULE = "dynamicRule";
public static final String REACH_MAX_LIMITED_COUNT = "reach max limited count";
public static final String N_D_REGION = "n-d-region";
public static final String N_D_VERSION = "n-d-version";
public static final String N_D_ADDRESS = "n-d-address";
public static final String XML_FORMAT = "xml";
public static final String JSON_FORMAT = "json";
public static final String PREFIX_CLASSPATH = "classpath:";
public static final String PREFIX_FILE = "file:";
public static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
public static final String ENCODING_UTF_8 = "UTF-8";
public static final String SEPARATE = ";";
public static final String ASYNC = "async";
public static final String SYNC = "sync";
public static final String GLOBAL = "global";
public static final String PARTIAL = "partial";
public static final String OK = "OK";
public static final String NO = "NO";
public static final String UNKNOWN = "UNKNOWN";
public static final String EXT = "ext";
} | [
"1394997@qq.com"
] | 1394997@qq.com |
dfc563923c34317d9471f7663a76da5a4d5a3fd6 | 97a48e7ef9a50362dd88d22ff05cdeb7adf41c6b | /src/main/java/lib/org/apache/xml/security/keys/keyresolver/KeyResolverSpi.java | 732c5c86988647ef3035677fa69af4744d62d45d | [] | no_license | gusmp/appletCatcertDI | 2164a6dd7c3f1568eb7e30f6e13338df02b84118 | 868da9683aa8946a9d60d902d93789a9157a489d | refs/heads/master | 2021-01-20T21:49:26.039179 | 2018-08-18T11:29:15 | 2018-08-18T11:29:15 | 6,111,520 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,679 | java | /*
* Copyright 1999-2004 The Apache Software 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 lib.org.apache.xml.security.keys.keyresolver;
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import javax.crypto.SecretKey;
import lib.org.apache.xml.security.keys.storage.StorageResolver;
import org.w3c.dom.Element;
/**
* This class is abstract class for a child KeyInfo Elemnet.
*
* If you want the your KeyResolver, at firstly you must extand this class, and register
* as following in config.xml
* <PRE>
* <KeyResolver URI="http://www.w3.org/2000/09/xmldsig#KeyValue"
* JAVACLASS="MyPackage.MyKeyValueImpl"//gt;
* </PRE>
*
* @author $Author: raul $
* @version $Revision: 1.11 $
*/
public abstract class KeyResolverSpi {
/**
* This method helps the {@link lib.org.apache.xml.security.utils.resolver.ResourceResolver} to decide whether a
* {@link lib.org.apache.xml.security.utils.resolver.ResourceResolverSpi} is able to perform the requested action.
*
* @param element
* @param BaseURI
* @param storage
* @return true if can resolve the key in the element
*/
abstract public boolean engineCanResolve(Element element, String BaseURI,
StorageResolver storage);
/**
* Method engineResolvePublicKey
*
* @param element
* @param BaseURI
* @param storage
* @return resolved public key from the registered from the element.
*
* @throws KeyResolverException
*/
abstract public PublicKey engineResolvePublicKey(
Element element, String BaseURI, StorageResolver storage)
throws KeyResolverException;
/**
* Method engineResolveCertificate
*
* @param element
* @param BaseURI
* @param storage
* @return resolved X509Certificate key from the registered from the elements
*
* @throws KeyResolverException
*/
abstract public X509Certificate engineResolveX509Certificate(
Element element, String BaseURI, StorageResolver storage)
throws KeyResolverException;
/**
* Method engineResolveSecretKey
*
* @param element
* @param BaseURI
* @param storage
* @return resolved SecretKey key from the registered from the elements
*
* @throws KeyResolverException
*/
abstract public SecretKey engineResolveSecretKey(
Element element, String BaseURI, StorageResolver storage)
throws KeyResolverException;
/** Field _properties */
protected java.util.Map _properties = new java.util.HashMap(10);
/**
* Method engineSetProperty
*
* @param key
* @param value
*/
public void engineSetProperty(String key, String value) {
java.util.Iterator i = this._properties.keySet().iterator();
while (i.hasNext()) {
String c = (String) i.next();
if (c.equals(key)) {
key = c;
break;
}
}
this._properties.put(key, value);
}
/**
* Method engineGetProperty
*
* @param key
* @return obtain the property appointed by key
*/
public String engineGetProperty(String key) {
java.util.Iterator i = this._properties.keySet().iterator();
while (i.hasNext()) {
String c = (String) i.next();
if (c.equals(key)) {
key = c;
break;
}
}
return (String) this._properties.get(key);
}
/**
* Method engineGetPropertyKeys
*
* @return the keys of properties known by this resolver
*/
public String[] engineGetPropertyKeys() {
return new String[0];
}
/**
* Method understandsProperty
*
* @param propertyToTest
* @return true if understood the property
*/
public boolean understandsProperty(String propertyToTest) {
String[] understood = this.engineGetPropertyKeys();
if (understood != null) {
for (int i = 0; i < understood.length; i++) {
if (understood[i].equals(propertyToTest)) {
return true;
}
}
}
return false;
}
}
| [
"none@none.es"
] | none@none.es |
3b4bf7d20cfa40cd9d062dabedb353c15caf06bd | a4581224333cad55b6c69cd7b96121cf22e08775 | /fiveClass/day16-2/code/mybatis-3/src/main/java/com/bjlemon/mybatis/mapper/EmployeeMapper.java | 67a0809303a63df253e612623a5eea1954d258f5 | [] | no_license | persueahead/lemon | c7cc2fa11458da3aed8e8eb124afef6a20640a3e | 6379abfd60881007d8dc2efef7a7ac3b99fd9241 | refs/heads/main | 2023-02-18T02:18:49.973014 | 2021-01-06T03:09:26 | 2021-01-06T03:09:26 | 325,274,156 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 616 | java | package com.bjlemon.mybatis.mapper;
import com.bjlemon.mybatis.domain.Department;
import com.bjlemon.mybatis.domain.Employee;
import java.util.List;
/**
* @author jeffzhou
* @version 1.0.0
* @ClassName EmployeeMapper.java
* @Description TODO
* @createTime 2020年03月03日 21:45:00
*/
public interface EmployeeMapper {
void save(Employee employee);
List<Employee> findEmployeesByDepartmentId(Integer departmentId);
/**
* @description 根据员工名称查询所在部门
* @author admin
* @updateTime 2020/3/3 22:53
*/
Department findDepartmentByName(String name);
}
| [
"49875630+persueahead@users.noreply.github.com"
] | 49875630+persueahead@users.noreply.github.com |
1de7503ec861a0dd2430b41bcb8b6c7f7e99ac85 | b7f3edb5b7c62174bed808079c3b21fb9ea51d52 | /chrome/android/javatests/src/org/chromium/chrome/browser/browsing_data/BrowsingDataTest.java | 4574621f30e58d37805a67bbb0155f799f1b8517 | [
"BSD-3-Clause"
] | permissive | otcshare/chromium-src | 26a7372773b53b236784c51677c566dc0ad839e4 | 64bee65c921db7e78e25d08f1e98da2668b57be5 | refs/heads/webml | 2023-03-21T03:20:15.377034 | 2020-11-16T01:40:14 | 2020-11-16T01:40:14 | 209,262,645 | 18 | 21 | BSD-3-Clause | 2023-03-23T06:20:07 | 2019-09-18T08:52:07 | null | UTF-8 | Java | false | false | 6,788 | java | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.browsing_data;
import android.support.test.InstrumentationRegistry;
import androidx.test.filters.SmallTest;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.chromium.base.test.util.CallbackHelper;
import org.chromium.base.test.util.CommandLineFlags;
import org.chromium.chrome.browser.ChromeActivity;
import org.chromium.chrome.browser.flags.ChromeSwitches;
import org.chromium.chrome.test.ChromeActivityTestRule;
import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
import org.chromium.content_public.browser.test.util.JavaScriptUtils;
import org.chromium.content_public.browser.test.util.TestThreadUtils;
import org.chromium.net.test.EmbeddedTestServer;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeoutException;
/**
* Integration tests for browsing data deletion.
*/
@RunWith(ChromeJUnit4ClassRunner.class)
@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
public class BrowsingDataTest {
private static final String TEST_FILE = "/content/test/data/browsing_data/site_data.html";
private EmbeddedTestServer mTestServer;
private String mUrl;
@Rule
public ChromeActivityTestRule<ChromeActivity> mActivityTestRule =
new ChromeActivityTestRule<>(ChromeActivity.class);
@Before
public void setUp() throws Exception {
mActivityTestRule.startMainActivityOnBlankPage();
mTestServer = EmbeddedTestServer.createAndStartServer(InstrumentationRegistry.getContext());
mUrl = mTestServer.getURL(TEST_FILE);
}
private void clearBrowsingData(int dataType, int timePeriod) throws TimeoutException {
CallbackHelper helper = new CallbackHelper();
TestThreadUtils.runOnUiThreadBlocking(() -> {
BrowsingDataBridge.getInstance().clearBrowsingData(
helper::notifyCalled, new int[] {dataType}, timePeriod);
});
helper.waitForCallback(0);
}
private int getCookieCount() throws Exception {
String[] out = {""};
BrowsingDataCounterBridge[] counter = {null};
CallbackHelper helper = new CallbackHelper();
BrowsingDataCounterBridge.BrowsingDataCounterCallback callback = (result) -> {
if (result.equals("Calculating…")) return;
out[0] = result;
helper.notifyCalled();
};
TestThreadUtils.runOnUiThreadBlocking(() -> {
counter[0] = new BrowsingDataCounterBridge(
callback, BrowsingDataType.COOKIES, ClearBrowsingDataTab.ADVANCED);
});
helper.waitForCallback(0);
// The counter returns a result like "3 sites" or "None".
if (out[0].equals("None")) return 0;
String cookieCount = out[0].replaceAll("[^0-9]", "");
Assert.assertFalse("Result should contain a number: " + out[0], cookieCount.isEmpty());
return Integer.parseInt(cookieCount);
}
private String runJavascriptAsync(String type) throws Exception {
return JavaScriptUtils.runJavascriptWithAsyncResult(
mActivityTestRule.getWebContents(), type);
}
/**
* Test cookies deletion.
*/
@Test
@SmallTest
public void testCookiesDeleted() throws Exception {
Assert.assertEquals(0, getCookieCount());
mActivityTestRule.loadUrl(mUrl);
Assert.assertEquals("false", runJavascriptAsync("hasCookie()"));
runJavascriptAsync("setCookie()");
Assert.assertEquals("true", runJavascriptAsync("hasCookie()"));
Assert.assertEquals(1, getCookieCount());
clearBrowsingData(BrowsingDataType.COOKIES, TimePeriod.LAST_HOUR);
Assert.assertEquals("false", runJavascriptAsync("hasCookie()"));
Assert.assertEquals(0, getCookieCount());
}
/**
* Test site data deletion.
*/
@Test
@SmallTest
public void testSiteDataDeleted() throws Exception {
// TODO(dullweber): Investigate, why WebSql fails this test.
List<String> siteData = Arrays.asList("LocalStorage", "ServiceWorker", "CacheStorage",
"IndexedDb", "FileSystem" /*, "WebSql"*/);
mActivityTestRule.loadUrl(mUrl);
for (String type : siteData) {
Assert.assertEquals(type, 0, getCookieCount());
Assert.assertEquals(type, "false", runJavascriptAsync("has" + type + "()"));
runJavascriptAsync("set" + type + "()");
Assert.assertEquals(type, 1, getCookieCount());
Assert.assertEquals(type, "true", runJavascriptAsync("has" + type + "()"));
clearBrowsingData(BrowsingDataType.COOKIES, TimePeriod.LAST_HOUR);
Assert.assertEquals(type, 0, getCookieCount());
Assert.assertEquals(type, "false", runJavascriptAsync("has" + type + "()"));
// Some types create data by checking for them, so we need to do a cleanup at the end.
clearBrowsingData(BrowsingDataType.COOKIES, TimePeriod.LAST_HOUR);
}
}
/**
* Test all data deletion for incognito profile. This only checks to see if an android specific
* code crashes or not. For details see, crbug.com/990624.
*/
@Test
@SmallTest
public void testAllDataDeletedForIncognito() throws Exception {
// TODO(roagarwal) : Crashes on BrowsingDataType.SITE_SETTINGS, BrowsingDataType.BOOKMARKS
// data types.
CallbackHelper helper = new CallbackHelper();
TestThreadUtils.runOnUiThreadBlocking(() -> {
BrowsingDataBridge.getInstance().clearBrowsingDataIncognitoForTesting(
helper::notifyCalled,
new int[] {BrowsingDataType.HISTORY, BrowsingDataType.CACHE,
BrowsingDataType.COOKIES, BrowsingDataType.PASSWORDS,
BrowsingDataType.FORM_DATA},
TimePeriod.LAST_HOUR);
});
helper.waitForCallback(0);
}
/**
* Test history deletion.
*/
@Test
@SmallTest
public void testHistoryDeleted() throws Exception {
Assert.assertEquals(0, getCookieCount());
mActivityTestRule.loadUrlInNewTab(mUrl);
Assert.assertEquals("false", runJavascriptAsync("hasHistory()"));
runJavascriptAsync("setHistory()");
Assert.assertEquals("true", runJavascriptAsync("hasHistory()"));
clearBrowsingData(BrowsingDataType.HISTORY, TimePeriod.LAST_HOUR);
Assert.assertEquals("false", runJavascriptAsync("hasHistory()"));
}
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
c0854f44ca5c5a5c06f2cecc04e100d2f14db306 | f788fb59b3dca4ea10848224886965fd87f42db2 | /src/org/pepstock/charba/showcase/client/cases/plugins/HtmlLegendCustomCallbackCase.java | 8759ea648207eafdc25ec89eddbe7a2fdcd6779b | [
"Apache-2.0"
] | permissive | pepstock-org/Charba-Showcase | db3ad32e9ab07876f1132a38235d8a251c15501e | c980631cd840ae8d14e8f418d690853f4ee51de5 | refs/heads/master | 2023-06-01T06:28:52.834689 | 2023-05-23T09:28:26 | 2023-05-23T09:28:26 | 106,569,735 | 3 | 1 | Apache-2.0 | 2023-05-19T16:27:04 | 2017-10-11T15:04:54 | Java | UTF-8 | Java | false | false | 4,658 | java | package org.pepstock.charba.showcase.client.cases.plugins;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.pepstock.charba.client.IsChart;
import org.pepstock.charba.client.callbacks.HtmlLegendItemCallback;
import org.pepstock.charba.client.colors.GoogleChartColor;
import org.pepstock.charba.client.colors.IsColor;
import org.pepstock.charba.client.data.BarDataset;
import org.pepstock.charba.client.data.Dataset;
import org.pepstock.charba.client.dom.safehtml.SafeHtml;
import org.pepstock.charba.client.dom.safehtml.SafeHtmlBuilder;
import org.pepstock.charba.client.enums.Position;
import org.pepstock.charba.client.gwt.widgets.BarChartWidget;
import org.pepstock.charba.client.impl.plugins.HtmlLegend;
import org.pepstock.charba.client.impl.plugins.HtmlLegendOptions;
import org.pepstock.charba.client.items.LegendLabelItem;
import org.pepstock.charba.showcase.client.cases.commons.BaseComposite;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Widget;
public class HtmlLegendCustomCallbackCase extends BaseComposite {
private static ViewUiBinder uiBinder = GWT.create(ViewUiBinder.class);
interface ViewUiBinder extends UiBinder<Widget, HtmlLegendCustomCallbackCase> {
}
@UiField
BarChartWidget chart;
public HtmlLegendCustomCallbackCase() {
initWidget(uiBinder.createAndBindUi(this));
chart.getOptions().setResponsive(true);
chart.getOptions().getLegend().setPosition(Position.TOP);
chart.getOptions().getTitle().setDisplay(true);
chart.getOptions().getTitle().setText("HTML legend callback to manage item text on bar chart");
BarDataset dataset1 = chart.newDataset();
dataset1.setLabel("This is dataset 1 which contains data");
IsColor color1 = GoogleChartColor.values()[0];
dataset1.setBackgroundColor(color1.alpha(0.2));
dataset1.setBorderColor(color1.toHex());
dataset1.setBorderWidth(1);
dataset1.setData(getRandomDigits(months));
BarDataset dataset2 = chart.newDataset();
dataset2.setLabel("This is dataset 2 which contains data");
IsColor color2 = GoogleChartColor.values()[1];
dataset2.setBackgroundColor(color2.alpha(0.2));
dataset2.setBorderColor(color2.toHex());
dataset2.setBorderWidth(1);
dataset2.setData(getRandomDigits(months));
chart.getData().setLabels(getLabels());
chart.getData().setDatasets(dataset1, dataset2);
HtmlLegendOptions options = new HtmlLegendOptions();
options.setLegendItemCallback(new HtmlLegendItemCallback() {
Map<String, SafeHtml> values = new HashMap<>();
@Override
public SafeHtml generateText(IsChart chart, LegendLabelItem item, String currentText) {
if (!values.containsKey(currentText)) {
SafeHtmlBuilder builder = SafeHtmlBuilder.create();
String newText = currentText.replaceAll("dataset", "<b>dataset</b>");
newText = newText.replaceAll("which contains data", "<font style='color: " + item.getStrokeStyle().toRGBA() + "'>which contains data</font>");
builder.appendHtmlConstant(newText);
values.put(currentText, builder.toSafeHtml());
}
return values.get(currentText);
}
});
chart.getOptions().getPlugins().setOptions(HtmlLegend.ID, options);
chart.getPlugins().add(HtmlLegend.get());
}
@UiHandler("randomize")
protected void handleRandomize(ClickEvent event) {
for (Dataset dataset : chart.getData().getDatasets()) {
dataset.setData(getRandomDigits(months));
}
chart.update();
}
@UiHandler("add_dataset")
protected void handleAddDataset(ClickEvent event) {
List<Dataset> datasets = chart.getData().getDatasets();
BarDataset dataset = chart.newDataset();
dataset.setLabel("This is dataset " + (datasets.size() + 1) + " which contains data ");
IsColor color = GoogleChartColor.values()[datasets.size()];
dataset.setBackgroundColor(color.alpha(0.2));
dataset.setBorderColor(color.toHex());
dataset.setBorderWidth(1);
dataset.setData(getRandomDigits(months));
datasets.add(dataset);
chart.update();
}
@UiHandler("remove_dataset")
protected void handleRemoveDataset(ClickEvent event) {
removeDataset(chart);
}
@UiHandler("add_data")
protected void handleAddData(ClickEvent event) {
addData(chart);
}
@UiHandler("remove_data")
protected void handleRemoveData(ClickEvent event) {
removeData(chart);
}
@UiHandler("source")
protected void handleViewSource(ClickEvent event) {
Window.open(getUrl(), "_blank", "");
}
}
| [
"stocki.nail@gmail.com"
] | stocki.nail@gmail.com |
836be89d949194c2a1b61658b89c488d7a0a81fb | 36698a8464c18cfe4476b954eed4c9f3911b5e2c | /ZimbraSelenium/src/java/com/zimbra/qa/selenium/projects/zcs/tests/documents/DocumentBugTests.java | 1829eb129399ada89bdf7df548b16fe0402383da | [] | no_license | mcsony/Zimbra-1 | 392ef27bcbd0e0962dce99ceae3f20d7a1e9d1c7 | 4bf3dc250c68a38e38286bdd972c8d5469d40e34 | refs/heads/master | 2021-12-02T06:45:15.852374 | 2011-06-13T13:10:57 | 2011-06-13T13:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,642 | java | package com.zimbra.qa.selenium.projects.zcs.tests.documents;
import java.lang.reflect.Method;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import com.zimbra.qa.selenium.framework.core.*;
import com.zimbra.qa.selenium.framework.util.RetryFailedTests;
import com.zimbra.qa.selenium.framework.util.ZimbraSeleniumProperties;
import com.zimbra.qa.selenium.projects.zcs.tests.CommonTest;
import com.zimbra.qa.selenium.projects.zcs.ui.DocumentCompose;
/**
* This covers some high priority test cases related to Documents
*
* @author Prashant JAISWAL
*
*/
@SuppressWarnings("static-access")
public class DocumentBugTests extends CommonTest {
//--------------------------------------------------------------------------
// SECTION 1: DATA-PROVIDERS
//--------------------------------------------------------------------------
private static String WARNING_MESSAGE = "The name must be at most 128 characters long";
@DataProvider(name = "DocumentDataProvider")
public Object[][] createData(Method method) {
String test = method.getName();
if (test.equals("tooLongDocName_Bug37614")) {
return new Object[][] { {
"pageName" + getLocalizedData_NoSpecialChar(),
"bodyContent:" + getLocalizedData(3) } };
} else {
return new Object[][] { { "" } };
}
}
// --------------
// section 2 BeforeClass
// --------------
@BeforeClass(groups = { "always" })
public void zLogin() throws Exception {
super.NAVIGATION_TAB="documents";
super.zLogin();
}
@Test(dataProvider = "", groups = { "smoke", "full" }, retryAnalyzer = RetryFailedTests.class)
public void tooLongDocName_Bug37614() throws Exception {
if (SelNGBase.isExecutionARetry.get())
handleRetry();
obj.zButton.zClick(DocumentCompose.zNewPageIconBtn);
zWaitTillObjectExist("button", DocumentCompose.zSavePageIconBtn);
DocumentCompose
.zEnterBasicPageData(
"page1pagepage1pagepage1pagepage1pagepage1pagepage1pagepage1pagepage1pagepage1page page1page page1page page1page23456789pageNamepage1pagepage1pagepage1pagepage1pagepage1pagepage1pagepage1pagepage1pagepage1page page1page page1page page1page23456789pageName",
"Hello World");
obj.zButton.zClick(DocumentCompose.zSavePageIconBtn);
obj.zDialog.zExists(localize(locator.warningMsg));
if (ZimbraSeleniumProperties.getStringProperty("locale").equalsIgnoreCase("en_US")) {
Assert.assertTrue(obj.zDialog.zGetMessage(
localize(locator.warningMsg)).equals(WARNING_MESSAGE));
}
SelNGBase.needReset.set(false);
}
} | [
"dstites@autobase.net"
] | dstites@autobase.net |
cf763dfaa4da69f079f91a0ec26f10a758844a3e | fe94810f8f47cfdcb74eda2d32ed5e829289fd22 | /app/src/main/java/com/eshop/mvp/http/entity/store/MockAuditGoods.java | c9771f7ab4fced0cbecd701aed7e92cd5a34c46d | [] | no_license | thinking123/yiqi-new-android | ef35b275d8644b6143c7b13eaf4d63a0f0418447 | dd17c8f52157d948659e038ea2a413a01e927ac8 | refs/heads/master | 2020-07-06T10:15:05.173123 | 2019-08-31T03:47:21 | 2019-08-31T03:47:21 | 202,983,082 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,072 | java | package com.eshop.mvp.http.entity.store;
import com.eshop.mvp.http.entity.home.HomeGoodBean;
import java.util.ArrayList;
import java.util.List;
public class MockAuditGoods {
public static List<AuditGoods> goodsList;
public static void init(){
goodsList = new ArrayList<>();
AuditGoods b1 = new AuditGoods();
b1.imgUrl = "http://zack-image.oss-cn-beijing.aliyuncs.com/3c0878bd-2d19-4e4a-8d09-600e0637809b.jpg";
b1.title = "商品";
b1.unitPrice = "12.0";
goodsList.add(b1);
b1 = new AuditGoods();
b1.imgUrl = "http://zack-image.oss-cn-beijing.aliyuncs.com/84f44f32-82a2-4ce0-8dcd-ad092b862710.jpg";
b1.title = "商品";
b1.unitPrice = "12.0";
goodsList.add(b1);
b1 = new AuditGoods();
b1.imgUrl = "http://zack-image.oss-cn-beijing.aliyuncs.com/c7f43de3-15de-4c79-8e46-8c401c66391f.jpg";
b1.title = "商品";
b1.unitPrice = "12.0";
goodsList.add(b1);
goodsList.add(b1);
}
} | [
"1294873004@qq.com"
] | 1294873004@qq.com |
16d698a47e83d463ea5ec6c57ff2db755be5b6cc | 1ec62a7e351ed029b2141ee01432d2fc8c44f43a | /java/isemba/Applet/j325d/j325d.java | b51a7c7b4c9dbe1c020be52cdad9c792b46d9aeb | [] | no_license | hataka/codingground | 7a1b555d13b8e42320f5f5e4898664191da16a47 | 53d2b204ae2e0fb13bd6d293e07c68066226e26b | refs/heads/master | 2021-01-20T01:34:16.778320 | 2019-02-02T04:27:14 | 2019-02-02T04:27:14 | 89,292,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,806 | java | // -*- mode: java -*- Time-stamp: <09/05/19 16:28:13 kazuhiko>
/*====================================================================
* name: j325d.java
* created : Time-stamp: <09/06/30(火) 08:59:00 hata>
* $Id$
* Programmed by kahata
* To compile:
* To run:
* links: http://jubilo.cis.ibaraki.ac.jp/~isemba/PROGRAM/JAVA/java.shtml
* http://jubilo.cis.ibaraki.ac.jp/~isemba/PROGRAM/JAVA/CLASS/j325d.htm
* description: Java プログラミング(基礎と応用) 仙波一郎
* ====================================================================*/
////////////////////////////////////////////////////////////////////////////////
// << j325d.java >>
//
// アプレット(2):レイアウトマネージャー(GridBagLayout、基礎)
//
// 2個のラベルを配置する。
//
// これらのラベルは、指定された位置関係を保存しながら表示される。
// 部品の表示領域が部品のサイズより大きくなったとき、拡張できる。
//
// ●GridBagConstraintsクラスの変数
//
// int fill 部品の表示領域が部品のサイズより大きくなったとき、
// どのようにするか指定する。
// GridBagConstraints.BOTH 部品を水平・垂直の両方向
// 一杯に拡張する。
// GridBagConstraints.HORIZONTAL 部品を水平方向一杯に
// 拡張する。
// GridBagConstraints.VERTICAL 部品を垂直方向一杯に
// 拡張する。
// GridBagConstraints.NONE なにもしない。
//
////////////////////////////////////////////////////////////////////////////////
import java.applet.Applet;
import java.awt.*;
public class j325d extends Applet {
public void init() {
// アプレットの背景色を黄色に設定。
this.setBackground(Color.yellow);
// アプレットのレイアウトマネージャをGridBagLayoutに設定。
GridBagLayout gb = new GridBagLayout();
this.setLayout(gb);
// GridBagConstraintsオブジェクトの作成。
GridBagConstraints gbc = new GridBagConstraints();
// ラベルの作成。
Label lab1 = new Label("ラベル1");
lab1.setBackground(Color.green); // ラベル1の背景色を緑に設定。
Label lab2 = new Label("ラベル2");
lab2.setBackground(Color.red); // ラベル2の背景色を赤に設定。
// ラベル1を(0,0)から(1,1)に配置する。
gbc.gridx = 0; gbc.gridy = 0;
gbc.gridwidth = 1; gbc.gridheight = 1;
gbc.weightx = 1.0; gbc.weighty = 1.0;
gb.setConstraints(lab1,gbc);
this.add(lab1);
// ボタン2を(1,1)から(2,2)に配置する。
gbc.gridx = 1; gbc.gridy = 1;
gbc.fill = GridBagConstraints.BOTH;
gb.setConstraints(lab2,gbc);
this.add(lab2);
}
}
/*
</pre>
<font size=5 color=blue>HTMLファイル</font><br>
<pre>
<html>
<head>
<title>アプレット</title>
</head>
<body bgcolor=white text=black>
<applet code="j325d.class" width="160" height="160">
</applet>
</body>
</html>
</pre>
<font size=5 color=blue>実行結果</font><br>
<applet code="j325d.class" width="160" height="160">
</applet>
<br><br>
<font size=5 color=blue>HTMLファイル</font><br>
<pre>
<html>
<head>
<title>アプレット</title>
</head>
<body bgcolor=white text=black>
<applet code="j325d.class" width="300" height="200">
</applet>
</body>
</html>
</pre>
<font size=5 color=blue>実行結果</font><br>
<applet code="j325d.class" width="300" height="200">
</applet>
</body>
</html>
*/
| [
"kazuhiko.hata@nifty.com"
] | kazuhiko.hata@nifty.com |
894e0703a425c3f083ced9d3baf5e6eda3204c2f | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Spring/Spring9592.java | a895216212c362481b6a8345fc8f0636756c9daf | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 284 | java | @Override
@SuppressWarnings("")
public <T> T getNativeResponse(@Nullable Class<T> requiredType) {
if (requiredType != null) {
Object response = getExternalContext().getResponse();
if (requiredType.isInstance(response)) {
return (T) response;
}
}
return null;
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
d8c4549dd87fb18385edb27b07a89749b59c1aa5 | f7f9d7fa841e856927e02513ecc74dc00c935f8a | /server/src/main/java/org/codelibs/fesen/search/aggregations/bucket/terms/heuristic/SignificanceHeuristic.java | 4df8fb0671a189924770a0a95fb9e3438cc8a68c | [
"CDDL-1.0",
"MIT",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"NAIST-2003",
"LicenseRef-scancode-generic-export-compliance",
"ICU",
"SunPro",
"Python-2.0",
"CC-BY-SA-3.0",
"MPL-1.1",
"GPL-2.0-only",
"CPL-1.0",
"LicenseRef-scancode-other-copyleft",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"CC-PDDC",
"BSD-2-Clause",
"LicenseRef-scancode-unicode-mappings",
"LicenseRef-scancode-unicode",
"CC0-1.0",
"Apache-1.1",
"EPL-1.0",
"Classpath-exception-2.0"
] | permissive | codelibs/fesen | 3f949fd3533e8b25afc3d3475010d1b1a0d95c09 | b2440fbda02e32f7abe77d2be95ead6a16c8af06 | refs/heads/main | 2022-07-27T21:14:02.455938 | 2021-12-21T23:54:20 | 2021-12-21T23:54:20 | 330,334,670 | 4 | 0 | Apache-2.0 | 2022-05-17T01:54:31 | 2021-01-17T07:07:56 | Java | UTF-8 | Java | false | false | 3,434 | java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.codelibs.fesen.search.aggregations.bucket.terms.heuristic;
import org.codelibs.fesen.common.io.stream.NamedWriteable;
import org.codelibs.fesen.common.xcontent.ToXContentFragment;
import org.codelibs.fesen.index.query.QueryShardContext;
import org.codelibs.fesen.search.aggregations.InternalAggregation;
import org.codelibs.fesen.search.aggregations.bucket.terms.SignificantTerms;
/**
* Heuristic for that {@link SignificantTerms} uses to pick out significant terms.
*/
public abstract class SignificanceHeuristic implements NamedWriteable, ToXContentFragment {
/**
* @param subsetFreq The frequency of the term in the selected sample
* @param subsetSize The size of the selected sample (typically number of docs)
* @param supersetFreq The frequency of the term in the superset from which the sample was taken
* @param supersetSize The size of the superset from which the sample was taken (typically number of docs)
* @return a "significance" score
*/
public abstract double getScore(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize);
protected void checkFrequencyValidity(long subsetFreq, long subsetSize, long supersetFreq, long supersetSize,
String scoreFunctionName) {
if (subsetFreq < 0 || subsetSize < 0 || supersetFreq < 0 || supersetSize < 0) {
throw new IllegalArgumentException("Frequencies of subset and superset must be positive in " + scoreFunctionName +
".getScore()");
}
if (subsetFreq > subsetSize) {
throw new IllegalArgumentException("subsetFreq > subsetSize, in " + scoreFunctionName);
}
if (supersetFreq > supersetSize) {
throw new IllegalArgumentException("supersetFreq > supersetSize, in " + scoreFunctionName);
}
}
/**
* Provides a hook for subclasses to provide a version of the heuristic
* prepared for execution on data on the coordinating node.
* @param reduceContext the reduce context on the coordinating node
* @return a version of this heuristic suitable for execution
*/
public SignificanceHeuristic rewrite(InternalAggregation.ReduceContext reduceContext) {
return this;
}
/**
* Provides a hook for subclasses to provide a version of the heuristic
* prepared for execution on data on a shard.
* @param queryShardContext the shard context on the data node
* @return a version of this heuristic suitable for execution
*/
public SignificanceHeuristic rewrite(QueryShardContext queryShardContext) {
return this;
}
}
| [
"shinsuke@apache.org"
] | shinsuke@apache.org |
e7c3ffed1c8101925cda1f702a2425666981bcde | ba55269057e8dc503355a26cfab3c969ad7eb278 | /POSNirvanaORM/src/com/nirvanaxp/types/entities/Floorplan.java | 821482857294b1e3fd955a9e907d6a22dafc852b | [
"Apache-2.0"
] | permissive | apoorva223054/SF3 | b9db0c86963e549498f38f7e27f65c45438b2a71 | 4dab425963cf35481d2a386782484b769df32986 | refs/heads/master | 2022-03-07T17:13:38.709002 | 2020-01-29T05:19:06 | 2020-01-29T05:19:06 | 236,907,773 | 0 | 0 | Apache-2.0 | 2022-02-09T22:46:01 | 2020-01-29T05:10:51 | Java | UTF-8 | Java | false | false | 2,861 | java | /**
* Copyright (c) 2012 - 2017 by NirvanaXP, LLC. All Rights reserved. Express
* written consent required to use, copy, share, alter, distribute or transmit
* this source code in part or whole through any means physical or electronic.
**/
package com.nirvanaxp.types.entities;
import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
/**
* The persistent class for the floorplan database table.
*
*/
@Entity
@Table(name = "floorplan")
@XmlRootElement(name = "floorplan")
public class Floorplan implements Serializable
{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(unique = true, nullable = false)
private int id;
@Temporal(TemporalType.TIMESTAMP)
private Date created;
@Column(name = "created_by")
private String createdBy;
@Column(name = "image_name", nullable = false)
private String imageName;
@Column(name = "locations_id", nullable = false)
private String locationsId;
@Temporal(TemporalType.TIMESTAMP)
private Date updated;
@Column(name = "updated_by", nullable = false)
private String updatedBy;
public Floorplan()
{
}
public int getId()
{
return this.id;
}
public void setId(int id)
{
this.id = id;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public String getUpdatedBy() {
return updatedBy;
}
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public String getImageName()
{
return this.imageName;
}
public void setImageName(String imageName)
{
this.imageName = imageName;
}
public String getLocationsId()
{
if(locationsId != null && (locationsId.length()==0 || locationsId.equals("0"))){return null;}else{ if(locationsId != null && (locationsId.length()==0 || locationsId.equals("0"))){return null;}else{ return locationsId;}}
}
public void setLocationsId(String locationsId)
{
this.locationsId = locationsId;
}
public Date getCreated()
{
return created;
}
public void setCreated(Date created)
{
this.created = created;
}
public Date getUpdated()
{
return updated;
}
public void setUpdated(Date updated)
{
this.updated = updated;
}
@Override
public String toString() {
return "Floorplan [id=" + id + ", created=" + created + ", createdBy="
+ createdBy + ", imageName=" + imageName + ", locationsId="
+ locationsId + ", updated=" + updated + ", updatedBy="
+ updatedBy + "]";
}
} | [
"naman223054@gmail.com"
] | naman223054@gmail.com |
df0251639ee2430329a72902ad37c2ab8ad2643f | 63aa90f81728c223df1eca002ba8b30e3b89ab29 | /src/test/java/org/assertj/core/internal/chararrays/CharArrays_assertContainsOnly_Test.java | 88650fef632d2ea299e078d4123beb035c0f36d4 | [
"Apache-2.0"
] | permissive | assilzm/assertj-core | f87b92f05d8644b7c7946fdcbdf1041196dad6dc | faa1b442e674d440caa54ae860a70983ba3e2588 | refs/heads/master | 2021-01-18T08:24:33.533825 | 2015-03-11T21:11:44 | 2015-03-15T04:37:40 | 32,510,975 | 1 | 0 | null | 2015-03-19T09:01:51 | 2015-03-19T09:01:51 | null | UTF-8 | Java | false | false | 5,875 | java | /**
* 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.
*
* Copyright 2012-2015 the original author or authors.
*/
package org.assertj.core.internal.chararrays;
import static org.assertj.core.error.ShouldContainOnly.shouldContainOnly;
import static org.assertj.core.test.CharArrays.*;
import static org.assertj.core.test.ErrorMessages.*;
import static org.assertj.core.test.TestData.someInfo;
import static org.assertj.core.test.TestFailures.failBecauseExpectedAssertionErrorWasNotThrown;
import static org.assertj.core.util.FailureMessages.actualIsNull;
import static org.assertj.core.util.Sets.newLinkedHashSet;
import static org.mockito.Mockito.verify;
import org.assertj.core.api.AssertionInfo;
import org.assertj.core.internal.CharArrays;
import org.assertj.core.internal.CharArraysBaseTest;
import org.junit.Test;
/**
* Tests for <code>{@link CharArrays#assertContainsOnly(AssertionInfo, char[], char[])}</code>.
*
* @author Alex Ruiz
* @author Joel Costigliola
*/
public class CharArrays_assertContainsOnly_Test extends CharArraysBaseTest {
@Test
public void should_pass_if_actual_contains_given_values_only() {
arrays.assertContainsOnly(someInfo(), actual, arrayOf('a', 'b', 'c'));
}
@Test
public void should_pass_if_actual_contains_given_values_only_in_different_order() {
arrays.assertContainsOnly(someInfo(), actual, arrayOf('c', 'b', 'a'));
}
@Test
public void should_pass_if_actual_contains_given_values_only_more_than_once() {
actual = arrayOf('a', 'b', 'c', 'c', 'c');
arrays.assertContainsOnly(someInfo(), actual, arrayOf('a', 'b', 'c'));
}
@Test
public void should_pass_if_actual_contains_given_values_only_even_if_duplicated() {
arrays.assertContainsOnly(someInfo(), actual, arrayOf('a', 'b', 'c', 'a', 'b', 'c'));
}
@Test
public void should_pass_if_actual_and_given_values_are_empty() {
actual = emptyArray();
arrays.assertContainsOnly(someInfo(), actual, emptyArray());
}
@Test
public void should_fail_if_array_of_values_to_look_for_is_empty_and_actual_is_not() {
thrown.expect(AssertionError.class);
arrays.assertContainsOnly(someInfo(), actual, emptyArray());
}
@Test
public void should_throw_error_if_array_of_values_to_look_for_is_null() {
thrown.expectNullPointerException(valuesToLookForIsNull());
arrays.assertContainsOnly(someInfo(), actual, null);
}
@Test
public void should_fail_if_actual_is_null() {
thrown.expectAssertionError(actualIsNull());
arrays.assertContainsOnly(someInfo(), null, arrayOf('a'));
}
@Test
public void should_fail_if_actual_does_not_contain_given_values_only() {
AssertionInfo info = someInfo();
char[] expected = { 'a', 'b', 'd' };
try {
arrays.assertContainsOnly(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainOnly(actual, expected, newLinkedHashSet('d'), newLinkedHashSet('c')));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
@Test
public void should_pass_if_actual_contains_given_values_only_according_to_custom_comparison_strategy() {
arraysWithCustomComparisonStrategy.assertContainsOnly(someInfo(), actual, arrayOf('A', 'b', 'c'));
}
@Test
public void should_pass_if_actual_contains_given_values_only_in_different_order_according_to_custom_comparison_strategy() {
arraysWithCustomComparisonStrategy.assertContainsOnly(someInfo(), actual, arrayOf('c', 'b', 'A'));
}
@Test
public void should_pass_if_actual_contains_given_values_only_more_than_once_according_to_custom_comparison_strategy() {
actual = arrayOf('A', 'b', 'c', 'c', 'c');
arraysWithCustomComparisonStrategy.assertContainsOnly(someInfo(), actual, arrayOf('A', 'b', 'c'));
}
@Test
public void should_pass_if_actual_contains_given_values_only_even_if_duplicated_according_to_custom_comparison_strategy() {
arraysWithCustomComparisonStrategy.assertContainsOnly(someInfo(), actual, arrayOf('A', 'b', 'c', 'A', 'b', 'c'));
}
@Test
public void should_fail_if_array_of_values_to_look_for_is_empty_and_actual_is_not_whatever_custom_comparison_strategy_is() {
thrown.expect(AssertionError.class);
arraysWithCustomComparisonStrategy.assertContainsOnly(someInfo(), actual, emptyArray());
}
@Test
public void should_throw_error_if_array_of_values_to_look_for_is_null_whatever_custom_comparison_strategy_is() {
thrown.expectNullPointerException(valuesToLookForIsNull());
arraysWithCustomComparisonStrategy.assertContainsOnly(someInfo(), actual, null);
}
@Test
public void should_fail_if_actual_is_null_whatever_custom_comparison_strategy_is() {
thrown.expectAssertionError(actualIsNull());
arraysWithCustomComparisonStrategy.assertContainsOnly(someInfo(), null, arrayOf('A'));
}
@Test
public void should_fail_if_actual_does_not_contain_given_values_only_according_to_custom_comparison_strategy() {
AssertionInfo info = someInfo();
char[] expected = { 'A', 'b', 'd' };
try {
arraysWithCustomComparisonStrategy.assertContainsOnly(info, actual, expected);
} catch (AssertionError e) {
verify(failures).failure(info, shouldContainOnly(actual, expected, newLinkedHashSet('d'), newLinkedHashSet('c'), caseInsensitiveComparisonStrategy));
return;
}
failBecauseExpectedAssertionErrorWasNotThrown();
}
}
| [
"joel.costigliola@gmail.com"
] | joel.costigliola@gmail.com |
812b31a119b0b450b4556a81114fbf2281e789ab | 656ce78b903ef3426f8f1ecdaee57217f9fbc40e | /src/o/acc.java | 24d4c3bedd60a34b2f0cb73026cecf0e8d856433 | [] | no_license | zhuharev/periscope-android-source | 51bce2c1b0b356718be207789c0b84acf1e7e201 | 637ab941ed6352845900b9d465b8e302146b3f8f | refs/heads/master | 2021-01-10T01:47:19.177515 | 2015-12-25T16:51:27 | 2015-12-25T16:51:27 | 48,586,306 | 8 | 10 | null | null | null | null | UTF-8 | Java | false | false | 281 | java | // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: braces fieldsfirst space lnc
package o;
public interface acc
{
public abstract byte[] aA();
public abstract byte[] aB();
}
| [
"hostmaster@zhuharev.ru"
] | hostmaster@zhuharev.ru |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.