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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6f80735237bfd9f0ad907eeb00f9f7a532d46f7c | ab1ccc0fe5eebe505743efd8459248390c057d9b | /MybatisTestThree/src/main/java/com/entity/ColumnsPrivKey.java | 692c3559f7972bbc75dd7217ce5cd8fed639d7c7 | [] | no_license | YueLineMe/distribution | 8e030e568ac0512774777211c1288c8c7bc3a8a2 | 4c66df624baf3beb3a1a90b40d6698f549523387 | refs/heads/master | 2020-04-02T04:17:21.084741 | 2018-10-21T14:13:42 | 2018-10-21T14:13:42 | 154,009,680 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,335 | java | package com.entity;
public class ColumnsPrivKey {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column columns_priv.Host
*
* @mbg.generated
*/
private String host;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column columns_priv.Db
*
* @mbg.generated
*/
private String db;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column columns_priv.User
*
* @mbg.generated
*/
private String user;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column columns_priv.Table_name
*
* @mbg.generated
*/
private String table_name;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column columns_priv.Column_name
*
* @mbg.generated
*/
private String column_name;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column columns_priv.Host
*
* @return the value of columns_priv.Host
*
* @mbg.generated
*/
public String getHost() {
return host;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column columns_priv.Host
*
* @param host the value for columns_priv.Host
*
* @mbg.generated
*/
public void setHost(String host) {
this.host = host == null ? null : host.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column columns_priv.Db
*
* @return the value of columns_priv.Db
*
* @mbg.generated
*/
public String getDb() {
return db;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column columns_priv.Db
*
* @param db the value for columns_priv.Db
*
* @mbg.generated
*/
public void setDb(String db) {
this.db = db == null ? null : db.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column columns_priv.User
*
* @return the value of columns_priv.User
*
* @mbg.generated
*/
public String getUser() {
return user;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column columns_priv.User
*
* @param user the value for columns_priv.User
*
* @mbg.generated
*/
public void setUser(String user) {
this.user = user == null ? null : user.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column columns_priv.Table_name
*
* @return the value of columns_priv.Table_name
*
* @mbg.generated
*/
public String getTable_name() {
return table_name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column columns_priv.Table_name
*
* @param table_name the value for columns_priv.Table_name
*
* @mbg.generated
*/
public void setTable_name(String table_name) {
this.table_name = table_name == null ? null : table_name.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column columns_priv.Column_name
*
* @return the value of columns_priv.Column_name
*
* @mbg.generated
*/
public String getColumn_name() {
return column_name;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column columns_priv.Column_name
*
* @param column_name the value for columns_priv.Column_name
*
* @mbg.generated
*/
public void setColumn_name(String column_name) {
this.column_name = column_name == null ? null : column_name.trim();
}
} | [
"949861884@qq.com"
] | 949861884@qq.com |
14efc5a8a2b04925a2c25413465ab3ee1cf34acf | 1454d3453f9e27827dbcf6fdb20cdb7df15b0976 | /IDEA/TestOJDBC/src/com/forward/server/UserServer.java | a24dcfd97b0f3b4f48f9eec334e8659d5744f949 | [] | no_license | liaoshanggang/MyGitHub | bf8b081c229e79d20a511480b59eaa561c6207da | def305f66aaede80a75b21153a22a2d8078451eb | refs/heads/master | 2021-06-23T18:40:49.431361 | 2018-07-02T15:55:59 | 2018-07-02T15:55:59 | 95,458,230 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 319 | java | package com.forward.server;
import com.forward.dao.DaoImpl;
import com.forward.po.User;
public class UserServer {
public User login(int user_id, String user_name, int password, double salary) {
DaoImpl daoImpl = new DaoImpl();
return daoImpl.getUser(user_id, user_name,password,salary);
}
}
| [
"787887060@qq.com"
] | 787887060@qq.com |
7137268f7863d4f406ed9cafce7e8318e4b1133c | ed166738e5dec46078b90f7cca13a3c19a1fd04b | /minor/guice-OOM-error-reproduction/src/main/java/gen/J_Gen70.java | 614a6b290cd5c0c14aa628c4ec0b40fbcb81cdc7 | [] | no_license | michalradziwon/script | 39efc1db45237b95288fe580357e81d6f9f84107 | 1fd5f191621d9da3daccb147d247d1323fb92429 | refs/heads/master | 2021-01-21T21:47:16.432732 | 2016-03-23T02:41:50 | 2016-03-23T02:41:50 | 22,663,317 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java |
package gen;
public class J_Gen70 {
@com.google.inject.Inject
public J_Gen70(J_Gen71 j_gen71){
System.out.println(this.getClass().getCanonicalName() + " created. " + j_gen71 );
}
@com.google.inject.Inject public void injectInterfaceWithoutImpl(gen.InterfaceWithoutImpl i){} // should expolode :)
}
| [
"michal.radzi.won@gmail.com"
] | michal.radzi.won@gmail.com |
703d720dfb65b1d6779e342720b2b2505c93d836 | e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f | /MazeMode/src/com/puttysoftware/mazemode/generic/GenericCarpet.java | 5ed1e5abfca7a27e3f222632641433e4bb57ccf2 | [
"Unlicense"
] | permissive | retropipes/older-java-games | 777574e222f30a1dffe7936ed08c8bfeb23a21ba | 786b0c165d800c49ab9977a34ec17286797c4589 | refs/heads/master | 2023-04-12T14:28:25.525259 | 2021-05-15T13:03:54 | 2021-05-15T13:03:54 | 235,693,016 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 830 | java | /* MazeMode: A Maze-Solving Game
Copyright (C) 2008-2010 Eric Ahnell
Any questions should be directed to the author via email at: products@puttysoftware.com
*/
package com.puttysoftware.mazemode.generic;
public abstract class GenericCarpet extends GenericGround {
// Fields
private final String color;
// Constructors
protected GenericCarpet(final String newColor) {
super();
this.color = newColor;
}
@Override
public final String getName() {
return this.color + " Carpet";
}
@Override
public final String getPluralName() {
return "Squares of " + this.color + " Carpet";
}
@Override
public final String getDescription() {
return "Squares of " + this.color
+ " Carpet are one of the many types of ground.";
}
}
| [
"eric.ahnell@puttysoftware.com"
] | eric.ahnell@puttysoftware.com |
6731d1a72a9a685a8969f76e40492790ae315584 | 61ca80dbb014ee6a513b5e6cceb485904e19b2ff | /mycop/src/main/java/com/gever/vo/VOInterface.java | 34c51706d16f6edf69fbeee19e19c8075b208be7 | [] | no_license | myosmatrix/mycop | 3fbc1e243dfbb32fe9c4b3cef5f2bfa7d984f1f4 | b1f0260ea8d21176ebc2fc06de47b523e22e27df | refs/heads/master | 2021-05-29T13:10:02.076980 | 2010-09-11T15:23:34 | 2010-09-11T15:23:34 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 1,690 | java | package com.gever.vo;
/**
* <p>Title: VO公共接口类</p>
* <p>Description: 为VO扩展了一些与数据库相关的操作</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: </p>
* @author
* @version 0.5
*/
public interface VOInterface {
/**
* 取得指定变量名的值
* @param name 属性名称
*/
public String getValue(String name);
/**
* 设置指定变量名的值
* @param name 属性名称
* @param value 值
*/
public void setValue(String name, String value);
/**通过数组方式一次指定数个字段的值
* @param values
*/
public void setValues(String[] values);
/**
* 获取指定字段的数据类型
* @param name 字段名称
* @return 字段类型
*/
public String getColType(String name);
/**
* 获取本vo类的所有变量。
* @return 本vo类的所有字段数组。
*/
public String getAllFields();
/**
* 获取本vo类的所有可修改的字段名字,注以(逗号分隔)。
* @return 本vo类的所有字段。
*/
public String getModifyFields();
/**
* 获取本vo类的所有主键名称,注以(逗号分隔)。
* @return 本vo类的所有字段数组。
*/
public String getPkFields();
/**
* 获取本vo类的所映射表名。
* @return 本vo类的所映射表名。
*/
public String getTableName();
/**
* 设置其它属性(因可能会用到其它的属性)
* @param map (单行的数据记录)
*/
public void setOtherProperty(String[] values) ;
} | [
"huhongjun@gmail.com"
] | huhongjun@gmail.com |
c5f218bc2b8285b1f2ad0d7339bf8493d78e799a | a840a5e110b71b728da5801f1f3e591f6128f30e | /src/test/java/com/google/security/zynamics/reil/translators/arm/THUMBAsrTranslatorTest.java | c20163f4c6a6f904ca761a0e1b8c942e78133ca7 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | tpltnt/binnavi | 0a25d2fde2c6029aeef4fcfec8eead5c8e51f4b4 | 598c361d618b2ca964d8eb319a686846ecc43314 | refs/heads/master | 2022-10-20T19:38:30.080808 | 2022-07-20T13:01:37 | 2022-07-20T13:01:37 | 107,143,332 | 0 | 0 | Apache-2.0 | 2023-08-20T11:22:53 | 2017-10-16T15:02:35 | Java | UTF-8 | Java | false | false | 6,342 | java | /*
Copyright 2014 Google Inc. 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.google.security.zynamics.reil.translators.arm;
import static org.junit.Assert.assertEquals;
import com.google.common.collect.Lists;
import com.google.security.zynamics.reil.OperandSize;
import com.google.security.zynamics.reil.ReilInstruction;
import com.google.security.zynamics.reil.TestHelpers;
import com.google.security.zynamics.reil.interpreter.CpuPolicyARM;
import com.google.security.zynamics.reil.interpreter.EmptyInterpreterPolicy;
import com.google.security.zynamics.reil.interpreter.Endianness;
import com.google.security.zynamics.reil.interpreter.InterpreterException;
import com.google.security.zynamics.reil.interpreter.ReilInterpreter;
import com.google.security.zynamics.reil.interpreter.ReilRegisterStatus;
import com.google.security.zynamics.reil.translators.InternalTranslationException;
import com.google.security.zynamics.reil.translators.StandardEnvironment;
import com.google.security.zynamics.reil.translators.arm.THUMBAsrTranslator;
import com.google.security.zynamics.zylib.disassembly.ExpressionType;
import com.google.security.zynamics.zylib.disassembly.IInstruction;
import com.google.security.zynamics.zylib.disassembly.MockInstruction;
import com.google.security.zynamics.zylib.disassembly.MockOperandTree;
import com.google.security.zynamics.zylib.disassembly.MockOperandTreeNode;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
@RunWith(JUnit4.class)
public class THUMBAsrTranslatorTest {
private final ReilInterpreter interpreter = new ReilInterpreter(Endianness.BIG_ENDIAN,
new CpuPolicyARM(), new EmptyInterpreterPolicy());
private final StandardEnvironment environment = new StandardEnvironment();
private final THUMBAsrTranslator translator = new THUMBAsrTranslator();
private final ArrayList<ReilInstruction> instructions = new ArrayList<ReilInstruction>();
final OperandSize dw = OperandSize.DWORD;
final OperandSize wd = OperandSize.WORD;
final OperandSize bt = OperandSize.BYTE;
@Before
public void setUp() {
}
// @Test
// public void testRegister() throws InternalTranslationException, InterpreterException
// {
// interpreter.setRegister("R0", BigInteger.valueOf(0x00000010L), dw, ReilRegisterStatus.DEFINED);
// interpreter.setRegister("R1", BigInteger.valueOf(0x00000003L), dw, ReilRegisterStatus.DEFINED);
// interpreter.setRegister("C", BigInteger.ZERO, bt, ReilRegisterStatus.DEFINED);
//
// final MockOperandTree operandTree1 = new MockOperandTree();
// operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
// operandTree1.root.children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "R0"));
//
// final MockOperandTree operandTree2 = new MockOperandTree();
// operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
// operandTree2.root.children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "R1"));
//
// final List<MockOperandTree> operands = Lists.newArrayList(operandTree1, operandTree2);
//
// final IInstruction instruction = new MockInstruction("ASRS", operands);
//
// translator.translate(environment, instruction, instructions);
//
// interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100L));
//
// assertEquals(BigInteger.valueOf(0x00000000L), interpreter.getVariableValue("R0"));
// assertEquals(BigInteger.valueOf(0x00000003L), interpreter.getVariableValue("R1"));
// assertEquals(BigInteger.ZERO, interpreter.getVariableValue("C"));
//
// assertEquals(BigInteger.ZERO, BigInteger.valueOf(interpreter.getMemorySize()));
// assertEquals(6, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size());
// }
@Test
public void testSimple() throws InternalTranslationException, InterpreterException {
interpreter.setRegister("R0", BigInteger.valueOf(0x00000010L), dw, ReilRegisterStatus.DEFINED);
interpreter.setRegister("R1", BigInteger.valueOf(0x00000003L), dw, ReilRegisterStatus.DEFINED);
interpreter.setRegister("C", BigInteger.ZERO, bt, ReilRegisterStatus.DEFINED);
final MockOperandTree operandTree1 = new MockOperandTree();
operandTree1.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
operandTree1.root.m_children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "R0"));
final MockOperandTree operandTree2 = new MockOperandTree();
operandTree2.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
operandTree2.root.m_children.add(new MockOperandTreeNode(ExpressionType.REGISTER, "R1"));
final MockOperandTree operandTree3 = new MockOperandTree();
operandTree3.root = new MockOperandTreeNode(ExpressionType.SIZE_PREFIX, "b4");
operandTree3.root.m_children.add(new MockOperandTreeNode(ExpressionType.IMMEDIATE_INTEGER,
String.valueOf(4L)));
final List<MockOperandTree> operands =
Lists.newArrayList(operandTree1, operandTree2, operandTree3);
final IInstruction instruction = new MockInstruction("ASRS", operands);
translator.translate(environment, instruction, instructions);
interpreter.interpret(TestHelpers.createMapping(instructions), BigInteger.valueOf(0x100L));
assertEquals(BigInteger.valueOf(0x00000000L), interpreter.getVariableValue("R0"));
assertEquals(BigInteger.valueOf(0x00000003L), interpreter.getVariableValue("R1"));
assertEquals(BigInteger.ZERO, interpreter.getVariableValue("C"));
assertEquals(BigInteger.ZERO, BigInteger.valueOf(interpreter.getMemorySize()));
assertEquals(6, TestHelpers.filterNativeRegisters(interpreter.getDefinedRegisters()).size());
}
}
| [
"cblichmann@google.com"
] | cblichmann@google.com |
06c8c3c68dca0c6955ca33c242b57586c0e6a7c8 | 9187ef8cc85315e8e55b23c03bc1685f2aef355c | /src/com/jm2007/jdbc/ddl/CreateTable.java | d1d8e88806531b690d0952b3c13c04fecd4173f0 | [] | no_license | WeInnovate/JM2007_JDBC | 2cc4398ac6b3bdfda52ae2cc13741122c003962f | a1da3acfd41fdb93688712916f84e8d5b019f6ab | refs/heads/master | 2020-03-19T17:50:53.620893 | 2018-06-24T05:49:32 | 2018-06-24T05:49:32 | 136,781,115 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 608 | java | package com.jm2007.jdbc.ddl;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class CreateTable {
public static void main(String[] args) {
Connection con = null;
try {
con = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
Statement stmt = con.createStatement();
boolean bool = stmt.execute("CREATE TABLE JDBC_TBL(ID NUMBER, NAME VARCHAR, PERCENTAGE DECIMAL)");
if(bool == false) {
System.out.println("Table created successfully.");
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
| [
"er.dwivediatul@gmail.com"
] | er.dwivediatul@gmail.com |
2e91ff0648c74b486a653c971f8af87fb9d50d2c | 6dbae30c806f661bcdcbc5f5f6a366ad702b1eea | /Corpus/eclipse.pde.ui/2952.java | 8a120993860ad2f755d8b2f81d383ca009c270c9 | [
"MIT"
] | permissive | SurfGitHub/BLIZZARD-Replication-Package-ESEC-FSE2018 | d3fd21745dfddb2979e8ac262588cfdfe471899f | 0f8f4affd0ce1ecaa8ff8f487426f8edd6ad02c0 | refs/heads/master | 2020-03-31T15:52:01.005505 | 2018-10-01T23:38:50 | 2018-10-01T23:38:50 | 152,354,327 | 1 | 0 | MIT | 2018-10-10T02:57:02 | 2018-10-10T02:57:02 | null | UTF-8 | Java | false | false | 416 | java | package x.y.z;
import c.NoRefClass;
public class testC14 {
class Inner {
void method2() {
NoRefClass clazz = new NoRefClass();
String field = clazz.fNoRefClassField;
clazz.noRefClassMethod();
}
}
void method1() {
NoRefClass clazz = new NoRefClass();
String field = clazz.fNoRefClassField;
clazz.noRefClassMethod();
}
}
| [
"masudcseku@gmail.com"
] | masudcseku@gmail.com |
e1500be297d3610944013e9af4ac5c56936c6ec9 | ab49d0c6d3e4f3a999710508084e599fe5284ce0 | /src/com/cos/crossfit/action/user/UsersLoginAction.java | a2203f5e81eeddb505a13e10fe93a911d2386b61 | [] | no_license | polojune/crossfit-site | af40ef7909898d3f89eb54dd44ec0877bafe6e7c | dfcc82a8a66afa583b795c7486de712718a0f392 | refs/heads/master | 2022-11-07T03:55:29.941981 | 2020-07-04T07:23:31 | 2020-07-04T07:23:31 | 274,633,216 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 584 | java | package com.cos.crossfit.action.user;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.cos.crossfit.action.Action;
public class UsersLoginAction implements Action{
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
RequestDispatcher dis = request.getRequestDispatcher("login.jsp");
dis.forward(request, response);
}
}
| [
"crossfit@a.naver.com"
] | crossfit@a.naver.com |
34abf0fb87ef38a2fbbebdd031e5a055e4f6a3fb | 7bea7fb60b5f60f89f546a12b43ca239e39255b5 | /src/com/sun/corba/se/spi/activation/RepositoryPackage/StringSeqHelper.java | 15127b272329dd90f73687a9e7d728a9dae7b5af | [] | no_license | sorakeet/fitcorejdk | 67623ab26f1defb072ab473f195795262a8ddcdd | f946930a826ddcd688b2ddbb5bc907d2fc4174c3 | refs/heads/master | 2021-01-01T05:52:19.696053 | 2017-07-15T01:33:41 | 2017-07-15T01:33:41 | 97,292,673 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,625 | java | package com.sun.corba.se.spi.activation.RepositoryPackage;
abstract public class StringSeqHelper{
private static String _id="IDL:activation/Repository/StringSeq:1.0";
private static org.omg.CORBA.TypeCode __typeCode=null;
public static void insert(org.omg.CORBA.Any a,String[] that){
org.omg.CORBA.portable.OutputStream out=a.create_output_stream();
a.type(type());
write(out,that);
a.read_value(out.create_input_stream(),type());
}
synchronized public static org.omg.CORBA.TypeCode type(){
if(__typeCode==null){
__typeCode=org.omg.CORBA.ORB.init().create_string_tc(0);
__typeCode=org.omg.CORBA.ORB.init().create_sequence_tc(0,__typeCode);
__typeCode=org.omg.CORBA.ORB.init().create_alias_tc(StringSeqHelper.id(),"StringSeq",__typeCode);
}
return __typeCode;
}
public static String id(){
return _id;
}
public static void write(org.omg.CORBA.portable.OutputStream ostream,String[] value){
ostream.write_long(value.length);
for(int _i0=0;_i0<value.length;++_i0)
ostream.write_string(value[_i0]);
}
public static String[] extract(org.omg.CORBA.Any a){
return read(a.create_input_stream());
}
public static String[] read(org.omg.CORBA.portable.InputStream istream){
String value[]=null;
int _len0=istream.read_long();
value=new String[_len0];
for(int _o1=0;_o1<value.length;++_o1)
value[_o1]=istream.read_string();
return value;
}
}
| [
"panxiaoping@9af151c5-2e68-9a40-a710-8967c58c11f7"
] | panxiaoping@9af151c5-2e68-9a40-a710-8967c58c11f7 |
c4670658825171281db470a7c81829f4c4bb7c33 | 124df74bce796598d224c4380c60c8e95756f761 | /com.raytheon.uf.common.dataplugin.satellite/src/com/raytheon/uf/common/dataplugin/satellite/units/water/RainfallRatePixel.java | 823e505f82b58e6a3aaa6a0bd8604a09b223b974 | [] | no_license | Mapoet/AWIPS-Test | 19059bbd401573950995c8cc442ddd45588e6c9f | 43c5a7cc360b3cbec2ae94cb58594fe247253621 | refs/heads/master | 2020-04-17T03:35:57.762513 | 2017-02-06T17:17:58 | 2017-02-06T17:17:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,113 | java | /**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.dataplugin.satellite.units.water;
import javax.measure.converter.UnitConverter;
import javax.measure.quantity.Velocity;
import javax.measure.unit.DerivedUnit;
import javax.measure.unit.NonSI;
import javax.measure.unit.SI;
import javax.measure.unit.Unit;
import org.apache.commons.lang.builder.HashCodeBuilder;
/**
* Represents a pixel value of a rainfall rate (mm/hr) on a POES or DMSP
* satellite image
*
* <pre>
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Aug 29, 2007 njensen Initial creation
* Mar 23, 2009 2086 jsanchez Changed unit from mm^3/hr to mm/hr
*
* </pre>
*
* @author njensen
*/
public class RainfallRatePixel extends DerivedUnit<Velocity> {
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object anObject) {
return (anObject instanceof RainfallRatePixel);
}
@SuppressWarnings("unchecked")
@Override
public Unit<Velocity> getStandardUnit() {
return (Unit<Velocity>) (SI.MILLI(SI.METRE))
.divide(NonSI.HOUR);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public UnitConverter toStandardUnit() {
return new RainfallPixelToRateConverter();
}
}
| [
"joshua.t.love@saic.com"
] | joshua.t.love@saic.com |
1f4dbc8a0cde0f592f1f74d9f86615cacd412955 | 622259e01d8555d552ddeba045fafe6624d80312 | /edu.harvard.i2b2.eclipse.plugins.previousQuery/gensrc/edu/harvard/i2b2/crcxmljaxb/datavo/i2b2message/SecurityType.java | ebe9cb0170f3b479b188f9838ea08e84b3ed3d18 | [] | no_license | kmullins/i2b2-workbench-old | 93c8e7a3ec7fc70b68c4ce0ae9f2f2c5101f5774 | 8144b0b62924fa8a0e4076bf9672033bdff3b1ff | refs/heads/master | 2021-05-30T01:06:11.258874 | 2015-11-05T18:00:58 | 2015-11-05T18:00:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,103 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.1.2-b01-fcs
// 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: 2015.07.21 at 10:39:09 AM EDT
//
package edu.harvard.i2b2.crcxmljaxb.datavo.i2b2message;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for securityType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="securityType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <sequence>
* <element name="domain" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="username" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="password" type="{http://www.i2b2.org/xsd/hive/msg/1.1/}passwordType"/>
* </sequence>
* </choice>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "securityType", propOrder = {
"domain",
"username",
"password"
})
public class SecurityType {
protected String domain;
protected String username;
protected PasswordType password;
/**
* Gets the value of the domain property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDomain() {
return domain;
}
/**
* Sets the value of the domain property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDomain(String value) {
this.domain = value;
}
/**
* Gets the value of the username property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getUsername() {
return username;
}
/**
* Sets the value of the username property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setUsername(String value) {
this.username = value;
}
/**
* Gets the value of the password property.
*
* @return
* possible object is
* {@link PasswordType }
*
*/
public PasswordType getPassword() {
return password;
}
/**
* Sets the value of the password property.
*
* @param value
* allowed object is
* {@link PasswordType }
*
*/
public void setPassword(PasswordType value) {
this.password = value;
}
}
| [
"Janice@phs000774.partners.org"
] | Janice@phs000774.partners.org |
31144db12e266f0bfec924cb484b40dccedf1b51 | fb80fdc722d8ad415a66634f9060043c70191589 | /src/main/java/hyperskill/strings/Euphenious.java | a490bba139c4a373f142f526327e6fb83eda7ce6 | [] | no_license | arturdziocha/learn | ee795b09fd8d0ae0022762400b53edb65c6643c3 | f4396844a733de2c959c64b9251bc766f211b32a | refs/heads/master | 2020-12-22T06:14:55.818022 | 2020-07-31T14:40:11 | 2020-07-31T14:40:11 | 236,692,415 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,743 | java | package hyperskill.strings;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/*
* All the letters of the English alphabet are divided into vowels and consonants.
The vowels are: a, e, i, o, u, y.
The remaining letters are consonants.
A word is considered euphonious if it has not three or more vowels or consonants in a row. Otherwise, it is considered discordant.
Your task is to create euphonious words from discordant. You can insert any letters inside word. You should output the minimum number of characters needed to create a euphonious word from a given word.
For example, word "schedule" is considered discordant because it has three consonants in a row - "sch". To create a euphonious word you need to add any vowel between 's' and 'c' or between 'c' and 'h'.
Sample Input 1:
schedule
Sample Output 1:
1
Sample Input 2:
garage
Sample Output 2:
0
Sample Input 3:
player
Sample Output 3:
1
Sample Input 4:
biiiiig
Sample Output 4:
2
wwwwwwwwwwwwwwwwwwwwwwwwwwwww
*/
public class Euphenious {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("add");
String word = scanner.next();
scanner.close();
System.out.println(find(factorialEuph(word.toLowerCase())));
}
static String factorialEuph(String string) {
List<Character> vovels = Arrays.asList('a', 'e', 'i', 'o', 'u', 'y');
List<Character> consonants = IntStream
.rangeClosed('a', 'z')
.mapToObj(c -> (char) c)
.collect(Collectors.toCollection(ArrayList::new));
consonants.removeAll(vovels);
String vovelsString = vovels.stream().map(String::valueOf).collect(Collectors.joining());
String consonantsString = consonants.stream().map(String::valueOf).collect(Collectors.joining());
Pattern pattern = Pattern.compile("[" + vovelsString + "]{3}|[" + consonantsString + "]{3}");
Matcher matcher = pattern.matcher(string);
if (matcher.find()) {
int val = matcher.end(0);
string = factorialEuph(string.substring(0, val - 1) + "_" + string.substring(val - 1));
}
return string;
}
static int find(String word) {
Pattern pattern = Pattern.compile("[_]");
Matcher matcher = pattern.matcher(word);
int sum = 0;
while (matcher.find()) {
sum += 1;
}
return sum;
}
}
| [
"artur.dziocha@gmail.com"
] | artur.dziocha@gmail.com |
b94ea7b60b826b77ca04b19404f9351fbbe8855a | a4fbb458efa6df7e33c4a9c6bb303fdd65570a85 | /gameserver-test/src/main/java/org/jyg/gameserver/test/tcp/remoteInvoke/Test03Invoke.java | aeca1c14459d28e9088ee24775bf892f68da1587 | [
"Apache-2.0"
] | permissive | JygTech/gameserver | 204de35d9428a60d5cbf3d00eaf69e8c69bc420a | 54df3632aa967d2bd7b2ebc90c2af75e3946507a | refs/heads/master | 2021-06-11T00:54:52.044866 | 2021-05-12T09:07:14 | 2021-05-12T09:07:14 | 189,595,175 | 0 | 0 | Apache-2.0 | 2021-05-12T09:07:14 | 2019-05-31T13:05:02 | Java | UTF-8 | Java | false | false | 405 | java | package org.jyg.gameserver.test.tcp.remoteInvoke;
import com.alibaba.fastjson.JSONObject;
import org.jyg.gameserver.core.invoke.IRemoteInvoke;
import org.jyg.gameserver.core.util.AllUtil;
/**
* create by jiayaoguang on 2021/4/24
*/
public class Test03Invoke implements IRemoteInvoke {
@Override
public void invoke(JSONObject paramJson) {
AllUtil.println("hello Test03Invoke");
}
}
| [
"1090196116@qq.com"
] | 1090196116@qq.com |
8346cb73fc0ca63abf0438d35c837d729d6c5f53 | f86938ea6307bf6d1d89a07b5b5f9e360673d9b8 | /CodeComment_Data/Code_Jam/train/Magic_Trick/S/a(315).java | d12573930a50e92ef76a343b7fea6357fd13e08d | [] | no_license | yxh-y/code_comment_generation | 8367b355195a8828a27aac92b3c738564587d36f | 2c7bec36dd0c397eb51ee5bd77c94fa9689575fa | refs/heads/master | 2021-09-28T18:52:40.660282 | 2018-11-19T14:54:56 | 2018-11-19T14:54:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,365 | java | package methodEmbedding.Magic_Trick.S.LYD330;
import java.io.*;
import java.util.*;
public class a {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(new FileReader("a-in.txt"));
PrintWriter pw = new PrintWriter(new FileWriter("a-out.txt"));
int testcases = sc.nextInt();
int f1=0,f2=0,r;
int[][] arr ;
for (int i = 0; i < testcases ; i++) {
arr = new int[16][2];
f1 = sc.nextInt() -1;
for(int j=0;j<4;j++)
{
for(int k=0;k<4;k++)
{
r = sc.nextInt();
arr[r-1][0] = j;
}
}
f2 = sc.nextInt()-1;
for (int j = 0; j < 4; j++) {
for (int j2 = 0; j2 < 4; j2++) {
r = sc.nextInt();
arr[r-1][1] = j;
}
}
int[] ocaurence = new int[16];
for(int ii=0;ii<16;ii++)
{
if(arr[ii][0]==f1)
{
ocaurence[ii]++;
}
if(arr[ii][1]==f2)
{
ocaurence[ii]++;
}
}
int counter = 0, index = 0;
for (int ii = 0; ii < ocaurence.length; ii++) {
if(ocaurence[ii]==2)
{
counter++;
index = ii;
}
}
pw.printf("Case #%d: ",i+1);
if(counter==0)
{
pw.println("Volunteer cheated!");
} else if(counter==1)
{
pw.println(index+1);
} else {
pw.println("Bad magician!");
}
}
pw.close();
sc.close();
}
}
| [
"liangyuding@sjtu.edu.cn"
] | liangyuding@sjtu.edu.cn |
611c76ba937b83224d2ec2f6baaaef6e80a3ec7d | b5f593062031c0d06680135a4bc756f56163ab7f | /common/src/main/java/org/pozopardo/challenges/hackerrank/common/data/structure/ListOperator.java | 6dd018f9c3392488f1f3580a5f5c5846da56462e | [] | no_license | denis-pozo/hackerrank | a1a3727503edb32ab9a8f60ce92d54aa0dd464be | 0ae93ba393e3916249e66f8436e85cc2359f7d12 | refs/heads/master | 2023-05-13T01:24:17.189086 | 2023-05-08T08:30:47 | 2023-05-08T08:30:47 | 263,018,459 | 0 | 0 | null | 2020-10-14T09:35:09 | 2020-05-11T11:06:40 | Java | UTF-8 | Java | false | false | 1,213 | java | package org.pozopardo.challenges.hackerrranck.data.structure;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class ListOperator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int nElements = scanner.nextInt();
List<Integer> list = new ArrayList<>(nElements);
while(nElements-- > 0) {
list.add(scanner.nextInt());
}
int q = scanner.nextInt();
while(q-- > 0) {
String query = scanner.next("Insert|Delete");
if(query.equalsIgnoreCase("Insert")){
int index = scanner.nextInt();
int value = scanner.nextInt();
list.add(index, value);
} else {
int index = scanner.nextInt();
list.remove(index);
}
}
print(list);
scanner.close();
}
private static void print(List<Integer> list) {
StringBuilder str = new StringBuilder();
for(Integer i : list) {
str.append(i);
str.append(" ");
}
str.append("\n");
System.out.println(str.toString());
}
}
| [
"denis.pozo@dai-labor.de"
] | denis.pozo@dai-labor.de |
8d4b70e5e53ab9f1e6c2217966cb95bf1467c0e3 | 0b24cf99612ce74f354f2af5274888fc32b47e7b | /springboot-bean-refresh/springboot-bean-refresh-framework/src/main/java/com/github/lybgeek/scope/register/RefreshBeanScopeDefinitionRegistryPostProcessor.java | b2e530b3f4ef440f34cfdcc5c476e7ce831c8884 | [] | no_license | lyb-geek/springboot-learning | 9c90706ffe4af8f14485d043c52bbb795f366bc0 | d441036b5969a8023b92b4c40b8a915cf524dba6 | refs/heads/master | 2023-07-25T13:43:46.685581 | 2023-07-22T12:41:42 | 2023-07-22T12:41:42 | 195,616,981 | 544 | 395 | null | 2023-03-11T02:17:31 | 2019-07-07T06:13:03 | Java | UTF-8 | Java | false | false | 915 | java | package com.github.lybgeek.scope.register;
import com.github.lybgeek.scope.RefreshBeanScope;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor;
import static com.github.lybgeek.scope.constant.RefreshBeanScopeConstant.SCOPE_NAME;
public class RefreshBeanScopeDefinitionRegistryPostProcessor implements BeanDefinitionRegistryPostProcessor {
@Override
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
}
@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
beanFactory.registerScope(SCOPE_NAME,new RefreshBeanScope());
}
}
| [
"410480180@qq.com"
] | 410480180@qq.com |
dad33bf2ba8b4fa461b2a255366596568e3e95a4 | c152699595b817d9f19d6d4e456724e22bc78c9f | /introduccion-java/soluciones/tarea5/javase_colecciones_map_set/src/org/diplomado/pucmm/mescyt/java/encapsulados/Persona.java | f4df87a444d9cead5c7904ca80a18bc78cb835d5 | [] | no_license | ecabrerar/diplomado-java-pucmm-mescyt | be7201553870ec1fd14f1dc9b4e167a6607b2f38 | ef688530a7d47e62dc2bb45692c666276eab6d89 | refs/heads/master | 2022-07-07T20:33:58.586169 | 2021-01-13T18:01:58 | 2021-01-13T18:01:58 | 51,713,436 | 4 | 6 | null | 2022-06-20T23:14:55 | 2016-02-14T21:03:17 | Java | UTF-8 | Java | false | false | 1,731 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.diplomado.pucmm.mescyt.java.encapsulados;
/**
*
* @author eudriscabrera
*/
public class Persona {
private String nombre;
private String apellido;
private Genero genero;
private int edad;
public Persona(String nombre, String apellido, Genero genero, int edad) {
this.nombre = nombre;
this.apellido = apellido;
this.genero = genero;
this.edad = edad;
}
/**
* @return the nombre
*/
public String getNombre() {
return nombre;
}
/**
* @param nombre the nombre to set
*/
public void setNombre(String nombre) {
this.nombre = nombre;
}
/**
* @return the apellido
*/
public String getApellido() {
return apellido;
}
/**
* @param apellido the apellido to set
*/
public void setApellido(String apellido) {
this.apellido = apellido;
}
/**
* @return the genero
*/
public Genero getGenero() {
return genero;
}
/**
* @param genero the genero to set
*/
public void setGenero(Genero genero) {
this.genero = genero;
}
/**
* @return the edad
*/
public int getEdad() {
return edad;
}
/**
* @param edad the edad to set
*/
public void setEdad(int edad) {
this.edad = edad;
}
public void printPersona() {
System.out.println(String.format("Nombre : %s Gnero: %s edad:%d", getNombre(), getGenero(), getEdad()));
}
}
| [
"eudris@gmail.com"
] | eudris@gmail.com |
b97c0085581b9e560607e4beebbf076433f941a1 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13377-16-24-NSGA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/security/authorization/internal/XWikiCachingRightService_ESTest.java | e7c634029adb0f497f3d94c36ffabcc3b2cbf733 | [] | no_license | STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application | cf118b23ecb87a8bf59643e42f7556b521d1f754 | 3bb39683f9c343b8ec94890a00b8f260d158dfe3 | refs/heads/master | 2022-07-29T14:44:00.774547 | 2020-08-10T15:14:49 | 2020-08-10T15:14:49 | 285,804,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | /*
* This file was automatically generated by EvoSuite
* Wed Apr 01 14:01:19 UTC 2020
*/
package org.xwiki.security.authorization.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(useVFS = true, useJEE = true)
public class XWikiCachingRightService_ESTest extends XWikiCachingRightService_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
4c568ef99d950c601ace0a9002512de1c4510710 | 6a61e393dfad6a6cefdf4f06798917c3a7aee971 | /tests/04_prim_operators/op_05_int_to_int_overflow.java | 6611feb9edb1c448851ff5c5d57359cdc63532a3 | [] | no_license | kframework/java-semantics | 388bead15b594f3b2478441a5d95c02d7a0ccbf6 | f27067ee7a38d236499992eed1b48064e70680fa | refs/heads/master | 2021-09-22T20:42:43.662165 | 2021-09-15T19:53:33 | 2021-09-15T19:53:33 | 11,711,471 | 14 | 7 | null | 2016-03-16T22:03:02 | 2013-07-27T21:42:38 | Java | UTF-8 | Java | false | false | 1,567 | java | class main {
void printAll(String[] vs, int[] v) {
for (int i = 0; i<nrOps; i++) {
System.out.println(vs[i]+" = "+v[i]);
}
}
int nrOps = 30;
String[] initVS() {
String[] vs = new String[nrOps];
int i=0;
//Infix operators
vs[i++] = " 2147483647 + 2147483647 ";
vs[i++] = "-2147483647 - 2147483647 ";
vs[i++] = " 2147483647 * 2147483647 ";
vs[i++] = "- (-2147483648) ";
vs[i++] = "++2147483647 ";
vs[i++] = "2147483647++ ";
vs[i++] = "-- (-2147483648) ";
vs[i++] = "(-2147483648)-- ";
vs[i++] = "~(-2147483648) ";
vs[i++] = "2147483647 | (-2147483648) ";
vs[i++] = "2147483647 ^ (-2147483648) ";
vs[i++] = "3 << 31 ";
nrOps = i;
return vs;
}
main(String[] args) {
int[] v = new int[nrOps];
String[] vs = initVS();
int i=0;
//Infix operators
v[i++] = 2147483647 + 2147483647;
v[i++] = -2147483647 - 2147483647;
v[i++] = 2147483647 * 2147483647;
v[i++] = - (-2147483648);
v[i] = 2147483647;
++v[i++];
v[i] = 2147483647;
v[i++]++;
v[i] = -2147483648;
--v[i++];
v[i] = -2147483648;
v[i++]--;
v[i++] = ~(-2147483648);
v[i++] = 2147483647 | (-2147483648);
v[i++] = 2147483647 ^ (-2147483648);
v[i++] = 3 << 31;
printAll(vs,v);
System.out.println("Done!");
}
}
public class op_05_int_to_int_overflow {
public static void main(String[] args) {
new main(args);
}
}
| [
"denis.bogdanas@gmail.com"
] | denis.bogdanas@gmail.com |
b44ceaf3f6dc0446fa8dd8e93aedead6765e9a93 | 2b8c47031dddd10fede8bcf16f8db2b52521cb4f | /subject SPLs and test cases/MobileMedia(4)/MobileMedia_P2/evosuite-tests4/lancs/mobilemedia/lib/exceptions/InvalidImageFormatException_ESTest_scaffolding4.java | f7c1c64a2383da80ab095a9911b19d8c749a0037 | [] | no_license | psjung/SRTST_experiments | 6f1ff67121ef43c00c01c9f48ce34f31724676b6 | 40961cb4b4a1e968d1e0857262df36832efb4910 | refs/heads/master | 2021-06-20T04:45:54.440905 | 2019-09-06T04:05:38 | 2019-09-06T04:05:38 | 206,693,757 | 1 | 0 | null | 2020-10-13T15:50:41 | 2019-09-06T02:10:06 | Java | UTF-8 | Java | false | false | 1,546 | java | /**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Mon Aug 13 23:33:37 KST 2018
*/
package lancs.mobilemedia.lib.exceptions;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class InvalidImageFormatException_ESTest_scaffolding4 {
@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
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 = "lancs.mobilemedia.lib.exceptions.InvalidImageFormatException";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
}
@Before
public void initTestCase(){
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
}
@After
public void doneWithTestCase(){
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}
}
| [
"psjung@kaist.ac.kr"
] | psjung@kaist.ac.kr |
f6aa38782955bc49284cc3420c592f82bf5e76a7 | aa623c778fd88082cf59f442ad3cb671253ffc37 | /src/main/java/com/tencentcloudapi/dayu/v20180709/models/DescribeL4HealthConfigRequest.java | 028f44e5d5d5dd26eb552a5ce00b1db9ad25fae9 | [
"Apache-2.0"
] | permissive | zjm9109/tencentcloud-sdk-java | 1eac89cedd70c8111c300d050f2c2f2ab1839189 | a31d2d50f75dc740457289db0bf93ed8b3994c73 | refs/heads/master | 2020-09-30T10:32:57.836303 | 2019-12-05T14:18:17 | 2019-12-05T14:18:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,187 | java | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tencentcloudapi.dayu.v20180709.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class DescribeL4HealthConfigRequest extends AbstractModel{
/**
* 大禹子产品代号(bgpip表示高防IP;net表示高防IP专业版)
*/
@SerializedName("Business")
@Expose
private String Business;
/**
* 资源ID
*/
@SerializedName("Id")
@Expose
private String Id;
/**
* 规则ID数组,当导出所有规则的健康检查配置则不填或填空数组;
*/
@SerializedName("RuleIdList")
@Expose
private String [] RuleIdList;
/**
* 获取大禹子产品代号(bgpip表示高防IP;net表示高防IP专业版)
* @return Business 大禹子产品代号(bgpip表示高防IP;net表示高防IP专业版)
*/
public String getBusiness() {
return this.Business;
}
/**
* 设置大禹子产品代号(bgpip表示高防IP;net表示高防IP专业版)
* @param Business 大禹子产品代号(bgpip表示高防IP;net表示高防IP专业版)
*/
public void setBusiness(String Business) {
this.Business = Business;
}
/**
* 获取资源ID
* @return Id 资源ID
*/
public String getId() {
return this.Id;
}
/**
* 设置资源ID
* @param Id 资源ID
*/
public void setId(String Id) {
this.Id = Id;
}
/**
* 获取规则ID数组,当导出所有规则的健康检查配置则不填或填空数组;
* @return RuleIdList 规则ID数组,当导出所有规则的健康检查配置则不填或填空数组;
*/
public String [] getRuleIdList() {
return this.RuleIdList;
}
/**
* 设置规则ID数组,当导出所有规则的健康检查配置则不填或填空数组;
* @param RuleIdList 规则ID数组,当导出所有规则的健康检查配置则不填或填空数组;
*/
public void setRuleIdList(String [] RuleIdList) {
this.RuleIdList = RuleIdList;
}
/**
* 内部实现,用户禁止调用
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "Business", this.Business);
this.setParamSimple(map, prefix + "Id", this.Id);
this.setParamArraySimple(map, prefix + "RuleIdList.", this.RuleIdList);
}
}
| [
"tencentcloudapi@tencent.com"
] | tencentcloudapi@tencent.com |
06f3f32229c5379fef6b053cdf26487bb1df0e50 | bafb94a5e291427875c522fb858b715056a53545 | /Summer2019_Java/src/day23_Arrays/WarmUp.java | d3bdb8bbaf502c2411711436273442426750d30c | [] | no_license | gulhanim/Java_Studies | 7a58136c8f06d72ff51cfde6892141ed0de9450c | 65657e6313ed03276414ce27c8d686318cd53111 | refs/heads/master | 2022-04-05T04:09:35.013430 | 2019-12-30T21:38:12 | 2019-12-30T21:38:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 561 | java | package day23_Arrays;
import java.util.Scanner;
public class WarmUp {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Please enter the word: ");
String word = scan.nextLine();
int count;
String unique = "";
for (int i = 0; i < word.length(); i++) {
count = 0;
for (int j = 0; j < word.length(); j++) {
if (word.charAt(i) == (word.charAt(j)))
count++;
}
if (count == 1)
unique += word.charAt(i);
}
System.out.println("unique characters in word are " + unique);
}
}
| [
"yusuf@kucukvatan.com"
] | yusuf@kucukvatan.com |
a31f876aecf9d6efa9066ff15fdd61f9c46c72f6 | de76d31cb027eba7e8e569da7c37c1d33508f431 | /src/generics/A.java | 64b06e1fa80040bf0dee4d0873e3747880624cd1 | [] | no_license | BingYu-track/Thinking-In-Java-Learning | 83e4235c66b46e7a3525fc19bb0542f9688f331b | 44da040a6ae50b634e793fc50ef97bdfcdbd1acf | refs/heads/master | 2023-06-12T09:42:08.872559 | 2021-07-04T15:00:06 | 2021-07-04T15:00:06 | 122,946,178 | 5 | 2 | null | null | null | null | UTF-8 | Java | false | false | 138 | java | package generics;
/**
* @version 1.0
* @Description:
* @author: hxw
* @date: 2018/12/13 21:29
*/
class A extends SelfBounded<A>{
}
| [
"525782303@qq.com"
] | 525782303@qq.com |
a3a9d56a1a6d47313ec6f0872eab7397e2dc0cd1 | e26a8434566b1de6ea6cbed56a49fdb2abcba88b | /model-trea-mx/src/generated/java/com/prowidesoftware/swift/model/mx/MxTrea01200102.java | ec29f0f4a4c5824ae09688c9bf5371bc6da737eb | [
"Apache-2.0"
] | permissive | adilkangerey/prowide-iso20022 | 6476c9eb8fafc1b1c18c330f606b5aca7b8b0368 | 3bbbd6804eb9dc4e1440680e5f9f7a1726df5a61 | refs/heads/master | 2023-09-05T21:41:47.480238 | 2021-10-03T20:15:26 | 2021-10-03T20:15:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,561 | java |
package com.prowidesoftware.swift.model.mx;
import com.prowidesoftware.swift.model.mx.dic.*;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import com.prowidesoftware.swift.model.MxSwiftMessage;
import com.prowidesoftware.swift.model.mx.AbstractMX;
import com.prowidesoftware.swift.model.mx.MxRead;
import com.prowidesoftware.swift.model.mx.MxReadImpl;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* Class for trea.012.001.02 ISO 20022 message.
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Document", propOrder = {
"fxOptnNtfctnV02"
})
@XmlRootElement(name = "Document", namespace = "urn:iso:std:iso:20022:tech:xsd:trea.012.001.02")
public class MxTrea01200102
extends AbstractMX
{
@XmlElement(name = "FXOptnNtfctnV02", required = true)
protected ForeignExchangeOptionNotificationV02 fxOptnNtfctnV02;
public final static transient String BUSINESS_PROCESS = "trea";
public final static transient int FUNCTIONALITY = 12;
public final static transient int VARIANT = 1;
public final static transient int VERSION = 2;
@SuppressWarnings("rawtypes")
public final static transient Class[] _classes = new Class[] {ActiveOrHistoricCurrencyAndAmount.class, AddressType2Code.class, AgreedRate1 .class, AmountsAndValueDate2 .class, ForeignExchangeOptionNotificationV02 .class, FundIdentification2 .class, MxTrea01200102 .class, NameAndAddress8 .class, Option3 .class, OptionData2 .class, OptionParty1Code.class, OptionStyle2Code.class, PartyIdentification22 .class, PartyIdentification8Choice.class, PostalAddress1 .class, PremiumAmount2 .class, PremiumQuote1Choice.class, SettlementData2 .class, SettlementStatus1Code.class, SettlementType1Code.class, TradePartyIdentification4 .class, TradeStatus1 .class, TradeStatus1Code.class };
public final static transient String NAMESPACE = "urn:iso:std:iso:20022:tech:xsd:trea.012.001.02";
public MxTrea01200102() {
super();
}
/**
* Creates the MX object parsing the parameter String with the XML content
*
*/
public MxTrea01200102(final String xml) {
this();
MxTrea01200102 tmp = parse(xml);
fxOptnNtfctnV02 = tmp.getFXOptnNtfctnV02();
}
/**
* Creates the MX object parsing the raw content from the parameter MxSwiftMessage
*
*/
public MxTrea01200102(final MxSwiftMessage mxSwiftMessage) {
this(mxSwiftMessage.message());
}
/**
* Gets the value of the fxOptnNtfctnV02 property.
*
* @return
* possible object is
* {@link ForeignExchangeOptionNotificationV02 }
*
*/
public ForeignExchangeOptionNotificationV02 getFXOptnNtfctnV02() {
return fxOptnNtfctnV02;
}
/**
* Sets the value of the fxOptnNtfctnV02 property.
*
* @param value
* allowed object is
* {@link ForeignExchangeOptionNotificationV02 }
*
*/
public MxTrea01200102 setFXOptnNtfctnV02(ForeignExchangeOptionNotificationV02 value) {
this.fxOptnNtfctnV02 = value;
return this;
}
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
}
@Override
public boolean equals(Object that) {
return EqualsBuilder.reflectionEquals(this, that);
}
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
@Override
public String getBusinessProcess() {
return BUSINESS_PROCESS;
}
@Override
public int getFunctionality() {
return FUNCTIONALITY;
}
@Override
public int getVariant() {
return VARIANT;
}
@Override
public int getVersion() {
return VERSION;
}
/**
* Creates the MX object parsing the raw content from the parameter XML
*
*/
public static MxTrea01200102 parse(String xml) {
return ((MxTrea01200102) MxReadImpl.parse(MxTrea01200102 .class, xml, _classes));
}
/**
* Creates the MX object parsing the raw content from the parameter XML with injected read implementation
* @since 9.0.1
*
* @param parserImpl an MX unmarshall implementation
*/
public static MxTrea01200102 parse(String xml, MxRead parserImpl) {
return ((MxTrea01200102) parserImpl.read(MxTrea01200102 .class, xml, _classes));
}
@Override
public String getNamespace() {
return NAMESPACE;
}
@Override
@SuppressWarnings("rawtypes")
public Class[] getClasses() {
return _classes;
}
/**
* Creates an MxTrea01200102 messages from its JSON representation.
* <p>
* For generic conversion of JSON into the corresponding MX instance
* see {@link AbstractMX#fromJson(String)}
*
* @since 7.10.2
*
* @param json a JSON representation of an MxTrea01200102 message
* @return
* a new instance of MxTrea01200102
*/
public final static MxTrea01200102 fromJson(String json) {
return AbstractMX.fromJson(json, MxTrea01200102 .class);
}
}
| [
"sebastian@prowidesoftware.com"
] | sebastian@prowidesoftware.com |
b955f3e1d93c595f7f01126b8ac45f02917278fc | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/41/org/apache/commons/lang/math/Fraction_toString_903.java | 12f1eb0ec126670bf529ff26ea089c0681ca61b4 | [] | 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 | 1,458 | java |
org apach common lang math
code fraction code code number code implement
store fraction accur
immut interoper method accept
code number code
author travi reeder
author stephen colebourn
author tim brien o'brien
author pete gieser
author scott ananian
version
fraction number compar fraction
fraction code string code
format numer denomin
code string code form fraction
overrid
string string tostr
string tostr
string tostr string buffer stringbuff
append numer getnumer
append
append denomin getdenomin string tostr
string tostr
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
8081e4d43557ae888e588cc22df665b483e01750 | 7dfda9db0b5eca9091c84e3cf4a0497858cac1cb | /src/mapred/org/apache/hadoop/mapred/BasicTypeSorterBase.java | 67656cb3e31f69ae555b304feb75f06caf66c332 | [
"LicenseRef-scancode-unknown",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | smiley0907/purnacache | bc7364a9fa292f7606671cb494c3896d74156c13 | 0370c725d061a7fb460f7088b3cf4c8c47916d3b | refs/heads/master | 2020-03-25T19:31:13.053441 | 2020-02-07T00:56:27 | 2020-02-07T00:56:27 | 144,087,062 | 0 | 0 | Apache-2.0 | 2018-08-09T01:40:37 | 2018-08-09T01:40:37 | null | UTF-8 | Java | false | false | 7,887 | 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.hadoop.mapred;
import java.io.DataOutputStream;
import java.io.IOException;
import org.apache.hadoop.io.DataOutputBuffer;
import org.apache.hadoop.io.OutputBuffer;
import org.apache.hadoop.io.RawComparator;
import org.apache.hadoop.io.SequenceFile.ValueBytes;
import org.apache.hadoop.util.Progress;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.io.SequenceFile.Sorter.RawKeyValueIterator;
import org.apache.hadoop.util.Progressable;
/**
* This class implements the sort interface using primitive int arrays as the
* data structures (that is why this class is called 'BasicType'SorterBase)
*/
abstract class BasicTypeSorterBase implements BufferSorter {
protected OutputBuffer keyValBuffer; // the buffer used for storing
// key/values
protected int[] startOffsets; // the array used to store the start offsets
// of
// keys in keyValBuffer
protected int[] keyLengths; // the array used to store the lengths of
// keys
protected int[] valueLengths; // the array used to store the value lengths
protected int[] pointers; // the array of startOffsets's indices. This will
// be sorted at the end to contain a sorted array of
// indices to offsets
protected RawComparator comparator; // the comparator for the map output
protected int count; // the number of key/values
// the overhead of the arrays in memory
// 12 => 4 for keyoffsets, 4 for keylengths, 4 for valueLengths, and
// 4 for indices into startOffsets array in the
// pointers array (ignored the partpointers list itself)
static private final int BUFFERED_KEY_VAL_OVERHEAD = 16;
static private final int INITIAL_ARRAY_SIZE = 5;
// we maintain the max lengths of the key/val that we encounter. During
// iteration of the sorted results, we will create a DataOutputBuffer to
// return the keys. The max size of the DataOutputBuffer will be the max
// keylength that we encounter. Expose this value to model memory more
// accurately.
private int maxKeyLength = 0;
private int maxValLength = 0;
// Reference to the Progressable object for sending KeepAlive
protected Progressable reporter;
// Implementation of methods of the SorterBase interface
//
public void configure(JobConf conf) {
comparator = conf.getOutputKeyComparator();
}
public void setProgressable(Progressable reporter) {
this.reporter = reporter;
}
public void addKeyValue(int recordOffset, int keyLength, int valLength) {
// Add the start offset of the key in the startOffsets array and the
// length in the keyLengths array.
if (startOffsets == null || count == startOffsets.length)
grow();
startOffsets[count] = recordOffset;
keyLengths[count] = keyLength;
if (keyLength > maxKeyLength) {
maxKeyLength = keyLength;
}
if (valLength > maxValLength) {
maxValLength = valLength;
}
valueLengths[count] = valLength;
pointers[count] = count;
count++;
}
public void setInputBuffer(OutputBuffer buffer) {
// store a reference to the keyValBuffer that we need to read during
// sort
this.keyValBuffer = buffer;
}
public long getMemoryUtilized() {
// the total length of the arrays + the max{Key,Val}Length (this will be
// the
// max size of the DataOutputBuffers during the iteration of the sorted
// keys).
if (startOffsets != null) {
return (startOffsets.length) * BUFFERED_KEY_VAL_OVERHEAD
+ maxKeyLength + maxValLength;
} else { // nothing from this yet
return 0;
}
}
public abstract RawKeyValueIterator sort();
public void close() {
// set count to 0; also, we don't reuse the arrays since we want to
// maintain
// consistency in the memory model
count = 0;
startOffsets = null;
keyLengths = null;
valueLengths = null;
pointers = null;
maxKeyLength = 0;
maxValLength = 0;
// release the large key-value buffer so that the GC, if necessary,
// can collect it away
keyValBuffer = null;
}
private void grow() {
int currLength = 0;
if (startOffsets != null) {
currLength = startOffsets.length;
}
int newLength = (int) (currLength * 1.1) + 1;
startOffsets = grow(startOffsets, newLength);
keyLengths = grow(keyLengths, newLength);
valueLengths = grow(valueLengths, newLength);
pointers = grow(pointers, newLength);
}
private int[] grow(int[] old, int newLength) {
int[] result = new int[newLength];
if (old != null) {
System.arraycopy(old, 0, result, 0, old.length);
}
return result;
}
} // BasicTypeSorterBase
// Implementation of methods of the RawKeyValueIterator interface. These
// methods must be invoked to iterate over key/vals after sort is done.
//
class MRSortResultIterator implements RawKeyValueIterator {
private int count;
private int[] pointers;
private int[] startOffsets;
private int[] keyLengths;
private int[] valLengths;
private int currStartOffsetIndex;
private int currIndexInPointers;
private OutputBuffer keyValBuffer;
private DataOutputBuffer key = new DataOutputBuffer();
private InMemUncompressedBytes value = new InMemUncompressedBytes();
public MRSortResultIterator(OutputBuffer keyValBuffer, int[] pointers,
int[] startOffsets, int[] keyLengths, int[] valLengths) {
this.count = pointers.length;
this.pointers = pointers;
this.startOffsets = startOffsets;
this.keyLengths = keyLengths;
this.valLengths = valLengths;
this.keyValBuffer = keyValBuffer;
}
public Progress getProgress() {
return null;
}
public DataOutputBuffer getKey() throws IOException {
int currKeyOffset = startOffsets[currStartOffsetIndex];
int currKeyLength = keyLengths[currStartOffsetIndex];
// reuse the same key
key.reset();
key.write(keyValBuffer.getData(), currKeyOffset, currKeyLength);
return key;
}
public ValueBytes getValue() throws IOException {
// value[i] is stored in the following byte range:
// startOffsets[i] + keyLengths[i] through valLengths[i]
value.reset(keyValBuffer, startOffsets[currStartOffsetIndex]
+ keyLengths[currStartOffsetIndex],
valLengths[currStartOffsetIndex]);
return value;
}
public boolean next() throws IOException {
if (count == currIndexInPointers)
return false;
currStartOffsetIndex = pointers[currIndexInPointers];
currIndexInPointers++;
return true;
}
public void close() {
return;
}
// An implementation of the ValueBytes interface for the in-memory value
// buffers.
private static class InMemUncompressedBytes implements ValueBytes {
private byte[] data;
int start;
int dataSize;
private void reset(OutputBuffer d, int start, int length)
throws IOException {
data = d.getData();
this.start = start;
dataSize = length;
}
public int getSize() {
return dataSize;
}
public void writeUncompressedBytes(DataOutputStream outStream)
throws IOException {
outStream.write(data, start, dataSize);
}
public void writeCompressedBytes(DataOutputStream outStream)
throws IllegalArgumentException, IOException {
throw new IllegalArgumentException(
"UncompressedBytes cannot be compressed!");
}
} // InMemUncompressedBytes
} // MRSortResultIterator
| [
"raghavendra.pra.yelisetty@hpe.com"
] | raghavendra.pra.yelisetty@hpe.com |
f5289ab795e722a6aa697eb7716aa93c829388dc | 1d64bf4b7cec44c8a12e4086ad2918e8df6dcc76 | /SpringRelatedJars/spring-framework-2.0.5/dist/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java | 412f23a4b3ab6683cab2d006ec810ef6ca4ec3b4 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | XerO00/AllJarFiles | 03472690fad55b5c2fcae530ac7de6294c54521e | d546337cfa29f4d33c3d3c5a4479a35063771612 | refs/heads/master | 2020-05-07T15:51:39.184855 | 2019-04-10T20:08:57 | 2019-04-10T20:08:57 | 180,655,268 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,865 | java | /*
* Copyright 2002-2007 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.aop.aspectj;
import org.springframework.aop.framework.AopConfigException;
import org.springframework.core.Ordered;
import org.springframework.util.Assert;
/**
* Implementation of {@link AspectInstanceFactory} that creates a new instance
* of the specified aspect class for every {@link #getAspectInstance()} call.
*
* @author Juergen Hoeller
* @since 2.0.4
*/
public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
private final Class aspectClass;
/**
* Create a new SimpleAspectInstanceFactory for the given aspect class.
* @param aspectClass the aspect class
*/
public SimpleAspectInstanceFactory(Class aspectClass) {
Assert.notNull(aspectClass, "Aspect class must not be null");
this.aspectClass = aspectClass;
}
/**
* Return the specified aspect class (never <code>null</code>).
*/
public final Class getAspectClass() {
return this.aspectClass;
}
public final Object getAspectInstance() {
try {
return this.aspectClass.newInstance();
}
catch (InstantiationException ex) {
throw new AopConfigException("Unable to instantiate aspect class [" + this.aspectClass.getName() + "]", ex);
}
catch (IllegalAccessException ex) {
throw new AopConfigException("Cannot access element class [" + this.aspectClass.getName() + "]", ex);
}
}
/**
* Determine the order for this factory's aspect instance,
* either an instance-specific order expressed through implementing
* the {@link org.springframework.core.Ordered} interface,
* or a fallback order.
* @see org.springframework.core.Ordered
* @see #getOrderForAspectClass
*/
public int getOrder() {
return getOrderForAspectClass(this.aspectClass);
}
/**
* Determine a fallback order for the case that the aspect instance
* does not express an instance-specific order through implementing
* the {@link org.springframework.core.Ordered} interface.
* <p>The default implementation simply returns <code>Ordered.LOWEST_PRECEDENCE</code>.
* @param aspectClass the aspect class
*/
protected int getOrderForAspectClass(Class aspectClass) {
return Ordered.LOWEST_PRECEDENCE;
}
}
| [
"prasannadandhalkar1@gmail.com"
] | prasannadandhalkar1@gmail.com |
68ae4be1e585a379d4004e73c3af061df0ae2c8c | 796e56f0f2dccf5013e200a0b3af4c270476a008 | /testapp/testapp-ejb/src/main/java/test/TestService.java | 2521510a2e5a9207db04fa8d8eba08b628542a74 | [] | no_license | veithen/sibbatchra | 2dc796c1ba01f5348f33715ba1c8fe41ff6df2eb | 0a4f4fc4b80380486ab5386c4ee91dc4f9b721cd | refs/heads/master | 2020-05-17T02:04:30.561063 | 2012-04-15T12:57:32 | 2012-04-15T12:57:32 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,953 | java | package test;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import javax.annotation.Resource;
import javax.ejb.EJBException;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.sql.DataSource;
@WebService
@Stateless
public class TestService {
@Resource
private QueueConnectionFactory qcf;
@Resource
private Queue queue;
@Resource
private DataSource ds;
@WebMethod
@WebResult(name="uuid")
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public String[] put(@WebParam(name="count") int count, @WebParam(name="duration") int duration, @WebParam(name="fail") boolean fail) {
try {
Connection c = ds.getConnection();
try {
QueueConnection qc = qcf.createQueueConnection();
try {
QueueSession session = qc.createQueueSession(false, 0);
try {
QueueSender sender = session.createSender(queue);
try {
PreparedStatement p = c.prepareStatement("insert into message (uuid) values (?)");
try {
List<String> results = new ArrayList<String>(count);
for (int i=0; i<count; i++) {
UUID uuid = UUID.randomUUID();
p.setString(1, uuid.toString());
p.addBatch();
sender.send(session.createObjectMessage(new TestMessage(uuid, duration, fail)));
results.add(uuid.toString());
}
p.executeBatch();
return results.toArray(new String[count]);
} finally {
p.close();
}
} finally {
sender.close();
}
} finally {
session.close();
}
} finally {
qc.close();
}
} finally {
c.close();
}
} catch (SQLException ex) {
throw new EJBException(ex);
} catch (JMSException ex) {
throw new EJBException(ex);
}
}
}
| [
"andreas.veithen@gmail.com"
] | andreas.veithen@gmail.com |
92e286a968c24c52d5cedf0701962b4eb7e96de7 | 43d7e8516c4ad0454e70eb73c33c3b6a74bed28e | /ev/endrov/flowBasic/math/EvOpImageMulImage.java | 13bb7d42915ff2ab1e10f83211a1791f85870ef9 | [] | no_license | kimno/Endrov | b98206c50875869c9f782849b4d60733a4f9321a | 1ebe9f75b24d6625508af3a891e250966658ea04 | refs/heads/master | 2021-01-21T01:20:39.514313 | 2012-07-09T11:45:12 | 2012-07-09T11:45:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,632 | java | /***
* Copyright (C) 2010 Johan Henriksson
* This code is under the Endrov / BSD license. See www.endrov.net
* for the full text and how to cite.
*/
package endrov.flowBasic.math;
import endrov.flow.EvOpSlice1;
import endrov.imageset.EvPixels;
import endrov.imageset.EvPixelsType;
import endrov.util.ProgressHandle;
/**
* A * B
* @author Johan Henriksson
*
*/
public class EvOpImageMulImage extends EvOpSlice1
{
public EvPixels exec1(ProgressHandle ph, EvPixels... p)
{
return EvOpImageMulImage.apply(p[0], p[1]);
}
/**
* Add images. Assumes same size and position
*/
public static EvPixels apply(EvPixels a, EvPixels b)
{
if(a.getType()==EvPixelsType.INT && b.getType()==EvPixelsType.INT)
{
//Should use the common higher type here
a=a.getReadOnly(EvPixelsType.INT);
b=b.getReadOnly(EvPixelsType.INT);
int w=a.getWidth();
int h=a.getHeight();
EvPixels out=new EvPixels(a.getType(),w,h);
int[] aPixels=a.getArrayInt();
int[] bPixels=b.getArrayInt();
int[] outPixels=out.getArrayInt();
for(int i=0;i<aPixels.length;i++)
outPixels[i]=aPixels[i]*bPixels[i];
return out;
}
else
{
//Should use the common higher type here
a=a.getReadOnly(EvPixelsType.DOUBLE);
b=b.getReadOnly(EvPixelsType.DOUBLE);
int w=a.getWidth();
int h=a.getHeight();
EvPixels out=new EvPixels(EvPixelsType.DOUBLE,w,h);
double[] aPixels=a.getArrayDouble();
double[] bPixels=b.getArrayDouble();
double[] outPixels=out.getArrayDouble();
for(int i=0;i<aPixels.length;i++)
outPixels[i]=aPixels[i]*bPixels[i];
return out;
}
}
} | [
"mahogny@areta.org"
] | mahogny@areta.org |
9a29ce268c4479864352e0364cd008cb6076365b | d60e287543a95a20350c2caeabafbec517cabe75 | /LACCPlus/Camel/10169_1.java | 0a20cd11f7046e285cab85d1c66e56ea15e496d2 | [
"MIT"
] | permissive | sgholamian/log-aware-clone-detection | 242067df2db6fd056f8d917cfbc143615c558b2c | 9993cb081c420413c231d1807bfff342c39aa69a | refs/heads/main | 2023-07-20T09:32:19.757643 | 2021-08-27T15:02:50 | 2021-08-27T15:02:50 | 337,837,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 557 | java | //,temp,DefaultUnitOfWork.java,279,288,temp,DefaultUnitOfWork.java,268,277
//,2
public class xxx {
@Override
public void afterRoute(Exchange exchange, Route route) {
if (log.isTraceEnabled()) {
log.trace("UnitOfWork afterRoute: {} for ExchangeId: {} with {}", route.getId(), exchange.getExchangeId(),
exchange);
}
if (synchronizations != null && !synchronizations.isEmpty()) {
UnitOfWorkHelper.afterRouteSynchronizations(route, exchange, synchronizations, log);
}
}
}; | [
"SHOSHIN\\sgholamian@shoshin.uwaterloo.ca"
] | SHOSHIN\sgholamian@shoshin.uwaterloo.ca |
f6e307b882c2ac49aea142ac7181157746bb54ed | 65dd72ae432058b1dcc21df69ba09988af5bb007 | /Geekq-tools-design-optimization/src/main/java/com/geekqtools/optimization/OptimizationApplication.java | ecabbbbbbea1bc9ce54d36e1c7830af82b115980 | [] | no_license | Charles2mx/GeekQ-Tools | 345bc25805e9774d2adeef183fba76d0ad902e58 | d660a8fe2e0ef7e1504a820fbd4af3252e58474a | refs/heads/master | 2021-03-21T09:38:56.589028 | 2019-05-30T07:46:49 | 2019-05-30T07:46:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 344 | java | package com.geekqtools.optimization;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class OptimizationApplication {
public static void main(String[] args) {
SpringApplication.run(OptimizationApplication.class, args);
}
}
| [
"qiurunze@youxin.com"
] | qiurunze@youxin.com |
33b529dd05fdefe12be378677d113a5434175569 | 5b2bc6e368a5357d009db3e1ded1967869c62900 | /src/main/java/com/luckydog/mapper/WyIncomeProjectMapper.java | 21028e1f75952b226b5aa58b312e22b942b57a60 | [] | no_license | wzy1142552920/family_service_platform | 0d68e1b0f884e970ec55505970f53340a3082409 | 5a68167215072baa1314faa6853f3b7d526c811f | refs/heads/master | 2023-02-05T04:14:51.623473 | 2020-11-22T15:50:47 | 2020-11-22T15:50:47 | 315,075,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 306 | java | package com.luckydog.mapper;
import com.luckydog.bean.WyIncomeProject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* 收入项目 Mapper 接口
* </p>
*
* @author luckydog
* @since 2020-07-14
*/
public interface WyIncomeProjectMapper extends BaseMapper<WyIncomeProject> {
}
| [
"wzy1142552920@outlook.com"
] | wzy1142552920@outlook.com |
50faec563ae266417e72c85d90dada0d88c96be9 | 2c8931832908c4cdd18b0eb5aa314300449588b7 | /src/Day023_StringManipulation/Task_84.java | 7fab54907f38ac8e67241f951b2065b9ca9932e8 | [] | no_license | KailibinuerAbuduaini/JavaStudyByKalbi | 46b3f4e4bb40230da73bf0b66309967e1afe40a2 | 37790f00294cb66ef61860bf91b5d7a73d5e0663 | refs/heads/master | 2020-09-08T22:40:30.172367 | 2020-05-03T22:22:27 | 2020-05-03T22:22:27 | 221,262,371 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 339 | java | package Day023_StringManipulation;
import java.util.Random;
public class Task_84 {
public static void main(String[] args) {
Random rn = new Random();
for (int i = 0; i < 10; i++) {
int coin = rn.nextInt(2);
if (coin == 1) {
System.out.println("Tails");
} else {
System.out.println("Heads");
}
}
}
}
| [
"myEmail@Gmail.com"
] | myEmail@Gmail.com |
360238d884a2bfbd9615dabadd466383f30adc91 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/27/27_47e6d0482bbac2dc903c8da6f1328e1289f884ef/LinkedNodeList/27_47e6d0482bbac2dc903c8da6f1328e1289f884ef_LinkedNodeList_s.java | 0eb8545ce2f6dbb375beb30c116ef3e92be71ed7 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,126 | 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.kahadb.util;
/**
* Provides a list of LinkedNode objects.
*
* @author chirino
*/
public class LinkedNodeList<T extends LinkedNode<T>> {
T head;
int size;
public LinkedNodeList() {
}
public boolean isEmpty() {
return head == null;
}
public void addLast(T node) {
node.linkToTail(this);
}
public void addFirst(T node) {
node.linkToHead(this);
}
public T getHead() {
return head;
}
public T getTail() {
return head.prev;
}
public void clear() {
while (head != null) {
head.unlink();
}
}
public void addLast(LinkedNodeList<T> list) {
if (list.isEmpty()) {
return;
}
if (head == null) {
reparent(list);
head = list.head;
list.head = null;
} else {
getTail().linkAfter(list);
}
}
public void addFirst(LinkedNodeList<T> list) {
if (list.isEmpty()) {
return;
}
if (head == null) {
reparent(list);
head = list.head;
list.head = null;
} else {
getHead().linkBefore(list);
}
}
public T reparent(LinkedNodeList<T> list) {
size += list.size;
T n = list.head;
do {
n.list = this;
n = n.next;
} while (n != list.head);
list.head = null;
list.size = 0;
return n;
}
/**
* Move the head to the tail and returns the new head node.
*
* @return
*/
public T rotate() {
return head = head.getNextCircular();
}
public int size() {
return size;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("[");
boolean first=true;
T cur = getHead();
while( cur!=null ) {
if( !first ) {
sb.append(", ");
}
sb.append(cur);
first=false;
cur = cur.getNext();
}
sb.append("]");
return sb.toString();
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
dba468a918354bb1a9f1bdd0a3c1fae09c4d4ddb | aa8bfeb580b9048ca17f0a57fc6478a3e456629a | /src/main/java/com/sun/corba/se/PortableActivationIDL/ORBPortInfoListHelper.java | 0a7643eee019b3985d241fd9a183b7b5903a8c6f | [] | no_license | KunkkaCoco/java7-source | 619f87ab0eca49cbeba09280e4d89e165dfc4ed2 | 1d59690d3f1f7c792b5de4f8a3941ad0326434f9 | refs/heads/master | 2016-09-05T12:03:58.162623 | 2014-07-17T04:31:23 | 2014-07-17T04:31:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,411 | java | package com.sun.corba.se.PortableActivationIDL;
/**
* com/sun/corba/se/PortableActivationIDL/ORBPortInfoListHelper.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
* Wednesday, December 18, 2013 6:35:01 PM PST
*/
/** A list of ORB and port information for a particular endpoint type.
*/
abstract public class ORBPortInfoListHelper
{
private static String _id = "IDL:PortableActivationIDL/ORBPortInfoList:1.0";
public static void insert (org.omg.CORBA.Any a, com.sun.corba.se.PortableActivationIDL.ORBPortInfo[] that)
{
org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
a.type (type ());
write (out, that);
a.read_value (out.create_input_stream (), type ());
}
public static com.sun.corba.se.PortableActivationIDL.ORBPortInfo[] extract (org.omg.CORBA.Any a)
{
return read (a.create_input_stream ());
}
private static org.omg.CORBA.TypeCode __typeCode = null;
synchronized public static org.omg.CORBA.TypeCode type ()
{
if (__typeCode == null)
{
__typeCode = com.sun.corba.se.PortableActivationIDL.ORBPortInfoHelper.type ();
__typeCode = org.omg.CORBA.ORB.init ().create_sequence_tc (0, __typeCode);
__typeCode = org.omg.CORBA.ORB.init ().create_alias_tc (com.sun.corba.se.PortableActivationIDL.ORBPortInfoListHelper.id (), "ORBPortInfoList", __typeCode);
}
return __typeCode;
}
public static String id ()
{
return _id;
}
public static com.sun.corba.se.PortableActivationIDL.ORBPortInfo[] read (org.omg.CORBA.portable.InputStream istream)
{
com.sun.corba.se.PortableActivationIDL.ORBPortInfo value[] = null;
int _len0 = istream.read_long ();
value = new com.sun.corba.se.PortableActivationIDL.ORBPortInfo[_len0];
for (int _o1 = 0;_o1 < value.length; ++_o1)
value[_o1] = com.sun.corba.se.PortableActivationIDL.ORBPortInfoHelper.read (istream);
return value;
}
public static void write (org.omg.CORBA.portable.OutputStream ostream, com.sun.corba.se.PortableActivationIDL.ORBPortInfo[] value)
{
ostream.write_long (value.length);
for (int _i0 = 0;_i0 < value.length; ++_i0)
com.sun.corba.se.PortableActivationIDL.ORBPortInfoHelper.write (ostream, value[_i0]);
}
}
| [
"chenweichao@news.cn"
] | chenweichao@news.cn |
b8cb93cee05aa642d36e3625bcdfb74ac4ea243a | 3c18b4ab3a20dab175dc48758835fb1a854a92c8 | /src-regressionTestManager/regressionTestManager/ioInvariantParser/PairwiseLinearBinaryFloatAssembler.java | 838e660f7816698677c7efa8e3a69b71a9a6a850 | [
"Apache-2.0"
] | permissive | lta-disco-unimib-it/BCT | 2c6bcf52894db8798d8ad14c7ebe066262dd22e4 | 1c7fcb52f42bae9f5169c94032ded919cb1c42c4 | refs/heads/master | 2020-08-24T16:32:03.904958 | 2019-10-22T20:30:10 | 2019-10-22T20:30:10 | 216,863,231 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,507 | java | /*******************************************************************************
* Copyright 2019 Fabrizio Pastore, Leonardo Mariani
*
* 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 regressionTestManager.ioInvariantParser;
import java.lang.reflect.Array;
import check.ioInvariantParser.Constants;
import sjm.parse.Assembler;
import sjm.parse.Assembly;
public class PairwiseLinearBinaryFloatAssembler extends Assembler {
private static Boolean evaluatePairwiseLinearBinaryFloat(Object y,Number a,Object x,Number b) {
int MAX = Array.getLength(y);
for(int i=0;i<MAX;i++) {
Number yn = (Number)Array.get(y,i);
Number xn = (Number)Array.get(x,i);
if(Math.abs( yn.floatValue() - ( a.floatValue()*xn.floatValue()+b.floatValue() ) ) > Constants.FLOAT_PRECISION )
return Boolean.FALSE;
}
return Boolean.TRUE;
}
public void workOn(Assembly ass) {
Target target = (Target)ass.getTarget();
//Number b = (Number)target.pop();
Number b = null;
try{
b = (Number)target.pop();
}catch(ArrayIndexOutOfBoundsException e) {
EvaluationRuntimeErrors.emptyStack();
return;
}
//Object x = (Object)target.pop();
Object x = null;
try{
x = (Object)target.pop();
}catch(ArrayIndexOutOfBoundsException e) {
EvaluationRuntimeErrors.emptyStack();
return;
}
Number a = (Number)target.pop();
//Object y = (Object)target.pop();
Object y = null;
try{
y = (Object)target.pop();
}catch(ArrayIndexOutOfBoundsException e) {
EvaluationRuntimeErrors.emptyStack();
return;
}
try{
EvaluationRuntimeErrors.log("PairWise Not implemented");
//target.push(evaluatePairwiseLinearBinaryFloat(y,a,x,b));
}catch (Exception e) {
EvaluationRuntimeErrors.evaluationError();
//target.push(Boolean.FALSE);
return;
}
}
} | [
"fabrizio.pastore@gmail.com"
] | fabrizio.pastore@gmail.com |
5a86cc31ed49ab79f19a612b3bbb3ac9f703676e | 99a15911a848676894f7cbae01d514d052f16043 | /ai-fsm/Chapter2_code/ch2_mycode/WestWorld_85_transition/src/FSM/MinerStates/Transition.java | 3f66ca8f769e7622c92102381f388e1825104d30 | [] | no_license | algerd/ai | 13f2adb6a7c7eea27e64c23912186513a9dc8baf | 4fa0212d4fe30106b497fd4f9c44399866185b76 | refs/heads/master | 2021-01-11T10:16:28.198572 | 2016-11-01T15:49:14 | 2016-11-01T15:49:14 | 72,550,742 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,252 | java |
package FSM.MinerStates;
import FSM.Miner;
public class Transition {
private Miner miner;
public Transition(Miner miner) {
this.miner = miner;
}
private void debugTransition(String state) {
System.out.println("++++++++ Transition to state " + state + " +++++++++");
}
/**
* If miner is fatigued then to sleep.
*/
public boolean toSleep() {
if (miner.isFatigued()) {
miner.changeState(new Sleep());
debugTransition("Sleep: Fatigue = " + miner.getFatigue());
return true;
}
return false;
}
/**
* If miner is hungry then to eat.
*/
public boolean toEating() {
if (miner.isHungry()) {
miner.changeState(new Eating());
debugTransition("Eating: Hunger = " + miner.getHunger());
return true;
}
return false;
}
/**
* If miner is thirsty then QuenchThirst.
*/
public boolean toQuenchThirst() {
if (miner.isThirst()) {
miner.changeState(new QuenchThirst());
debugTransition("QuenchThirst: Thirst = " + miner.getThirst());
return true;
}
return false;
}
/**
* Go home with any state and any condition.
*/
public boolean toGoHome() {
miner.changeState(new GoHome());
debugTransition("GoHome");
return true;
}
/**
* If miner has not full pockets and has not enough money then to dig nugget.
*/
public boolean toDigNugget() {
if (!miner.isPocketsFull() && !miner.isEnoughMoney()) {
miner.changeState(new DigNugget());
debugTransition("DigNugget: goldCarried = " + miner.getGoldCarried());
return true;
}
return false;
}
/**
* If the miner has full pockets then to VisitBank.
*/
public boolean toVisitBank() {
if (miner.isPocketsFull()) {
miner.changeState(new VisitBank());
debugTransition("VisitBank: moneyInBank = " + miner.getMoneyInBank());
return true;
}
return false;
}
}
| [
"algerd75@mail.ru"
] | algerd75@mail.ru |
67c83f42881078a0fdbb8e7aa69218ebd95b6fcb | 6f3cf9d2eaaded996271a0fd1a165b1df216655a | /JavaConcurrency/MultiTasking1/src/main/java/com/example/multitasking/multithreadingBasics/Locks/BankTransfer.java | 431f58303266c1bcf41189296f25e25ed0869114 | [] | no_license | nislamovs/Playground | 45529ff52407c90280fe30351d86b9b048a0f415 | a5b6158e89b96dbe99306a313576ab4ee6a1259d | refs/heads/master | 2023-07-21T14:29:34.927906 | 2022-11-09T14:11:01 | 2022-11-09T14:11:01 | 178,099,445 | 0 | 0 | null | 2023-07-07T21:39:10 | 2019-03-28T01:03:27 | Shell | UTF-8 | Java | false | false | 3,260 | java | package com.example.multitasking.multithreadingBasics.Locks;
import lombok.SneakyThrows;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
public class BankTransfer {
private int id;
private double balance;
private String accountName;
final Lock lock = new ReentrantLock();
public BankTransfer(int id, double balance, String accountName) {
this.id = id;
this.balance = balance;
this.accountName = accountName;
}
@SneakyThrows
public boolean withdraw (double amount) {
if (this.lock.tryLock()) {
Thread.sleep(100);
balance -= amount;
this.lock.unlock();
return true;
}
return false;
}
public boolean deposit (double amount) throws InterruptedException {
if(this.lock.tryLock()) {
Thread.sleep(100);
balance += amount;
this.lock.unlock();
return true;
}
return false;
}
public boolean transfer(BankTransfer to, double amount) throws InterruptedException {
if(withdraw(amount)) {
System.out.println("Withdrawing amount:" + amount + " from " + accountName);
if(to.deposit(amount)) {
System.out.println("Deposit amount: " + amount + " to :" + to.accountName);
return true;
} else {
System.out.println("Failed to acquire both locks; refunding : " + amount + " to :" + accountName);
while (!deposit(amount)) {
continue;
}
}
}
return false;
}
public static void main(String[] args) throws InterruptedException {
BankTransfer studentBankAccount = new BankTransfer(1, 50000, "StudentA");
BankTransfer universityBankAccount = new BankTransfer(1, 100000, "University");
System.out.println("Starting balance of account are: University: "
+ universityBankAccount.balance + " student: " + studentBankAccount.balance);
ExecutorService service = Executors.newFixedThreadPool(10);
Thread t = new Thread(() -> {
System.out.println(Thread.currentThread().getName() + " says :: Executing transfer");
try {
while (!studentBankAccount.transfer(universityBankAccount, 1000)) {
Thread.sleep(100);
continue;
}
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println(Thread.currentThread().getName() + " says :: Transfer is successful!");
});
for (int i = 0; i < 20; i++) {
service.submit(t);
}
service.shutdown();
while(!service.awaitTermination(24L, TimeUnit.HOURS)) {
System.out.println("Not Yet. still waiting for termination");
}
System.out.println("Ending balance of student account : " + studentBankAccount.balance
+ " University account: " + universityBankAccount.balance);
}
}
| [
"nizamiislamovs@gmail.com"
] | nizamiislamovs@gmail.com |
e1b6ab1f91124098beb479e4b1b0c2bfa1b820a5 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/org/apache/druid/metadata/MetadataStorageConnectorConfigTest.java | ed02469ab0cb6a184dfa25190dfc77c717060998 | [] | 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 | 2,391 | 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.druid.metadata;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import org.junit.Assert;
import org.junit.Test;
public class MetadataStorageConnectorConfigTest {
@Test
public void testEquals() throws IOException {
MetadataStorageConnectorConfig metadataStorageConnectorConfig = createMetadataStorageConfig(true, "testHost", 4000, "url", "user", "\"nothing\"");
MetadataStorageConnectorConfig metadataStorageConnectorConfig2 = createMetadataStorageConfig(true, "testHost", 4000, "url", "user", "\"nothing\"");
Assert.assertTrue(metadataStorageConnectorConfig.equals(metadataStorageConnectorConfig2));
Assert.assertTrue(((metadataStorageConnectorConfig.hashCode()) == (metadataStorageConnectorConfig2.hashCode())));
}
private static final ObjectMapper jsonMapper = new ObjectMapper();
@Test
public void testMetadataStorageConnectionConfigSimplePassword() throws Exception {
testMetadataStorageConnectionConfig(true, "host", 1234, "connectURI", "user", "\"nothing\"", "nothing");
}
@Test
public void testMetadataStorageConnectionConfigWithDefaultProviderPassword() throws Exception {
testMetadataStorageConnectionConfig(true, "host", 1234, "connectURI", "user", "{\"type\":\"default\",\"password\":\"nothing\"}", "nothing");
}
@Test
public void testDbcpProperties() throws Exception {
testDbcpPropertiesFile(true, "host", 1234, "connectURI", "user", "{\"type\":\"default\",\"password\":\"nothing\"}", "nothing");
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
8fb54e7acff49ad9ef2449ed650a1aa5ac32afde | 9103a7d70263a86e72945663cfa01254f62316ef | /jakarta/cassandra/src/main/java/org/jnosql/demo/endgame/jakarta/cassandra/function/PersonEvent.java | ad53c8ee45b30b71cfc83a1781243024d1d6caeb | [
"Apache-2.0"
] | permissive | ThirumlaDevi/nosql-endgame | 857c17af14fd62e30ca89df842c91cd3e3b79d3d | 3e18abef02001b19793c29ab2c1f58c1bcaa2979 | refs/heads/master | 2023-02-03T17:22:51.214593 | 2020-12-18T13:17:39 | 2020-12-18T13:17:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,679 | java | /*
* Copyright (c) 2017 Otávio Santana and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* and Apache License v2.0 which accompanies this distribution.
* The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
* and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.
*
* You may elect to redistribute this code under either of these licenses.
*
* Contributors:
*
* Otavio Santana
*/
package org.jnosql.demo.endgame.jakarta.cassandra.function;
import java.util.logging.Logger;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.event.Observes;
import jakarta.nosql.mapping.EntityPostPersit;
import jakarta.nosql.mapping.EntityPrePersist;
import jakarta.nosql.mapping.column.ColumnEntityPostPersist;
import jakarta.nosql.mapping.column.ColumnEntityPrePersist;
@ApplicationScoped
public class PersonEvent {
private static final Logger LOGGER = Logger.getLogger(PersonEvent.class.getName());
public void preEntity(@Observes EntityPrePersist event) {
LOGGER.info("Event to pre persistence" + event.getValue());
}
public void postEntity(@Observes EntityPostPersit event) {
LOGGER.info("Event to post persistence" + event.getValue());
}
public void preColumn(@Observes ColumnEntityPrePersist event) {
LOGGER.info("Event to pre Column entity" + event.getEntity());
}
public void postColumn(@Observes ColumnEntityPostPersist event) {
LOGGER.info("Event to post cassandra entity" + event.getEntity());
}
}
| [
"werner.keil@gmx.net"
] | werner.keil@gmx.net |
61b11179e5e635b0094a270470e9483d29dafc85 | 3a1609f0c9d03e2e4943b804e7bc080c94094235 | /src/main/java/com/lingyi/proxy/statics/interfaces/ManSupplies.java | 25feb1e52c2599ba6b63877acea63954cd042d00 | [] | no_license | chenweilong1022/DesignPatterns | 83d682922100c27ef09442e0f15b1d3854dc4ee5 | 76c2a23e95a5ada1c48d118beb52bb364838cd0d | refs/heads/master | 2022-12-29T23:06:05.630860 | 2020-08-15T06:57:32 | 2020-08-15T06:57:32 | 257,008,559 | 0 | 0 | null | 2020-10-13T21:19:31 | 2020-04-19T13:38:25 | Java | UTF-8 | Java | false | false | 197 | java | package com.lingyi.proxy.statics.interfaces;
/**
* @author chenweilong
* @email 1433471850@qq.com
* @date 2020-04-27 19:30
*/
public interface ManSupplies {
void buyDoll(Integer size);
}
| [
"chenweilong"
] | chenweilong |
33d374679a041daee49e673a5ab1f1f701c3ab0e | 94f687dec2238cc82ea12fc0c64b5d8c69cd0613 | /wicket-core/src/test/java/org/apache/wicket/markup/html/TransparentContainerWithAutoTransparentContainerPage.java | 287adb41e0a35e27d19efde865705ea0c01b0689 | [
"Apache-2.0",
"LicenseRef-scancode-generic-export-compliance",
"BSD-3-Clause",
"Apache-1.1",
"CDDL-1.0",
"MIT",
"X11"
] | permissive | freiheit-com/wicket | ed8e86ee967837255d889b922be6a41affcf352e | 9c552ff7cd64fd1f30c28feace46efc985741828 | refs/heads/master | 2021-01-18T19:09:11.374149 | 2015-08-13T08:29:14 | 2015-08-13T08:29:14 | 40,662,222 | 0 | 1 | Apache-2.0 | 2020-01-20T14:22:31 | 2015-08-13T14:09:58 | Java | UTF-8 | Java | false | false | 2,597 | 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.wicket.markup.html;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxFallbackLink;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.basic.Label;
/**
* A test page for triggering a StackOverflowError when updating a component inside a
* {@link TransparentWebMarkupContainer}, with Wicket auto-adding TWMC's.
*/
public class TransparentContainerWithAutoTransparentContainerPage extends WebPage
{
private static final long serialVersionUID = 1L;
/**
* Constructor.
*/
public TransparentContainerWithAutoTransparentContainerPage()
{
final Label label = new Label("label", "Label");
label.setOutputMarkupId(true);
add(label);
// Letting Wicket auto-add a TransparentWebMarkupContainer to the AJAX link (due to relative
// URL rewriting) causes a StackOverflowException
add(new AjaxLink<Void>("group1")
{
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget t)
{
}
});
// But you need two auto-added TWMCs to trigger the StackOverflowError
add(new AjaxLink<Void>("group2")
{
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget t)
{
}
});
// a non-AJAX click on this link passes the test case, an AJAX request
// fails with a StackOverflowError
add(new AjaxFallbackLink<Void>("link")
{
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target)
{
if (target != null)
target.add(label);
}
});
// if you add this TransparentWebMarkupContainer as first component in
// the page, the test passes
add(new TransparentWebMarkupContainer("twmc"));
}
}
| [
"martijn.dashorst@gmail.com"
] | martijn.dashorst@gmail.com |
d8aabe43e8aa88a9f3e63c30a612ef43919110e4 | 83593598f21cba234f08eca4dec44d2f73a6052d | /prj/otc/web-exchange/src/main/java/gnnt/MEBS/account/action/ErrorLoginAction.java | 801b1c26a0121b13f9a640c5d67a86c30b6bd389 | [
"Apache-2.0"
] | permissive | bigstar18/prjs | 23a04309a51b0372ddf6c391ee42270e640ec13c | c29da4d0892ce43e074d9e9831f1eedf828cd9d8 | refs/heads/master | 2021-05-31T19:55:16.217893 | 2016-06-24T02:35:31 | 2016-06-24T02:35:31 | 42,025,473 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 6,065 | java | package gnnt.MEBS.account.action;
import com.opensymphony.xwork2.ActionSupport;
import gnnt.MEBS.account.service.ErrorLoginService;
import gnnt.MEBS.base.query.jdbc.PageInfo;
import gnnt.MEBS.base.query.jdbc.QueryConditions;
import gnnt.MEBS.base.query.jdbc.QueryHelper;
import gnnt.MEBS.base.util.WebUtils;
import gnnt.MEBS.common.security.AclCtrl;
import gnnt.MEBS.config.constant.ActionConstant;
import gnnt.MEBS.config.constant.LogConstant;
import gnnt.MEBS.globalLog.model.OperateLog;
import gnnt.MEBS.globalLog.service.OperateLogService;
import gnnt.MEBS.packaging.action.util.EcsideJDBCUtil;
import gnnt.MEBS.packaging.action.util.EcsideUtil;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
@Component
@Scope("request")
public class ErrorLoginAction
extends ActionSupport
implements ServletRequestAware
{
private final transient Log logger = LogFactory.getLog(ErrorLoginAction.class);
@Autowired
@Qualifier("errorLoginService")
private ErrorLoginService errorLoginService;
@Autowired
@Qualifier("globalLogService")
private OperateLogService globalLogService;
protected HttpServletRequest request;
@Resource(name="returnValueMap")
protected Map<String, String> returnValueMap;
public void setServletRequest(HttpServletRequest request)
{
this.request = request;
}
protected void returnBaseMsg(PageInfo pageInfo)
{
this.request.setAttribute(ActionConstant.OLDPARAMS,
WebUtils.getParametersStartingWith(this.request, ActionConstant.GNNT_));
this.request.setAttribute(ActionConstant.PAGEINFO, pageInfo);
}
protected PageInfo getPageInfo(Map<String, Object> map)
{
return (PageInfo)map.get(ActionConstant.PAGEINFO);
}
protected QueryConditions getQueryConditions(Map<String, Object> map)
{
return (QueryConditions)map.get(ActionConstant.QUERYCONDITIONS);
}
public String getReturnValue()
{
String type = this.request.getParameter("type") != null ? this.request
.getParameter("type") : (String)this.request.getAttribute("type");
type = type == null ? "page" : type;
String returnValue = (String)this.returnValueMap.get(type);
this.logger.debug("returnValue:" + returnValue);
this.request.removeAttribute("type");
return returnValue;
}
public String getList()
{
this.logger.debug("enter list");
String sortName = (this.request.getParameter("sortName") != null) || ("".equals(this.request.getParameter("sortName"))) ? this.request
.getParameter("sortName") : "traderid,ip";
String sortOrder = this.request.getParameter("sortOrder") != null ? this.request
.getParameter("sortOrder") : "false";
QueryConditions qc = new QueryConditions();
qc.addCondition("traderid", "=", this.request.getParameter("traderid"));
List<Map<String, Object>> list = this.errorLoginService.getList(qc, null);
this.request.setAttribute("list", list);
return getReturnValue();
}
public String getExList()
{
this.logger.debug("enter list");
String sortName = (this.request.getParameter("sortName") != null) || ("".equals(this.request.getParameter("sortName"))) ? this.request
.getParameter("sortName") : "traderid";
String sortOrder = this.request.getParameter("sortOrder") != null ? this.request
.getParameter("sortOrder") : "false";
Map<String, Object> map = EcsideJDBCUtil.getQurey(this.request, sortName, new Boolean(sortOrder).booleanValue());
PageInfo pageInfo = getPageInfo(map);
QueryConditions qc = getQueryConditions(map);
Map oldParams = new HashMap();
oldParams =
QueryHelper.getMapFromRequest(this.request, ActionConstant.GNNT_);
List<Map<String, Object>> list = this.errorLoginService.getExList(qc, pageInfo);
EcsideUtil.setRowAttributes(this.request, pageInfo.getTotalRecords());
returnBaseMsg(pageInfo);
this.request.setAttribute("list", list);
return getReturnValue();
}
public String active()
{
String manyOrAll = this.request.getParameter("manyOrAll");
String[] ids = new String[0];
if ("many".equals(manyOrAll))
{
ids = this.request.getParameterValues("ids");
}
else
{
List<Map<String, Object>> list = this.errorLoginService.getExList(null, null);
if ((list != null) && (list.size() > 0))
{
ids = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
ids[i] = ((Map)list.get(i)).get("traderId").toString();
}
}
}
this.errorLoginService.delete(ids);
this.request.getSession().setAttribute(ActionConstant.RESULTMSG, "操作成功!");
this.request.getSession().setAttribute(ActionConstant.RESULTVAULE, Integer.valueOf(1));
String desc = "";
for (String id : ids) {
desc = desc + id + ",";
}
desc = "对登陆账号是:" + desc + "的解锁操作";
OperateLog operateLog = new OperateLog();
operateLog.setOperator(AclCtrl.getLogonID(this.request));
operateLog.setMark((String)this.request.getSession().getAttribute(ActionConstant.REGISTERID));
operateLog.setOperateContent(desc);
operateLog.setOperateDate(this.errorLoginService.getSysDate());
operateLog.setOperateIp(this.request.getRemoteAddr());
operateLog.setOperateLogType(3001);
operateLog.setOperatorType(LogConstant.OPERATORTYPE);
this.globalLogService.add(operateLog);
return getReturnValue();
}
}
| [
"hxx@hxx-PC"
] | hxx@hxx-PC |
e2093c72e6360748779683200e85f50dce534871 | d384dd7a9c4effc5e7ffe974f431d80923279295 | /src/main/java/org/motechproject/tujiokowe/service/HolidayService.java | a24d10347e23416d0d6f8cbe661648a872f3a45b | [
"Apache-2.0"
] | permissive | motech-implementations/tujiokowe | 7406d478de8322578ac38b69b4b0638a47c10e32 | 0133da6573d9b862b2a0ed737d6d72d99ef32266 | refs/heads/dev | 2022-12-22T11:52:10.255024 | 2020-10-31T18:54:13 | 2020-10-31T18:54:13 | 223,919,300 | 0 | 0 | Apache-2.0 | 2022-12-15T23:56:54 | 2019-11-25T10:15:03 | Java | UTF-8 | Java | false | false | 315 | java | package org.motechproject.tujiokowe.service;
import org.joda.time.LocalDate;
import org.motechproject.tujiokowe.domain.Holiday;
public interface HolidayService {
Holiday findByDate(LocalDate date);
Holiday create(Holiday holiday);
Holiday update(Holiday holiday);
void dataChanged(Holiday holiday);
}
| [
"pmuchowski@soldevelo.com"
] | pmuchowski@soldevelo.com |
4be51619f4e5261bd70fda5413a31f4c90e2c654 | 81fa3349ceaec8cbebc7fea8fbc719709cb292cc | /src/main/java/com/kouthair/jhipster/web/rest/errors/package-info.java | 977f9734ed77b610bf4743225fb7748a7448462f | [] | no_license | koutheirF/first-jhipster-application | cd4677be3f9e9b4250f3994d380569e623465f75 | 48f8f433197da487653868a8cbc77df89abd5629 | refs/heads/main | 2023-02-12T17:04:32.505676 | 2021-01-17T20:35:22 | 2021-01-17T20:35:22 | 330,481,378 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 196 | java | /**
* Specific errors used with Zalando's "problem-spring-web" library.
*
* More information on https://github.com/zalando/problem-spring-web
*/
package com.kouthair.jhipster.web.rest.errors;
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
abbdacb8c9dbb045e301a71f38a9efe459e10708 | 047241bdd3aa490c9b623dd5c3dcdb5775abc885 | /ejemplos/basicos/javase_fundamentos/src/org/cursofinalgrado/uapa/java/fundamentos/TresTiposVariables.java | b493eb32097786a083c3aa61a9d27978be3efb6c | [] | no_license | uniabierta-cursofinal/introduccion-java | 751625d838985f9a0452f879b451ca272c7e3dbe | 13a8691b54fe4434409833de1d2dfcf92d10d4c6 | refs/heads/master | 2016-09-06T13:31:25.358295 | 2015-06-06T21:16:53 | 2015-06-06T21:16:53 | 29,449,324 | 1 | 9 | null | null | null | null | UTF-8 | Java | false | false | 794 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package org.cursofinalgrado.uapa.java.fundamentos;
/**
*
* @author ecabrerar
*/
public class TresTiposVariables {
static String variableEstatica = "variable estatica";
String variableInstancia = "Variable Instancia";
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String variableLocal = "variable local ";
System.out.println("estatica = " + variableEstatica);
//System.out.println("variable instancia = " + variableInstancia);
System.out.println("local = " + variableLocal);
}
}
| [
"eudris@gmail.com"
] | eudris@gmail.com |
2ff4a779084a505c7f86bb21b179741008ab6837 | e82c1473b49df5114f0332c14781d677f88f363f | /MED-CLOUD/med-service/src/main/java/nta/med/service/ihis/handler/phys/PHY8002U01LoadFnInpHandler.java | b89e00aed553a67a5c4191787ae84dc34d82aacc | [] | no_license | zhiji6/mih | fa1d2279388976c901dc90762bc0b5c30a2325fc | 2714d15853162a492db7ea8b953d5b863c3a8000 | refs/heads/master | 2023-08-16T18:35:19.836018 | 2017-12-28T09:33:19 | 2017-12-28T09:33:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,243 | java | package nta.med.service.ihis.handler.phys;
import javax.annotation.Resource;
import nta.med.data.dao.medi.inp.Inp1001Repository;
import nta.med.core.infrastructure.socket.handler.ScreenHandler;
import nta.med.service.ihis.proto.PhysServiceProto;
import nta.med.service.ihis.proto.PhysServiceProto.PHY8002U01LoadFnInpRequest;
import nta.med.service.ihis.proto.PhysServiceProto.PHY8002U01LoadFnInpResponse;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import org.vertx.java.core.Vertx;
@Service
@Scope("prototype")
public class PHY8002U01LoadFnInpHandler
extends ScreenHandler<PhysServiceProto.PHY8002U01LoadFnInpRequest, PhysServiceProto.PHY8002U01LoadFnInpResponse> {
@Resource
private Inp1001Repository inp1001Repository;
@Override
@Transactional(readOnly=true)
public PHY8002U01LoadFnInpResponse handle(Vertx vertx, String clientId,
String sessionId, long contextId, PHY8002U01LoadFnInpRequest request)
throws Exception {
PhysServiceProto.PHY8002U01LoadFnInpResponse.Builder response = PhysServiceProto.PHY8002U01LoadFnInpResponse.newBuilder();
String hospCode = getHospitalCode(vertx, sessionId);
String jaewon = inp1001Repository.callFnInpLoadJaewonHoDong(hospCode, request.getBunho());
if(!StringUtils.isEmpty(jaewon)){
response.setValueJaewon(jaewon);
}
String last = inp1001Repository.callFnInpLoadLastIpwonDate(hospCode, request.getBunho());
if(!StringUtils.isEmpty(last)){
response.setValueLast(last);
}
return response.build();
}
} | [
"duc_nt@nittsusystem-vn.com"
] | duc_nt@nittsusystem-vn.com |
a11a610091d011d9f112eab6bc9a2019dfe4da26 | 1e425d8861c4016eb3e379c76f741ddb1d60ed8b | /com/p032a/p033a/C0887p.java | ac792ad40407feafca42c8fb2441fed0b41f3506 | [] | no_license | jayarambaratam/Soroush | 302ebd5b172e511354969120c89f4e82cdb297bf | 21e6b9a1ab415262db1f97a9a6e02a8827e01184 | refs/heads/master | 2021-01-17T22:50:54.415189 | 2016-02-04T10:57:55 | 2016-02-04T10:57:55 | 52,431,208 | 2 | 1 | null | 2016-02-24T09:42:40 | 2016-02-24T09:42:40 | null | UTF-8 | Java | false | false | 506 | java | package com.p032a.p033a;
import com.a.a.p$com.a.a.q;
import com.p032a.p033a.p037d.p046c.C0677s;
/* renamed from: com.a.a.p */
public final class C0887p<A, T> {
final /* synthetic */ C0884m f3093a;
private final C0677s<A, T> f3094b;
private final Class<T> f3095c;
C0887p(C0884m c0884m, C0677s<A, T> c0677s, Class<T> cls) {
this.f3093a = c0884m;
this.f3094b = c0677s;
this.f3095c = cls;
}
public q m5344a(A a) {
return new C0888q(this, a);
}
}
| [
"grayhat@kimo.com"
] | grayhat@kimo.com |
c436b718b961b8788d7eb28cfed0f6b7580c0bd6 | 0d26d715a0e66246d9a88d1ca77637c208089ec4 | /qtadmin/src/main/java/com/ylxx/qt/service/po/TradeFieldBean.java | b41b025cbc9b1ea05c974fe530878e90b70f946e | [] | no_license | lkp7321/sour | ff997625c920ddbc8f8bd05307184afc748c22b7 | 06ac40e140bad1dc1e7b3590ce099bc02ae065f2 | refs/heads/master | 2021-04-12T12:18:22.408705 | 2018-04-26T06:22:26 | 2018-04-26T06:22:26 | 126,673,285 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,542 | java | package com.ylxx.qt.service.po;
import java.io.Serializable;
public class TradeFieldBean implements Serializable {
private static final long serialVersionUID = 1L;
private String ctp_id; // CTPID
private String investor_id; // 投资者代码
private String instrument_id; // 合约代码
private String direction; // 买卖方向
private String offSet_flag; // 开平标志
private double price; // 价格
private int volumn; // 数量
private String trade_date; // 成交时期
private double profit; // 成交盈亏
private String td;
private double sum;
private String product_id;
private double sumc;
private String week; //每周
private double week_account; //每周盈亏
private String trade_id; //交易编号
private String exchange_id; //交易所编码
private String hedge; //投保
private String tradeTime; //交易时间
private String tradingDay; //交易日期
private String order_id; //委托订单编号
private String sys_id; //系统编号
private String tradeDateTime; //交易详细时间
private String updateTime; //数据更新时间
private String openTride_id; //开仓成交号
private double closeProfit; //盈亏
private double closeProfitBydate; //逐日盯市平仓盈亏
public double getCloseProfitBydate() {
return closeProfitBydate;
}
public void setCloseProfitBydate(double closeProfitBydate) {
this.closeProfitBydate = closeProfitBydate;
}
public double getCloseProfit() {
return closeProfit;
}
public void setCloseProfit(double closeProfit) {
this.closeProfit = closeProfit;
}
public String getTrade_id() {
return trade_id;
}
public void setTrade_id(String trade_id) {
this.trade_id = trade_id;
}
public String getExchange_id() {
return exchange_id;
}
public void setExchange_id(String exchange_id) {
this.exchange_id = exchange_id;
}
public String getHedge() {
return hedge;
}
public void setHedge(String hedge) {
this.hedge = hedge;
}
public String getOrder_id() {
return order_id;
}
public void setOrder_id(String order_id) {
this.order_id = order_id;
}
public String getSys_id() {
return sys_id;
}
public void setSys_id(String sys_id) {
this.sys_id = sys_id;
}
public String getUpdateTime() {
return updateTime;
}
public void setUpdateTime(String updateTime) {
this.updateTime = updateTime;
}
public String getOpenTride_id() {
return openTride_id;
}
public void setOpenTride_id(String openTride_id) {
this.openTride_id = openTride_id;
}
public String getTradeTime() {
return tradeTime;
}
public void setTradeTime(String tradeTime) {
this.tradeTime = tradeTime;
}
public String getTradingDay() {
return tradingDay;
}
public void setTradingDay(String tradingDay) {
this.tradingDay = tradingDay;
}
public String getTradeDateTime() {
return tradeDateTime;
}
public void setTradeDateTime(String tradeDateTime) {
this.tradeDateTime = tradeDateTime;
}
public TradeFieldBean(){
}
public String getCtp_id() {
return ctp_id;
}
public void setCtp_id(String ctp_id) {
this.ctp_id = ctp_id;
}
public String getInvestor_id() {
return investor_id;
}
public void setInvestor_id(String investor_id) {
this.investor_id = investor_id;
}
public String getInstrument_id() {
return instrument_id;
}
public void setInstrument_id(String instrument_id) {
this.instrument_id = instrument_id;
}
public String getDirection() {
return direction;
}
public void setDirection(String direction) {
this.direction = direction;
}
public String getOffSet_flag() {
return offSet_flag;
}
public void setOffSet_flag(String offSet_flag) {
this.offSet_flag = offSet_flag;
}
public double getPrice() {
return price;
}
public void setPrice(double price) {
this.price = price;
}
public int getVolumn() {
return volumn;
}
public void setVolumn(int volumn) {
this.volumn = volumn;
}
public String getTrade_date() {
return trade_date;
}
public void setTrade_date(String trade_date) {
this.trade_date = trade_date;
}
public double getProfit() {
return profit;
}
public void setProfit(double profit) {
this.profit = profit;
}
public String getTd() {
return td;
}
public void setTd(String td) {
this.td = td;
}
public double getSum() {
return sum;
}
public void setSum(double sum) {
this.sum = sum;
}
public String getProduct_id() {
return product_id;
}
public void setProduct_id(String product_id) {
this.product_id = product_id;
}
public double getSumc() {
return sumc;
}
public void setSumc(double sumc) {
this.sumc = sumc;
}
public String getWeek() {
return week;
}
public void setWeek(String week) {
this.week = week;
}
public double getWeek_account() {
return week_account;
}
public void setWeek_account(double week_account) {
this.week_account = week_account;
}
@Override
public String toString() {
return "TradeFieldBean [ctp_id=" + ctp_id + ", investor_id="
+ investor_id + ", instrument_id=" + instrument_id
+ ", direction=" + direction + ", offSet_flag=" + offSet_flag
+ ", price=" + price + ", volumn=" + volumn + ", trade_date="
+ trade_date + ", profit=" + profit + ", td=" + td + ", sum="
+ sum + ", product_id=" + product_id + ", sumc=" + sumc
+ ", week=" + week + ", week_account=" + week_account + "]";
}
}
| [
"lz13037330@163.com"
] | lz13037330@163.com |
05101cb4842ae7edc2770592237676aaf22972e4 | 7200960674ffcaaf3939adfcf0258170e878622d | /app/src/main/java/cn/yuyun/yymy/ui/home/member/CallbackAdapter.java | da0c633e838d4b556477801acd1201230d92fb81 | [] | no_license | lizhongze123/YuYunMeiYe | f6742665d7d5cbcc5534ab50bf127178ae0f2634 | 69b82644ab945641c9f5ff15b73c8441c4b502fd | refs/heads/master | 2021-05-12T00:15:33.411942 | 2019-03-21T09:13:14 | 2019-03-21T09:13:14 | 117,528,299 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,399 | java | package cn.yuyun.yymy.ui.home.member;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import cn.lzz.utils.DateTimeUtils;
import cn.lzz.utils.TextViewUtils;
import cn.yuyun.yymy.R;
import cn.yuyun.yymy.http.result.ResultCallback;
import cn.yuyun.yymy.http.result.ResultCommunication;
import cn.yuyun.yymy.ui.home.unboxing.FillContent;
import cn.yuyun.yymy.utils.GlideHelper;
/**
* @author
* @desc
* @date
*/
public class CallbackAdapter extends RecyclerView.Adapter<CallbackAdapter.ViewHolder>{
private int RESOURCE_ID = R.layout.item_communication;
private Context mContext;
private List<ResultCallback> dataList = new ArrayList<>();
OnMyItemClickListener onItemClickListener;
public CallbackAdapter(Context context){
this.mContext = context;
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View rootView = LayoutInflater.from(mContext).inflate(RESOURCE_ID, parent, false);
return new ViewHolder(rootView, onItemClickListener);
}
@Override
public void onBindViewHolder(ViewHolder holder, int position) {
holder.bindItem(dataList.get(position), position);
}
@Override
public int getItemCount() {
return dataList.size();
}
public void notifyDataSetChanged(List<ResultCallback> dataList) {
this.dataList.clear();
this.dataList.addAll(dataList);
notifyDataSetChanged();
}
public void addAll(List<ResultCallback> dataList) {
this.dataList.addAll(dataList);
notifyDataSetChanged();
}
public void clear() {
this.dataList.clear();
notifyDataSetChanged();
}
class ViewHolder extends RecyclerView.ViewHolder {
private CallbackAdapter.OnMyItemClickListener onItemClickListener;
@BindView(R.id.rl)
RelativeLayout rl;
@BindView(R.id.iv_avatar)
ImageView ivAvatar;
@BindView(R.id.tv_name)
TextView tvName;
@BindView(R.id.tv_vip)
TextView tvVip;
@BindView(R.id.tv_store)
TextView tvStore;
@BindView(R.id.tv_content)
TextView tvContent;
@BindView(R.id.tv_time)
TextView tvTime;
@BindView(R.id.rv)
RecyclerView rv;
ViewHolder(View view, CallbackAdapter.OnMyItemClickListener onItemClickListener) {
super(view);
ButterKnife.bind(this, view);
this.onItemClickListener = onItemClickListener;
}
private void bindItem(final ResultCallback bean, final int position) {
if (null != bean.pictures) {
List<String> list = new ArrayList<>();
for (int i = 0; i < bean.pictures.size(); i++) {
if (bean.pictures.get(i).startsWith(mContext.getString(R.string.HTTP))) {
list.add(bean.pictures.get(i));
} else {
list.add(mContext.getString(R.string.image_url_prefix) + bean.pictures.get(i));
}
}
rv.setVisibility(View.VISIBLE);
FillContent.fillComunicationImgList(list, mContext, rv, true, true);
} else {
rv.setVisibility(View.GONE);
}
if(!TextUtils.isEmpty(bean.createPersonAvatar)){
if(bean.createPersonAvatar.startsWith(mContext.getString(R.string.HTTP))){
GlideHelper.displayImage(mContext, bean.createPersonAvatar,ivAvatar);
}else{
GlideHelper.displayImage(mContext, mContext.getString(R.string.image_url_prefix) + bean.createPersonAvatar, ivAvatar);
}
}
TextViewUtils.setTextOrEmpty(tvName, bean.createPersonName);
if(!TextUtils.isEmpty(bean.createPersonPosition)){
tvVip.setVisibility(View.VISIBLE);
TextViewUtils.setTextOrEmpty(tvVip, "(" + bean.createPersonPosition + ")");
}else{
tvVip.setVisibility(View.GONE);
}
TextViewUtils.setTextOrEmpty(tvStore, "门店:" + bean.spName);
TextViewUtils.setTextOrEmpty(tvContent, bean.content);
TextViewUtils.setTextOrEmpty(tvTime, DateTimeUtils.StringToDate(bean.visTime, DateTimeUtils.FORMAT_DATETIME_UI, DateTimeUtils.FORMAT_DATETIME_TWO));
rl.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onItemClickListener != null) {
onItemClickListener.onItemClick(v, bean, position);
}
}
});
}
}
public void setOnItemClickListener(OnMyItemClickListener onItemClickListener) {
this.onItemClickListener = onItemClickListener;
}
public interface OnMyItemClickListener {
void onItemClick(View view, ResultCallback bean, int position);
}
} | [
"793223793@qq.com"
] | 793223793@qq.com |
0d7ff57b07361bca6012356af3cf347824151bbb | d71e879b3517cf4fccde29f7bf82cff69856cfcd | /ExtractedJars/Ibotta_com.ibotta.android/javafiles/android/support/transition/ChangeBounds$ViewBounds.java | d7e6a54e68a0a467f0765e4ab8a065e20d34aa3b | [
"MIT"
] | permissive | Andreas237/AndroidPolicyAutomation | b8e949e072d08cf6c6166c3f15c9c63379b8f6ce | c1ed10a2c6d4cf3dfda8b8e6291dee2c2a15ee8a | refs/heads/master | 2020-04-10T02:14:08.789751 | 2019-05-16T19:29:11 | 2019-05-16T19:29:11 | 160,739,088 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,436 | java | // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) annotate safe
package android.support.transition;
import android.graphics.PointF;
import android.view.View;
// Referenced classes of package android.support.transition:
// ChangeBounds, ViewUtils
private static class ChangeBounds$ViewBounds
{
private void setLeftTopRightBottom()
{
ViewUtils.setLeftTopRightBottom(mView, mLeft, mTop, mRight, mBottom);
// 0 0:aload_0
// 1 1:getfield #23 <Field View mView>
// 2 4:aload_0
// 3 5:getfield #27 <Field int mLeft>
// 4 8:aload_0
// 5 9:getfield #29 <Field int mTop>
// 6 12:aload_0
// 7 13:getfield #31 <Field int mRight>
// 8 16:aload_0
// 9 17:getfield #33 <Field int mBottom>
// 10 20:invokestatic #38 <Method void ViewUtils.setLeftTopRightBottom(View, int, int, int, int)>
mTopLeftCalls = 0;
// 11 23:aload_0
// 12 24:iconst_0
// 13 25:putfield #40 <Field int mTopLeftCalls>
mBottomRightCalls = 0;
// 14 28:aload_0
// 15 29:iconst_0
// 16 30:putfield #42 <Field int mBottomRightCalls>
// 17 33:return
}
void setBottomRight(PointF pointf)
{
mRight = Math.round(pointf.x);
// 0 0:aload_0
// 1 1:aload_1
// 2 2:getfield #50 <Field float PointF.x>
// 3 5:invokestatic #56 <Method int Math.round(float)>
// 4 8:putfield #31 <Field int mRight>
mBottom = Math.round(pointf.y);
// 5 11:aload_0
// 6 12:aload_1
// 7 13:getfield #59 <Field float PointF.y>
// 8 16:invokestatic #56 <Method int Math.round(float)>
// 9 19:putfield #33 <Field int mBottom>
mBottomRightCalls = mBottomRightCalls + 1;
// 10 22:aload_0
// 11 23:aload_0
// 12 24:getfield #42 <Field int mBottomRightCalls>
// 13 27:iconst_1
// 14 28:iadd
// 15 29:putfield #42 <Field int mBottomRightCalls>
if(mTopLeftCalls == mBottomRightCalls)
//* 16 32:aload_0
//* 17 33:getfield #40 <Field int mTopLeftCalls>
//* 18 36:aload_0
//* 19 37:getfield #42 <Field int mBottomRightCalls>
//* 20 40:icmpne 47
setLeftTopRightBottom();
// 21 43:aload_0
// 22 44:invokespecial #61 <Method void setLeftTopRightBottom()>
// 23 47:return
}
void setTopLeft(PointF pointf)
{
mLeft = Math.round(pointf.x);
// 0 0:aload_0
// 1 1:aload_1
// 2 2:getfield #50 <Field float PointF.x>
// 3 5:invokestatic #56 <Method int Math.round(float)>
// 4 8:putfield #27 <Field int mLeft>
mTop = Math.round(pointf.y);
// 5 11:aload_0
// 6 12:aload_1
// 7 13:getfield #59 <Field float PointF.y>
// 8 16:invokestatic #56 <Method int Math.round(float)>
// 9 19:putfield #29 <Field int mTop>
mTopLeftCalls = mTopLeftCalls + 1;
// 10 22:aload_0
// 11 23:aload_0
// 12 24:getfield #40 <Field int mTopLeftCalls>
// 13 27:iconst_1
// 14 28:iadd
// 15 29:putfield #40 <Field int mTopLeftCalls>
if(mTopLeftCalls == mBottomRightCalls)
//* 16 32:aload_0
//* 17 33:getfield #40 <Field int mTopLeftCalls>
//* 18 36:aload_0
//* 19 37:getfield #42 <Field int mBottomRightCalls>
//* 20 40:icmpne 47
setLeftTopRightBottom();
// 21 43:aload_0
// 22 44:invokespecial #61 <Method void setLeftTopRightBottom()>
// 23 47:return
}
private int mBottom;
private int mBottomRightCalls;
private int mLeft;
private int mRight;
private int mTop;
private int mTopLeftCalls;
private View mView;
ChangeBounds$ViewBounds(View view)
{
// 0 0:aload_0
// 1 1:invokespecial #21 <Method void Object()>
mView = view;
// 2 4:aload_0
// 3 5:aload_1
// 4 6:putfield #23 <Field View mView>
// 5 9:return
}
}
| [
"silenta237@gmail.com"
] | silenta237@gmail.com |
591098e3f2d0a01a0c71edccb2bbd991a27ea201 | 471a1d9598d792c18392ca1485bbb3b29d1165c5 | /jadx-MFP/src/main/java/com/google/android/gms/measurement/internal/zzed.java | 21627b1a07010cf2241851240ab4ff71677429e2 | [] | no_license | reed07/MyPreferencePal | 84db3a93c114868dd3691217cc175a8675e5544f | 365b42fcc5670844187ae61b8cbc02c542aa348e | refs/heads/master | 2020-03-10T23:10:43.112303 | 2019-07-08T00:39:32 | 2019-07-08T00:39:32 | 129,635,379 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,401 | java | package com.google.android.gms.measurement.internal;
import android.os.RemoteException;
import java.util.concurrent.atomic.AtomicReference;
final class zzed implements Runnable {
private final /* synthetic */ boolean zzaeg;
private final /* synthetic */ zzk zzaqn;
private final /* synthetic */ zzeb zzasl;
private final /* synthetic */ AtomicReference zzasm;
zzed(zzeb zzeb, AtomicReference atomicReference, zzk zzk, boolean z) {
this.zzasl = zzeb;
this.zzasm = atomicReference;
this.zzaqn = zzk;
this.zzaeg = z;
}
public final void run() {
synchronized (this.zzasm) {
try {
zzaj zzd = this.zzasl.zzasf;
if (zzd == null) {
this.zzasl.zzgt().zzjg().zzby("Failed to get user properties");
this.zzasm.notify();
return;
}
this.zzasm.set(zzd.zza(this.zzaqn, this.zzaeg));
this.zzasl.zzcy();
this.zzasm.notify();
} catch (RemoteException e) {
try {
this.zzasl.zzgt().zzjg().zzg("Failed to get user properties", e);
this.zzasm.notify();
} catch (Throwable th) {
this.zzasm.notify();
throw th;
}
}
}
}
}
| [
"anon@ymous.email"
] | anon@ymous.email |
09db21e78bcd8abd22a67284db0fb026fd4bfa97 | a35069023ad6e57b9ec0f42a09b169b4ef451a27 | /src/main/java/com/wynprice/boneophone/types/BassGuitarType.java | d5e030eba3ecad582bc2e6f3a65239185e66b928 | [] | no_license | Wyn-Price/SkeletalBand | d9b03fc5473b430fadc45b92a977ba0ebdbeb543 | 313ac90822243db916cba3090db61afbe24b283c | refs/heads/master | 2020-03-31T01:06:36.192027 | 2018-11-01T18:37:38 | 2018-11-01T18:37:38 | 151,767,063 | 3 | 2 | null | 2018-10-17T06:50:42 | 2018-10-05T19:15:00 | Java | UTF-8 | Java | false | false | 4,005 | java | package com.wynprice.boneophone.types;
import com.wynprice.boneophone.ModelHandler;
import com.wynprice.boneophone.SoundHandler;
import com.wynprice.boneophone.entity.MusicalSkeleton;
import com.wynprice.boneophone.midi.MidiStream;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.SoundEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
public class BassGuitarType extends MusicianType {
private float prevNotePosition;
private float notePosition;
private float handTicksToHit;
private float rotation;
private int rightHandHitTicks;
private int hitDirection = 1;
private float hitRotation;
public BassGuitarType(MusicalSkeleton entity, MusicianTypeFactory factoryType) {
super(entity, factoryType);
}
@Override
public void playTones(MidiStream.MidiTone[] tones) {
if(this.entity.world.isRemote) {
for (MidiStream.MidiTone tone : tones) {
this.playRawSound(SoundHandler.BASS_OCTAVES[tone.getOctave()], this.entity.getVolume() * 2F, (float) Math.pow(2.0D, (tone.getKey() / 12.0D)));
}
}
}
@SideOnly(Side.CLIENT)
private void playRawSound(SoundEvent event, float volume, float pitch) {
Minecraft.getMinecraft().getSoundHandler().playSound(new PositionedSoundRecord(event, SoundCategory.RECORDS, volume, pitch, this.entity.getPosition()));
}
@Override
public boolean shouldStopAiTasks() {
return true;
}
@Override
public void renderExtras(float partialTicks) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.pushMatrix();
GlStateManager.scale(1.5F, 1.5F, 1.5F);
GlStateManager.rotate(180, 1, 0, 0);
GlStateManager.translate(-0.05F, -0.32F, 0.15F);
GlStateManager.rotate(-20F, 0, 1F, 0);
GlStateManager.rotate(-65F, 0, 0, 1F);
Minecraft.getMinecraft().getRenderItem().renderItem(new ItemStack(Blocks.STONE), ModelHandler.GUITAR_MODEL);
GlStateManager.popMatrix();
}
@Override
public void onTick() {
this.handTicksToHit++;
this.rightHandHitTicks++;
super.onTick();
}
@Override
public void setAnimationsFromTones(MidiStream.MidiTone[] tones) {
if(tones.length == 0) {
return;
}
this.prevNotePosition = notePosition;
this.notePosition = tones[0].getPosition();
this.handTicksToHit = 0;
this.hitDirection *= -1;
this.rightHandHitTicks = 0;
}
@Override
public void setEntityAnimations(float partialTicks, ModelBase model) {
if(model instanceof ModelBiped) {
ModelBiped biped = (ModelBiped) model;
biped.bipedRightArm.rotateAngleX = (float) Math.toRadians(-40F);
biped.bipedLeftArm.rotateAngleX = (float) Math.toRadians(-60F);
int ticksToHit = 2;//Faster ticks to hit
if(this.handTicksToHit <= ticksToHit) {
this.rotation = (float) (Math.toRadians(55F) * (this.prevNotePosition + (this.notePosition - this.prevNotePosition) * (this.handTicksToHit + partialTicks) / ticksToHit));
}
if(this.rightHandHitTicks <= ticksToHit) {
this.hitRotation = (float) (Math.toRadians(5F) * (-2F * this.hitDirection * ((this.rightHandHitTicks + partialTicks) / ticksToHit)));
}
biped.bipedLeftArm.rotateAngleZ = this.rotation;
biped.bipedRightArm.rotateAngleZ = this.hitRotation;
}
}
}
| [
"wynprice999@gmail.com"
] | wynprice999@gmail.com |
f252440357746c34ee3c212367becde986694f1e | 51394231ea039236457c73dbcdb5997d9cf2d6a1 | /commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/AbstractRandomAccessStreamContent.java | 7d24c9f489de17628e2137d873b72b61190716b7 | [
"Apache-2.0"
] | permissive | wso2/wso2-commons-vfs | 9c43b32ecdd572c459df32e6a5a7fbfeb1f8459c | 94238737553d356f6612331e9c1508af04c1f965 | refs/heads/2.2.x | 2023-08-21T16:37:18.991696 | 2023-08-17T06:37:01 | 2023-08-17T06:37:01 | 17,473,456 | 40 | 72 | Apache-2.0 | 2023-08-17T06:35:14 | 2014-03-06T10:01:42 | Java | UTF-8 | Java | false | false | 3,368 | 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.commons.vfs2.provider;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import org.apache.commons.vfs2.util.RandomAccessMode;
/**
* Implements the part usable for all stream-based random access.
*/
public abstract class AbstractRandomAccessStreamContent extends AbstractRandomAccessContent {
protected AbstractRandomAccessStreamContent(final RandomAccessMode mode) {
super(mode);
}
protected abstract DataInputStream getDataInputStream() throws IOException;
@Override
public byte readByte() throws IOException {
return getDataInputStream().readByte();
}
@Override
public char readChar() throws IOException {
return getDataInputStream().readChar();
}
@Override
public double readDouble() throws IOException {
return getDataInputStream().readDouble();
}
@Override
public float readFloat() throws IOException {
return getDataInputStream().readFloat();
}
@Override
public int readInt() throws IOException {
return getDataInputStream().readInt();
}
@Override
public int readUnsignedByte() throws IOException {
return getDataInputStream().readUnsignedByte();
}
@Override
public int readUnsignedShort() throws IOException {
return getDataInputStream().readUnsignedShort();
}
@Override
public long readLong() throws IOException {
return getDataInputStream().readLong();
}
@Override
public short readShort() throws IOException {
return getDataInputStream().readShort();
}
@Override
public boolean readBoolean() throws IOException {
return getDataInputStream().readBoolean();
}
@Override
public int skipBytes(final int n) throws IOException {
return getDataInputStream().skipBytes(n);
}
@Override
public void readFully(final byte[] b) throws IOException {
getDataInputStream().readFully(b);
}
@Override
public void readFully(final byte[] b, final int off, final int len) throws IOException {
getDataInputStream().readFully(b, off, len);
}
@Override
public String readUTF() throws IOException {
return getDataInputStream().readUTF();
}
@Override
public InputStream getInputStream() throws IOException {
return getDataInputStream();
}
@Override
public void setLength(final long newLength) throws IOException {
throw new UnsupportedOperationException();
}
}
| [
"nandika@wso2.com"
] | nandika@wso2.com |
95e0dadcdaff2670697cd68dc719474afc6ab986 | 205135c18cd7e264d5a3abd49a096930c7453970 | /src/com/xfashion/client/notepad/event/RequestCheckNotepadPositionHandler.java | 818aee94d4dc6c0c2f1e07667dbf24b621f186ba | [] | no_license | archmage74/x-fashion | 25f34b2fb0a76b04ae921de95facf6d576c4eaae | a72f6facd0716e3b74b42cfdeea1000d2e7fe338 | refs/heads/master | 2020-04-09T10:37:37.353269 | 2012-10-21T16:57:55 | 2012-10-21T16:57:55 | 3,690,556 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 190 | java | package com.xfashion.client.notepad.event;
public interface RequestCheckNotepadPositionHandler {
void onRequestCheckNotepadPosition(RequestCheckNotepadPositionEvent event);
}
| [
"werner.puff@gmx.net"
] | werner.puff@gmx.net |
14c41def204c1c9ba9b912d5551f7c68f08e4d56 | ccaa535498e3daa911985bc3fc0e396eaf56e226 | /spider-55haitao-crawler/src/main/java/com/haitao55/spider/crawler/core/callable/custom/kipling/KiplingCallaber.java | 30bade3c2b81c86e238b2165f7d4312e86646beb | [] | no_license | github4n/spider-55ht | d871aad6e51f7cf800032351137b4b3f12d6e86e | 7c59cda6b5b514139bd69cff2b914e0815f53cd6 | refs/heads/master | 2020-03-29T22:44:38.527732 | 2018-02-01T07:53:30 | 2018-02-01T07:53:30 | 150,438,349 | 1 | 0 | null | 2018-09-26T14:19:14 | 2018-09-26T14:19:14 | null | UTF-8 | Java | false | false | 6,846 | java | package com.haitao55.spider.crawler.core.callable.custom.kipling;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Callable;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.ClientProtocolException;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import com.alibaba.fastjson.JSONObject;
import com.haitao55.spider.common.http.Crawler;
import com.haitao55.spider.common.http.HttpException;
import com.haitao55.spider.common.http.HttpMethod;
import com.haitao55.spider.common.utils.Currency;
import com.haitao55.spider.crawler.common.cache.ProxyCache;
import com.haitao55.spider.crawler.core.callable.context.Context;
import com.haitao55.spider.crawler.core.model.Image;
import com.haitao55.spider.crawler.core.model.Proxy;
import com.haitao55.spider.crawler.core.model.Url;
import com.haitao55.spider.crawler.utils.JsoupUtils;
public class KiplingCallaber implements Callable<JSONObject> {
private static final String stock_flag = "In Stock";
private static final String color_flag = "dwvar_{}_color=";
private String param;
private String productId;
private Context context;
public String getParam() {
return param;
}
public void setParam(String param) {
this.param = param;
}
public String getProductId() {
return productId;
}
public void setProductId(String productId) {
this.productId = productId;
}
public Context getContext() {
return context;
}
public void setContext(Context context) {
this.context = context;
}
public KiplingCallaber(String param, String productId, Context context) {
this.param = param;
this.productId = productId;
this.context = context;
}
@Override
public JSONObject call() throws Exception {
//pics
JSONObject json = new JSONObject();
String content = crawler_package(param);
Document doc = JsoupUtils.parse(content);
List<Image> pics = new ArrayList<Image>();
//sku color id
String sku_color_id = StringUtils.EMPTY;
String color_flag_temp = StringUtils.replacePattern(color_flag, "\\{\\}", productId);
//default colorid
String colorId = StringUtils.substringAfter(param, color_flag_temp);
Elements colorElemets = doc.select("ul.swatches.Color li a");
if(CollectionUtils.isNotEmpty(colorElemets)){
for (Element element : colorElemets) {
String skuColorId = element.attr("data-colorid");
//匹配当前颜色对应的属性值
if(StringUtils.containsIgnoreCase(colorId, skuColorId)){
sku_color_id = skuColorId;
String color = element.attr("title");
String switch_img = element.attr("style");
switch_img = StringUtils.substringBetween(switch_img, "background: url(", ")");
//json put
json.put("color", color);
json.put("colorId", skuColorId);
json.put("switch_img", switch_img);
}
}
}
String salePrice = StringUtils.EMPTY;
String origPrice = StringUtils.EMPTY;
String save = StringUtils.EMPTY;
Elements elements = doc.select("span.price-sales");
if (CollectionUtils.isNotEmpty(elements)) {
salePrice = elements.get(0).text();
}
elements = doc.select("span.price-standard");
if (CollectionUtils.isNotEmpty(elements)) {
origPrice = elements.get(0).text();
}
String unit = getCurrencyValue(salePrice);// 得到货币代码
salePrice = salePrice.replaceAll("[$,]", "");
origPrice = origPrice.replaceAll("[$,]", "");
if (StringUtils.isBlank(origPrice)) {
origPrice = salePrice;
}
if (StringUtils.isBlank(salePrice)) {
salePrice = origPrice;
}
if (StringUtils.isBlank(origPrice)
|| Float.valueOf(origPrice) < Float.valueOf(salePrice)) {
origPrice = salePrice;
}
if (StringUtils.isBlank(save)) {
save = Math.round((1 - Float.valueOf(salePrice) / Float.valueOf(origPrice)) * 100)
+ "";// discount
}
int stock_status = 1;
Elements stockElements = doc.select("p.in-stock-msg");
if(!StringUtils.containsIgnoreCase(stockElements.text(), stock_flag)){
stock_status = 0;
}
//json put
json.put("sale_price", salePrice);
json.put("orign_price", origPrice);
json.put("save", save);
json.put("unit", unit);
json.put("stock_status", stock_status);
images_package(pics,sku_color_id,productId,context);
//images
json.put(sku_color_id, pics);
return json;
}
/**
* 封装图片地址
* @param pics
* @param image_preffix
* @param sku_color_id
* @param productId
*/
private void images_package(List<Image> pics, String sku_color_id, String productId
,Context context) {
String[] params = new String[]{"A","B","C","D"};
String image_suffix ="http://s7d9.scene7.com/is/image/KiplingBrand/xxlarge/";
for (String attr : params) {
String imageUrl = image_suffix+productId+"_"+sku_color_id+"_"+attr+".jpg";
boolean flag = image_exists(imageUrl,context);
if(flag){
pics.add(new Image(imageUrl));
}
}
}
/**
* 验证图片是否存在
* @param image_url
* @param context
* @return
*/
private boolean image_exists(String image_url, Context context) {
try {
Url url = context.getUrl();
String proxyRegionId = url.getTask().getProxyRegionId();
if(StringUtils.isBlank(proxyRegionId)){
Crawler.create().timeOut(15000).url(image_url).proxy(false).resultAsString();
}else{
Proxy proxy = ProxyCache.getInstance().pickup(proxyRegionId, true);
String ip = proxy.getIp();
int port = proxy.getPort();
Crawler.create().timeOut(20000).url(image_url).proxy(true).proxyAddress(ip)
.proxyPort(port).resultAsString();
}
return true;
} catch (ClientProtocolException e) {
} catch (HttpException e) {
if(200!=e.getStatus()){
return false;
}
} catch (IOException e) {
}
return false;
}
/**
* get 货币
*
* @param val
* @return
*/
private static String getCurrencyValue(String val) {
String currency = StringUtils.substring(val, 0, 1);
String unit = StringUtils.EMPTY;
unit = Currency.codeOf(currency).name();
return unit;
}
private String crawler_package(String url) throws ClientProtocolException, HttpException, IOException {
String content = StringUtils.EMPTY;
String proxyRegionId = context.getUrl().getTask().getProxyRegionId();
if(StringUtils.isBlank(proxyRegionId)){
content = Crawler.create().timeOut(15000).url(url).method(HttpMethod.GET.getValue())
.resultAsString();
}else{
Proxy proxy = ProxyCache.getInstance().pickup(proxyRegionId, true);
String proxyAddress=proxy.getIp();
int proxyPort=proxy.getPort();
content = Crawler.create().timeOut(15000).url(url).method(HttpMethod.GET.getValue())
.proxy(true).proxyAddress(proxyAddress).proxyPort(proxyPort).resultAsString();
}
return content;
}
}
| [
"liusz_ok@126.com"
] | liusz_ok@126.com |
f9f834c826ce1b539d8a8520ee44093d12bb36a6 | 9bf6dee1407f112cebf42443e0f492e89d0d3fbc | /gameserver/src/org/openaion/gameserver/network/aion/serverpackets/SM_STANCE_STATE.java | a7e6c3370ed78072b8aea6f504111382c3dcb8df | [] | no_license | vavavr00m/aion-source | 6caef6738fee6d4898fcb66079ea63da46f5c9c0 | 8ce4c356d860cf54e5f3fe4a799197725acffc3b | refs/heads/master | 2021-01-10T02:08:43.965463 | 2011-08-22T10:47:12 | 2011-08-22T10:47:12 | 50,949,918 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 685 | java | package org.openaion.gameserver.network.aion.serverpackets;
import java.nio.ByteBuffer;
import org.openaion.gameserver.network.aion.AionConnection;
import org.openaion.gameserver.network.aion.AionServerPacket;
/**
*
* @author kamui
*
*/
public class SM_STANCE_STATE extends AionServerPacket
{
private int playerObjectId;
private int stateId;
public SM_STANCE_STATE(int playerObjectId, int stateId)
{
this.playerObjectId = playerObjectId;
this.stateId = stateId;
}
/**
* {@inheritDoc}
*/
@Override
protected void writeImpl(AionConnection con, ByteBuffer buf)
{
writeD(buf, playerObjectId);
writeC(buf, stateId);
}
}
| [
"tomulescu@gmail.com"
] | tomulescu@gmail.com |
bacbbf076dfe30a969bc6f184631ae158ded3758 | ce0a5947851c94f9ca674a32010624e0d50d31ac | /src/org/cakelab/jdoxml/impl/graphhandler/EdgeRelationMapper.java | 2280d3b8b2a382547b39b873e0f78ab192aa038f | [] | no_license | homacs/org.cakelab.jdoxml | fbd1413c134a6688f7baa139e32d45e11cfcb3e4 | 6f1db859d1d1461423db837172f5b1af441fe77b | refs/heads/master | 2023-04-03T22:58:54.421098 | 2023-03-23T18:58:26 | 2023-03-23T18:58:26 | 203,998,179 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 768 | java | package org.cakelab.jdoxml.impl.graphhandler;
import java.util.HashMap;
import java.util.Map;
import org.cakelab.jdoxml.api.IChildNode;
class EdgeRelationMapper {
private Map<String, IChildNode.NodeRelation> m_map = new HashMap<String, IChildNode.NodeRelation>();
EdgeRelationMapper() {
m_map.put("public-inheritance", IChildNode.NodeRelation.PublicInheritance);
m_map.put("protected-inheritance", IChildNode.NodeRelation.ProtectedInheritance);
m_map.put("private-inheritance", IChildNode.NodeRelation.PrivateInheritance);
m_map.put("usage", IChildNode.NodeRelation.Usage);
m_map.put("template-instance", IChildNode.NodeRelation.TemplateInstance);
}
public IChildNode.NodeRelation stringToNodeRelation(String nrStr) {
return m_map.get(nrStr);
}
} | [
"homac@strace.org"
] | homac@strace.org |
cdb4ca04a063954e969d52930b0081706208cbc4 | 1921bcd990174f55303670969a0e2f3351de7b4a | /Sesion-08/Ejemplo-02/codigo/src/main/java/com/example/demo/controlador/CasaController.java | b5ce0c900d8b34b752d41f6581cd2c153a0125b3 | [] | no_license | beduExpert/Java-Standard-Edition-Intermedio | e0616a9227fc68ec8fd4e2cd125d38d1368a38fd | 78e8c8e48edcc035968432bb1709411f2410eb4b | refs/heads/master | 2020-09-09T00:03:44.428024 | 2019-12-14T02:11:41 | 2019-12-14T02:11:41 | 221,283,227 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 766 | java | package com.example.demo.controlador;
import com.example.demo.modelo.Casa;
import com.example.demo.negocio.CasaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("/casa")
public class CasaController {
private final CasaService service;
@Autowired
public CasaController(CasaService service) {
this.service = service;
}
@RequestMapping(value = "", method = RequestMethod.POST)
public void guardarCasa(@RequestBody Casa casa) {
service.guardar(casa);
}
@RequestMapping(value = "/{id}", method = RequestMethod.GET)
public Casa getCasa(@PathVariable Long id) {
return service.buscarPorId(id);
}
}
| [
"amonmar2000@hotmail.com"
] | amonmar2000@hotmail.com |
4704d308f45093bbe91da95cdc111165ead8e5f7 | bf7b4c21300a8ccebb380e0e0a031982466ccd83 | /middlewareConcepts2014-master/Assignment3/lib/jacorb-3.4/src/generated/org/omg/CosCollection/EqualityCollectionHelper.java | 205526dd3089ad0539972bde03657ac41d8ef33c | [] | no_license | Puriakshat/Tuberlin | 3fe36b970aabad30ed95e8a07c2f875e4912a3db | 28dcf7f7edfe7320c740c306b1c0593a6c1b3115 | refs/heads/master | 2021-01-19T07:30:16.857479 | 2014-11-06T18:49:16 | 2014-11-06T18:49:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,488 | java | package org.omg.CosCollection;
/**
* Generated from IDL interface "EqualityCollection".
*
* @author JacORB IDL compiler V @project.version@
* @version generated at 27-May-2014 20:14:30
*/
public abstract class EqualityCollectionHelper
{
private volatile static org.omg.CORBA.TypeCode _type;
public static org.omg.CORBA.TypeCode type ()
{
if (_type == null)
{
synchronized(EqualityCollectionHelper.class)
{
if (_type == null)
{
_type = org.omg.CORBA.ORB.init().create_interface_tc("IDL:omg.org/CosCollection/EqualityCollection:1.0", "EqualityCollection");
}
}
}
return _type;
}
public static void insert (final org.omg.CORBA.Any any, final org.omg.CosCollection.EqualityCollection s)
{
any.insert_Object(s);
}
public static org.omg.CosCollection.EqualityCollection extract(final org.omg.CORBA.Any any)
{
return narrow(any.extract_Object()) ;
}
public static String id()
{
return "IDL:omg.org/CosCollection/EqualityCollection:1.0";
}
public static EqualityCollection read(final org.omg.CORBA.portable.InputStream in)
{
return narrow(in.read_Object(org.omg.CosCollection._EqualityCollectionStub.class));
}
public static void write(final org.omg.CORBA.portable.OutputStream _out, final org.omg.CosCollection.EqualityCollection s)
{
_out.write_Object(s);
}
public static org.omg.CosCollection.EqualityCollection narrow(final org.omg.CORBA.Object obj)
{
if (obj == null)
{
return null;
}
else if (obj instanceof org.omg.CosCollection.EqualityCollection)
{
return (org.omg.CosCollection.EqualityCollection)obj;
}
else if (obj._is_a("IDL:omg.org/CosCollection/EqualityCollection:1.0"))
{
org.omg.CosCollection._EqualityCollectionStub stub;
stub = new org.omg.CosCollection._EqualityCollectionStub();
stub._set_delegate(((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate());
return stub;
}
else
{
throw new org.omg.CORBA.BAD_PARAM("Narrow failed");
}
}
public static org.omg.CosCollection.EqualityCollection unchecked_narrow(final org.omg.CORBA.Object obj)
{
if (obj == null)
{
return null;
}
else if (obj instanceof org.omg.CosCollection.EqualityCollection)
{
return (org.omg.CosCollection.EqualityCollection)obj;
}
else
{
org.omg.CosCollection._EqualityCollectionStub stub;
stub = new org.omg.CosCollection._EqualityCollectionStub();
stub._set_delegate(((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate());
return stub;
}
}
}
| [
"puri.akshat@gmail.com"
] | puri.akshat@gmail.com |
b4fabba8d88363b94e4aba29470eefb071b16da1 | 3a9b1c122d1d9583f569ad85778da469a35462a9 | /src/com/company/doandlearn/algorithmization/sorting/Task1.java | 860d74231c63b22f71fe760a54093868563dd2e5 | [] | no_license | Alexey-Che/EPAM_test_tasks | ed609175d2394d29e0429c446878b09465c9f7ea | 1b4c6296e6176a1639b63a2ac89f0666b8ff5c07 | refs/heads/master | 2023-03-17T15:03:24.023037 | 2021-03-06T05:06:46 | 2021-03-06T05:06:46 | 344,821,666 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 866 | java | package com.company.doandlearn.algorithmization.sorting;
import java.util.Arrays;
public class Task1 {
public static void main(String[] args) {
Task1 k = new Task1();
k.go();
}
public void go() {
int[] a = {0,1,2,3,4};
int[] b = {10,11,12};
int k = 2;
int m = a.length;
int n = b.length;
int y = m+n;
/* int[] aCopy = Arrays.copyOf(a, a.length+b.length);
System.out.println(Arrays.toString(aCopy));*/
int[] c = new int[y];
int index = 0;
for (int i = 0; i < m; i++) {
if (i !=k) {
c[index++] = a[i];
} else {
c[index++] = a[i];
for (int value : b) {
c[index++] = value;
}
}
}
System.out.println(Arrays.toString(c));
}
}
| [
"lexa.36484@gmail.com"
] | lexa.36484@gmail.com |
42e25d2323fac23722a28608eb914cfab24ab747 | 0b0f5aaf4fc19c1e6b2f4729756d1f08345f3f7a | /src/test/java/xutils/http/HttpTest.java | 8baa1195114cf07dfc1d7ba6d7b7745d8c915aba | [] | no_license | spiderII/commonUtils | bc6ffd2f5aacdaffeb07df563293d12626c0e35a | 769f7ddd8f534eae8f434a84f05d6268d5ec784b | refs/heads/master | 2020-11-26T05:01:47.399714 | 2018-01-19T09:39:58 | 2018-01-19T09:39:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,103 | java | package xutils.http;
import org.junit.Test;
import xutils.http.listener.HttpDownloadListener;
/**
* Http模块测试
* <p>
* Created by xuan on 17/8/1.
*/
public class HttpTest {
@Test
public void testGet() {
HttpResponse httpResponse = HttpUtils.get("http://www.baidu.com", null);
if (httpResponse.isStatusOk()) {
System.out.println("请求成功");
}
System.out.println("++++++++++httpResponse:" + httpResponse);
}
@Test
public void testGetDowload() {
HttpResponse httpResponse = HttpUtils.getDowload("http://www.baidu.com", null, "/Users/xuan/Desktop/haha", new HttpDownloadListener() {
@Override
public void callBack(long count, long current, boolean isFinish) {
System.out.println("++++++++++进度:count[" + count + "]current[" + current + "]isFinish[" + isFinish + "]");
}
});
if (httpResponse.isStatusOk()) {
System.out.println("下载成功");
}
System.out.println("++++++++++httpResponse:" + httpResponse);
}
}
| [
"test"
] | test |
22c176c7165121de8435b8fe8738240e111d3e8d | be7b04889fc3c54121de1ac14cf8f988d4e585c8 | /src/main/java/com/vrv/service/impl/TeamRelationService.java | 27ca9999edeb2da51d86f204dd96fa2852578fb1 | [] | no_license | socket123/14SouXiangmu | 650d0e06db99ac6b5a78b51447e96ba90b9c3f59 | 1df87d3951a22eeee956668cc76e49c856185209 | refs/heads/master | 2020-12-02T22:50:19.733232 | 2017-07-04T07:51:46 | 2017-07-04T07:51:46 | 96,190,620 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,593 | java | package com.vrv.service.impl;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.vrv.entity.SSUser;
import com.vrv.entity.TransportTeam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vrv.entity.TeamRelation;
import com.vrv.mapper.TeamRelationMapper;
import com.vrv.service.BaseService;
@Service
public class TeamRelationService extends BaseService<TeamRelation> {
@Autowired
TransportTeamService teamService;
@Autowired
TeamRelationMapper teamRelationMapper;
public int deleteByTeam(int teamId, int type) {
return teamRelationMapper.deleteByTeam(teamId, type);
}
public List<TeamRelation> selectByTeam(int teamId, int type) {
return teamRelationMapper.selectByTeam(teamId, type);
}
public int findTeamRelation(TeamRelation teamRelation) {
return teamRelationMapper.findTeamRelation(teamRelation);
}
// 根据状态 查询
public List<TeamRelation> selectByTeam_type(TeamRelation teamRelation){
return teamRelationMapper.selectByTeam_type(teamRelation);
}
//增加
public int insertSelective(TeamRelation teamRelation){
return teamRelationMapper.insertSelective(teamRelation);
}
// 查询
public List<TeamRelation> teamRelationList(SSUser user){
List<TeamRelation> teamRelationList = new ArrayList<TeamRelation>();
if(null != user.getId()) {
TransportTeam transportTeam = teamService.selectTeamByUserId(user.getId());
if(null != transportTeam){
TeamRelation teamRelation = new TeamRelation();
teamRelation.setTeamId(transportTeam.getId());
teamRelationList = selectByTeam_type(teamRelation);//1范围,2资源,3负责人、4承运小队
}
}
return teamRelationList;
}
// 保存 民工 id
public Map<String,String> worker_list_save(SSUser user ){
Map<String,String> maps = new HashMap<String,String>();
List<TeamRelation> teamRelationList = teamRelationList(user);
if(null != teamRelationList && teamRelationList.size() > 0){
String stes = "";
for (TeamRelation teamRelation : teamRelationList){
stes += teamRelation.getOtherId()+",";
}
Integer is = teamRelationList.size()+1;
float count = (float)1/is;
DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
String filesize = df.format(count);//返回的是String类型的
maps.put("id",","+stes);
maps.put("count",filesize);
return maps;
}
maps.put("id",null);
maps.put("count",null);
return maps;
}
}
| [
"jslygchenyu@126.com"
] | jslygchenyu@126.com |
5734744b766f42b874a8831b5be69740d082cd39 | 61602d4b976db2084059453edeafe63865f96ec5 | /com/xunlei/downloadprovider/personal/lixianspace/b/c.java | 94ef231d9905e0544d44879dff2c4baf12fd3ae5 | [] | no_license | ZoranLi/thunder | 9d18fd0a0ec0a5bb3b3f920f9413c1ace2beb4d0 | 0778679ef03ba1103b1d9d9a626c8449b19be14b | refs/heads/master | 2020-03-20T23:29:27.131636 | 2018-06-19T06:43:26 | 2018-06-19T06:43:26 | 137,848,886 | 12 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,642 | java | package com.xunlei.downloadprovider.personal.lixianspace.b;
import android.os.Handler;
import android.os.Looper;
import com.xunlei.downloadlib.parameter.TorrentInfo;
import com.xunlei.downloadprovider.member.login.LoginHelper;
import com.xunlei.downloadprovider.member.payment.a.j;
import com.xunlei.downloadprovider.personal.lixianspace.bean.LXTaskInfo;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONObject;
/* compiled from: LXSpaceDataHelper */
public final class c {
Handler a;
List<a> b;
public int c;
public int d;
/* compiled from: LXSpaceDataHelper */
private static class a {
private static final c a = new c();
}
private c() {
this.a = new Handler(Looper.getMainLooper());
this.c = 0;
this.d = 0;
LoginHelper.a().a(new d(this));
}
public final void a(a aVar) {
if (aVar != null) {
if (this.b == null) {
this.b = new ArrayList(4);
}
if (!this.b.contains(aVar)) {
this.b.add(aVar);
}
}
}
public final void b(a aVar) {
if (!(aVar == null || this.b == null)) {
if (!this.b.isEmpty()) {
this.b.remove(aVar);
}
}
}
final void a(LXTaskInfo lXTaskInfo, int i, String str) {
this.a.post(new e(this, lXTaskInfo, i, str));
}
final void a(List<LXTaskInfo> list, int i, String str) {
this.a.post(new f(this, list, i, str));
}
final void a(int i, String str) {
this.a.post(new g(this, i, str));
}
final void a(int i, String str, long j) {
this.a.post(new h(this, j, i, str));
}
final void a(int i, String str, List<LXTaskInfo> list) {
this.a.post(new i(this, list, i, str));
}
final void a(int i, String str, TorrentInfo torrentInfo) {
this.a.post(new j(this, torrentInfo, i, str));
}
final void a(String str, int i, String str2, LXTaskInfo lXTaskInfo) {
this.a.post(new k(this, str, i, str2, lXTaskInfo));
}
public final int a() {
return !j.a().a.l() ? 0 : this.c;
}
final void a(JSONObject jSONObject) {
if (jSONObject != null) {
int optInt = jSONObject.optInt("max_count");
jSONObject = jSONObject.optInt("used_count");
if (jSONObject >= null) {
this.c = jSONObject;
}
if (optInt >= 0) {
this.d = optInt;
}
a(null, "");
}
}
public final boolean b() {
return this.d > 0;
}
}
| [
"lizhangliao@xiaohongchun.com"
] | lizhangliao@xiaohongchun.com |
fcdb60812b0f62f931114818cac06b60f0d72dcb | c9f808b3316a96a4d0a1555a36d6ec47ccb8fd9b | /src/jdo/sys/SYSLoginStructureTool.java | 289253ab58a78672c293de58ebebec678d0f66d9 | [] | no_license | levonyang/proper-his | f4c19b4ce46b213bf637be8e18bffa3758c64ecd | 2fdcb956b0c61e8be35e056d52a97d4890cbea3f | refs/heads/master | 2022-01-05T09:17:14.716629 | 2018-04-08T01:04:21 | 2018-04-08T01:04:21 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,096 | java | package jdo.sys;
import com.dongyang.jdo.TJDODBTool;
import com.dongyang.data.TParm;
import java.util.Map;
/**
*
* <p>Title: 登录专用程序加载树数据采集对象(穿透技术)</p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2008</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class SYSLoginStructureTool extends TJDODBTool{
/**
* 得到主程列表根据权限(Tree专用)
* @param roleCode String 权限编号
* @return TParm
*/
public TParm getStructureTreeForRole(String roleCode)
{
return new TParm(getStructureTreeForRole("SYS_SUBSYSTEM",roleCode));
}
/**
* 得到主程列表根据权限(Tree专用)
* @param groupID String 组编号
* @param roleCode String 权限编号
* @return Map
*/
public Map getStructureTreeForRole(String groupID,String roleCode)
{
if(isClientlink())
return (Map)callServerMethod(groupID,roleCode);
TParm parm = new TParm(getStructureForRole(groupID,roleCode));
int count = parm.getCount();
for(int i = 0;i < count;i++)
{
String id = parm.getValue("ID",i);
parm.addData("CHILD",getStructureTreeForRole(id,roleCode));
}
return parm.getData();
}
/**
* 得到主程列表根据权限
* @param groupID String 组编号
* @param roleCode String 权限编号
* @return Map
*/
public Map getStructureForRole(String groupID,String roleCode)
{
String sql =
"SELECT GROUP_ID,ID,CHN_DESC AS NAME,ENG_DESC AS ENNAME,TYPE,PARENT_ID,STATE,DATA" +
" FROM SYS_DICTIONARY,SYS_ROLE_POPEDOM" +
" WHERE GROUP_ID='" + groupID + "'" +
" AND GROUP_ID=SYS_ROLE_POPEDOM.GROUP_CODE" +
" AND ID=SYS_ROLE_POPEDOM.CODE" +
" AND SYS_ROLE_POPEDOM.ROLE_CODE='" + roleCode + "'" +
" ORDER BY SEQ";
return select(sql);
}
}
| [
"licx@ACA803A0.ipt.aol.com"
] | licx@ACA803A0.ipt.aol.com |
d5a47fb4781d5b0267bd1712103f8f576768c234 | 3d7d0a17ffb2ad0d1dc5e8773eec3cd245f82830 | /src/test/java/org/hawkular/client/test/metrics/PingTest.java | 64498597dacd40b66851430530b82b06b10523c0 | [
"Apache-2.0"
] | permissive | arastoul/hawkular-client-java | b087b368fdeb746be8c3f9039732285075b41a4c | 92b14be4cbc74ae7e507ea6ea794a773d0fe19ae | refs/heads/master | 2020-03-28T19:18:43.722118 | 2017-03-16T17:04:33 | 2017-03-16T17:04:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,305 | java | /*
* Copyright 2015-2017 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.hawkular.client.test.metrics;
import java.util.Map;
import org.hawkular.client.core.ClientResponse;
import org.hawkular.client.test.BaseTest;
import org.testng.Assert;
import org.testng.annotations.Test;
@Test(groups = {"metrics"})
public class PingTest extends BaseTest {
@Test
public void ping() {
ClientResponse<Map<String, String>> response = client()
.metrics()
.ping()
.ping();
Assert.assertTrue(response.isSuccess());
Assert.assertNotNull(response.getEntity());
Assert.assertTrue(response.getEntity().size() > 0);
}
}
| [
"hwr@pilhuhn.de"
] | hwr@pilhuhn.de |
0a40e9e2afc3df68e9d96f924ee7204b52eb8848 | c1a29f3534b5dffcfac6e8040120210f56f37a70 | /spring-functionaltest-web/src/main/java/jp/co/ntt/fw/spring/functionaltest/app/aply/aply0401009/test1/APLY040100902Controller.java | f3ba35842956c5a52dea65eae5e5fe67977d8433 | [] | no_license | ptmxndys/spring-functionaltest | 658bb332efcc811168c05d9d1366871ce3650222 | ba2f34feb1da6312d868444fb41cf86ef554cd13 | refs/heads/master | 2023-02-11T21:18:06.677036 | 2021-01-04T09:43:01 | 2021-01-07T08:38:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,199 | java | /*
* Copyright(c) 2014 NTT Corporation.
*
* 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 jp.co.ntt.fw.spring.functionaltest.app.aply.aply0401009.test1;
import jp.co.ntt.fw.spring.functionaltest.app.cmmn.exception.IntentionalException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.terasoluna.gfw.common.message.ResultMessages;
@RequestMapping("aply")
@Controller
public class APLY040100902Controller {
@RequestMapping(value = "0401/009/02")
public String handle040100902() {
throw new IntentionalException(ResultMessages.error().add(
"e.sf.cmmn.8003"));
}
}
| [
"macchinetta.fw@gmail.com"
] | macchinetta.fw@gmail.com |
b7f83ff10e2cd2075cfa73b43804c1b46d203b04 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/live/plugin/ah$2$$ExternalSyntheticLambda4.java | f02c0b5377f0124fda3f2954b762d0ae561abe51 | [] | 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 | 597 | java | package com.tencent.mm.plugin.finder.live.plugin;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.View;
import com.tencent.mm.ui.base.s;
import com.tencent.mm.ui.base.u.f;
public final class ah$2$$ExternalSyntheticLambda4
implements u.f
{
public final void OnCreateContextMMMenu(s arg1, View arg2, ContextMenu.ContextMenuInfo arg3) {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes3.jar
* Qualified Name: com.tencent.mm.plugin.finder.live.plugin.ah.2..ExternalSyntheticLambda4
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
1d72953714f201dbb16d587079eecd3f29c90b29 | 9ddee94233726ffe9f4899e8c3a6c66d1c36e170 | /Fvhr.platform/src/dean/ds/program/fvhr/ui/an/lamtron.java | 0096fe4b12dc5953ae9929b458f81af44ed6a4dd | [] | no_license | tuankhoi2206/Freetrend | 315e9f99d3213763d38ef2c068d47e148223b7ff | 4b8124b0b0c8ea20081f8fe119f7dec0ad58bc29 | refs/heads/master | 2020-09-03T19:34:26.734722 | 2019-11-04T16:42:23 | 2019-11-04T16:42:23 | 219,545,899 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 569 | java | package ds.program.fvhr.ui.an;
public class lamtron {
public float testLamTron(float a){
String [] h;
String c;
float b,d,result;
Integer e;
//a=54200;
b=a/1000;
c=""+b;
h=c.split("\\.");
d=Float.parseFloat(h[0]);
e=(int)((b-d)*1000);
if(e>=500){
result=(d*1000)+1000;
}
/*else if(e>250){
result=(d*1000)+500;
}*/
else if(e<500){
result=d*1000;
}
else {
result=0;
}
return result;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
}
}
| [
"tuankhoi2206@gmail.com"
] | tuankhoi2206@gmail.com |
577f60f032c5eadf42565ba11a36c960e9acfb63 | a90f8343ca16224a1b05015094418cc9f228d4e7 | /service/service-store/src/main/java/com/ydc/service/store/service/CommodityImgService.java | 18cf03b78d859d32af3c8a15e20b09ff0802a478 | [] | no_license | oyjy2018/template | 0b381ecc50de254ecab37f34e2d1de058683ab8b | 3e9a07b9fff01b43a91b943152a3b9af9ff48e06 | refs/heads/master | 2022-12-06T11:02:16.875133 | 2019-06-05T16:12:35 | 2019-06-05T16:12:35 | 190,425,044 | 1 | 0 | null | 2022-11-16T10:56:08 | 2019-06-05T15:55:35 | Java | UTF-8 | Java | false | false | 2,014 | java | package com.ydc.service.store.service;
import com.ydc.model.cgj.CommodityImg;
import java.util.List;
/**
* 商品图片
*/
public interface CommodityImgService {
/**
* 根据主键删除
* 参数:主键
* 返回:删除个数
*
* @ibatorgenerated 2018-09-04 10:11:24
*/
int deleteByPrimaryKey(Integer id);
/**
* 插入,空属性也会插入
* 参数:pojo对象
* 返回:删除个数
*
* @ibatorgenerated 2018-09-04 10:11:24
*/
int insert(CommodityImg record);
/**
* 插入,空属性不会插入
* 参数:pojo对象
* 返回:删除个数
*
* @ibatorgenerated 2018-09-04 10:11:24
*/
int insertSelective(CommodityImg record);
/**
* 根据主键查询
* 参数:查询条件,主键值
* 返回:对象
*
* @ibatorgenerated 2018-09-04 10:11:24
*/
CommodityImg selectByPrimaryKey(Integer id);
/**
* 根据主键修改,空值条件不会修改成null
* 参数:1.要修改成的值
* 返回:成功修改个数
*
* @ibatorgenerated 2018-09-04 10:11:24
*/
int updateByPrimaryKeySelective(CommodityImg record);
/**
* 根据主键修改,空值条件会修改成null
* 参数:1.要修改成的值
* 返回:成功修改个数
*
* @ibatorgenerated 2018-09-04 10:11:24
*/
int updateByPrimaryKey(CommodityImg record);
/**
* 根据商品ID获取记录
*
* @param commodityId
* @return
*/
List<CommodityImg> selectByCommodityId(Integer commodityId);
/**
* 批量新增记录
*
* @param list
*/
void batchInsert(List<CommodityImg> list);
/**
* 批量新增或修改记录
*
* @param list
*/
void batchInsertOrUpdate(List<CommodityImg> list);
/**
* 查询商品图片
*
* @param homePageImgId
* @return
*/
CommodityImg getValidCommodityImg(Integer homePageImgId);
}
| [
"983014204@qq.com"
] | 983014204@qq.com |
9f48134231247196e42a230659e89ecf414ebcca | 0672615b53f57a98191aa5eecdc8e7864f82857b | /flink-yarn/src/test/java/org/apache/flink/yarn/TestingRegisterApplicationMasterResponse.java | 328ac00a8bbbdd821b0daf680d8ce2f741fd73cb | [
"Apache-2.0",
"MIT",
"OFL-1.1",
"ISC",
"BSD-3-Clause"
] | permissive | jingshanglu/flink | 34d6684e0e2134cd97ababa3e7e79447165bbafd | 5a2b259153b036dbdcd6b62e5384d7f0865c2745 | refs/heads/master | 2021-07-17T17:38:32.752993 | 2020-10-10T08:40:18 | 2020-10-10T08:40:18 | 219,395,022 | 0 | 0 | Apache-2.0 | 2020-10-10T08:40:19 | 2019-11-04T01:47:06 | Java | UTF-8 | Java | false | false | 2,347 | 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.flink.yarn;
import org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse;
import org.apache.hadoop.yarn.api.protocolrecords.impl.pb.RegisterApplicationMasterResponsePBImpl;
import org.apache.hadoop.yarn.api.records.Container;
import java.util.Collections;
import java.util.EnumSet;
import java.util.List;
import java.util.function.Supplier;
/**
* A Yarn {@link RegisterApplicationMasterResponse} implementation for testing.
*/
public class TestingRegisterApplicationMasterResponse extends RegisterApplicationMasterResponsePBImpl {
private final Supplier<List<Container>> getContainersFromPreviousAttemptsSupplier;
TestingRegisterApplicationMasterResponse(Supplier<List<Container>> getContainersFromPreviousAttemptsSupplier) {
this.getContainersFromPreviousAttemptsSupplier = getContainersFromPreviousAttemptsSupplier;
}
/**
* The @Override annotation is intentionally removed for this method to align with the production codes' assumption
* that this interface may not be available for the given hadoop version.
*/
public List<Container> getContainersFromPreviousAttempts() {
return getContainersFromPreviousAttemptsSupplier.get();
}
/**
* The @Override annotation is intentionally removed for this method to align with the production codes' assumption
* that this interface may not be available for the given hadoop version.
*/
@SuppressWarnings("unchecked")
public EnumSet getSchedulerResourceTypes() {
return EnumSet.copyOf(Collections.<Enum>emptySet());
}
}
| [
"trohrmann@apache.org"
] | trohrmann@apache.org |
862e75a57bf657b436b71815aca21ec7133e59cf | 776f7a8bbd6aac23678aa99b72c14e8dd332e146 | /src/rx/internal/operators/OperatorZip$ZipSubscriber.java | c7a17fd9f32e6ba17f82def03e15205370cc2f3a | [] | no_license | arvinthrak/com.nianticlabs.pokemongo | aea656acdc6aa419904f02b7331f431e9a8bba39 | bcf8617bafd27e64f165e107fdc820d85bedbc3a | refs/heads/master | 2020-05-17T15:14:22.431395 | 2016-07-21T03:36:14 | 2016-07-21T03:36:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,221 | java | package rx.internal.operators;
import rx.Observable;
import rx.Subscriber;
final class OperatorZip$ZipSubscriber
extends Subscriber<Observable[]>
{
final Subscriber<? super R> child;
final OperatorZip.ZipProducer<R> producer;
boolean started = false;
final OperatorZip.Zip<R> zipper;
public OperatorZip$ZipSubscriber(Subscriber<? super R> paramSubscriber, OperatorZip.Zip<R> paramZip, OperatorZip.ZipProducer<R> paramZipProducer)
{
super(paramZip);
child = paramZip;
zipper = paramZipProducer;
OperatorZip.ZipProducer localZipProducer;
producer = localZipProducer;
}
public void onCompleted()
{
if (!started) {
child.onCompleted();
}
}
public void onError(Throwable paramThrowable)
{
child.onError(paramThrowable);
}
public void onNext(Observable[] paramArrayOfObservable)
{
if ((paramArrayOfObservable == null) || (paramArrayOfObservable.length == 0))
{
child.onCompleted();
return;
}
started = true;
zipper.start(paramArrayOfObservable, producer);
}
}
/* Location:
* Qualified Name: rx.internal.operators.OperatorZip.ZipSubscriber
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
5a0828f358a63cc6da8495c192ee9e5a67ff6f59 | 129f58086770fc74c171e9c1edfd63b4257210f3 | /src/testcases/CWE80_XSS/CWE80_XSS__Servlet_connect_tcp_74a.java | 6b2b0c57f65bc8aa766ce00b992ede95910ac391 | [] | no_license | glopezGitHub/Android23 | 1bd0b6a6c7ce3c7439a74f1e4dcef2c4c0fac4ba | 6215d0684c4fbdc7217ccfbedfccfca69824cc5e | refs/heads/master | 2023-03-07T15:14:59.447795 | 2023-02-06T13:59:49 | 2023-02-06T13:59:49 | 6,856,387 | 0 | 3 | null | 2023-02-06T18:38:17 | 2012-11-25T22:04:23 | Java | UTF-8 | Java | false | false | 4,503 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE80_XSS__Servlet_connect_tcp_74a.java
Label Definition File: CWE80_XSS__Servlet.label.xml
Template File: sources-sink-74a.tmpl.java
*/
/*
* @description
* CWE: 80 Cross Site Scripting (XSS)
* BadSource: connect_tcp Read data using an outbound tcp connection
* GoodSource: A hardcoded string
* Sinks:
* BadSink : Display of data in web page without any encoding or validation
* Flow Variant: 74 Data flow: data passed in a HashMap from one method to another in different source files in the same package
*
* */
package testcases.CWE80_XSS;
import testcasesupport.*;
import java.util.HashMap;
import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;
public class CWE80_XSS__Servlet_connect_tcp_74a extends AbstractTestCaseServlet
{
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
data = ""; /* Initialize data */
/* Read data using an outbound tcp connection */
{
Socket sock = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try {
/* Read data using an outbound tcp connection */
sock = new Socket("host.example.org", 39544);
/* read input from socket */
instrread = new InputStreamReader(sock.getInputStream(), "UTF-8");
buffread = new BufferedReader(instrread);
/* POTENTIAL FLAW: Read data using an outbound tcp connection */
data = buffread.readLine();
}
catch( IOException ioe )
{
IO.logger.log(Level.WARNING, "Error with stream reading", ioe);
}
finally {
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
IO.logger.log(Level.WARNING, "Error closing BufferedReader", ioe);
}
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
IO.logger.log(Level.WARNING, "Error closing InputStreamReader", ioe);
}
/* clean up socket objects */
try {
if( sock != null )
{
sock.close();
}
}
catch( IOException e )
{
IO.logger.log(Level.WARNING, "Error closing Socket", e);
}
}
}
HashMap<Integer,String> data_hashmap = new HashMap<Integer,String>();
data_hashmap.put(0, data);
data_hashmap.put(1, data);
data_hashmap.put(2, data);
(new CWE80_XSS__Servlet_connect_tcp_74b()).bad_sink(data_hashmap , request, response );
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
String data;
/* FIX: Use a hardcoded string */
data = "foo";
HashMap<Integer,String> data_hashmap = new HashMap<Integer,String>();
data_hashmap.put(0, data);
data_hashmap.put(1, data);
data_hashmap.put(2, data);
(new CWE80_XSS__Servlet_connect_tcp_74b()).goodG2B_sink(data_hashmap , request, response );
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"guillermo.pando@gmail.com"
] | guillermo.pando@gmail.com |
1ba7b52edf7bc9d3930de324a5fb6a32cd552274 | 8f8374f81f46d96198b4c690c85472a374ae8855 | /bungeecord-chat/src/main/java/net/md_5/bungee/chat/TranslatableComponentSerializer.java | 1b04a69e4ea4612d305b6021012a9bb146c04fd4 | [] | no_license | VoxelGamesLib/external-libs | 1ec9a80b1444ad10a63dcae6bd160d2758cf805a | a1e86b878c31f7fa22f84f73161a42236f7c915f | refs/heads/master | 2020-05-25T19:48:16.808706 | 2017-06-10T15:37:48 | 2017-06-10T15:37:48 | 84,960,941 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,649 | java | package net.md_5.bungee.chat;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.TranslatableComponent;
import java.lang.reflect.Type;
import java.util.Arrays;
public class TranslatableComponentSerializer extends BaseComponentSerializer implements JsonSerializer<TranslatableComponent>, JsonDeserializer<TranslatableComponent> {
public TranslatableComponent deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException {
TranslatableComponent component = new TranslatableComponent();
JsonObject object = json.getAsJsonObject();
deserialize(object, component, context);
component.setTranslate(object.get("translate").getAsString());
if (object.has("with")) {
component.setWith(Arrays.asList((BaseComponent[]) context.deserialize(object.get("with"), BaseComponent[].class)));
}
return component;
}
public JsonElement serialize(TranslatableComponent src, Type typeOfSrc, JsonSerializationContext context) {
JsonObject object = new JsonObject();
serialize(object, src, context);
object.addProperty("translate", src.getTranslate());
if (src.getWith() != null) {
object.add("with", context.serialize(src.getWith()));
}
return object;
}
}
| [
"admin@minidigger.me"
] | admin@minidigger.me |
d7a9d9cc0533618548e5fd7ac93845df913db935 | fe0b6d0d4c14965808a4b38aa91d0c5cef1f69f6 | /languages/activitydiagram/org.gemoc.activitydiagram.sequential.xactivitydiagram.scenario/src/org/gemoc/activitydiagram/sequential/xactivitydiagram/scenario/xactivitydiagramscenario/XActivityDiagramProvider/impl/InitialNodeQueryImpl.java | e179595076c7000711c7ccda2037b211fa0460ae | [] | no_license | tetrabox/examples-behavioral-interface | f05b9bf1d3a8414ffc5eef3560f72f3719e09f28 | 3a5df4b8ec4ed13a39712269487f07d09479ec99 | refs/heads/master | 2020-12-02T16:23:03.869890 | 2019-10-22T08:59:20 | 2019-10-22T08:59:20 | 96,529,344 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,343 | java | /**
*/
package org.gemoc.activitydiagram.sequential.xactivitydiagram.scenario.xactivitydiagramscenario.XActivityDiagramProvider.impl;
import fr.inria.diverse.event.commons.model.property.StateProperty;
import fr.inria.diverse.event.commons.model.scenario.impl.ElementQueryImpl;
import org.eclipse.emf.ecore.EClass;
import org.gemoc.activitydiagram.sequential.xactivitydiagram.activitydiagram.InitialNode;
import org.gemoc.activitydiagram.sequential.xactivitydiagram.scenario.xactivitydiagramscenario.XActivityDiagramProvider.InitialNodeQuery;
import org.gemoc.activitydiagram.sequential.xactivitydiagram.scenario.xactivitydiagramscenario.XActivityDiagramProvider.XActivityDiagramProviderPackage;
/**
* <!-- begin-user-doc -->
* An implementation of the model object '<em><b>Initial Node Query</b></em>'.
* <!-- end-user-doc -->
*
* @generated
*/
public class InitialNodeQueryImpl extends ElementQueryImpl<InitialNode, StateProperty<InitialNode>> implements InitialNodeQuery {
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected InitialNodeQueryImpl() {
super();
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected EClass eStaticClass() {
return XActivityDiagramProviderPackage.Literals.INITIAL_NODE_QUERY;
}
} //InitialNodeQueryImpl
| [
"dorian.leroy@irisa.fr"
] | dorian.leroy@irisa.fr |
9e8748f5fbe28eeba37caedfcaffc67a05e85aef | 842861b4a521276d480c75d0f4c816396208a99d | /application.db.modules/events.system/src/main/java/events/system/mapper/TopicsMapper.java | f78769c00eb70ec45648d2a427d67912b8dcc4be | [] | no_license | tatjana19/turbo-sansa | 0cdd8d8ab4539ac9eff5dbb759280f8bf2adb6c9 | 38cd3e150fbaae33afbb1e5ada499e1b754f954d | refs/heads/master | 2021-01-24T03:18:23.851056 | 2015-09-13T16:40:49 | 2015-09-13T16:40:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 221 | java | package events.system.mapper;
import hbm.mapper.AbstractEntityBOMapper;
import events.system.domain.Topic;
import events.system.model.Topics;
public class TopicsMapper extends AbstractEntityBOMapper<Topics, Topic> {
}
| [
"asterios.raptis@gmx.net"
] | asterios.raptis@gmx.net |
f64a2decf2aa8a4b5979e1e91e69b4a6c60e47c9 | 206989531cb57770edb8b2b7079639af4bff5875 | /Socialize/sdk/src/com/socialize/google/gson/TypeAdapterFactory.java | 8388a15a1dba313341ab2d879a9244b8290ddfb2 | [] | no_license | jbailey2010/Boozle | 543f6bac00423aa34d06013fac97661bff8e7458 | 3a50809e01708f68f98839f077656934e99651c1 | refs/heads/master | 2020-04-13T12:30:42.391029 | 2015-04-21T02:50:38 | 2015-04-21T02:50:38 | 16,244,666 | 2 | 1 | null | null | null | null | UTF-8 | Java | false | false | 6,622 | java | /*
* Copyright (C) 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.socialize.google.gson;
import com.socialize.google.gson.reflect.TypeToken;
/**
* Creates type adapters for set of related types. Type adapter factories are
* most useful when several types share similar structure in their JSON form.
*
* <h3>Example: Converting enums to lowercase</h3>
* In this example, we implement a factory that creates type adapters for all
* enums. The type adapters will write enums in lowercase, despite the fact
* that they're defined in {@code CONSTANT_CASE} in the corresponding Java
* model: <pre> {@code
*
* public class LowercaseEnumTypeAdapterFactory implements TypeAdapter.Factory {
* public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
* Class<T> rawType = (Class<T>) type.getRawType();
* if (!rawType.isEnum()) {
* return null;
* }
*
* final Map<String, T> lowercaseToConstant = new HashMap<String, T>();
* for (T constant : rawType.getEnumConstants()) {
* lowercaseToConstant.put(toLowercase(constant), constant);
* }
*
* return new TypeAdapter<T>() {
* public void write(JsonWriter out, T value) throws IOException {
* if (value == null) {
* out.nullValue();
* } else {
* out.value(toLowercase(value));
* }
* }
*
* public T read(JsonReader reader) throws IOException {
* if (reader.peek() == JsonToken.NULL) {
* reader.nextNull();
* return null;
* } else {
* return lowercaseToConstant.get(reader.nextString());
* }
* }
* };
* }
*
* private String toLowercase(Object o) {
* return o.toString().toLowerCase(Locale.US);
* }
* }
* }</pre>
*
* <p>Type adapter factories select which types they provide type adapters
* for. If a factory cannot support a given type, it must return null when
* that type is passed to {@link #create}. Factories should expect {@code
* create()} to be called on them for many types and should return null for
* most of those types. In the above example the factory returns null for
* calls to {@code create()} where {@code type} is not an enum.
*
* <p>A factory is typically called once per type, but the returned type
* adapter may be used many times. It is most efficient to do expensive work
* like reflection in {@code create()} so that the type adapter's {@code
* read()} and {@code write()} methods can be very fast. In this example the
* mapping from lowercase name to enum value is computed eagerly.
*
* <p>As with type adapters, factories must be <i>registered</i> with a {@link
* com.socialize.google.gson.GsonBuilder} for them to take effect: <pre> {@code
*
* GsonBuilder builder = new GsonBuilder();
* builder.registerTypeAdapterFactory(new LowercaseEnumTypeAdapterFactory());
* ...
* Gson gson = builder.create();
* }</pre>
* If multiple factories support the same type, the factory registered earlier
* takes precedence.
*
* <h3>Example: composing other type adapters</h3>
* In this example we implement a factory for Guava's {@code Multiset}
* collection type. The factory can be used to create type adapters for
* multisets of any element type: the type adapter for {@code
* Multiset<String>} is different from the type adapter for {@code
* Multiset<URL>}.
*
* <p>The type adapter <i>delegates</i> to another type adapter for the
* multiset elements. It figures out the element type by reflecting on the
* multiset's type token. A {@code Gson} is passed in to {@code create} for
* just this purpose: <pre> {@code
*
* public class MultisetTypeAdapterFactory implements TypeAdapter.Factory {
* public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> typeToken) {
* Type type = typeToken.getType();
* if (typeToken.getRawType() != Multiset.class
* || !(type instanceof ParameterizedType)) {
* return null;
* }
*
* Type elementType = ((ParameterizedType) type).getActualTypeArguments()[0];
* TypeAdapter<?> elementAdapter = gson.getAdapter(TypeToken.get(elementType));
* return (TypeAdapter<T>) newMultisetAdapter(elementAdapter);
* }
*
* private <E> TypeAdapter<Multiset<E>> newMultisetAdapter(
* final TypeAdapter<E> elementAdapter) {
* return new TypeAdapter<Multiset<E>>() {
* public void write(JsonWriter out, Multiset<E> value) throws IOException {
* if (value == null) {
* out.nullValue();
* return;
* }
*
* out.beginArray();
* for (Multiset.Entry<E> entry : value.entrySet()) {
* out.value(entry.getCount());
* elementAdapter.write(out, entry.getElement());
* }
* out.endArray();
* }
*
* public Multiset<E> read(JsonReader in) throws IOException {
* if (in.peek() == JsonToken.NULL) {
* in.nextNull();
* return null;
* }
*
* Multiset<E> result = LinkedHashMultiset.create();
* in.beginArray();
* while (in.hasNext()) {
* int count = in.nextInt();
* E element = elementAdapter.read(in);
* result.add(element, count);
* }
* in.endArray();
* return result;
* }
* };
* }
* }
* }</pre>
* Delegating from one type adapter to another is extremely powerful; it's
* the foundation of how Gson converts Java objects and collections. Whenever
* possible your factory should retrieve its delegate type adapter in the
* {@code create()} method; this ensures potentially-expensive type adapter
* creation happens only once.
*
* @since 2.1
*/
public interface TypeAdapterFactory {
/**
* Returns a type adapter for {@code type}, or null if this factory doesn't
* support {@code type}.
*/
<T> TypeAdapter<T> create(Gson gson, TypeToken<T> type);
}
| [
"bailey27@illinois.edu"
] | bailey27@illinois.edu |
9c313c5b76f481747bf56814219f30bc5bffda70 | 16c47353da26311e1b37cc8f59b6bd6e0b89b950 | /integration-test-groups/cxf-soap/cxf-soap-server/src/test/java/org/apache/camel/quarkus/component/cxf/soap/server/it/Java2wsTest.java | 03a1f84bab03c34fe4a2e5ef5708b7e507068764 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | apache/camel-quarkus | 8776c1d97941d3eceb58d889d7cbb6a2e7bfcf8e | 038810b4144fd834460fb65a1e9c701590aab9d1 | refs/heads/main | 2023-09-01T17:54:31.555282 | 2023-09-01T10:24:09 | 2023-09-01T13:44:23 | 193,065,376 | 236 | 196 | Apache-2.0 | 2023-09-14T17:29:35 | 2019-06-21T08:55:25 | Java | UTF-8 | Java | false | false | 5,463 | 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.camel.quarkus.component.cxf.soap.server.it;
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
@QuarkusTest
public class Java2wsTest {
@Test
public void java2WsCodeFirstService()
throws IOException, ParserConfigurationException, SAXException, TransformerException {
String servedWsdl = RestAssured.given()
.get("/soapservice/codefirst?wsdl")
.then()
.statusCode(200)
.extract().body().asString();
servedWsdl = normalizeNsPrefixes(servedWsdl);
Path generatedPath = Paths.get("target/Java2wsTest/CodeFirstService-from-java2ws.wsdl");
try (InputStream in = Files.newInputStream(generatedPath)) {
final String java2WsGeneratedWsdl = new String(in.readAllBytes(), StandardCharsets.UTF_8);
/* We have to compare on DOM level so that different order of XML attributes, etc. does not make the test fail */
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
dbf.setCoalescing(true);
dbf.setIgnoringElementContentWhitespace(true);
dbf.setIgnoringComments(true);
DocumentBuilder db = dbf.newDocumentBuilder();
final Document generatedDoc = parse(db, java2WsGeneratedWsdl);
final Document servedDoc = parse(db, servedWsdl);
boolean equal = generatedDoc.isEqualNode(servedDoc);
String mode = this.getClass().getSimpleName().endsWith("IT") ? "native" : "jvm";
Path servedPath = Paths.get("target/Java2wsTest/CodeFirstService-served-normalized-" + mode + ".wsdl")
.toAbsolutePath();
Path generatedNormalizedPath = Paths.get("target/Java2wsTest/CodeFirstService-from-java2ws-normalized.wsdl")
.toAbsolutePath();
save(servedDoc, servedPath);
save(generatedDoc, generatedNormalizedPath);
if (!equal) {
Assertions.fail(
"The WSDL generated by java2ws and the WSDL served by the application are not equal XML documents. You may want to compare "
+ generatedNormalizedPath + " vs. " + servedPath);
}
}
}
protected String normalizeNsPrefixes(String servedWsdl) {
/*
* ns1 does not seem to be used anywhere in the WSDL document so it should be fine to remove it.
* At the same time it is the only difference against the document produced by java2ws which is also fine
*/
return servedWsdl.replace("xmlns:ns1=\"http://schemas.xmlsoap.org/soap/http\"", "");
}
static void save(Document doc, Path path) throws TransformerException, IOException {
Files.createDirectories(path.getParent());
Transformer t = TransformerFactory.newDefaultInstance().newTransformer();
t.transform(new DOMSource(doc), new StreamResult(path.toFile()));
}
static Document parse(DocumentBuilder db, String wsdlDoc) throws SAXException, IOException {
Document doc = db.parse(new InputSource(new StringReader(wsdlDoc)));
/*
* There is some default :9090 location in the generated WSDL so we remove the whole address node from both
*/
NodeList adrNodes = doc.getElementsByTagNameNS("http://schemas.xmlsoap.org/wsdl/soap/", "address");
List<Node> adrNodesList = new ArrayList<>();
for (int i = 0; i < adrNodes.getLength(); i++) {
adrNodesList.add(adrNodes.item(i));
}
for (Node node : adrNodesList) {
node.getParentNode().removeChild(node);
}
doc.normalizeDocument();
return doc;
}
}
| [
"ppalaga@redhat.com"
] | ppalaga@redhat.com |
e75690e8be82a0f3babd865939547b233eb78b54 | c8e1db3dd44ba967af12c6dd7b8f4d2864c44346 | /easybatch-jpa/src/main/java/org/easybatch/jpa/JpaRecordWriter.java | da9151443554e02c5e08c13a40e0f82919083350 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | mathewdenis/easybatch-framework | a46d11e946d0ddaab6a2ab472a1c0b19bafad781 | 00f2c3a913dc3a38ed53212843e197a028ef0367 | refs/heads/master | 2021-01-17T21:41:48.031050 | 2015-08-26T22:56:14 | 2015-08-26T22:56:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,274 | java | /*
* The MIT License
*
* Copyright (c) 2015, Mahmoud Ben Hassine (mahmoud@benhassine.fr)
*
* 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.easybatch.jpa;
import org.easybatch.core.api.RecordProcessingException;
import org.easybatch.core.writer.AbstractRecordWriter;
import javax.persistence.EntityManager;
import static org.easybatch.core.util.Utils.checkNotNull;
/**
* Write entities to a database using JPA.
* <p/>
* This writer does not commit a transaction after writing records.
* You can use a {@link JpaTransactionStepListener} for this purpose.
*
* @param <T> the entity type.
* @author Mahmoud Ben Hassine (mahmoud@benhassine.fr)
*/
public class JpaRecordWriter<T> extends AbstractRecordWriter<T> {
private EntityManager entityManager;
/**
* Create a JPA record writer.
*
* @param entityManager the entity manager to write records.
*/
public JpaRecordWriter(final EntityManager entityManager) {
checkNotNull(entityManager, "entity manager");
this.entityManager = entityManager;
}
@Override
public void writeRecord(final T record) throws RecordProcessingException {
entityManager.persist(record);
}
}
| [
"md.benhassine@gmail.com"
] | md.benhassine@gmail.com |
d675e4b67717119e5f9f6bdbd6d5625046c019d9 | e2c48e041d2983164cf04bc49d37f3bc7324f2d3 | /Java/src/_0000_study/classicalproblems/reverselinkedlist/ListNode.java | e1eeaf67a352e5fb4ac945004974772fd168c1f5 | [] | no_license | ToLoveToFeel/LeetCode | 17aff7f9b36615ccebe386545440f921d8fdf740 | de7a893fc625ff30122899969f761ed5f8df8b12 | refs/heads/master | 2023-07-12T07:35:09.410016 | 2021-08-23T02:33:00 | 2021-08-23T02:33:00 | 230,863,299 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 206 | java | package _0000_study.classicalproblems.reverselinkedlist;
/**
* Date: 2020/9/4 18:05
* Content:
*/
public class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
}
}
| [
"1137247975@qq.com"
] | 1137247975@qq.com |
5b9dcab15f2867d05998760e94284ec70bf423de | ddddf0024e0207dc64259e14131dd62ebe3dfa33 | /app/src/main/java/com/myworld/wenwo/utils/BitmapUtil.java | 91e61b821389d27475657471be99c7fbd3423772 | [] | no_license | jianglei260/wenwo | efc4c0bf9bb3fd8ea3da298fb9db4f6ca2434ccd | f8f971638702dc74603470f8b85e8faaffba11f1 | refs/heads/master | 2020-04-22T11:53:47.747663 | 2016-09-23T09:03:30 | 2016-09-23T09:03:31 | 67,763,546 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,123 | java | package com.myworld.wenwo.utils;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
/**
* Created by jianglei on 16/8/9.
*/
public class BitmapUtil {
public static byte[] getBitmapFormUri(Activity ac, Uri uri) throws FileNotFoundException, IOException {
InputStream input = ac.getContentResolver().openInputStream(uri);
BitmapFactory.Options onlyBoundsOptions = new BitmapFactory.Options();
onlyBoundsOptions.inJustDecodeBounds = true;
onlyBoundsOptions.inDither = true;//optional
onlyBoundsOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;//optional
BitmapFactory.decodeStream(input, null, onlyBoundsOptions);
input.close();
int originalWidth = onlyBoundsOptions.outWidth;
int originalHeight = onlyBoundsOptions.outHeight;
if ((originalWidth == -1) || (originalHeight == -1))
return null;
//图片分辨率以480x800为标准
float hh = 800f;//这里设置高度为800f
float ww = 480f;//这里设置宽度为480f
//缩放比。由于是固定比例缩放,只用高或者宽其中一个数据进行计算即可
int be = 1;//be=1表示不缩放
if (originalWidth > originalHeight && originalWidth > ww) {//如果宽度大的话根据宽度固定大小缩放
be = (int) (originalWidth / ww);
} else if (originalWidth < originalHeight && originalHeight > hh) {//如果高度高的话根据宽度固定大小缩放
be = (int) (originalHeight / hh);
}
if (be <= 0)
be = 1;
//比例压缩
BitmapFactory.Options bitmapOptions = new BitmapFactory.Options();
bitmapOptions.inSampleSize = be;//设置缩放比例
bitmapOptions.inDither = true;//optional
bitmapOptions.inPreferredConfig = Bitmap.Config.ARGB_8888;//optional
input = ac.getContentResolver().openInputStream(uri);
Bitmap bitmap = BitmapFactory.decodeStream(input, null, bitmapOptions);
input.close();
return compressImage(bitmap);//再进行质量压缩
}
public static byte[] compressImage(Bitmap image) {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
image.compress(Bitmap.CompressFormat.PNG, 100, baos);//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中
int options = 100;
while (baos.toByteArray().length / 1024 > 100) { //循环判断如果压缩后图片是否大于100kb,大于继续压缩
baos.reset();//重置baos即清空baos
//第一个参数 :图片格式 ,第二个参数: 图片质量,100为最高,0为最差 ,第三个参数:保存压缩后的数据的流
image.compress(Bitmap.CompressFormat.PNG, options, baos);//这里压缩options%,把压缩后的数据存放到baos中
options -= 10;//每次都减少10
if (options <= 0)
break;
}
Log.d("out size(kb)", baos.toByteArray().length / 1024 + "kb");
return baos.toByteArray();
}
public static Bitmap convertViewToBitmap(View view) {
((Activity) view.getContext()).runOnUiThread(new Runnable() {
@Override
public void run() {
}
});
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(),
Bitmap.Config.ARGB_8888);
//利用bitmap生成画布
Canvas canvas = new Canvas(bitmap);
canvas.drawColor(Color.WHITE);
view.draw(canvas);
return bitmap;
}
public static String saveViewToStorage(View view) {
Bitmap bitmap = convertViewToBitmap(view);
float scaleWidth = 600f / view.getWidth();
float scaleHeight = 800f / view.getHeight();
Matrix matrix = new Matrix();
matrix.setScale(scaleWidth, scaleHeight);
Bitmap compressBitmap = Bitmap.createBitmap(bitmap, 0, 0, view.getWidth(), view.getHeight(), matrix, true);
String path = Environment.getExternalStorageDirectory().getAbsolutePath();
File dir = new File(path + File.separator + "wenwo");
if (!dir.exists())
dir.mkdir();
File out = new File(dir.getAbsolutePath() + File.separator + System.currentTimeMillis() + ".png");
try {
FileOutputStream fos = new FileOutputStream(out);
compressBitmap.compress(Bitmap.CompressFormat.PNG, 100, fos);
fos.close();
} catch (Exception e) {
e.printStackTrace();
}
return out.getAbsolutePath();
}
}
| [
"260940356@qq.com"
] | 260940356@qq.com |
ba84291e0029664acebcb9f10f16cf7df2d9866b | b755a269f733bc56f511bac6feb20992a1626d70 | /qiyun-pay/pay-mapper/src/main/java/com/qiyun/mapper/XxPayApplyMapper.java | 9ac939e5e345fa7a5d15570e8010fa2850ad1d8c | [] | no_license | yysStar/dubbo-zookeeper-SSM | 55df313b58c78ab2eaa3d021e5bb201f3eee6235 | e3f85dea824159fb4c29207cc5c9ccaecf381516 | refs/heads/master | 2022-12-21T22:50:33.405116 | 2020-05-09T09:20:41 | 2020-05-09T09:20:41 | 125,301,362 | 2 | 0 | null | 2022-12-16T10:51:09 | 2018-03-15T02:27:17 | Java | UTF-8 | Java | false | false | 865 | java | package com.qiyun.mapper;
import com.qiyun.model.XxPayApply;
import com.qiyun.model.XxPayApplyQuery;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface XxPayApplyMapper {
int countByExample(XxPayApplyQuery example);
int deleteByExample(XxPayApplyQuery example);
int deleteByPrimaryKey(Integer id);
int insert(XxPayApply record);
int insertSelective(XxPayApply record);
List<XxPayApply> selectByExample(XxPayApplyQuery example);
XxPayApply selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") XxPayApply record, @Param("example") XxPayApplyQuery example);
int updateByExample(@Param("record") XxPayApply record, @Param("example") XxPayApplyQuery example);
int updateByPrimaryKeySelective(XxPayApply record);
int updateByPrimaryKey(XxPayApply record);
} | [
"qawsed1231010@126.com"
] | qawsed1231010@126.com |
98a74c6109aed2d0991914699f15d4475115bc06 | 2ea250da5ffc6d8d30ea1717ea9ac4da456a3afa | /kodilla-spring/src/test/java/com/kodilla/spring/portfolio/BoardTestSuite.java | 96879831990dde706ffd35ebd2f7695ce42af06d | [] | no_license | psobow/patryk-sobow-kodilla-java | 3711941b40b8b1878ce5a4ef369a8fc91dbaaf8a | ab59f2993b55a5cea85905377bdf5be25cbd0d77 | refs/heads/master | 2020-03-24T21:27:05.623267 | 2019-06-08T14:46:49 | 2019-06-30T00:27:17 | 143,033,125 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,153 | java | package com.kodilla.spring.portfolio;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class BoardTestSuite {
@Test
public void testShowBoard(){
ApplicationContext context = new AnnotationConfigApplicationContext(BoardConfig.class);
Board board = context.getBean(Board.class);
//When&Then
board.showBoard();
}
@Test
public void testAddOneTask(){
ApplicationContext context = new AnnotationConfigApplicationContext(BoardConfig.class);
Board board = context.getBean(Board.class);
//When
board.getToDoList().addTask("ZRÓB SALTO");
board.getInProgressList().addTask("IDŹ SPAĆ");
board.getDoneList().addTask("DOKĄD NOCĄ TUPTA JEŻ");
//Then
board.showBoard();
Assert.assertEquals(1, board.getToDoList().getTasks().size());
Assert.assertEquals(1, board.getInProgressList().getTasks().size());
Assert.assertEquals(1, board.getDoneList().getTasks().size());
}
}
| [
"patryk.sobow95@gmail.com"
] | patryk.sobow95@gmail.com |
0fff9334152e9e21d8c4347461863ddc98dfcc03 | a0f2d14afd17a93f9a78b48c92b816725adee7dc | /core/src/com/mygdx/game/main/DoremonJump.java | 1dd589330fecadd3741b24f48e36a6fec0959341 | [] | no_license | ziggy192/MyDoremon | 46449b59f85a5f669557b94ec915aef5b2306203 | a568b2fb229f97375f479cbbcfe912d85477e0ff | refs/heads/master | 2021-06-15T23:38:41.828470 | 2021-05-29T09:17:59 | 2021-05-29T09:17:59 | 73,878,646 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,669 | java | package com.mygdx.game.main;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.mygdx.game.gfx.Assets;
import com.mygdx.game.states.GameStateManager;
import com.mygdx.game.states.MenuState;
public class DoremonJump extends ApplicationAdapter {
public static OrthographicCamera camera;
public static int bestScore = 0;
protected int WIDTH;
protected int HEIGHT;
private GameStateManager gsm;
private SpriteBatch batch;
private Handler handler;
@Override
public void create() {
WIDTH = Gdx.graphics.getWidth();
HEIGHT = Gdx.graphics.getHeight();
batch = new SpriteBatch();
Assets.init();
init();
}
public void init() {
camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.setToOrtho(true, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
handler = new Handler(this);
gsm = new GameStateManager();
gsm.push(new MenuState(handler, gsm));
}
@Override
public void render() {
batch.setProjectionMatrix(camera.combined);
Gdx.gl.glClearColor(1, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
gsm.render(batch);
gsm.tick();
}
@Override
public void dispose() {
batch.dispose();
gsm.dispose();
// Assets.dispose();
}
public int getHeight() {
return HEIGHT;
}
public int getWidth() {
return WIDTH;
}
}
| [
"luuquangnghia97@gmail.com"
] | luuquangnghia97@gmail.com |
2b160a4080da7924c93adea6d147ab60437d9ca5 | fb33e12379f3233ff1bcb859ce4f237b0d95a180 | /src/main/java/net/Socket/TCP_demo03/ClientDemo.java | 491d27f5ea00fe44dcf92ae9d900646af928a8c8 | [] | no_license | abelzyp/JavaAPI | b2557aa84650087f22553be0aaee43c1bf5c13c3 | 82ba3b18e03141d5446c8cbadf46fe729e781a43 | refs/heads/master | 2020-04-06T06:59:52.416071 | 2020-01-15T07:18:05 | 2020-01-15T07:18:05 | 60,389,265 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 937 | java | package net.Socket.TCP_demo03;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.Socket;
/*
* 客户端键盘录入,服务器输出到控制台
*/
public class ClientDemo {
public static void main(String[] args) throws IOException {
// 创建客户端Socket对象
Socket s = new Socket("222.27.254.77", 8888);
// 键盘录入数据
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// 把通道内的流包装一下
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
s.getOutputStream()));
String line = null;
while ((line = br.readLine()) != null) {
// 自定义结束标记
if ("886".equals(line)) {
break;
}
bw.write(line);
bw.newLine();
bw.flush();
}
// 释放资源
// bw.close();
// br.close();
s.close();
}
}
| [
"abelzyp@foxmail.com"
] | abelzyp@foxmail.com |
4528cae4e63a9f065d8f8d333679828a1821d985 | 0a4dc176eb14c7b52f05d403afb341420a547265 | /andcommon/src/main/java/com/pepperonas/andbasx/animation/FadeAnimation.java | eabf464e2f7a73e8b2a52e3df6ee83f7f2950387 | [] | no_license | pepperonas/Base | 4a875f067045536a13779d2e724a50c7105c0915 | 934039b3a38ebf23fe9ec37c0491ae977c59b432 | refs/heads/master | 2021-01-10T05:33:43.640974 | 2016-02-11T19:50:19 | 2016-02-11T19:50:19 | 45,982,277 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,977 | java | /*
* Copyright (c) 2016 Martin Pfeffer
*
* 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.pepperonas.andbasx.animation;
import android.view.View;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
/**
* @author Martin Pfeffer (pepperonas)
*/
public class FadeAnimation {
private View view;
private float maxBrightness = 1.0f;
private float minBrightness = 0.1f;
private long duration = 400L;
private long startOffset = 0L;
public FadeAnimation(View view) {
this.view = view;
}
public FadeAnimation(View view, float maxBrightness, float minBrightness, long duration, long startOffset) {
this.view = view;
this.maxBrightness = maxBrightness;
this.minBrightness = minBrightness;
this.duration = duration;
this.startOffset = startOffset;
}
public void fadeOut() {
Animation anim = new AlphaAnimation(maxBrightness, minBrightness);
anim.setDuration(duration);
anim.setStartOffset(startOffset);
anim.setFillEnabled(true);
anim.setFillAfter(true);
view.startAnimation(anim);
}
public void fadeIn() {
Animation anim = new AlphaAnimation(minBrightness, maxBrightness);
anim.setDuration(duration);
anim.setStartOffset(startOffset);
anim.setFillEnabled(true);
anim.setFillAfter(true);
view.startAnimation(anim);
}
}
| [
"martinpaush@gmail.com"
] | martinpaush@gmail.com |
8a1bea02733a375bd424bc571962cb8466c91f51 | cfc60fc1148916c0a1c9b421543e02f8cdf31549 | /src/testcases/CWE789_Uncontrolled_Mem_Alloc/CWE789_Uncontrolled_Mem_Alloc__max_value_08.java | c459fd44f355844b6f7d1e48b69bc546051e20d1 | [
"LicenseRef-scancode-public-domain"
] | permissive | zhujinhua/GitFun | c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2 | 987f72fdccf871ece67f2240eea90e8c1971d183 | refs/heads/master | 2021-01-18T05:46:03.351267 | 2012-09-11T16:43:44 | 2012-09-11T16:43:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,043 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE789_Uncontrolled_Mem_Alloc__max_value_08.java
Label Definition File: CWE789_Uncontrolled_Mem_Alloc.int.label.xml
Template File: sources-sink-08.tmpl.java
*/
/*
* @description
* CWE: 789 Uncontrolled Memory Allocation
* BadSource: max_value Set data to a hardcoded value of Integer.MAX_VALUE
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* BadSink: HashMap Create a HashMap using data as the initial size
* Flow Variant: 08 Control flow: if(private_returns_t()) and if(private_returns_f())
*
* */
package testcases.CWE789_Uncontrolled_Mem_Alloc;
import testcasesupport.*;
import javax.servlet.http.*;
import java.util.HashMap;
public class CWE789_Uncontrolled_Mem_Alloc__max_value_08 extends AbstractTestCase
{
/* The methods below always return the same value, so a tool
should be able to figure out that every call to these
methods will return true or return false. */
private boolean private_returns_t()
{
return true;
}
private boolean private_returns_f()
{
return false;
}
/* uses badsource and badsink */
public void bad() throws Throwable
{
int data;
if(private_returns_t())
{
data = Integer.MAX_VALUE;
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
/* POTENTIAL FLAW: Create a HashMap using data as the initial size. data may be very large, creating memory issues */
HashMap list = new HashMap(data);
}
/* goodG2B1() - use goodsource and badsink by changing private_returns_t() to private_returns_f() */
private void goodG2B1() throws Throwable
{
int data;
if(private_returns_f())
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
data = Integer.MAX_VALUE;
}
else {
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
/* POTENTIAL FLAW: Create a HashMap using data as the initial size. data may be very large, creating memory issues */
HashMap list = new HashMap(data);
}
/* goodG2B2() - use goodsource and badsink by reversing statements in if */
private void goodG2B2() throws Throwable
{
int data;
if(private_returns_t())
{
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded number that won't cause underflow, overflow,
divide by zero, or loss-of-precision issues */
data = 2;
}
else {
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
data = Integer.MAX_VALUE;
}
/* POTENTIAL FLAW: Create a HashMap using data as the initial size. data may be very large, creating memory issues */
HashMap list = new HashMap(data);
}
public void good() throws Throwable
{
goodG2B1();
goodG2B2();
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
| [
"amitf@chackmarx.com"
] | amitf@chackmarx.com |
23e809364c0e02c8e8f99730ca69b991622335bd | 1e66385a988019b78f02cf0eeda66486052c804b | /src/test/java/io/github/jhipster/application/repository/CustomAuditEventRepositoryIntTest.java | ecfdfa2f5d6912a4b721e847b1d79c9559e98055 | [] | no_license | fer512/Ventas | 3f10e4fb3503a3a0e76721b11cc93d99e7274e61 | 4a26134d03d70b516b8f9d01a97f4df9afc1914d | refs/heads/master | 2020-03-27T07:28:16.118370 | 2018-08-26T15:31:57 | 2018-08-26T15:31:57 | 146,192,847 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,662 | java | package io.github.jhipster.application.repository;
import io.github.jhipster.application.VentasApp;
import io.github.jhipster.application.config.Constants;
import io.github.jhipster.application.config.audit.AuditEventConverter;
import io.github.jhipster.application.domain.PersistentAuditEvent;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.mock.web.MockHttpServletRequest;
import org.springframework.mock.web.MockHttpSession;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpSession;
import java.time.Instant;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
import static io.github.jhipster.application.repository.CustomAuditEventRepository.EVENT_DATA_COLUMN_MAX_LENGTH;
/**
* Test class for the CustomAuditEventRepository class.
*
* @see CustomAuditEventRepository
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = VentasApp.class)
@Transactional
public class CustomAuditEventRepositoryIntTest {
@Autowired
private PersistenceAuditEventRepository persistenceAuditEventRepository;
@Autowired
private AuditEventConverter auditEventConverter;
private CustomAuditEventRepository customAuditEventRepository;
private PersistentAuditEvent testUserEvent;
private PersistentAuditEvent testOtherUserEvent;
private PersistentAuditEvent testOldUserEvent;
@Before
public void setup() {
customAuditEventRepository = new CustomAuditEventRepository(persistenceAuditEventRepository, auditEventConverter);
persistenceAuditEventRepository.deleteAll();
Instant oneHourAgo = Instant.now().minusSeconds(3600);
testUserEvent = new PersistentAuditEvent();
testUserEvent.setPrincipal("test-user");
testUserEvent.setAuditEventType("test-type");
testUserEvent.setAuditEventDate(oneHourAgo);
Map<String, String> data = new HashMap<>();
data.put("test-key", "test-value");
testUserEvent.setData(data);
testOldUserEvent = new PersistentAuditEvent();
testOldUserEvent.setPrincipal("test-user");
testOldUserEvent.setAuditEventType("test-type");
testOldUserEvent.setAuditEventDate(oneHourAgo.minusSeconds(10000));
testOtherUserEvent = new PersistentAuditEvent();
testOtherUserEvent.setPrincipal("other-test-user");
testOtherUserEvent.setAuditEventType("test-type");
testOtherUserEvent.setAuditEventDate(oneHourAgo);
}
@Test
public void addAuditEvent() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("test-value");
assertThat(persistentAuditEvent.getAuditEventDate()).isEqualTo(event.getTimestamp());
}
@Test
public void addAuditEventTruncateLargeData() {
Map<String, Object> data = new HashMap<>();
StringBuilder largeData = new StringBuilder();
for (int i = 0; i < EVENT_DATA_COLUMN_MAX_LENGTH + 10; i++) {
largeData.append("a");
}
data.put("test-key", largeData);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getPrincipal()).isEqualTo(event.getPrincipal());
assertThat(persistentAuditEvent.getAuditEventType()).isEqualTo(event.getType());
assertThat(persistentAuditEvent.getData()).containsKey("test-key");
String actualData = persistentAuditEvent.getData().get("test-key");
assertThat(actualData.length()).isEqualTo(EVENT_DATA_COLUMN_MAX_LENGTH);
assertThat(actualData).isSubstringOf(largeData);
assertThat(persistentAuditEvent.getAuditEventDate()).isEqualTo(event.getTimestamp());
}
@Test
public void testAddEventWithWebAuthenticationDetails() {
HttpSession session = new MockHttpSession(null, "test-session-id");
MockHttpServletRequest request = new MockHttpServletRequest();
request.setSession(session);
request.setRemoteAddr("1.2.3.4");
WebAuthenticationDetails details = new WebAuthenticationDetails(request);
Map<String, Object> data = new HashMap<>();
data.put("test-key", details);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("remoteAddress")).isEqualTo("1.2.3.4");
assertThat(persistentAuditEvent.getData().get("sessionId")).isEqualTo("test-session-id");
}
@Test
public void testAddEventWithNullData() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", null);
AuditEvent event = new AuditEvent("test-user", "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(1);
PersistentAuditEvent persistentAuditEvent = persistentAuditEvents.get(0);
assertThat(persistentAuditEvent.getData().get("test-key")).isEqualTo("null");
}
@Test
public void addAuditEventWithAnonymousUser() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent(Constants.ANONYMOUS_USER, "test-type", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
@Test
public void addAuditEventWithAuthorizationFailureType() {
Map<String, Object> data = new HashMap<>();
data.put("test-key", "test-value");
AuditEvent event = new AuditEvent("test-user", "AUTHORIZATION_FAILURE", data);
customAuditEventRepository.add(event);
List<PersistentAuditEvent> persistentAuditEvents = persistenceAuditEventRepository.findAll();
assertThat(persistentAuditEvents).hasSize(0);
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
75b78f2f0b06ecd270e086c7554b829ecec8758f | e2e1afc468f4a5792ae28cc34b97d51e1ec93e19 | /src/au/com/mineauz/PlayerSpy/Records/ILocationAware.java | 65eb9f237c46a25e6316367abd6eb8fd6da178a9 | [] | no_license | Schmoller/PlayerSpy | edbb671176fabdaacf3131e956edeb88f4b13bc7 | 01ef9d547fd6d55976589030fc4b573b6f461e30 | refs/heads/master | 2021-01-18T23:08:03.233132 | 2013-08-11T00:46:22 | 2013-08-11T00:46:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 149 | java | package au.com.mineauz.PlayerSpy.Records;
import org.bukkit.Location;
public interface ILocationAware
{
public Location getLocation();
}
| [
"steven.schmoll@gmail.com"
] | steven.schmoll@gmail.com |
c327001bc2b3bdb08a644dae7f4f84292fefbdd8 | 069db98b04c2c2b306ca6d0911ecfaa9d3484291 | /chis/src/main/java/chis/source/admin/PublicInfoService.java | 040f3cd525f5d3f1a72ca9d715a0912b8c8c5bde | [] | no_license | zhouhui521/his | 59270696d3667c8c6eb8f7104af0a9501a90942a | 8d26b62e73d6ec95111eff66ab9d7aee61674f73 | refs/heads/master | 2023-02-03T16:20:57.561243 | 2020-12-24T06:33:46 | 2020-12-24T06:33:46 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,240 | java | /**
* @(#)PublicInfoService.java Created on 2012-5-8 上午10:26:29
*
* 版权:版权所有 bsoft 保留所有权力。
*/
package chis.source.admin;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import chis.source.BaseDAO;
import chis.source.Constants;
import chis.source.ModelDataOperationException;
import chis.source.service.AbstractActionService;
import chis.source.service.DAOSupportable;
import chis.source.util.SchemaUtil;
import ctd.service.core.ServiceException;
import ctd.util.context.Context;
/**
* @description
*
* @author <a href="mailto:yaosq@bsoft.com.cn">姚士强</a>
*/
public class PublicInfoService extends AbstractActionService implements
DAOSupportable {
private static final Log logger = LogFactory
.getLog(PublicInfoService.class);
protected void doRemovePublicInfo(Map<String, Object> req,
Map<String, Object> res, BaseDAO dao, Context ctx)
throws ServiceException {
String pkey = (String) req.get("pkey");
String schema = (String) req.get("schema");
PublicInfoModel pim = new PublicInfoModel(dao);
try {
pim.removePublicInfo(pkey, schema);
} catch (ModelDataOperationException e) {
logger.error("Failed to remove PublicInfo .", e);
res.put(RES_CODE, Constants.CODE_DATABASE_ERROR);
res.put(RES_MESSAGE, "删除公告维护信息失败。");
throw new ServiceException(e);
}
}
protected void doSavePublicInfo(Map<String, Object> req,
Map<String, Object> res, BaseDAO dao, Context ctx)
throws ServiceException {
String schema = (String) req.get("schema");
String op = (String) req.get("op");
@SuppressWarnings("unchecked")
Map<String, Object> reqBody = (Map<String, Object>) req.get("body");
PublicInfoModel pim = new PublicInfoModel(dao);
Map<String, Object> body = null;
try {
body = pim.savePublicInfo(schema, op, reqBody);
body = SchemaUtil.setDictionaryMessageForForm(body, schema);
} catch (ModelDataOperationException e) {
logger.error("Failed to save PublicInfo .", e);
res.put(RES_CODE, Constants.CODE_DATABASE_ERROR);
res.put(RES_MESSAGE, "保存公告维护信息失败。");
throw new ServiceException(e);
}
res.put("body", body);
}
}
| [
"renw1@bsoft.com.cn"
] | renw1@bsoft.com.cn |
f3835bebb56f24e83b7f2fb1dee4f4dbda6f71d9 | 18e3cb105ae6e14609b385ee468a34f4fddb0dd6 | /event-parent/domain-event-core/src/test/java/com/github/huifer/domain/event/common/register/EventRegisterMemoryTest.java | 222eefa28570db7cb88fa3454553a101ee05a8c4 | [
"Apache-2.0"
] | permissive | huifer/domain-event | 6ea0100dd48028a97df09d9c097adf0961568572 | 06c143ab50a93514a542b294752eaaf2e7321128 | refs/heads/master | 2022-12-22T19:13:19.060149 | 2020-09-27T03:08:14 | 2020-09-27T03:08:14 | 298,430,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 922 | java | package com.github.huifer.domain.event.common.register;
import com.github.huifer.domain.event.common.handler.EventHandler;
import com.github.huifer.domain.event.common.model.event.BaseEvent;
import org.junit.Assert;
import org.junit.Before;
public class EventRegisterMemoryTest {
EventRegister register;
@Before
public void init() {
register = new EventRegisterMemory();
}
@org.junit.Test
public void register() {
BaseEvent baseEvent = new BaseEvent() {
};
EventHandler<BaseEvent> eventHandler = new EventHandler<BaseEvent>() {
@Override
public void handler(BaseEvent event) {
}
@Override
public Class<?> eventType() {
return null;
}
};
register.register(baseEvent, eventHandler);
Assert.assertTrue(register.map().size() == 1);
Assert.assertTrue(register.map().get(baseEvent.getClass()).get(0).equals(eventHandler));
}
@org.junit.Test
public void testRegister() {
}
} | [
"huifer97@163.com"
] | huifer97@163.com |
febc51419c6b8d5016ad03e932ba4f66a44ec2c7 | bb80d820728ffaaabbf0f1d8b4878b8015a598a5 | /app/src/main/java/com/skyvn/ten/util/PhoneUtils.java | 06f7a2669d9160e4cac51a10f8c6824cd675d164 | [] | no_license | wuliang6661/skyvn_ten1 | 4d7ef9097f3148da6021d29d73c559e70b283267 | 4b92929e804f133409cb41825699c5f53987bb3e | refs/heads/master | 2021-05-18T12:55:41.065976 | 2020-04-15T13:04:25 | 2020-04-15T13:04:25 | 251,250,341 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,192 | java | package com.skyvn.ten.util;
import android.Manifest;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.support.v4.app.ActivityCompat;
public class PhoneUtils {
/**
* 拨打电话(跳转到拨号界面,用户手动点击拨打)
*
* @param phoneNum 电话号码
*/
public static void callPhone(String phoneNum) {
Intent intent = new Intent(Intent.ACTION_CALL);
Uri data = Uri.parse("tel:" + phoneNum);
intent.setData(data);
if (ActivityCompat.checkSelfPermission(AppManager.getAppManager().curremtActivity(), Manifest.permission.CALL_PHONE) !=
PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(AppManager.getAppManager().curremtActivity(),
new String[]{
Manifest.permission.READ_PHONE_STATE,
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.CALL_PHONE
}, 1);
return;
}
AppManager.getAppManager().curremtActivity().startActivity(intent);
}
}
| [
"wuliang6661@163.com"
] | wuliang6661@163.com |
dd45695e6cca13c769d211452918512818f6e4b4 | 34dac51dc8343e825e5683268d12edb01d37b357 | /app/src/main/java/com/recycleview/multitype/bannerviewpager/ViewPagerScroller.java | 4aba432f869f06bb3ada83abd47c9cc14c128284 | [] | no_license | hunimeizi/RecycleViewMultiType | 5491641175a819192ef3c68638c9dfd44be4cd47 | 21e03c7eb6411ad886d6246c729c376239191c99 | refs/heads/master | 2021-01-19T12:36:40.873906 | 2018-08-25T05:56:12 | 2018-08-25T05:56:12 | 88,041,599 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,148 | java | package com.recycleview.multitype.bannerviewpager;
import android.content.Context;
import android.view.animation.Interpolator;
import android.widget.Scroller;
public class ViewPagerScroller extends Scroller {
private int mScrollDuration = 1200;
public ViewPagerScroller(Context context) {
super(context);
}
public ViewPagerScroller(Context context, Interpolator interpolator) {
super(context, interpolator);
}
public ViewPagerScroller(Context context, Interpolator interpolator,
boolean flywheel) {
super(context, interpolator, flywheel);
}
@Override
public void startScroll(int startX, int startY, int dx, int dy, int duration) {
super.startScroll(startX, startY, dx, dy, mScrollDuration);
}
@Override
public void startScroll(int startX, int startY, int dx, int dy) {
super.startScroll(startX, startY, dx, dy, mScrollDuration);
}
public int getScrollDuration() {
return mScrollDuration;
}
public void setScrollDuration(int scrollDuration) {
this.mScrollDuration = scrollDuration;
}
} | [
"342161360@qq.com"
] | 342161360@qq.com |
3f42896e71bd9c9e0450fe746b7ed61abc2f4490 | 647ce242e20bc792b334cf445d1fb3243f0f3b47 | /chintai-migration-cms/src/net/chintai/backend/sysadmin/review/action/ReviewBukkenInfoBackAction.java | 6671a3c5c20e2ab3adbca06cf2750b3cf25c01bf | [] | no_license | sangjiexun/20191031test | 0ce6c9e3dabb7eed465d4add33a107e5b5525236 | 3248d86ce282c1455f2e6ce0e05f0dbd15e51518 | refs/heads/master | 2020-12-14T20:31:05.085987 | 2019-11-01T06:03:50 | 2019-11-01T06:03:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,585 | java | /*
* $Id: ReviewBukkenInfoBackAction.java 3570 2007-12-14 08:55:47Z t-kojima $
* ---------------------------------------------------------
* 更新日 更新者 内容
* ---------------------------------------------------------
* 2007/09/12 BGT)李昊燮 新規作成
*
*/
package net.chintai.backend.sysadmin.review.action;
import org.springframework.context.ApplicationContext;
import net.chintai.backend.sysadmin.common.AuthorityId;
import net.chintai.backend.sysadmin.common.BaseActionSupport;
import net.chintai.backend.sysadmin.common.BusinessContext;
import net.chintai.backend.sysadmin.common.service.AuthService;
/**
* 物件詳細情報画面に戻るアクション
* @author Lee Hosup
* @version $Revision: 3570 $
* Copyright: (C) CHINTAI Corporation All Right Reserved.
*/
public class ReviewBukkenInfoBackAction extends BaseActionSupport {
/*
* (非 Javadoc)
* @see net.chintai.backend.sysadmin.common.BaseActionSupport#isAuthorized(java.lang.String)
*/
@Override
protected boolean isAuthorized(String userId) {
ApplicationContext ac = getWebApplicationContext();
AuthService auth = (AuthService) ac.getBean("authService");
return auth.authenticate(userId, AuthorityId.REVIEW);
}
/*
* (非 Javadoc)
* @see net.chintai.backend.sysadmin.common.BaseActionSupport#doExecute(net.chintai.backend.sysadmin.common.BusinessContext)
*/
@Override
protected void doExecute(BusinessContext context) throws Exception {
context.setForward("success");
}
}
| [
"yuki.hirukawa@ctc-g.co.jp"
] | yuki.hirukawa@ctc-g.co.jp |
5ddb3e00284665b388e0c9f11f97c00d907c07e1 | 254697a961d3b54bd7fb6838cab8bca92ed62966 | /Network/src/main/java/org/voovan/network/messagesplitter/ByteMessageSplitter.java | 4c4318d987ec8c1a56ee82e93dd26ab97efb4f65 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | moyu3390/Voovan | d6f79fb283b24858f5e31338c90b9456e1df3875 | ae1f9539317c0b643660537263169ade400ad8a4 | refs/heads/master | 2023-03-11T09:28:03.847227 | 2022-05-19T14:19:31 | 2022-05-19T14:19:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,389 | java | package org.voovan.network.messagesplitter;
import org.voovan.network.IoSession;
import org.voovan.network.MessageSplitter;
import org.voovan.network.filter.ByteFilter;
import org.voovan.tools.TByte;
import org.voovan.tools.Varint;
import org.voovan.tools.buffer.TByteBuffer;
import java.nio.ByteBuffer;
/**
* Byte数据截断器
* 255+4位为数据长度+255+数据
*
* @author: helyho
* Project: DBase
* Create: 2017/11/1 14:38
*/
public class ByteMessageSplitter implements MessageSplitter {
@Override
public int canSplite(IoSession session, ByteBuffer byteBuffer) {
int originPosition = byteBuffer.position();
int ret = -1;
try {
if (byteBuffer.remaining() > ByteFilter.HEAD_LEGNTH) {
if(byteBuffer.get() == ByteFilter.SPLITER) {
int lengthByteOffset = byteBuffer.position();
int length = Varint.varintToInt(byteBuffer);
int lengthByteSize = byteBuffer.position() - lengthByteOffset;
if(length < 0){
session.close();
}
if(byteBuffer.hasRemaining()) {
if (byteBuffer.get() == ByteFilter.SPLITER) {
if (length > 0 && byteBuffer.remaining() >= length) {
ret = ByteFilter.HEAD_LEGNTH + lengthByteSize + length;
}
} else {
session.close();
}
}
} else {
session.close();
}
}
} finally {
byteBuffer.position(originPosition);
}
return ret;
}
}
| [
"helyho@gmail.com"
] | helyho@gmail.com |
5e511d9c341d3adbf721c6ec6dcc4643428fb09b | 68a19507f18acff18aa4fa67d6611f5b8ac8913c | /plfx/plfx-jd/plfx-jd-pojo/src/main/java/plfx/jd/pojo/dto/ylclient/hotel/HotelDTO.java | 638d339bc70d5759e7a186a91ff4620233d1f062 | [] | no_license | ksksks2222/pl-workspace | cf0d0be2dfeaa62c0d4d5437f85401f60be0eadd | 6146e3e3c2384c91cac459d25b27ffeb4f970dcd | refs/heads/master | 2021-09-13T08:59:17.177105 | 2018-04-27T09:46:42 | 2018-04-27T09:46:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,353 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// 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: 2014.10.30 at 10:29:41 AM CST
//
package plfx.jd.pojo.dto.ylclient.hotel;
import java.math.BigDecimal;
import java.util.List;
import plfx.jd.pojo.dto.ylclient.order.PrepayRuleDTO;
/**
*
* @类功能说明:酒店信息
* @类修改者:
* @修改日期:
* @修改说明:
* @公司名称:浙江汇购科技有限公司
* @部门:技术部
* @作者:yaosanfeng
* @创建时间:2015年3月26日上午10:50:03
* @版本:V1.0
*
*/
public class HotelDTO {
/**
* 酒店id
*/
protected String hotelId;
/**
* 最小价格
*/
protected BigDecimal lowRate;
/**
* 最低价格的货币
*/
protected String currencyCode;
/**
* 酒店设置
*/
protected String facilities;
/**
* 距离
*/
protected BigDecimal distance;
/**
* 预定规则
*/
protected List<BookingRuleDTO> bookingRules;
/**
* 担保规则
*/
protected List<GuaranteeRuleDTO> guaranteeRules;
/**
* 预付规则
*/
protected List<PrepayRuleDTO> prepayRules;
/**
* 增值服务
*/
protected List<ValueAddDTO> valueAdds;
/**
* 促销规则
*/
protected List<DrrRuleDTO> drrRules;
/**
* 房间
*/
protected List<RoomDTO> rooms;
/**
* 酒店信息
*/
protected DetailDTO detail;
/**
* 图片集合
*/
protected List<HotelImgDTO> images;
/**
* 送礼活动集合
*/
protected List<GiftDTO> gifts;
/**
* 酒店特殊信息提示集合
*/
protected List<HAvailPolicyDTO> hAvailPolicys;
public String getHotelId() {
return hotelId;
}
public void setHotelId(String hotelId) {
this.hotelId = hotelId;
}
public BigDecimal getLowRate() {
return lowRate;
}
public void setLowRate(BigDecimal lowRate) {
this.lowRate = lowRate;
}
public String getCurrencyCode() {
return currencyCode;
}
public void setCurrencyCode(String currencyCode) {
this.currencyCode = currencyCode;
}
public String getFacilities() {
return facilities;
}
public void setFacilities(String facilities) {
this.facilities = facilities;
}
public BigDecimal getDistance() {
return distance;
}
public void setDistance(BigDecimal distance) {
this.distance = distance;
}
public List<BookingRuleDTO> getBookingRules() {
return bookingRules;
}
public void setBookingRules(List<BookingRuleDTO> bookingRules) {
this.bookingRules = bookingRules;
}
public List<GuaranteeRuleDTO> getGuaranteeRules() {
return guaranteeRules;
}
public void setGuaranteeRules(List<GuaranteeRuleDTO> guaranteeRules) {
this.guaranteeRules = guaranteeRules;
}
public List<PrepayRuleDTO> getPrepayRules() {
return prepayRules;
}
public void setPrepayRules(List<PrepayRuleDTO> prepayRules) {
this.prepayRules = prepayRules;
}
public List<ValueAddDTO> getValueAdds() {
return valueAdds;
}
public void setValueAdds(List<ValueAddDTO> valueAdds) {
this.valueAdds = valueAdds;
}
public List<DrrRuleDTO> getDrrRules() {
return drrRules;
}
public void setDrrRules(List<DrrRuleDTO> drrRules) {
this.drrRules = drrRules;
}
public List<RoomDTO> getRooms() {
return rooms;
}
public void setRooms(List<RoomDTO> rooms) {
this.rooms = rooms;
}
public DetailDTO getDetail() {
return detail;
}
public void setDetail(DetailDTO detail) {
this.detail = detail;
}
public List<HotelImgDTO> getImages() {
return images;
}
public void setImages(List<HotelImgDTO> images) {
this.images = images;
}
public List<GiftDTO> getGifts() {
return gifts;
}
public void setGifts(List<GiftDTO> gifts) {
this.gifts = gifts;
}
public List<HAvailPolicyDTO> gethAvailPolicys() {
return hAvailPolicys;
}
public void sethAvailPolicys(List<HAvailPolicyDTO> hAvailPolicys) {
this.hAvailPolicys = hAvailPolicys;
}
}
| [
"cangsong6908@gmail.com"
] | cangsong6908@gmail.com |
5f6af85f3982e3954027f49a067c4452be0bff34 | cc28075c28a05af4a45d712d246a8983ed38786e | /com/sun/corba/se/PortableActivationIDL/LocatorPackage/ServerLocationPerORBHolder.java | a6a35e8c4e7f38e6353710d662d575ca2de91720 | [] | no_license | lionhuo/jdk8u202 | cabfaa57f37f149649ccf329812cf5a1dc3ad207 | f03d6563dd4655b0491fe2f58a6cc16505caacbf | refs/heads/master | 2020-04-22T19:38:29.464485 | 2019-02-14T02:59:51 | 2019-02-14T02:59:51 | 170,614,337 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,312 | java | package com.sun.corba.se.PortableActivationIDL.LocatorPackage;
/**
* com/sun/corba/se/PortableActivationIDL/LocatorPackage/ServerLocationPerORBHolder.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /HUDSON/workspace/8-2-build-linux-amd64/jdk8u202/12319/corba/src/share/classes/com/sun/corba/se/PortableActivationIDL/activation.idl
* Saturday, December 15, 2018 12:40:35 PM PST
*/
public final class ServerLocationPerORBHolder implements org.omg.CORBA.portable.Streamable
{
public com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB value = null;
public ServerLocationPerORBHolder ()
{
}
public ServerLocationPerORBHolder (com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORB initialValue)
{
value = initialValue;
}
public void _read (org.omg.CORBA.portable.InputStream i)
{
value = com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.read (i);
}
public void _write (org.omg.CORBA.portable.OutputStream o)
{
com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.write (o, value);
}
public org.omg.CORBA.TypeCode _type ()
{
return com.sun.corba.se.PortableActivationIDL.LocatorPackage.ServerLocationPerORBHelper.type ();
}
}
| [
"200583820@qq.com"
] | 200583820@qq.com |
6f6f3071c8a4a8dc9d4b59c1fcae264857a0427b | 7280ffbd493bcd3eb2c81d167b5cf912af351113 | /org.cfeclipse.cfml/src/org/cfeclipse/cfml/preferences/CFMLPreferencesMessages.java | d85d6363bae3ab6814870825e931d857786a5e0b | [
"MIT"
] | permissive | cfeclipse/cfeclipse | 6cb02d34c1fd42fcfec588b13d780a82d073fc9c | c894f73c9aefe50748f818ced48b9bffa193168e | refs/heads/master | 2023-01-11T13:37:46.528453 | 2022-12-30T02:38:23 | 2022-12-30T02:38:23 | 1,813,144 | 51 | 29 | null | 2022-12-30T02:39:40 | 2011-05-28T05:28:49 | Java | UTF-8 | Java | false | false | 2,484 | java | /**********************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This
* program and the accompanying materials are made available under the terms of
* the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM - Initial API and implementation
**********************************************************************/
package org.cfeclipse.cfml.preferences;
import org.eclipse.osgi.util.NLS;
public class CFMLPreferencesMessages extends NLS {
private static final String BUNDLE_NAME = "org.cfeclipse.cfml.preferences.CFMLPreferencesMessages";//$NON-NLS-1$
public static String CFMLEditorPreferencePage_9;
public static String CFMLCodeFormatterPreferencePage_0;
public static String CFMLCodeFormatterPreferencePage_1;
public static String CFMLCodeFormatterPreferencePage_2;
public static String CFMLCodeFormatterPreferencePage_3;
public static String CFMLCodeFormatterPreferencePage_4;
public static String CFMLCodeFormatterPreferencePage_5;
public static String CFMLCodeFormatterPreferencePage_6;
public static String CFMLCodeFormatterPreferencePage_7;
public static String CFMLCodeFormatterPreferencePage_8;
public static String CFMLCodeFormatterPreferencePage_9;
public static String CFMLCodeFormatterPreferencePage_10;
public static String CFMLCodeFormatterPreferencePage_11;
public static String CFMLCodeFormatterPreferencePage_12;
public static String CFMLCodeFormatterPreferencePage_13;
public static String CFMLCodeFormatterPreferencePage_14;
public static String CFMLCodeFormatterPreferencePage_15;
public static String CFMLCodeFormatterPreferencePage_16;
public static String CFMLCodeFormatterPreferencePage_17;
public static String CFMLCodeFormatterPreferencePage_18;
public static String CFMLCodeFormatterPreferencePage_19;
public static String CFMLCodeFormatterPreferencePage_CloseTagList;
public static String CFMLCodeFormatterPreferencePage_IgnoredTags;
public static String CFMLCodeFormatterPreferencePage_FormatJS;
public static String CFMLCodeFormatterPreferencePage_FormatCSS;
public static String CFMLCodeFormatterPreferencePage_FormatCFScript;
public static String CFMLCodeFormatterPreferencePage_BracesOnOwnLine;
static {
// load message values from bundle file
NLS.initializeMessages(BUNDLE_NAME, CFMLPreferencesMessages.class);
}
} | [
"valliantster@gmail.com"
] | valliantster@gmail.com |
9da13d21e9dc0ad8ebfcd6110755436037e41eda | 728b37e3a817c3b2847ef21c6d0da34bc7078fb6 | /codjo-segmentation-gui/src/main/java/net/codjo/segmentation/gui/editor/EditorEventManager.java | 7240c84d23d10cf22d14aabfc83362e6fdd46710 | [] | no_license | codjo-sandbox/codjo-segmentation | 69886ffb2a0ebb4a483c84693eead3eef7661c6b | 743fdebbee1943e69b062e1557ad2ebd50613a31 | refs/heads/integration | 2020-12-25T17:44:28.733680 | 2015-08-05T15:02:43 | 2015-08-05T15:02:43 | 3,581,425 | 0 | 0 | null | null | null | null | ISO-8859-2 | Java | false | false | 1,642 | java | /*
* codjo.net
*
* Common Apache License 2.0
*/
package net.codjo.segmentation.gui.editor;
import java.awt.event.MouseListener;
import java.util.Collection;
import java.util.Map;
import javax.swing.text.SimpleAttributeSet;
import javax.swing.event.ListSelectionListener;
/**
* Gestionnaire des événements de l'éditeur d'expressions.
*
* @version $Revision: 1.6 $
*/
public class EditorEventManager {
private EditorMainPanelLogic editorMainPanelLogic;
public EditorEventManager(EditorMainPanelLogic editorMainPanelLogic) {
this.editorMainPanelLogic = editorMainPanelLogic;
}
public void addColumnsListListener(ListSelectionListener listener) {
editorMainPanelLogic.getEditorMainPanelGui().getFamilyFieldJList()
.addListSelectionListener(listener);
}
public Map getFieldMap() {
return editorMainPanelLogic.getFieldMap();
}
public MouseListener getjListMouseListener() {
return editorMainPanelLogic.getjListMouseListener();
}
public void insertText(String text) {
editorMainPanelLogic.insertText(text);
}
public void addMapToBeReplaced(Map toBeReplaced) {
editorMainPanelLogic.addMapToBeReplaced(toBeReplaced);
}
public void addStringsStyle(SimpleAttributeSet attributeStyle, Collection stringStyle) {
StringsStyle stringsStyle = new StringsStyle(attributeStyle, stringStyle);
editorMainPanelLogic.addStringsStyle(stringsStyle);
}
public void initFieldListPopupMenu(ValueListPanel valueListPanel) {
editorMainPanelLogic.initFieldListPopupMenu(valueListPanel);
}
}
| [
"admin@codjo.net"
] | admin@codjo.net |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.