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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
944bd9560abce24ce65801baf5d82488519f1ea5 | 7463234200df3540cff34861e1518c100664e25f | /WebBasics/WorkshopJspJpa /metube2/src/main/java/metube/domain/models/binding/UserLoginBindingModel.java | abbdd612bc87850dd19a19bb04a2bd598d552b47 | [] | no_license | HristoRaykov/JavaWeb-01.2019 | bc0ab9e57050ddff7665b40292caa95799ab6bce | be125d887d5bc23a4fcf04a3d098c1e2a0bb02df | refs/heads/master | 2020-04-21T22:56:18.156745 | 2019-05-07T09:33:31 | 2019-05-07T09:33:31 | 169,929,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 545 | java | package metube.domain.models.binding;
import metube.domain.entities.enums.UserRole;
public class UserLoginBindingModel {
private String username;
private String password;
public UserLoginBindingModel() {
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
}
| [
"hristocr@gmail.com"
] | hristocr@gmail.com |
8d3df3944f52fd1c4f2842a7b7b9edcd4ee80f40 | c885ef92397be9d54b87741f01557f61d3f794f3 | /tests-without-trycatch/Math-9/org.apache.commons.math3.geometry.euclidean.threed.Line/default/18/org/apache/commons/math3/geometry/euclidean/threed/Line_ESTest_scaffolding.java | 8f800acc96780a678481d094603e33532788a7a2 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 8,000 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Jul 30 13:55:48 GMT 2021
*/
package org.apache.commons.math3.geometry.euclidean.threed;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
import org.junit.AfterClass;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
@EvoSuiteClassExclude
public class Line_ESTest_scaffolding {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.math3.geometry.euclidean.threed.Line";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}
@AfterClass
public static void clearEvoSuiteFramework(){
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
public static void setSystemProperties() {
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("user.dir", "/experiment");
java.lang.System.setProperty("java.io.tmpdir", "/tmp");
}
private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(Line_ESTest_scaffolding.class.getClassLoader() ,
"org.apache.commons.math3.geometry.Vector",
"org.apache.commons.math3.geometry.euclidean.threed.Vector3DFormat",
"org.apache.commons.math3.util.Precision",
"org.apache.commons.math3.exception.util.ExceptionContextProvider",
"org.apache.commons.math3.geometry.Space",
"org.apache.commons.math3.geometry.euclidean.oned.IntervalsSet",
"org.apache.commons.math3.util.MathArrays",
"org.apache.commons.math3.geometry.euclidean.oned.Vector1D",
"org.apache.commons.math3.exception.util.ArgUtils",
"org.apache.commons.math3.exception.MathArithmeticException",
"org.apache.commons.math3.exception.NumberIsTooSmallException",
"org.apache.commons.math3.geometry.partitioning.BSPTreeVisitor",
"org.apache.commons.math3.exception.MathInternalError",
"org.apache.commons.math3.exception.NotPositiveException",
"org.apache.commons.math3.exception.MathIllegalStateException",
"org.apache.commons.math3.geometry.VectorFormat",
"org.apache.commons.math3.exception.NonMonotonicSequenceException",
"org.apache.commons.math3.exception.MathIllegalArgumentException",
"org.apache.commons.math3.geometry.euclidean.threed.Line",
"org.apache.commons.math3.geometry.euclidean.threed.SubLine",
"org.apache.commons.math3.util.FastMath$CodyWaite",
"org.apache.commons.math3.exception.MathIllegalNumberException",
"org.apache.commons.math3.util.CompositeFormat",
"org.apache.commons.math3.exception.util.LocalizedFormats",
"org.apache.commons.math3.geometry.partitioning.AbstractRegion",
"org.apache.commons.math3.exception.MathParseException",
"org.apache.commons.math3.geometry.partitioning.Region",
"org.apache.commons.math3.util.FastMath",
"org.apache.commons.math3.exception.DimensionMismatchException",
"org.apache.commons.math3.geometry.euclidean.oned.Euclidean1D",
"org.apache.commons.math3.exception.util.Localizable",
"org.apache.commons.math3.geometry.partitioning.BSPTree",
"org.apache.commons.math3.exception.NotStrictlyPositiveException",
"org.apache.commons.math3.exception.util.ExceptionContext",
"org.apache.commons.math3.geometry.euclidean.threed.Vector3D",
"org.apache.commons.math3.exception.NullArgumentException",
"org.apache.commons.math3.geometry.euclidean.oned.Vector1DFormat",
"org.apache.commons.math3.geometry.partitioning.Embedding",
"org.apache.commons.math3.geometry.euclidean.threed.Euclidean3D",
"org.apache.commons.math3.geometry.partitioning.SubHyperplane"
);
}
private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(Line_ESTest_scaffolding.class.getClassLoader());
org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"org.apache.commons.math3.geometry.euclidean.threed.Line",
"org.apache.commons.math3.exception.util.LocalizedFormats",
"org.apache.commons.math3.util.FastMath",
"org.apache.commons.math3.util.Precision",
"org.apache.commons.math3.geometry.euclidean.threed.Vector3D",
"org.apache.commons.math3.exception.MathIllegalArgumentException",
"org.apache.commons.math3.exception.util.ExceptionContext",
"org.apache.commons.math3.exception.util.ArgUtils",
"org.apache.commons.math3.util.FastMath$CodyWaite",
"org.apache.commons.math3.util.MathArrays",
"org.apache.commons.math3.exception.MathIllegalNumberException",
"org.apache.commons.math3.exception.DimensionMismatchException",
"org.apache.commons.math3.geometry.VectorFormat",
"org.apache.commons.math3.geometry.euclidean.threed.Vector3DFormat",
"org.apache.commons.math3.util.CompositeFormat",
"org.apache.commons.math3.geometry.euclidean.oned.Vector1D",
"org.apache.commons.math3.geometry.euclidean.oned.Vector1DFormat",
"org.apache.commons.math3.geometry.euclidean.threed.SubLine",
"org.apache.commons.math3.geometry.partitioning.AbstractRegion",
"org.apache.commons.math3.geometry.euclidean.oned.IntervalsSet",
"org.apache.commons.math3.geometry.partitioning.BSPTree",
"org.apache.commons.math3.geometry.euclidean.threed.Euclidean3D",
"org.apache.commons.math3.geometry.euclidean.threed.Euclidean3D$LazyHolder",
"org.apache.commons.math3.exception.MathArithmeticException",
"org.apache.commons.math3.geometry.euclidean.oned.Euclidean1D",
"org.apache.commons.math3.geometry.euclidean.oned.Euclidean1D$LazyHolder"
);
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
7133712c6ab880c5cd53cc7caf578d6b396861d8 | 83436380fe01acf30dd154294b3da930e58c5ceb | /BelejanorProject/src/com/belejanor/switcher/bimo/pacs/camt_998_321/Reason.java | 56ba0b2576a4da5707ace85c1735ffac7725e383 | [] | no_license | jmptrader/BelejanorSwitch | 83e847ee3dc6a555a40e6347f40af4e106c9054f | ce11d46b5ed52b89d22b5890f1e4fad29730125a | refs/heads/master | 2023-02-07T07:22:42.266465 | 2020-12-27T05:07:15 | 2020-12-27T05:07:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,915 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-520
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2018.03.01 at 02:22:51 PM COT
//
package com.belejanor.switcher.bimo.pacs.camt_998_321;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Reason complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="Reason">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="Code" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.321}ReasonCode"/>
* <element name="AddtlInf" type="{urn:iso:std:iso:20022:tech:xsd:camt.998.321}Max105Text" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@SuppressWarnings("serial")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Reason", propOrder = {
"code",
"addtlInf"
})
public class Reason implements Serializable{
@XmlElement(name = "Code", required = true)
protected String code;
@XmlElement(name = "AddtlInf")
protected List<String> addtlInf;
/**
* Gets the value of the code property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCode() {
return code;
}
/**
* Sets the value of the code property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCode(String value) {
this.code = value;
}
/**
* Gets the value of the addtlInf 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 addtlInf property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAddtlInf().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getAddtlInf() {
if (addtlInf == null) {
addtlInf = new ArrayList<String>();
}
return this.addtlInf;
}
}
| [
"jorellana29@gmail.com"
] | jorellana29@gmail.com |
a4f6954d908b0cdcf520de8c81f900210be1ba1b | a046fab691517432a59b06b4db559071cf1fc643 | /src/main/java/com/cy/util/UtilStringEx.java | 9e81cb2588f5758a249f927839aa92bc47c074d7 | [] | no_license | djun100/AutoGen | edbfd599b54de79f742fd374379cc88c0cff7da2 | 974d2a82269ddbfb3d1976bf99ca2f3905656cc2 | refs/heads/master | 2020-04-23T11:20:48.041205 | 2019-06-06T04:01:22 | 2019-06-06T04:01:22 | 171,133,515 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,063 | java | package com.cy.util;
import com.cy.data.UtilString;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
/**
* Created by cy on 2017/6/30.
*/
public class UtilStringEx {
/**首字母大写*/
public static String upperFirstLetter(String str){
str =str.replaceFirst(str.substring(0, 1), str.substring(0, 1).toUpperCase()) ;
return str;
}
public static String valueOf(String s){
if (s==null) return "";
return s;
}
public static String addTailIfNotHas(String original,String tail){
if (UtilString.isEmpty(original)) return tail;
if (UtilString.isEmpty(tail)) return original;
return original.endsWith(tail) ? original : original + tail;
}
public static String removeTailIfHas(String original,String tail){
if (UtilString.isEmpty(original)) return original;
if (UtilString.isEmpty(tail)) return original;
return original.endsWith(tail) ? original.substring(0,original.length()-tail.length()) : original;
}
public static String readResourcesFileContent(String resourcePathName) {
//resource路径必须/开头
resourcePathName = resourcePathName.startsWith("/") ? resourcePathName : "/" + resourcePathName;
StringBuilder stringBuilder = new StringBuilder();
InputStream is = UtilFile.class.getResourceAsStream(resourcePathName);
BufferedReader br = null;
try {
br = new BufferedReader(new InputStreamReader(is));
} catch (Exception e) {
e.printStackTrace();
}
String s = "";
try {
while ((s = br.readLine()) != null) {
stringBuilder.append(s).append("\n");
}
} catch (IOException e) {
e.printStackTrace();
}
String result = stringBuilder.toString();
if (result.length() > 0) {
result = result.substring(0, result.length() - 1);
}
return result;
}
}
| [
"djun100@qq.com"
] | djun100@qq.com |
640fe152015bc96e5e532ad7ddf60773e28158ee | a3a54e8c694730ea5ae071cc198db50582ca7ab6 | /学习笔记/Java Web Notes/JavaWeb/day18-JDBC/code/day18_5/src/dbutils/test/Stu.java | 6ed05755e6bc7769b8822906064929ab1f122b0a | [] | no_license | zhhqiang9198/Giovani-resource | 3f807c97f231a00b694a1bd8adaa7816aab90af4 | aa30dcac2af0b34c6f14f55635199a9319ef3685 | refs/heads/master | 2021-10-18T17:15:22.759832 | 2019-01-16T10:01:20 | 2019-01-16T10:01:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 585 | java | package dbutils.test;
/**
* @author Administrator
*
*/
public class Stu {
private String sname;
private int age;
public String getSname() {
return sname;
}
public void setSname(String sname) {
this.sname = sname;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
@Override
public String toString() {
return "Stu [sname=" + sname + ", age=" + age + "]";
}
public Stu() {
super();
// TODO Auto-generated constructor stub
}
public Stu(String sname, int age) {
super();
this.sname = sname;
this.age = age;
}
}
| [
"15219331778@163.com"
] | 15219331778@163.com |
f553edc80431eda75638a3c0242347a5ec8307e3 | 7fc7b8ea77698230ac6fa6710fc872a7e5ea16cf | /menggeba/mall-base-service/src/main/java/com/vivebest/mall/dao/OrderDao.java | 4b2d373a529c678277441b9b99a3328553402af0 | [] | no_license | 1473478496/JavaMaven | 1c8f82868a3cd08e40ddc16e478678d50b2fcc6a | 6affc09c8207103f2481957f850ecbbecd6d2936 | refs/heads/master | 2020-03-07T16:54:07.660234 | 2018-04-01T04:48:32 | 2018-04-01T04:48:32 | 127,591,841 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,758 | java | /*
* Copyright 2005-2013 www.mgb.cn. All rights reserved.
* Support: http://www.mgb.cn
* License: http://www.mgb.cn/license
*/
package com.vivebest.mall.dao;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.vivebest.mall.core.common.Filter;
import com.vivebest.mall.core.common.Page;
import com.vivebest.mall.core.common.Pageable;
import com.vivebest.mall.core.dao.BaseDao;
import com.vivebest.mall.entity.Member;
import com.vivebest.mall.entity.Order;
import com.vivebest.mall.entity.Order.OrderStatus;
import com.vivebest.mall.entity.Order.PaymentStatus;
import com.vivebest.mall.entity.Order.ShippingStatus;
/**
* Dao - 订单
*
* @author vnb shop Team
* @version 3.0
*/
public interface OrderDao extends BaseDao<Order, Long> {
public int updateBySn(String sn,String name);
/**
* 根据订单编号查找订单
*
* @param sn
* 订单编号(忽略大小写)
* @return 订单,若不存在则返回null
*/
Order findBySn(String sn);
/**
* 查找订单
*
* @param member
* 会员
* @param count
* 数量
* @param filters
* 筛选
* @param orders
* 排序
* @return 订单
*/
List<Order> findList(Member member, Integer count, List<Filter> filters, List<com.vivebest.mall.core.common.Order> orders);
/**
* 查找订单分页
*
* @param orderStatus
* 订单状态
* @param member
* 会员
* @param pageable
* 分页信息
* @return 订单分页
*/
Page<Order> findPage(OrderStatus orderStatus,String sn, Member member, Pageable pageable);
/**
* 查找订单分页
*
* @param member
* 会员
* @param pageable
* 分页信息
* @return 订单分页
*/
Page<Order> findPage(Member member, Pageable pageable);
/**
* 查找订单分页
* @param member
* 会员
* @param beginDate
* 起始日期
* @param endDate
* 结束日期
* @param pageable
* 分页信息
* @return
*/
Page<Order> findPage(Member member, Date beginDate, Date endDate, Pageable pageable);
/**
* 查找订单分页
*
* @param orderStatus
* 订单状态
* @param paymentStatus
* 支付状态
* @param shippingStatus
* 配送状态
* @param hasExpired
* 是否已过期
* @param pageable
* 分页信息
* @return 商品分页
*/
Page<Order> findPage(Date beginDate, Date endDate,OrderStatus orderStatus, PaymentStatus paymentStatus, ShippingStatus shippingStatus, Boolean hasExpired, Pageable pageable);
/**
* 查找订单
*
* @param orderStatus
* 订单状态
* @param paymentStatus
* 支付状态
* @param shippingStatus
* 配送状态
* @param hasExpired
* 是否已过期
* @param pageable
* 分页信息
* @return 商品分页
*/
List<Order> findList(OrderStatus orderStatus, PaymentStatus paymentStatus, ShippingStatus shippingStatus,
Boolean hasExpired, Pageable pageable,Date bDate, Date eDate);
/**
* 查询订单数量
*
* @param orderStatus
* 订单状态
* @param paymentStatus
* 支付状态
* @param shippingStatus
* 配送状态
* @param hasExpired
* 是否已过期
* @return 订单数量
*/
Long count(Member member,OrderStatus orderStatus, PaymentStatus paymentStatus, ShippingStatus shippingStatus, Boolean hasExpired);
/**
* 查询等待支付订单数量
*
* @param member
* 会员
* @return 等待支付订单数量
*/
Long waitingPaymentCount(Member member);
/**
* 查询等待发货订单数量
*
* @param member
* 会员
* @return 等待发货订单数量
*/
Long waitingShippingCount(Member member);
/**
* 获取销售额
*
* @param beginDate
* 起始日期
* @param endDate
* 结束日期
* @return 销售额
*/
BigDecimal getSalesAmount(Date beginDate, Date endDate);
/**
* 获取销售量
*
* @param beginDate
* 起始日期
* @param endDate
* 结束日期
* @return 销售量
*/
Integer getSalesVolume(Date beginDate, Date endDate);
/**
* 释放过期订单库存
*/
void releaseStock();
List findPage(Order order, String ssn ,String psn,String pname,String mname,String bDate,String eDate,Integer orderStatue,Integer shippingStatue,Integer payStatue,Boolean hasExpired);
/**
* 根据id查询订单列表
* @param list
* @return
*/
Page<Order> findById(List<Long> list,Pageable pageable);
Page<Order> findPageMeOrderId(String sn, String member, Pageable pageable);
} | [
"1473478496@qq.com"
] | 1473478496@qq.com |
52651f95e8cf11f43c5ca8b8e00647c620616d2b | f459a141957c1c00f399754ddb8044a2254cbf5d | /app/src/test/java/com/mma/basicappupdate/ExampleUnitTest.java | f5f92ebc79835a46d6c3348ab211f47cfbce9d66 | [] | no_license | Shwesi/nnlappupdate | d75c89c536eff0b74470f5f3db6d73fa11c0da57 | cedc6d7143fb48f861f213349bc47eb2a42c2bb6 | refs/heads/master | 2020-07-24T06:08:49.250985 | 2019-09-11T15:17:59 | 2019-09-11T15:17:59 | 207,823,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 386 | java | package com.mma.basicappupdate;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals ( 4, 2 + 2 );
}
} | [
"linkstar2012@gmail.com"
] | linkstar2012@gmail.com |
5345465d470b91ffb4dd0b2b1bfc1f633eab1a8e | 29026c160acab70b7342f307e77c1769eb067449 | /app/src/main/java/com/zhuandian/myapplication/ise/result/entity/Sentence.java | 6a05768033578088c66f05f60e8b5159aa7ed39f | [] | no_license | xiedong11/xunfei_Ise | d140349270ba824243b42d7b788712e7f3d70a7e | 4f8c8bae3f1705ba1394231e8ff600acbc3ecbf6 | refs/heads/master | 2020-09-14T11:39:45.413699 | 2019-11-21T07:52:23 | 2019-11-21T07:52:23 | 223,118,404 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 819 | java | /**
*
*/
package com.zhuandian.myapplication.ise.result.entity;
import java.util.ArrayList;
/**
* <p>Title: Sentence</p>
* <p>Description: 句子,对应于xml结果中的sentence标签</p>
* <p>Company: www.iflytek.com</p>
* @author iflytek
* @date 2015年1月12日 下午4:10:09
*/
public class Sentence {
/**
* 开始帧位置,每帧相当于10ms
*/
public int beg_pos;
/**
* 结束帧位置
*/
public int end_pos;
/**
* 句子内容
*/
public String content;
/**
* 总得分
*/
public float total_score;
/**
* 时长(单位:帧,每帧相当于10ms)(cn)
*/
public int time_len;
/**
* 句子的索引(en)
*/
public int index;
/**
* 单词数(en)
*/
public int word_count;
/**
* sentence包括的word
*/
public ArrayList<Word> words;
}
| [
"xiedong11@aliyun.com"
] | xiedong11@aliyun.com |
053f9eaf9f62315eca2022707c018bc68b25d530 | 214cabb86914dd10b7185af3080ab811ff20ba45 | /CucumberProjectBySDET/src/test/java/PageObjects/AddCustomerPage.java | 4446b1838d1d4181987140a2cf7069ff50c35b83 | [] | no_license | Ramkrushna93/CucumberFrameWork | 529c43b421bc137af3d37acbd27cff49f58603eb | 6acf18ba2d065807d1011f8820b4ae1511cace85 | refs/heads/master | 2021-07-08T09:46:23.085949 | 2020-01-18T18:11:37 | 2020-01-18T18:11:37 | 234,775,511 | 0 | 0 | null | 2021-03-31T21:51:38 | 2020-01-18T18:06:11 | Java | UTF-8 | Java | false | false | 940 | java | package PageObjects;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.support.PageFactory;
public class AddCustomerPage {
public WebDriver rdriver;
public AddCustomerPage(WebDriver ldriver) {
ldriver = rdriver;
PageFactory.initElements(rdriver, this);
}
By lnkcustomer_menu = By.xpath("(//span[text()='Customers'])[1]");
By lnkcustomer_menuitem = By.xpath("(//span[text()='Customers'])[2]");
By btnaddnew = By.xpath("//a[@class=\"btn bg-blue\"]");
By txtemail = By.id("Email");
public void clickOnCustomerMenu() {
rdriver.findElement(lnkcustomer_menu).click();
}
public void clickOnCustoMenuItems() {
rdriver.findElement(lnkcustomer_menuitem).click();
}
public void clickOnAddnew() {
rdriver.findElement(btnaddnew).click();
}
public void setmail(String email) {
rdriver.findElement(txtemail).sendKeys(email);
}
}
| [
"USER@USER-PC"
] | USER@USER-PC |
2255fcd22e1608013126052fc4b22eb38954def8 | 46167791cbfeebc8d3ddc97112764d7947fffa22 | /spring-boot/src/main/java/com/justexample/repository/Entity0436Repository.java | ab7d739f9eacfe0237f4beb4b56c1130a4a7399a | [] | no_license | kahlai/unrealistictest | 4f668b4822a25b4c1f06c6b543a26506bb1f8870 | fe30034b05f5aacd0ef69523479ae721e234995c | refs/heads/master | 2023-08-25T09:32:16.059555 | 2021-11-09T08:17:22 | 2021-11-09T08:17:22 | 425,726,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 252 | java | package com.justexample.repository;
import java.util.List;
import com.justexample.entity.Entity0436;
import org.springframework.data.jpa.repository.JpaRepository;
public interface Entity0436Repository extends JpaRepository<Entity0436,Long>{
}
| [
"laikahhoe@gmail.com"
] | laikahhoe@gmail.com |
883d38c44ee24961a9eb269dc0c050697133f9f7 | 63217a91d73674add57c6395f05ba891233b8c84 | /dart/editor/tools/plugins/com.google.dart.tools.debug.core_test/src/com/google/dart/tools/debug/core/pubserve/PubConnectionTest.java | da06b789e07b18b40473c5d7c62897526ba5d56f | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | AurelienBallier/dart-sdk | f020f55388f50e475e51124e4b8005719e9f13e6 | 66931ab8372ef61e3ea421f094764d158f0a0669 | refs/heads/master | 2020-07-09T08:30:47.662771 | 2015-04-13T13:40:41 | 2015-04-13T13:40:41 | 33,870,380 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,388 | java | /*
* Copyright (c) 2013, the Dart project authors.
*
* Licensed under the Eclipse Public License v1.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.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package com.google.dart.tools.debug.core.pubserve;
import com.google.dart.engine.sdk.DirectoryBasedDartSdk;
import com.google.dart.tools.core.generator.WebAppSample;
import com.google.dart.tools.core.model.DartSdkManager;
import com.google.dart.tools.core.test.util.PlainTestProject;
import com.google.dart.tools.core.utilities.net.NetUtils;
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
public class PubConnectionTest extends TestCase {
// pub ==> {"id":1,"method":"pathToUrls","params":{"path":"web/foo.html"},"jsonrpc":"2.0"}
// pub <== {"id":1,"result":{"urls":["http://127.0.0.1:8080/foo.html"]},"jsonrpc":"2.0"}
// pub ==> {"id":2,"method":"urlToAssetId","params":{"url":"http://127.0.0.1:8080/foo.html"},"jsonrpc":"2.0"}
// pub <== {"id":2,"result":{"path":"web/foo.html","package":"foo"},"jsonrpc":"2.0"}
// pub ==> {"id":3,"method":"serveDirectory","params":{"path":"test"},"jsonrpc":"2.0"}
// pub <== {"id":3,"result":{"url":"http://127.0.0.1:8081"},"jsonrpc":"2.0"}
private PubCallback<String> serveDirectoryCallback = new PubCallback<String>() {
@Override
public void handleResult(PubResult<String> result) {
assertTrue(!result.isError());
assertTrue(result.getResult().matches("http://.*"));
latch.countDown();
}
};
private PubCallback<String> assetToUrlCallback = new PubCallback<String>() {
@Override
public void handleResult(PubResult<String> result) {
assertTrue(!result.isError());
assertTrue(result.getResult().matches("http://.*"));
assertTrue(result.getResult().contains("foo.html"));
latch.countDown();
}
};
private PubCallback<PubAsset> urlToAssestCallback = new PubCallback<PubAsset>() {
@Override
public void handleResult(PubResult<PubAsset> result) {
assertTrue(!result.isError());
assertEquals("foo", result.getResult().getPackageStr());
assertEquals("web/foo.html", result.getResult().getPath());
latch.countDown();
}
};
protected PubConnection connection;
private PlainTestProject testProject;
private Process process;
private String port;
private PubConnection pubConnection;
private StringBuilder stdOut = new StringBuilder();
private static CountDownLatch latch;
/**
* An integration test of pub protocol support.
*/
public void testPubProtocolIntegration() throws Exception {
PubCommands command = pubConnection.getCommands();
latch = new CountDownLatch(1);
command.pathToUrl("web/foo.html", assetToUrlCallback);
if (!latch.await(3000, TimeUnit.MILLISECONDS)) {
throw new Exception("No response from pub command assetIdToUrl");
}
latch = new CountDownLatch(1);
command.urlToAssetId("http://localhost:8080/foo.html", urlToAssestCallback);
if (!latch.await(5000, TimeUnit.MILLISECONDS)) {
throw new Exception("No response from pub command urlToAssestId");
}
// TODO(keertip): get test passing and enable
latch = new CountDownLatch(1);
command.serveDirectory("test", serveDirectoryCallback);
if (!latch.await(3000, TimeUnit.MILLISECONDS)) {
throw new Exception("No response from pub command serveDirectory");
}
}
@Override
protected void setUp() throws Exception {
testProject = new PlainTestProject("webby");
IProject project = testProject.getProject();
WebAppSample generator = new WebAppSample();
generator.generateInto(project, "foo");
testProject.setFileContent("pubspec.lock", "packages:\n"
+ " browser:\n description: browser\n source: hosted\n version: \"0.10.0\"");
testProject.createFolder("test");
testProject.setFileContent("test/test.dart", "main() {}");
List<String> args = buildPubServeCommand();
ProcessBuilder builder = new ProcessBuilder();
builder.command(args);
builder.directory(project.getLocation().toFile());
process = builder.start();
Thread stdoutThread = new Thread(new Runnable() {
@Override
public void run() {
try {
copyStream(process.getInputStream(), stdOut);
} catch (IOException e) {
processDestroy();
fail("Exception while reading pub serve stdout");
}
}
});
stdoutThread.start();
// Increased timeout 3 -> 30 sec for buildbots
long endTime = System.currentTimeMillis() + 30 * 1000;
while (!isTerminated() && !stdOut.toString().contains("127.0.0.1")
&& System.currentTimeMillis() < endTime) {
try {
Thread.sleep(200);
} catch (InterruptedException exception) {
// do nothing, continue
}
}
if (isTerminated()) {
fail("Pub serve process terminated");
}
if (!stdOut.toString().contains("127.0.0.1")) {
fail("Timeout: pub serve did not start in 3 secs");
processDestroy();
}
pubConnection = new PubConnection(new URI("ws://127.0.0.1:" + port + "/"));
pubConnection.connect();
}
@Override
protected void tearDown() throws Exception {
try {
testProject.dispose();
} catch (Exception e) {
processDestroy();
fail("Exception while deleting test project");
}
processDestroy();
}
private List<String> buildPubServeCommand() {
DirectoryBasedDartSdk sdk = DartSdkManager.getManager().getSdk();
File pubFile = sdk.getPubExecutable();
List<String> args = new ArrayList<String>();
args.add(pubFile.getAbsolutePath());
args.add("serve");
args.add("--admin-port");
port = Integer.toString(NetUtils.findUnusedPort(8080));
args.add(port);
args.add("--hostname");
args.add("127.0.0.1");
// args.add("--verbose");
return args;
}
private void copyStream(InputStream in, StringBuilder stringBuilder) throws IOException {
byte[] buffer = new byte[2048];
try {
int count = in.read(buffer);
while (count != -1) {
if (count > 0) {
String str = new String(buffer, 0, count);
stringBuilder.append(str);
}
count = in.read(buffer);
}
in.close();
} catch (IOException ioe) {
in.close();
process.destroy();
fail("IOException while reading pub serve stream");
}
}
private boolean isTerminated() {
try {
if (process != null) {
process.exitValue();
}
} catch (IllegalThreadStateException exception) {
return false;
}
return true;
}
private void processDestroy() {
if (process != null) {
process.destroy();
}
}
}
| [
"aurelien.ballier@cyclonit.com"
] | aurelien.ballier@cyclonit.com |
65a66a690f5279a3a91ae3e8554a0f5cd8623bf8 | 2fa04f21cbb7203b468f7598df6696a88b05a286 | /bus-image/src/main/java/org/aoju/bus/image/metric/StorageOptions.java | 7312f05bc0fe06cb2fb8a0fdbd7451617fd2b3aa | [
"MIT"
] | permissive | jingshuai5213/bus | 17bb475fd76592682123488608a559abec788f81 | f3ec545617acffaf2668ea78e974a05be268cfd1 | refs/heads/master | 2022-11-16T00:35:46.037858 | 2020-07-02T09:35:10 | 2020-07-02T09:35:10 | 254,873,385 | 0 | 0 | MIT | 2020-07-02T09:35:11 | 2020-04-11T13:26:50 | null | UTF-8 | Java | false | false | 6,343 | java | /*********************************************************************************
* *
* The MIT License (MIT) *
* *
* Copyright (c) 2015-2020 aoju.org and other contributors. *
* *
* 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 org.aoju.bus.image.metric;
import org.aoju.bus.image.metric.internal.pdu.ExtendedNegotiate;
import java.io.Serializable;
/**
* @author Kimi Liu
* @version 6.0.1
* @since JDK 1.8+
*/
public class StorageOptions implements Serializable {
private LevelOfSupport levelOfSupport;
private DigitalSignatureSupport digitalSignatureSupport;
private ElementCoercion elementCoercion;
public StorageOptions() {
this(LevelOfSupport.UNSPECIFIED,
DigitalSignatureSupport.UNSPECIFIED,
ElementCoercion.UNSPECIFIED);
}
public StorageOptions(LevelOfSupport levelOfSupport,
DigitalSignatureSupport levelOfDigitalSignatureSupport,
ElementCoercion getElementCoercion) {
this.levelOfSupport = levelOfSupport;
this.digitalSignatureSupport = levelOfDigitalSignatureSupport;
this.elementCoercion = getElementCoercion;
}
public static StorageOptions valueOf(ExtendedNegotiate extNeg) {
return new StorageOptions(
LevelOfSupport.valueOf(extNeg.getField(0, (byte) 3)),
DigitalSignatureSupport.valueOf(extNeg.getField(2, (byte) 0)),
ElementCoercion.valueOf(extNeg.getField(4, (byte) 2)));
}
public final LevelOfSupport getLevelOfSupport() {
return levelOfSupport;
}
public final void setLevelOfSupport(LevelOfSupport levelOfSupport) {
this.levelOfSupport = levelOfSupport;
}
public final DigitalSignatureSupport getDigitalSignatureSupport() {
return digitalSignatureSupport;
}
public final void setDigitalSignatureSupport(
DigitalSignatureSupport digitalSignatureSupport) {
this.digitalSignatureSupport = digitalSignatureSupport;
}
public final ElementCoercion getElementCoercion() {
return elementCoercion;
}
public final void setElementCoercion(ElementCoercion elementCoercion) {
this.elementCoercion = elementCoercion;
}
public byte[] toExtendedNegotiationInformation() {
return new byte[]{
(byte) levelOfSupport.ordinal(), 0,
(byte) digitalSignatureSupport.ordinal(), 0,
(byte) elementCoercion.ordinal(), 0};
}
@Override
public int hashCode() {
return levelOfSupport.hashCode()
+ digitalSignatureSupport.hashCode()
+ elementCoercion.hashCode();
}
@Override
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof StorageOptions))
return false;
StorageOptions other = (StorageOptions) o;
return levelOfSupport == other.levelOfSupport
&& digitalSignatureSupport == other.digitalSignatureSupport
&& elementCoercion == other.elementCoercion;
}
@Override
public String toString() {
return "StorageOptions[levelOfSupport=" + levelOfSupport.ordinal()
+ ", digitalSignatureSupport=" + digitalSignatureSupport.ordinal()
+ ", elementCoercion=" + elementCoercion.ordinal() + "]";
}
public enum LevelOfSupport {
LEVEL_0, LEVEL_1, LEVEL_2, UNSPECIFIED;
public static LevelOfSupport valueOf(int level) {
switch (level) {
case 0:
return LEVEL_0;
case 1:
return LEVEL_1;
case 2:
return LEVEL_2;
}
return UNSPECIFIED;
}
}
public enum DigitalSignatureSupport {
UNSPECIFIED, LEVEL_1, LEVEL_2, LEVEL_3;
public static DigitalSignatureSupport valueOf(int level) {
switch (level) {
case 1:
return LEVEL_1;
case 2:
return LEVEL_2;
case 3:
return LEVEL_3;
}
return UNSPECIFIED;
}
}
public enum ElementCoercion {
NO, YES, UNSPECIFIED;
public static ElementCoercion valueOf(int i) {
switch (i) {
case 0:
return NO;
case 1:
return YES;
}
return UNSPECIFIED;
}
}
}
| [
"839536@qq.com"
] | 839536@qq.com |
a07eddb14bd15349b4be2bcbadee1d0b21d2a2ff | 016ffc668fcba9d84b22323ed1af521908dc78a6 | /src/test/java/com/excelmandarin/app/web/rest/ClientForwardControllerIT.java | a5f0b2d5e722c0bace88910bd54c72f9259b1e18 | [] | no_license | mctang719/excel-mandarin-application | 67c8ab93a49a953d37881b35ab608fdc1e756467 | aafd1a738665dd45710408a5a01f2ae857d36830 | refs/heads/master | 2021-08-16T05:31:51.284447 | 2019-10-25T02:58:21 | 2019-10-25T02:58:21 | 217,439,157 | 0 | 0 | null | 2020-09-04T00:33:08 | 2019-10-25T02:58:07 | Java | UTF-8 | Java | false | false | 2,392 | java | package com.excelmandarin.app.web.rest;
import com.excelmandarin.app.ExcelMandarinApplicationApp;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.http.MediaType;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
/**
* Integration tests for the {@link ClientForwardController} REST controller.
*/
@SpringBootTest(classes = ExcelMandarinApplicationApp.class)
public class ClientForwardControllerIT {
private MockMvc restMockMvc;
@BeforeEach
public void setup() {
ClientForwardController clientForwardController = new ClientForwardController();
this.restMockMvc = MockMvcBuilders
.standaloneSetup(clientForwardController, new TestController())
.build();
}
@Test
public void getBackendEndpoint() throws Exception {
restMockMvc.perform(get("/test"))
.andExpect(status().isOk())
.andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_PLAIN_VALUE))
.andExpect(content().string("test"));
}
@Test
public void getClientEndpoint() throws Exception {
ResultActions perform = restMockMvc.perform(get("/non-existant-mapping"));
perform
.andExpect(status().isOk())
.andExpect(forwardedUrl("/"));
}
@Test
public void getNestedClientEndpoint() throws Exception {
restMockMvc.perform(get("/admin/user-management"))
.andExpect(status().isOk())
.andExpect(forwardedUrl("/"));
}
@RestController
public static class TestController {
@RequestMapping(value = "/test")
public String test() {
return "test";
}
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
aa5e2410111e2814537d5e73ce11226e37923c3c | 5b82e2f7c720c49dff236970aacd610e7c41a077 | /QueryReformulation-master 2/data/processed/AnonymousPojoValuePropertyTest.java | c80af04fd313022c2a8b6d8d7ae45cb0dcdae6c7 | [] | no_license | shy942/EGITrepoOnlineVersion | 4b157da0f76dc5bbf179437242d2224d782dd267 | f88fb20497dcc30ff1add5fe359cbca772142b09 | refs/heads/master | 2021-01-20T16:04:23.509863 | 2016-07-21T20:43:22 | 2016-07-21T20:43:22 | 63,737,385 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 852 | java | /***/
package org.eclipse.core.tests.databinding.beans;
import org.eclipse.core.databinding.beans.PojoProperties;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.WritableValue;
import org.eclipse.core.databinding.property.value.IValueProperty;
import org.eclipse.jface.tests.databinding.AbstractDefaultRealmTestCase;
/**
* @since 3.2
*
*/
public class AnonymousPojoValuePropertyTest extends AbstractDefaultRealmTestCase {
public void testObserveDetailHavingNullValueType_UseExplicitValueType() {
IObservableValue master = WritableValue.withValueType(null);
IValueProperty prop = PojoProperties.value("value", String.class);
IObservableValue detail = prop.observeDetail(master);
assertEquals(String.class, detail.getValueType());
}
}
| [
"muktacseku@gmail.com"
] | muktacseku@gmail.com |
21803500296ecf6baafcd36c88e57f9dcaadafd2 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Hibernate/Hibernate10144.java | 1e4a7494d285f04577d5fee76775954d3b173ce0 | [] | 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 | 265 | java | public List<R> sort(Collection<Vertex<R>> vertices) {
sorted = new ArrayList<>( vertices.size() );
time = 1;
for ( Vertex<R> v : vertices ) {
if ( v.getEndTime() == 0 ) {
process( v );
}
}
Collections.reverse( sorted );
return sorted;
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
ff6fb0648d3782cc2e65d50afc9ed22e2d6d4646 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/Gson-18/com.google.gson.internal.$Gson$Types/BBC-F0-opt-100/tests/21/com/google/gson/internal/$Gson$Types_ESTest.java | ff7006b43e45d327629e49b2c2cdcabcb5a0d5ec | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 637 | java | /*
* This file was automatically generated by EvoSuite
* Sat Oct 23 03:52:04 GMT 2021
*/
package com.google.gson.internal;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class $Gson$Types_ESTest extends $Gson$Types_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
7d51768566ff5580cd2ed35f99764ca0b785528e | e61884cb126ddc64abf8c997af8b57de0bf1bcc1 | /baseio-test/src/main/java/com/generallycloud/test/nio/front/TestFrontServer.java | 58b0d3c6b266ef04a1eb7ff8633432b06b334882 | [
"Apache-2.0"
] | permissive | glpenghui/baseio | ecf691bf9f9f0ccee61a389840cb77234bbe4860 | 727217e15c1b5b40c7a86caf218befbaf5575247 | refs/heads/master | 2021-01-23T05:14:29.636372 | 2017-03-27T02:33:12 | 2017-03-27T02:33:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,459 | java | /*
* Copyright 2015-2017 GenerallyCloud.com
*
* 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.generallycloud.test.nio.front;
import java.io.IOException;
import com.generallycloud.baseio.codec.protobase.ProtobaseProtocolFactory;
import com.generallycloud.baseio.configuration.ServerConfiguration;
import com.generallycloud.baseio.front.FrontServerBootStrap;
public class TestFrontServer {
public static void main(String[] args) throws IOException {
FrontServerBootStrap f = new FrontServerBootStrap();
f.setFrontProtocolFactory(new ProtobaseProtocolFactory());
f.setFrontReverseProtocolFactory(new ProtobaseProtocolFactory());
ServerConfiguration fc = new ServerConfiguration();
fc.setSERVER_PORT(8900);
ServerConfiguration frc = new ServerConfiguration();
frc.setSERVER_PORT(8600);
f.setFrontServerConfiguration(fc);
f.setFrontReverseServerConfiguration(frc);
f.startup();
}
}
| [
"8738115@qq.com"
] | 8738115@qq.com |
783989aad26319a93b3a79841dd1321ac9b8d8e5 | 0d93eac5ab180bc6cf9ad36c8ea7b08e485980f9 | /src/main/java/com/helger/event/helper/crud/CRUDEventType.java | 00bb6ec1535b9f187167e3f45c8de19ae879db82 | [
"Apache-2.0"
] | permissive | phax/ph-events | ee63c51576ff6a4b68ea86f52490261b597a5ece | 33b96694e24bdc5b54efb608a227b257dfc53a1b | refs/heads/master | 2023-08-31T00:05:46.475011 | 2022-02-15T10:03:06 | 2022-02-15T10:03:06 | 31,646,461 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,675 | java | /**
* Copyright (C) 2015-2020 Philip Helger (www.helger.com)
* philip[at]helger[dot]com
*
* 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.helger.event.helper.crud;
import javax.annotation.Nonnull;
import javax.annotation.concurrent.Immutable;
import com.helger.commons.ValueEnforcer;
import com.helger.commons.annotation.Nonempty;
import com.helger.commons.hashcode.HashCodeGenerator;
import com.helger.commons.string.ToStringGenerator;
/**
* Default implementation if the {@link ICRUDEventType} interface.
*
* @author Philip Helger
*/
@Immutable
public class CRUDEventType implements ICRUDEventType
{
private final String m_sEventName;
private final EEventPointInTime m_ePointInTime;
private final EEventCRUD m_eCRUD;
public CRUDEventType (@Nonnull @Nonempty final String sBaseName,
@Nonnull final EEventPointInTime ePointInTime,
@Nonnull final EEventCRUD eCRUD)
{
ValueEnforcer.notNull (ePointInTime, "PointInTime");
ValueEnforcer.notNull (eCRUD, "CRUD");
m_sEventName = sBaseName + '.' + ePointInTime.getID () + '.' + eCRUD.getID ();
m_ePointInTime = ePointInTime;
m_eCRUD = eCRUD;
}
@Nonnull
@Nonempty
public String getName ()
{
return m_sEventName;
}
@Nonnull
public EEventPointInTime getPointInTime ()
{
return m_ePointInTime;
}
@Nonnull
public EEventCRUD getCRUD ()
{
return m_eCRUD;
}
@Override
public boolean equals (final Object o)
{
if (o == this)
return true;
if (o == null || !getClass ().equals (o.getClass ()))
return false;
final CRUDEventType rhs = (CRUDEventType) o;
return m_sEventName.equals (rhs.m_sEventName);
}
@Override
public int hashCode ()
{
return new HashCodeGenerator (this).append (m_sEventName).getHashCode ();
}
@Override
public String toString ()
{
return new ToStringGenerator (this).append ("Name", m_sEventName)
.append ("PointInTime", m_ePointInTime)
.append ("CRUD", m_eCRUD)
.getToString ();
}
}
| [
"philip@helger.com"
] | philip@helger.com |
1f03d00bfa949eb9cdf6fe2d4dcfd90dc6089acf | b7c059120c10fb8ee89685c573c84663c72cd6df | /app/src/main/java/com/yibai/examination/adapter/ExaminationQuestionAdapter.java | a4b130e86a0769c0bfbec30a5d1365b2391d00ca | [] | no_license | enjoyO/YiBaiEducationExamination | 38387cf44b2d1220e6356796c78e0ccbbd381394 | 60fc525259ffa0e5bf9272488cf54bc1216a5f05 | refs/heads/master | 2020-05-21T01:34:54.245911 | 2016-12-21T03:48:45 | 2016-12-21T03:48:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 969 | java | package com.yibai.examination.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import com.yibai.examination.ui.fragment.ExamingFragment;
import java.util.List;
/**
* YiBaiEducationExamination
* Create 2016/12/18 23:14;
* https://github.com/szhua
*
* @author sz.hua
*/
public class ExaminationQuestionAdapter extends FragmentPagerAdapter {
private List<ExamingFragment> examingFragments;
public ExaminationQuestionAdapter(FragmentManager fm , List<ExamingFragment> examingFragments){
super(fm);
this.examingFragments = examingFragments;
}
public ExaminationQuestionAdapter(FragmentManager fm) {
super(fm);
}
@Override
public int getCount() {
return examingFragments.size();
}
@Override
public Fragment getItem(int position) {
return examingFragments.get(position);
}
}
| [
"389894467@qq.com"
] | 389894467@qq.com |
593d581c982f2cc6cbc6907ad6aac09e55c18299 | 9c6b787c151ec968ef498b77dc3a8183763cdda8 | /app/src/main/java/org/apache/fineract/data/models/customer/identification/ExpirationDate.java | 5604ba6d0c8667debe773a5f4610d33b44513b7b | [
"Apache-2.0"
] | permissive | therajanmaurya/android-client-2.0 | b6e86151849c0635234526d136b21b5e960b9b60 | c2a3743ca17f56319128377fdc2fea607b8c7e5c | refs/heads/development | 2021-09-08T00:41:20.410479 | 2018-01-12T18:23:16 | 2018-01-17T13:38:37 | 84,943,457 | 7 | 5 | null | null | null | null | UTF-8 | Java | false | false | 1,803 | java | package org.apache.fineract.data.models.customer.identification;
import android.os.Parcel;
import android.os.Parcelable;
/**
* @author Rajan Maurya
* On 31/07/17.
*/
public class ExpirationDate implements Parcelable {
private Integer year;
private Integer month;
private Integer day;
public ExpirationDate() {
super();
}
public Integer getYear() {
return this.year;
}
public void setYear(final Integer year) {
this.year = year;
}
public Integer getMonth() {
return this.month;
}
public void setMonth(final Integer month) {
this.month = month;
}
public Integer getDay() {
return this.day;
}
public void setDay(final Integer day) {
this.day = day;
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
dest.writeValue(this.year);
dest.writeValue(this.month);
dest.writeValue(this.day);
}
protected ExpirationDate(Parcel in) {
this.year = (Integer) in.readValue(Integer.class.getClassLoader());
this.month = (Integer) in.readValue(Integer.class.getClassLoader());
this.day = (Integer) in.readValue(Integer.class.getClassLoader());
}
public static final Parcelable.Creator<ExpirationDate> CREATOR =
new Parcelable.Creator<ExpirationDate>() {
@Override
public ExpirationDate createFromParcel(Parcel source) {
return new ExpirationDate(source);
}
@Override
public ExpirationDate[] newArray(int size) {
return new ExpirationDate[size];
}
};
}
| [
"rajanmaurya154@gmail.com"
] | rajanmaurya154@gmail.com |
cfdfeb7d8dd93af091175a15807563f93a8d3b6d | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/druid-io--druid/26e0eb62cbefe3db4dedbce30b37b2de573b8062/after/ArbitraryGranularitySpec.java | fdc1b12b3e4d17b918b0b3a9d15c7556893fe67d | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,875 | java | /*
* Druid - a distributed column store.
* Copyright (C) 2012 Metamarkets Group Inc.
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package com.metamx.druid.indexer.granularity;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Optional;
import com.google.common.collect.Iterators;
import com.google.common.collect.PeekingIterator;
import com.google.common.collect.Sets;
import com.metamx.common.guava.Comparators;
import org.joda.time.DateTime;
import org.joda.time.Interval;
import java.util.List;
import java.util.SortedSet;
import java.util.TreeSet;
public class ArbitraryGranularitySpec implements GranularitySpec
{
private final TreeSet<Interval> intervals;
@JsonCreator
public ArbitraryGranularitySpec(
@JsonProperty("intervals") List<Interval> inputIntervals
)
{
intervals = Sets.newTreeSet(Comparators.intervalsByStartThenEnd());
// Insert all intervals
for(final Interval inputInterval : inputIntervals) {
intervals.add(inputInterval);
}
// Ensure intervals are non-overlapping (but they may abut each other)
final PeekingIterator<Interval> intervalIterator = Iterators.peekingIterator(intervals.iterator());
while(intervalIterator.hasNext()) {
final Interval currentInterval = intervalIterator.next();
if(intervalIterator.hasNext()) {
final Interval nextInterval = intervalIterator.peek();
if(currentInterval.overlaps(nextInterval)) {
throw new IllegalArgumentException(String.format(
"Overlapping intervals: %s, %s",
currentInterval,
nextInterval));
}
}
}
}
@Override
@JsonProperty("intervals")
public SortedSet<Interval> bucketIntervals()
{
return intervals;
}
@Override
public Optional<Interval> bucketInterval(DateTime dt)
{
// First interval with start time ≤ dt
final Interval interval = intervals.floor(new Interval(dt, new DateTime(Long.MAX_VALUE)));
if(interval != null && interval.contains(dt)) {
return Optional.of(interval);
} else {
return Optional.absent();
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
af7b4e6b5d40f4fc00f8e6d144c0cba44fdd20be | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/appbrand/ui/recents/f.java | 3b212d1ab19a3a536502c45d19f5bd41ea3c3eab | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 2,078 | java | package com.tencent.mm.plugin.appbrand.ui.recents;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.appbrand.ba.f;
import com.tencent.mm.plugin.appbrand.ba.g;
import com.tencent.mm.ui.widget.ThreeDotsLoadingView;
public final class f
{
public final View caK;
private ThreeDotsLoadingView uiD;
public View une;
private View unf;
public f(Context paramContext, ViewGroup paramViewGroup)
{
AppMethodBeat.i(49140);
this.caK = LayoutInflater.from(paramContext).inflate(ba.g.app_brand_recents_list_footer, paramViewGroup, false);
this.uiD = ((ThreeDotsLoadingView)this.caK.findViewById(ba.f.loading_view));
this.une = this.caK.findViewById(ba.f.footer_top_divider);
this.unf = this.caK.findViewById(ba.f.end_tip);
AppMethodBeat.o(49140);
}
public final boolean cML()
{
AppMethodBeat.i(323101);
if ((this.uiD != null) && (this.uiD.isShown()))
{
AppMethodBeat.o(323101);
return true;
}
AppMethodBeat.o(323101);
return false;
}
public final void iQ()
{
this.uiD = null;
this.unf = null;
}
public final void setLoading(boolean paramBoolean)
{
AppMethodBeat.i(49139);
if (paramBoolean)
{
if (this.uiD != null)
{
this.uiD.setVisibility(0);
this.uiD.jFe();
}
if (this.unf != null)
{
this.unf.setVisibility(8);
AppMethodBeat.o(49139);
}
}
else
{
if (this.uiD != null)
{
this.uiD.jFf();
this.uiD.setVisibility(8);
}
if (this.unf != null) {
this.unf.setVisibility(0);
}
}
AppMethodBeat.o(49139);
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes8.jar
* Qualified Name: com.tencent.mm.plugin.appbrand.ui.recents.f
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
4793f23ee14315832084dfec4a9c51438722354f | 26c627640de997cbbf5dc6268c1bbf6d2ca2d385 | /stn-springjpa/src/main/java/com/cqx/config/JpaConfig.java | 3796e17bee4faa594006ba6cb933f82070c1c5a4 | [
"MIT"
] | permissive | cqxxxxxxxx/somethingnew | 80bdf421bad9d23a4c3f299bece6ef6334c25bad | 2b7f7e13eda670c1698887f2d863535b773b892c | refs/heads/master | 2023-04-28T23:40:20.226077 | 2022-09-25T11:55:17 | 2022-09-25T12:00:24 | 198,219,013 | 0 | 2 | MIT | 2023-04-17T17:35:12 | 2019-07-22T12:28:20 | Java | UTF-8 | Java | false | false | 614 | java | package com.cqx.config;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
* Created by BG307435 on 2017/8/14.
*/
@Configuration
@EnableJpaRepositories("com.cqx.dao") //Set up Spring to create proxy instances for those interfaces.
@EnableTransactionManagement //Enables Spring's annotation-driven transaction management capability
@ComponentScan
public class JpaConfig {
}
| [
"82803852@qq.com"
] | 82803852@qq.com |
107d5e51f27e3c345689fc9d72b6dea99d00c93e | 96602275a8a9fdd18552df60d3b4ae4fa21034e9 | /providers/jaxb/src/test/java/org/jboss/resteasy/test/nextgen/CharSetTest.java | 573ef6ea15e1cceb61bb046db6edd9b7dfcf2698 | [
"Apache-2.0"
] | permissive | tedwon/Resteasy | 03bb419dc9f74ea406dc1ea29d8a6b948b2228a8 | 38badcb8c2daae2a77cea9e7d70a550449550c49 | refs/heads/master | 2023-01-18T22:03:43.256889 | 2016-06-29T15:37:45 | 2016-06-29T15:37:45 | 62,353,131 | 0 | 0 | NOASSERTION | 2023-01-02T22:02:20 | 2016-07-01T01:29:16 | Java | UTF-8 | Java | false | false | 2,804 | java | package org.jboss.resteasy.test.nextgen;
import org.jboss.resteasy.client.jaxrs.ResteasyClient;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.jboss.resteasy.client.jaxrs.ResteasyWebTarget;
import org.jboss.resteasy.test.BaseResourceTest;
import org.jboss.resteasy.test.TestPortProvider;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import javax.ws.rs.Consumes;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
/**
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
* @version $Revision: 1 $
*/
public class CharSetTest extends BaseResourceTest
{
@XmlRootElement(name="customer")
@XmlAccessorType(XmlAccessType.PROPERTY)
public static class Customer
{
private String name;
@XmlElement
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
}
@Path("/test")
public static class TestService
{
@POST
@Consumes("application/xml")
public void post(Customer cust)
{
System.out.println(cust.getName());
}
@POST
@Path("string")
public void postString(String cust)
{
System.out.println("*******");
System.out.println(cust);
}
}
private static ResteasyClient client;
@BeforeClass
public static void setup()
{
addPerRequestResource(TestService.class);
client = new ResteasyClientBuilder().build();
}
@AfterClass
public static void shutdown()
{
client.close();
}
@Test
public void testCase2() throws Exception
{
ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/test/string"));
Customer cust = new Customer();
String name = "bill\u00E9";
cust.setName(name);
Response response = target.request().post(Entity.xml(cust));
response.close();
}
@Test
public void testCase() throws Exception
{
ResteasyWebTarget target = client.target(TestPortProvider.generateURL("/test"));
Customer cust = new Customer();
String name = "bill\u00E9";
System.out.println("client name: " + name);
System.out.println("bytes string: " + new String(name.getBytes("UTF-8"), "UTF-8"));
cust.setName(name);
Response response = target.request().post(Entity.xml(cust));
response.close();
}
}
| [
"bburke@redhat.com"
] | bburke@redhat.com |
6e71e4bbf1784d984b7849027ea1c5f41eee7e2b | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project1/src/main/java/org/gradle/test/performance1_4/Production1_325.java | 6a9c18e5b6287b0361b1233c62423f7be239af1c | [] | 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 | 246 | java | package org.gradle.test.performance1_4;
public class Production1_325 {
private final String property;
public Production1_325() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
cc0ff92047311c7f6c400f035b4240ec9988292f | c82bfe5797f1104a6c3fa59762fd065b089489ea | /src/test/java/ch/ethz/idsc/tensor/fig/VisualSetTest.java | a2316a752165124a2341f2e33e4482ea1ae8a8fd | [] | no_license | etarakci-hvl/owl | 208f6bf6be98717dbdd62ab369dd654bdbf4343a | 60790bdb31741b8368001e892a941bded7fcbfb9 | refs/heads/master | 2022-03-02T00:22:24.167829 | 2019-11-17T09:15:23 | 2019-11-17T09:15:23 | 279,145,425 | 1 | 0 | null | 2020-07-12T20:47:38 | 2020-07-12T20:47:37 | null | UTF-8 | Java | false | false | 3,764 | java | // code by gjoel, jph
package ch.ethz.idsc.tensor.fig;
import java.io.File;
import java.io.IOException;
import org.jfree.chart.ChartUtils;
import org.jfree.chart.JFreeChart;
import ch.ethz.idsc.tensor.RealScalar;
import ch.ethz.idsc.tensor.Tensor;
import ch.ethz.idsc.tensor.Tensors;
import ch.ethz.idsc.tensor.alg.Dimensions;
import ch.ethz.idsc.tensor.alg.Transpose;
import ch.ethz.idsc.tensor.io.HomeDirectory;
import ch.ethz.idsc.tensor.io.Serialization;
import ch.ethz.idsc.tensor.pdf.RandomVariate;
import ch.ethz.idsc.tensor.pdf.UniformDistribution;
import junit.framework.TestCase;
public class VisualSetTest extends TestCase {
public void testConstructors() {
Tensor domain = Tensors.fromString("{1, 2, 3, 4, 5}");
Tensor values = RandomVariate.of(UniformDistribution.unit(), 5);
Tensor points = Transpose.of(Tensors.of(domain, values));
VisualSet set2 = new VisualSet();
VisualRow row2 = set2.add(domain, values);
row2.setLabel("row2");
VisualRow row3 = set2.add(points);
row3.setLabel("row3");
assertEquals(set2.visualRows().size(), 2);
VisualSet set1 = new VisualSet();
assertEquals(set1.visualRows().size(), 0);
}
public void testAdd() throws ClassNotFoundException, IOException {
Tensor domain = Tensors.fromString("{1, 2, 3, 4, 5}");
Tensor values1 = RandomVariate.of(UniformDistribution.unit(), 5);
Tensor values2 = RandomVariate.of(UniformDistribution.unit(), 5);
VisualSet visualSet = new VisualSet();
VisualRow row1 = visualSet.add(domain, values1);
VisualRow row2 = visualSet.add(domain, values2);
assertEquals(Dimensions.of(row1.points()), Dimensions.of(row2.points()));
Serialization.copy(visualSet);
}
public void testSetRowLabel() {
Tensor domain = Tensors.fromString("{1, 2, 3, 4, 5}");
Tensor values1 = RandomVariate.of(UniformDistribution.unit(), 5);
Tensor values2 = RandomVariate.of(UniformDistribution.unit(), 5);
VisualSet set = new VisualSet();
VisualRow row1 = set.add(domain, values1);
VisualRow row2 = set.add(domain, values2);
row1.setLabel("row 1");
row2.setLabel("row 2");
assertEquals(set.getVisualRow(0).getLabelString(), "row 1");
assertEquals(set.getVisualRow(1).getLabelString(), "row 2");
}
public void testEmptyPass() throws IOException {
VisualSet visualSet = new VisualSet();
visualSet.add(Tensors.empty());
JFreeChart jFreeChart = ListPlot.of(visualSet);
File file = HomeDirectory.Downloads(VisualSetTest.class.getSimpleName() + ".png");
assertFalse(file.exists());
ChartUtils.saveChartAsPNG(file, jFreeChart, 100, 100);
assertTrue(file.isFile());
assertTrue(file.canWrite());
file.delete();
assertFalse(file.exists());
}
public void testFailScalar() {
VisualSet visualSet = new VisualSet();
try {
visualSet.add(RealScalar.ZERO, RealScalar.ONE);
fail();
} catch (Exception exception) {
// ---
}
}
public void testFailVector() {
VisualSet visualSet = new VisualSet();
try {
visualSet.add(Tensors.vector(1, 2, 3, 4), Tensors.vector(1, 2, 3, 4, 5));
fail();
} catch (Exception exception) {
// ---
}
}
public void testFailUnstructured() {
VisualSet visualSet = new VisualSet();
try {
visualSet.add(Tensors.fromString("{{1, 2}, {3, 4}, {5, 6}, {3}}"));
fail();
} catch (Exception exception) {
// ---
}
try {
visualSet.add(Tensors.fromString("{{1, 2}, {3, 4}, {5, 6}, 4}"));
fail();
} catch (Exception exception) {
// ---
}
try {
visualSet.add(Tensors.fromString("{{1, 2, 3}, {3, 4, 2}, {5, 6, 3}, {3, 5, 3}}"));
fail();
} catch (Exception exception) {
// ---
}
}
}
| [
"jan.hakenberg@gmail.com"
] | jan.hakenberg@gmail.com |
a4d745e42144233046b700482c43243bb9c9547e | 9aa17a9745d60930a832a6a6d5817a0c734eea71 | /deobfuscator/src/test/java/net/runelite/deob/deobfuscators/ExprArgOrderTest.java | f6d283f67ea124836953de7e1e3b43a26d8573ea | [
"BSD-2-Clause"
] | permissive | vipkid/runelite | c9499da63bbfba38e0e93035b5d5cd50c7b909fb | 24a34471409458cb953e1ae2f1d8da75e0c5b4fa | refs/heads/master | 2021-01-20T04:46:20.650947 | 2017-04-28T12:00:51 | 2017-04-28T12:00:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,284 | java | /*
* Copyright (c) 2016-2017, Adam <Adam@sigterm.info>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.deob.deobfuscators;
import java.io.File;
import java.io.IOException;
import net.runelite.asm.ClassGroup;
import net.runelite.deob.TemporyFolderLocation;
import net.runelite.deob.util.JarUtil;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
public class ExprArgOrderTest
{
private static final File GAMEPACK = new File(RenameUniqueTest.class.getResource("/gamepack_v16.jar").getFile());
@Rule
public TemporaryFolder folder = TemporyFolderLocation.getTemporaryFolder();
private ClassGroup group;
@Before
public void before() throws IOException
{
group = JarUtil.loadJar(GAMEPACK);
}
@After
public void after() throws IOException
{
JarUtil.saveJar(group, folder.newFile());
}
@Test
public void testRun()
{
ExprArgOrder e = new ExprArgOrder();
e.run(group);
}
}
| [
"Adam@anope.org"
] | Adam@anope.org |
207417236c5c1794e87c4c6e38ea119805d3bc61 | b66204e5f19c5a1e8fdfe47d98053ff72f666da1 | /BeagleTest/src/main/java/MuzikController.java | cac958cf4c574aaa9b32d4a857827f60103b1961 | [] | no_license | ramazanfirin/beagleTest | 1ff6ec5fec02449406f097ba30f43ea043277c4f | 5c9e0535439dbdc9b3a650ecb037be3fe6d57f89 | refs/heads/master | 2021-01-17T11:08:27.868624 | 2016-06-24T12:21:47 | 2016-06-24T12:21:47 | 46,034,246 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,436 | java | import java.io.IOException;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import constants.Constants;
import model.Klima;
import model.Muzik;
@ManagedBean
@RequestScoped
public class MuzikController extends BaseController{
Muzik muzik= new Muzik();
@Override
void prepareData() {
int auidoChannel= dataController.getModbusValues()[Constants.AUDIO_CHANNEL_SELECT];
if(auidoChannel==1)
muzik.setChannel(Muzik.CHANNEL.KANAL_1);
else if (auidoChannel==2)
muzik.setChannel(Muzik.CHANNEL.KANAL_2);
else if (auidoChannel==3)
muzik.setChannel(Muzik.CHANNEL.KANAL_3);
else if (auidoChannel==4)
muzik.setChannel(Muzik.CHANNEL.KANAL_4);
}
public void setChannel1() throws IOException{
saveModbus(Constants.AUDIO_CHANNEL_SELECT,1);
muzik.setChannel(Muzik.CHANNEL.KANAL_1);
}
public void setChannel2() throws IOException{
saveModbus(Constants.AUDIO_CHANNEL_SELECT,2);
muzik.setChannel(Muzik.CHANNEL.KANAL_2);
}
public void setChannel3() throws IOException{
saveModbus(Constants.AUDIO_CHANNEL_SELECT,3);
muzik.setChannel(Muzik.CHANNEL.KANAL_3);
}
public void setChannel4() throws IOException{
saveModbus(Constants.AUDIO_CHANNEL_SELECT,4);
muzik.setChannel(Muzik.CHANNEL.KANAL_4);
}
public void changeVolume(){
muzik.setVolume(0);
}
public Muzik getMuzik() {
return muzik;
}
public void setMuzik(Muzik muzik) {
this.muzik = muzik;
}
} | [
"ramazan_firin@hotmail.com"
] | ramazan_firin@hotmail.com |
19bb2b923159ae0ad160388df9f44e8d96b95417 | 132a7d3c8816635e414ddfb752246d2a46bff772 | /core/src/main/java/com/alibaba/alink/operator/local/sink/AppendModelStreamFileSinkLocalOp.java | 3b00ed66b5bd152622e6c7cdff1d76d5540f4a1b | [
"Apache-2.0"
] | permissive | jackiehff/Alink | 8a04f0bb97d79745aa227da28d12a8c900d603cb | c3a3886a55cbcdaa5a1057ce501ccfd2ade2c6b4 | refs/heads/master | 2023-03-20T20:27:28.455375 | 2022-11-08T08:14:04 | 2022-11-08T08:14:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,153 | java | package com.alibaba.alink.operator.local.sink;
import org.apache.flink.ml.api.misc.param.Params;
import org.apache.flink.table.api.TableSchema;
import org.apache.flink.types.Row;
import com.alibaba.alink.common.annotation.InputPorts;
import com.alibaba.alink.common.annotation.NameCn;
import com.alibaba.alink.common.annotation.PortSpec;
import com.alibaba.alink.common.annotation.PortType;
import com.alibaba.alink.common.exceptions.AkUnclassifiedErrorException;
import com.alibaba.alink.common.io.filesystem.FilePath;
import com.alibaba.alink.common.utils.TableUtil;
import com.alibaba.alink.operator.common.stream.model.FileModelStreamSink;
import com.alibaba.alink.operator.common.stream.model.ModelStreamUtils;
import com.alibaba.alink.operator.local.LocalOperator;
import com.alibaba.alink.params.io.AppendModelStreamFileSinkParams;
import java.io.IOException;
import java.sql.Timestamp;
@InputPorts(values = {@PortSpec(PortType.MODEL)})
@NameCn("模型流导出")
public class AppendModelStreamFileSinkLocalOp extends BaseSinkLocalOp <AppendModelStreamFileSinkLocalOp>
implements AppendModelStreamFileSinkParams <AppendModelStreamFileSinkLocalOp> {
public AppendModelStreamFileSinkLocalOp() {
this(new Params());
}
public AppendModelStreamFileSinkLocalOp(Params params) {
super(params);
}
@Override
protected AppendModelStreamFileSinkLocalOp sinkFrom(LocalOperator <?> in) {
final FilePath filePath = getFilePath();
final Timestamp timestamp = ModelStreamUtils.createStartTime(getModelTime());
final int numFiles = 1; // todo, support getNumFiles();
final int numKeepModel = getNumKeepModel();
final TableSchema schema = in.getSchema();
final FileModelStreamSink sink = new FileModelStreamSink(
filePath, TableUtil.schema2SchemaStr(schema)
);
try {
sink.initializeGlobal();
sink.open(timestamp, 0);
for (Row value : in.getOutputTable().getRows()) {
sink.collect(value);
}
sink.close();
sink.finalizeGlobal(timestamp, in.getOutputTable().getNumRow(), numFiles, numKeepModel);
} catch (IOException e) {
throw new AkUnclassifiedErrorException("Error. ", e);
}
return this;
}
}
| [
"shaomeng.wang.w@gmail.com"
] | shaomeng.wang.w@gmail.com |
ee56f5f07550b350d516f7ab7dea9c06a3decbad | 14746c4b8511abe301fd470a152de627327fe720 | /soroush-android-1.10.0_source_from_JADX/com/p196h/p197a/C2127d.java | 2408d77cbf8fc7ce5d1c4e5dd875e89403a8a6be | [] | no_license | maasalan/soroush-messenger-apis | 3005c4a43123c6543dbcca3dd9084f95e934a6f4 | 29867bf53a113a30b1aa36719b1c7899b991d0a8 | refs/heads/master | 2020-03-21T21:23:20.693794 | 2018-06-28T19:57:01 | 2018-06-28T19:57:01 | 139,060,676 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package com.p196h.p197a;
import android.annotation.SuppressLint;
import android.widget.RelativeLayout;
import android.widget.TextView;
@SuppressLint({"ViewConstructor"})
final class C2127d extends RelativeLayout {
RelativeLayout f7121a;
TextView f7122b;
final void m5804a(Character ch) {
TextView textView = this.f7122b;
CharSequence ch2 = ch.toString();
if (ch2 != null) {
int length = ch2.length();
if (length != 0) {
char charAt = ch2.charAt(0);
if (!Character.isTitleCase(charAt)) {
StringBuilder stringBuilder = new StringBuilder(length);
stringBuilder.append(Character.toTitleCase(charAt));
stringBuilder.append(ch2.substring(1));
ch2 = stringBuilder.toString();
}
}
}
textView.setText(ch2);
}
}
| [
"Maasalan@riseup.net"
] | Maasalan@riseup.net |
68ca68eb842a678a50154f373b2ec716f5b24339 | 768e659caf14b805fced5c3f33addcb652395a10 | /yshop-common/src/main/java/co/yixiang/enums/CouponEnum.java | 32b80f778b0bfaf3c4b11cea6c0951ed8e240a9a | [
"Apache-2.0"
] | permissive | xrall39/yshopmall | 2443bd252ded6ecb500cb9f1608c09a7075541e9 | 0f028ab115821f382bb93dc6b5d4dae0ac6bab6f | refs/heads/master | 2022-06-21T14:22:06.356168 | 2020-05-08T14:20:51 | 2020-05-08T14:20:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 502 | java | package co.yixiang.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.stream.Stream;
/**
* @author hupeng
* 优惠券相关枚举
*/
@Getter
@AllArgsConstructor
public enum CouponEnum {
TYPE_0(0,"全部"),
TYPE_1(1,"未使用"),
TYPE_2(2,"已使用");
private Integer value;
private String desc;
public static CouponEnum toType(int value) {
return Stream.of(CouponEnum.values())
.filter(p -> p.value == value)
.findAny()
.orElse(null);
}
}
| [
"guchengwuyue@163.com"
] | guchengwuyue@163.com |
ccccf5862fbbacab20d48f67730300a78c04d124 | 77264d446d920f836629cb30036b05ed2a537076 | /src/main/java/com/pr/sepp/common/config/MailHealthIndicator.java | 97e2940e1cacfb3657722655c9dc6c1526d14839 | [
"MIT"
] | permissive | fpxtest/seppb | 5e28ea5db1992ac77ca6271637a478800f1e2729 | 971481c8ca7a662b4167503db3691d4cb3c1e63f | refs/heads/master | 2023-05-20T21:40:33.460222 | 2021-06-09T02:16:51 | 2021-06-09T02:16:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 505 | java | package com.pr.sepp.common.config;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;
@Component
public class MailHealthIndicator implements HealthIndicator {
@Override
public Health health() {
int errorCode = check();
if (errorCode != 0) {
return Health.down().withDetail("Error Code", errorCode).build();
}
return Health.up().build();
}
int check() {
return 0;
}
}
| [
"yijiubasi@163.com"
] | yijiubasi@163.com |
1961f8e68eae23f6ae5eb00e764dcd2f15252142 | 38585c67267a8c5fcd889b24a13bf215635ff64d | /src/test/java/org/zwobble/mammoth/tests/documents/StyleTests.java | 06f6ebaeef8f4df704fa876e403d98a38f10199d | [
"BSD-2-Clause"
] | permissive | clear-datacenter/java-mammoth | 225d45732eaf5b7401183b21d28dd2f9bcdc99bb | fd18fb68e65af28a0f65b1bd6ec4b1dec06f582f | refs/heads/master | 2021-01-17T10:49:44.857432 | 2016-05-02T11:14:52 | 2016-05-02T11:14:52 | 58,867,168 | 0 | 1 | null | 2016-05-15T14:49:58 | 2016-05-15T14:49:58 | null | UTF-8 | Java | false | false | 669 | java | package org.zwobble.mammoth.tests.documents;
import org.junit.Test;
import org.zwobble.mammoth.internal.documents.Style;
import java.util.Optional;
import static org.junit.Assert.assertEquals;
public class StyleTests {
@Test
public void descriptionOfStyleIncludesBothIdAndNameIfPresent() {
Style style = new Style("Heading1", Optional.of("Heading 1"));
assertEquals("Heading 1 (Style ID: Heading1)", style.describe());
}
@Test
public void descriptionOfStyleIsJustStyleIdIfStyleNameIsMissing() {
Style style = new Style("Heading1", Optional.empty());
assertEquals("Style ID: Heading1", style.describe());
}
}
| [
"mike@zwobble.org"
] | mike@zwobble.org |
6380fbf8a63e80bb70f1e7f674cba7c28d64ba76 | a9315f81355487ccc7508ea911f0566324292786 | /src/main/java/com/rultor/agents/daemons/Script.java | bcbd1ed2befe91e48e1a6f28267c4271bb1e2893 | [
"BSD-2-Clause"
] | permissive | gumbelmj/rultor | 181bb183a1f7423dbbe1b265527a67a86a1a211e | 978ad592342d970ac1ef94347b93603a1e4f8dc9 | refs/heads/master | 2021-01-18T06:01:21.053661 | 2016-02-29T20:47:34 | 2016-02-29T20:47:34 | 50,289,825 | 0 | 0 | null | 2016-01-24T13:53:26 | 2016-01-24T13:53:26 | null | UTF-8 | Java | false | false | 3,343 | java | /**
* Copyright (c) 2009-2015, rultor.com
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met: 1) Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer. 2) Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution. 3) Neither the name of the rultor.com nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
* NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.rultor.agents.daemons;
import com.google.common.base.Joiner;
import com.jcabi.aspects.Immutable;
import com.jcabi.log.Logger;
import com.jcabi.ssh.SSH;
import com.jcabi.ssh.Shell;
import com.jcabi.xml.XML;
import com.rultor.agents.shells.TalkShells;
import java.io.IOException;
import java.util.logging.Level;
import lombok.EqualsAndHashCode;
import lombok.ToString;
/**
* Script to run.
*
* @author Yegor Bugayenko (yegor@teamed.io)
* @version $Id$
* @since 1.53
*/
@Immutable
@ToString
@EqualsAndHashCode(callSuper = false)
final class Script {
/**
* Script name.
*/
private final transient String name;
/**
* Ctor.
* @param script Script name
*/
Script(final String script) {
this.name = script;
}
/**
* Execute.
* @param xml Talk xml
* @return Exit code
* @throws IOException If fails
*/
public int exec(final XML xml) throws IOException {
final Shell shell = new TalkShells(xml).get();
final String dir = xml.xpath("/talk/daemon/dir/text()").get(0);
new Shell.Safe(shell).exec(
String.format(
"cd %s && cat > %s && chmod a+x %1$s",
SSH.escape(dir), SSH.escape(this.name)
),
this.getClass().getResourceAsStream(this.name),
Logger.stream(Level.INFO, this),
Logger.stream(Level.WARNING, this)
);
return new Shell.Empty(shell).exec(
Joiner.on(" && ").join(
"set -o pipefail",
String.format("cd %s", SSH.escape(dir)),
String.format(
"/bin/bash %s >> stdout 2>&1",
SSH.escape(this.name)
)
)
);
}
}
| [
"yegor@tpc2.com"
] | yegor@tpc2.com |
b1e23953275a0a90eabaa07e9e300343accf2118 | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module2139_public/tests/more/src/java/module2139_public_tests_more/a/IFoo1.java | 35a7df44e7edcca8ed990bab877c3d5dd64a9f05 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 793 | java | package module2139_public_tests_more.a;
import java.beans.beancontext.*;
import java.io.*;
import java.rmi.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.io.File
* @see java.rmi.Remote
* @see java.nio.file.FileStore
*/
@SuppressWarnings("all")
public interface IFoo1<B> extends module2139_public_tests_more.a.IFoo0<B> {
java.sql.Array f0 = null;
java.util.logging.Filter f1 = null;
java.util.zip.Deflater f2 = null;
String getName();
void setName(String s);
B get();
void set(B e);
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
99198a57427f316257793fe126dadc85ca1e7fe1 | 6eee3a04abefe435a99b15a568120773e50f1324 | /rabbitmq-api/src/main/java/com/javashitang/rabbitmq/chapter_5_rejectMsg/RejectMsgProducer.java | 99e0b4291119dd1d15b0abf38dabfb7d232ae345 | [] | no_license | swinghigh/rabbitmq-examples | bd4db9e32c39911147a4394edf75acf2296d1ad0 | c960636673074c190572e95b5aaa122da6fb0f9c | refs/heads/master | 2023-02-17T13:53:57.433408 | 2020-11-14T08:24:46 | 2020-11-14T08:24:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,475 | java | package com.javashitang.rabbitmq.chapter_5_rejectMsg;
import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
import java.util.concurrent.TimeoutException;
/**
* 一般情况下,如果队列中的消息发送到消费者后,消费者不对消息进行确认。
* 那么消息会一直留在队列中,直到确认才会删除。
* 消费者与rabbitmq的连接中断,rabbitmq才会考虑将消息重新投递给另一个消费者
*/
@Slf4j
public class RejectMsgProducer {
public static final String EXCHANGE_NAME = "rejectMsg_exchange";
public static void main(String[] args) throws IOException, TimeoutException {
ConnectionFactory factory = new ConnectionFactory();
factory.setHost("myhost");
Connection connection = factory.newConnection();
Channel channel = connection.createChannel();
channel.exchangeDeclare(EXCHANGE_NAME, BuiltinExchangeType.DIRECT);
String routingKey = "error";
for (int i = 0; i < 10; i++) {
String message = "hello rabbitmq " + i;
channel.basicPublish(EXCHANGE_NAME, routingKey, null, message.getBytes());
log.info("send message, routingKey: {}, message: {}", routingKey ,message);
}
channel.close();
connection.close();
}
}
| [
"290059742@qq.com"
] | 290059742@qq.com |
1f7a2a7b807f984f1973ff932b1fe516b81282e5 | db2cc93761eb37fabb00042238a7f3eb126e9905 | /src/nine/six/AlgorithmFrame.java | 7634dc3ec00f767c7d5b063f8ece21cf2b2bdd50 | [] | no_license | zchengi/AlgorithmVisualization | b8c1d6f88cd23d3455a2c2cdab10ca34dd996514 | 95df35af55237c50ace8e2512c544541148638bd | refs/heads/master | 2021-05-08T15:25:50.732328 | 2018-04-10T04:42:30 | 2018-04-10T04:42:30 | 120,112,017 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,192 | java | package nine.six;
import templates.AlgorithmVisHelper;
import javax.swing.*;
import java.awt.*;
/**
* 视图层
*
* @author cheng
* 2018/4/10 11:29
*/
public class AlgorithmFrame extends JFrame {
private int canvasWidth;
private int canvasHeight;
private FractalData data;
public AlgorithmFrame(String title, int canvasWidth, int canvasHeight) {
super(title);
this.canvasWidth = canvasWidth;
this.canvasHeight = canvasHeight;
AlgorithmCanvas canvas = new AlgorithmCanvas();
this.setContentPane(canvas);
this.setResizable(false);
pack();
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setVisible(true);
}
public AlgorithmFrame(String title) {
this(title, 640, 480);
}
public void render(FractalData data) {
this.data = data;
repaint();
}
private class AlgorithmCanvas extends JPanel {
AlgorithmCanvas() {
super(true);
}
// 绘制组件 Graphics:绘制的上下文环境
@Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D graphics2D = (Graphics2D) g;
// 打开抗锯齿
RenderingHints hints = new RenderingHints(
RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
// 设置运行质量优先
hints.put(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
graphics2D.addRenderingHints(hints);
// 具体绘制
drawFractal(graphics2D, 0, canvasHeight, canvasWidth, 0);
}
private void drawFractal(Graphics2D graphics2D, int Ax, int Ay, int side, int depth) {
if (side <= 1) {
AlgorithmVisHelper.setColor(graphics2D, AlgorithmVisHelper.Indigo);
AlgorithmVisHelper.fillRectangle(graphics2D, Ax, Ay, 1, 1);
return;
}
int Bx = Ax + side;
int By = Ay;
int h = (int) (Math.sin(60.0 * Math.PI / 180.0) * side);
int Cx = Ax + side / 2;
int Cy = Ay - h;
if (depth == data.getDepth()) {
AlgorithmVisHelper.setColor(graphics2D, AlgorithmVisHelper.Indigo);
AlgorithmVisHelper.fillTriangle(graphics2D, Ax, Ay, Bx, By, Cx, Cy);
return;
}
int AB_centerX = (Ax + Bx) / 2;
int AB_centerY = (Ay + By) / 2;
int AC_centerX = (Ax + Cx) / 2;
int AC_centerY = (Ay + Cy) / 2;
drawFractal(graphics2D, Ax, Ay, side / 2, depth + 1);
drawFractal(graphics2D, AC_centerX, AC_centerY, side / 2, depth + 1);
drawFractal(graphics2D, AB_centerX, AB_centerY, side / 2, depth + 1);
}
@Override
public Dimension getPreferredSize() {
return new Dimension(canvasWidth, canvasHeight);
}
}
public int getCanvasWidth() {
return canvasWidth;
}
public int getCanvasHeight() {
return canvasHeight;
}
}
| [
"792702352@qq.com"
] | 792702352@qq.com |
1062062ab186963d6b4fbb6116cf4671d99631a0 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/apache/ignite/internal/IgniteNodeStartUtilsSelfTest.java | 0092450eeaa8250abab8104550981e52add870d2 | [] | no_license | STAMP-project/dspot-experiments | f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5 | 121487e65cdce6988081b67f21bbc6731354a47f | refs/heads/master | 2023-02-07T14:40:12.919811 | 2019-11-06T07:17:09 | 2019-11-06T07:17:09 | 75,710,758 | 14 | 19 | null | 2023-01-26T23:57:41 | 2016-12-06T08:27:42 | null | UTF-8 | Java | false | false | 4,264 | java | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.ignite.internal;
import java.io.File;
import java.util.Collection;
import java.util.Map;
import org.apache.ignite.internal.util.nodestart.IgniteNodeStartUtils;
import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiTuple;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.junit.Test;
/**
* Tests for {@link org.apache.ignite.internal.util.nodestart.IgniteNodeStartUtils}.
*/
public class IgniteNodeStartUtilsSelfTest extends GridCommonAbstractTest {
/**
*
*
* @throws Exception
* If failed.
*/
@Test
public void testParseFile() throws Exception {
File file = U.resolveIgnitePath("modules/core/src/test/config/start-nodes.ini");
IgniteBiTuple<Collection<Map<String, Object>>, Map<String, Object>> t = IgniteNodeStartUtils.parseFile(file);
assert t != null;
Collection<Map<String, Object>> hosts = t.get1();
assert hosts != null;
assert (hosts.size()) == 2;
for (Map<String, Object> host : hosts) {
assert host != null;
assert ("192.168.1.1".equals(host.get(IgniteNodeStartUtils.HOST))) || ("192.168.1.2".equals(host.get(IgniteNodeStartUtils.HOST)));
if ("192.168.1.1".equals(host.get(IgniteNodeStartUtils.HOST))) {
assert ((Integer) (host.get(IgniteNodeStartUtils.PORT))) == 1;
assert "uname1".equals(host.get(IgniteNodeStartUtils.UNAME));
assert "passwd1".equals(host.get(IgniteNodeStartUtils.PASSWD));
assert new File("key1").equals(host.get(IgniteNodeStartUtils.KEY));
assert ((Integer) (host.get(IgniteNodeStartUtils.NODES))) == 1;
assert "ggHome1".equals(host.get(IgniteNodeStartUtils.IGNITE_HOME));
assert "cfg1".equals(host.get(IgniteNodeStartUtils.CFG));
assert "script1".equals(host.get(IgniteNodeStartUtils.SCRIPT));
} else
if ("192.168.1.2".equals(host.get(IgniteNodeStartUtils.HOST))) {
assert ((Integer) (host.get(IgniteNodeStartUtils.PORT))) == 2;
assert "uname2".equals(host.get(IgniteNodeStartUtils.UNAME));
assert "passwd2".equals(host.get(IgniteNodeStartUtils.PASSWD));
assert new File("key2").equals(host.get(IgniteNodeStartUtils.KEY));
assert ((Integer) (host.get(IgniteNodeStartUtils.NODES))) == 2;
assert "ggHome2".equals(host.get(IgniteNodeStartUtils.IGNITE_HOME));
assert "cfg2".equals(host.get(IgniteNodeStartUtils.CFG));
assert "script2".equals(host.get(IgniteNodeStartUtils.SCRIPT));
}
}
Map<String, Object> dflts = t.get2();
assert dflts != null;
assert ((Integer) (dflts.get(IgniteNodeStartUtils.PORT))) == 3;
assert "uname3".equals(dflts.get(IgniteNodeStartUtils.UNAME));
assert "passwd3".equals(dflts.get(IgniteNodeStartUtils.PASSWD));
assert new File("key3").equals(dflts.get(IgniteNodeStartUtils.KEY));
assert ((Integer) (dflts.get(IgniteNodeStartUtils.NODES))) == 3;
assert "ggHome3".equals(dflts.get(IgniteNodeStartUtils.IGNITE_HOME));
assert "cfg3".equals(dflts.get(IgniteNodeStartUtils.CFG));
assert "script3".equals(dflts.get(IgniteNodeStartUtils.SCRIPT));
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
5dd7b397dba4df240cfa1b9d47a09d85ba312c9e | faddd3950f7bbfcb2774fc473ddfac3eca74fbaf | /src/main/java/com/uwyn/rife/resources/exceptions/ResourceAdditionErrorException.java | 87cf4175b56cd093ec822fde9f685f4df061a403 | [] | no_license | wangbo15/rife | d4b392f6577e998f12a8b6e529886487ca9ed320 | 399468a4c6929f0f32ad2fc15906b89cfae0e1c1 | refs/heads/master | 2020-04-13T14:24:13.894322 | 2013-07-01T23:02:50 | 2013-07-01T23:02:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 812 | java | /*
* Copyright 2001-2008 Geert Bevin (gbevin[remove] at uwyn dot com)
* Licensed under the Apache License, Version 2.0 (the "License")
* $Id: ResourceAdditionErrorException.java 3918 2008-04-14 17:35:35Z gbevin $
*/
package com.uwyn.rife.resources.exceptions;
public class ResourceAdditionErrorException extends ResourceWriterErrorException
{
private static final long serialVersionUID = 5975240130712585022L;
private String mName = null;
private String mContent = null;
public ResourceAdditionErrorException(String name, String content, Throwable e)
{
super("Error while adding the resource with name '"+name+"' and content '"+content+"'.", e);
mName = name;
mContent = content;
}
public String getName()
{
return mName;
}
public String getContent()
{
return mContent;
}
}
| [
"gbevin@uwyn.com"
] | gbevin@uwyn.com |
4b36de3586436fa5200e534bfcfa638dc639dd24 | c45813bc216e4646caa5d654e7a6dd3cf0cdaeb7 | /domain/src/main/java/com/kinglloy/album/domain/interactor/GetWallpapers.java | 56aa171592863c3240cc563ec267371d58844593 | [] | no_license | paijwar/LWA | 732f5d0e44b3316bd538c0442cd4440fc12fd215 | 550ec5b6389ffee4a4b8e621970d7ebe4db89dc7 | refs/heads/master | 2022-03-24T04:57:39.346402 | 2019-09-30T07:40:54 | 2019-09-30T07:40:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,723 | java | package com.kinglloy.album.domain.interactor;
import com.kinglloy.album.domain.Wallpaper;
import com.kinglloy.album.domain.WallpaperType;
import com.kinglloy.album.domain.executor.PostExecutionThread;
import com.kinglloy.album.domain.executor.ThreadExecutor;
import com.kinglloy.album.domain.repository.WallpaperRepository;
import java.util.List;
import javax.inject.Inject;
import io.reactivex.Observable;
/**
* @author jinyalin
* @since 2017/7/28.
*/
public class GetWallpapers extends UseCase<List<Wallpaper>, GetWallpapers.Params> {
private WallpaperRepository repository;
@Inject
public GetWallpapers(ThreadExecutor threadExecutor,
PostExecutionThread postExecutionThread,
WallpaperRepository repository) {
super(threadExecutor, postExecutionThread);
this.repository = repository;
}
@Override
public Observable<List<Wallpaper>> buildUseCaseObservable(GetWallpapers.Params params) {
switch (params.wallpaperType) {
case LIVE:
return repository.getLiveWallpapers();
case STYLE:
return repository.getStyleWallpapers();
case HD:
return repository.getHDWallpapers();
default:
return repository.getVideoWallpapers();
}
}
public static final class Params {
private final WallpaperType wallpaperType;
private Params(WallpaperType wallpaperType) {
this.wallpaperType = wallpaperType;
}
public static GetWallpapers.Params withType(WallpaperType wallpaperType) {
return new GetWallpapers.Params(wallpaperType);
}
}
}
| [
"jinyalin@baidu.com"
] | jinyalin@baidu.com |
70491b54ccafde0daff6767697b99d66eede24d0 | 5eac2b4cb2e06737e86a07b4a49fcf4f6d0d544f | /collect_app/src/main/java/org/odk/collect/android/preferences/AndroidXPreferencesActivity.java | d0c205e2cc0aafaacb889cb6f5eabe92a40bf614 | [
"Apache-2.0"
] | permissive | kaupong/collect | 682e66ddb0334a0f2c450e988180c8577dbd8c59 | 49077fb1b3f11d4c48d8ad1e7b165b1b25057f42 | refs/heads/master | 2021-07-16T11:33:41.139821 | 2020-06-16T09:17:56 | 2020-06-16T09:17:56 | 268,251,628 | 0 | 0 | NOASSERTION | 2020-05-31T09:52:55 | 2020-05-31T09:52:55 | null | UTF-8 | Java | false | false | 2,589 | java | package org.odk.collect.android.preferences;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.preference.PreferenceFragmentCompat;
import org.odk.collect.android.R;
import org.odk.collect.android.activities.CollectAbstractActivity;
/**
* Hosts preferences screens extending {@link PreferenceFragmentCompat} rather than the deprecated
* {@link androidx.preference.PreferenceFragment}. Once we've moved over ever Fragment we should be
* able to either only use this Activity or convert the existing preference Activity classes to
* use the new AndroidX preference framework.
*/
public class AndroidXPreferencesActivity extends CollectAbstractActivity {
public static final String KEY_EXTRA_FRAGMENT = "key_extra_fragment";
public static final int EXTRA_FRAGMENT_FORM_METADATA = 1;
public static final int EXTRA_FRAGMENT_USER_INTERFACE = 2;
public static <T extends PreferenceFragmentCompat> void start(Activity activity, Class<T> fragmentClass) {
Intent intent = new Intent(activity, AndroidXPreferencesActivity.class);
if (fragmentClass.isAssignableFrom(FormMetadataFragment.class)) {
intent.putExtra(KEY_EXTRA_FRAGMENT, EXTRA_FRAGMENT_FORM_METADATA);
} else if (fragmentClass.isAssignableFrom(UserInterfacePreferencesFragment.class)) {
intent.putExtra(KEY_EXTRA_FRAGMENT, EXTRA_FRAGMENT_USER_INTERFACE);
}
activity.startActivity(intent);
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_preferences_layout);
if (savedInstanceState == null) {
int fragmentToShow = getIntent().getExtras().getInt(KEY_EXTRA_FRAGMENT);
Fragment fragment;
switch (fragmentToShow) {
case EXTRA_FRAGMENT_FORM_METADATA:
fragment = new FormMetadataFragment();
break;
case EXTRA_FRAGMENT_USER_INTERFACE:
fragment = new UserInterfacePreferencesFragment();
break;
default:
fragment = null;
}
if (fragment != null) {
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.preferences_fragment_container, fragment)
.commit();
}
}
}
}
| [
"callum@seadowg.com"
] | callum@seadowg.com |
a4104acaa0e96194898021d7ad05eecd2626e0ea | 5d10b0b0b995823362d0cb40b16615d8a8c7a456 | /src/main/java/com/ldbc/driver/dshini/operations/AbstractOperationFactory.java | 60b8a821cc77590d971e3b6ffc46a6e9b436663c | [] | no_license | alexaverbuch/ldbc_bench-log_gen | c17eed3658e605fce3c2ac829496a76067a021de | 7cc62f088cfeed334e7d564da7be83662f86af78 | refs/heads/master | 2021-01-02T22:51:25.194211 | 2013-08-22T17:45:41 | 2013-08-22T17:45:41 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,244 | java | package com.ldbc.driver.dshini.operations;
import java.util.regex.Pattern;
import com.ldbc.driver.dshini.generator.Matchable;
import com.ldbc.driver.dshini.generator.MatchableException;
import com.ldbc.driver.dshini.log.RequestLogEntry;
public abstract class AbstractOperationFactory implements Matchable<RequestLogEntry>
{
private final String expectedHttpMethod;
private final Pattern expectedUrlPattern;
public AbstractOperationFactory()
{
expectedHttpMethod = getExpectedHttpMethod();
expectedUrlPattern = getExpectedUrlPattern();
}
protected abstract String getExpectedHttpMethod();
protected abstract Pattern getExpectedUrlPattern();
protected boolean performCustomLogic( RequestLogEntry entry ) throws MatchableException
{
return true;
}
@Override
public final boolean matches( RequestLogEntry entry ) throws MatchableException
{
if ( false == getExpectedHttpMethod().equals( entry.getHttpMethod() ) ) return false;
if ( false == getExpectedUrlPattern().matcher( entry.getUrl() ).matches() ) return false;
return performCustomLogic( entry );
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + ( ( expectedHttpMethod == null ) ? 0 : expectedHttpMethod.hashCode() );
result = prime * result + ( ( expectedUrlPattern == null ) ? 0 : expectedUrlPattern.hashCode() );
return result;
}
@Override
public boolean equals( Object obj )
{
if ( this == obj ) return true;
if ( obj == null ) return false;
if ( getClass() != obj.getClass() ) return false;
AbstractOperationFactory other = (AbstractOperationFactory) obj;
if ( expectedHttpMethod == null )
{
if ( other.expectedHttpMethod != null ) return false;
}
else if ( !expectedHttpMethod.equals( other.expectedHttpMethod ) ) return false;
if ( expectedUrlPattern == null )
{
if ( other.expectedUrlPattern != null ) return false;
}
else if ( !expectedUrlPattern.equals( other.expectedUrlPattern ) ) return false;
return true;
}
}
| [
"alex.averbuch@gmail.com"
] | alex.averbuch@gmail.com |
2e812bd3cdfb9606f101bd60d83548db0ecdc04a | 78f7fd54a94c334ec56f27451688858662e1495e | /partyanalyst-service/trunk/src/main/java/com/itgrids/partyanalyst/model/MobileBrand.java | 80d1fffa0e5d93d590cb6c1d25b27e29735a16c1 | [] | no_license | hymanath/PA | 2e8f2ef9e1d3ed99df496761a7b72ec50d25e7ef | d166bf434601f0fbe45af02064c94954f6326fd7 | refs/heads/master | 2021-09-12T09:06:37.814523 | 2018-04-13T20:13:59 | 2018-04-13T20:13:59 | 129,496,146 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,392 | java | package com.itgrids.partyanalyst.model;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.LazyToOne;
import org.hibernate.annotations.LazyToOneOption;
import org.hibernate.annotations.NotFoundAction;
@Entity
@Table(name="mobile_brand")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class MobileBrand extends BaseModel implements Serializable{
private Long mobileBrandId;
private String brandName;
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="mobile_brand_id", unique=true, nullable=false)
public Long getMobileBrandId() {
return mobileBrandId;
}
public void setMobileBrandId(Long mobileBrandId) {
this.mobileBrandId = mobileBrandId;
}
@Column(name="brand_name")
public String getBrandName() {
return brandName;
}
public void setBrandName(String brandName) {
this.brandName = brandName;
}
}
| [
"itgrids@b17b186f-d863-de11-8533-00e0815b4126"
] | itgrids@b17b186f-d863-de11-8533-00e0815b4126 |
b773211dbf7aed7dc383962665e1efae9765a804 | e63d80f7fc164bcc4165fb407f57fa951a98424e | /src/main/java/laboGrid/lb/velocity/d3/D3VelocityConditions.java | 1ea100b153c1f9298086ca30d5786fb20fefe574 | [] | no_license | cfd-learner/labogrid | f4b8096253816c54715d2ae59b85f3b7bd535885 | fcf43f5e31affc7d95e81a260f4913ca99745d9e | refs/heads/master | 2021-01-20T12:10:39.578987 | 2011-08-11T13:54:54 | 2011-08-11T13:54:54 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,823 | java | /*
* #%L
* LaBoGrid
* %%
* Copyright (C) 2011 LaBoGrid Team
* %%
* 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 3 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, see
* <http://www.gnu.org/licenses/gpl-3.0.html>.
* #L%
*/
package laboGrid.lb.velocity.d3;
import laboGrid.lb.lattice.Lattice;
import laboGrid.lb.lattice.d3.D3Lattice;
import laboGrid.lb.pressure.PressureConditions;
import laboGrid.lb.solid.Solid;
import laboGrid.lb.solid.d3.D3Solid;
public abstract class D3VelocityConditions implements PressureConditions {
protected int xSize, ySize, zSize;
protected int flowDirection;
protected double uIn;
protected D3Lattice d3Fluid;
protected D3Solid d3Solid;
private int siteSize;
public D3VelocityConditions(int flowDirection,
double uIn, D3Lattice fluid, D3Solid solid) {
this.flowDirection = flowDirection;
this.uIn = uIn;
setFluidAndSolid(fluid, solid);
}
@Override
public void apply() {
double[] site = new double[siteSize];
// X
if(flowDirection == 0) {
// System.out.println("Applying pressure X.");
for(int y = 0; y < ySize; ++y) {
for(int z = 0; z < zSize; ++z) {
if(uIn > 0 && d3Solid.at(0, y, z) == Solid.FLUID) {
d3Fluid.getSiteDensities(0, y, z, site);
inXVelocity(site, uIn);
d3Fluid.setSiteDensities(0, y, z, site);
}
// else {
// System.out.println("No pressure condition on site (rhoIn="+rhoIn+"): "+IntegerVector.toString(new int[] {0, y, z}));
// }
if(d3Solid.at(xSize-1, y, z) == Solid.FLUID) {
d3Fluid.getSiteDensities(xSize-2, y, z, site);
d3Fluid.setSiteDensities(xSize-1, y, z, site);
}
}
}
}
// Y
if(flowDirection == 1) {
// System.out.println("Applying pressure Y.");
for(int x = 0; x < xSize; ++x) {
for(int z = 0; z < zSize; ++z) {
if(uIn > 0 && d3Solid.at(x, 0, z) == Solid.FLUID) {
d3Fluid.getSiteDensities(x, 0, z, site);
inYVelocity(site, uIn);
d3Fluid.setSiteDensities(x, 0, z, site);
}
if(d3Solid.at(x, ySize-1, z) == Solid.FLUID) {
d3Fluid.getSiteDensities(x, ySize-2, z, site);
d3Fluid.setSiteDensities(x, ySize-1, z, site);
}
}
}
}
// Z
if(flowDirection == 2) {
// System.out.println("Applying pressure Z.");
for(int x = 0; x < xSize; ++x) {
for(int y = 0; y < ySize; ++y) {
if(uIn > 0 && d3Solid.at(x, y, 0) == Solid.FLUID) {
d3Fluid.getSiteDensities(x, y, 0, site);
inZVelocity(site, uIn);
d3Fluid.setSiteDensities(x, y, 0, site);
}
if(d3Solid.at(x, y, zSize-1) == Solid.FLUID) {
d3Fluid.getSiteDensities(x, y, zSize-2, site);
d3Fluid.setSiteDensities(x, y, zSize-1, site);
}
}
}
}
}
@Override
public void setFluidAndSolid(Lattice fluid, Solid solid) {
this.d3Fluid = (D3Lattice) fluid;
this.d3Solid = (D3Solid) solid;
if(solid != null) {
xSize = d3Solid.getXSize();
ySize = d3Solid.getYSize();
zSize = d3Solid.getZSize();
}
if(fluid != null)
siteSize = fluid.getLatticeDescriptor().getVelocitiesCount();
}
protected abstract void inXVelocity(double[] site, double uIn);
protected abstract void inYVelocity(double[] site, double uIn);
protected abstract void inZVelocity(double[] site, double uIn);
}
| [
"g.dethier@gmail.com"
] | g.dethier@gmail.com |
57db709bc004730bf556ac92c4c540e0a1cd5863 | 874ac0a79e9d8001dfb9be8d4ab2c20460b851fe | /ax-fsm/src/main/java/com/g2forge/alexandria/fsm/HFSM.java | dfcd45b95d166638caaea9b90d9ae211fde907bf | [
"Unlicense",
"Apache-2.0"
] | permissive | gdgib/alexandria | e644bcfcc99f67a244d823aed6af22bbb6f54266 | e47cdd4b15b45ec668f09af8adfa3fccc68d0e27 | refs/heads/master | 2023-06-08T13:52:10.133484 | 2021-03-01T17:28:51 | 2021-03-01T17:28:51 | 118,267,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,894 | java | package com.g2forge.alexandria.fsm;
import com.g2forge.alexandria.fsm.transition.FSMTransition;
import com.g2forge.alexandria.fsm.transition.IFSMTransition;
import com.g2forge.alexandria.fsm.transition.builder.CurrentFSMTransitionBuilder;
import com.g2forge.alexandria.fsm.value.ClassFSMType;
import com.g2forge.alexandria.fsm.value.FSMValue;
import com.g2forge.alexandria.fsm.value.IFSMType;
import com.g2forge.alexandria.fsm.value.IFSMValue;
import com.g2forge.alexandria.java.core.marker.Helpers;
import com.g2forge.alexandria.java.type.IGeneric;
import lombok.experimental.UtilityClass;
@Helpers
@UtilityClass
public class HFSM {
public static <CurrentState extends IGeneric<CurrentArgument>, CurrentArgument> CurrentFSMTransitionBuilder<CurrentState, CurrentArgument> transition(IFSMType<CurrentState, CurrentArgument> current) {
return new CurrentFSMTransitionBuilder<>(current);
}
public static <CurrentState extends IGeneric<CurrentArgument>, CurrentArgument, Event extends IGeneric<EventArgument>, EventArgument, NextState extends IGeneric<Void>, Emission> IFSMTransition<CurrentState, CurrentArgument, Event, EventArgument, NextState, Void, Emission> transition(IFSMType<CurrentState, CurrentArgument> current, IFSMType<Event, EventArgument> event, IFSMType<NextState, Void> next) {
return new FSMTransition<>(current, event, null, next, (ca, ea) -> null, null);
}
public static <CurrentState extends IGeneric<CurrentArgument>, CurrentArgument, Event extends IGeneric<EventArgument>, EventArgument, NextState extends IGeneric<Void>, Emission> IFSMTransition<CurrentState, CurrentArgument, Event, EventArgument, NextState, Void, Emission> transition(IFSMType<CurrentState, CurrentArgument> current, IFSMType<Event, EventArgument> event, IFSMType<NextState, Void> next, Emission emission) {
return new FSMTransition<>(current, event, null, next, (ca, ea) -> null, (ca, ea) -> emission);
}
public static <G extends IGeneric<T>, T> IFSMType<G, T> type(Class<G> type) {
return new ClassFSMType<>(type);
}
public static <G extends IGeneric<T>, T> IFSMType<G, T> type(T value) {
@SuppressWarnings({ "unchecked", "rawtypes" })
final Class<G> type = (Class) value.getClass();
return type(type);
}
public static <G extends IGeneric<Void>> IFSMValue<G, Void> value(Class<G> type) {
return new FSMValue<>(type(type), null);
}
public static <G extends IGeneric<T>, T> IFSMValue<G, T> value(Class<G> type, T value) {
return new FSMValue<>(type(type), value);
}
public static <G extends IGeneric<G>> IFSMValue<G, G> value(G value) {
return new FSMValue<>(type(value), value);
}
public static <G extends IGeneric<T>, T> IFSMValue<G, T> value(IFSMType<G, T> type, T value) {
return new FSMValue<>(type, value);
}
public static <G extends IGeneric<Void>> IFSMValue<G, Void> value(IFSMType<G, Void> type) {
return new FSMValue<>(type, null);
}
}
| [
"gdgib@outlook.com"
] | gdgib@outlook.com |
a4fb2b09a1dc2061ed80f35aedbc70badce24ef1 | e96172bcad99d9fddaa00c25d00a319716c9ca3a | /java-language-impl/src/main/java/com/intellij/java/language/impl/psi/controlFlow/ControlFlowInstructionVisitor.java | 3d2d1f84e123301cff9e7166287b4e4b825a279a | [
"Apache-2.0"
] | permissive | consulo/consulo-java | 8c1633d485833651e2a9ecda43e27c3cbfa70a8a | a96757bc015eff692571285c0a10a140c8c721f8 | refs/heads/master | 2023-09-03T12:33:23.746878 | 2023-08-29T07:26:25 | 2023-08-29T07:26:25 | 13,799,330 | 5 | 4 | Apache-2.0 | 2023-01-03T08:32:23 | 2013-10-23T09:56:39 | Java | UTF-8 | Java | false | false | 3,046 | java | /*
* Copyright 2000-2016 JetBrains s.r.o.
*
* 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.intellij.java.language.impl.psi.controlFlow;
public class ControlFlowInstructionVisitor {
public void visitInstruction(Instruction instruction, int offset, int nextOffset) {
}
public void visitEmptyInstruction(EmptyInstruction instruction, int offset, int nextOffset) {
visitSimpleInstruction(instruction, offset, nextOffset);
}
public void visitCommentInstruction(CommentInstruction instruction, int offset, int nextOffset) {
visitSimpleInstruction(instruction, offset, nextOffset);
}
public void visitReadVariableInstruction(ReadVariableInstruction instruction, int offset, int nextOffset) {
visitSimpleInstruction(instruction, offset, nextOffset);
}
public void visitWriteVariableInstruction(WriteVariableInstruction instruction, int offset, int nextOffset) {
visitSimpleInstruction(instruction, offset, nextOffset);
}
public void visitSimpleInstruction(SimpleInstruction instruction, int offset, int nextOffset) {
visitInstruction(instruction, offset, nextOffset);
}
public void visitBranchingInstruction(BranchingInstruction instruction, int offset, int nextOffset) {
visitInstruction(instruction, offset, nextOffset);
}
public void visitConditionalBranchingInstruction(ConditionalBranchingInstruction instruction, int offset, int nextOffset) {
visitBranchingInstruction(instruction, offset, nextOffset);
}
public void visitConditionalGoToInstruction(ConditionalGoToInstruction instruction, int offset, int nextOffset) {
visitConditionalBranchingInstruction(instruction, offset, nextOffset);
}
public void visitConditionalThrowToInstruction(ConditionalThrowToInstruction instruction, int offset, int nextOffset) {
visitConditionalBranchingInstruction(instruction, offset, nextOffset);
}
public void visitThrowToInstruction(ThrowToInstruction instruction, int offset, int nextOffset) {
visitBranchingInstruction(instruction, offset, nextOffset);
}
public void visitGoToInstruction(GoToInstruction instruction, int offset, int nextOffset) {
visitBranchingInstruction(instruction, offset, nextOffset);
}
public void visitCallInstruction(CallInstruction instruction, int offset, int nextOffset) {
visitGoToInstruction(instruction, offset, nextOffset);
}
public void visitReturnInstruction(ReturnInstruction instruction, int offset, int nextOffset) {
visitGoToInstruction(instruction, offset, nextOffset);
}
} | [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
2abac8f6b77a6a39d2a0d2be6e1140ce42d28ad6 | 31b7d2067274728a252574b2452e617e45a1c8fb | /jpa-connector-beehive-bdk/com_V2.0.1.4/oracle/beehive/GivenNamePredicate.java | 9ffd75f4cef2b98d416dfbef13303325062dfd54 | [] | no_license | ericschan/open-icom | c83ae2fa11dafb92c3210a32184deb5e110a5305 | c4b15a2246d1b672a8225cbb21b75fdec7f66f22 | refs/heads/master | 2020-12-30T12:22:48.783144 | 2017-05-28T00:51:44 | 2017-05-28T00:51:44 | 91,422,338 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,131 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.3-hudson-jaxb-ri-2.2.3-3-
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2011.05.18 at 04:52:34 PM PDT
//
package com.oracle.beehive;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for givenNamePredicate complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="givenNamePredicate">
* <complexContent>
* <extension base="{http://www.oracle.com/beehive}patternPredicate">
* <sequence>
* </sequence>
* </extension>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "givenNamePredicate")
public class GivenNamePredicate
extends PatternPredicate
{
}
| [
"eric.sn.chan@gmail.com"
] | eric.sn.chan@gmail.com |
95a2232152c699ce0e1997e56f4e3dbef6def2a6 | 59ed0ef3c4affb359bda63dedbc241185041ca30 | /log_analytics_ad/0.1.0/1_adiimp/ad_analysis/src/com/bi/ad/comm/util/format/AdpInfo.java | 0dfd10b112e96ed801c7fa1c0dcb3897c50e1a2e | [] | no_license | wisgood/mobile-core | 54e7c913e74a383636b8152cf0259c796a6daa63 | d82f118cfb51ca97c3fc60c75178be7853dd51d8 | refs/heads/master | 2021-01-10T02:21:22.738009 | 2015-11-25T11:36:34 | 2015-11-25T11:36:34 | 46,857,877 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java |
package com.bi.ad.comm.util.format;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import org.apache.hadoop.io.IOUtils;
public class AdpInfo {
private HashMap<String, AdpBase> adpInfo = new HashMap<String, AdpBase>();
public void init(String fileName) throws IOException {
BufferedReader in = null;
try {
in = new BufferedReader(new InputStreamReader(new FileInputStream(fileName)));
String line = null;
String code = null;
while ((line = in.readLine()) != null) {
String[] fields = line.trim().split("\t");
code = fields[1];
AdpBase adpBase = new AdpBase(fields);
adpInfo.put(code, adpBase);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
IOUtils.closeStream(in);
}
}
public HashMap<String, AdpBase> getAdpInfo() {
return adpInfo;
}
public void setAdpInfo(HashMap<String, AdpBase> adpInfo) {
this.adpInfo = adpInfo;
}
} | [
"wangxiaowei204876@sogou-inc.com"
] | wangxiaowei204876@sogou-inc.com |
9a664aedd0939433962cacf9cdde32136f789508 | 34192f594fae630d891e645fa2657798be8472e5 | /judge-site/src/main/java/cn/edu/zjnu/acm/judge/service/impl/JudgeServiceImpl.java | 0cc562f0798ec703d1abb26e7168c16bd797adc6 | [
"Apache-2.0"
] | permissive | zjnu-acm/judge | 1b37aabf99e50b28c6f99b8414abf03d9ce55e62 | 292a437b4b344ca7643c5c24edba8342a28ad8da | refs/heads/master | 2022-05-21T22:58:51.709192 | 2022-05-11T06:34:09 | 2022-05-11T06:34:09 | 58,370,373 | 23 | 16 | Apache-2.0 | 2021-04-22T18:06:39 | 2016-05-09T11:06:44 | Java | UTF-8 | Java | false | false | 5,831 | java | /*
* Copyright 2015-2019 ZJNU ACM.
*
* 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 cn.edu.zjnu.acm.judge.service.impl;
import cn.edu.zjnu.acm.judge.core.JudgeException;
import cn.edu.zjnu.acm.judge.core.SimpleValidator;
import cn.edu.zjnu.acm.judge.core.Status;
import cn.edu.zjnu.acm.judge.core.Validator;
import cn.edu.zjnu.acm.judge.domain.Problem;
import cn.edu.zjnu.acm.judge.domain.Submission;
import cn.edu.zjnu.acm.judge.domain.SubmissionDetail;
import cn.edu.zjnu.acm.judge.exception.BusinessCode;
import cn.edu.zjnu.acm.judge.exception.BusinessException;
import cn.edu.zjnu.acm.judge.mapper.SubmissionDetailMapper;
import cn.edu.zjnu.acm.judge.mapper.SubmissionMapper;
import cn.edu.zjnu.acm.judge.mapper.UserProblemMapper;
import cn.edu.zjnu.acm.judge.sandbox.win32.SpecialValidator;
import cn.edu.zjnu.acm.judge.service.JudgeRunner;
import cn.edu.zjnu.acm.judge.service.JudgeService;
import cn.edu.zjnu.acm.judge.service.LanguageService;
import cn.edu.zjnu.acm.judge.service.ProblemService;
import cn.edu.zjnu.acm.judge.service.SystemService;
import cn.edu.zjnu.acm.judge.support.JudgeData;
import cn.edu.zjnu.acm.judge.support.RunRecord;
import cn.edu.zjnu.acm.judge.support.RunResult;
import cn.edu.zjnu.acm.judge.util.ResultType;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.file.Path;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
*
* @author zhanhb
*/
@RequiredArgsConstructor
@Service("judgeService")
@Slf4j
public class JudgeServiceImpl implements JudgeService {
private final SubmissionMapper submissionMapper;
private final SubmissionDetailMapper submissionDetailMapper;
private final UserProblemMapper userProblemMapper;
private final ProblemService problemService;
private final SystemService systemService;
private final LanguageService languageService;
private final JudgeRunner judgeRunner;
private void updateSubmissionStatus(String userId, long problemId) {
userProblemMapper.update(userId, problemId);
userProblemMapper.updateUser(userId);
userProblemMapper.updateProblem(problemId);
}
@Override
public void execute(long submissionId) {
Submission submission = submissionMapper.findOne(submissionId);
if (submission == null) {
throw new BusinessException(BusinessCode.SUBMISSION_NOT_FOUND, submissionId);
}
long problemId = submission.getProblem();
Problem problem = problemService.findOneNoI18n(problemId);
try {
RunRecord runRecord = RunRecord.builder()
.language(languageService.getAvailableLanguage(submission.getLanguage()))
.source(submissionDetailMapper.findSourceById(submissionId))
.memoryLimit(problem.getMemoryLimit())
.timeLimit(problem.getTimeLimit())
.build();
Path dataDirectory = systemService.getDataDirectory(problemId);
JudgeData judgeData = JudgeData.parse(dataDirectory);
Path specialFile = systemService.getSpecialJudgeExecutable(problemId);
boolean isSpecial = systemService.isSpecialJudge(problemId);
Path work = systemService.getWorkDirectory(submissionId); //建立临时文件
final Validator validator = isSpecial
? new SpecialValidator(specialFile.toString(), work)
: SimpleValidator.PE_AS_AC;
boolean deleteTempFile = systemService.isDeleteTempFile();
RunResult runResult = judgeRunner.run(runRecord, work, judgeData, validator, deleteTempFile);
SubmissionDetail detail = SubmissionDetail.builder().id(submissionId)
.compileInfo(runResult.getCompileInfo())
.detail(runResult.getDetail())
.systemInfo(runResult.getSystemInfo())
.build();
if (runResult.getType() == Status.COMPILATION_ERROR) {
submissionMapper.updateResult(submissionId, ResultType.COMPILE_ERROR, 0, 0);
} else {
int score = runResult.getScore();
long time = runResult.getTime();
long memory = runResult.getMemory();
submissionMapper.updateResult(submissionId, score, time, memory);
}
// TODO return value not handled, we can do nothing for the record not exists in the table now.
submissionDetailMapper.update(detail);
updateSubmissionStatus(submission.getUser(), problemId);
} catch (ThreadDeath | VirtualMachineError error) {
throw error;
} catch (JudgeException | IOException | Error ex) {
log.error("got an exception when judging submission {}", submissionId, ex);
submissionMapper.updateResult(submissionId, ResultType.SYSTEM_ERROR, 0, 0);
StringWriter sw = new StringWriter();
try (PrintWriter pw = new PrintWriter(sw)) {
ex.printStackTrace(pw);
}
submissionDetailMapper.update(SubmissionDetail.builder().id(submissionId)
.systemInfo(sw.toString()).build());
}
}
}
| [
"6323014+zhanhb@users.noreply.github.com"
] | 6323014+zhanhb@users.noreply.github.com |
a9551c92dfa03c96d452ac1d994f07fa45ba792e | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/54/org/apache/commons/lang/time/FastDateFormat_format_822.java | 58e8dca4eb4363db4f6bb6ce41d9595035c5d99b | [] | 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 | 2,839 | java |
org apach common lang time
fast date format fastdateformat fast thread safe version
link java text simpl date format simpledateformat
direct replac
code simpl date format simpledateformat code format situat
multi thread server environ
code simpl date format simpledateformat code thread safe jdk version
sun close bug rfe
format support pattern compat
simpl date format simpledateformat time zone
java introduc pattern letter code 'z' code repres
time zone rfc822 format code code code code
pattern letter jdk version
addit pattern code zz' 'zz' code made repres
iso8601 full format time zone code code code code
introduc minor incompat java gain
function
author tea trove teatrov project
author brian neill o'neil
author sean schofield
author gari gregori
author stephen colebourn
author nikolai metchev
version
fast date format fastdateformat format
format code date code object
param date date format
format string
string format date date
calendar gregorian calendar gregoriancalendar time zone mtimezon
set time settim date
appli rule applyrul string buffer stringbuff max length estim mmaxlengthestim string tostr
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
4716b09e6249191ef4ccc35df8c5716cb703ee5f | 0874d515fb8c23ae10bf140ee5336853bceafe0b | /l2j-universe/java/lineage2/commons/threading/FIFORunnableQueue.java | 4954e93b038b9d30794099d29781c76654ccfd48 | [] | no_license | NotorionN/l2j-universe | 8dfe529c4c1ecf0010faead9e74a07d0bc7fa380 | 4d05cbd54f5586bf13e248e9c853068d941f8e57 | refs/heads/master | 2020-12-24T16:15:10.425510 | 2013-11-23T19:35:35 | 2013-11-23T19:35:35 | 37,354,291 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,084 | java | /*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
package lineage2.commons.threading;
import java.util.Queue;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public abstract class FIFORunnableQueue<T extends Runnable> implements Runnable
{
/**
* Field NONE. (value is 0)
*/
private static final int NONE = 0;
/**
* Field QUEUED. (value is 1)
*/
private static final int QUEUED = 1;
/**
* Field RUNNING. (value is 2)
*/
private static final int RUNNING = 2;
/**
* Field _state.
*/
private int _state = NONE;
/**
* Field _queue.
*/
private final Queue<T> _queue;
/**
* Constructor for FIFORunnableQueue.
* @param queue Queue<T>
*/
public FIFORunnableQueue(Queue<T> queue)
{
_queue = queue;
}
/**
* Method execute.
* @param t T
*/
public void execute(T t)
{
_queue.add(t);
synchronized (this)
{
if (_state != NONE)
{
return;
}
_state = QUEUED;
}
execute();
}
/**
* Method execute.
*/
protected abstract void execute();
/**
* Method clear.
*/
public void clear()
{
_queue.clear();
}
/**
* Method run.
* @see java.lang.Runnable#run()
*/
@Override
public void run()
{
synchronized (this)
{
if (_state == RUNNING)
{
return;
}
_state = RUNNING;
}
try
{
for (;;)
{
final Runnable t = _queue.poll();
if (t == null)
{
break;
}
t.run();
}
}
finally
{
synchronized (this)
{
_state = NONE;
}
}
}
}
| [
"jmendezsr@gmail.com"
] | jmendezsr@gmail.com |
6e525b51561e802e805d3faaa2322247967bd851 | 815629c7c6fd092d55e070bcdd3ad8a92eae3105 | /spring-integration-file/src/test/java/org/springframework/integration/file/DefaultFileNameGeneratorTests.java | 31a0132cfa8aac55c411f3829558d61f55e884c9 | [] | no_license | alexku66/spring-integration | 95d03b73f1e1cd505c152f08a29a0fa9bfbae7ac | 6747f69a77b817e9b8df20e2a871141a30f27f91 | refs/heads/master | 2021-01-18T06:32:43.812243 | 2012-10-12T15:35:29 | 2012-10-12T15:35:29 | 6,214,671 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 5,061 | java | /*
* Copyright 2002-2009 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.integration.file;
import static org.junit.Assert.assertEquals;
import java.io.File;
import org.junit.Test;
import org.springframework.integration.Message;
import org.springframework.integration.support.MessageBuilder;
/**
* @author Mark Fisher
*/
public class DefaultFileNameGeneratorTests {
@Test
public void defaultHeaderNamePresent() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
Message<?> message = MessageBuilder.withPayload("test")
.setHeader(FileHeaders.FILENAME, "foo").build();
String filename = generator.generateFileName(message);
assertEquals("foo", filename);
}
@Test
public void defaultHeaderNameNotPresent() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
Message<?> message = MessageBuilder.withPayload("test").build();
String filename = generator.generateFileName(message);
assertEquals(message.getHeaders().getId() + ".msg", filename);
}
@Test
public void defaultHeaderNameNotString() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
Message<?> message = MessageBuilder.withPayload("test")
.setHeader(FileHeaders.FILENAME, new Integer(123)).build();
String filename = generator.generateFileName(message);
assertEquals(message.getHeaders().getId() + ".msg", filename);
}
@Test
public void customHeaderNamePresent() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
generator.setHeaderName("foo");
Message<?> message = MessageBuilder.withPayload("test")
.setHeader("foo", "bar").build();
String filename = generator.generateFileName(message);
assertEquals("bar", filename);
}
@Test
public void customHeaderNameNotPresent() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
generator.setHeaderName("foo");
Message<?> message = MessageBuilder.withPayload("test").build();
String filename = generator.generateFileName(message);
assertEquals(message.getHeaders().getId() + ".msg", filename);
}
@Test
public void customHeaderNameNotString() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
generator.setHeaderName("foo");
Message<?> message = MessageBuilder.withPayload("test")
.setHeader("foo", new Integer(123)).build();
String filename = generator.generateFileName(message);
assertEquals(message.getHeaders().getId() + ".msg", filename);
}
@Test
public void filePayloadPresent() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
File payload = new File("/some/path/foo");
Message<?> message = MessageBuilder.withPayload(payload).build();
String filename = generator.generateFileName(message);
assertEquals("foo", filename);
}
@Test
public void defaultHeaderNameTakesPrecedenceOverFilePayload() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
File payload = new File("/some/path/ignore");
Message<?> message = MessageBuilder.withPayload(payload)
.setHeader(FileHeaders.FILENAME, "foo").build();
String filename = generator.generateFileName(message);
assertEquals("foo", filename);
}
@Test
public void customHeaderNameTakesPrecedenceOverFilePayload() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
generator.setHeaderName("foo");
File payload = new File("/some/path/ignore");
Message<?> message = MessageBuilder.withPayload(payload)
.setHeader("foo", "bar").build();
String filename = generator.generateFileName(message);
assertEquals("bar", filename);
}
@Test
public void customHeaderNameTakesPrecedenceOverDefault() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
generator.setHeaderName("foo");
Message<?> message = MessageBuilder.withPayload("test")
.setHeader(FileHeaders.FILENAME, "ignore")
.setHeader("foo", "bar").build();
String filename = generator.generateFileName(message);
assertEquals("bar", filename);
}
@Test
public void customHeaderNameTakesPrecedenceOverFilePayloadAndDefault() {
DefaultFileNameGenerator generator = new DefaultFileNameGenerator();
generator.setHeaderName("foo");
File payload = new File("/some/path/ignore1");
Message<?> message = MessageBuilder.withPayload(payload)
.setHeader(FileHeaders.FILENAME, "ignore2")
.setHeader("foo", "bar").build();
String filename = generator.generateFileName(message);
assertEquals("bar", filename);
}
}
| [
"markfisher@vmware.com"
] | markfisher@vmware.com |
05d76c01ae81c45e8d1c097f27a7d3def0301007 | c67412a747669b3bf8d56cfc1b38b5004b8f0bc6 | /user/src/main/java/com/yesmywine/user/service/impl/SynchroServiceImpl.java | d60e1f7f02f612e5868fac27dce7ac1b933a5415 | [] | no_license | qiango/yesmywine | 56e8b25565afdc7a69e66de416f1376bdfa26aac | b1b46c4f2f33b858e0dca68273a4fc03f2e46665 | refs/heads/master | 2021-10-20T03:56:12.871233 | 2019-02-25T15:32:05 | 2019-02-25T15:32:05 | 114,221,199 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,612 | java | package com.yesmywine.user.service.impl;
import com.yesmywine.user.dao.BeanCenterFlowDao;
import com.yesmywine.user.dao.BeanUserFlowDao;
import com.yesmywine.user.dao.ChannelsDao;
import com.yesmywine.user.dao.UserInformationDao;
import com.yesmywine.user.entity.BeanCenterFlow;
import com.yesmywine.user.entity.BeanUserFlow;
import com.yesmywine.user.entity.Channels;
import com.yesmywine.user.entity.UserInformation;
import com.yesmywine.user.service.SynchroService;
import com.yesmywine.util.error.yesmywineException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import java.util.Map;
/**
* Created by Mars on 2017/6/25.
*/
@Service
public class SynchroServiceImpl implements SynchroService {
@Autowired
private ChannelsDao channelsDao;
@Autowired
private BeanUserFlowDao beanUserFlowDao;
@Autowired
private BeanCenterFlowDao beanCenterFlowDao;
@Autowired
private UserInformationDao userDao;
public String beanCenter(@RequestParam Map<String,String> params) throws yesmywineException {
String channelCode = params.get("channelCode");
String userName = params.get("userName");
String oderNumber = params.get("orderNumber");
String bean = params.get("bean");
String userId = params.get("userId");
Channels channels = channelsDao.findByChannelCode(channelCode);
Integer channelId = channels.getId();
BeanCenterFlow beanCenterFlow = new BeanCenterFlow();//中心酒豆消耗记录
if(params.get("status").equals("generate")){
beanCenterFlow.setUserName(userName);
beanCenterFlow.setStatus("generate");
beanCenterFlow.setChannelId(channelId);
beanCenterFlow.setChannelName(channels.getChannelName());
beanCenterFlow.setPayer(channels.getChannelName());
beanCenterFlow.setPayee("酒豆中心");
BigDecimal beans = new BigDecimal(Double.valueOf(bean));
beanCenterFlow.setBeans(beans);
}else if(params.get("status").equals("consume")){
beanCenterFlow.setUserName(userName);
beanCenterFlow.setStatus("consume");
beanCenterFlow.setChannelId(channelId);
beanCenterFlow.setChannelName(channels.getChannelName());
beanCenterFlow.setPayer("酒豆中心");
beanCenterFlow.setPayee(channels.getChannelName());
BigDecimal beans = new BigDecimal(Double.valueOf(bean));
BigDecimal temp = new BigDecimal(Double.valueOf(-1));
beanCenterFlow.setBeans(beans.multiply(temp));
}
beanCenterFlowDao.save(beanCenterFlow);
return "success";
}
public Object returnsConsumeSys(@RequestParam Map<String,String> params) throws yesmywineException {
String channelCode = params.get("channelCode");
String userName = params.get("userName");
String oderNumber = params.get("orderNumber");
String newBeans = params.get("newBeans");
String returnBean = params.get("returnBean");
String ponit = params.get("point");
String userId = params.get("userId");
UserInformation userInformation = userDao.findByUserNameOrPhoneNumber(userName,null);
Channels channels = channelsDao.findByChannelCode(channelCode);
Integer channelId = channels.getId();
BeanUserFlow beanUserFlow = new BeanUserFlow();//个人 酒豆退回
beanUserFlow.setUserName(userName);
beanUserFlow.setOrderNumber(oderNumber);
beanUserFlow.setBeans(Double.valueOf(returnBean));
beanUserFlow.setChannels(channels);
beanUserFlow.setPoint(0);
beanUserFlow.setStatus("generate");
beanUserFlow.setUserId(Integer.valueOf(userId));
beanUserFlowDao.save(beanUserFlow);
BeanUserFlow beanUserFlow1 = new BeanUserFlow();//个人 酒豆收回
beanUserFlow1.setUserName(userName);
beanUserFlow1.setOrderNumber(oderNumber);
beanUserFlow1.setBeans(Double.valueOf(newBeans));
beanUserFlow1.setChannels(channels);
beanUserFlow1.setStatus("consume");//撤回
beanUserFlow1.setPoint(Integer.valueOf(ponit));
beanUserFlow1.setUserId(Integer.valueOf(userId));
beanUserFlowDao.save(beanUserFlow1);
BeanCenterFlow beanCenterFlow = new BeanCenterFlow();//中心酒豆退回是增加
beanCenterFlow.setUserName(userName);
beanCenterFlow.setStatus("generate");
beanCenterFlow.setChannelId(channelId);
beanCenterFlow.setChannelName(channels.getChannelName());
beanCenterFlow.setPayer(channels.getChannelName());
beanCenterFlow.setPayee("酒豆中心");
BigDecimal beans = new BigDecimal(Double.valueOf(returnBean));
beanCenterFlow.setBeans(beans);
beanCenterFlowDao.save(beanCenterFlow);
BeanCenterFlow beanCenterFlow1 = new BeanCenterFlow();//中心酒豆消耗记录
beanCenterFlow1.setUserName(userName);
beanCenterFlow1.setStatus("consume");
beanCenterFlow1.setChannelId(channelId);
beanCenterFlow1.setChannelName(channels.getChannelName());
beanCenterFlow1.setPayer("酒豆中心");
beanCenterFlow1.setPayee(channels.getChannelName());
BigDecimal newBean = new BigDecimal(Double.valueOf(newBeans));
beanCenterFlow1.setBeans(newBean.multiply(new BigDecimal(-1)));
beanCenterFlowDao.save(beanCenterFlow1);
return "success";
}
public Boolean synchronous(Integer id, String name, String type,String goodsCode ,Integer synchronous) {
Boolean resutl = false;
if(0 == synchronous || 1 == synchronous){
resutl = this.save(id, name, type,goodsCode);
}else {
resutl = this.delete(id);
}
return resutl;
}
public Boolean save(Integer id, String name, String type,String code){
try {
Channels channel = new Channels();
channel.setId(id);
channel.setType(type);
channel.setChannelName(name);
channel.setChannelCode(code);
this.channelsDao.save(channel);
}catch (Exception e){
return false;
}
return true;
}
public Boolean delete(Integer id){
try {
this.channelsDao.delete(id);
}catch (Exception e){
return false;
}
return true;
}
}
| [
"603446367@qq.com"
] | 603446367@qq.com |
b05b5cc8f605c4e371617d19e07bf7baebb68ff9 | 5c4bc790490d1eb4104fc86483a7360935420512 | /SistemaFinancieroVentura/ejb/src/main/java/org/ventura/sistemafinanciero/control/AgenciaServiceBean.java | a19a595bad0ac20db5262ed29865db879647e888 | [] | no_license | carlosthe19916/sistemafinancieroventura | b23fc7ed24cc6df037c272bcb53ed9213a879842 | b8b99d5969eeb672fdc64a75ce2589fdfcb86931 | refs/heads/master | 2021-01-10T13:27:28.038630 | 2014-07-30T15:39:16 | 2014-07-30T15:39:16 | 36,529,458 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,508 | java | package org.ventura.sistemafinanciero.control;
import java.math.BigInteger;
import java.util.HashSet;
import java.util.Set;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.inject.Inject;
import javax.inject.Named;
import org.hibernate.Hibernate;
import org.ventura.sistemafinanciero.dao.DAO;
import org.ventura.sistemafinanciero.entity.Agencia;
import org.ventura.sistemafinanciero.entity.Boveda;
import org.ventura.sistemafinanciero.entity.BovedaCaja;
import org.ventura.sistemafinanciero.entity.Caja;
import org.ventura.sistemafinanciero.service.AgenciaService;
@Named
@Stateless
@Remote(AgenciaService.class)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class AgenciaServiceBean extends AbstractServiceBean<Agencia> implements AgenciaService {
@Inject
private DAO<Object, Agencia> agenciaDAO;
@Override
public Set<Caja> getCajas(BigInteger idAgencia) {
Agencia agencia = agenciaDAO.find(idAgencia);
if(agencia == null)
return null;
Set<Caja> result = new HashSet<Caja>();
Set<Boveda> bovedas = agencia.getBovedas();
for (Boveda boveda : bovedas) {
Set<BovedaCaja> bovedasCasjas = boveda.getBovedaCajas();
for (BovedaCaja bovedaCaja : bovedasCasjas) {
Caja caja = bovedaCaja.getCaja();
Hibernate.initialize(caja);
result.add(caja);
}
}
return result;
}
@Override
protected DAO<Object, Agencia> getDAO() {
return agenciaDAO;
}
}
| [
"carlosthe19916@gmail.com"
] | carlosthe19916@gmail.com |
65adb821301e487d4b050ffaa31c31b29aaa072f | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-large-project/src/test/java/org/gradle/test/performancenull_408/Testnull_40794.java | 5bab2580a18d3d2b054ff40570dfbc9295d1009c | [] | 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 | 308 | java | package org.gradle.test.performancenull_408;
import static org.junit.Assert.*;
public class Testnull_40794 {
private final Productionnull_40794 production = new Productionnull_40794("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
128d9b85aeb74bd3ccbccf2b3523f5d64b9c0602 | c1c4239c3e34244d8d0ba725608a3a884b4e85dc | /src/main/java/com/zhangguo/SpringEL/spel03/Test.java | 30e61beb870dffc53b8ee98b490887e205609e46 | [] | no_license | hopana/SpringEL | 61fcfbcad783cb9b4763337dadb05e1b00c249d9 | 156021870b459b0b296b9f6fcc120d4786c9963f | refs/heads/master | 2020-04-08T16:36:52.608924 | 2018-11-28T16:00:00 | 2018-11-28T16:00:00 | 159,526,470 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,420 | java | package com.zhangguo.SpringEL.spel03;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.expression.EvaluationContext;
import org.springframework.expression.ExpressionParser;
import org.springframework.expression.spel.standard.SpelExpressionParser;
import org.springframework.expression.spel.support.StandardEvaluationContext;
public class Test {
public static void main(String[] args) {
ApplicationContext ctx = new ClassPathXmlApplicationContext("spel03.xml");
User user1 = ctx.getBean("user1", User.class);
System.out.println(user1.getId() + "," + user1.getName());
Order Order03 = ctx.getBean("Order03", Order.class);
System.out.println(Order03);
ExpressionParser ep = new SpelExpressionParser();
// 关系操作符
System.out.println(ep.parseExpression("5>2").getValue());
System.out.println(ep.parseExpression("2 between {1,9}").getValue());
// 逻辑运算符
System.out.println(ep.parseExpression("(5>2) and (2==1)").getValue());
// 算术操作符
System.out.println(ep.parseExpression("100-2^2").getValue());
// 测试获取用户属性
EvaluationContext evctx = new StandardEvaluationContext();
evctx.setVariable("user1", user1);
System.out.println(ep.parseExpression("'user1:'+#user1.getName()").getValue(evctx, String.class));
}
}
| [
"hopana@163.com"
] | hopana@163.com |
17e4a428ee515b9006d830931eeca7fa8882d7b0 | 40665051fadf3fb75e5a8f655362126c1a2a3af6 | /ibinti-bugvm/be14f5b2df53a99c72bc226f46658519f386b972/5791/CLErrorUserInfoKey.java | d47854c46527f4ac6df22cf47af4e0c5f84137a5 | [] | no_license | fermadeiral/StyleErrors | 6f44379207e8490ba618365c54bdfef554fc4fde | d1a6149d9526eb757cf053bc971dbd92b2bfcdf1 | refs/heads/master | 2020-07-15T12:55:10.564494 | 2019-10-24T02:30:45 | 2019-10-24T02:30:45 | 205,546,543 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,649 | java | /*
* Copyright (C) 2013-2015 RoboVM AB
*
* 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.bugvm.apple.corelocation;
/*<imports>*/
import java.io.*;
import java.nio.*;
import java.util.*;
import com.bugvm.objc.*;
import com.bugvm.objc.annotation.*;
import com.bugvm.objc.block.*;
import com.bugvm.rt.*;
import com.bugvm.rt.annotation.*;
import com.bugvm.rt.bro.*;
import com.bugvm.rt.bro.annotation.*;
import com.bugvm.rt.bro.ptr.*;
import com.bugvm.apple.foundation.*;
import com.bugvm.apple.addressbook.*;
import com.bugvm.apple.corebluetooth.*;
/*</imports>*/
/*<javadoc>*/
/*</javadoc>*/
/*<annotations>*/@Library("CoreLocation") @StronglyLinked/*</annotations>*/
@Marshaler(/*<name>*/CLErrorUserInfoKey/*</name>*/.Marshaler.class)
/*<visibility>*/public/*</visibility>*/ class /*<name>*/CLErrorUserInfoKey/*</name>*/
extends /*<extends>*/NSErrorUserInfoKey/*</extends>*/
/*<implements>*//*</implements>*/ {
static { Bro.bind(/*<name>*/CLErrorUserInfoKey/*</name>*/.class); }
/*<marshalers>*/
public static class Marshaler {
@MarshalsPointer
public static CLErrorUserInfoKey toObject(Class<CLErrorUserInfoKey> cls, long handle, long flags) {
NSString o = (NSString) NSObject.Marshaler.toObject(NSString.class, handle, flags);
if (o == null) {
return null;
}
return CLErrorUserInfoKey.valueOf(o);
}
@MarshalsPointer
public static long toNative(CLErrorUserInfoKey o, long flags) {
if (o == null) {
return 0L;
}
return NSObject.Marshaler.toNative(o.value(), flags);
}
}
public static class AsListMarshaler {
@SuppressWarnings("unchecked")
@MarshalsPointer
public static List<CLErrorUserInfoKey> toObject(Class<? extends NSObject> cls, long handle, long flags) {
NSArray<NSString> o = (NSArray<NSString>) NSObject.Marshaler.toObject(NSArray.class, handle, flags);
if (o == null) {
return null;
}
List<CLErrorUserInfoKey> list = new ArrayList<>();
for (int i = 0; i < o.size(); i++) {
list.add(CLErrorUserInfoKey.valueOf(o.get(i)));
}
return list;
}
@MarshalsPointer
public static long toNative(List<CLErrorUserInfoKey> l, long flags) {
if (l == null) {
return 0L;
}
NSArray<NSString> array = new NSMutableArray<>();
for (CLErrorUserInfoKey o : l) {
array.add(o.value());
}
return NSObject.Marshaler.toNative(array, flags);
}
}
/*</marshalers>*/
/*<constants>*/
/**
* @since Available in iOS 5.0 and later.
*/
public static final CLErrorUserInfoKey AlternateRegion = new CLErrorUserInfoKey("AlternateRegion");
/*</constants>*/
private static /*<name>*/CLErrorUserInfoKey/*</name>*/[] values = new /*<name>*/CLErrorUserInfoKey/*</name>*/[] {/*<value_list>*/AlternateRegion/*</value_list>*/};
/*<name>*/CLErrorUserInfoKey/*</name>*/ (String getterName) {
super(Values.class, getterName);
}
public static /*<name>*/CLErrorUserInfoKey/*</name>*/ valueOf(/*<type>*/NSString/*</type>*/ value) {
for (/*<name>*/CLErrorUserInfoKey/*</name>*/ v : values) {
if (v.value().equals(value)) {
return v;
}
}
throw new IllegalArgumentException("No constant with value " + value + " found in "
+ /*<name>*/CLErrorUserInfoKey/*</name>*/.class.getName());
}
/*<methods>*//*</methods>*/
/*<annotations>*/@Library("CoreLocation") @StronglyLinked/*</annotations>*/
public static class Values {
static { Bro.bind(Values.class); }
/*<values>*/
/**
* @since Available in iOS 5.0 and later.
*/
@GlobalValue(symbol="kCLErrorUserInfoAlternateRegionKey", optional=true)
public static native NSString AlternateRegion();
/*</values>*/
}
}
| [
"fer.madeiral@gmail.com"
] | fer.madeiral@gmail.com |
afdce15a6e82a60c6c2f341b746d20e7a319199c | 9b294c3bf262770e9bac252b018f4b6e9412e3ee | /camerazadas/source/apk/com.sonyericsson.android.camera/src-cfr-nocode/com/google/android/gms/drive/realtime/internal/event/ValuesSetDetails.java | 15caa97682f245c9dea00bc600d33d1f3df097fc | [] | no_license | h265/camera | 2c00f767002fd7dbb64ef4dc15ff667e493cd937 | 77b986a60f99c3909638a746c0ef62cca38e4235 | refs/heads/master | 2020-12-30T22:09:17.331958 | 2015-08-25T01:22:25 | 2015-08-25T01:22:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 739 | java | /*
* Decompiled with CFR 0_100.
*/
package com.google.android.gms.drive.realtime.internal.event;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.safeparcel.SafeParcelable;
/*
* Exception performing whole class analysis.
* Exception performing whole class analysis ignored.
*/
public class ValuesSetDetails
implements SafeParcelable {
public static final Parcelable.Creator<ValuesSetDetails> CREATOR;
final int BR;
final int Rr;
final int Rs;
final int mIndex;
static;
ValuesSetDetails(int var1, int var2, int var3, int var4);
@Override
public int describeContents();
@Override
public void writeToParcel(Parcel var1, int var2);
}
| [
"jmrm@ua.pt"
] | jmrm@ua.pt |
d806ab0d94ceb5069ae0b5775b923d84ddeef772 | c7d2f0c03a17973ddfee2f91ed0fcc08b63e1a45 | /src/server/TimerManager.java | bf85d4e870dee4ae5c3c1e7df264d56f06065e03 | [] | no_license | Rabbit-Guo/TWMS_134 | 1ff26104efcfe4973c9ba803ebedb8ab6ea989b5 | ffe96a957c216fba23c5361c89c3817ce44e4b90 | refs/heads/master | 2023-05-18T18:38:08.794937 | 2019-01-09T18:12:22 | 2019-01-09T18:12:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,329 | java | package server;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import tools.FileoutputUtil;
public class TimerManager {
private static TimerManager instance = new TimerManager();
public static class getInstance {
public getInstance() {
//
}
}
private ScheduledThreadPoolExecutor ses;
public static TimerManager getInstance() {
return instance;
}
public void start() {
if (ses != null && !ses.isShutdown() && !ses.isTerminated()) {
return; //starting the same timermanager twice is no - op
}
final ThreadFactory thread = new ThreadFactory() {
private final AtomicInteger threadNumber = new AtomicInteger(1);
@Override
public Thread newThread(Runnable r) {
final Thread t = new Thread(r);
t.setName("Timermanager-Worker-" + threadNumber.getAndIncrement());
return t;
}
};
final ScheduledThreadPoolExecutor stpe = new ScheduledThreadPoolExecutor(3, thread);
stpe.setKeepAliveTime(10, TimeUnit.MINUTES);
;
stpe.allowCoreThreadTimeOut(true);
stpe.setCorePoolSize(3);
stpe.setMaximumPoolSize(5);
stpe.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
ses = stpe;
}
public void stop() {
ses.shutdown();
}
public ScheduledFuture<?> register(Runnable r, long repeatTime, long delay) {
return ses.scheduleAtFixedRate(new LoggingSaveRunnable(r), delay, repeatTime, TimeUnit.MILLISECONDS);
}
public ScheduledFuture<?> register(Runnable r, long repeatTime) {
return ses.scheduleAtFixedRate(new LoggingSaveRunnable(r), 0, repeatTime, TimeUnit.MILLISECONDS);
}
public ScheduledFuture<?> schedule(Runnable r, long delay) {
return ses.schedule(new LoggingSaveRunnable(r), delay, TimeUnit.MILLISECONDS);
}
public ScheduledFuture<?> scheduleAtTimestamp(Runnable r, long timestamp) {
return schedule(r, timestamp - System.currentTimeMillis());
}
private class LoggingSaveRunnable implements Runnable {
Runnable r;
public LoggingSaveRunnable(final Runnable r) {
this.r = r;
}
@Override
public void run() {
try {
r.run();
} catch (Throwable t) {
FileoutputUtil.outputFileError(FileoutputUtil.Timer_Log, t);
}
}
}
} | [
"s884812@gmail.com"
] | s884812@gmail.com |
90227586af8315c26ce2e15357b8264791a76ba1 | 8910b49b7d5346d813825293dcba64e0ac1561e6 | /src/LC6307.java | af60a0254d4448d79b3ddd006a401f0493fc958d | [] | no_license | TaurusGGBOY/AlgorithmCode | 253242d31d3c61d12c479111a2e225d0896cd70b | e58f1b7af51184ec69a5687e40a778a38f654b85 | refs/heads/master | 2023-08-05T07:49:02.811106 | 2023-07-30T03:03:16 | 2023-07-30T03:03:16 | 131,671,067 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 172 | java | class Solution {
public int passThePillow(int n, int time) {
time %= 2 * n - 2;
if (time >= n) return 2 * n - time - 1;
return time + 1;
}
} | [
"854357635@qq.com"
] | 854357635@qq.com |
6e1a8c6c546625d432c20d75b4707027083bebd0 | e30cfa9770cde37a926e09bd6500d4c78057eb06 | /Test_all/src/main/java/com/lx/test/GetChuFangListNyKfrq.java | 476ddf2ed61646f30f199ec805713c1dd50f89d0 | [] | no_license | yinqianhui1990/Test_all | df04f27dc9b7d02adb088b5ce147edfe588634e0 | 077469a7a56beb28cf114977898896b380ebda05 | refs/heads/master | 2021-04-29T09:39:44.788360 | 2019-04-11T12:58:27 | 2019-04-11T12:58:27 | 77,657,869 | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,360 | java |
package com.lx.test;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>anonymous complex type的 Java 类。
*
* <p>以下模式片段指定包含在此类中的预期内容。
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="inXML" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"inXML"
})
@XmlRootElement(name = "GetChuFangList_Ny_Kfrq")
public class GetChuFangListNyKfrq {
protected String inXML;
/**
* 获取inXML属性的值。
*
* @return
* possible object is
* {@link String }
*
*/
public String getInXML() {
return inXML;
}
/**
* 设置inXML属性的值。
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setInXML(String value) {
this.inXML = value;
}
}
| [
"qianhui.yin@lachesis-mh.com"
] | qianhui.yin@lachesis-mh.com |
3be286dd8d802991525f6f1c17deaeb928edd560 | 1e671aad06682da80282dd83dece1937239a848f | /demo/src/com/zhaoqy/app/demo/page/dianping/adapter/DianpingPagerAdapter.java | f8a154541808f53683a2c6cb6b2de43421c1bcb5 | [] | no_license | zhaoqingyue/EclipseStudy | 548671318b074c833d3e12b8dc6379a85e122576 | f2238125e55333a7651fec546f39fd23dee0197e | refs/heads/master | 2020-04-04T03:24:09.966018 | 2018-11-01T12:41:11 | 2018-11-01T12:41:11 | 155,712,533 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 802 | java | package com.zhaoqy.app.demo.page.dianping.adapter;
import java.util.List;
import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;
public class DianpingPagerAdapter extends PagerAdapter
{
public List<View> mViews;
public DianpingPagerAdapter(List<View> views)
{
mViews = views;
}
@Override
public int getCount()
{
return mViews.size();
}
@Override
public boolean isViewFromObject(View view, Object obj)
{
return view == obj;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object)
{
container.removeView(mViews.get(position));
}
@Override
public Object instantiateItem(ViewGroup container, int position)
{
container.addView(mViews.get(position));
return mViews.get(position);
}
}
| [
"1023755730@qq.com"
] | 1023755730@qq.com |
cd67acd65be3db3c323327116281f0fd0e0db40d | dd17d429daf7bb9c1f66fd48a03269df5e535447 | /bit/algorithm/greed/L1221balancedStringSplit.java | dfc4ab13f2af82a7479f8c74431adac9e2695061 | [] | no_license | wangzilong2019/Algorithm | 6e1b3f549c13ae171fa79f5899169e320cbbdcb1 | 43af25ae1c167e7ebe1d1be461eca57b52e93ab6 | refs/heads/master | 2022-12-01T19:17:21.206767 | 2022-11-23T13:33:19 | 2022-11-23T13:33:19 | 233,599,797 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,600 | java | package bit.algorithm.greed;
public class L1221balancedStringSplit {
/**
* 在一个「平衡字符串」中,'L' 和 'R' 字符的数量是相同的。
*
* 给出一个平衡字符串 s,请你将它分割成尽可能多的平衡字符串。
*
* 返回可以通过分割得到的平衡字符串的最大数量。
*
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/split-a-string-in-balanced-strings
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
* 输入:s = "RLRRLLRLRL"
* 输出:4
* 解释:s 可以分割为 "RL", "RRLL", "RL", "RL", 每个子字符串中都包含相同数量的 'L' 和 'R'。
*
* 来源:力扣(LeetCode)
* 链接:https://leetcode-cn.com/problems/split-a-string-in-balanced-strings
* 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
*/
/**
* 因为要保证是对称的 ,可以用消去法来处理
* 这里注意不能让平衡字符串嵌套
* @param s
* @return
*/
public int balancedStringSplit(String s) {
//统计平衡串的总数
int cnt = 0;
int balance = 0;
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) == 'R') {
balance--;
} else if (s.charAt(i) == 'L') {
balance++;
}
if (balance == 0) {
cnt++;
}
}
return cnt;
}
}
| [
"1428075063@qq.com"
] | 1428075063@qq.com |
b056ba18e8ff8da553244433d9b887c35aed261b | 9a40fbcd0a33cfff80c969d65ec6cae195e4c783 | /spring-boot-update/src/main/java/com/springboot/update/UserController.java | 9a9506a728ee529cffa118df1aac5fa2b5c0ace8 | [] | no_license | alexandreximenes/spring | e966d599df79826847349ddae61a25b20b64704b | f9cbcebf2483e90c881dc93a5572539f0cde4e78 | refs/heads/master | 2023-01-04T15:35:31.445741 | 2020-09-01T02:43:42 | 2020-09-01T02:43:42 | 239,022,735 | 0 | 0 | null | 2022-12-27T14:44:50 | 2020-02-07T21:07:29 | Java | UTF-8 | Java | false | false | 1,735 | java | package com.springboot.update;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.List;
@RestController
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
@RequestMapping("/users")
public class UserController {
private final UserService userService;
private final Response<User> response = new Response<>();
@GetMapping
public ResponseEntity<List<User>> findAll(){
return response.ok(userService.findAll());
}
@PostMapping
public ResponseEntity<User> save(@Valid @RequestBody User user){
final User userS = userService.save(user);
return response.ok(userS);
}
@GetMapping(PathUtils.ID)
public ResponseEntity<User> getId(@PathVariable Long id) throws Exception {
final User userS = userService.findById(id);
return response.resolve(userS);
}
@GetMapping("/i18n/good-morning")
public ResponseEntity<Object> getI18nGoodMorning(
@RequestParam(name = "name", required = false,
defaultValue = "") String name) {
return response.ok(userService.i18nGetGoodMorning(name));
}
@GetMapping("/i18n/good-night/{name}")
public ResponseEntity<Object> getI18nGoodNight(@PathVariable String name) {
return response.ok(userService.i18nGetGoodNigth(name));
}
/*//exemplo 1
@GetMapping("/i18n")
public String getI18n(@RequestHeader(name = "Accept-Language", required = false) Locale locale) {
return messageSource.getMessage("good.morning", null, locale);
}*/
}
| [
"xyymenes@gmail.com"
] | xyymenes@gmail.com |
920a25a41c3ee9847d5449848135c2bf13a70db6 | 21f18ee7639bb56b778f7d4fa2eebccc6e40686b | /world/WorldBankPro/src/com/mccoy/services/Mailer.java | a6dae7f559091b3d442dcd5a0ae21997713bda3d | [] | no_license | chetanagm/Banking | e1e00309ad2a22bfad63d8f70bcc5d09d08db19c | a5c0a7106a4cfc1ee71ca5a8a826f7068e62c02d | refs/heads/master | 2020-03-07T06:37:26.887175 | 2018-03-29T17:47:34 | 2018-03-29T17:47:34 | 127,327,390 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,619 | java | package com.mccoy.services;
import java.util.Properties;
import javax.mail.*;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
public class Mailer {
public static void send(String to,String subject,String msg){
final String user="chetmathapati@gmail.com";//change accordingly
final String pass="Jaimatadi6";
System.out.println("Data recived and forwarding");
//1st step) Get the session object
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.gmail.com");
props.put("mail.smtp.port", "587");
props.put("mail.smtp.auth", "true");
props.put("mail.debug", "false");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.ssl.trust", "smtp.gmail.com");
System.out.println("properties done");
Session session = Session.getDefaultInstance(props,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(user,pass);
}
});
System.out.println("SESSION Done");
//2nd step)compose message
try {
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(user));
message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));
message.setSubject(subject);
message.setText(msg);
//3rd step)send message
Transport.send(message);
System.out.println("composed and itz Done");
} catch (MessagingException e) {
throw new RuntimeException(e);
}
}
} | [
"user@user-PC"
] | user@user-PC |
b7ab056264ccb9e1ba58a18c52a3fb6c88513df7 | e14e25c5b4c7c1ffcb4b8af588d811a1ca8791ec | /src/solution02/c3/QuickX.java | 3c71f31403f89002b90facbc0730405931624e60 | [] | no_license | BurningBright/algorithms-fourth-edition | 6ecd434ebc42449f5f05da1e6d6a94ef64eaab57 | 46ad5a29154b8094a2cd169308b9922131a74587 | refs/heads/master | 2021-01-24T07:13:27.408150 | 2021-01-08T02:42:30 | 2021-01-08T02:42:30 | 55,818,397 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,447 | java | package solution02.c3;
import stdlib.StdIn;
import stdlib.StdOut;
/*************************************************************************
* Compilation: javac QuickX.java
* Execution: java QuickX N
*
* Uses the Bentley-McIlroy 3-way partitioning scheme,
* chooses the partitioning element using Tukey's ninther,
* and cuts off to insertion sort.
*
* Reference: Engineering a Sort Function by Jon L. Bentley
* and M. Douglas McIlroy. Softwae-Practice and Experience,
* Vol. 23 (11), 1249-1265 (November 1993).
*
*************************************************************************/
/**
* The <tt>QuickX</tt> class provides static methods for sorting an
* array using an optimized version of quicksort (using Bentley-McIlroy
* 3-way partitioning, Tukey's ninther, and cutoff to insertion sort).
* <p>
* For additional documentation, see <a href="http://algs4.cs.princeton.edu/21elementary">Section 2.1</a> of
* <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
*
* @author Robert Sedgewick
* @author Kevin Wayne
*/
public class QuickX {
private static final int CUTOFF = 8; // cutoff to insertion sort, must be >= 1
// This class should not be instantiated.
private QuickX() { }
/**
* Rearranges the array in ascending order, using the natural order.
* @param a the array to be sorted
*/
@SuppressWarnings("rawtypes")
public static void sort(Comparable[] a) {
sort(a, 0, a.length - 1);
}
@SuppressWarnings("rawtypes")
private static void sort(Comparable[] a, int lo, int hi) {
int N = hi - lo + 1;
// cutoff to insertion sort
if (N <= CUTOFF) {
insertionSort(a, lo, hi);
return;
}
// use median-of-3 as partitioning element
else if (N <= 40) {
int m = median3(a, lo, lo + N/2, hi);
exch(a, m, lo);
}
// use Tukey ninther as partitioning element
else {
int eps = N/8;
int mid = lo + N/2;
int m1 = median3(a, lo, lo + eps, lo + eps + eps);
int m2 = median3(a, mid - eps, mid, mid + eps);
int m3 = median3(a, hi - eps - eps, hi - eps, hi);
int ninther = median3(a, m1, m2, m3);
exch(a, ninther, lo);
}
// Bentley-McIlroy 3-way partitioning
int i = lo, j = hi+1;
int p = lo, q = hi+1;
Comparable v = a[lo];
while (true) {
while (less(a[++i], v))
if (i == hi) break;
while (less(v, a[--j]))
if (j == lo) break;
// pointers cross
if (i == j && eq(a[i], v))
exch(a, ++p, i);
if (i >= j) break;
exch(a, i, j);
if (eq(a[i], v)) exch(a, ++p, i);
if (eq(a[j], v)) exch(a, --q, j);
}
i = j + 1;
for (int k = lo; k <= p; k++) exch(a, k, j--);
for (int k = hi; k >= q; k--) exch(a, k, i++);
sort(a, lo, j);
sort(a, i, hi);
}
// sort from a[lo] to a[hi] using insertion sort
@SuppressWarnings("rawtypes")
private static void insertionSort(Comparable[] a, int lo, int hi) {
for (int i = lo; i <= hi; i++)
for (int j = i; j > lo && less(a[j], a[j-1]); j--)
exch(a, j, j-1);
}
// return the index of the median element among a[i], a[j], and a[k]
@SuppressWarnings("rawtypes")
private static int median3(Comparable[] a, int i, int j, int k) {
return (less(a[i], a[j]) ?
(less(a[j], a[k]) ? j : less(a[i], a[k]) ? k : i) :
(less(a[k], a[j]) ? j : less(a[k], a[i]) ? k : i));
}
/***********************************************************************
* Helper sorting functions
***********************************************************************/
// is v < w ?
@SuppressWarnings({ "rawtypes", "unchecked" })
private static boolean less(Comparable v, Comparable w) {
return (v.compareTo(w) < 0);
}
// does v == w ?
@SuppressWarnings({ "rawtypes", "unchecked" })
private static boolean eq(Comparable v, Comparable w) {
return (v.compareTo(w) == 0);
}
// exchange a[i] and a[j]
private static void exch(Object[] a, int i, int j) {
Object swap = a[i];
a[i] = a[j];
a[j] = swap;
}
/***********************************************************************
* Check if array is sorted - useful for debugging
***********************************************************************/
@SuppressWarnings({ "rawtypes", "unused" })
private static boolean isSorted(Comparable[] a) {
for (int i = 1; i < a.length; i++)
if (less(a[i], a[i-1])) return false;
return true;
}
// print array to standard output
@SuppressWarnings("rawtypes")
private static void show(Comparable[] a) {
for (int i = 0; i < a.length; i++) {
StdOut.println(a[i]);
}
}
/**
* Reads in a sequence of strings from standard input; quicksorts them
* (using an optimized version of quicksort);
* and prints them to standard output in ascending order.
*/
public static void main(String[] args) {
String[] a = StdIn.readAllStrings();
QuickX.sort(a);
show(a);
}
}
| [
"lcg51271@gmail.com"
] | lcg51271@gmail.com |
4de4eca314b04adfd43e0ae9cb542ac22f368311 | a5f33abfb00007e30139737046331696640e3404 | /old/app/src/main/java/com/widget/miaotu/common/utils/gsutils/StringNullAdapter.java | 6939138cdf2915ddf204369abc8d2fa0037decd0 | [] | no_license | itmouseman/miaotu | 48b2eaf2cb211a6d21ebfcf20c8a2e2b7c7f0d43 | ba13c0f27ad300f7bc578fb21f562a069d2a634e | refs/heads/master | 2023-01-13T17:07:46.241545 | 2020-10-26T05:26:19 | 2020-10-26T05:26:19 | 307,267,569 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 963 | java | package com.widget.miaotu.common.utils.gsutils;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
public class StringNullAdapter extends TypeAdapter<String> {
@Override
public String read(JsonReader reader) throws IOException {
if (reader.peek() == JsonToken.NULL) {
reader.nextNull();
return "";//原先是返回Null,这里改为返回空字符串
}
String jsonStr = reader.nextString();
if(jsonStr.equals("null")) {
return "";
}else {
return jsonStr;
}
}
@Override
public void write(JsonWriter writer, String value) throws IOException {
if (value == null) {
writer.nullValue();
return;
}
writer.value(value);
}
}
| [
"mac@macdeiMac.local"
] | mac@macdeiMac.local |
ffc0ebcbdc1b3cc510dfcc42462554dc32903669 | 004832e529873885f1559eb8c864384b3e1cda3f | /java/lineage2/gameserver/skills/effects/EffectManaHeal.java | 7157705f6066595fb08d9a5e61f1f6ac3ab480fb | [] | no_license | wks1222/mobius-source | 02323e79316eabd4ce7e5b29f8cd5749c930d098 | 325a49fa23035f4d529e5a34b809b83c68d19cad | refs/heads/master | 2021-01-10T02:22:17.746138 | 2015-01-17T20:08:13 | 2015-01-17T20:08:13 | 36,601,733 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,372 | java | /*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
package lineage2.gameserver.skills.effects;
import lineage2.gameserver.model.Effect;
import lineage2.gameserver.network.serverpackets.SystemMessage;
import lineage2.gameserver.stats.Env;
import lineage2.gameserver.stats.Stats;
/**
* @author Mobius
* @version $Revision: 1.0 $
*/
public class EffectManaHeal extends Effect
{
private final boolean _ignoreMpEff;
/**
* Constructor for EffectManaHeal.
* @param env Env
* @param template EffectTemplate
*/
public EffectManaHeal(Env env, EffectTemplate template)
{
super(env, template);
_ignoreMpEff = template.getParam().getBool("ignoreMpEff", false);
}
/**
* Method checkCondition.
* @return boolean
*/
@Override
public boolean checkCondition()
{
if (_effected.isHealBlocked())
{
return false;
}
return super.checkCondition();
}
/**
* Method onStart.
*/
@Override
public void onStart()
{
super.onStart();
if (_effected.isHealBlocked())
{
return;
}
double mp = calc();
double newMp = Math.min(mp * 1.7, (mp * (!_ignoreMpEff ? _effected.calcStat(Stats.MANAHEAL_EFFECTIVNESS, 100., _effector, getSkill()) : 100.)) / 100.);
double addToMp = Math.max(0, Math.min(newMp, ((_effected.calcStat(Stats.MP_LIMIT, null, null) * _effected.getMaxMp()) / 100.) - _effected.getCurrentMp()));
_effected.sendPacket(new SystemMessage(SystemMessage.S1_MPS_HAVE_BEEN_RESTORED).addNumber(Math.round(addToMp)));
if (addToMp > 0)
{
_effected.setCurrentMp(addToMp + _effected.getCurrentMp());
}
}
/**
* Method onActionTime.
* @return boolean
*/
@Override
public boolean onActionTime()
{
return false;
}
}
| [
"mobius@cyber-wizard.com"
] | mobius@cyber-wizard.com |
e1d5a307e14a37acbcdf5d495b97659da3429651 | 47a1618c7f1e8e197d35746639e4480c6e37492e | /src/oracle/retail/stores/pos/services/sale/complete/ContractSignatureCaptureReturnShuttle.java | b9d6ba986fccca7b65de5154f0b40db9233883e8 | [] | no_license | dharmendrams84/POSBaseCode | 41f39039df6a882110adb26f1225218d5dcd8730 | c588c0aa2a2144aa99fa2bbe1bca867e008f47ee | refs/heads/master | 2020-12-31T07:42:29.748967 | 2017-03-29T08:12:34 | 2017-03-29T08:12:34 | 86,555,051 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,310 | java | /* ===========================================================================
* Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
* ===========================================================================
* $Header: rgbustores/applications/pos/src/oracle/retail/stores/pos/services/sale/complete/ContractSignatureCaptureReturnShuttle.java /rgbustores_13.4x_generic_branch/1 2011/05/05 14:06:01 mszekely Exp $
* ===========================================================================
* NOTES
* <other useful comments, qualifications, etc.>
*
* MODIFIED (MM/DD/YY)
* acadar 06/08/10 - changes for signature capture, disable txn send, and
* discounts
* acadar 06/07/10 - changes for signature capture
* acadar 06/03/10 - changes for signature capture and refactoring
* acadar 06/03/10 - signature capture for external order contract
* ===========================================================================
*/
package oracle.retail.stores.pos.services.sale.complete;
import oracle.retail.stores.domain.externalorder.LegalDocumentIfc;
import oracle.retail.stores.foundation.tour.ifc.BusIfc;
import oracle.retail.stores.foundation.tour.ifc.ShuttleIfc;
import oracle.retail.stores.pos.services.sale.SaleCargoIfc;
import oracle.retail.stores.pos.services.signaturecapture.SignatureCaptureCargo;
/**
* Set's the captured signature on the credit tender
*/
public class ContractSignatureCaptureReturnShuttle implements ShuttleIfc
{
// This id is used to tell
// the compiler not to generate a
// new serialVersionUID.
//
private static final long serialVersionUID = -2223170586490716782L;
/** Signature capture cargo */
SignatureCaptureCargo sigCargo = null;
/**
* Loads the shuttle
*/
public void load(BusIfc bus)
{
sigCargo = (SignatureCaptureCargo)bus.getCargo();
}
/* (non-Javadoc)
* @see oracle.retail.stores.foundation.tour.ifc.ShuttleIfc#unload(oracle.retail.stores.foundation.tour.ifc.BusIfc)
*/
public void unload(BusIfc bus)
{
SaleCargoIfc cargo = (SaleCargoIfc)bus.getCargo();
LegalDocumentIfc legalDocument = sigCargo.getLegalDocument();
cargo.setLegalDocument(legalDocument);
}
}
| [
"Ignitiv021@Ignitiv021-PC"
] | Ignitiv021@Ignitiv021-PC |
806b2a5d9168f01e2d7eca756e5c976e485117b7 | b0f70c8a4de2bb61e502ac9ade71e58f09139ec8 | /src/main/java/com/noctarius/snowcast/impl/SnowcastClientProxyDescriptorProvider.java | 575692423fa98b8b201aa7925a80a93e84cf9c52 | [
"Apache-2.0"
] | permissive | noctarius/snowcast | 229748b691e4ca96d33ac9f55e383d9ddb99b16b | 5f4fd2636a0881127b8ffb0ed4337a913e2ad1bc | refs/heads/master | 2020-04-09T02:37:24.664710 | 2017-02-08T07:17:15 | 2017-02-08T07:17:15 | 27,859,802 | 55 | 18 | Apache-2.0 | 2018-03-04T20:47:15 | 2014-12-11T07:40:44 | Java | UTF-8 | Java | false | false | 1,444 | java | /*
* Copyright (c) 2015-2017, Christoph Engelbert (aka noctarius) and
* contributors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.noctarius.snowcast.impl;
import com.hazelcast.client.spi.ClientProxy;
import com.hazelcast.client.spi.ClientProxyDescriptor;
import com.hazelcast.client.spi.ClientProxyDescriptorProvider;
public final class SnowcastClientProxyDescriptorProvider
implements ClientProxyDescriptorProvider {
@Override
public ClientProxyDescriptor[] createClientProxyDescriptors() {
return new ClientProxyDescriptor[]{new ClientProxyDescriptor() {
@Override
public String getServiceName() {
return SnowcastConstants.SERVICE_NAME;
}
@Override
public Class<? extends ClientProxy> getClientProxyClass() {
return ClientSequencer.class;
}
}};
}
}
| [
"me@noctarius.com"
] | me@noctarius.com |
33cf4a6996ebaf5c9be1afc549e40b765a294e0c | 77ef18b7b1ea8372f76cd67cbf433efbdae3baff | /src/assignment11/PriorityQueueTester.java | bd946d86ed98cf8472b1ae9f91ccf879a1b01f0e | [] | no_license | cmpickle/cs2420 | 16f9bab99322370f29ffdab86a7077df7f5a62ed | 87304eeb07661b17ee9c76796cc17f10c4d9e5a2 | refs/heads/master | 2021-01-18T22:17:11.323859 | 2017-04-03T05:47:51 | 2017-04-03T05:47:51 | 87,042,185 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,729 | java | package assignment11;
import static org.junit.Assert.*;
import java.util.NoSuchElementException;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
/**
* A tester class for the PriorityQueue class.
*
* @author Cameron Pickle
* @author Daniel Avery
*/
public class PriorityQueueTester {
StringLengthComp comp;
PriorityQueue<Integer> ints;
PriorityQueue<String> strings;
@Before
public void setUp() throws Exception
{
comp = new StringLengthComp();
ints = new PriorityQueue<Integer>();
strings = new PriorityQueue<String>(comp);
}
@After
public void tearDown() throws Exception
{
ints = null;
strings = null;
}
/****************************************************************
* TEST size()
****************************************************************/
@Test
public void testSize1()
{
ints.add(9);
ints.add(5);
ints.add(3);
ints.add(1);
ints.add(6);
ints.add(8);
assertEquals(6, ints.size());
}
@Test
public void testSize2()
{
strings.add("hi");
strings.add("hey");
strings.add("sup");
strings.add("dude");
strings.add("what");
strings.add("who");
strings.add("yo");
assertEquals(7, strings.size());
}
/****************************************************************
* TEST clear()
****************************************************************/
@Test
public void testClear1()
{
ints.add(9);
ints.add(5);
ints.add(3);
ints.add(1);
ints.add(6);
ints.add(8);
ints.clear();
assertEquals(0, ints.size());
}
@Test
public void testClear2()
{
ints.add(9);
ints.add(5);
ints.add(3);
ints.add(1);
ints.add(6);
ints.add(8);
ints.clear();
ints.add(3);
ints.add(1);
ints.add(6);
ints.add(8);
assertEquals(4, ints.size());
}
@Test
public void testClear3()
{
strings.add("hi");
strings.add("hey");
strings.add("sup");
strings.add("dude");
strings.add("what");
strings.add("who");
strings.add("yo");
strings.clear();
assertEquals(0, strings.size());
}
/****************************************************************
* TEST findMin()
****************************************************************/
@Test
public void testFindMin1()
{
ints.add(21);
ints.add(273);
ints.add(51);
ints.add(52);
ints.add(79);
ints.add(19);
ints.add(22);
ints.add(35);
ints.add(20);
ints.add(40);
assertEquals((Integer)19, ints.findMin());
}
@Test
public void testFindMin2()
{
ints.add(21);
ints.add(273);
ints.add(51);
ints.add(52);
ints.add(79);
ints.add(19);
ints.add(22);
ints.add(35);
ints.add(20);
ints.add(40);
ints.deleteMin();
assertEquals((Integer)20, ints.findMin());
}
@Test
public void testFindMin3()
{
ints.add(21);
ints.add(273);
ints.add(51);
ints.add(52);
assertEquals(21, (int) ints.findMin());
ints.clear();
ints.add(79);
ints.add(19);
assertEquals(19, (int) ints.findMin());
ints.clear();
ints.add(-22);
ints.add(-35);
ints.add(20);
ints.add(40);
ints.deleteMin();
assertEquals(-22, (int) ints.findMin());
}
@Test
public void testFindMin4()
{
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
strings.add("pickles");
assertEquals("pickles", strings.findMin());
assertEquals("pickles", strings.deleteMin());
assertEquals("pickles", strings.findMin());
}
@Test (expected = NoSuchElementException.class)
public void testFindMinException()
{
ints.findMin();
}
/****************************************************************
* TEST deleteMin()
****************************************************************/
@Test
public void testDeleteMin1()
{
ints.add(9);
ints.add(5);
ints.add(3);
ints.add(1);
ints.add(6);
ints.add(8);
assertEquals(1, (int) ints.deleteMin());
assertEquals(5, ints.size());
assertEquals(3, (int) ints.findMin());
}
@Test
public void testDeleteMin2()
{
ints.add(9);
ints.add(5);
ints.add(3);
ints.add(1);
ints.add(6);
ints.add(8);
assertEquals(1, (int) ints.deleteMin());
assertEquals(3, (int) ints.deleteMin());
assertEquals(5, (int) ints.deleteMin());
assertEquals(6, (int) ints.deleteMin());
assertEquals(2, ints.size());
assertEquals(8, (int) ints.findMin());
}
@Test
public void testDeleteMin3()
{
strings.add("a");
strings.add("hey");
strings.add("sup");
strings.add("dude");
strings.add("what");
strings.add("who");
strings.add("yo");
assertEquals("a", (String) strings.deleteMin());
assertEquals("yo", (String) strings.deleteMin());
assertEquals("who", (String) strings.deleteMin());
assertEquals("hey", (String) strings.deleteMin());
assertEquals(3, strings.size());
}
@Test (expected = NoSuchElementException.class)
public void testDeleteMinException()
{
ints.deleteMin();
}
/****************************************************************
* TEST add()
****************************************************************/
@Test
public void testAdd1()
{
Integer[] arr = {5, 8, 6, 9};
ints.add(9);
ints.add(5);
ints.add(3);
ints.add(1);
ints.add(6);
ints.add(8);
assertEquals(1, (int) ints.deleteMin());
assertEquals(5, ints.size());
assertEquals(3, (int) ints.findMin());
ints.clear();
ints.add(9);
ints.add(5);
ints.add(6);
ints.add(8);
assertEquals(4, ints.size());
assertArrayEquals(arr, ints.toArray());
}
@Test
public void testAdd2()
{
Integer[] arr = {-9, -8, -6, -5};
ints.add(900);
ints.add(500000);
ints.add(23);
ints.add(-16);
ints.add(68);
ints.add(-1);
assertEquals(-16, (int) ints.deleteMin());
assertEquals(5, ints.size());
assertEquals(-1, (int) ints.findMin());
ints.clear();
ints.add(-9);
ints.add(-5);
ints.add(-6);
ints.add(-8);
assertEquals(4, ints.size());
assertArrayEquals(arr, ints.toArray());
}
@Test
public void testAdd3()
{
strings.add("hi");
strings.add("hey");
strings.add("sup");
strings.add("dude");
strings.add("what");
strings.add("who");
strings.add("yo");
strings.clear();
strings.add("59");
strings.add("hey");
strings.add("99999");
strings.add("dude");
strings.add("this is it");
strings.add("who_are_you?_why_are_you_here?");
strings.add("");
strings.add(";");
assertEquals(8, strings.size());
assertEquals("", (String) strings.deleteMin());
assertEquals(";", (String) strings.deleteMin());
assertEquals("59", (String) strings.deleteMin());
assertEquals("hey", (String) strings.findMin());
}
}
| [
"cmpickle@gmail.com"
] | cmpickle@gmail.com |
5523be24a10be66eef3625b1d6fd731a9ca437c3 | f2b07635c7365975263a7d9401496620f9e64a06 | /96_深入理解hystrix的短路器执行原理以及模拟接口异常时的短路实验/代码/eshop-cache-ha/src/main/java/com/roncoo/eshop/cache/ha/controller/CacheController.java | 01767470f6a2e4ee49275186700a6d532a1a65be | [] | no_license | chenjiaren123/xuexiziliao | f9305cc1fcc1e845fb9b7631d8908cfea0cdcefe | 8c07c05bdbc35f67a7d691ac07defc5793a9a9f6 | refs/heads/master | 2022-07-16T08:56:13.175353 | 2019-09-03T15:15:25 | 2019-09-03T15:15:25 | 204,735,102 | 0 | 0 | null | 2022-06-17T03:30:51 | 2019-08-27T15:38:03 | Java | UTF-8 | Java | false | false | 3,634 | java | package com.roncoo.eshop.cache.ha.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.netflix.hystrix.HystrixCommand;
import com.roncoo.eshop.cache.ha.http.HttpClientUtils;
import com.roncoo.eshop.cache.ha.hystrix.command.GetBrandNameCommand;
import com.roncoo.eshop.cache.ha.hystrix.command.GetCityNameCommand;
import com.roncoo.eshop.cache.ha.hystrix.command.GetProductInfoCommand;
import com.roncoo.eshop.cache.ha.model.ProductInfo;
/**
* 缓存服务的接口
* @author Administrator
*
*/
@Controller
public class CacheController {
@RequestMapping("/change/product")
@ResponseBody
public String changeProduct(Long productId) {
// 拿到一个商品id
// 调用商品服务的接口,获取商品id对应的商品的最新数据
// 用HttpClient去调用商品服务的http接口
String url = "http://127.0.0.1:8082/getProductInfo?productId=" + productId;
String response = HttpClientUtils.sendGetRequest(url);
System.out.println(response);
return "success";
}
/**
* nginx开始,各级缓存都失效了,nginx发送很多的请求直接到缓存服务要求拉取最原始的数据
* @param productId
* @return
*/
@RequestMapping("/getProductInfo")
@ResponseBody
public ProductInfo getProductInfo(Long productId) {
// 拿到一个商品id
// 调用商品服务的接口,获取商品id对应的商品的最新数据
// 用HttpClient去调用商品服务的http接口
HystrixCommand<ProductInfo> getProductInfoCommand = new GetProductInfoCommand(productId);
ProductInfo productInfo = getProductInfoCommand.execute();
Long cityId = productInfo.getCityId();
GetCityNameCommand getCityNameCommand = new GetCityNameCommand(cityId);
String cityName = getCityNameCommand.execute();
productInfo.setCityName(cityName);
Long brandId = productInfo.getBrandId();
GetBrandNameCommand getBrandNameCommand = new GetBrandNameCommand(brandId);
String brandName = getBrandNameCommand.execute();
productInfo.setBrandName(brandName);
// Future<ProductInfo> future = getProductInfoCommand.queue();
// try {
// Thread.sleep(1000);
// System.out.println(future.get());
// } catch (Exception e) {
// e.printStackTrace();
// }
System.out.println(productInfo);
return productInfo;
}
/**
* 一次性批量查询多条商品数据的请求
*/
@RequestMapping("/getProductInfos")
@ResponseBody
public String getProductInfos(String productIds) {
// HystrixObservableCommand<ProductInfo> getProductInfosCommand =
// new GetProductInfosCommand(productIds.split(","));
// Observable<ProductInfo> observable = getProductInfosCommand.observe();
//
// observable = getProductInfosCommand.toObservable(); // 还没有执行
//
// observable.subscribe(new Observer<ProductInfo>() { // 等到调用subscribe然后才会执行
//
// public void onCompleted() {
// System.out.println("获取完了所有的商品数据");
// }
//
// public void onError(Throwable e) {
// e.printStackTrace();
// }
//
// public void onNext(ProductInfo productInfo) {
// System.out.println(productInfo);
// }
//
// });
for(String productId : productIds.split(",")) {
GetProductInfoCommand getProductInfoCommand = new GetProductInfoCommand(
Long.valueOf(productId));
ProductInfo productInfo = getProductInfoCommand.execute();
System.out.println(productInfo);
System.out.println(getProductInfoCommand.isResponseFromCache());
}
return "success";
}
}
| [
"chen@qq.com"
] | chen@qq.com |
cdfa5edb819cc4c248cb18062877cbc755adf6da | 9b9c3236cc1d970ba92e4a2a49f77efcea3a7ea5 | /L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/instancemanager/PremiumManager.java | 62d726cfeb6e25815bad9c9cbeab891f0c7f02ac | [] | no_license | BETAJIb/ikol | 73018f8b7c3e1262266b6f7d0a7f6bbdf284621d | f3709ea10be2d155b0bf1dee487f53c723f570cf | refs/heads/master | 2021-01-05T10:37:17.831153 | 2019-12-24T22:23:02 | 2019-12-24T22:23:02 | 240,993,482 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,986 | java | /*
* This file is part of the L2J Mobius project.
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
package org.l2jmobius.gameserver.instancemanager;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.database.DatabaseFactory;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.events.Containers;
import org.l2jmobius.gameserver.model.events.EventType;
import org.l2jmobius.gameserver.model.events.ListenersContainer;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin;
import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogout;
import org.l2jmobius.gameserver.model.events.listeners.ConsumerEventListener;
/**
* @author Mobius
*/
public class PremiumManager
{
// SQL Statement
private static final String LOAD_SQL = "SELECT account_name,enddate FROM account_premium WHERE account_name = ?";
private static final String UPDATE_SQL = "REPLACE INTO account_premium (account_name,enddate) VALUE (?,?)";
private static final String DELETE_SQL = "DELETE FROM account_premium WHERE account_name = ?";
class PremiumExpireTask implements Runnable
{
final PlayerInstance player;
PremiumExpireTask(PlayerInstance player)
{
this.player = player;
}
@Override
public void run()
{
player.setPremiumStatus(false);
}
}
// Data Cache
private final Map<String, Long> premiumData = new ConcurrentHashMap<>();
// expireTasks
private final Map<String, ScheduledFuture<?>> expiretasks = new ConcurrentHashMap<>();
// Listeners
private final ListenersContainer listenerContainer = Containers.Players();
private final Consumer<OnPlayerLogin> playerLoginEvent = (event) ->
{
final PlayerInstance player = event.getPlayer();
final String accountName = player.getAccountName();
loadPremiumData(accountName);
final long now = System.currentTimeMillis();
final long premiumExpiration = getPremiumExpiration(accountName);
player.setPremiumStatus(premiumExpiration > now);
if (player.hasPremiumStatus())
{
startExpireTask(player, premiumExpiration - now);
}
else if (premiumExpiration > 0)
{
removePremiumStatus(accountName, false);
}
};
private final Consumer<OnPlayerLogout> playerLogoutEvent = (event) ->
{
PlayerInstance player = event.getPlayer();
stopExpireTask(player);
};
protected PremiumManager()
{
listenerContainer.addListener(new ConsumerEventListener(listenerContainer, EventType.ON_PLAYER_LOGIN, playerLoginEvent, this));
listenerContainer.addListener(new ConsumerEventListener(listenerContainer, EventType.ON_PLAYER_LOGOUT, playerLogoutEvent, this));
}
/**
* @param player
* @param delay
*/
private void startExpireTask(PlayerInstance player, long delay)
{
ScheduledFuture<?> task = ThreadPool.schedule(new PremiumExpireTask(player), delay);
expiretasks.put(player.getAccountName(), task);
}
/**
* @param player
*/
private void stopExpireTask(PlayerInstance player)
{
ScheduledFuture<?> task = expiretasks.remove(player.getAccountName());
if (task != null)
{
task.cancel(false);
task = null;
}
}
public void loadPremiumData(String accountName)
{
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(LOAD_SQL))
{
stmt.setString(1, accountName);
try (ResultSet rset = stmt.executeQuery())
{
while (rset.next())
{
premiumData.put(rset.getString(1), rset.getLong(2));
}
}
}
catch (SQLException e)
{
e.printStackTrace();
}
}
public long getPremiumExpiration(String accountName)
{
return premiumData.getOrDefault(accountName, 0L);
}
public void addPremiumTime(String accountName, int timeValue, TimeUnit timeUnit)
{
long addTime = timeUnit.toMillis(timeValue);
long now = System.currentTimeMillis();
// new premium task at least from now
long oldPremiumExpiration = Math.max(now, getPremiumExpiration(accountName));
long newPremiumExpiration = oldPremiumExpiration + addTime;
// UPDATE DATABASE
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(UPDATE_SQL))
{
stmt.setString(1, accountName);
stmt.setLong(2, newPremiumExpiration);
stmt.execute();
}
catch (SQLException e)
{
e.printStackTrace();
}
// UPDATE CACHE
premiumData.put(accountName, newPremiumExpiration);
// UPDATE PlAYER PREMIUMSTATUS
PlayerInstance playerOnline = World.getInstance().getPlayers().stream().filter(p -> accountName.equals(p.getAccountName())).findFirst().orElse(null);
if (playerOnline != null)
{
stopExpireTask(playerOnline);
startExpireTask(playerOnline, newPremiumExpiration - now);
if (!playerOnline.hasPremiumStatus())
{
playerOnline.setPremiumStatus(true);
}
}
}
public void removePremiumStatus(String accountName, boolean checkOnline)
{
if (checkOnline)
{
PlayerInstance playerOnline = World.getInstance().getPlayers().stream().filter(p -> accountName.equals(p.getAccountName())).findFirst().orElse(null);
if ((playerOnline != null) && playerOnline.hasPremiumStatus())
{
playerOnline.setPremiumStatus(false);
stopExpireTask(playerOnline);
}
}
// UPDATE CACHE
premiumData.remove(accountName);
// UPDATE DATABASE
try (Connection con = DatabaseFactory.getConnection();
PreparedStatement stmt = con.prepareStatement(DELETE_SQL))
{
stmt.setString(1, accountName);
stmt.execute();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
public static PremiumManager getInstance()
{
return SingletonHolder.INSTANCE;
}
private static class SingletonHolder
{
protected static final PremiumManager INSTANCE = new PremiumManager();
}
} | [
"mobius@cyber-wizard.com"
] | mobius@cyber-wizard.com |
dc0f3bd3bcb607f58735e49272b83aa202dcf232 | 5eae683a6df0c4b97ab1ebcd4724a4bf062c1889 | /bin/platform/bootstrap/gensrc/de/hybris/platform/cms2/model/relations/package-info.java | 7d1abdcb1e11dfa46e1be7fc2cb8664bcf71e261 | [] | no_license | sujanrimal/GiftCardProject | 1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb | e0398eec9f4ec436d20764898a0255f32aac3d0c | refs/heads/master | 2020-12-11T18:05:17.413472 | 2020-01-17T18:23:44 | 2020-01-17T18:23:44 | 233,911,127 | 0 | 0 | null | 2020-06-18T15:26:11 | 2020-01-14T18:44:18 | null | UTF-8 | Java | false | false | 533 | java | /*
*
* [y] hybris Platform
* Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved.
* This software is the confidential and proprietary information of SAP
* ("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 SAP.
*/
/**
* Contains generated models for each type of de.hybris.platform.cms2.jalo.relations package.
*/
package de.hybris.platform.cms2.model.relations;
| [
"travis.d.crawford@accenture.com"
] | travis.d.crawford@accenture.com |
88e97f36c6499924c2f05dda1dd4c215c75c620f | ad0325eb7f7e30ef220fa3c49e550bcaec51f16c | /src/aula03/orientacaoObjetos/classesAbstratas/ContaJuridica.java | 84ccc9628d6c99ffc298760f01e8f05467404bd6 | [] | no_license | edneyRoldao/aulas-java | 79a4b5b99e5faab372693e5fc87ee31467b3c6ba | da35b2505f341fbb49b20836c652d32204687961 | refs/heads/master | 2023-03-10T10:18:23.317486 | 2021-03-01T15:21:20 | 2021-03-01T15:21:20 | 341,656,199 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 549 | java | package aula03.orientacaoObjetos.classesAbstratas;
public class ContaJuridica extends Conta {
private String cnpj;
public ContaJuridica(Integer numeroConta, Integer agencia, String endereco, String nomeCliente, String doc) {
super(numeroConta, agencia, endereco, nomeCliente);
cnpj = doc;
}
@Override
public void consultarDocumento() {
System.out.println("Sou um doc do tipo CNPJ: " + cnpj);
}
// getters and setters
public String getCnpj() {
return cnpj;
}
public void setCnpj(String cnpj) {
this.cnpj = cnpj;
}
}
| [
"edneyroldao@gmail.com"
] | edneyroldao@gmail.com |
1bb7811878208afe68c41492c689b5d9c8d1dc59 | 4cfae83ad512bff5dba42d9475b446a4c690cba6 | /midwestenbankwebapp/midwestenbankwebapp/src/main/java/edu/mum/cs/cs425/finalexam/midwestenbankwebapp/repository/IAccountRepository.java | b0d2082a5b29126c22dbf8427e5abf1e633717a2 | [] | no_license | sarojthapa2019/SE | 45645818a6d961660e8df120ddc8141dca861d45 | 72e8ce6d53f538a68d588f67c2feb4c9b73c14cc | refs/heads/master | 2022-12-12T05:39:19.410822 | 2019-12-19T22:15:04 | 2019-12-19T22:15:04 | 229,144,364 | 0 | 0 | null | 2022-11-24T09:37:19 | 2019-12-19T21:50:41 | HTML | UTF-8 | Java | false | false | 348 | java | package edu.mum.cs.cs425.finalexam.midwestenbankwebapp.repository;
import edu.mum.cs.cs425.finalexam.midwestenbankwebapp.model.Account;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface IAccountRepository extends JpaRepository<Account, Long> {
}
| [
"sarose301@gmail.com"
] | sarose301@gmail.com |
19e686adf690af2ce017883ebb57e485f0dfce2f | a9d89d565a7f7a06e7c575c4edc0c28770e45f73 | /org.osate.xtext.aadl2.errormodel/src-gen/org/osate/xtext/aadl2/errormodel/errorModel/impl/ErrorTypesImpl.java | 61658216fd18573482af6d958ec039c3ba6aebcb | [] | no_license | sma350/ErrorModelV2 | 246311aef24836ccada2ca3f6f10832ddda58ec1 | d2d01f7376201906ca1f0f664265ef6dc272e7a2 | refs/heads/master | 2020-12-11T06:14:38.961516 | 2015-02-28T17:39:57 | 2015-02-28T17:39:57 | 33,978,368 | 0 | 0 | null | 2015-04-15T06:58:41 | 2015-04-15T06:58:41 | null | UTF-8 | Java | false | false | 871 | java | /**
*/
package org.osate.xtext.aadl2.errormodel.errorModel.impl;
import org.eclipse.emf.ecore.EClass;
import org.osate.aadl2.impl.NamedElementImpl;
import org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelPackage;
import org.osate.xtext.aadl2.errormodel.errorModel.ErrorTypes;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Error Types</b></em>'.
* <!-- end-user-doc -->
* <p>
* </p>
*
* @generated
*/
public class ErrorTypesImpl extends NamedElementImpl implements ErrorTypes
{
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected ErrorTypesImpl()
{
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass()
{
return ErrorModelPackage.Literals.ERROR_TYPES;
}
} //ErrorTypesImpl
| [
"lutz.wrage@gmail.com"
] | lutz.wrage@gmail.com |
7cc138576ba0d32e6910160d7bf3b58716b28045 | 86379142e9429376c9b3db46eee6e9841337bfc2 | /src/main/java/com/github/piasy/base/model/jsr310/ThreeTenABPDelegateImpl.java | 7f5e30c638135086ae90f4492a485c530949e537 | [] | no_license | gengjiawen/AndroidTDDBootStrap-base | e8e226d566b422f0dfd64a42c7d028a97e63eb7c | c940212c1b68f64b543decf9f5e119a339b99b0a | refs/heads/master | 2020-12-24T08:08:25.885297 | 2016-11-09T14:32:42 | 2016-11-09T14:39:22 | 73,341,743 | 0 | 0 | null | 2016-11-10T02:57:26 | 2016-11-10T02:57:24 | Java | UTF-8 | Java | false | false | 2,032 | java | /*
* The MIT License (MIT)
*
* Copyright (c) 2016 Piasy
*
* 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.github.piasy.base.model.jsr310;
import android.app.Application;
import com.jakewharton.threetenabp.AndroidThreeTen;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* Created by Piasy{github.com/Piasy} on 15/8/16.
*
* Implementation of {@link ThreeTenABPDelegate}.
*/
@Singleton
public class ThreeTenABPDelegateImpl implements ThreeTenABPDelegate {
private final Application mApplication;
/**
* Create instance with the given {@link Application} object. Used to initialize the
* ThreeTenABP library.
*
* @param application the given {@link Application} object. Used to initialize the ThreeTenABP
* library.
*/
@Inject
ThreeTenABPDelegateImpl(final Application application) {
this.mApplication = application;
}
@Override
public void init() {
AndroidThreeTen.init(mApplication);
}
}
| [
"xz4215@gmail.com"
] | xz4215@gmail.com |
00f81d8b52ed545b5edd5024b8d263125b512aab | 7596b13ad3a84feb67f05aeda486e8b9fc93f65f | /getAndroidAPI/src/java/util/EventListener.java | 90f7409ba1a0d3a298e7474b5b598a6d32e3bd65 | [] | no_license | WinterPan2017/Android-Malware-Detection | 7aeacfa03ca1431e7f3ba3ec8902cfe2498fd3de | ff38c91dc6985112e958291867d87bfb41c32a0f | refs/heads/main | 2023-02-08T00:02:28.775711 | 2020-12-20T06:58:01 | 2020-12-20T06:58:01 | 303,900,592 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 249 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name: EventListener.java
package java.util;
public interface EventListener
{
}
| [
"panwentao1301@163.com"
] | panwentao1301@163.com |
0fc8225051c485b7aca4bac1042d77dc762261ce | 2c6e2ba03eb71ca45fe690ff6e4586f6e2fa0f17 | /material/apks/banco/sources/ar/com/santander/rio/mbanking/services/model/general/Productos.java | 611513054352442a0f7b3f3867143b98ddfa39f6 | [] | no_license | lcrcastor/curso-mobile-2019 | 3088a196139b3e980ed6e09797a0bbf5efb6440b | 7585fccb6437a17c841772c1d9fb0701d6c68042 | refs/heads/master | 2023-04-06T21:46:32.333236 | 2020-10-30T19:47:54 | 2020-10-30T19:47:54 | 308,680,747 | 0 | 1 | null | 2023-03-26T06:57:57 | 2020-10-30T16:08:31 | Java | UTF-8 | Java | false | false | 1,554 | java | package ar.com.santander.rio.mbanking.services.model.general;
import com.google.gson.annotations.SerializedName;
public class Productos {
@SerializedName("cuentas")
Cuentas cuentas;
@SerializedName("cuentasBP")
Cuentas cuentasBP;
@SerializedName("cuentasTitulo")
Cuentas cuentasTitulo;
@SerializedName("prestamos")
Prestamos prestamos;
@SerializedName("tarjetas")
Tarjetas tarjetas;
@SerializedName("tarjetasDebito")
TarjetasDebito tarjetasDebito;
public Cuentas getCuentas() {
return this.cuentas;
}
public void setCuentas(Cuentas cuentas2) {
this.cuentas = cuentas2;
}
public Tarjetas getTarjetas() {
return this.tarjetas;
}
public void setTarjetas(Tarjetas tarjetas2) {
this.tarjetas = tarjetas2;
}
public TarjetasDebito getTarjetasDebito() {
return this.tarjetasDebito;
}
public void setTarjetasDebito(TarjetasDebito tarjetasDebito2) {
this.tarjetasDebito = tarjetasDebito2;
}
public Cuentas getCuentasTitulo() {
return this.cuentasTitulo;
}
public void setCuentasTitulo(Cuentas cuentas2) {
this.cuentasTitulo = cuentas2;
}
public Prestamos getPrestamos() {
return this.prestamos;
}
public void setPrestamos(Prestamos prestamos2) {
this.prestamos = prestamos2;
}
public Cuentas getCuentasBP() {
return this.cuentasBP;
}
public void setCuentasBP(Cuentas cuentas2) {
this.cuentasBP = cuentas2;
}
}
| [
"luis@MARK-2.local"
] | luis@MARK-2.local |
0ed95b118b5a589940b41e237ba555222746dd73 | 4472796266749a7f2e031274041ea583a50de121 | /java/arrays/leetcode/put_marbles_in_bags.java | ecbf431f1822357d018aa810a5517e931d05583c | [] | no_license | vetkolisanket/ds_algo | 879324430c97732a0aa31678138b9f9c88803e79 | 7c6e4c82a75ba19eafc57f0765b048b198a9ece9 | refs/heads/master | 2023-09-03T11:15:01.902084 | 2023-09-03T10:02:06 | 2023-09-03T10:02:06 | 250,981,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,721 | java | /*
2551. Put Marbles in Bags
You have k bags. You are given a 0-indexed integer array weights where weights[i] is the weight of the ith marble. You are also given the integer k.
Divide the marbles into the k bags according to the following rules:
No bag is empty.
If the ith marble and jth marble are in a bag, then all marbles with an index between the ith and jth indices should also be in that same bag.
If a bag consists of all the marbles with an index from i to j inclusively, then the cost of the bag is weights[i] + weights[j].
The score after distributing the marbles is the sum of the costs of all the k bags.
Return the difference between the maximum and minimum scores among marble distributions.
Example 1:
Input: weights = [1,3,5,1], k = 2
Output: 4
Explanation:
The distribution [1],[3,5,1] results in the minimal score of (1+1) + (3+1) = 6.
The distribution [1,3],[5,1], results in the maximal score of (1+3) + (5+1) = 10.
Thus, we return their difference 10 - 6 = 4.
Example 2:
Input: weights = [1, 3], k = 2
Output: 0
Explanation: The only distribution possible is [1],[3].
Since both the maximal and minimal score are the same, we return 0.
Constraints:
1 <= k <= weights.length <= 10^5
1 <= weights[i] <= 10^9
*/
//Soln using greedy TC O(NlogN) SC O(N)
class Solution {
public long putMarbles(int[] weights, int k) {
int n = weights.length;
long[] pairWeights = new long[n-1];
for (int i=0;i<n-1;i++) {
pairWeights[i] = weights[i] + weights[i+1];
}
Arrays.sort(pairWeights);
long ans = 0L;
for (int i=0;i<k-1;i++) {
ans += pairWeights[n-2-i] - pairWeights[i];
}
return ans;
}
}
| [
"sanket.vetkoli@agrostar.in"
] | sanket.vetkoli@agrostar.in |
5651d719727f59fbb09aa4ab2ff0f94a4844577f | 2526e13c77927cb8a7967f40bfab0eac2ea88130 | /HeRide_partner/app/src/main/java/com/karry/side_screens/wallet/changeCard/model/CardDetailsDataModel.java | f92b547c0922df5a208db8f6ad907d58a094d887 | [] | no_license | therealbop/Android-Driver | 5d77166a01f73e0685137ed9eb117121bf8df15b | 163ddd99233e0a93179a1c9d765f614373fad336 | refs/heads/master | 2021-02-09T18:47:18.685299 | 2020-03-02T08:44:05 | 2020-03-02T08:44:05 | 244,315,056 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,878 | java | package com.karry.side_screens.wallet.changeCard.model;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.io.Serializable;
/**
* <h1>CardDetailsDataModel</h1>
* Used to hold the cards details
* @author embed
* @since on 25/11/15.
*/
public class CardDetailsDataModel implements Serializable
{
@SerializedName("id")
@Expose
private String id;
@SerializedName("last4")
@Expose
private String last4;
@SerializedName("brand")
@Expose
private String brand;
@SerializedName("expMonth")
@Expose
private String expMonth;
@SerializedName("funding")
@Expose
private String funding;
@SerializedName("expYear")
@Expose
private String expYear;
@SerializedName("name")
@Expose
private String name;
@SerializedName("isDefault")
@Expose
private boolean isDefault;
@SerializedName("paymentType")
@Expose
private int paymentType;
public int getPaymentType() {
return paymentType;
}
public void setPaymentType(int paymentType) {
this.paymentType = paymentType;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getLast4() {
return last4;
}
public String getBrand() {
return brand;
}
public String getExpMonth() {
return expMonth;
}
public String getExpYear() {
return expYear;
}
public boolean getDefault() {
return isDefault;
}
public void setDefault(boolean aDefault) {
this.isDefault = aDefault;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFunding() {
return funding;
}
}
| [
"arun@mobifyi.com"
] | arun@mobifyi.com |
d4a02e9f6a46c9c22ba444cff8240be038c8895b | 22c8794809cb5bf03c489ff23e552e0df79a1e13 | /src/hard/WordSearchII.java | 7ea04fd81a391ab7e38e77e1fdff1ed2d0cb093f | [] | no_license | acrush37/leetcode-dfs | cd5b136f7243d455402c20db229ecbd2c39351f3 | 96468c30a5f5a34b4ed098be6e3877b48e37b2cf | refs/heads/master | 2022-04-01T17:09:21.070318 | 2020-02-06T11:47:18 | 2020-02-06T11:47:18 | 215,553,894 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,012 | java | package hard;
import java.util.ArrayList;
import java.util.List;
/*
Given a 2D board and a list of words from the dictionary, find all words in the board.
Each word must be constructed from letters of sequentially adjacent cell, where "adjacent" cells are
those horizontally or vertically neighboring. The same letter cell may not be used more than once in a word.
*/
public class WordSearchII {
private int[] a = {-1, 1, 0, 0};
private int[] b = {0, 0, -1, 1};
public static void main(String... args) {
String[] words = {"aaa"};
char[][] board = {{'a','a'}};
WordSearchII wordSearchII = new WordSearchII();
System.out.println(wordSearchII.findWords(board, words));
}
private boolean dfs(int k, int x, int y, int m, int n, char[] c, char[][] f, boolean[][] t) {
if (k == -1) return true;
for (int i = 0; i < 4; i++) {
int u = x + a[i];
int v = y + b[i];
if (u < 0 || v < 0 || u >= m || v >= n || t[u][v] || f[u][v] != c[k]) continue;
t[u][v] = true;
if (dfs(k-1, u, v, m, n, c, f, t)) return true;
t[u][v] = false;
}
return false;
}
private boolean check(int m, int n, char[][] f, char[] c) {
int p = c.length - 1;
for (int i = 0; i < m; i++)
for (int j = 0; j < n; j++)
if (f[i][j] == c[p]) {
boolean[][] t = new boolean[m][n];
t[i][j] = true;
if (dfs(p-1, i, j, m, n, c, f, t)) return true;
}
return false;
}
public List<String> findWords(char[][] board, String[] words) {
int m = board.length;
List<String> result = new ArrayList<>();
if (m == 0) return result;
int n = board[0].length;
for (String word : words)
if (check(m, n, board, word.toCharArray()))
result.add(word);
return result;
}
}
| [
"acrush37@gmail.com"
] | acrush37@gmail.com |
0ad73b286dea69a26938b94ec50cf2a4b6819cd5 | 2f9ff75d69186bb8e05d77ebcc082eb77d8ad399 | /common.settlement.sdk/src/main/java/com/guohuai/account/api/response/AccountSettlementResponse.java | 592532056d6a697f4e5f031839535861aa0b07d0 | [] | no_license | songpanyong/p-boot | db19956d6db7cf0d517f9800e0142c8c29b26757 | 1cc47792746b3123e8814a6d940de99ac97a3c35 | refs/heads/master | 2020-03-10T04:45:52.264469 | 2018-04-12T05:50:27 | 2018-04-12T05:50:27 | 129,200,605 | 2 | 5 | null | null | null | null | UTF-8 | Java | false | false | 702 | java | package com.guohuai.account.api.response;
import java.math.BigDecimal;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* @ClassName: AccountSettlementResponse
* @Description: 轧差结算返回参数
* @author chendonghui
* @date 2017年6月8日 下午4:55:48
*
*/
@Data
@EqualsAndHashCode(callSuper=false)
public class AccountSettlementResponse extends BaseResponse {
private static final long serialVersionUID = 3356030702384518611L;
/**
* 发行人Id
*/
private String publisherUserOid;
/**
* 轧差额
*/
private BigDecimal nettingBalance;
/**
* 请求流水号
*/
private String requestNo;
/**
* 来源系统单据号
*/
private String orderNo;
}
| [
"songpanyong@163.com"
] | songpanyong@163.com |
de68d7923db9e927d72f96e429001888bd3f6f12 | a7412e915e3115ea12629eb764aba7b6d7d618fa | /app/src/main/java/com/puyue/www/qiaoge/view/LuckPan.java | 42998a6263ee6f33d92f83754360a8d82a155a00 | [] | no_license | wang15855271796/qiaoge | a50a93f03a0e5b64562f7f85a2d8d5c7ce5aa56e | b6f8009e72cbf9bdcf293dd9760dcb904e164f00 | refs/heads/master | 2023-03-22T05:34:09.716442 | 2021-03-20T07:19:30 | 2021-03-20T07:19:30 | 349,652,900 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,549 | java | package com.puyue.www.qiaoge.view;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.puyue.www.qiaoge.R;
import java.util.ArrayList;
import java.util.List;
/**
* @ProjectName: LuckPan
* @Package: com.itfitness.luckpan.widget
* @ClassName: LuckPan
* @Description: java类作用描述 :
* @Author: 作者名:lml
* @CreateDate: 2019/3/12 15:50
* @UpdateUser: 更新者:
* @UpdateDate: 2019/3/12 15:50
* @UpdateRemark: 更新说明:
* @Version: 1.0
*/
public class LuckPan extends View {
private Paint mPaintArc;//转盘扇形画笔
private Paint mPaintItemStr;//转盘文字画笔
private int mRadius;//圆盘的半径
private RectF rectFPan;//构建转盘的矩形
private RectF rectFStr;//构建文字圆盘的矩形
private List<String> mItemStrs;
private ArrayList<Path> mArcPaths;
private float mItemAnge;
private int mRepeatCount = 4;//转几圈
private int mLuckNum = 2;//最终停止的位置
private float mStartAngle = 0;//存储圆盘开始的位置
private float mOffsetAngle = 0;//圆盘偏移角度(当Item数量为4的倍数的时候)
private float mTextSize = 20;//文字大小
private ObjectAnimator objectAnimator;
private LuckPanAnimEndCallBack luckPanAnimEndCallBack;
public LuckPanAnimEndCallBack getLuckPanAnimEndCallBack() {
return luckPanAnimEndCallBack;
}
public void setLuckPanAnimEndCallBack(LuckPanAnimEndCallBack luckPanAnimEndCallBack) {
this.luckPanAnimEndCallBack = luckPanAnimEndCallBack;
}
public LuckPan(Context context) {
this(context,null);
}
public LuckPan(Context context, @Nullable AttributeSet attrs) {
this(context, attrs,0);
}
public LuckPan(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
mPaintArc = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaintArc.setStyle(Paint.Style.FILL);
mPaintItemStr = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaintItemStr.setColor(Color.parseColor("#ED2F2F"));
mPaintItemStr.setStrokeWidth(3);
mPaintItemStr.setTextAlign(Paint.Align.CENTER);
mArcPaths = new ArrayList<>();
// for ( int i = 0; i < 5; i++ ) {
// mListBitmap.add(BitmapFactory.decodeResource(getResources(), R.mipmap.ic_add));
// }
}
/**
* 设置转盘数据
* @param items
*/
public void setItems(List<String> items){
mItemStrs = items;
mOffsetAngle=0;
mStartAngle=0;
mOffsetAngle = 360/items.size()/2;
invalidate();
}
/**
* 设置转盘数据
*/
public void setLuckNumber(int luckNumber){
mLuckNum = luckNumber;
}
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mRadius = (int) (Math.min(w,h)/2*0.9);
//这里是将(0,0)点作为圆心
rectFPan = new RectF(-mRadius,-mRadius,mRadius,mRadius);
rectFStr = new RectF(-mRadius/7*5,-mRadius/7*5,mRadius/7*5,mRadius/7*5);
//每一个Item的角度
mItemAnge = 360 / mItemStrs.size();
mTextSize = mRadius/9;
mPaintItemStr.setTextSize(mTextSize);
//数据初始化
mOffsetAngle=0;
mStartAngle=0;
mOffsetAngle = mItemAnge/2;
}
public void startAnim(){
if(objectAnimator!=null){
objectAnimator.cancel();
}
float v = mItemAnge*mLuckNum+mStartAngle%360;//如果转过一次了那下次旋转的角度就需要减去上一次多出的,否则结束的位置会不断增加的
objectAnimator = ObjectAnimator.ofFloat(this, "rotation", mStartAngle, mStartAngle-mRepeatCount*360-v);
objectAnimator.setDuration(3000);
objectAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if(luckPanAnimEndCallBack!=null){
luckPanAnimEndCallBack.onAnimEnd(mItemStrs.get(3));
}
}
});
objectAnimator.start();
mStartAngle -= mRepeatCount*360+v;
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.translate(getWidth()/2,getHeight()/2);//画布中心点设置为(0,0)
canvas.rotate(-90-mOffsetAngle);
drawPanItem(canvas);
drawText(canvas);
// drawBg(canvas);
}
private List<Bitmap> mListBitmap = new ArrayList<>();
private void drawBg(Canvas canvas) {
final int paddingLeft = getPaddingLeft();
final int paddingRight = getPaddingRight();
final int paddingTop = getPaddingTop();
final int paddingBottom = getPaddingBottom();
float startAngle = -mItemAnge / 2 - 90;
int width = getWidth() - paddingLeft - paddingRight;
int height = getHeight() - paddingTop - paddingBottom;
for (int i = 0; i <5 ; i++) {
float angle = ( float ) Math.toRadians(startAngle + mItemAnge / 2);
//确定图片在圆弧中 中心点的位置
float x = ( float ) (width / 2 + (mRadius / 2 + mRadius / 12) * Math.cos(angle));
float y = ( float ) (height / 2 + (mRadius / 2 + mRadius / 12) * Math.sin(angle));
int imgWidth = mRadius / 3;
int w = ( int ) (Math.abs(Math.cos(Math.toRadians(Math.abs(180 - mItemAnge * i)))) *
imgWidth + imgWidth * Math.abs(Math.sin(Math.toRadians(Math.abs(180 - mItemAnge * i)))));
int h = ( int ) (Math.abs(Math.sin(Math.toRadians(Math.abs(180 - mItemAnge * i)))) *
imgWidth + imgWidth * Math.abs(Math.cos(Math.toRadians(Math.abs(180 - mItemAnge * i)))));
RectF rect1 = new RectF(x - w *2, y - h *2, x + w *2, y + h *2);
canvas.drawBitmap(mListBitmap.get(i), null, rect1, null);
}
}
//画文字
private void drawText(Canvas canvas) {
for(int x = 0;x<mItemStrs.size();x++){
Path path = mArcPaths.get(x);
canvas.drawTextOnPath(mItemStrs.get(x),path,0,0,mPaintItemStr);
}
}
private void drawPanItem(Canvas canvas) {
float startAng = 0;//扇形开始的角度
for (int x = 1;x<= mItemStrs.size();x++){
if(x%2 == 1){
//是奇数
mPaintArc.setColor(Color.WHITE);
}else {
//偶数
mPaintArc.setColor(Color.parseColor("#FEB446"));
}
Path path = new Path();
path.addArc(rectFStr,startAng,mItemAnge);//文字的路径圆形比盘的小
mArcPaths.add(path);
canvas.drawArc(rectFPan,startAng,mItemAnge,true,mPaintArc);
startAng+=mItemAnge;
}
}
}
| [
"1433953566@qq.com"
] | 1433953566@qq.com |
f8237eb552d5c3357aba14aaac77157bcc1561fc | e5fcecd08dc30e947cf11d1440136994226187c6 | /spagobi-core/src/main/java/it/eng/spagobi/engines/kpi/bo/charttypes/dialcharts/BulletGraph.java | c994650b243f0f23c6017989535c6dabf1c0af73 | [] | no_license | skoppe/SpagoBI | 16851fa5a6949b5829702eaea2724cee0629560b | 7a295c096e3cca9fb53e5c125b9566983472b259 | refs/heads/master | 2021-05-05T10:18:35.120113 | 2017-11-27T10:26:44 | 2017-11-27T10:26:44 | 104,053,911 | 0 | 0 | null | 2017-09-19T09:19:44 | 2017-09-19T09:19:43 | null | UTF-8 | Java | false | false | 4,557 | java | /* SpagoBI, the Open Source Business Intelligence suite
* Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0, without the "Incompatible With Secondary Licenses" notice.
* If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */
package it.eng.spagobi.engines.kpi.bo.charttypes.dialcharts;
import it.eng.spagobi.engines.kpi.bo.ChartImpl;
import it.eng.spagobi.engines.kpi.utils.KpiInterval;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Vector;
import org.apache.log4j.Logger;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.axis.AxisLocation;
import org.jfree.chart.axis.CategoryAxis;
import org.jfree.chart.axis.NumberAxis;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.IntervalMarker;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.chart.plot.ValueMarker;
import org.jfree.chart.renderer.category.BarRenderer;
import org.jfree.data.Range;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.ui.Layer;
import org.jfree.ui.RectangleInsets;
public class BulletGraph extends ChartImpl{
private static transient Logger logger=Logger.getLogger(BulletGraph.class);
public BulletGraph() {
super();
intervals=new Vector();
}
public void configureChart(HashMap conf) {
logger.debug("IN");
super.configureChart(conf);
logger.debug("OUT");
}
public void setThresholds(List thresholds) {
super.setThresholdValues(thresholds);
}
public JFreeChart createChart(){
logger.debug("IN");
Number value = null;
if (dataset==null){
logger.debug("The dataset to be represented is null");
value = new Double(0);
}else{
value = dataset.getValue();
}
DefaultCategoryDataset datasetC = new DefaultCategoryDataset();
datasetC.addValue(value, "", "");
// customize a bar chart
JFreeChart chart = ChartFactory.createBarChart(
null,
null,
null,
datasetC,
PlotOrientation.HORIZONTAL,
false,
false,
false);
chart.setBorderVisible(false);
CategoryPlot plot = chart.getCategoryPlot();
plot.setOutlineVisible(true);
plot.setOutlinePaint(Color.BLACK);
plot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0));
plot.setBackgroundPaint(null);
plot.setDomainGridlinesVisible(false);
plot.setRangeGridlinesVisible(false);
plot.setRangeCrosshairVisible(false);
plot.setAnchorValue(value.doubleValue());
// add the target marker
if(target != null) {
ValueMarker marker = new ValueMarker( target.doubleValue(), Color.BLACK, new BasicStroke(2.0f));
plot.addRangeMarker(marker, Layer.FOREGROUND);
}
//sets different marks
for (Iterator iterator = intervals.iterator(); iterator.hasNext();) {
KpiInterval interval = (KpiInterval) iterator.next();
// add the marks
IntervalMarker marker = new IntervalMarker(interval.getMin(), interval.getMax(), interval.getColor());
plot.addRangeMarker(marker, Layer.BACKGROUND);
logger.debug("Added new interval to the plot");
}
// customize axes
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setVisible(false);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setVisible(show_axis);
rangeAxis.setLabelFont(new Font("Arial",Font.PLAIN,4));
// calculate the upper limit
//double upperBound = target * upperFactor;
rangeAxis.setRange(new Range(lower, upper));
plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
// customize renderer
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setMaximumBarWidth(0.18);
renderer.setSeriesPaint(0, Color.BLACK);
/*BasicStroke d = new BasicStroke(3f,BasicStroke.CAP_ROUND ,BasicStroke.JOIN_ROUND);
renderer.setSeriesOutlineStroke(0, d);
renderer.setSeriesStroke(0, d);
renderer.setStroke(d);*/
return chart;
}
}
| [
"mail@skoppe.eu"
] | mail@skoppe.eu |
fb866087ff8a34fba8ef02bc35c82bf0f92f9e02 | 68b3fbd825d0a578ab7441833ca20a803b150c4c | /src/main/java/com/cloudera/cdp/environments/model/AwsLogStorageRequest.java | 40098c0fee9485cb2503917b8e5a00bc1a84c4b9 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | feihu618/cdp-sdk-java | efcfb3160effec94bdbf77d7ec6fcc8bc846f4d6 | 72b20489b268aeaf1196e1da9ecbb17c2fa7cee7 | refs/heads/master | 2023-07-26T18:10:47.021336 | 2021-09-08T23:24:20 | 2021-09-08T23:24:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,734 | java | /*
* Copyright (c) 2018 Cloudera, Inc. All Rights Reserved.
*
* Portions Copyright (c) Copyright 2013-2018 Amazon.com, Inc. or its
* affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* 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.cloudera.cdp.environments.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import com.cloudera.cdp.client.CdpResponse;
/**
* AWS storage configuration for cluster and audit logs.
**/
@javax.annotation.Generated(value = "com.cloudera.cdp.client.codegen.CdpSDKJavaCodegen", date = "2021-09-08T16:23:12.818-07:00")
public class AwsLogStorageRequest {
/**
* The base location to store logs in S3. This should be an s3a:// url.
**/
private String storageLocationBase = null;
/**
* The AWS instance profile that which contains the necessary permissions to access the S3 storage location.
**/
private String instanceProfile = null;
/**
* The base location to store backup in S3. This should be an s3a:// url.
**/
private String backupStorageLocationBase = null;
/**
* Getter for storageLocationBase.
* The base location to store logs in S3. This should be an s3a:// url.
**/
@JsonProperty("storageLocationBase")
public String getStorageLocationBase() {
return storageLocationBase;
}
/**
* Setter for storageLocationBase.
* The base location to store logs in S3. This should be an s3a:// url.
**/
public void setStorageLocationBase(String storageLocationBase) {
this.storageLocationBase = storageLocationBase;
}
/**
* Getter for instanceProfile.
* The AWS instance profile that which contains the necessary permissions to access the S3 storage location.
**/
@JsonProperty("instanceProfile")
public String getInstanceProfile() {
return instanceProfile;
}
/**
* Setter for instanceProfile.
* The AWS instance profile that which contains the necessary permissions to access the S3 storage location.
**/
public void setInstanceProfile(String instanceProfile) {
this.instanceProfile = instanceProfile;
}
/**
* Getter for backupStorageLocationBase.
* The base location to store backup in S3. This should be an s3a:// url.
**/
@JsonProperty("backupStorageLocationBase")
public String getBackupStorageLocationBase() {
return backupStorageLocationBase;
}
/**
* Setter for backupStorageLocationBase.
* The base location to store backup in S3. This should be an s3a:// url.
**/
public void setBackupStorageLocationBase(String backupStorageLocationBase) {
this.backupStorageLocationBase = backupStorageLocationBase;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AwsLogStorageRequest awsLogStorageRequest = (AwsLogStorageRequest) o;
if (!Objects.equals(this.storageLocationBase, awsLogStorageRequest.storageLocationBase)) {
return false;
}
if (!Objects.equals(this.instanceProfile, awsLogStorageRequest.instanceProfile)) {
return false;
}
if (!Objects.equals(this.backupStorageLocationBase, awsLogStorageRequest.backupStorageLocationBase)) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash(storageLocationBase, instanceProfile, backupStorageLocationBase);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AwsLogStorageRequest {\n");
sb.append(" storageLocationBase: ").append(toIndentedString(storageLocationBase)).append("\n");
sb.append(" instanceProfile: ").append(toIndentedString(instanceProfile)).append("\n");
sb.append(" backupStorageLocationBase: ").append(toIndentedString(backupStorageLocationBase)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line except the first indented by 4 spaces.
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"dev-kitchen@cloudera.com"
] | dev-kitchen@cloudera.com |
6839de5ed58f09d4e5654b26969041bde22ce18d | ae2dbe983fb8a8694a8a8ec5c9dfa0d8d7be2bd8 | /txc-core/src/main/java/com/shield/txc/BaseEventRepository.java | fa25488231a52e530bbb7a86594dc306059d6a46 | [
"Apache-2.0"
] | permissive | lesineyzk/shieldTXC | 9f78a96c499840c62dde36b8cfec81c08ede6c9c | 2aa2226e6faccf2fb849d5925c8ce35b25f8ffb4 | refs/heads/master | 2023-01-02T04:54:32.993391 | 2020-10-29T05:09:03 | 2020-10-29T05:09:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,134 | java | package com.shield.txc;
import com.shield.txc.domain.ShieldEvent;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* @author snowalker
* @version 1.0
* @date 2019/7/30 22:58
* @className BaseEventRepository
* @desc 基础事件持久层
* TODO 表名可配置
*/
public class BaseEventRepository {
JdbcTemplate jdbcTemplate;
String tableName;
public BaseEventRepository(JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
}
public BaseEventRepository(String tableName, JdbcTemplate jdbcTemplate) {
this.jdbcTemplate = jdbcTemplate;
this.tableName = tableName;
}
/**
* 插入事件
*
* @param event
* @return
*/
@Transactional(rollbackFor = Exception.class)
public boolean insertEvent(ShieldEvent event) {
StringBuilder sqlBuilder = new StringBuilder("INSERT INTO shield_event")
.append("(event_type, tx_type, event_status, content, app_id, biz_key)")
.append(" VALUES(?,?,?,?,?,?)");
return jdbcTemplate.update(sqlBuilder.toString(), preparedStatement -> {
preparedStatement.setString(1, event.getEventType());
preparedStatement.setString(2, event.getTxType());
preparedStatement.setString(3, event.getEventStatus());
preparedStatement.setString(4, event.getContent());
preparedStatement.setString(5, event.getAppId());
preparedStatement.setString(6, event.getBizKey());
}) == 1;
}
/**
* 插入事件带主键id
*
* @param event
* @return
*/
@Transactional(rollbackFor = Exception.class)
public boolean insertEventWithId(ShieldEvent event) {
StringBuilder sqlBuilder = new StringBuilder("INSERT INTO shield_event")
.append("(id, event_type, tx_type, event_status, content, app_id, biz_key)")
.append(" VALUES(?,?,?,?,?,?,?)");
return jdbcTemplate.update(sqlBuilder.toString(), preparedStatement -> {
preparedStatement.setInt(1, event.getId());
preparedStatement.setString(2, event.getEventType());
preparedStatement.setString(3, event.getTxType());
preparedStatement.setString(4, event.getEventStatus());
preparedStatement.setString(5, event.getContent());
preparedStatement.setString(6, event.getAppId());
preparedStatement.setString(7, event.getBizKey());
}) == 1;
}
/**
* 更新事件状态
*
* @param event
* @return
*/
@Transactional(rollbackFor = Exception.class)
public boolean updateEventStatusById(ShieldEvent event) {
StringBuilder sqlBuilder = new StringBuilder("UPDATE shield_event SET event_status=? ")
.append("where id = ? AND event_status=?");
return jdbcTemplate.update(sqlBuilder.toString(), preparedStatement -> {
preparedStatement.setString(1, event.getEventStatus());
preparedStatement.setInt(2, event.getId());
preparedStatement.setString(3, event.getBeforeUpdateEventStatus());
}) == 1;
}
/**
* 逻辑删除事件
*
* @param id
* @return
*/
@Transactional(rollbackFor = Exception.class)
public boolean deleteEventLogicallyById(Integer id) {
StringBuilder sqlBuilder = new StringBuilder("UPDATE shield_event SET record_status=1 ")
.append("where id = ?");
return jdbcTemplate.update(sqlBuilder.toString(), preparedStatement -> {
preparedStatement.setInt(1, id);
}) == 1;
}
/**
* 根据事件状态获取事件列表
*
* @param eventStatus
* @return
*/
public List<ShieldEvent> queryEventListByStatus(String eventStatus) {
final List<ShieldEvent> resultList = new ArrayList<>();
StringBuilder sqlBuilder = new StringBuilder("SELECT id, event_type, event_status, tx_type, content,")
.append("app_id, record_status, gmt_create, gmt_update, biz_key")
.append(" from shield_event where event_status=? and record_status=0 limit 50");
jdbcTemplate.query(sqlBuilder.toString(), new Object[]{eventStatus}, resultSet -> {
ShieldEvent shieldEvent = new ShieldEvent();
shieldEvent.setId(resultSet.getInt("id"))
.setEventType(resultSet.getString("event_type"))
.setEventStatus(resultSet.getString("event_status"))
.setTxType(resultSet.getString("tx_type"))
.setContent(resultSet.getString("content"))
.setAppId(resultSet.getString("app_id"))
.setRecordStatus(resultSet.getInt("record_status"))
.setGmtCreate(resultSet.getTimestamp("gmt_create"))
.setGmtUpdate(resultSet.getTimestamp("gmt_update"))
.setBizKey(resultSet.getString("biz_key"));
resultList.add(shieldEvent);
});
return resultList;
}
/**
* 查询事件详情
*
* @param id
* @return
*/
public ShieldEvent queryEventById(int id) {
StringBuilder sqlBuilder = new StringBuilder("SELECT id, event_type, event_status, tx_type, content,")
.append("app_id, record_status, gmt_create, gmt_update, biz_key")
.append(" from shield_event where id=?");
final ShieldEvent shieldEvent = new ShieldEvent();
jdbcTemplate.query(sqlBuilder.toString(), new Object[]{id}, resultSet -> {
shieldEvent.setId(resultSet.getInt("id"))
.setEventType(resultSet.getString("event_type"))
.setEventStatus(resultSet.getString("event_status"))
.setTxType(resultSet.getString("tx_type"))
.setContent(resultSet.getString("content"))
.setAppId(resultSet.getString("app_id"))
.setRecordStatus(resultSet.getInt("record_status"))
.setGmtCreate(resultSet.getTimestamp("gmt_create"))
.setGmtUpdate(resultSet.getTimestamp("gmt_update"))
.setBizKey(resultSet.getString("biz_key"))
.setSuccess(Boolean.TRUE);
});
return shieldEvent;
}
/**
* 查询事件详情
* @param bizKey
* @param txType
* @param appId
* @return
*/
public List<ShieldEvent> queryEventByBizkeyCond(String bizKey, String txType, String appId) {
StringBuilder sqlBuilder = new StringBuilder("SELECT id, event_type, event_status, tx_type, content,")
.append("app_id, record_status, gmt_create, gmt_update, biz_key")
.append(" from shield_event where biz_key=? and tx_type=? and app_id=? ")
.append(" AND (event_status = 'CONSUME_INIT' OR event_status = 'CONSUME_PROCESSING' OR event_status = 'CONSUME_PROCESSED')");
final List<ShieldEvent> resultList = new ArrayList<>();
jdbcTemplate.query(sqlBuilder.toString(), new Object[]{bizKey, txType, appId}, resultSet -> {
ShieldEvent shieldEvent = new ShieldEvent();
shieldEvent.setId(resultSet.getInt("id"))
.setEventType(resultSet.getString("event_type"))
.setEventStatus(resultSet.getString("event_status"))
.setTxType(resultSet.getString("tx_type"))
.setContent(resultSet.getString("content"))
.setAppId(resultSet.getString("app_id"))
.setRecordStatus(resultSet.getInt("record_status"))
.setGmtCreate(resultSet.getTimestamp("gmt_create"))
.setGmtUpdate(resultSet.getTimestamp("gmt_update"))
.setBizKey(resultSet.getString("biz_key"))
.setSuccess(Boolean.TRUE);
resultList.add(shieldEvent);
});
return resultList;
}
}
| [
"1210812591@qq.com"
] | 1210812591@qq.com |
a9858d44786877ffd4e487d065b9f85fa796165c | 14834ba60d434cbd9ea2d38865d30c6a017e471d | /src/main/java/lumien/randomthings/client/gui/GuiFilteredSuperLubricentPlatform.java | e194f46d92007f7df6798fcdf5b7354c723ef1c0 | [
"MIT"
] | permissive | modindex/Random-Things | bf0a7aa8ad5429b4f59ae7550b058c8d8e597f21 | f1e3813bc7c770992670a030787183dc7ea0020b | refs/heads/master | 2020-06-27T05:30:10.002235 | 2019-07-30T18:31:53 | 2019-07-30T18:31:53 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,380 | java | package lumien.randomthings.client.gui;
import org.lwjgl.opengl.GL11;
import lumien.randomthings.container.ContainerFilteredSuperLubricentPlatform;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class GuiFilteredSuperLubricentPlatform extends GuiContainerBase
{
final ResourceLocation background = new ResourceLocation("randomthings:textures/gui/filteredSuperLubricentPlatform.png");
public GuiFilteredSuperLubricentPlatform(EntityPlayer player, World world, int x, int y, int z)
{
super(new ContainerFilteredSuperLubricentPlatform(player, world, x, y, z));
this.xSize = 176;
this.ySize = 129;
}
@Override
protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY)
{
this.mc.renderEngine.bindTexture(background);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
{
super.drawGuiContainerForegroundLayer(mouseX, mouseY);
this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8, 37, 4210752);
}
@Override
public void updateScreen()
{
super.updateScreen();
}
}
| [
"lumien231@users.noreply.github.com"
] | lumien231@users.noreply.github.com |
33b452db35f9b7dd3f04fe24346587bfa3a4a890 | 4b131d8718899711f9e11e2f4941cad57267ec6c | /core/vr-core/vr-core-service/src/main/java/net/vpc/app/vainruling/core/service/fs/VrFSEntry.java | aa34ad7ac4aeb350f4c10313e3b372496fa0fbb5 | [] | no_license | ENISoCollaboration/vr | 53789cf0896c4565c5cc0ec4b143c8f8d53f06ab | 939b751ab24115b083360f121a457f29fcc04f81 | refs/heads/master | 2020-03-18T03:45:31.955199 | 2018-04-02T20:57:59 | 2018-04-02T20:57:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,305 | java | /*
* To change this license header, choose License Headers in Project Properties.
*
* and open the template in the editor.
*/
package net.vpc.app.vainruling.core.service.fs;
/**
* @author taha.bensalah@gmail.com
*/
public class VrFSEntry {
private String filterName;
private String filterType;
private String mountPoint;
private String linkPath;
public VrFSEntry() {
}
public VrFSEntry(String filterName, String filterType, String mountPoint, String linkPath) {
this.filterName = filterName;
this.filterType = filterType;
this.mountPoint = mountPoint;
this.linkPath = linkPath;
}
public String getFilterName() {
return filterName;
}
public void setFilterName(String filterName) {
this.filterName = filterName;
}
public String getFilterType() {
return filterType;
}
public void setFilterType(String filterType) {
this.filterType = filterType;
}
public String getMountPoint() {
return mountPoint;
}
public void setMountPoint(String mountPoint) {
if (mountPoint == null) {
throw new IllegalArgumentException("Invalid path");
}
mountPoint = mountPoint.trim();
if (mountPoint.isEmpty()) {
throw new IllegalArgumentException("Invalid path");
}
// if (mountPoint.endsWith("/")) {
// mountPoint = mountPoint.substring(0, mountPoint.length() - 1);
// }
// if (!mountPoint.startsWith("/")) {
// mountPoint = "/" + mountPoint;
// }
this.mountPoint = mountPoint;
}
public String getLinkPath() {
return linkPath;
}
public void setLinkPath(String linkPath) {
if (linkPath == null) {
throw new IllegalArgumentException("Invalid path");
}
linkPath = linkPath.trim();
if (linkPath.isEmpty()) {
throw new IllegalArgumentException("Invalid path");
}
if (linkPath.endsWith("/")) {
linkPath = linkPath.substring(0, linkPath.length() - 1);
}
if (!linkPath.startsWith("/")) {
linkPath = "/" + linkPath;
}
this.linkPath = linkPath;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
VrFSEntry vrFSEntry = (VrFSEntry) o;
if (filterName != null ? !filterName.equals(vrFSEntry.filterName) : vrFSEntry.filterName != null) return false;
if (filterType != null ? !filterType.equals(vrFSEntry.filterType) : vrFSEntry.filterType != null) return false;
if (mountPoint != null ? !mountPoint.equals(vrFSEntry.mountPoint) : vrFSEntry.mountPoint != null) return false;
return linkPath != null ? linkPath.equals(vrFSEntry.linkPath) : vrFSEntry.linkPath == null;
}
@Override
public int hashCode() {
int result = filterName != null ? filterName.hashCode() : 0;
result = 31 * result + (filterType != null ? filterType.hashCode() : 0);
result = 31 * result + (mountPoint != null ? mountPoint.hashCode() : 0);
result = 31 * result + (linkPath != null ? linkPath.hashCode() : 0);
return result;
}
}
| [
"vpc@linux-booster"
] | vpc@linux-booster |
6cdd5fc89eed31eefb3d0a446fcba6e00c1cdd9c | 884056b6a120b2a4c1c1202a4c69b07f59aecc36 | /java projects/oddOrPos/result/slicedOddOrPos/traditional_mutants/int_oddOrPos(int)/AOIS_1/slicedOddOrPos.java | 7413ae26421b092265e86ac8079069d1d81a7dba | [
"MIT"
] | permissive | NazaninBayati/SMBFL | a48b16dbe2577a3324209e026c1b2bf53ee52f55 | 999c4bca166a32571e9f0b1ad99085a5d48550eb | refs/heads/master | 2021-07-17T08:52:42.709856 | 2020-09-07T12:36:11 | 2020-09-07T12:36:11 | 204,252,009 | 3 | 0 | MIT | 2020-01-31T18:22:23 | 2019-08-25T05:47:52 | Java | UTF-8 | Java | false | false | 643 | java | // This is mutant program.
// Author : ysma
class slicedOddOrPos
{
public static int oddOrPos( int[] x )
{
int count = 0;
for (int i = 0; ++i < x.length; i++) {
if (x[i] % 2 == 1 && x[i] > 0) {
count++;
}
}
return count;
}
public static void main( java.lang.String[] argv )
{
int[] inArr = new int[argv.length];
for (int i = 0; i < argv.length; i++) {
inArr[i] = Integer.parseInt( argv[i] );
}
System.out.println( "Number of elements that are either odd or positive is: " + oddOrPos( inArr ) );
}
}
| [
"n.bayati20@gmail.com"
] | n.bayati20@gmail.com |
f0a7736d3a5b77170d0402a8bcc1703c14c1ccd3 | 140d222eeee573715214aa18eee19ee1f1602604 | /src/main/java/com/selectica/CanSee/definitions/CProcBO/CPDetails/scripts/OnONCHANGE_AgrTypeIsNotMaster.java | 0acfa0d3b383187de2973296b1cb5b2867684077 | [] | no_license | LeoSigal/CoolDemo | 586d549c65d20b62c8b63f60b538b453f4ad9983 | cfbc3653ba40c72e49c79f4c1581de7423030ea8 | refs/heads/master | 2016-09-09T20:17:58.590807 | 2015-06-19T16:44:15 | 2015-06-19T16:44:15 | 37,732,398 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 306 | java | package com.selectica.CanSee.definitions.CProcBO.CPDetails.scripts;
import com.selectica.CanSee.eclm.definitions.CProcBO.CPDetails.scripts.AgrTypeControlScript;
import com.selectica.rcfscripts.AbstractDataWriteScript;
/**null*/
public class OnONCHANGE_AgrTypeIsNotMaster extends AgrTypeControlScript {
}
| [
"user@rcfproj.aws.selectica.net"
] | user@rcfproj.aws.selectica.net |
6f3281bb87d1d6fccfcee4d4ef4ee944ee220828 | 0552dd376606c850308cafaea03ca26c7e9b0500 | /src/main/java/com/cn/tianxia/admin/service/txdata/impl/CagentOnlinememServiceImpl.java | 8e2c69c7c370fc9b60ff34b29a415e66c90ad19e | [] | no_license | pumaxiaoyao/tx-admin-shiro | 08725c0bd4b0caab374a3d0f4be6ecbda5ef962e | a8223149725d87fc9153c399b5cc240b77e39e39 | refs/heads/master | 2020-06-03T10:43:15.099384 | 2019-05-18T14:02:42 | 2019-05-18T14:02:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,085 | java | package com.cn.tianxia.admin.service.txdata.impl;
import com.cn.tianxia.admin.common.Constant;
import com.cn.tianxia.admin.common.Pager;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cn.tianxia.admin.domain.txdata.CagentOnlinememMapper;
import com.cn.tianxia.admin.project.txdata.CagentOnlinemem;
import com.cn.tianxia.admin.service.txdata.CagentOnlinememService;
import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Map;
/**
*
* @ClassName CagentOnlinememServiceImpl
* @Description TODO(这里用一句话描述这个类的作用)
* @author Hardy
* @Date 2019年4月22日 下午3:44:18
* @version 1.0.0
*/
@Service
public class CagentOnlinememServiceImpl implements CagentOnlinememService {
//日志
private static final Logger logger = LoggerFactory.getLogger(CagentOnlinememServiceImpl.class);
@Autowired
private CagentOnlinememMapper cagentOnlinememMapper;
@Override
public int deleteByPrimaryKey(Integer id) {
return cagentOnlinememMapper.deleteByPrimaryKey(id);
}
@Override
public int insertSelective(CagentOnlinemem record) {
return cagentOnlinememMapper.insertSelective(record);
}
@Override
public CagentOnlinemem selectByPrimaryKey(Integer id) {
return cagentOnlinememMapper.selectByPrimaryKey(id);
}
@Override
public int updateByPrimaryKeySelective(CagentOnlinemem record) {
return cagentOnlinememMapper.updateByPrimaryKeySelective(record);
}
@Override
public Pager<CagentOnlinemem> getAllOnlinemem(Map<String, String> params) throws Exception {
logger.info("查询线上会员配置参数:{}",params);
Pager<CagentOnlinemem> pager = new Pager<>();
if(!CollectionUtils.isEmpty(params)) {
if (params.containsKey(Constant.PAGE_FILED)) {
pager.setPage(Integer.parseInt(params.remove(Constant.PAGE_FILED)));
}
if (params.containsKey(Constant.LIMIT_FILED)) {
pager.setLimit(Integer.parseInt(params.remove(Constant.LIMIT_FILED)));
}
if (params.containsKey(Constant.SORT_FIELD) && params.containsKey(Constant.SORT_RULE_FILED)) {
if (StringUtils.isBlank(params.get(Constant.SORT_FIELD))) {
params.remove(Constant.SORT_FIELD);
}
if (StringUtils.isBlank(params.get(Constant.SORT_RULE_FILED))) {
params.remove(Constant.SORT_RULE_FILED);
}
}
}
pager.setParams(params);
List<CagentOnlinemem> allOnlinemems = cagentOnlinememMapper.getAllOnlinemem(pager);
int totalCount = cagentOnlinememMapper.getTotalCount();
Pager<CagentOnlinemem> result = new Pager<>(totalCount,pager.getPage(),pager.getLimit());
result.setList(allOnlinemems);
return result;
}
}
| [
"xfearless1201@gmail.com"
] | xfearless1201@gmail.com |
2524cf244c3785ae380604a419b9fa63c2c46b63 | 596d36a78c206f896a4a7247a064a934a262d41e | /src/main/java/aramframework/com/uss/olp/qim/service/QustnrItemManageVO.java | 68166e5ab43a97faf4e297ec7067a4c6111e99d7 | [
"Apache-2.0"
] | permissive | SkyDevCode/aramcomp | 5042d9d01fe6103733f8ae3fdefb70af969527d5 | 090af4eeedbc50de91a204ee84b1cf781bcab6f5 | refs/heads/master | 2021-01-14T08:30:33.994946 | 2016-01-04T13:18:12 | 2016-01-04T13:18:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,929 | java | package aramframework.com.uss.olp.qim.service;
import aramframework.com.cmm.SearchVO;
/**
* 설문항목관리 VO Class 구현
*
* @author 아람컴포넌트 조헌철
* @since 2014.11.11
* @version 1.0
* @see
*
* <pre>
*
* << 개정이력(Modification Information) >>
*
* 수정일 수정자 수정내용
* ------- ------ ---------------------------
* 2014.11.11 조헌철 최초 생성
*
* </pre>
*/
public class QustnrItemManageVO extends SearchVO {
private static final long serialVersionUID = 1L;
/** 검색모드설정 */
private String searchMode = "";
/** 설문문항 아이디 */
private String qestnrQesitmId = "";
/** 질문내용 */
private String qestnCn = "";
/** 설문지 아이디 */
private String qestnrId = "";
/** 설문제목 */
private String qestnrSj = "";
/** 항목순번 */
private String qustnrIemSn = "";
/** 설문항목아이디 */
private String qustnrIemId = "";
/** 항목내용 */
private String qustnrIemCn = "";
/** 키타답변여부 */
private String etcAnswerAt = "";
/**
* searchMode attribute 를 리턴한다.
*
* @return the String
*/
public String getSearchMode() {
return searchMode;
}
/**
* searchMode attribute 값을 설정한다.
*
* @return searchMode String
*/
public void setSearchMode(String searchMode) {
this.searchMode = searchMode;
}
/**
* qestnrQesitmId attribute 를 리턴한다.
*
* @return the String
*/
public String getQestnrQesitmId() {
return qestnrQesitmId;
}
/**
* qestnrQesitmId attribute 값을 설정한다.
*
* @return qestnrQesitmId String
*/
public void setQestnrQesitmId(String qestnrQesitmId) {
this.qestnrQesitmId = qestnrQesitmId;
}
/**
* qestnCn attribute 를 리턴한다.
*
* @return the String
*/
public String getQestnCn() {
return qestnCn;
}
/**
* qestnCn attribute 값을 설정한다.
*
* @return qestnCn String
*/
public void setQestnCn(String qestnCn) {
this.qestnCn = qestnCn;
}
/**
* qestnrId attribute 를 리턴한다.
*
* @return the String
*/
public String getQestnrId() {
return qestnrId;
}
/**
* qestnrId attribute 값을 설정한다.
*
* @return qestnrId String
*/
public void setQestnrId(String qestnrId) {
this.qestnrId = qestnrId;
}
/**
* qestnrSj attribute 를 리턴한다.
*
* @return the String
*/
public String getQestnrSj() {
return qestnrSj;
}
/**
* qestnrSj attribute 값을 설정한다.
*
* @return qestnrSj String
*/
public void setQestnrSj(String qestnrSj) {
this.qestnrSj = qestnrSj;
}
/**
* qustnrIemSn attribute 를 리턴한다.
*
* @return the String
*/
public String getQustnrIemSn() {
return qustnrIemSn;
}
/**
* qustnrIemSn attribute 값을 설정한다.
*
* @return iemSn String
*/
public void setQustnrIemSn(String qustnrIemSn) {
this.qustnrIemSn = qustnrIemSn;
}
/**
* qustnrIemId attribute 를 리턴한다.
*
* @return the String
*/
public String getQustnrIemId() {
return qustnrIemId;
}
/**
* qustnrIemId attribute 값을 설정한다.
*
* @return qustnrIemId String
*/
public void setQustnrIemId(String qustnrIemId) {
this.qustnrIemId = qustnrIemId;
}
/**
* qustnrIemCn attribute 를 리턴한다.
*
* @return the String
*/
public String getQustnrIemCn() {
return qustnrIemCn;
}
/**
* qustnrIemCn attribute 값을 설정한다.
*
* @return qustnrIemCn String
*/
public void setQustnrIemCn(String qustnrIemCn) {
this.qustnrIemCn = qustnrIemCn;
}
/**
* etcAnswerAt attribute 를 리턴한다.
*
* @return the String
*/
public String getEtcAnswerAt() {
return etcAnswerAt;
}
/**
* etcAnswerAt attribute 값을 설정한다.
*
* @return etcAnswerAt String
*/
public void setEtcAnswerAt(String etcAnswerAt) {
this.etcAnswerAt = etcAnswerAt;
}
}
| [
"hnccho@hanafos.com"
] | hnccho@hanafos.com |
a5e5a8910a6599a404ba97f9f0528962c3b5fc9c | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /single-medium-project/src/test/java/org/gradle/test/performancenull_6/Testnull_550.java | 4bf9aafd0ca0b08f702bb55237e4f96fd03b99a9 | [] | 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 | 300 | java | package org.gradle.test.performancenull_6;
import static org.junit.Assert.*;
public class Testnull_550 {
private final Productionnull_550 production = new Productionnull_550("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
d1dbfa789f0ad349da115af49131adf11458556c | 8651815d220ced94baf6d3b4559b3d8e86931b91 | /PR106-RecyclerView/app/src/main/java/pedrojoya/iessaladillo/es/pr106/App.java | 195455047817b9b3939ee5c042e780ad36f628f8 | [] | no_license | OmarObispoUX/studio | f23ee4a488c3c124afaab6e522d6540e0e89764a | a5fc52f835ee180f7cdec4999fab0eabd0f1f710 | refs/heads/master | 2020-03-17T02:05:05.950065 | 2018-05-08T17:03:28 | 2018-05-08T17:03:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 580 | java | package pedrojoya.iessaladillo.es.pr106;
import android.app.Application;
import com.mooveit.library.Fakeit;
import com.squareup.leakcanary.LeakCanary;
@SuppressWarnings("WeakerAccess")
public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
LeakCanary.install(this);
Fakeit.init();
}
}
| [
"pedrojoya@gmail.com"
] | pedrojoya@gmail.com |
3f35c949b6695af31877886856eccc3e5bdccb77 | ee1244b10de45679f053293e366f192af307be74 | /sources/turbogram/Utilities/TurboConfig$Tabs.java | 27fa093c5ec0c86f4e848bf978179d0d5af0e23d | [] | no_license | scarletstuff/Turbogram | a086e50b3f4d7036526075199616682a0d7c9c45 | 21b8862573953add9260f1eb586f0985d2c71e8e | refs/heads/master | 2021-09-23T14:34:23.323880 | 2018-09-24T17:48:43 | 2018-09-24T17:48:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,872 | java | package turbogram.Utilities;
public class TurboConfig$Tabs {
public static boolean autoDownloadFavorite = TurboConfig.preferences.getBoolean("fav_auto_download", false);
public static boolean changeTabTitle = TurboConfig.preferences.getBoolean("change_tab_title", true);
public static boolean countOnlyNotMuted = TurboConfig.preferences.getBoolean("tabs_only_not_muted", false);
public static int defaulTab = TurboConfig.preferences.getInt("default_tab", 6);
public static boolean hideTabsOnScroll = TurboConfig.preferences.getBoolean("hide_tabs", true);
public static boolean mergeGroups = TurboConfig.preferences.getBoolean("merge_groups", false);
public static boolean moveTabsToBottom = TurboConfig.preferences.getBoolean("move_tabs", false);
public static int selectedTab = TurboConfig.preferences.getInt("selected_tab", defaulTab);
public static boolean showHiddenInShareAlert = TurboConfig.preferences.getBoolean("hidden_sharealert", true);
public static boolean swipeTabs = TurboConfig.preferences.getBoolean("swipe_tabs", true);
public static boolean tabsCountChats = TurboConfig.preferences.getBoolean("tabs_count_chats", false);
public static boolean tabsCounter = TurboConfig.preferences.getBoolean("tabs_counter", true);
public static boolean tabsEnabled = TurboConfig.preferences.getBoolean("tabs", true);
public static int tabsHeight = TurboConfig.preferences.getInt("tabs_height", 45);
public static String tabsPriority = TurboConfig.preferences.getString("tabs_priority", "[0, 1, 2, 3, 4, 5, 6, 7]");
public static String tabsVisibility = TurboConfig.preferences.getString("tabs_visibility", "[0, 0, 0, 0, 0, 0, 0, 0]");
public static void setBooleanValue(String pref, boolean value) {
TurboConfig.preferences.edit().putBoolean(pref, value).commit();
updatePreferences();
}
public static void toggleBooleanValue(String pref, boolean value) {
TurboConfig.preferences.edit().putBoolean(pref, !value).commit();
updatePreferences();
}
public static void setIntValue(String pref, int value) {
TurboConfig.preferences.edit().putInt(pref, value).commit();
updatePreferences();
}
public static void setStringValue(String pref, String value) {
TurboConfig.preferences.edit().putString(pref, value).commit();
updatePreferences();
}
public static int getFirstActiveTab() {
int i;
int[] tabs = new int[8];
int[] visible = new int[8];
String tabsPriorityArray = tabsPriority;
if (tabsPriorityArray != null) {
i = 0;
for (String item : tabsPriorityArray.substring(1, tabsPriorityArray.length() - 1).split(", ")) {
if (item.length() > 0) {
tabs[i] = Integer.parseInt(item);
}
i++;
}
}
String tabsVisibilityArray = tabsVisibility;
if (tabsVisibilityArray != null) {
i = 0;
for (String item2 : tabsVisibilityArray.substring(1, tabsVisibilityArray.length() - 1).split(", ")) {
if (item2.length() > 0) {
visible[i] = Integer.parseInt(item2);
}
i++;
}
}
for (int a = 0; a < tabs.length; a++) {
if (visible[a] == 0) {
return tabs[a];
}
}
return 0;
}
public static int[] getTabsArray() {
int[] tabs = new int[8];
String tabsPriorityArray = tabsPriority;
if (tabsPriorityArray != null) {
int i = 0;
for (String item : tabsPriorityArray.substring(1, tabsPriorityArray.length() - 1).split(", ")) {
if (item.length() > 0) {
tabs[i] = Integer.parseInt(item);
}
i++;
}
}
return tabs;
}
public static int[] getVisibleArray() {
int[] visible = new int[8];
String tabsVisibilityArray = tabsVisibility;
if (tabsVisibilityArray != null) {
int i = 0;
for (String item : tabsVisibilityArray.substring(1, tabsVisibilityArray.length() - 1).split(", ")) {
if (item.length() > 0) {
visible[i] = Integer.parseInt(item);
}
i++;
}
}
return visible;
}
private static void updatePreferences() {
tabsPriority = TurboConfig.preferences.getString("tabs_priority", "[0, 1, 2, 3, 4, 5, 6, 7]");
tabsVisibility = TurboConfig.preferences.getString("tabs_visibility", "[0, 0, 0, 0, 0, 0, 0, 0]");
tabsEnabled = TurboConfig.preferences.getBoolean("tabs", true);
swipeTabs = TurboConfig.preferences.getBoolean("swipe_tabs", true);
changeTabTitle = TurboConfig.preferences.getBoolean("change_tab_title", true);
hideTabsOnScroll = TurboConfig.preferences.getBoolean("hide_tabs", true);
moveTabsToBottom = TurboConfig.preferences.getBoolean("move_tabs", false);
tabsHeight = TurboConfig.preferences.getInt("tabs_height", 45);
mergeGroups = TurboConfig.preferences.getBoolean("merge_groups", false);
autoDownloadFavorite = TurboConfig.preferences.getBoolean("fav_auto_download", false);
defaulTab = TurboConfig.preferences.getInt("default_tab", 6);
selectedTab = TurboConfig.preferences.getInt("selected_tab", defaulTab);
showHiddenInShareAlert = TurboConfig.preferences.getBoolean("hidden_sharealert", true);
tabsCounter = TurboConfig.preferences.getBoolean("tabs_counter", true);
tabsCountChats = TurboConfig.preferences.getBoolean("tabs_count_chats", false);
countOnlyNotMuted = TurboConfig.preferences.getBoolean("tabs_only_not_muted", false);
}
}
| [
"root@linuxhub.it"
] | root@linuxhub.it |
1838d3fa69d682071065a1f0a6f8883905acb9f6 | 1d2fda2245888413e3eef8798a61236822f022db | /target/classes/com/wurmonline/server/console/CommandReader.java | e13ea594b937fd28aca788a8f351666047f76fde | [
"IJG"
] | permissive | SynieztroLedPar/Wu | 3b4391e916f6a5605d60663f800702f3e45d5dfc | 5f7daebc2fb430411ddb76a179005eeecde9802b | refs/heads/master | 2023-04-29T17:27:08.301723 | 2020-10-10T22:28:40 | 2020-10-10T22:28:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,649 | java | package com.wurmonline.server.console;
import com.wurmonline.server.Server;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.logging.Level;
import java.util.logging.Logger;
public class CommandReader
implements Runnable
{
private static final Logger logger = Logger.getLogger(CommandReader.class.getName());
private final Server server;
private final InputStream inputStream;
private static final String SHUTDOWN = "shutdown";
public CommandReader(Server server, InputStream inputStream)
{
this.server = server;
this.inputStream = inputStream;
}
public void run()
{
logger.info("Starting command reader for console input");
BufferedReader consoleReader = new BufferedReader(new InputStreamReader(this.inputStream));
String nextLine;
do
{
try
{
String nextLine = consoleReader.readLine();
if (nextLine == null) {
break;
}
if (nextLine.equals("shutdown"))
{
this.server.shutDown();
break;
}
logger.warning("Unknown command: " + nextLine);
}
catch (IOException e)
{
logger.log(Level.SEVERE, "Can't read from console", e);
nextLine = null;
}
} while (nextLine != null);
logger.info("Console reader exiting.");
}
}
/* Location: C:\Games\SteamLibrary\steamapps\common\Wurm Unlimited Dedicated Server\server.jar!\target\classes\com\wurmonline\server\console\CommandReader.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 0.7.1
*/ | [
"dwayne.griffiths@outlook.com"
] | dwayne.griffiths@outlook.com |
b053c401b4d0645f06de4a0f8a9da0443cd6cc6f | 95c49f466673952b465e19a5ee3ae6eff76bee00 | /src/main/java/p2189io/reactivex/p2210d/p2215e/p2221f/SingleDoOnDispose.java | 80f2147ce3722f0c4c3b34f29f09749f8f8d08ea | [] | no_license | Phantoms007/zhihuAPK | 58889c399ae56b16a9160a5f48b807e02c87797e | dcdbd103436a187f9c8b4be8f71bdf7813b6d201 | refs/heads/main | 2023-01-24T01:34:18.716323 | 2020-11-25T17:14:55 | 2020-11-25T17:14:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,917 | java | package p2189io.reactivex.p2210d.p2215e.p2221f;
import java.util.concurrent.atomic.AtomicReference;
import p2189io.reactivex.Single;
import p2189io.reactivex.SingleObserver;
import p2189io.reactivex.SingleSource;
import p2189io.reactivex.disposables.Disposable;
import p2189io.reactivex.p2208b.C31732b;
import p2189io.reactivex.p2209c.AbstractC31733a;
import p2189io.reactivex.p2210d.p2211a.DisposableHelper;
import p2189io.reactivex.p2229g.RxJavaPlugins;
/* renamed from: io.reactivex.d.e.f.h */
/* compiled from: SingleDoOnDispose */
public final class SingleDoOnDispose<T> extends Single<T> {
/* renamed from: a */
final SingleSource<T> f110514a;
/* renamed from: b */
final AbstractC31733a f110515b;
public SingleDoOnDispose(SingleSource<T> acVar, AbstractC31733a aVar) {
this.f110514a = acVar;
this.f110515b = aVar;
}
/* access modifiers changed from: protected */
@Override // p2189io.reactivex.Single
/* renamed from: a */
public void mo129801a(SingleObserver<? super T> aaVar) {
this.f110514a.subscribe(new C32101a(aaVar, this.f110515b));
}
/* renamed from: io.reactivex.d.e.f.h$a */
/* compiled from: SingleDoOnDispose */
static final class C32101a<T> extends AtomicReference<AbstractC31733a> implements SingleObserver<T>, Disposable {
private static final long serialVersionUID = -8583764624474935784L;
/* renamed from: a */
final SingleObserver<? super T> f110516a;
/* renamed from: b */
Disposable f110517b;
C32101a(SingleObserver<? super T> aaVar, AbstractC31733a aVar) {
this.f110516a = aaVar;
lazySet(aVar);
}
@Override // p2189io.reactivex.disposables.Disposable
public void dispose() {
AbstractC31733a aVar = (AbstractC31733a) getAndSet(null);
if (aVar != null) {
try {
aVar.run();
} catch (Throwable th) {
C31732b.m147608b(th);
RxJavaPlugins.m148482a(th);
}
this.f110517b.dispose();
}
}
@Override // p2189io.reactivex.disposables.Disposable
public boolean isDisposed() {
return this.f110517b.isDisposed();
}
@Override // p2189io.reactivex.SingleObserver
public void onSubscribe(Disposable disposable) {
if (DisposableHelper.validate(this.f110517b, disposable)) {
this.f110517b = disposable;
this.f110516a.onSubscribe(this);
}
}
@Override // p2189io.reactivex.SingleObserver
public void onSuccess(T t) {
this.f110516a.onSuccess(t);
}
@Override // p2189io.reactivex.SingleObserver
public void onError(Throwable th) {
this.f110516a.onError(th);
}
}
}
| [
"seasonpplp@qq.com"
] | seasonpplp@qq.com |
9ca60f91e48b0fd3b31435ae15117d5893330f44 | ded7db8dac4a91d9ea49b7ee459b8886cf0f8a4b | /src/main/java/com/jdon/annotation/Interceptor.java | 0c89442589cb7ab3765d947d56b6b3dcde42d6f1 | [
"Apache-2.0"
] | permissive | wangzildj/jdonframework | 67ed881cb2ca77b7e9363d41e73b267d8ff363d1 | 7ab8abb3147bcff5842fa09e12679ba7f3c42600 | refs/heads/master | 2020-03-31T15:55:43.789974 | 2018-09-28T15:48:07 | 2018-09-28T15:48:07 | 152,356,395 | 1 | 0 | Apache-2.0 | 2018-10-10T03:15:53 | 2018-10-10T03:15:52 | null | UTF-8 | Java | false | false | 1,013 | java | package com.jdon.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
/**
* the @Interceptor("aroundAdvice") if there is no any component call this class
* (MethodInterceptor), the MethodInterceptor will
* action for all components called by client (by
* AppUtil.getService or WebApp.getService)
*
*
*the @Interceptor(name = "myInterceptor", target = "a,c") if there is target
* value, this class will be only available for the target
* component name, not for all components called by client
*
*/
@Target(TYPE)
@Retention(RUNTIME)
@Documented
public @interface Interceptor {
String value() default "";
String name() default "";
String pointcut() default "";
}
| [
"banq@163.com"
] | banq@163.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.