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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0dab63b9ab917757bbf8941f5ac9bd806b6f0bcc | 6ebe48d7fca9467ef02df22cb3a3ddb681f02be5 | /Open Source Java Projects- Experimental Subjects/36_schemaspy/minimized-evosuite/net/sourceforge/schemaspy/util/DbSpecificConfigEvoSuiteTest.java | 51c0a69b3cedfd1b1aef5a13afe3b45bc5213fcc | [] | no_license | mubparekh/MS-Computer-Science-Masters-Project | 889d3798357a51e8bb72501b74026365e5d8e34f | d3d5cd77270e2a3ed4af829430940da18a8d5595 | refs/heads/master | 2021-01-22T21:12:38.934221 | 2017-03-20T13:13:28 | 2017-03-20T13:13:28 | 85,402,502 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,601 | java | /*
* This file was automatically generated by EvoSuite
*/
package net.sourceforge.schemaspy.util;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
import net.sourceforge.schemaspy.Config;
import net.sourceforge.schemaspy.util.DbSpecificConfig;
public class DbSpecificConfigEvoSuiteTest {
//Test case number: 0
/*
* 13 covered goals:
* 1 net.sourceforge.schemaspy.util.DbSpecificConfig.getOptions()Ljava/util/List;: root-Branch
* 2 net.sourceforge.schemaspy.util.DbSpecificConfig.<init>(Ljava/lang/String;)V: root-Branch
* 3 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I19 Branch 1 IFEQ L66 - true
* 4 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I19 Branch 1 IFEQ L66 - false
* 5 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I30 Branch 2 IFLE L68 - true
* 6 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I30 Branch 2 IFLE L68 - false
* 7 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I41 Branch 3 IFLE L70 - true
* 8 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I41 Branch 3 IFLE L70 - false
* 9 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I50 Branch 4 IFEQ L73 - true
* 10 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I50 Branch 4 IFEQ L73 - false
* 11 net.sourceforge.schemaspy.util.DbSpecificConfig.dumpUsage()V: I41 Branch 5 IFEQ L107 - true
* 12 net.sourceforge.schemaspy.util.DbSpecificConfig.dumpUsage()V: I41 Branch 5 IFEQ L107 - false
* 13 net.sourceforge.schemaspy.util.DbSpecificConfig.dumpUsage()V: I61 Branch 6 IFNULL L108 - false
*/
@Test
public void test0() throws Throwable {
DbSpecificConfig dbSpecificConfig0 = new DbSpecificConfig("ora");
dbSpecificConfig0.dumpUsage();
assertEquals("Oracle with OCI8 Driver", dbSpecificConfig0.toString());
}
//Test case number: 2
/*
* 10 covered goals:
* 1 net.sourceforge.schemaspy.util.DbSpecificConfig.getConfig()Lnet/sourceforge/schemaspy/Config;: root-Branch
* 2 net.sourceforge.schemaspy.util.DbSpecificConfig.<init>(Ljava/lang/String;)V: root-Branch
* 3 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I19 Branch 1 IFEQ L66 - true
* 4 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I19 Branch 1 IFEQ L66 - false
* 5 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I30 Branch 2 IFLE L68 - true
* 6 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I30 Branch 2 IFLE L68 - false
* 7 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I41 Branch 3 IFLE L70 - true
* 8 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I41 Branch 3 IFLE L70 - false
* 9 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I50 Branch 4 IFEQ L73 - true
* 10 net.sourceforge.schemaspy.util.DbSpecificConfig.loadOptions(Ljava/util/Properties;)V: I50 Branch 4 IFEQ L73 - false
*/
@Test
public void test2() throws Throwable {
DbSpecificConfig dbSpecificConfig0 = new DbSpecificConfig("ora");
Config config0 = dbSpecificConfig0.getConfig();
assertEquals("schemaSpy.css", config0.getCss());
}
}
| [
"mparekh@uccs.edu"
] | mparekh@uccs.edu |
ad258ee003888088e3b92c509578eb8d3e8256d5 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project33/src/test/java/org/gradle/test/performance33_1/Test33_2.java | e0e514516a0ed3ddb0bb9b3e473633a04d3180a9 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 286 | java | package org.gradle.test.performance33_1;
import static org.junit.Assert.*;
public class Test33_2 {
private final Production33_2 production = new Production33_2("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
1b8c9450d0ba94c9761f470359c22c3e15502722 | 471579962eb0abf949c73685353ef0098a8ad127 | /HelloGradle/src/main/java/com/kaifantech/component/timer/taskexe/auto/TaskexeAutoDealTimer.java | 2e2a8f8c8eb51b281d1688518de0895baf5e4133 | [] | no_license | huyulin11/gradle | a727c7e31b9a42aee6decd5d6a5f5ceac84180f3 | 3cdc3b8b02e9f48af93d1cc6087b61f67cf45a0e | refs/heads/master | 2020-04-13T07:09:16.437325 | 2019-02-26T03:20:13 | 2019-02-26T03:20:13 | 163,042,029 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,783 | java | package com.kaifantech.component.timer.taskexe.auto;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Lazy;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import com.kaifantech.component.business.ctrl.deal.ICtrlDealModule;
import com.kaifantech.component.business.task.deal.ITaskexeDealModule;
import com.kaifantech.init.sys.params.SystemParameters;
import com.kaifantech.init.sys.qualifier.SystemQualifier;
import com.kaifantech.util.thread.ThreadTool;
@Component
@Lazy(false)
public class TaskexeAutoDealTimer {
private static boolean isTaskRunning = false;
private static boolean isCtrlRunning = false;
private static String timerType = "任务处理器";
private final Logger logger = Logger.getLogger(TaskexeAutoDealTimer.class);
@Autowired
@Qualifier(SystemQualifier.DEFAULT_TASKEXE_DEALER_MODULE)
private ITaskexeDealModule taskModule;
@Autowired
@Qualifier(SystemQualifier.DEFAULT_CTRL_DEALER_MODULE)
private ICtrlDealModule ctrlModule;
public TaskexeAutoDealTimer() {
logger.info(timerType + "开始启动!");
}
@Scheduled(cron = "0/1 * * * * ?")
public void resoluteTaskexe() {
if (!SystemParameters.isConnectIotClient()) {
return;
}
dealCtrl();
dealTaskexe();
}
private void dealTaskexe() {
ThreadTool.run(() -> {
if (!isTaskRunning) {
isTaskRunning = true;
taskModule.startControl();
}
isTaskRunning = false;
});
}
private void dealCtrl() {
ThreadTool.run(() -> {
if (!isCtrlRunning) {
isCtrlRunning = true;
ctrlModule.startControl();
}
isCtrlRunning = false;
});
}
}
| [
"huyulin11@sina.cn"
] | huyulin11@sina.cn |
2acbd349b50456fc0cdaeff3f18ea926f1361057 | f6c8ef02c43ab6ec6d941cf93b9c454e19c6a6ee | /src/com/company/Lesson_13_Sort_String_bubble/Test13_01.java | 30baff25605bbf4e40cd38e07e14fbc7a6061fe1 | [] | no_license | VasylN/Tutor_project | 0b96e3437b15b4e55c9806dfde13c4338cf28784 | 835080f6c767f5e8d14d800f0d6d032445677626 | refs/heads/master | 2021-01-22T21:48:57.478089 | 2017-05-24T18:02:39 | 2017-05-24T18:02:39 | 85,478,361 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,113 | java | package com.company.Lesson_13_Sort_String_bubble;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Pc on 23.10.2016.
*/
/* Семья
Создай класс Human с полями имя(String), пол(boolean),возраст(int), отец(Human), мать(Human).
Создай объекты и заполни их так, чтобы получилось: Два дедушки, две бабушки, отец, мать, трое детей.
Вывести объекты на экран.
Примечание:
Если написать свой метод String toString() в классе Human, то именно он будет использоваться при выводе объекта на экран.
Пример вывода:
Имя: Аня, пол: женский, возраст: 21, отец: Павел, мать: Катя
Имя: Катя, пол: женский, возраст: 55
Имя: Игорь, пол: мужской, возраст: 2, отец: Михаил, мать: Аня
…
*/
public class Test13_01 {
public static void main(String[] args) {
Human grandeFather1 = new Human("Дед Иван", true, 80, null,null);
Human grandeFather2 = new Human("Ded Igor" , true, 79, null,null);
Human grandeMather1 = new Human("Baba Ania", false,70,null,null);
Human grandeMather2 = new Human("Baba Tania", false,69,null,null);
Human father = new Human("papa Kolia", true, 50,grandeFather1,grandeMather2);
Human mather = new Human("mama Olia", false, 49,grandeFather2,grandeMather2);
Human child1 = new Human("kid Sasha" , true, 30,mather,father);
Human child2 = new Human("kid Pasha" , true, 25,mather,father);
Human child3 = new Human("kid Katia" , false, 20,mather,father);
List<Human> list = new ArrayList<>();
list.add(grandeFather1);
list.add(grandeFather2);
list.add(grandeMather1);
list.add(grandeMather2);
list.add(father);
list.add(mather);
list.add(child1);
list.add(child2);
list.add(child3);
for (Human human : list) {
System.out.println(human);
}
}
public static class Human {
String name;
boolean sex;
int age;
Human father;
Human mather;
Human(String n, boolean sex, int age, Human father, Human mather) {
this.name = n;
this.sex = sex;
this.age = age;
this.father = father;
this.mather = mather;
}
@Override
public String toString() {
String text = "";
text += "Имя: " + this.name;
text += ", пол: " + (this.sex ? "мужской" : "женский");
text += ", возраст: " + this.age;
if(this.father != null){
text += ", отец: " + this.father.name;
}
if (this.mather != null){
text += ", мать: " + this.mather.name;
}
return text;
}
}
}
| [
"vasyln86@gmail.com"
] | vasyln86@gmail.com |
177654406587b013a624f12f47292c4202616d3f | 6c7510ea9afc8b4367197a4772c21f9465e9625a | /javaBasic/src/尚硅谷/java基础/day06_day18/day13/com/atguigu/exer2/MyDateTest.java | 0ab3992cfaba734e8d62825b413948975ab4df46 | [] | no_license | 17551085204/javaStudy | 4afa9bfe131a7996e19f93c1c97961c5bf863a2e | 52e230f043c9fa2655f03a17ca23dd27deab86e5 | refs/heads/main | 2023-03-04T21:03:19.329229 | 2021-02-07T01:00:36 | 2021-02-07T01:00:36 | 315,607,992 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,730 | java | package 尚硅谷.java基础.day06_day18.day13.com.atguigu.exer2;
public class MyDateTest {
public static void main(String[] args) {
MyDate m1 = new MyDate(14, 3, 1976);
MyDate m2 = new MyDate(14, 3, 1976);
if (m1 == m2) {
System.out.println("m1==m2");
} else {
System.out.println("m1!=m2"); // m1 != m2
}
if (m1.equals(m2)) {
System.out.println("m1 is equal to m2");// m1 is equal to m2
} else {
System.out.println("m1 is not equal to m2");
}
}
}
class MyDate{
private int day;
private int month;
private int year;
public MyDate(int day, int month, int year) {
super();
this.day = day;
this.month = month;
this.year = year;
}
public int getDay() {
return day;
}
public void setDay(int day) {
this.day = day;
}
public int getMonth() {
return month;
}
public void setMonth(int month) {
this.month = month;
}
public int getYear() {
return year;
}
public void setYear(int year) {
this.year = year;
}
@Override
public boolean equals(Object obj) {
if(this == obj){
return true;
}
if(obj instanceof MyDate){
MyDate myDate = (MyDate)obj;
return this.day == myDate.day && this.month == myDate.month &&
this.year == myDate.year;
}
return false;
}
// @Override
// public boolean equals(Object obj) {
// if (this == obj)
// return true;
// if (obj == null)
// return false;
// if (getClass() != obj.getClass())
// return false;
// MyDate other = (MyDate) obj;
// if (day != other.day)
// return false;
// if (month != other.month)
// return false;
// if (year != other.year)
// return false;
// return true;
// }
}
| [
"2890241339@qq.com"
] | 2890241339@qq.com |
f93bf5a504cc15abdcee5d05012880c07d5e7843 | 5e224ff6d555ee74e0fda6dfa9a645fb7de60989 | /database/src/main/java/adila/db/klteactive.java | aa3b7774d3937baefb5829fe30481fa4a7a092d7 | [
"MIT"
] | permissive | karim/adila | 8b0b6ba56d83f3f29f6354a2964377e6197761c4 | 00f262f6d5352b9d535ae54a2023e4a807449faa | refs/heads/master | 2021-01-18T22:52:51.508129 | 2016-11-13T13:08:04 | 2016-11-13T13:08:04 | 45,054,909 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 242 | java | // This file is automatically generated.
package adila.db;
/*
* Samsung Galaxy S5 Active
*
* DEVICE: klteactive
* MODEL: SM-G870F
*/
final class klteactive {
public static final String DATA = "Samsung|Galaxy S5 Active|Galaxy S";
}
| [
"keldeeb@gmail.com"
] | keldeeb@gmail.com |
1f21be65237fcf657f62d9901fa05daece459c32 | 6c11df8d2ba06f25e8f2372bc7b68f0cd62e7ac6 | /hr2-java-parent/hr2-rest-api/src/main/java/hu/interconnect/hr/web/rest/scheduledtasks/ScheduledtasksRestController.java | e6e366e2ff64e487d2e522385304e8363d736d71 | [
"MIT"
] | permissive | tornaia/hr2 | 24c6bece39fdc3c9333432a32fb3f781ade9789a | 45a952294b90c2a86dfdda86d1c15c2f3b0e635e | refs/heads/master | 2021-01-17T13:29:27.893139 | 2018-11-19T16:28:13 | 2018-11-19T16:28:13 | 52,294,150 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,934 | java | package hu.interconnect.hr.web.rest.scheduledtasks;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import hu.interconnect.hr.backend.api.dto.IdozitettFuttatasResponseDTO;
import hu.interconnect.hr.backend.api.dto.IdozitettFuttatasokResponseDTO;
import hu.interconnect.hr.backend.api.service.ScheduledtasksCommandService;
import hu.interconnect.hr.backend.api.service.ScheduledtasksQueryService;
@RestController
@RequestMapping("/api/v1/scheduledtasks")
public class ScheduledtasksRestController {
private ScheduledtasksQueryService scheduledtasksQueryService;
private ScheduledtasksCommandService scheduledtasksCommandService;
@Autowired
public ScheduledtasksRestController(ScheduledtasksQueryService scheduledtasksQueryService, ScheduledtasksCommandService scheduledtasksCommandService) {
this.scheduledtasksQueryService = scheduledtasksQueryService;
this.scheduledtasksCommandService = scheduledtasksCommandService;
}
@RequestMapping(value = "/list", method=RequestMethod.GET)
public IdozitettFuttatasokResponseDTO get() {
return scheduledtasksQueryService.get();
}
@RequestMapping(value = "/details/{feladat}", method=RequestMethod.GET)
public IdozitettFuttatasokResponseDTO details(@PathVariable String feladat) {
return scheduledtasksQueryService.details(feladat);
}
@RequestMapping(value = "/detail/{id}", method=RequestMethod.GET)
public IdozitettFuttatasResponseDTO details(@PathVariable int id) {
return scheduledtasksQueryService.detail(id);
}
@RequestMapping(value = "/start/{feladat}", method=RequestMethod.POST)
public void start(@PathVariable String feladat) {
scheduledtasksCommandService.start(feladat);
}
}
| [
"tornai.andras.ede@gmail.com"
] | tornai.andras.ede@gmail.com |
2da271a81c93c2300f17556950822a15bfbf7a75 | 9661b969a0b1dc82b687db1fa068f67cfa454e66 | /code/jsonstar-core-0.0.1/src/com/jsonstar/core/type/CharTypes.java | cdd1cdad4eef3bfa3d6a82098297fa675fb8ca25 | [] | no_license | netwelfare/jsonstar | c68289490435e6b86ed5cde945a81b70fcbf0a08 | 56c8e653c1343fd49e93bb4c70793a322a770968 | refs/heads/master | 2020-06-14T00:43:30.396653 | 2016-12-18T10:27:59 | 2016-12-18T10:27:59 | 75,537,290 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,687 | java | package com.jsonstar.core.type;
import java.util.Arrays;
public final class CharTypes
{
private final static char[] HEX_CHARS = "0123456789ABCDEF".toCharArray();
private final static byte[] HEX_BYTES;
static
{
int len = HEX_CHARS.length;
HEX_BYTES = new byte[len];
for (int i = 0; i < len; ++i)
{
HEX_BYTES[i] = (byte) HEX_CHARS[i];
}
}
/**
* Lookup table used for determining which input characters
* need special handling when contained in text segment.
*/
final static int[] sInputCodes;
static
{
/* 96 would do for most cases (backslash is ascii 94)
* but if we want to do lookups by raw bytes it's better
* to have full table
*/
int[] table = new int[256];
// Control chars and non-space white space are not allowed unquoted
for (int i = 0; i < 32; ++i)
{
table[i] = -1;
}
// And then string end and quote markers are special too
table['"'] = 1;
table['\\'] = 1;
sInputCodes = table;
}
/**
* Additionally we can combine UTF-8 decoding info into similar
* data table.
*/
final static int[] sInputCodesUtf8;
static
{
int[] table = new int[sInputCodes.length];
System.arraycopy(sInputCodes, 0, table, 0, sInputCodes.length);
for (int c = 128; c < 256; ++c)
{
int code;
// We'll add number of bytes needed for decoding
if ((c & 0xE0) == 0xC0)
{ // 2 bytes (0x0080 - 0x07FF)
code = 2;
}
else if ((c & 0xF0) == 0xE0)
{ // 3 bytes (0x0800 - 0xFFFF)
code = 3;
}
else if ((c & 0xF8) == 0xF0)
{
// 4 bytes; double-char with surrogates and all...
code = 4;
}
else
{
// And -1 seems like a good "universal" error marker...
code = -1;
}
table[c] = code;
}
sInputCodesUtf8 = table;
}
/**
* To support non-default (and -standard) unquoted field names mode,
* need to have alternate checking.
* Basically this is list of 8-bit ASCII characters that are legal
* as part of Javascript identifier
*/
final static int[] sInputCodesJsNames;
static
{
int[] table = new int[256];
// Default is "not a name char", mark ones that are
Arrays.fill(table, -1);
// Assume rules with JS same as Java (change if/as needed)
for (int i = 33; i < 256; ++i)
{
if (Character.isJavaIdentifierPart((char) i))
{
table[i] = 0;
}
}
/* As per [JACKSON-267], '@', '#' and '*' are also to be accepted as well.
* And '-' (for hyphenated names); and '+' for sake of symmetricity...
*/
table['@'] = 0;
table['#'] = 0;
table['*'] = 0;
table['-'] = 0;
table['+'] = 0;
sInputCodesJsNames = table;
}
/**
* This table is similar to Latin-1, except that it marks all "high-bit"
* code as ok. They will be validated at a later point, when decoding
* name
*/
final static int[] sInputCodesUtf8JsNames;
static
{
int[] table = new int[256];
// start with 8-bit JS names
System.arraycopy(sInputCodesJsNames, 0, table, 0, sInputCodesJsNames.length);
Arrays.fill(table, 128, 128, 0);
sInputCodesUtf8JsNames = table;
}
/**
* Decoding table used to quickly determine characters that are
* relevant within comment content
*/
final static int[] sInputCodesComment = new int[256];
static
{
// but first: let's start with UTF-8 multi-byte markers:
System.arraycopy(sInputCodesUtf8, 128, sInputCodesComment, 128, 128);
// default (0) means "ok" (skip); -1 invalid, others marked by char itself
Arrays.fill(sInputCodesComment, 0, 32, -1); // invalid white space
sInputCodesComment['\t'] = 0; // tab is still fine
sInputCodesComment['\n'] = '\n'; // lf/cr need to be observed, ends cpp comment
sInputCodesComment['\r'] = '\r';
sInputCodesComment['*'] = '*'; // end marker for c-style comments
}
/**
* Lookup table used for determining which output characters in
* 7-bit ASCII range need to be quoted.
*/
final static int[] sOutputEscapes128;
static
{
int[] table = new int[128];
// Control chars need generic escape sequence
for (int i = 0; i < 32; ++i)
{
// 04-Mar-2011, tatu: Used to use "-(i + 1)", replaced with constants
table[i] = CharacterEscapes.ESCAPE_STANDARD;
}
/* Others (and some within that range too) have explicit shorter
* sequences
*/
table['"'] = '"';
table['\\'] = '\\';
// Escaping of slash is optional, so let's not add it
table[0x08] = 'b';
table[0x09] = 't';
table[0x0C] = 'f';
table[0x0A] = 'n';
table[0x0D] = 'r';
sOutputEscapes128 = table;
}
/**
* Lookup table for the first 128 Unicode characters (7-bit ASCII)
* range. For actual hex digits, contains corresponding value;
* for others -1.
*/
final static int[] sHexValues = new int[128];
static
{
Arrays.fill(sHexValues, -1);
for (int i = 0; i < 10; ++i)
{
sHexValues['0' + i] = i;
}
for (int i = 0; i < 6; ++i)
{
sHexValues['a' + i] = 10 + i;
sHexValues['A' + i] = 10 + i;
}
}
public final static int[] getInputCodeLatin1()
{
return sInputCodes;
}
public final static int[] getInputCodeUtf8()
{
return sInputCodesUtf8;
}
public final static int[] getInputCodeLatin1JsNames()
{
return sInputCodesJsNames;
}
public final static int[] getInputCodeUtf8JsNames()
{
return sInputCodesUtf8JsNames;
}
public final static int[] getInputCodeComment()
{
return sInputCodesComment;
}
/**
* Accessor for getting a read-only encoding table for first 128 Unicode
* code points (single-byte UTF-8 characters).
* Value of 0 means "no escaping"; other positive values that value is character
* to use after backslash; and negative values that generic (backslash - u)
* escaping is to be used.
*/
public final static int[] get7BitOutputEscapes()
{
return sOutputEscapes128;
}
public static int charToHex(int ch)
{
return (ch > 127) ? -1 : sHexValues[ch];
}
public static void appendQuoted(StringBuilder sb, String content)
{
final int[] escCodes = sOutputEscapes128;
int escLen = escCodes.length;
for (int i = 0, len = content.length(); i < len; ++i)
{
char c = content.charAt(i);
if (c >= escLen || escCodes[c] == 0)
{
sb.append(c);
continue;
}
sb.append('\\');
int escCode = escCodes[c];
if (escCode < 0)
{ // generic quoting (hex value)
// We know that it has to fit in just 2 hex chars
sb.append('u');
sb.append('0');
sb.append('0');
int value = -(escCode + 1);
sb.append(HEX_CHARS[value >> 4]);
sb.append(HEX_CHARS[value & 0xF]);
}
else
{ // "named", i.e. prepend with slash
sb.append((char) escCode);
}
}
}
public static char[] copyHexChars()
{
return (char[]) HEX_CHARS.clone();
}
public static byte[] copyHexBytes()
{
return (byte[]) HEX_BYTES.clone();
}
}
| [
"didawangxiaofei@126.com"
] | didawangxiaofei@126.com |
3bb4464c2591c612faa058919c3c7b545155fa58 | f5d98583924587b5628f98d882051b6d3ddb9eb1 | /chapter02_algs4/src/main/java/com/edu/princeton/cs/algs4/InplaceMSD.java | 7e33b74737e289e65b304b8bfa48d446cea68bbb | [] | no_license | noudisan/java-algorithm | d448877f9a90bd40d6ff02614d66311edbca4480 | d1ed64769134f56f0567029f7d5de1b3432fddf3 | refs/heads/master | 2020-08-02T11:43:36.499467 | 2019-09-27T14:54:56 | 2019-09-27T14:54:57 | 211,339,329 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,512 | java | /******************************************************************************
* Compilation: javac InplaceMSD.java
* Execution: java InplaceMSD < input.txt
* Dependencies: StdIn.java StdOut.java
* Data files: https://algs4.cs.princeton.edu/51radix/words3.txt
* https://algs4.cs.princeton.edu/51radix/shells.txt
*
* Sort an array of strings or integers using in-place MSD radix sort.
*
* % java InplaceMSD < shells.txt
* are
* by
* sea
* seashells
* seashells
* sells
* sells
* she
* she
* shells
* shore
* surely
* the
* the
*
******************************************************************************/
package com.edu.princeton.cs.algs4;
/**
* The {@code InplaceMSD} class provides static methods for sorting an
* array of extended ASCII strings using in-place MSD radix sort.
* <p>
* For additional documentation,
* see <a href="https://algs4.cs.princeton.edu/51radix">Section 5.1</a> of
* <i>Algorithms, 4th Edition</i> by Robert Sedgewick and Kevin Wayne.
*
* @author Ivan Pesin
*/
public class InplaceMSD {
private static final int R = 256; // extended ASCII alphabet size
private static final int CUTOFF = 15; // cutoff to insertion sort
// do not instantiate
private InplaceMSD() { }
/**
* Rearranges the array of extended ASCII strings in ascending order.
* This is an unstable sorting algorithm.
*
* @param a the array to be sorted
*/
public static void sort(String[] a) {
int n = a.length;
sort(a, 0, n-1, 0);
}
// return dth character of s, -1 if d = length of string
private static int charAt(String s, int d) {
assert d >= 0 && d <= s.length();
if (d == s.length()) return -1;
return s.charAt(d);
}
// sort from a[lo] to a[hi], starting at the dth character
private static void sort(String[] a, int lo, int hi, int d) {
// cutoff to insertion sort for small subarrays
if (hi <= lo + CUTOFF) {
insertion(a, lo, hi, d);
return;
}
// compute frequency counts
int[] heads = new int[R+2];
int[] tails = new int[R+1];
for (int i = lo; i <= hi; i++) {
int c = charAt(a[i], d);
heads[c+2]++;
}
// transform counts to indices
heads[0] = lo;
for (int r = 0; r < R+1; r++) {
heads[r+1] += heads[r];
tails[r] = heads[r+1];
}
// sort by d-th character in-place
for (int r = 0; r < R+1; r++) {
while (heads[r] < tails[r]) {
int c = charAt(a[heads[r]], d);
while (c + 1 != r) {
exch(a, heads[r], heads[c+1]++);
c = charAt(a[heads[r]], d);
}
heads[r]++;
}
}
// recursively sort for each character (excludes sentinel -1)
for (int r = 0; r < R; r++)
sort(a, tails[r], tails[r+1] - 1, d+1);
}
// insertion sort a[lo..hi], starting at dth character
private static void insertion(String[] a, int lo, int hi, int d) {
for (int i = lo; i <= hi; i++)
for (int j = i; j > lo && less(a[j], a[j-1], d); j--)
exch(a, j, j-1);
}
// exchange a[i] and a[j]
private static void exch(String[] a, int i, int j) {
String temp = a[i];
a[i] = a[j];
a[j] = temp;
}
// is v less than w, starting at character d
private static boolean less(String v, String w, int d) {
// assert v.substring(0, d).equals(w.substring(0, d));
for (int i = d; i < Math.min(v.length(), w.length()); i++) {
if (v.charAt(i) < w.charAt(i)) return true;
if (v.charAt(i) > w.charAt(i)) return false;
}
return v.length() < w.length();
}
/**
* Reads in a sequence of extended ASCII strings from standard input;
* in-place MSD radix sorts them;
* and prints them to standard output in ascending order.
*
* @param args the command-line arguments
*/
public static void main(String[] args) {
String[] a = StdIn.readAllStrings();
int n = a.length;
sort(a);
for (int i = 0; i < n; i++)
StdOut.println(a[i]);
}
}
/******************************************************************************
* Copyright 2002-2018, Robert Sedgewick and Kevin Wayne.
*
* This file is part of algs4.jar, which accompanies the textbook
*
* Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne,
* Addison-Wesley Professional, 2011, ISBN 0-321-57351-X.
* http://algs4.cs.princeton.edu
*
*
* algs4.jar is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* algs4.jar is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with algs4.jar. If not, see http://www.gnu.org/licenses.
******************************************************************************/
| [
"dztt@email.com"
] | dztt@email.com |
6cbd53f8607576f8445e45a6c5589df741cfc0bd | 6baf1fe00541560788e78de5244ae17a7a2b375a | /hollywood/com.oculus.browser-base/sources/defpackage/C2590fq0.java | 0ca4b1055302419f8c8ad0115de08cc4370e403d | [] | no_license | phwd/quest-tracker | 286e605644fc05f00f4904e51f73d77444a78003 | 3d46fbb467ba11bee5827f7cae7dfeabeb1fd2ba | refs/heads/main | 2023-03-29T20:33:10.959529 | 2021-04-10T22:14:11 | 2021-04-10T22:14:11 | 357,185,040 | 4 | 2 | null | 2021-04-12T12:28:09 | 2021-04-12T12:28:08 | null | UTF-8 | Java | false | false | 215 | java | package defpackage;
/* renamed from: fq0 reason: default package and case insensitive filesystem */
/* compiled from: chromium-OculusBrowser.apk-stable-281887347 */
public final /* synthetic */ class C2590fq0 {
}
| [
"cyuubiapps@gmail.com"
] | cyuubiapps@gmail.com |
44e5041607de31491666861ca6aa668a9f8b55dc | 87bc4ed16f191e382bc64798d5ad28ff72d7742a | /src/main/java/com/fanwe/shortvideo/editor/utils/Edit.java | 97de1fe203e1b1cbbe0f0c36c5d1b8bf0e6637b4 | [] | no_license | qq674684107/fanweHybridLive | cf847515123e33438ef4808c884ad0df5fb6c8a6 | f043be1fba7aa96e50f2add8dbe1500cf6c6e4c0 | refs/heads/master | 2020-06-10T06:49:28.554572 | 2019-04-01T10:53:54 | 2019-04-01T10:54:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 861 | java | package com.fanwe.shortvideo.editor.utils;
/**
* Created by yuejiaoli on 2017/7/21.
*/
public class Edit {
/**
* 视频裁剪片段选取改变监听
*/
public interface OnCutChangeListener {
void onCutClick();
void onCutChangeKeyDown();
/**
* @param startTime
* @param endTime
* @param type TCVideoEditerActivity#TYPE_CUT/ TYPE_REPEAT
*/
void onCutChangeKeyUp(long startTime, long endTime, int type);
}
/****************************************************** 时间特效 *******************************/
/**
* 视频重复片段选取的监听
*/
public interface OnRepeatChangeListener {
void onRepeatClick();
void onRepeatChangeKeyDown();
void onRepeatChangeKeyUp(long startTime, long endTime);
}
}
| [
"liujun@yimidida.com"
] | liujun@yimidida.com |
045bcaea9e3ead25cb7ac8b38ca51784be23ac19 | 32cd70512c7a661aeefee440586339211fbc9efd | /aws-java-sdk-ses/src/main/java/com/amazonaws/services/simpleemail/model/UpdateReceiptRuleRequest.java | fad88fe3d60cbf6006b25f529c670986ef10e4f1 | [
"Apache-2.0"
] | permissive | twigkit/aws-sdk-java | 7409d949ce0b0fbd061e787a5b39a93db7247d3d | 0b8dd8cf5e52ad7ae57acd2ce7a584fd83a998be | refs/heads/master | 2020-04-03T16:40:16.625651 | 2018-05-04T12:05:14 | 2018-05-04T12:05:14 | 60,255,938 | 0 | 1 | Apache-2.0 | 2018-05-04T12:48:26 | 2016-06-02T10:40:53 | Java | UTF-8 | Java | false | false | 5,236 | java | /*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights
* Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.simpleemail.model;
import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
/**
*
*/
public class UpdateReceiptRuleRequest extends AmazonWebServiceRequest implements
Serializable, Cloneable {
/**
* <p>
* The name of the receipt rule set to which the receipt rule belongs.
* </p>
*/
private String ruleSetName;
/**
* <p>
* A data structure that contains the updated receipt rule information.
* </p>
*/
private ReceiptRule rule;
/**
* <p>
* The name of the receipt rule set to which the receipt rule belongs.
* </p>
*
* @param ruleSetName
* The name of the receipt rule set to which the receipt rule
* belongs.
*/
public void setRuleSetName(String ruleSetName) {
this.ruleSetName = ruleSetName;
}
/**
* <p>
* The name of the receipt rule set to which the receipt rule belongs.
* </p>
*
* @return The name of the receipt rule set to which the receipt rule
* belongs.
*/
public String getRuleSetName() {
return this.ruleSetName;
}
/**
* <p>
* The name of the receipt rule set to which the receipt rule belongs.
* </p>
*
* @param ruleSetName
* The name of the receipt rule set to which the receipt rule
* belongs.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public UpdateReceiptRuleRequest withRuleSetName(String ruleSetName) {
setRuleSetName(ruleSetName);
return this;
}
/**
* <p>
* A data structure that contains the updated receipt rule information.
* </p>
*
* @param rule
* A data structure that contains the updated receipt rule
* information.
*/
public void setRule(ReceiptRule rule) {
this.rule = rule;
}
/**
* <p>
* A data structure that contains the updated receipt rule information.
* </p>
*
* @return A data structure that contains the updated receipt rule
* information.
*/
public ReceiptRule getRule() {
return this.rule;
}
/**
* <p>
* A data structure that contains the updated receipt rule information.
* </p>
*
* @param rule
* A data structure that contains the updated receipt rule
* information.
* @return Returns a reference to this object so that method calls can be
* chained together.
*/
public UpdateReceiptRuleRequest withRule(ReceiptRule rule) {
setRule(rule);
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getRuleSetName() != null)
sb.append("RuleSetName: " + getRuleSetName() + ",");
if (getRule() != null)
sb.append("Rule: " + getRule());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UpdateReceiptRuleRequest == false)
return false;
UpdateReceiptRuleRequest other = (UpdateReceiptRuleRequest) obj;
if (other.getRuleSetName() == null ^ this.getRuleSetName() == null)
return false;
if (other.getRuleSetName() != null
&& other.getRuleSetName().equals(this.getRuleSetName()) == false)
return false;
if (other.getRule() == null ^ this.getRule() == null)
return false;
if (other.getRule() != null
&& other.getRule().equals(this.getRule()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime
* hashCode
+ ((getRuleSetName() == null) ? 0 : getRuleSetName().hashCode());
hashCode = prime * hashCode
+ ((getRule() == null) ? 0 : getRule().hashCode());
return hashCode;
}
@Override
public UpdateReceiptRuleRequest clone() {
return (UpdateReceiptRuleRequest) super.clone();
}
} | [
"aws@amazon.com"
] | aws@amazon.com |
f5462f02b700a2d922f6dfea0f960b08318d3536 | 4be2623b3cc95e039f214f2ad8d9fc14fa404ee9 | /src/Class/String/_20_StringLastIndexOf.java | 2fcfc37f4f03aca66d0d95a21a7dfb4ff52effde | [] | no_license | maainul/Java | df6364f57e5c4cdca3ff83894b633f19197b541e | 81681c9f48946b07c4f839f1db6d9953fe47a9df | refs/heads/master | 2023-04-26T22:13:27.395026 | 2021-04-29T20:47:41 | 2021-04-29T20:47:41 | 229,538,242 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 418 | java | package Class.String;
// The java string lastIndexOf() method returns last index of the given character value or substring.
// If it is not found, it returns -1. The index counter starts from zero.
public class _20_StringLastIndexOf {
public static void main(String args[]) {
String s4 = "This is index of lastindex.";
System.out.println(s4.lastIndexOf('s'));
System.out.println(s4.lastIndexOf('s', 5));
}
}
| [
"mainul080@yahoo.com"
] | mainul080@yahoo.com |
33807676bdb135ff98da6dd2198c15eb4a86b66d | 6d29d4b533fec734e898ea422db3b80a10947784 | /plugins/org.fusesource.ide.commons/src/org/fusesource/ide/commons/util/XmlUtilities.java | ccaf97bd8c43112a51766a02ba008d140deff36e | [] | no_license | rcernich/fuseide | fb86c8a873a738dbe51cb0abb56604240dc2519a | 4cbbefdb73deb09c099b6b29434c21f37d575a6e | refs/heads/master | 2020-12-25T12:17:12.790499 | 2013-01-08T00:01:36 | 2013-01-08T00:01:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 666 | java | package org.fusesource.ide.commons.util;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
public class XmlUtilities {
protected static Map<String, String> unescape = new HashMap<String, String>();
static {
unescape.put("<", "<");
unescape.put(">", ">");
unescape.put("&", "&");
}
public static String unescape(String text) {
if (text == null) {
return null;
}
Set<Entry<String, String>> entrySet = unescape.entrySet();
for (Entry<String, String> entry : entrySet) {
text = text.replaceAll(entry.getKey(), entry.getValue());
}
return text;
}
}
| [
"james.strachan@gmail.com"
] | james.strachan@gmail.com |
e17d9047cad974b9453534104fd73efbaf776c44 | 3e9dd3298b85ab9b081117eb9c88032715ce13cf | /foc/src/com/foc/business/downloadableContent/DownloadableContent.java | 2d9bd423117832588600dc2cc32e7d6fabd698c1 | [
"Apache-2.0"
] | permissive | focframework/framework | d0a151755f14a04b4a72a562b22f6bad83fe8836 | 6d07b694e7713d27b95f0ca69e2ec3c056969054 | refs/heads/master | 2020-05-30T16:48:32.505610 | 2019-05-30T07:38:36 | 2019-05-30T07:38:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,875 | java | package com.foc.business.downloadableContent;
import java.io.InputStream;
import java.sql.Date;
import com.foc.Globals;
import com.foc.desc.FocConstructor;
import com.foc.desc.FocObject;
@SuppressWarnings("serial")
public class DownloadableContent extends FocObject{
public DownloadableContent(FocConstructor constr){
super(constr);
newFocProperties();
}
public void setDocument(InputStream inputStream){
Globals.getApp().getDataSource().focObject_addBlobFromInputStream(this, DownloadableContentDesc.FLD_DOCUMENT, inputStream);
}
public InputStream getDocument(){
return Globals.getApp().getDataSource().focObject_LoadInputStream(this, DownloadableContentDesc.FLD_DOCUMENT);
}
public void setDocumentCloud(InputStream inputStream, String directoryName, boolean createDirIfNeeded, String fileName){
setPropertyCloudStorage(DownloadableContentDesc.FLD_DOCUMENT, inputStream, directoryName, createDirIfNeeded, fileName);
}
public InputStream getDocumentCloud(){
return getPropertyCloudStorage(DownloadableContentDesc.FLD_DOCUMENT);
}
public void setDocumentName(String imageName){
setPropertyString(DownloadableContentDesc.FLD_DOCUMENT_NAME, imageName);
}
public String getDocumentName(){
return getPropertyString(DownloadableContentDesc.FLD_DOCUMENT_NAME);
}
public void setUploadDate(Date uploadDate){
setPropertyDate(DownloadableContentDesc.FLD_UPLOAD_DATE, uploadDate);
}
public Date getUploadDate(){
return getPropertyDate(DownloadableContentDesc.FLD_UPLOAD_DATE);
}
public void setDescription(String description){
setPropertyString(DownloadableContentDesc.FLD_DESCRIPTION, description);
}
public String getDescription(){
return getPropertyString(DownloadableContentDesc.FLD_DESCRIPTION);
}
}
| [
"antoine.samaha@01barmaja.com"
] | antoine.samaha@01barmaja.com |
cc1e788e416f409647be6082487a737693ee1c42 | 409e9b1ccd61887933e30f73ec7d311cfb3ea39f | /src/main/java/com/google/common/html/types/SafeHtmls.java | c39f811ebe9f0f855670eb92e229933f7dd6a18d | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | kleopatra999/safe-html-types | 26f57146f2004695cce0210f2b3f767086a4d3d9 | 030cc2056268e81d7346d1966bc30037717f5ce5 | refs/heads/master | 2021-01-17T10:33:46.112687 | 2016-05-26T12:31:50 | 2016-05-26T12:31:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,750 | java | // **** GENERATED CODE, DO NOT MODIFY ****
// This file was generated via preprocessing from input:
// java/com/google/common/html/types/SafeHtmls.java.tpl
// ***************************************
/*
* Copyright 2016 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.common.html.types;
import static com.google.common.html.types.BuilderUtils.coerceToInterchangeValid;
import static com.google.common.html.types.BuilderUtils.escapeHtmlInternal;
import com.google.common.annotations.GwtCompatible;
/**
* Protocol conversions, builders and factory methods for {@link SafeHtml}.
*/
@GwtCompatible
public final class SafeHtmls {
/**
* Deserializes a SafeHtmlProto into a SafeHtml instance.
*
* <p>Protocol-message forms are intended to be opaque. The fields of the protocol message should
* be considered encapsulated and are not intended for direct inspection or manipulation. Protocol
* message forms of this type should be produced by {@link #toProto(SafeHtml)} or its
* equivalent in other implementation languages.
*
* <p><b>Important:</b> It is unsafe to invoke this method on a protocol message that has been
* received from an entity outside the application's trust domain. Data coming from the browser
* is outside the application's trust domain.
*/
public static SafeHtml fromProto(SafeHtmlProto proto) {
return create(proto.getPrivateDoNotAccessOrElseSafeHtmlWrappedValue());
}
/**
* Wraps a SafeScript inside a <script type="text/javascript"> tag.
*/
public static SafeHtml fromScript(SafeScript script) {
return create("<script type=\"text/javascript\">" + script.getSafeScriptString() + "</script>");
}
/**
* Creates a <script type="text/javascript" src="<i>url</i>"><script> where the
* {@code src} attribute points to the given {@code trustedResourceUrl}.
*/
public static SafeHtml fromScriptUrl(TrustedResourceUrl trustedResourceUrl) {
String escapedUrl = htmlEscapeInternal(trustedResourceUrl.getTrustedResourceUrlString());
return create("<script type=\"text/javascript\" src=\"" + escapedUrl + "\"></script>");
}
/**
* Serializes a SafeHtml into its opaque protocol message representation.
*
* <p>Protocol message forms of this type are intended to be opaque. The fields of the returned
* protocol message should be considered encapsulated and are not intended for direct inspection
* or manipulation. Protocol messages can be converted back into a SafeHtml using
* {@link #fromProto(SafeHtmlProto)}.
*/
public static SafeHtmlProto toProto(SafeHtml safeHtml) {
return SafeHtmlProto.newBuilder().setPrivateDoNotAccessOrElseSafeHtmlWrappedValue(
safeHtml.getSafeHtmlString()).build();
}
/**
* Converts, by HTML-escaping, an arbitrary string into a contract-compliant {@link SafeHtml}.
*/
public static SafeHtml htmlEscape(String text) {
return create(htmlEscapeInternal(text));
}
/**
* Converts an arbitrary string into an HTML comment by HTML-escaping the contents and embedding
* the result between HTML comment markers.
*
* <p>Escaping is needed because Internet Explorer supports conditional comments and so may render
* HTML markup within comments.
*/
public static SafeHtml comment(String text) {
return create("<!--" + htmlEscapeInternal(text) + "-->");
}
/**
* Creates a new SafeHtml which contains, in order, the string representations of the given
* {@code htmls}.
*/
public static SafeHtml concat(SafeHtml... htmls) {
int concatLength = 0;
for (int i = 0; i < htmls.length; i++) {
concatLength += htmls[i].getSafeHtmlString().length();
}
StringBuilder result = new StringBuilder(concatLength);
for (int i = 0; i < htmls.length; i++) {
result.append(htmls[i].getSafeHtmlString());
}
return create(result.toString());
}
// Default visibility for use by SafeHtmlBuilder.
static SafeHtml create(String html) {
return new SafeHtml(html);
}
private static String htmlEscapeInternal(String text) {
return escapeHtmlInternal(coerceToInterchangeValid(text));
}
private SafeHtmls() { }
}
| [
"mikesamuel@gmail.com"
] | mikesamuel@gmail.com |
79fcffc1dee37cdc54eaf0abe017a72ebfd42d19 | 4aa90348abcb2119011728dc067afd501f275374 | /app/src/main/java/com/tencent/mm/plugin/sns/a/b/d.java | 2ea23ec1272e2b74285647106383c8df040fb5f5 | [] | no_license | jambestwick/HackWechat | 0d4ceb2d79ccddb45004ca667e9a6a984a80f0f6 | 6a34899c8bfd50d19e5a5ec36a58218598172a6b | refs/heads/master | 2022-01-27T12:48:43.446804 | 2021-12-29T10:36:30 | 2021-12-29T10:36:30 | 249,366,791 | 0 | 0 | null | 2020-03-23T07:48:32 | 2020-03-23T07:48:32 | null | UTF-8 | Java | false | false | 3,312 | java | package com.tencent.mm.plugin.sns.a.b;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import com.tencent.mm.ae.b;
import com.tencent.mm.ae.b.a;
import com.tencent.mm.ae.e;
import com.tencent.mm.ae.k;
import com.tencent.mm.network.q;
import com.tencent.mm.protocal.c.bd;
import com.tencent.mm.protocal.c.be;
import com.tencent.mm.protocal.c.bf;
import com.tencent.mm.protocal.c.bg;
import com.tencent.mm.sdk.platformtools.ac;
import com.tencent.mm.sdk.platformtools.bh;
import com.tencent.mm.sdk.platformtools.x;
public final class d extends k implements com.tencent.mm.network.k {
private b gJQ;
public e gJT;
public d(String str, int i, bg bgVar, int i2, int i3, int i4) {
this(str, i, 1, 0, null, bgVar, i2, "", i3, i4, 0, 0, 0);
}
public d(String str, int i, int i2, int i3, bd bdVar, bg bgVar, int i4, String str2, int i5, int i6, int i7, int i8, int i9) {
a aVar = new a();
aVar.hmj = new be();
aVar.hmk = new bf();
if (i6 != 2) {
aVar.uri = "/cgi-bin/mmoc-bin/ad/exposure";
aVar.hmi = 1231;
} else {
aVar.uri = "/cgi-bin/mmux-bin/adexposure";
aVar.hmi = 1875;
}
aVar.hml = 0;
aVar.hmm = 0;
this.gJQ = aVar.JZ();
x.i("MicroMsg.NetSceneAdExposure", "uri %s", new Object[]{this.gJQ.uri});
be beVar = (be) this.gJQ.hmg.hmo;
beVar.vGr = i3;
beVar.type = i2;
beVar.scene = i;
beVar.hOt = str;
beVar.vGu = i5;
beVar.vGv = i7;
beVar.vGw = i8;
beVar.vGi = i9;
if (bdVar != null) {
beVar.vGs = bdVar;
x.i("MicroMsg.NetSceneAdExposure", "exposure_info " + bdVar.vGp);
}
if (bgVar != null) {
beVar.vGt = bgVar;
x.i("MicroMsg.NetSceneAdExposure", "social_info " + bgVar.vGx + " " + bgVar.csU);
}
WifiManager wifiManager = (WifiManager) ac.getContext().getSystemService("wifi");
if (wifiManager != null) {
WifiInfo connectionInfo = wifiManager.getConnectionInfo();
if (connectionInfo != null) {
beVar.bssid = bh.az(connectionInfo.getBSSID(), "");
beVar.ssid = bh.az(connectionInfo.getSSID(), "");
}
}
beVar.vGd = System.currentTimeMillis();
beVar.vGf = i4;
if (str2 != null) {
beVar.vGc = str2;
}
x.i("MicroMsg.NetSceneAdExposure", "##time viewid " + str + " sceneType " + i + " type: " + i2 + " duration " + i3 + "feed_duration " + i7 + "feed_full_duration " + i8 + " ad_type " + i4 + " exposureCount " + i5 + " descXml:" + str2 + " flip_status " + i9);
}
public final int a(com.tencent.mm.network.e eVar, e eVar2) {
this.gJT = eVar2;
return a(eVar, this.gJQ, this);
}
public final int getType() {
return 1231;
}
public final void a(int i, int i2, int i3, String str, q qVar, byte[] bArr) {
x.i("MicroMsg.NetSceneAdExposure", "netId : " + i + " errType :" + i2 + " errCode: " + i3 + " errMsg :" + str);
bf bfVar = (bf) this.gJQ.hmh.hmo;
x.i("MicroMsg.NetSceneAdExposure", "resp " + bfVar.ret + " msg: " + bfVar.fpb);
this.gJT.a(i2, i3, str, this);
}
}
| [
"malin.myemail@163.com"
] | malin.myemail@163.com |
8568eb9a9dee50eeb5a2c03642f223b7742dab1f | 7cc551fdea2b4984247252f189bd5c7c16e20a0c | /Instrumentation.ex/src/de/uni_hildesheim/sse/monitoring/runtime/recording/ObjectSizeProvider.java | a5fd169c4cb17fafe16cd3c6546c6aa3bbccf340 | [
"Apache-2.0"
] | permissive | andreaskumlehn/spassMeter | 9924b5aee10f5b6143c69f301d3add7d17d5a3ee | 53d529b701f868f3a464a3f40e9abf6957bee45a | refs/heads/master | 2020-12-31T03:25:56.384101 | 2014-11-19T10:50:15 | 2014-11-19T10:50:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,178 | java | package de.uni_hildesheim.sse.monitoring.runtime.recording;
import de.uni_hildesheim.sse.monitoring.runtime.configuration
.IObjectSizeProvider;
import de.uni_hildesheim.sse.system.GathererFactory;
import de.uni_hildesheim.sse.system.ObjectSizeEstimator;
/**
* Allows to access the size of an object as allocated by the JVM. This class
* was introduced to allow native access in case that no agent is running
* (static instrumentation).
*
* @author Holger Eichelberger
* @since 1.00
* @version 1.00
*/
public class ObjectSizeProvider implements IObjectSizeProvider {
//TODO check: this class can be simplified - interface was only introduced
// to circumvent initial OSGi problems
/**
* Stores the singleton instance.
*/
private static IObjectSizeProvider instance = createDefaultProvider();
/**
* Creates the default provider. Do not delete or rename this method. It
* might be overridden by instrumentation in case of static instrumentation.
*
* @return the default provider
*
* @since 1.00
*/
private static IObjectSizeProvider createDefaultProvider() {
IObjectSizeProvider result;
if (GathererFactory.getDataGatherer().supportsJVMTI()) {
result = new IObjectSizeProvider() {
public long getObjectSize(Object object) {
return GathererFactory.getMemoryDataGatherer().
getObjectSize(object);
}
};
} else {
result = new ObjectSizeProvider();
}
return result;
}
/**
* Initializes the singleton instance.
*/
static {
instance = new ObjectSizeProvider();
}
/**
* Changes the singleton instance (may be done by {@link Agent}).
*
* @param newInstance the new singleton instance (must not be <b>null</b>).
* @throws IllegalArgumentException in case that
* <code>newInstance==<b>null</b></code>
*
* @since 1.00
*/
public static final void setInstance(IObjectSizeProvider newInstance) {
if (null == newInstance) {
throw new IllegalArgumentException("newInstance must not be null");
}
instance = newInstance;
}
/**
* Returns the singleton instance allowing access to object sizes.
*
* @return the singleton instance
*
* @since 1.00
*/
public static final IObjectSizeProvider getInstance() {
return instance;
}
/**
* Returns the size of the given object as allocated by the JVM. This
* method is a dummy implementation.
*
* @param object the object the size should be queried for
* @return the size of the physical memory allocated for <code>object</code>
* (in bytes, negative or zero if invalid or not available,
* always 0)
*
* @since 1.00
*/
@Override
public long getObjectSize(Object object) {
return ObjectSizeEstimator.getObjectSize(object);
}
}
| [
"eichelberger@sse.uni-hildesheim.de"
] | eichelberger@sse.uni-hildesheim.de |
c2f81a25c09a2a76ce228ca0b29216f34186c0d5 | 7564d54a0cd7e12b5900335c5fc6ace0c7366f5e | /app/src/main/java/client/ediancha/com/util/GlideUtil.java | 3f2a8f1b4ed78dfbf9e46d93db53a01ec7f017b5 | [] | no_license | dmz1024/EDianchaUserClient1.0 | decf0c1569b9cd7326a29930d95922898f790ff5 | b3fe9dc5052c8bf63843dfbb4dc8615e66a4d3c4 | refs/heads/master | 2021-01-24T10:59:26.659098 | 2016-12-28T05:44:36 | 2016-12-28T05:44:36 | 70,298,915 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 426 | java | package client.ediancha.com.util;
import android.content.Context;
import android.widget.ImageView;
import com.bumptech.glide.Glide;
import client.ediancha.com.R;
/**
* Created by dengmingzhi on 16/10/13.
*/
public class GlideUtil {
public static void GlideErrAndOc(Context ctx, Object url, ImageView iv) {
Glide.with(ctx).load(url).error(R.mipmap.icon_err).placeholder(R.mipmap.icon_err).into(iv);
}
}
| [
"894350911@qq.com"
] | 894350911@qq.com |
a90030281b5c731899fa99dd5746c354a2a11c63 | feb6a76440cab5cc81d8ab0c5eeb0274cc828b7a | /src/main/java/fr/efrei/mamazon/config/audit/AuditEventConverter.java | 8431a8af50316d9f6602191fac0d35baca00938e | [] | no_license | pierre-filliolaud/mamazon | 9756c6010b1af3c5a8fc6baf2958b233cf27a790 | 6af56c6c9915f32183c7cbbab8e41f99e4130007 | refs/heads/master | 2021-01-10T06:21:32.382256 | 2015-12-16T23:33:36 | 2015-12-16T23:33:36 | 48,137,060 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,164 | java | package fr.efrei.mamazon.config.audit;
import fr.efrei.mamazon.domain.PersistentAuditEvent;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Component;
import java.util.*;
@Component
public class AuditEventConverter {
/**
* Convert a list of PersistentAuditEvent to a list of AuditEvent
*
* @param persistentAuditEvents the list to convert
* @return the converted list.
*/
public List<AuditEvent> convertToAuditEvent(Iterable<PersistentAuditEvent> persistentAuditEvents) {
if (persistentAuditEvents == null) {
return Collections.emptyList();
}
List<AuditEvent> auditEvents = new ArrayList<>();
for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) {
auditEvents.add(convertToAuditEvent(persistentAuditEvent));
}
return auditEvents;
}
/**
* Convert a PersistentAuditEvent to an AuditEvent
*
* @param persistentAuditEvent the event to convert
* @return the converted list.
*/
public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) {
return new AuditEvent(persistentAuditEvent.getAuditEventDate().toDate(), persistentAuditEvent.getPrincipal(),
persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData()));
}
/**
* Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface
*
* @param data the data to convert
* @return a map of String, Object
*/
public Map<String, Object> convertDataToObjects(Map<String, String> data) {
Map<String, Object> results = new HashMap<>();
if (data != null) {
for (String key : data.keySet()) {
results.put(key, data.get(key));
}
}
return results;
}
/**
* Internal conversion. This method will allow to save additional data.
* By default, it will save the object as string
*
* @param data the data to convert
* @return a map of String, String
*/
public Map<String, String> convertDataToStrings(Map<String, Object> data) {
Map<String, String> results = new HashMap<>();
if (data != null) {
for (String key : data.keySet()) {
Object object = data.get(key);
// Extract the data that will be saved.
if (object instanceof WebAuthenticationDetails) {
WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) object;
results.put("remoteAddress", authenticationDetails.getRemoteAddress());
results.put("sessionId", authenticationDetails.getSessionId());
} else if (object != null) {
results.put(key, object.toString());
} else {
results.put(key, "null");
}
}
}
return results;
}
}
| [
"pierre.filliolaud@gmail.com"
] | pierre.filliolaud@gmail.com |
5ea6c3bcf0ea53e106c2c3d9a340764edd58845f | aaabffe8bf55973bfb1390cf7635fd00ca8ca945 | /src/main/java/com/microsoft/graph/requests/generated/BaseWorkbookChartPointCountRequestBuilder.java | 631e02353d3c77292e30b9d45649f2d8e5fe144d | [
"MIT"
] | permissive | rgrebski/msgraph-sdk-java | e595e17db01c44b9c39d74d26cd925b0b0dfe863 | 759d5a81eb5eeda12d3ed1223deeafd108d7b818 | refs/heads/master | 2020-03-20T19:41:06.630857 | 2018-03-16T17:31:43 | 2018-03-16T17:31:43 | 137,648,798 | 0 | 0 | null | 2018-06-17T11:07:06 | 2018-06-17T11:07:05 | null | UTF-8 | Java | false | false | 2,460 | java | // ------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.
// ------------------------------------------------------------------------------
package com.microsoft.graph.requests.generated;
import com.microsoft.graph.concurrency.*;
import com.microsoft.graph.core.*;
import com.microsoft.graph.models.extensions.*;
import com.microsoft.graph.models.generated.*;
import com.microsoft.graph.http.*;
import com.microsoft.graph.requests.extensions.*;
import com.microsoft.graph.requests.generated.*;
import com.microsoft.graph.options.*;
import com.microsoft.graph.serializer.*;
import java.util.Arrays;
import java.util.EnumSet;
// **NOTE** This file was generated by a tool and any changes will be overwritten.
/**
* The class for the Base Workbook Chart Point Count Request Builder.
*/
public class BaseWorkbookChartPointCountRequestBuilder extends BaseFunctionRequestBuilder {
/**
* The request builder for this WorkbookChartPointCount
*
* @param requestUrl the request URL
* @param client the service client
* @param requestOptions the options for this request
*/
public BaseWorkbookChartPointCountRequestBuilder(final String requestUrl, final IBaseClient client, final java.util.List<? extends Option> requestOptions) {
super(requestUrl, client, requestOptions);
}
/**
* Creates the IWorkbookChartPointCountRequest
*
* @return the IWorkbookChartPointCountRequest instance
*/
public IWorkbookChartPointCountRequest buildRequest() {
return buildRequest(getOptions());
}
/**
* Creates the IWorkbookChartPointCountRequest with specific requestOptions instead of the existing requestOptions
*
* @param requestOptions the options for the request
* @return the IWorkbookChartPointCountRequest instance
*/
public IWorkbookChartPointCountRequest buildRequest(final java.util.List<? extends Option> requestOptions) {
WorkbookChartPointCountRequest request = new WorkbookChartPointCountRequest(
getRequestUrl(),
getClient(),
requestOptions
);
for (FunctionOption option : functionOptions) {
request.addFunctionOption(option);
}
return request;
}
}
| [
"caitbal@microsoft.com"
] | caitbal@microsoft.com |
73d7c68707483c2d6f4d2f8e772d9fd9e0fae51a | 163e37c8899cd6689828980baa6d058a064dc98e | /o1kuaixue-demo/src/com/gdpph/o1kuaixue/demo/chapter10/section4/section2/Demo.java | 8678efe675334b0dc925956e661256aa73f08a25 | [] | no_license | sh2268411762/Java | f4ffb76decac318d99334251615c5b26bee86b99 | 1d6e89338e02dddb67056b5353eb498876ef381c | refs/heads/master | 2023-01-09T10:51:23.847574 | 2020-11-11T11:24:51 | 2020-11-11T11:24:51 | 257,934,424 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 237 | java | package com.gdpph.o1kuaixue.demo.chapter10.section4.section2;
import java.util.List;
/**
* 泛型类定义
*
* @author 零壹学堂
*/
public class Demo<T, S, U> {
private T name;
private List<S> desc;
private U age;
}
| [
"2268411762@qq.com"
] | 2268411762@qq.com |
26abc019783910be92a334e21fecb5876be23dbc | b7863c8f4450d6fa9492c1921c8bed482bbc4873 | /bus-image/src/main/java/org/aoju/bus/image/metric/internal/xdsi/DateTimeFilterType.java | de777b77bb55139aa4cbf9fba4736714f617c225 | [
"MIT"
] | permissive | BruceBruceZheng/bus | 479284c8143fd70fdc4b4a9f33c81e5d64b5e15e | 3123ed5301c0d08a5c4e933653995b9bb63acf5e | refs/heads/master | 2023-08-23T20:27:17.715754 | 2021-10-14T05:57:36 | 2021-10-14T05:57:36 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,776 | java | /*********************************************************************************
* *
* The MIT License (MIT) *
* *
* Copyright (c) 2015-2021 aoju.org and other contributors. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy *
* of this software and associated documentation files (the "Software"), to deal *
* in the Software without restriction, including without limitation the rights *
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included in *
* all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN *
* THE SOFTWARE. *
* *
********************************************************************************/
package org.aoju.bus.image.metric.internal.xdsi;
import javax.xml.bind.annotation.*;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* @author Kimi Liu
* @version 6.3.0
* @since JDK 1.8+
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DateTimeFilterType", namespace = "urn:oasis:names:tc:ebxml-regrep:xsd:query:3.0")
public class DateTimeFilterType extends SimpleFilterType {
@XmlAttribute(name = "value", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar value;
public XMLGregorianCalendar getValue() {
return this.value;
}
public void setValue(XMLGregorianCalendar value) {
this.value = value;
}
}
| [
"839536@qq.com"
] | 839536@qq.com |
b29e355d0cc1036a8a6fef6940c806d8b0423b02 | 68b57975b1a5bcb03b01259a49a8f989ce64f6d3 | /thaumcraft/client/renderers/models/gear/ModelHoverHarness.java | 1c7427d07defab58058d7381e5626738925bd919 | [] | no_license | KAMKEEL/Thaumcraft4-1.7.10 | 62ae23c025bb72d826797114c8546c6019b878d7 | 059a869367c7bfeef97e5c1aeca78a4b9fa26554 | refs/heads/master | 2021-12-15T02:43:23.921572 | 2017-07-19T00:56:18 | 2017-07-19T00:56:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,991 | java | /* */ package thaumcraft.client.renderers.models.gear;
/* */
/* */ import cpw.mods.fml.client.FMLClientHandler;
/* */ import cpw.mods.fml.relauncher.SideOnly;
/* */ import java.util.HashMap;
/* */ import java.util.Random;
/* */ import net.minecraft.client.Minecraft;
/* */ import net.minecraft.client.model.ModelBiped;
/* */ import net.minecraft.client.model.ModelRenderer;
/* */ import net.minecraft.entity.Entity;
/* */ import net.minecraft.entity.player.EntityPlayer;
/* */ import net.minecraft.entity.player.InventoryPlayer;
/* */ import net.minecraft.item.ItemStack;
/* */ import net.minecraft.nbt.NBTTagCompound;
/* */ import net.minecraft.util.MathHelper;
/* */ import net.minecraft.util.MovingObjectPosition;
/* */ import net.minecraft.util.ResourceLocation;
/* */ import net.minecraft.util.Vec3;
/* */ import net.minecraft.world.World;
/* */ import net.minecraftforge.client.model.IModelCustom;
/* */ import org.lwjgl.opengl.GL11;
/* */ import thaumcraft.client.fx.bolt.FXLightningBolt;
/* */ import thaumcraft.client.lib.UtilsFX;
/* */ import thaumcraft.common.items.armor.ItemHoverHarness;
/* */
/* */ @SideOnly(cpw.mods.fml.relauncher.Side.CLIENT)
/* */ public class ModelHoverHarness extends ModelBiped
/* */ {
/* 29 */ HashMap<Integer, Long> timingShock = new HashMap();
/* 30 */ private static final ResourceLocation HARNESS = new ResourceLocation("thaumcraft", "textures/models/hoverharness.obj");
/* */ private IModelCustom modelBack;
/* */
/* */ public ModelHoverHarness()
/* */ {
/* 35 */ this.field_78115_e = new ModelRenderer(this, 16, 16);
/* 36 */ this.field_78115_e.func_78790_a(-4.0F, 0.0F, -2.0F, 8, 12, 4, 0.6F);
/* 37 */ this.modelBack = net.minecraftforge.client.model.AdvancedModelLoader.loadModel(HARNESS);
/* */ }
/* */
/* */
/* */
/* */
/* */ public void func_78088_a(Entity entity, float par2, float par3, float par4, float par5, float par6, float par7)
/* */ {
/* 45 */ GL11.glPushMatrix();
/* 46 */ GL11.glPushMatrix();
/* 47 */ if ((entity != null) && (entity.func_70093_af())) {
/* 48 */ GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
/* */ }
/* 50 */ this.field_78115_e.func_78785_a(par7);
/* 51 */ GL11.glPopMatrix();
/* */
/* 53 */ GL11.glPushMatrix();
/* 54 */ GL11.glDisable(2896);
/* 55 */ GL11.glScalef(0.1F, 0.1F, 0.1F);
/* 56 */ GL11.glRotatef(90.0F, -1.0F, 0.0F, 0.0F);
/* 57 */ if ((entity != null) && (entity.func_70093_af())) {
/* 58 */ GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
/* */ }
/* 60 */ GL11.glTranslatef(0.0F, 0.33F, -3.7F);
/* */
/* 62 */ FMLClientHandler.instance().getClient().field_71446_o.func_110577_a(new ResourceLocation("thaumcraft", "textures/models/hoverharness2.png"));
/* 63 */ this.modelBack.renderAll();
/* 64 */ GL11.glEnable(2896);
/* 65 */ GL11.glPopMatrix();
/* */
/* 67 */ if ((entity != null) && ((entity instanceof EntityPlayer)) && (!GL11.glIsEnabled(3042)) && (GL11.glGetInteger(2976) == 5888) && (((EntityPlayer)entity).field_71071_by.func_70440_f(2).func_77942_o()) && (((EntityPlayer)entity).field_71071_by.func_70440_f(2).field_77990_d.func_74764_b("hover")) && (((EntityPlayer)entity).field_71071_by.func_70440_f(2).field_77990_d.func_74771_c("hover") == 1))
/* */ {
/* */
/* */
/* */
/* */
/* 73 */ long currenttime = System.currentTimeMillis();
/* 74 */ long timeShock = 0L;
/* 75 */ if (this.timingShock.get(Integer.valueOf(entity.func_145782_y())) != null) { timeShock = ((Long)this.timingShock.get(Integer.valueOf(entity.func_145782_y()))).longValue();
/* */ }
/* 77 */ GL11.glPushMatrix();
/* 78 */ float mod = 0.0F;
/* 79 */ if (entity.func_70093_af()) {
/* 80 */ GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
/* 81 */ GL11.glTranslatef(0.0F, 0.075F, -0.05F);
/* 82 */ mod = 0.075F;
/* */ }
/* 84 */ GL11.glTranslatef(0.0F, 0.2F, 0.55F);
/* 85 */ GL11.glPushMatrix();
/* 86 */ UtilsFX.renderQuadCenteredFromIcon(false, ((ItemHoverHarness)((EntityPlayer)entity).field_71071_by.func_70440_f(2).func_77973_b()).iconLightningRing, 2.5F, 1.0F, 1.0F, 1.0F, 230, 1, 1.0F);
/* */
/* */
/* 89 */ GL11.glPopMatrix();
/* 90 */ GL11.glPushMatrix();
/* 91 */ GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
/* 92 */ GL11.glTranslatef(0.0F, 0.0F, 0.03F);
/* 93 */ UtilsFX.renderQuadCenteredFromIcon(false, ((ItemHoverHarness)((EntityPlayer)entity).field_71071_by.func_70440_f(2).func_77973_b()).iconLightningRing, 1.5F, 1.0F, 0.5F, 1.0F, 230, 1, 1.0F);
/* */
/* */
/* 96 */ GL11.glPopMatrix();
/* 97 */ GL11.glPopMatrix();
/* */
/* */
/* 100 */ if (timeShock < currenttime) {
/* 101 */ timeShock = currenttime + 50L + entity.field_70170_p.field_73012_v.nextInt(50);
/* 102 */ this.timingShock.put(Integer.valueOf(entity.func_145782_y()), Long.valueOf(timeShock));
/* */
/* 104 */ MovingObjectPosition mop = thaumcraft.common.lib.utils.BlockUtils.getTargetBlock(entity.field_70170_p, entity.field_70165_t, entity.field_70163_u - 0.44999998807907104D - mod, entity.field_70161_v, ((EntityPlayer)entity).field_70761_aq - 90.0F - entity.field_70170_p.field_73012_v.nextInt(180), -80 + entity.field_70170_p.field_73012_v.nextInt(160), false, 6.0D);
/* */
/* */
/* */
/* 108 */ if (mop != null)
/* */ {
/* 110 */ double px = mop.field_72307_f.field_72450_a;
/* 111 */ double py = mop.field_72307_f.field_72448_b;
/* 112 */ double pz = mop.field_72307_f.field_72449_c;
/* */
/* 114 */ FXLightningBolt bolt = new FXLightningBolt(entity.field_70170_p, entity.field_70165_t - MathHelper.func_76134_b((((EntityPlayer)entity).field_70761_aq + 90.0F) / 180.0F * 3.141593F) * 0.5F, entity.field_70163_u - 0.44999998807907104D - mod, entity.field_70161_v - MathHelper.func_76126_a((((EntityPlayer)entity).field_70761_aq + 90.0F) / 180.0F * 3.141593F) * 0.5F, px, py, pz, entity.field_70170_p.field_73012_v.nextLong(), 1, 2.0F, 3);
/* */
/* */
/* */
/* */
/* */
/* 120 */ bolt.defaultFractal();
/* 121 */ bolt.setType(6);
/* 122 */ bolt.setWidth(0.015F);
/* 123 */ bolt.finalizeBolt();
/* */ }
/* */ }
/* */ }
/* */
/* */
/* 129 */ GL11.glPopMatrix();
/* */ }
/* */ }
/* Location: /Users/shannon/Desktop/Thaumcraft-1.7.10-4.2.3.5.jar!/thaumcraft/client/renderers/models/gear/ModelHoverHarness.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"phanegan2@gmail.com"
] | phanegan2@gmail.com |
17fec6a3f05ea658227bbf9f9f4f2eaa08657ab4 | dd952805064684d85a34600beca9577a40a74423 | /HuiHu_Android/module_notification/src/main/java/com/huihu/module_notification/util/ReadUtil.java | 82fb25675b20b82d232f17450aeef2e114696767 | [] | no_license | zhangkangmu/huihu | 4898375874e4c4d50414b96277568fadcac0aac8 | ae53fae658546882d4f14febfe143bdf8456a324 | refs/heads/master | 2020-05-31T07:06:51.460718 | 2019-06-04T07:56:36 | 2019-06-04T07:56:36 | 190,154,356 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,736 | java | package com.huihu.module_notification.util;
import com.bailun.bl_commonlib.net.NetworkTransmissionDefine;
import com.bailun.bl_commonlib.net.http.HttpRequestParam;
import com.bailun.localeslibrary.CurLocales;
import com.huihu.commonlib.net.HuihuCallBack;
import com.huihu.commonlib.net.HuihuHttpUtils;
import com.huihu.commonlib.net.ReturnModel;
import com.huihu.commonlib.utils.SPUtils;
import com.huihu.commonlib.utils.ToastUtil;
import com.huihu.module_notification.R;
/**
* create by wangjing on 2019/4/11 0011
* description:
*/
public class ReadUtil {
public static final String Success = "0C12C00";
public static final String BusinessError = "0C12C02";
public static void readNotice(int noticeId){
HuihuHttpUtils.httpRequest(getParam(noticeId), new HuihuCallBack() {
@Override
public void onSuccess(ReturnModel returnModel) {
}
@Override
public void onError(int errCode, String strErrMsg) {
ToastUtil.show(R.string.uilib_http_request_fail);
}
@Override
public void onCompleted() {
}
});
}
public static void readNotice(int noticeId, HuihuCallBack callBack){
HuihuHttpUtils.httpRequest(getParam(noticeId), callBack);
}
private static HttpRequestParam getParam(int noticeId){
HttpRequestParam param = new HttpRequestParam(CurLocales.instance().API.UserNotice.PutUserNoticeRead
, NetworkTransmissionDefine.HttpMethod.PUT);
param.addQuery("noticeId", String.valueOf(noticeId));
param.addQuery("uid", String.valueOf(SPUtils.getInstance().getCurrentUid()));
return param;
}
}
| [
"289590351@qq.com"
] | 289590351@qq.com |
f10472a58e5ba678bbb05ffd65e99a4aa12ceb8a | 7dbbe21b902fe362701d53714a6a736d86c451d7 | /BzenStudio-5.6/Source/com/zend/ide/n/td/b/g.java | 8237d2ea55fe0d4bd187540072f94a119d41f24d | [] | no_license | HS-matty/dev | 51a53b4fd03ae01981549149433d5091462c65d0 | 576499588e47e01967f0c69cbac238065062da9b | refs/heads/master | 2022-05-05T18:32:24.148716 | 2022-03-20T16:55:28 | 2022-03-20T16:55:28 | 196,147,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,517 | java | package com.zend.ide.n.td.b;
import com.zend.ide.n.bw;
import com.zend.ide.n.td.gb;
import com.zend.ide.n.td.hb;
import com.zend.ide.n.td.jb;
import com.zend.ide.n.td.mb;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import java.util.List;
public class g extends c
{
public g(bw parambw)
{
super(parambw, "Collapse All Functions");
}
public void actionPerformed(ActionEvent paramActionEvent)
{
hb localhb = (hb)this.a.e();
jb localjb = localhb.a();
if (localjb != null)
{
mb[] arrayOfmb = localjb.e();
for (int i = 0; i < arrayOfmb.length; i++)
{
if (!(arrayOfmb[i] instanceof com.zend.ide.n.td.g))
continue;
List localList1 = arrayOfmb[i].a();
ArrayList localArrayList = new ArrayList(localList1.size());
for (int j = localList1.size() - 1; j > -1; j--)
{
gb localgb = (gb)localList1.get(j);
List localList2 = localjb.b(localgb.d());
if (localList2.size() < 3)
{
localArrayList.add(localgb);
}
else
{
if ((localList2.size() != 3) || (!localgb.equals(localList2.get(localList2.size() - 1))))
continue;
localArrayList.add(localgb);
}
}
localjb.a(localArrayList);
break;
}
}
}
}
/* Location: C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendIDE.jar
* Qualified Name: com.zend.ide.n.td.b.g
* JD-Core Version: 0.6.0
*/ | [
"byqdes@gmail.com"
] | byqdes@gmail.com |
c362c015d9e59c995d257a9c0277f6dc99773ee7 | 91253be8d0da07fee400a9af79f0d358363eb791 | /src/main/java/com/jnape/palatable/lambda/semigroup/builtin/Merge.java | eaf5e355bb4a6a8ce102a74fdb7c439b1519d40a | [
"MIT"
] | permissive | saminfante/lambda | 1f3853b7bac1778ecea1e259e631f3eb7da3fb17 | b643ba836c5916d1d8193822e5efb4e7b40c489a | refs/heads/master | 2023-04-09T09:24:10.147258 | 2019-04-21T23:53:09 | 2019-04-22T01:37:08 | 184,848,287 | 1 | 0 | MIT | 2023-03-24T23:38:11 | 2019-05-04T03:36:30 | Java | UTF-8 | Java | false | false | 2,145 | java | package com.jnape.palatable.lambda.semigroup.builtin;
import com.jnape.palatable.lambda.adt.Either;
import com.jnape.palatable.lambda.functions.Fn1;
import com.jnape.palatable.lambda.functions.specialized.BiSemigroupFactory;
import com.jnape.palatable.lambda.functions.specialized.SemigroupFactory;
import com.jnape.palatable.lambda.monoid.Monoid;
import com.jnape.palatable.lambda.semigroup.Semigroup;
/**
* A {@link Semigroup} instance formed by {@link Either#merge} and semigroups over <code>L</code> and <code>R</code>.
* Like {@link Either#merge}, this is left-biased.
* <p>
* For the {@link Monoid}, see {@link com.jnape.palatable.lambda.monoid.builtin.Merge}.
*
* @param <L> The left parameter type
* @param <R> The right parameter type
* @see Monoid
* @see Either#merge
*/
public final class Merge<L, R> implements BiSemigroupFactory<Semigroup<L>, Semigroup<R>, Either<L, R>> {
private static final Merge<?, ?> INSTANCE = new Merge<>();
private Merge() {
}
@Override
public Semigroup<Either<L, R>> apply(Semigroup<L> lSemigroup, Semigroup<R> rSemigroup) {
return (x, y) -> x.merge(lSemigroup::apply, rSemigroup::apply, y);
}
@SuppressWarnings("unchecked")
public static <L, R> Merge<L, R> merge() {
return (Merge<L, R>) INSTANCE;
}
public static <L, R> SemigroupFactory<Semigroup<R>, Either<L, R>> merge(Semigroup<L> lSemigroup) {
return Merge.<L, R>merge().apply(lSemigroup);
}
public static <L, R> Semigroup<Either<L, R>> merge(Semigroup<L> lSemigroup, Semigroup<R> rSemigroup) {
return Merge.<L, R>merge(lSemigroup).apply(rSemigroup);
}
public static <L, R> Fn1<Either<L, R>, Either<L, R>> merge(Semigroup<L> lSemigroup, Semigroup<R> rSemigroup,
Either<L, R> x) {
return merge(lSemigroup, rSemigroup).apply(x);
}
public static <L, R> Either<L, R> merge(Semigroup<L> lSemigroup, Semigroup<R> rSemigroup, Either<L, R> x,
Either<L, R> y) {
return merge(lSemigroup, rSemigroup, x).apply(y);
}
}
| [
"jnape09@gmail.com"
] | jnape09@gmail.com |
eb4fed5c9eeaf69ebbc892050bc695502f9944bb | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Lang/56/org/apache/commons/lang/time/FastDateFormat_estimateLength_1142.java | b89908873f8119b38153cf1a69d0280dbbb4a2e0 | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 2,674 | java |
org apach common lang time
fast date format fastdateformat fast thread safe version
link java text simpl date format simpledateformat
direct replac
code simpl date format simpledateformat code format situat
multi thread server environ
code simpl date format simpledateformat code thread safe jdk version
sun close bug rfe
format support pattern compat
simpl date format simpledateformat time zone
java introduc pattern letter code 'z' code repres
time zone rfc822 format code code code code
pattern letter jdk version
addit pattern code zz' 'zz' code made repres
iso8601 full format time zone code code code code
introduc minor incompat java gain
function
author tea trove teatrov project
author brian neill o'neil
author sean schofield
author gari gregori
author stephen colebourn
author nikolai metchev
version
fast date format fastdateformat format
inherit doc inheritdoc
estim length estimatelength
max
valu mvalu length
len valu mvalu length
len max
max len
max
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
b2c071db387f7b4f81bfc8f82bd84f555b2fdf00 | 5ec06dab1409d790496ce082dacb321392b32fe9 | /clients/java-vertx/generated/src/main/java/org/openapitools/server/api/model/ComDayCqReportingImplRLogAnalyzerProperties.java | 336af15389978c91b1b6037331290a319ae15bd1 | [
"Apache-2.0"
] | permissive | shinesolutions/swagger-aem-osgi | e9d2385f44bee70e5bbdc0d577e99a9f2525266f | c2f6e076971d2592c1cbd3f70695c679e807396b | refs/heads/master | 2022-10-29T13:07:40.422092 | 2021-04-09T07:46:03 | 2021-04-09T07:46:03 | 190,217,155 | 3 | 3 | Apache-2.0 | 2022-10-05T03:26:20 | 2019-06-04T14:23:28 | null | UTF-8 | Java | false | false | 1,982 | java | package org.openapitools.server.api.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.openapitools.server.api.model.ConfigNodePropertyString;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ComDayCqReportingImplRLogAnalyzerProperties {
private ConfigNodePropertyString requestLogOutput = null;
public ComDayCqReportingImplRLogAnalyzerProperties () {
}
public ComDayCqReportingImplRLogAnalyzerProperties (ConfigNodePropertyString requestLogOutput) {
this.requestLogOutput = requestLogOutput;
}
@JsonProperty("request.log.output")
public ConfigNodePropertyString getRequestLogOutput() {
return requestLogOutput;
}
public void setRequestLogOutput(ConfigNodePropertyString requestLogOutput) {
this.requestLogOutput = requestLogOutput;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComDayCqReportingImplRLogAnalyzerProperties comDayCqReportingImplRLogAnalyzerProperties = (ComDayCqReportingImplRLogAnalyzerProperties) o;
return Objects.equals(requestLogOutput, comDayCqReportingImplRLogAnalyzerProperties.requestLogOutput);
}
@Override
public int hashCode() {
return Objects.hash(requestLogOutput);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ComDayCqReportingImplRLogAnalyzerProperties {\n");
sb.append(" requestLogOutput: ").append(toIndentedString(requestLogOutput)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"cliffano@gmail.com"
] | cliffano@gmail.com |
1a00de856e9b5be65f4d6e7213c404050e25e9bf | a94619fdc8770da90d0d307da64f19e95bcbbfc7 | /java/rl.java | 329324e28a8a56c55b2ccbec2ecc510354f32245 | [] | no_license | BeCandid/CFR | b95cf21629ced30fac290a61ff51d443057a5919 | ab5019fb6196b6c8f8e2a3fe18f557b89831d690 | refs/heads/master | 2021-01-12T05:52:09.792333 | 2016-12-24T10:04:51 | 2016-12-24T10:04:51 | 77,222,002 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 903 | java | /*
* Decompiled with CFR 0_110.
*
* Could not load the following classes:
* java.lang.Object
* java.lang.String
* java.util.Map
* java.util.concurrent.ConcurrentHashMap
* org.json.JSONObject
*/
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.json.JSONObject;
class rl {
final rn a;
final Map<String, Object> b = new ConcurrentHashMap();
public rl(rn rn2) {
this.a = rn2;
}
void a(String string2, Object object) {
if (!this.a.a(this.b, string2)) {
this.b.put((Object)string2, object);
}
}
void a(String string2, String string3) {
if (this.a.a(string2, "key") || this.a.a(string3, "value")) {
return;
}
this.a(this.a.a(string2), (Object)this.a.a(string3));
}
public String toString() {
return new JSONObject(this.b).toString();
}
}
| [
"admin@timo.de.vc"
] | admin@timo.de.vc |
d249baf8160e1c9b57170e32662065e02d467114 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/alibaba--druid/e4989a26cc61f679b5eaa08bd22ba0ce1810d8b9/after/OracleAlterTableTest16.java | 1b527083bd9f8fffda0654b7400da796e1dfc877 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,515 | java | /*
* Copyright 1999-2101 Alibaba Group Holding Ltd.
*
* 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.alibaba.druid.bvt.sql.oracle.alter;
import java.util.List;
import org.junit.Assert;
import com.alibaba.druid.sql.OracleTest;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser;
import com.alibaba.druid.sql.dialect.oracle.visitor.OracleSchemaStatVisitor;
import com.alibaba.druid.stat.TableStat;
public class OracleAlterTableTest16 extends OracleTest {
public void test_0() throws Exception {
String sql = //
"ALTER TABLE extensions DROP COLUMN category";
OracleStatementParser parser = new OracleStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
SQLStatement statemen = statementList.get(0);
print(statementList);
Assert.assertEquals(1, statementList.size());
OracleSchemaStatVisitor visitor = new OracleSchemaStatVisitor();
statemen.accept(visitor);
System.out.println("Tables : " + visitor.getTables());
System.out.println("fields : " + visitor.getColumns());
System.out.println("coditions : " + visitor.getConditions());
System.out.println("relationships : " + visitor.getRelationships());
System.out.println("orderBy : " + visitor.getOrderByColumns());
Assert.assertEquals(1, visitor.getTables().size());
Assert.assertTrue(visitor.getTables().containsKey(new TableStat.Name("extensions")));
Assert.assertEquals(1, visitor.getColumns().size());
// Assert.assertTrue(visitor.getColumns().contains(new TableStat.Column("PRODUCT_IDS_ZZJ_TBD0209", "discount_amount")));
// Assert.assertTrue(visitor.getColumns().contains(new TableStat.Column("ws_affiliate_tran_product", "commission_amount")));
// Assert.assertTrue(visitor.getColumns().contains(new TableStat.Column("pivot_table", "order_mode")));
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
c7e371a5144c122f11211c173b90ad318a8cd9da | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/8/8_71d5f346d64471c446b5d1e76db3336f9ecf0b2d/regress/8_71d5f346d64471c446b5d1e76db3336f9ecf0b2d_regress_s.java | 588673d1495f0b54a2de30291c2aa84384887a69 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 2,379 | java | // Regression test for libgcj/Classpath SimpleDateFormat bugs
// Tags: JDK1.1
// Copyright (c) 1999, 2001 Free Software Foundation
// This file is part of Mauve.
package gnu.testlet.java.text.SimpleDateFormat;
import gnu.testlet.Testlet;
import gnu.testlet.TestHarness;
import java.text.*;
import java.util.*;
public class regress implements Testlet
{
// These must all be in the same format, with the timezone as the
// characters after the final space, since that is what the code
// expects. They must also all represent the same time.
public static String[] dates =
{
"Fri, 18 May 2001 12:18:06 CDT",
"Fri, 18 May 2001 13:18:06 EDT",
"Fri, 18 May 2001 12:18:06 EST",
"Fri, 18 May 2001 17:18:06 GMT",
"Fri, 18 May 2001 10:18:06 PDT"
};
public void test (TestHarness harness)
{
// We don't check the results but just that this works at all. This
// is a regression test for libgcj.
harness.checkPoint ("parsing regression");
DateFormat cdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzzz");
boolean ok = true;
Date d = null;
try
{
d = cdf.parse ("Fri, 18 May 2001 20:18:06 GMT");
}
catch (ParseException _)
{
ok = false;
}
harness.check (ok);
Calendar k = Calendar.getInstance (TimeZone.getTimeZone ("GMT"));
k.setTime (d);
harness.check (k.get(Calendar.HOUR), 8, "check hour");
harness.check (k.get(Calendar.HOUR_OF_DAY), 20, "check hour-of-day");
cdf = new SimpleDateFormat ("EEE, dd MMM yyyy HH:mm:ss zzz");
cdf.setTimeZone (TimeZone.getTimeZone ("GMT"));
for (int i = 0; i < dates.length; ++i)
{
String tz = dates[i].substring (dates[i].lastIndexOf (' ') + 1,
dates[i].length ());
try
{
d = cdf.parse (dates[i]);
harness.check (cdf.format (d), "Fri, 18 May 2001 17:18:06 GMT",
tz);
}
catch (ParseException _)
{
harness.debug (_);
harness.check (false, tz);
}
}
cdf = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss");
try
{
d = cdf.parse ("03-22-2001 15:54:27");
harness.check (cdf.format (d), "03-22-2001 15:54:27",
"local timezone");
}
catch (ParseException _)
{
harness.debug (_);
harness.check (false, "local timezone");
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8b86f1bccb3e6a93dbc1abde3eabf35a9b6abdae | d8a7ff3ba36829837fb011d82df647641d83ba40 | /src/test/java/com/gargoylesoftware/htmlunit/javascript/host/html/HTMLTemplateElementTest.java | 0d5f5a2282bd37c5ea2ded31e41adf6e7b65351a | [
"Apache-2.0"
] | permissive | eckardnet/htmlunit | 772e073131b2c05e588d95ce70a1464da40e3a64 | 8ec1c0ca424ff57f0eb9ab24bab72867e9af4357 | refs/heads/master | 2020-03-28T06:06:52.705491 | 2018-09-06T17:51:57 | 2018-09-06T17:51:57 | 147,814,392 | 0 | 0 | Apache-2.0 | 2018-09-07T11:27:47 | 2018-09-07T11:27:47 | null | UTF-8 | Java | false | false | 7,456 | java | /*
* Copyright (c) 2002-2018 Gargoyle Software 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.gargoylesoftware.htmlunit.javascript.host.html;
import org.junit.Test;
import org.junit.runner.RunWith;
import com.gargoylesoftware.htmlunit.BrowserRunner;
import com.gargoylesoftware.htmlunit.BrowserRunner.Alerts;
import com.gargoylesoftware.htmlunit.WebDriverTestCase;
/**
* Tests for {@link HTMLTemplateElement}.
*
* @author Ronald Brill
*/
@RunWith(BrowserRunner.class)
public class HTMLTemplateElementTest extends WebDriverTestCase {
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = "false",
IE = "exception")
public void prototype() throws Exception {
final String html
= "<html><body>\n"
+ "<script>\n"
+ " try {\n"
+ " alert(HTMLTemplateElement.prototype == null);\n"
+ " } catch (e) { alert('exception'); }\n"
+ "</script>\n"
+ "</body></html>";
loadPageWithAlerts2(html);
}
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = "true",
IE = "false")
public void contentCheck() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <script>\n"
+ " function test() {\n"
+ " try {\n"
+ " var template = document.createElement('template');\n"
+ " alert('content' in template);\n"
+ " } catch (e) { alert('exception'); }\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>\n"
+ " </body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = {"[object DocumentFragment]", "0-0",
"[object DocumentFragment]", "0-0",
"[object DocumentFragment]", "0-1",
"[object DocumentFragment]", "0-2"},
IE = "not available")
public void content() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <script>\n"
+ " function test() {\n"
+ " var template = document.createElement('template');\n"
+ " if (!('content' in template)) { alert('not available'); return }\n"
+ " alert(template.content);\n"
+ " alert(template.childNodes.length + '-' + template.content.childNodes.length);\n"
+ " template = document.getElementById('tEmpty');\n"
+ " alert(template.content);\n"
+ " alert(template.childNodes.length + '-' + template.content.childNodes.length);\n"
+ " template = document.getElementById('tText');\n"
+ " alert(template.content);\n"
+ " alert(template.childNodes.length + '-' + template.content.childNodes.length);\n"
+ " template = document.getElementById('tDiv');\n"
+ " alert(template.content);\n"
+ " alert(template.childNodes.length + '-' + template.content.childNodes.length);\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>\n"
+ " <template id='tEmpty'></template>\n"
+ " <template id='tText'>HtmlUnit</template>\n"
+ " <template id='tDiv'><div>HtmlUnit</div><div>is great</div></template>\n"
+ " </body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = {"[object DocumentFragment]", "0-0", "1-0"},
IE = "not available")
public void appendChild() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <script>\n"
+ " function test() {\n"
+ " var template = document.createElement('template');\n"
+ " if (!('content' in template)) { alert('not available'); return }\n"
+ " template = document.getElementById('tester');\n"
+ " alert(template.content);\n"
+ " alert(template.childNodes.length + '-' + template.content.childNodes.length);\n"
+ " var div = document.createElement('div');\n"
+ " template.appendChild(div);\n"
+ " alert(template.childNodes.length + '-' + template.content.childNodes.length);\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>\n"
+ " <template id='tester'></template>\n"
+ " </body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
/**
* @throws Exception if the test fails
*/
@Test
@Alerts(DEFAULT = {"", "", "<p></p>", "", "HtmlUnit", "<div>HtmlUnit</div><div>is great</div>"},
IE = {"", "<div></div>", "", "HtmlUnit", "<div>HtmlUnit</div><div>is great</div>"})
public void innerHTML() throws Exception {
final String html =
"<html>\n"
+ " <head>\n"
+ " <script>\n"
+ " function test() {\n"
+ " var template = document.createElement('template');\n"
+ " alert(template.innerHTML);\n"
+ " var div = document.createElement('div');\n"
+ " template.appendChild(div);\n"
+ " alert(template.innerHTML);\n"
+ " var p = document.createElement('p');\n"
+ " if ('content' in template) {\n"
+ " template.content.appendChild(p);\n"
+ " alert(template.innerHTML);\n"
+ " }\n"
+ " template = document.getElementById('tEmpty');\n"
+ " alert(template.innerHTML);\n"
+ " template = document.getElementById('tText');\n"
+ " alert(template.innerHTML);\n"
+ " template = document.getElementById('tDiv');\n"
+ " alert(template.innerHTML);\n"
+ " }\n"
+ " </script>\n"
+ " </head>\n"
+ " <body onload='test()'>\n"
+ " <template id='tEmpty'></template>\n"
+ " <template id='tText'>HtmlUnit</template>\n"
+ " <template id='tDiv'><div>HtmlUnit</div><div>is great</div></template>\n"
+ " </body>\n"
+ "</html>";
loadPageWithAlerts2(html);
}
}
| [
"rbri@rbri.de"
] | rbri@rbri.de |
fba89e117e79aaa721cbc5ff16ed56a18558004a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_e458143227ec555d822cf8830d66f6c17abcff56/ScreenshotPane/15_e458143227ec555d822cf8830d66f6c17abcff56_ScreenshotPane_s.java | 8bcb40220cb6ed76af2efcc161e1ecde0b939208 | [] | 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 | 8,049 | java | package edu.mit.csail.uid;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.imageio.*;
class ScreenshotPane extends JPanel implements ChangeListener, ComponentListener, Subject{
final static int DEFAULT_H = 300;
static int MAX_NUM_MATCHING = 100;
Region _match_region;
int _width, _height;
double _scale, _ratio;
boolean _runFind = false;
float _similarity;
int _numMatches;
Set<Match> _fullMatches = null;
Vector<Match> _showMatches = null;
Observer _observer = null;
protected ScreenImage _simg;
protected BufferedImage _screen = null;
private JLabel btnSimilar;
private JSlider sldSimilar;
private JSpinner txtNumMatches;
public ScreenshotPane(ScreenImage simg){
_match_region = new UnionScreen();
int w = _match_region.w, h = _match_region.h;
_ratio = (double)w/h;
_height = DEFAULT_H;
_scale = (double)_height/h;
_width = (int)(w * _scale);
setPreferredSize(new Dimension(_width, _height));
addComponentListener(this);
_simg = simg;
_screen = simg.getImage();
}
static String _I(String key, Object... args){
return I18N._I(key, args);
}
public void componentHidden(ComponentEvent e) { }
public void componentMoved(ComponentEvent e) { }
public void componentShown(ComponentEvent e) { }
public void componentResized(ComponentEvent e) {
_width = getWidth();
_height = (int)((double)_width/_ratio);
_scale = (double)_height/_match_region.h;
setPreferredSize(new Dimension(_width, _height));
}
private JSlider createSlider(){
//sldSimilar = new JSlider(0, 100, 70);
sldSimilar = new SimilaritySlider(0, 100, 70);
sldSimilar.setMajorTickSpacing(10);
sldSimilar.setPaintTicks(true);
Hashtable labelTable = new Hashtable();
labelTable.put( new Integer( 0 ), new JLabel("0.0") );
labelTable.put( new Integer( 50 ), new JLabel("0.5") );
labelTable.put( new Integer( 100 ), new JLabel("1.0") );
sldSimilar.setLabelTable( labelTable );
sldSimilar.setPaintLabels(true);
sldSimilar.addChangeListener(this);
return sldSimilar;
}
public JComponent createControls(){
JPanel pane = new JPanel(new GridBagLayout());
btnSimilar = new JLabel(_I("lblSimilarity"));
sldSimilar = createSlider();
JLabel lblPreNumMatches = new JLabel(_I("lblNumberOfMatches"));
SpinnerNumberModel model = new SpinnerNumberModel(10, 0, ScreenshotPane.MAX_NUM_MATCHING, 1);
txtNumMatches = new JSpinner(model);
lblPreNumMatches.setLabelFor(txtNumMatches);
GridBagConstraints c = new GridBagConstraints();
c.fill = 1;
c.gridy = 0;
pane.add( btnSimilar, c );
pane.add( sldSimilar, c );
c.fill = 0;
c.gridy = 1;
pane.add( lblPreNumMatches, c );
c.insets = new Insets(0, 0, 10, 100);
pane.add( txtNumMatches, c );
txtNumMatches.addChangeListener(this);
return pane;
}
public boolean isExact(){ return _similarity==1.0f; }
public float getSimilarity(){ return _similarity; }
public int getNumMatches(){ return _numMatches; }
public void setParameters(boolean exact, float similarity, int numMatches){
if(!exact)
_similarity = similarity;
else
_similarity = 1.0f;
_numMatches = numMatches;
filterMatches(_similarity, _numMatches);
sldSimilar.setValue((int)(similarity*100));
repaint();
}
public void setSimilarity(float similarity){
_similarity = similarity;
filterMatches(_similarity, _numMatches);
repaint();
}
public void setNumMatches(int numMatches){
_numMatches = numMatches;
filterMatches(_similarity, _numMatches);
repaint();
}
public void addObserver( Observer ob ){
_observer = ob;
}
public void notifyObserver(){
if(_observer != null)
_observer.update(this);
}
public void setParameters(final String patFilename,
final boolean exact, final float similarity,
final int numMatches)
throws IOException, AWTException{
if( !_runFind ){
_runFind = true;
Thread thread = new Thread(new Runnable(){
public void run(){
try{
Finder f = new Finder(_simg, _match_region);
f.find(new Pattern(patFilename).similar(0f));
_fullMatches = new TreeSet<Match>(new Comparator(){
public int compare(Object o1, Object o2){
return -1 * ((Comparable)o1).compareTo(o2);
}
public boolean equals(Object o){
return false;
}
});
int count=0;
while(f.hasNext()){
if(++count > MAX_NUM_MATCHING)
break;
Match m = f.next();
synchronized(_fullMatches){
_fullMatches.add(m);
}
setParameters(exact, similarity, numMatches);
notifyObserver();
}
}
catch(Exception e){
e.printStackTrace();
}
}
});
thread.start();
}
else
setParameters(exact, similarity, numMatches);
}
void filterMatches(float similarity, int numMatches){
int count = 0;
if(_fullMatches != null && numMatches>=0){
Debug.log(7, "filterMatches(%.2f,%d): %d",
similarity, numMatches, count);
if(_showMatches == null)
_showMatches = new Vector<Match>();
synchronized(_showMatches){
_showMatches.clear();
if(numMatches == 0) return;
synchronized(_fullMatches){
for(Match m : _fullMatches){
if( m.score >= similarity ){
_showMatches.add(m);
if( ++count >= numMatches )
break;
}
}
}
}
}
return;
}
public void paint(Graphics g){
Graphics2D g2d = (Graphics2D)g;
if( _screen != null ){
g2d.drawImage(_screen, 0, 0, _width, _height, null);
if( _showMatches != null )
paintMatches(g2d);
else
paintOverlay(g2d);
}
}
void paintOverlay(Graphics2D g2d){
g2d.setColor(new Color(0,0,0,150));
g2d.fillRect(0, 0, _width, _height);
}
void paintMatches(Graphics2D g2d){
synchronized(_showMatches){
for(Match m : _showMatches){
int x = (int)(m.x*_scale);
int y = (int)(m.y*_scale);
int w = (int)(m.w*_scale);
int h = (int)(m.h*_scale);
Color c = SimilaritySlider.getScoreColor(m.score);
g2d.setColor(c);
g2d.fillRect(x, y, w, h);
g2d.drawRect(x, y, w-1, h-1);
}
}
}
public void stateChanged(javax.swing.event.ChangeEvent e) {
Object src = e.getSource();
if( src instanceof JSlider){
JSlider source = (JSlider)e.getSource();
int val = (int)source.getValue();
setSimilarity((float)val/100);
}
else if( src instanceof JSpinner){
JSpinner source = (JSpinner)e.getSource();
int val = (Integer)source.getValue();
setNumMatches(val);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
e28366641136dd1264c3434e8d09c3d6ff78b283 | 83d56024094d15f64e07650dd2b606a38d7ec5f1 | /sicc_druida/fuentes/java/BelTipoMovimCajaLPStartUpCreate.java | bf816eb7469637a997dc071f8cc1327f8b9b5586 | [] | no_license | cdiglesias/SICC | bdeba6af8f49e8d038ef30b61fcc6371c1083840 | 72fedb14a03cb4a77f62885bec3226dbbed6a5bb | refs/heads/master | 2021-01-19T19:45:14.788800 | 2016-04-07T16:20:51 | 2016-04-07T16:20:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,045 | java | /*
INDRA/CAR/mmg
$Id: BelTipoMovimCajaLPStartUpCreate.java,v 1.1 2009/12/03 18:36:06 pecbazalar Exp $
DESC
*/
import es.indra.druida.belcorp.MMGDruidaBase;
// Definicion de la clase
public class BelTipoMovimCajaLPStartUpCreate extends MMGDruidaBase{
public void inicio() throws Exception {
//No tiene asociado xml ya que simpelmente redirecciona
}
public void ejecucion() throws Exception {
conectorAction("BelTipoMovimCajaLPStartUp");
conectorActionParametro(PARAMETRO_GENERICO_ACCION, "create");
conectorActionParametro(PARAMETRO_GENERICO_ORIGEN, "menu");
conectorActionParametro("idFuncion",
conectorParametro("idFuncion") == null?"": conectorParametro("idFuncion"));
conectorActionParametro(PARAMETRO_MENU_FROM_MENU,
conectorParametro(PARAMETRO_MENU_FROM_MENU) == null?"": conectorParametro(PARAMETRO_MENU_FROM_MENU));
conectorActionParametro(PARAMETRO_MENU_CDOS_IDIOMA,
conectorParametro(PARAMETRO_MENU_CDOS_IDIOMA) == null? "": conectorParametro(PARAMETRO_MENU_CDOS_IDIOMA));
rastreo();
}
}
| [
"hp.vega@hotmail.com"
] | hp.vega@hotmail.com |
f7574f088dbce2e6421e4d8d85f291ce55f58150 | c4a14d70951d7ec5aac7fe7ebb2db891cfe6c0b1 | /webapps/GuiaUrbana/LOCALGIS-Core/src/main/java/com/localgis/web/core/security/sso/beans/SesionBean.java | 0d62465bdf323c2c9167898cc884b5fc0a28b17b | [] | no_license | pepeysusmapas/allocalgis | 925756321b695066775acd012f9487cb0725fcde | c14346d877753ca17339f583d469dbac444ffa98 | refs/heads/master | 2020-09-14T20:15:26.459883 | 2016-09-27T10:08:32 | 2016-09-27T10:08:32 | null | 0 | 0 | null | null | null | null | WINDOWS-1252 | Java | false | false | 2,818 | java | /**
* SesionBean.java
* © MINETUR, Government of Spain
* This program is part of LocalGIS
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.localgis.web.core.security.sso.beans;
import java.util.List;
import java.util.Date;
import java.util.Calendar;
/*
* @Author dcaaveiro
*/
public class SesionBean {
private static org.apache.log4j.Logger logger = org.apache.log4j.Logger.getLogger(SesionBean.class);
private String idSesion;
private String idApp;
private String idUser;
private List alMunicipios;
private String idEntidad;
private String idMunicipio;
private String sName;
private Date fechaConexion=null;
public SesionBean() {
}
public SesionBean(String sIdSesion, String sIdApp)
{
idSesion=sIdSesion;
idApp=sIdApp;
fechaConexion=Calendar.getInstance().getTime();
}
public Date getFechaConexion() {
return fechaConexion;
}
public void setFechaConexion(Date fechaConexion) {
this.fechaConexion = fechaConexion;
}
public String getIdUser() {
return idUser;
}
public void setIdSesion(String idSesion) {
this.idSesion = idSesion;
}
public void setIdApp(String idApp) {
this.idApp = idApp;
}
public void setIdUser(String idUser) {
this.idUser = idUser;
}
public String getIdSesion()
{
return idSesion;
}
public String getIdApp()
{
return idApp;
}
public List getAlMunicipios() {
return alMunicipios;
}
public void setAlMunicipios(List alMunicipios) {
this.alMunicipios = alMunicipios;
}
public String getIdEntidad() {
return idEntidad;
}
public void setIdEntidad(String idEntidad) {
this.idEntidad = idEntidad;
}
public String getIdMunicipio() {
return idMunicipio;
}
public void setIdMunicipio(String idMunicipio) {
this.idMunicipio = idMunicipio;
}
public String getsName() {
return sName;
}
public void setsName(String sName) {
this.sName = sName;
}
}
| [
"jorge.martin@cenatic.es"
] | jorge.martin@cenatic.es |
30362f9e89022e579467fef289ecb58ff1025021 | 7b2ba69191edaff56eeb9063e7713cf332add4e7 | /src/main/java/io/rakam/client/model/ContinuousQueryDeleteQuery.java | 436dd7ec8a9f4fe16106392ffabf837853979150 | [
"Apache-2.0"
] | permissive | sreekanthpulagam/rakam-java-client | fe7b2ebbeee54ec52aec5c0ffd114022572afffe | fda4ec00cc9dd864f7042a9739c596579da90922 | refs/heads/master | 2020-12-13T18:25:35.150576 | 2016-07-19T21:37:46 | 2016-07-19T21:37:46 | 68,785,657 | 0 | 1 | null | 2016-09-21T06:09:46 | 2016-09-21T06:09:45 | Java | UTF-8 | Java | false | false | 2,615 | java | /**
* Rakam API Documentation
* An analytics platform API that lets you create your own analytics services.
*
* OpenAPI spec version: 0.5
* Contact: contact@rakam.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.rakam.client.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* ContinuousQueryDeleteQuery
*/
public class ContinuousQueryDeleteQuery {
@SerializedName("table_name")
private String tableName = null;
public ContinuousQueryDeleteQuery tableName(String tableName) {
this.tableName = tableName;
return this;
}
/**
* Get tableName
* @return tableName
**/
@ApiModelProperty(example = "null", value = "")
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContinuousQueryDeleteQuery continuousQueryDeleteQuery = (ContinuousQueryDeleteQuery) o;
return Objects.equals(this.tableName, continuousQueryDeleteQuery.tableName);
}
@Override
public int hashCode() {
return Objects.hash(tableName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContinuousQueryDeleteQuery {\n");
sb.append(" tableName: ").append(toIndentedString(tableName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
| [
"emrekabakci@gmail.com"
] | emrekabakci@gmail.com |
d5dd015adf3bb3c1678ed4cf3c0dacbc37f00314 | 9885446259af09cd6f224124b67e38c4384f60e7 | /src/main/generated/eu/datex2/schema/_2_0rc1/_2_0/LocationCharacteristicsOverride.java | 43027242e54efa09ef4ed67e7d52399499a8186c | [] | no_license | dsuru1499/situation_exchange | 685b08e29ba11d9c4f797f51d33e8118b097bfa9 | c43b4a90a2de56b50b68bd66f8b087d100c600c5 | refs/heads/master | 2021-05-11T14:20:50.736215 | 2018-07-27T06:08:07 | 2018-07-27T06:08:07 | 117,700,983 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,690 | java |
package eu.datex2.schema._2_0rc1._2_0;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Classe Java pour LocationCharacteristicsOverride complex type.
*
* <p>Le fragment de schéma suivant indique le contenu attendu figurant dans cette classe.
*
* <pre>
* <complexType name="LocationCharacteristicsOverride">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="measurementLanesOverride" type="{http://datex2.eu/schema/2_0RC1/2_0}LaneEnum" minOccurs="0"/>
* <element name="reversedFlow" type="{http://datex2.eu/schema/2_0RC1/2_0}Boolean" minOccurs="0"/>
* <element name="locationCharacteristicsOverrideExtension" type="{http://datex2.eu/schema/2_0RC1/2_0}ExtensionType" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "LocationCharacteristicsOverride", propOrder = {
"measurementLanesOverride",
"reversedFlow",
"locationCharacteristicsOverrideExtension"
})
public class LocationCharacteristicsOverride
implements Serializable
{
private final static long serialVersionUID = 1L;
protected LaneEnum measurementLanesOverride;
protected Boolean reversedFlow;
protected ExtensionType locationCharacteristicsOverrideExtension;
/**
* Obtient la valeur de la propriété measurementLanesOverride.
*
* @return
* possible object is
* {@link LaneEnum }
*
*/
public LaneEnum getMeasurementLanesOverride() {
return measurementLanesOverride;
}
/**
* Définit la valeur de la propriété measurementLanesOverride.
*
* @param value
* allowed object is
* {@link LaneEnum }
*
*/
public void setMeasurementLanesOverride(LaneEnum value) {
this.measurementLanesOverride = value;
}
public boolean isSetMeasurementLanesOverride() {
return (this.measurementLanesOverride!= null);
}
/**
* Obtient la valeur de la propriété reversedFlow.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isReversedFlow() {
return reversedFlow;
}
/**
* Définit la valeur de la propriété reversedFlow.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setReversedFlow(Boolean value) {
this.reversedFlow = value;
}
public boolean isSetReversedFlow() {
return (this.reversedFlow!= null);
}
/**
* Obtient la valeur de la propriété locationCharacteristicsOverrideExtension.
*
* @return
* possible object is
* {@link ExtensionType }
*
*/
public ExtensionType getLocationCharacteristicsOverrideExtension() {
return locationCharacteristicsOverrideExtension;
}
/**
* Définit la valeur de la propriété locationCharacteristicsOverrideExtension.
*
* @param value
* allowed object is
* {@link ExtensionType }
*
*/
public void setLocationCharacteristicsOverrideExtension(ExtensionType value) {
this.locationCharacteristicsOverrideExtension = value;
}
public boolean isSetLocationCharacteristicsOverrideExtension() {
return (this.locationCharacteristicsOverrideExtension!= null);
}
}
| [
"user@localhost.localdomain"
] | user@localhost.localdomain |
f761b3bcaea1f43584eba5e0d08ecee90fbb6f69 | c6572a9dd42bce66df5ab21157f7e8738939e24f | /_test_rsocket/src/main/java/rsocktapp/demo2/ServerApp.java | ac36b0ec895e3a4daec24094f20c3af32e365dae | [
"Apache-2.0"
] | permissive | noear/solon_demo | 791ddd28d49c4356f5bf58840dfab15eaee9f0bb | 2cc1c4d580f9930db4cb5a0f9c300617fc4b4925 | refs/heads/master | 2023-07-20T13:43:55.586597 | 2023-04-02T00:41:41 | 2023-04-02T00:41:41 | 230,220,372 | 2 | 0 | Apache-2.0 | 2023-07-07T21:53:28 | 2019-12-26T07:51:10 | Java | UTF-8 | Java | false | false | 834 | java | package rsocktapp.demo2;
import io.rsocket.ConnectionSetupPayload;
import io.rsocket.RSocket;
import io.rsocket.SocketAcceptor;
import io.rsocket.core.RSocketServer;
import io.rsocket.frame.decoder.PayloadDecoder;
import io.rsocket.transport.netty.server.TcpServerTransport;
import reactor.core.publisher.Mono;
public class ServerApp {
public static void main(String[] args){
RSocketServer.create(new ServerHandler())
.payloadDecoder(PayloadDecoder.ZERO_COPY)
.bind(TcpServerTransport.create(7878))
.block()
.onClose();
}
public static class ServerHandler implements SocketAcceptor {
@Override
public Mono<RSocket> accept(ConnectionSetupPayload connectionSetupPayload, RSocket rSocket) {
return null;
}
}
}
| [
"noear@live.cn"
] | noear@live.cn |
2e0e0fbd930d2450820a5b3793602bb807f881e9 | 6253283b67c01a0d7395e38aeeea65e06f62504b | /decompile/app/Mms/src/main/java/com/android/mms/data/CryptoWorkingMessage.java | 863c3312617fcf2aaacd8af7b00712aa697f69dc | [] | no_license | sufadi/decompile-hw | 2e0457a0a7ade103908a6a41757923a791248215 | 4c3efd95f3e997b44dd4ceec506de6164192eca3 | refs/heads/master | 2023-03-15T15:56:03.968086 | 2017-11-08T03:29:10 | 2017-11-08T03:29:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 943 | java | package com.android.mms.data;
import android.content.Context;
import com.huawei.cspcommon.MLog;
import com.huawei.mms.crypto.CryptoMessageServiceProxy;
import com.huawei.mms.crypto.CryptoMessageUtil;
public class CryptoWorkingMessage {
public boolean isCryptoMessage(Context context, ContactList recipients) {
if (!CryptoMessageUtil.isCryptoSmsEnabled()) {
return false;
}
boolean messageEncrypted = CryptoMessageUtil.isSmsEncryptionSwitchOn(context, recipients);
MLog.d("CryptoWorkingMessage", "isCryptoMessage: messageEncrypted=" + messageEncrypted);
return messageEncrypted;
}
public String localEncrypt(String msg, int subID, Context context, ContactList recipients) {
if (CryptoMessageUtil.isCryptoSmsEnabled() && isCryptoMessage(context, recipients)) {
return CryptoMessageServiceProxy.localEncrypt(msg, subID);
}
return msg;
}
}
| [
"liming@droi.com"
] | liming@droi.com |
52e2c9e66a64fa2773afe9a078c3844382c0d4b2 | a46ea0b47063b54822c4e60f83cd9e40a1037115 | /workbench/org.carrot2.workbench.vis.aduna/src/org/carrot2/workbench/vis/aduna/VisualizationMode.java | 7dfdfa8975f37ff5f7130620652a4146a0ea4f49 | [
"LicenseRef-scancode-bsd-ack-carrot2",
"Apache-2.0"
] | permissive | syedfa/carrot2 | 1353fd972c59bdaa1ef693e1c97f99b9661a2a18 | 6eeec2f5c9e6e4226ca230f1a1ab04cdc48c5e81 | refs/heads/master | 2021-01-17T05:36:35.707664 | 2015-10-19T18:36:52 | 2015-10-19T18:36:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java |
/*
* Carrot2 project.
*
* Copyright (C) 2002-2015, Dawid Weiss, Stanisław Osiński.
* All rights reserved.
*
* Refer to the full license file "carrot2.LICENSE"
* in the root folder of the repository checkout or at:
* http://www.carrot2.org/carrot2.LICENSE
*/
package org.carrot2.workbench.vis.aduna;
/**
* How the view should react to selection in editors?
*/
enum VisualizationMode
{
SHOW_ALL_CLUSTERS("Show all clusters"),
SHOW_FIRST_LEVEL_CLUSTERS("Show first-level clusters"),
SHOW_SELECTED_CLUSTERS("Show selected clusters only");
private final String label;
private VisualizationMode(String label)
{
this.label = label;
}
@Override
public String toString()
{
return label;
}
}
| [
"dawid.weiss@carrotsearch.com"
] | dawid.weiss@carrotsearch.com |
45047032bb703e11e41c4c5ef9f29d96cbcb2bed | 995f73d30450a6dce6bc7145d89344b4ad6e0622 | /P40_HarmonyOS_2.0.0_Developer_Beta1/src/main/java/vendor/huawei/hardware/hisiradio/V1_0/RILImsUserData.java | 223c40f6bf79bee42a444260e0f110adc78a2a31 | [] | no_license | morningblu/HWFramework | 0ceb02cbe42585d0169d9b6c4964a41b436039f5 | 672bb34094b8780806a10ba9b1d21036fd808b8e | refs/heads/master | 2023-07-29T05:26:14.603817 | 2021-09-03T05:23:34 | 2021-09-03T05:23:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,306 | java | package vendor.huawei.hardware.hisiradio.V1_0;
import android.os.HidlSupport;
import android.os.HwBlob;
import android.os.HwParcel;
import java.util.ArrayList;
import java.util.Objects;
public final class RILImsUserData {
public String data = new String();
public int len;
public final boolean equals(Object otherObject) {
if (this == otherObject) {
return true;
}
if (otherObject == null || otherObject.getClass() != RILImsUserData.class) {
return false;
}
RILImsUserData other = (RILImsUserData) otherObject;
if (this.len == other.len && HidlSupport.deepEquals(this.data, other.data)) {
return true;
}
return false;
}
public final int hashCode() {
return Objects.hash(Integer.valueOf(HidlSupport.deepHashCode(Integer.valueOf(this.len))), Integer.valueOf(HidlSupport.deepHashCode(this.data)));
}
public final String toString() {
return "{.len = " + this.len + ", .data = " + this.data + "}";
}
public final void readFromParcel(HwParcel parcel) {
readEmbeddedFromParcel(parcel, parcel.readBuffer(24), 0);
}
public static final ArrayList<RILImsUserData> readVectorFromParcel(HwParcel parcel) {
ArrayList<RILImsUserData> _hidl_vec = new ArrayList<>();
HwBlob _hidl_blob = parcel.readBuffer(16);
int _hidl_vec_size = _hidl_blob.getInt32(8);
HwBlob childBlob = parcel.readEmbeddedBuffer((long) (_hidl_vec_size * 24), _hidl_blob.handle(), 0, true);
_hidl_vec.clear();
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
RILImsUserData _hidl_vec_element = new RILImsUserData();
_hidl_vec_element.readEmbeddedFromParcel(parcel, childBlob, (long) (_hidl_index_0 * 24));
_hidl_vec.add(_hidl_vec_element);
}
return _hidl_vec;
}
public final void readEmbeddedFromParcel(HwParcel parcel, HwBlob _hidl_blob, long _hidl_offset) {
this.len = _hidl_blob.getInt32(_hidl_offset + 0);
this.data = _hidl_blob.getString(_hidl_offset + 8);
parcel.readEmbeddedBuffer((long) (this.data.getBytes().length + 1), _hidl_blob.handle(), _hidl_offset + 8 + 0, false);
}
public final void writeToParcel(HwParcel parcel) {
HwBlob _hidl_blob = new HwBlob(24);
writeEmbeddedToBlob(_hidl_blob, 0);
parcel.writeBuffer(_hidl_blob);
}
public static final void writeVectorToParcel(HwParcel parcel, ArrayList<RILImsUserData> _hidl_vec) {
HwBlob _hidl_blob = new HwBlob(16);
int _hidl_vec_size = _hidl_vec.size();
_hidl_blob.putInt32(8, _hidl_vec_size);
_hidl_blob.putBool(12, false);
HwBlob childBlob = new HwBlob(_hidl_vec_size * 24);
for (int _hidl_index_0 = 0; _hidl_index_0 < _hidl_vec_size; _hidl_index_0++) {
_hidl_vec.get(_hidl_index_0).writeEmbeddedToBlob(childBlob, (long) (_hidl_index_0 * 24));
}
_hidl_blob.putBlob(0, childBlob);
parcel.writeBuffer(_hidl_blob);
}
public final void writeEmbeddedToBlob(HwBlob _hidl_blob, long _hidl_offset) {
_hidl_blob.putInt32(0 + _hidl_offset, this.len);
_hidl_blob.putString(8 + _hidl_offset, this.data);
}
}
| [
"dstmath@163.com"
] | dstmath@163.com |
763b8e6ef2c8a81700820efca386e6cc98b60986 | af846ab7ffc148cd3207f3e65cfb2dde6d92c767 | /sparrow-hyper/sparrow-flv-server/src/main/java/com/au/cache/Cache.java | fe9fc7eff6371b8d67bdca5fc2c59f34eb9cbb0b | [
"Apache-2.0"
] | permissive | aniu2002/myself-toolkit | aaf5f71948bb45d331b206d806de85c84bafadcc | aea640b4339ea24d7bfd32311f093560573635d3 | refs/heads/master | 2022-12-24T20:25:43.702167 | 2019-03-11T14:42:14 | 2019-03-11T14:42:14 | 99,811,298 | 1 | 0 | Apache-2.0 | 2022-12-12T21:42:45 | 2017-08-09T13:26:46 | Java | UTF-8 | Java | false | false | 6,024 | java | package com.au.cache;
import java.io.IOException;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import com.au.cache.exceptions.CacheException;
import com.au.cache.store.DiskStore;
import com.au.cache.store.LruMemoryStore;
import com.au.cache.store.Store;
public class Cache {
private Store diskStore;
private Store memoryStore;
private String name;
private String diskStorePath;
private int maxElementsInMemory;
private boolean overflowToDisk;
private boolean clearOnFlush;
private boolean active = false;
private int diskSpoolBufferSize;
public Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
int diskSpoolBufferSize) {
this(name, maxElementsInMemory, overflowToDisk, diskSpoolBufferSize,
System.getProperty("user.home"));
}
public Cache(String name, int maxElementsInMemory, boolean overflowToDisk,
int diskSpoolBufferSize, String diskStorePath) {
this.name = name;
this.maxElementsInMemory = maxElementsInMemory;
this.overflowToDisk = overflowToDisk;
this.clearOnFlush = true;
this.diskSpoolBufferSize = diskSpoolBufferSize;
this.diskStorePath = diskStorePath;
}
public void initialise() {
this.diskStore = this.createDiskStore();
this.memoryStore = new LruMemoryStore(this, diskStore,
this.maxElementsInMemory);
this.active = true;
}
protected Store createDiskStore() {
if (this.overflowToDisk) {
return new DiskStore(this, diskStorePath);
} else {
return null;
}
}
public boolean isOverflowToDisk() {
return this.overflowToDisk;
}
public boolean isClearOnFlush() {
return this.clearOnFlush;
}
public String getName() {
return this.name;
}
public long getMaxElementsOnDisk() {
return this.maxElementsInMemory;
}
public int getDiskSpoolBufferSizeMB() {
return this.diskSpoolBufferSize;
}
private void checkStatus() throws IllegalStateException {
if (!active) {
throw new IllegalStateException("The " + this.name
+ " Cache is not alive.");
}
}
public final Element get(Serializable key) {
return get((Object) key);
}
public final Element get(Object key) {
checkStatus();
Element element;
long start = System.currentTimeMillis();
element = searchInMemoryStore(key);
if (element == null && this.overflowToDisk) {
element = searchInDiskStore(key);
}
// todo is this expensive. Maybe ditch.
long end = System.currentTimeMillis();
return element;
}
private Element searchInMemoryStore(Object key) {
Element element;
element = memoryStore.get(key);
if (element != null) {
// 更新element 的使用频繁度
System.out.println("find the element " + element.getKey());
}
return element;
}
private Element searchInDiskStore(Object key) {
if (!(key instanceof Serializable)) {
return null;
}
Serializable serializableKey = (Serializable) key;
Element element;
element = diskStore.get(serializableKey);
if (element != null) {
// 放在内存中
try {
memoryStore.put(element);
} catch (CacheException e) {
e.printStackTrace();
}
}
return element;
}
public final void put(Element element) {
put(element, false);
}
/**
*/
public final void put(Element element, boolean notify) {
checkStatus();
if (!active) {
return;
}
if (element == null) {
return;
}
if (element.getObjectKey() == null) {
return;
}
// boolean elementExists;
// Object key = element.getObjectKey();
// elementExists = isElementInMemory(key) || isElementOnDisk(key);
backOffIfDiskSpoolFull();
try {
memoryStore.put(element);
} catch (CacheException e) {
e.printStackTrace();
}
}
private void backOffIfDiskSpoolFull() {
if (diskStore != null && diskStore.bufferFull()) {
// back off to avoid OutOfMemoryError
try {
Thread.sleep(100);
} catch (InterruptedException e) {
// do not care if this happens
}
}
}
public final boolean isElementInMemory(Object key) {
return memoryStore.containsKey(key);
}
public final boolean isElementOnDisk(Serializable key) {
return isElementOnDisk((Object) key);
}
public final boolean isElementOnDisk(Object key) {
if (!(key instanceof Serializable)) {
return false;
}
Serializable serializableKey = (Serializable) key;
if (this.overflowToDisk) {
return diskStore != null && diskStore.containsKey(serializableKey);
} else {
return false;
}
}
public final List getKeys() throws IllegalStateException, CacheException {
checkStatus();
List<Object> allKeyList = new ArrayList<Object>();
List<Object> keyList = Arrays.asList(memoryStore.getKeyArray());
allKeyList.addAll(keyList);
if (this.overflowToDisk) {
Set<Object> allKeys = new HashSet<Object>();
// within the store keys will be unique
allKeys.addAll(keyList);
Object[] diskKeys = diskStore.getKeyArray();
for (Object diskKey : diskKeys) {
if (allKeys.add(diskKey)) {
// Unique, so add it to the list
allKeyList.add(diskKey);
}
}
}
return allKeyList;
}
public final boolean remove(Serializable key) throws IllegalStateException {
return remove((Object) key);
}
public final boolean remove(Object key) throws IllegalStateException {
return remove(key, false);
}
private boolean remove(Object key, boolean expiry)
throws IllegalStateException {
checkStatus();
Element elementFromMemoryStore;
Element elementFromDiskStore;
elementFromMemoryStore = memoryStore.remove(key);
elementFromMemoryStore = null;
if (this.overflowToDisk) {
if ((key instanceof Serializable)) {
Serializable serializableKey = (Serializable) key;
elementFromDiskStore = diskStore.remove(serializableKey);
elementFromDiskStore = null;
}
}
return true;
}
public final synchronized void flush() {
checkStatus();
try {
memoryStore.flush();
if (this.overflowToDisk) {
diskStore.flush();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
| [
"yuanzhengchu2002@163.com"
] | yuanzhengchu2002@163.com |
34169500f52af6bae258f234885de5acb5c9e0f2 | db69ca20406f52244c1cc1f77df27701dedebc53 | /rdf-patch/src/main/java/org/seaborne/patch/items/TxnAbort.java | c7e0316d699bea65633ceb0b5ea12a829efbc050 | [
"Apache-2.0"
] | permissive | juanlongo/rdf-delta | 145a2461301337e016e0711b45ab2efd3f94eb48 | 51410d163b085f214f3de34fa4000276c65b9c6e | refs/heads/master | 2020-03-28T17:50:09.315923 | 2018-08-19T15:10:49 | 2018-08-19T15:10:49 | 148,827,079 | 0 | 0 | Apache-2.0 | 2018-09-14T18:27:09 | 2018-09-14T18:27:09 | null | UTF-8 | Java | false | false | 1,060 | 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.seaborne.patch.items;
public class TxnAbort extends ChangeItem {
@Override
public int hashCode() {
return 16;
}
@Override
public boolean equals(Object other) {
return other instanceof TxnAbort;
}
} | [
"andy@seaborne.org"
] | andy@seaborne.org |
41fa3790307b3b1f6ae1518574ab9e5b1c8a8164 | fd34bc57a54757fd6c29980347eb0a22213f5430 | /therapyreminder/adapter/src/main/java/it/mate/therapyreminder/shared/model/impl/PazienteTx.java | 2a89c9cee0ac35fc4403353414abd99097570b82 | [] | no_license | urazovm/marcelatelab | 7b64c1c3f6bad786590964e5115d811787bc91a2 | b9e264ecb4fe99b8966a8e4babc588b4aec4725f | refs/heads/master | 2021-06-01T06:25:35.860311 | 2016-04-29T12:22:07 | 2016-04-29T12:22:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 977 | java | package it.mate.therapyreminder.shared.model.impl;
import it.mate.gwtcommons.shared.rpc.IsMappable;
import it.mate.gwtcommons.shared.rpc.RpcMap;
import it.mate.therapyreminder.shared.model.Paziente;
@SuppressWarnings("serial")
public class PazienteTx implements Paziente, IsMappable {
private Integer id;
private String nome;
public PazienteTx() {
}
public PazienteTx(Paziente paziente) {
if (paziente instanceof PazienteTx) {
PazienteTx that = (PazienteTx)paziente;
this.id = that.id;
this.nome = that.nome;
}
}
@Override
public RpcMap toRpcMap() {
return null;
}
@Override
public IsMappable fromRpcMap(RpcMap map) {
return null;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
| [
"demarco.m73@gmail.com"
] | demarco.m73@gmail.com |
3cf5c2d748dc5a9c8c2f4a660468a51181b96e29 | dfe5519c786cca5790c2cdda598d36267e805bae | /android/src/ti/fcm/ForegroundCheck.java | a781250b084b811434ee7dc3d5d34d61009bd17b | [
"MIT"
] | permissive | appcelerator-forks/AppWerft.Ti.FCM | 1c4a1b479269ca7b4ff69471ddaf98bdfc9c70ba | ba39472f8e6b1d7ddc8d3893cafc8e4ebc613b46 | refs/heads/master | 2021-01-22T01:43:00.264773 | 2017-09-02T09:49:12 | 2017-09-02T09:49:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,472 | java | package ti.fcm;
import android.app.ActivityManager;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.AsyncTask;
import android.os.Build;
class ForegroundCheck extends AsyncTask<Context, Void, TaskTestResult> {
@Override
protected TaskTestResult doInBackground(Context... params) {
final Context context = params[0];
return isAppOnForeground(context);
}
@SuppressWarnings("deprecation")
private TaskTestResult isAppOnForeground(Context context) {
ActivityManager am = (ActivityManager) context
.getSystemService(Context.ACTIVITY_SERVICE);
/* retreiving packagename of toppest task */
String foregroundTaskPackageName = "";
if (Build.VERSION.SDK_INT > 20) {
foregroundTaskPackageName = am.getRunningAppProcesses().get(0).processName;
} else {
foregroundTaskPackageName = am.getRunningTasks(1).get(0).topActivity
.getPackageName();
}
PackageManager pm = context.getPackageManager();
PackageInfo foregroundAppPackageInfo = null;
try {
foregroundAppPackageInfo = pm.getPackageInfo(
foregroundTaskPackageName, 0);
} catch (NameNotFoundException e) {
e.printStackTrace();
}
String foregroundTaskAppId = foregroundAppPackageInfo.applicationInfo.packageName;
return new TaskTestResult(context.getPackageName().equals(
foregroundTaskAppId), foregroundTaskAppId);
}
} | [
"“rs@hamburger-appwerft.de“"
] | “rs@hamburger-appwerft.de“ |
e483a45f86464f3bc9a579de1d37e2f25a889c30 | 9254e7279570ac8ef687c416a79bb472146e9b35 | /scsp-20200702/src/main/java/com/aliyun/scsp20200702/models/ListOutboundPhoneNumberResponse.java | ea33f5dbae6380939fa338e631211588226903d5 | [
"Apache-2.0"
] | permissive | lquterqtd/alibabacloud-java-sdk | 3eaa17276dd28004dae6f87e763e13eb90c30032 | 3e5dca8c36398469e10cdaaa34c314ae0bb640b4 | refs/heads/master | 2023-08-12T13:56:26.379027 | 2021-10-19T07:22:15 | 2021-10-19T07:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,134 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.scsp20200702.models;
import com.aliyun.tea.*;
public class ListOutboundPhoneNumberResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("body")
@Validation(required = true)
public ListOutboundPhoneNumberResponseBody body;
public static ListOutboundPhoneNumberResponse build(java.util.Map<String, ?> map) throws Exception {
ListOutboundPhoneNumberResponse self = new ListOutboundPhoneNumberResponse();
return TeaModel.build(map, self);
}
public ListOutboundPhoneNumberResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public ListOutboundPhoneNumberResponse setBody(ListOutboundPhoneNumberResponseBody body) {
this.body = body;
return this;
}
public ListOutboundPhoneNumberResponseBody getBody() {
return this.body;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
f6d33e4f444c17c3df9210ba3dfafbf268bcc34d | cad7bc29389fbf5d5b722ee5327ba8154e7cc952 | /submissions/available/CPC/CPC-what-property/data/aim/apacheDB-trunk/tck/src/main/java/org/apache/jdo/tck/query/jdoql/ExecutingQueryWhenNoTransactionNoNontransactionalRead.java | d6fc065399e410ce4a1ddd93e185a4d3c71c9d16 | [
"Apache-2.0",
"Unlicense"
] | permissive | XZ-X/CPC-artifact-release | f9f9f0cde79b111f47622faba02f08b85a8a5ee9 | 5710dc0e39509f79e42535e0b5ca5e41cbd90fc2 | refs/heads/master | 2022-12-20T12:30:22.787707 | 2020-01-27T21:45:33 | 2020-01-27T21:45:33 | 236,601,424 | 1 | 0 | Unlicense | 2022-12-16T04:24:27 | 2020-01-27T21:41:38 | Java | UTF-8 | Java | false | false | 2,888 | 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.jdo.tck.query.jdoql;
import javax.jdo.Extent;
import javax.jdo.JDOUserException;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import org.apache.jdo.tck.pc.mylib.PCPoint;
import org.apache.jdo.tck.query.QueryTest;
import org.apache.jdo.tck.util.BatchTestRunner;
/**
*<B>Title:</B> Executing Query when no Transaction, no NontransactionalRead
*<BR>
*<B>Keywords:</B> query
*<BR>
*<B>Assertion ID:</B> A14.6.1-2.
*<BR>
*<B>Assertion Description: </B>
If the <code>NontransactionalRead</code> property is <code>false</code>,
and a transaction is not active, then the <code>execute</code> methods throw
<code>JDOUserException</code>.
*/
public class ExecutingQueryWhenNoTransactionNoNontransactionalRead
extends QueryTest {
/** */
private static final String ASSERTION_FAILED =
"Assertion A14.6.1-2 (ExecutingQueryWhenNoTransactionNoNontransactionalRead) failed: ";
/**
* The <code>main</code> is called when the class
* is directly executed from the command line.
* @param args The arguments passed to the program.
*/
public static void main(String[] args) {
BatchTestRunner.run(ExecutingQueryWhenNoTransactionNoNontransactionalRead.class);
}
/** */
public void testNegative() {
PersistenceManager pm = getPM();
pm.currentTransaction().setNontransactionalRead(false);
runTestNewQuery(pm);
}
/** */
void runTestNewQuery(PersistenceManager pm) {
Class clazz = PCPoint.class;
Extent extent = pm.getExtent(clazz, true);
Query query = pm.newQuery();
query.setClass(clazz);
query.setCandidates(extent);
try {
Object results = query.execute();
fail(ASSERTION_FAILED,
"Querying outside transactions should throw exception with non transactional read set to false");
}
catch (JDOUserException ex) {
// expected exception
if (debug) logger.debug("expected exception " + ex);
}
}
}
| [
"161250170@smail.nju.edu.cn"
] | 161250170@smail.nju.edu.cn |
9000487d0f7fa6a5d3bfb1e7479c5a7e1590f6d2 | d13fb02bb909606b9314bfbe67873deb00197fae | /app/src/main/java/com/xy/vo/QuestionVO.java | 31209616ac658e9a7bd3b70725fccd4dd8a7cd75 | [] | no_license | chinafengqiang/wkPhone | 1ff4e2e8feac47a97f193dc704b7c707a2b43e11 | 60d8e04fac5fd5c635f146aba4f33899091bd109 | refs/heads/master | 2020-12-13T03:35:41.420420 | 2016-08-02T10:41:11 | 2016-08-02T10:41:11 | 55,571,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,642 | java | package com.xy.vo;
import java.io.Serializable;
/**
* Created by sara on 15-9-17.
*/
public class QuestionVO implements Serializable{
private int id;
private int quetype;
private int diffcult;
private int queclass;
private int quescore;
private int conttype;
private String conturl;
private String queexpl;
private String vurl;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public int getQuetype() {
return quetype;
}
public void setQuetype(int quetype) {
this.quetype = quetype;
}
public int getDiffcult() {
return diffcult;
}
public void setDiffcult(int diffcult) {
this.diffcult = diffcult;
}
public int getQueclass() {
return queclass;
}
public void setQueclass(int queclass) {
this.queclass = queclass;
}
public int getQuescore() {
return quescore;
}
public void setQuescore(int quescore) {
this.quescore = quescore;
}
public int getConttype() {
return conttype;
}
public void setConttype(int conttype) {
this.conttype = conttype;
}
public String getConturl() {
return conturl;
}
public void setConturl(String conturl) {
this.conturl = conturl;
}
public String getQueexpl() {
return queexpl;
}
public void setQueexpl(String queexpl) {
this.queexpl = queexpl;
}
public String getVurl() {
return vurl;
}
public void setVurl(String vurl) {
this.vurl = vurl;
}
}
| [
"chinafengqiang@sina.com"
] | chinafengqiang@sina.com |
01448e882d27de74255366a2b92f783976503726 | af8c0ffa4f2181708532f2b852ca4b718f84eb19 | /diorite-api/src/main/java/org/diorite/material/blocks/GrassMat.java | f91a90f1bc31da39066d53079bbb2751c13d16f7 | [
"MIT"
] | permissive | Diorite/Diorite-old | 1a5e91483fe6e46e305f866f10cff22846b19816 | bfe35f695876f633ae970442f673188e4ff99c9b | refs/heads/master | 2021-01-22T15:21:39.404346 | 2016-08-09T18:10:57 | 2016-08-09T18:10:57 | 65,502,014 | 3 | 6 | null | null | null | null | UTF-8 | Java | false | false | 4,535 | java | /*
* The MIT License (MIT)
*
* Copyright (c) 2016. Diorite (by Bartłomiej Mazur (aka GotoFinal))
*
* 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.diorite.material.blocks;
import java.util.Map;
import org.diorite.inventory.item.BaseItemStack;
import org.diorite.material.data.drops.PossibleDrops;
import org.diorite.material.data.drops.PossibleFixedDrop;
import org.diorite.utils.collections.maps.CaseInsensitiveMap;
import it.unimi.dsi.fastutil.bytes.Byte2ObjectMap;
import it.unimi.dsi.fastutil.bytes.Byte2ObjectOpenHashMap;
/**
* Class representing 'Grass' block material in minecraft. <br>
* ID of block: 2 <br>
* String ID of block: minecraft:grass <br>
* Hardness: 0,6 <br>
* Blast Resistance 3
*/
@SuppressWarnings("JavaDoc")
public class GrassMat extends EarthMat
{
/**
* Sub-ids used by diorite/minecraft by default
*/
public static final int USED_DATA_VALUES = 1;
public static final GrassMat GRASS = new GrassMat();
private static final Map<String, GrassMat> byName = new CaseInsensitiveMap<>(USED_DATA_VALUES, SMALL_LOAD_FACTOR);
private static final Byte2ObjectMap<GrassMat> byID = new Byte2ObjectOpenHashMap<>(USED_DATA_VALUES, SMALL_LOAD_FACTOR);
@SuppressWarnings("MagicNumber")
public GrassMat()
{
super("GRASS", 2, "minecraft:grass", "GRASS", (byte) 0x00, 0.6f, 3);
}
public GrassMat(final String enumName, final int id, final String minecraftId, final int maxStack, final String typeName, final byte type, final float hardness, final float blastResistance)
{
super(enumName, id, minecraftId, maxStack, typeName, type, hardness, blastResistance);
}
@Override
public GrassMat getType(final String name)
{
return getByEnumName(name);
}
@Override
public GrassMat getType(final int id)
{
return getByID(id);
}
@Override
protected PossibleDrops initPossibleDrops()
{
return new PossibleDrops(new PossibleFixedDrop(new BaseItemStack(DIRT)));
}
/**
* Returns one of Grass sub-type based on sub-id, may return null
*
* @param id sub-type id
*
* @return sub-type of Grass or null
*/
public static GrassMat getByID(final int id)
{
return byID.get((byte) id);
}
/**
* Returns one of Grass sub-type based on name (selected by diorite team), may return null
* If block contains only one type, sub-name of it will be this same as name of material.
*
* @param name name of sub-type
*
* @return sub-type of Grass or null
*/
public static GrassMat getByEnumName(final String name)
{
return byName.get(name);
}
/**
* Register new sub-type, may replace existing sub-types.
* Should be used only if you know what are you doing, it will not create fully usable material.
*
* @param element sub-type to register
*/
public static void register(final GrassMat element)
{
allBlocks.incrementAndGet();
byID.put((byte) element.getType(), element);
byName.put(element.getTypeName(), element);
}
@Override
public GrassMat[] types()
{
return GrassMat.grassTypes();
}
/**
* @return array that contains all sub-types of this block.
*/
public static GrassMat[] grassTypes()
{
return byID.values().toArray(new GrassMat[byID.size()]);
}
static
{
GrassMat.register(GRASS);
}
}
| [
"bartlomiejkmazur@gmail.com"
] | bartlomiejkmazur@gmail.com |
8e63d99e10f4ef2e5d44b737820f36c938f910fc | a6f4d8a6c8bd1097cd468240bdc8eed241ef9f0e | /plugins/e-sparqlEndpointConstructScrollableCursor/src/main/java/com/linkedpipes/plugin/extractor/sparql/endpoint/select/SparqlEndpointConstructScrollableCursor.java | d1b0714a22255fc01cbf344c5068714242c74c2d | [
"MIT"
] | permissive | linkedpipes/etl | e9cdb00bd53e8f720dbbfcbac32c8f0d48fd024c | 52e904241be27fccd9d9b966b19f03f1ef00b647 | refs/heads/develop | 2023-08-21T23:49:17.746028 | 2023-07-20T15:51:02 | 2023-07-20T15:51:02 | 49,733,838 | 139 | 37 | NOASSERTION | 2022-07-12T07:51:18 | 2016-01-15T17:23:57 | Java | UTF-8 | Java | false | false | 5,708 | java | package com.linkedpipes.plugin.extractor.sparql.endpoint.select;
import com.linkedpipes.etl.dataunit.core.rdf.SingleGraphDataUnit;
import com.linkedpipes.etl.dataunit.core.rdf.WritableChunkedTriples;
import com.linkedpipes.etl.executor.api.v1.LpException;
import com.linkedpipes.etl.executor.api.v1.component.Component;
import com.linkedpipes.etl.executor.api.v1.component.SequentialExecution;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.eclipse.rdf4j.model.Statement;
import org.eclipse.rdf4j.model.impl.SimpleValueFactory;
import org.eclipse.rdf4j.query.GraphQuery;
import org.eclipse.rdf4j.query.QueryLanguage;
import org.eclipse.rdf4j.query.impl.SimpleDataset;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import org.eclipse.rdf4j.repository.RepositoryException;
import org.eclipse.rdf4j.repository.sparql.SPARQLRepository;
import org.eclipse.rdf4j.rio.RDFHandler;
import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.net.IDN;
import java.util.ArrayList;
import java.util.List;
/**
* Use scrollable cursors to execute SPARQL construct.
*/
public final class SparqlEndpointConstructScrollableCursor
implements Component, SequentialExecution {
private static final Logger LOG = LoggerFactory.getLogger(
SparqlEndpointConstructScrollableCursor.class);
@Component.InputPort(iri = "OutputFiles")
public WritableChunkedTriples outputRdf;
@Component.ContainsConfiguration
@Component.InputPort(iri = "Configuration")
public SingleGraphDataUnit configurationRdf;
@Component.Configuration
public SparqlEndpointConstructScrollableCursorConfiguration configuration;
@Override
public void execute() throws LpException {
SPARQLRepository repository;
if (configuration.isUseTolerantRepository()) {
repository = new TolerantSparqlRepository(getEndpoint());
} else {
repository = new SPARQLRepository(getEndpoint());
}
repository.init();
repository.setHttpClient(getHttpClient());
//
LOG.info("Used query: {}", prepareQuery(0));
try {
int offset = 0;
final List<Statement> buffer = new ArrayList<>(100000);
while (true) {
LOG.info("offset: {}", offset);
executeQuery(repository, offset, buffer);
if (buffer.isEmpty()) {
break;
} else {
outputRdf.submit(buffer);
}
offset += configuration.getPageSize();
}
} catch (Throwable t) {
throw new LpException("Can't query remote SPARQL.", t);
} finally {
try {
repository.shutDown();
} catch (RepositoryException ex) {
LOG.error("Can't close repository.", ex);
}
}
}
private String getEndpoint() {
String[] tokens = configuration.getEndpoint().split("://", 2);
String[] url = tokens[1].split("/", 2);
return tokens[0] + "://" + IDN.toASCII(url[0]) + "/" + url[1];
}
private CloseableHttpClient getHttpClient() {
CredentialsProvider provider = new BasicCredentialsProvider();
if (configuration.isUseAuthentication()) {
provider.setCredentials(
new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),
new UsernamePasswordCredentials(
configuration.getUsername(),
configuration.getPassword()));
}
return HttpClients.custom()
.setDefaultCredentialsProvider(provider).build();
}
/**
* @param repository
* @param offset
*/
protected void executeQuery(Repository repository, int offset,
List<Statement> buffer) throws LpException {
try (final RepositoryConnection connection =
repository.getConnection()) {
//
final GraphQuery query = connection.prepareGraphQuery(
QueryLanguage.SPARQL, prepareQuery(offset));
//
final SimpleDataset dataset = new SimpleDataset();
for (String iri : configuration.getDefaultGraphs()) {
if (!iri.isEmpty()) {
dataset.addDefaultGraph(
SimpleValueFactory.getInstance().createIRI(iri));
}
}
query.setDataset(dataset);
buffer.clear();
RDFHandler handler = new AbstractRDFHandler() {
@Override
public void handleStatement(Statement st) {
buffer.add(st);
}
};
if (configuration.isFixIncomingRdf()) {
handler = new RdfEncodeHandler(handler);
}
query.evaluate(handler);
}
}
protected String prepareQuery(int offset) {
return configuration.getPrefixes() + "\n CONSTRUCT {\n" +
configuration.getOuterConstruct() + "\n } WHERE { {" +
configuration.getInnerSelect() +
"\n} }" +
"\nLIMIT " + Integer.toString(configuration.getPageSize()) +
"\nOFFSET " + Integer.toString(offset);
}
}
| [
"skodapetr@gmail.com"
] | skodapetr@gmail.com |
0943ebaa001148e39e70139827dfd61ea054dfa3 | 3bc93d87b148c969b256fb368c572100688204f7 | /component/src/main/java/org/pushingpixels/radiance/component/internal/ui/common/popup/BasicColorSelectorPanelUI.java | 8156a470bd3559c66030891adfb4ffca54f85645 | [
"BSD-3-Clause"
] | permissive | kirill-grouchnikov/radiance | 5492b26acd2f7d88a9362c34fa437aefa20e992a | f19191cb501b68469a20a50388c204036d791718 | refs/heads/sunshine | 2023-09-06T07:10:58.249840 | 2023-08-23T20:42:00 | 2023-08-23T20:42:00 | 132,473,990 | 734 | 112 | BSD-3-Clause | 2022-10-12T21:44:47 | 2018-05-07T14:39:23 | Java | UTF-8 | Java | false | false | 6,696 | java | /*
* Copyright (c) 2005-2023 Radiance Kirill Grouchnikov. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* o Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* o Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* o Neither the name of the copyright holder nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.pushingpixels.radiance.component.internal.ui.common.popup;
import javax.swing.*;
import java.awt.*;
/**
* Basic UI for color selector panel {@link JColorSelectorPanel}.
*
* @author Kirill Grouchnikov
*/
public abstract class BasicColorSelectorPanelUI extends ColorSelectorPanelUI {
protected JColorSelectorPanel colorSelectorPanel;
private JLabel captionLabel;
private JPanel colorSelectorContainer;
@Override
public void installUI(JComponent c) {
this.colorSelectorPanel = (JColorSelectorPanel) c;
installDefaults();
installComponents();
installListeners();
}
@Override
public void uninstallUI(JComponent c) {
uninstallListeners();
uninstallComponents();
uninstallDefaults();
c.setLayout(null);
this.colorSelectorPanel = null;
}
/**
* Installs listeners on the associated color selector panel.
*/
protected void installListeners() {
}
/**
* Uninstalls listeners from the associated color selector panel.
*/
protected void uninstallListeners() {
}
/**
* Installs defaults on the associated color selector panel.
*/
protected void installDefaults() {
}
/**
* Uninstalls defaults from the associated color selector panel.
*/
protected void uninstallDefaults() {
}
/**
* Installs subcomponents on the associated color selector panel.
*/
protected void installComponents() {
this.captionLabel = new JLabel(this.colorSelectorPanel.getCaption());
this.captionLabel.setFont(this.captionLabel.getFont().deriveFont(Font.BOLD));
this.colorSelectorContainer = this.colorSelectorPanel.getColorSelectionContainer();
this.colorSelectorPanel.add(this.captionLabel);
if (this.colorSelectorContainer != null) {
this.colorSelectorPanel.add(this.colorSelectorContainer);
}
this.colorSelectorPanel.setLayout(new PanelLayout());
}
/**
* Uninstalls subcomponents from the associated color selector panel.
*/
protected void uninstallComponents() {
this.colorSelectorPanel.remove(this.captionLabel);
if (this.colorSelectorContainer != null) {
this.colorSelectorPanel.remove(this.colorSelectorContainer);
}
}
@Override
public void paint(Graphics g, JComponent c) {
Color bg = this.colorSelectorPanel.getBackground();
g.setColor(bg);
int w = c.getWidth();
int h = c.getHeight();
g.fillRect(0, 0, w, h);
Rectangle captionBackground = this.captionLabel.getBounds();
this.paintCaptionBackground(g, 0, 0, w, captionBackground.height + 2 * getLayoutGap());
if (this.colorSelectorPanel.isLastPanel()) {
paintBottomDivider(g, 0, 0, w, h);
}
}
protected abstract void paintBottomDivider(Graphics g, int x, int y, int width,
int height);
protected abstract void paintCaptionBackground(Graphics g, int x, int y, int width,
int height);
/**
* Returns the layout gap for button panel components.
*
* @return The layout gap for button panel components.
*/
protected abstract int getLayoutGap();
protected class PanelLayout implements LayoutManager {
@Override
public void addLayoutComponent(String name, Component comp) {
}
@Override
public void removeLayoutComponent(Component comp) {
}
@Override
public Dimension minimumLayoutSize(Container parent) {
return new Dimension(20, 20);
}
@Override
public Dimension preferredLayoutSize(Container parent) {
int layoutGap = getLayoutGap();
Dimension labelPrefSize = captionLabel.getPreferredSize();
Dimension contPrefSize = colorSelectorContainer.getPreferredSize();
return new Dimension(
Math.max(labelPrefSize.width, contPrefSize.width),
2 * layoutGap + labelPrefSize.height + contPrefSize.height
+ (colorSelectorPanel.isLastPanel() ? 1 : 0));
}
@Override
public void layoutContainer(Container parent) {
int layoutGap = getLayoutGap();
Dimension labelPrefSize = captionLabel.getPreferredSize();
int labelWidth = labelPrefSize.width;
int labelHeight = labelPrefSize.height;
int y = layoutGap;
if (captionLabel.getComponentOrientation().isLeftToRight()) {
captionLabel.setBounds(layoutGap, y, labelWidth, labelHeight);
} else {
captionLabel.setBounds(parent.getWidth() - layoutGap - labelWidth, y,
labelWidth, labelHeight);
}
y += labelHeight + layoutGap;
colorSelectorContainer.setBounds(0, y, parent.getWidth(),
parent.getHeight() - y - (colorSelectorPanel.isLastPanel() ? 1 : 0));
}
}
}
| [
"kirill.grouchnikov@gmail.com"
] | kirill.grouchnikov@gmail.com |
baaa8cb2d9cc4f56bda3f4d5e403b3ecfe968c50 | 29159bc4c137fe9104d831a5efe346935eeb2db5 | /mmj-cloud-pay/src/main/java/com/mmj/pay/controller/WxpayOrderController.java | 9270826e5bc192205f756cb8554f1712449983e9 | [] | no_license | xddpool/mmj-cloud | bfb06d2ef08c9e7b967c63f223fc50b1a56aac1c | de4bcb35db509ce929d516d83de765fdc2afdac5 | refs/heads/master | 2023-06-27T11:16:38.059125 | 2020-07-24T03:23:48 | 2020-07-24T03:23:48 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,863 | java | package com.mmj.pay.controller;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.mmj.common.context.BaseContextHandler;
import com.mmj.common.controller.BaseController;
import com.mmj.common.model.JwtUserDetails;
import com.mmj.common.model.ReturnData;
import com.mmj.common.properties.SecurityConstants;
import com.mmj.common.utils.SecurityUserUtil;
import com.mmj.pay.model.WxpayOrder;
import com.mmj.pay.model.WxpayOrderEx;
import com.mmj.pay.sdk.weixin.WXPayUtil;
import com.mmj.pay.service.WxpayOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.util.HashMap;
import java.util.Map;
/**
* <p>
* 微信支付订单表 前端控制器
* </p>
*
* @author lyf
* @since 2019-06-05
*/
@Slf4j
@RestController
@RequestMapping("/wxpayOrder")
@Api(value = "微信支付")
public class WxpayOrderController extends BaseController {
@Autowired
private WxpayOrderService wxpayOrderService;
@ApiOperation(value="获取支付信息")
@RequestMapping(value="/getPayInfo",method = RequestMethod.POST)
public ReturnData<Map> getPayInfo(@RequestBody WxpayOrderEx wxpayOrderEx, HttpServletRequest request) {
String appType = request.getHeader(SecurityConstants.APP_TYPE);
wxpayOrderEx.setPayType(appType);
Map map = wxpayOrderService.getPayInfo(wxpayOrderEx);
return initSuccessObjectResult(map);
}
@ApiOperation(value="微信回调地址")
@RequestMapping(value = "notifyUrl", produces = "application/xml")
public Object notifyUrl(HttpServletRequest request){
try {
InputStream inStream = request.getInputStream();
ByteArrayOutputStream outSteam = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int len = 0;
while ((len = inStream.read(buffer)) != -1) {
outSteam.write(buffer, 0, len);
}
outSteam.close();
inStream.close();
String xml = new String(outSteam.toByteArray(), "utf-8");
log.info("xml========" + xml);
Map<String, String> xmlToMap = WXPayUtil.xmlToMap(xml);
wxpayOrderService.notifyUrl(xmlToMap);
Map<String, String> result = new HashMap<>();
result.put("return_code", "SUCCESS");
result.put("return_msg", "OK");
return WXPayUtil.mapToXml(result);
} catch (Exception e) {
log.error("微信回调错误:" , new Throwable(e));
}
return null;
}
@ApiOperation(value="主动从微信平台拉取订单数据")
@PostMapping("pullOrder")
public ReturnData<Map> pullOrder(@RequestBody WxpayOrder wxpayOrder){
JwtUserDetails userDetails = SecurityUserUtil.getUserDetails();
BaseContextHandler.set(SecurityConstants.SHARDING_KEY, userDetails.getUserId());
EntityWrapper<WxpayOrder> wrapper = new EntityWrapper<>();
wrapper.eq("OUT_TRADE_NO", wxpayOrder.getOutTradeNo());
wxpayOrder = wxpayOrderService.selectOne(wrapper);
if(null == wxpayOrder){
return initErrorObjectResult("系统表订单号不存在");
}
if(StringUtils.isEmpty(wxpayOrder.getTransactionId())){
log.info("主动拉取订单信息,订单号:" + wxpayOrder.getOutTradeNo());
wxpayOrderService.pullOrder(wxpayOrder);
}
return initSuccessResult();
}
}
| [
"shenfuding@shenfudingdeMacBook-Pro.local"
] | shenfuding@shenfudingdeMacBook-Pro.local |
6532583a0cac3b78b85b2c9454393b2f8553495a | 41981d37465bd6ef30a0e87176e265283c3cbec4 | /quaerite-cli/src/main/java/org/mitre/quaerite/cli/QuaeriteCLI.java | cb564d830b9cd644a035458b82334629d199be6d | [
"Apache-2.0"
] | permissive | mitre/quaerite | 195b4108622811a71eec98bc31cd3a7d6e10fe09 | a51209f38a5a4658589f3f94e2e855627871a4bc | refs/heads/master | 2023-09-01T03:53:15.338260 | 2020-05-01T15:38:54 | 2020-05-01T15:38:54 | 173,306,807 | 71 | 10 | Apache-2.0 | 2022-01-21T23:23:57 | 2019-03-01T13:30:14 | Java | UTF-8 | Java | false | false | 2,274 | 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.mitre.quaerite.cli;
import java.util.ArrayList;
import java.util.List;
import org.h2.tools.Console;
public class QuaeriteCLI {
public static void main(String[] args) throws Exception {
String tool = args[0];
String[] newArgs = new String[args.length - 1];
System.arraycopy(args, 1, newArgs, 0, newArgs.length);
if (tool.equals("DumpExperiments")) {
DumpExperiments.main(newArgs);
} else if (tool.equals("RunExperiments")) {
RunExperiments.main(newArgs);
} else if (tool.equals("FindFeatures")) {
FindFeatures.main(newArgs);
} else if (tool.equals("GenerateExperiments")) {
GenerateExperiments.main(newArgs);
} else if (tool.equals("DumpResults")) {
DumpResults.main(newArgs);
} else if (tool.equals("StartDB")) {
startDB();
} else if (tool.equals("RunGA")) {
RunGA.main(newArgs);
} else {
System.err.println("I'm sorry, but I don't recognize \"" + tool + "\" as a tool");
}
}
private static void startDB() throws Exception {
List<String> argList = new ArrayList<>();
argList.add("-web");
Console.main(argList.toArray(new String[argList.size()]));
while (true) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
break;
}
}
}
}
| [
"tallison@apache.org"
] | tallison@apache.org |
78847e8b048b42b83bae52d27498f52977ff7168 | d5786bf0335010f7de9bb2cea6bb0a9536ff73af | /aliyun-java-sdk-sofa/src/main/java/com/aliyuncs/sofa/model/v20190815/UpdateRmsAlertrulePauseRequest.java | 5ac9d0730c76b4395731fc0cdfbb23e169dada6b | [
"Apache-2.0"
] | permissive | 1203802276/aliyun-openapi-java-sdk | 8066c546f0177cbbebb7b1178fe6ccaeb6f1da09 | e3f89f2ef8542055e3990401a94edccd1bbca410 | refs/heads/master | 2023-04-15T07:09:27.195262 | 2021-03-19T06:22:51 | 2021-03-19T06:22:51 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,954 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.aliyuncs.sofa.model.v20190815;
import com.aliyuncs.RpcAcsRequest;
import com.aliyuncs.http.MethodType;
import com.aliyuncs.sofa.Endpoint;
/**
* @author auto create
* @version
*/
public class UpdateRmsAlertrulePauseRequest extends RpcAcsRequest<UpdateRmsAlertrulePauseResponse> {
private String envJsonStr;
private String queryJsonStr;
public UpdateRmsAlertrulePauseRequest() {
super("SOFA", "2019-08-15", "UpdateRmsAlertrulePause", "sofacafedeps");
setMethod(MethodType.POST);
try {
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointMap").set(this, Endpoint.endpointMap);
com.aliyuncs.AcsRequest.class.getDeclaredField("productEndpointRegional").set(this, Endpoint.endpointRegionalType);
} catch (Exception e) {}
}
public String getEnvJsonStr() {
return this.envJsonStr;
}
public void setEnvJsonStr(String envJsonStr) {
this.envJsonStr = envJsonStr;
if(envJsonStr != null){
putBodyParameter("EnvJsonStr", envJsonStr);
}
}
public String getQueryJsonStr() {
return this.queryJsonStr;
}
public void setQueryJsonStr(String queryJsonStr) {
this.queryJsonStr = queryJsonStr;
if(queryJsonStr != null){
putBodyParameter("QueryJsonStr", queryJsonStr);
}
}
@Override
public Class<UpdateRmsAlertrulePauseResponse> getResponseClass() {
return UpdateRmsAlertrulePauseResponse.class;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
f680bcadcdfe38c38cdcb762bfeef1d35340b3ad | 75edf9c7d5d1e666135ab0d797a292f9781790b6 | /sld_enterprise_app/release/pagecompile/ish/cartridges/sld_005fenterprise_005fapp/default_/content/pageselection/PageSubPagesJSON_jsp.java | 4c9b2c91d5db9cd5dfc2ba2f5c6374a3f9585db7 | [] | no_license | arthurAddamsSiebert/cartridges | 7808f484de6b06c98c59be49f816164dba21366e | cc1141019a601f76ad15727af442718f1f6bb6cb | refs/heads/master | 2020-06-11T08:58:02.419907 | 2019-06-26T12:16:31 | 2019-06-26T12:16:31 | 193,898,014 | 0 | 1 | null | 2019-11-02T23:33:49 | 2019-06-26T12:15:29 | Java | UTF-8 | Java | false | false | 5,569 | java | /*
* Generated by the Jasper component of Apache Tomcat
* Version: JspCServletContext/1.0
* Generated at: 2019-02-13 15:29:30 UTC
* Note: The last modified time of this file was set to
* the last modified time of the source file after
* generation to assist with modification tracking.
*/
package ish.cartridges.sld_005fenterprise_005fapp.default_.content.pageselection;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import java.util.*;
import java.io.*;
import com.intershop.beehive.core.internal.template.*;
import com.intershop.beehive.core.internal.template.isml.*;
import com.intershop.beehive.core.capi.log.*;
import com.intershop.beehive.core.capi.resource.*;
import com.intershop.beehive.core.capi.util.UUIDMgr;
import com.intershop.beehive.core.capi.util.XMLHelper;
import com.intershop.beehive.foundation.util.*;
import com.intershop.beehive.core.internal.url.*;
import com.intershop.beehive.core.internal.resource.*;
import com.intershop.beehive.core.internal.wsrp.*;
import com.intershop.beehive.core.capi.pipeline.PipelineDictionary;
import com.intershop.beehive.core.capi.naming.NamingMgr;
import com.intershop.beehive.core.capi.pagecache.PageCacheMgr;
import com.intershop.beehive.core.capi.request.SessionMgr;
import com.intershop.beehive.core.internal.request.SessionMgrImpl;
import com.intershop.beehive.core.pipelet.PipelineConstants;
public final class PageSubPagesJSON_jsp extends com.intershop.beehive.core.internal.template.AbstractTemplate
implements org.apache.jasper.runtime.JspSourceDependent {
protected Boolean printTemplateMarker() { return Boolean.FALSE; }
private static final javax.servlet.jsp.JspFactory _jspxFactory =
javax.servlet.jsp.JspFactory.getDefaultFactory();
private static java.util.Map<java.lang.String,java.lang.Long> _jspx_dependants;
private javax.el.ExpressionFactory _el_expressionfactory;
private org.apache.tomcat.InstanceManager _jsp_instancemanager;
public java.util.Map<java.lang.String,java.lang.Long> getDependants() {
return _jspx_dependants;
}
public void _jspInit() {
_el_expressionfactory = _jspxFactory.getJspApplicationContext(getServletConfig().getServletContext()).getExpressionFactory();
_jsp_instancemanager = org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(getServletConfig());
}
public void _jspDestroy() {
}
public void _jspService(final javax.servlet.http.HttpServletRequest request, final javax.servlet.http.HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException {
final javax.servlet.jsp.PageContext pageContext;
javax.servlet.http.HttpSession session = null;
final javax.servlet.ServletContext application;
final javax.servlet.ServletConfig config;
javax.servlet.jsp.JspWriter out = null;
final java.lang.Object page = this;
javax.servlet.jsp.JspWriter _jspx_out = null;
javax.servlet.jsp.PageContext _jspx_page_context = null;
try {
response.setContentType("text/json;charset=utf-8");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 0, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
boolean _boolean_result=false;
TemplateExecutionConfig context = getTemplateExecutionConfig();
createTemplatePageConfig(context.getServletRequest());
printHeader(out);
setEncodingType("text/json");
{out.flush();processLocalIncludeByServer((com.intershop.beehive.core.capi.request.ServletResponse)response,"content/pageselection/Modules", null, "2");}
{Object temp_obj = (getObject("Page:SubPageletEntryPoints(ContentRepository:RepositoryDomain,PageletModelRepository)")); getPipelineDictionary().put("SubPages", temp_obj);}
_boolean_result=false;try {_boolean_result=((Boolean)((hasLoopElements("SubPages") ? Boolean.TRUE : Boolean.FALSE))).booleanValue();} catch (Exception e) {Logger.debug(this,"Boolean expression in line {} could not be evaluated. False returned. Consider using the 'isDefined' ISML function.",5,e);}if (_boolean_result) {
out.write('\n');
out.write('[');
out.write('\n');
while (loop("SubPages","Page",null)) {
processOpenTag(response, pageContext, "pagejson", new TagParameter[] {
new TagParameter("ContentRepository",getObject("ContentRepository")),
new TagParameter("PageletModelRepository",getObject("PageletModelRepository")),
new TagParameter("Page",getObject("Page"))}, 8);
_boolean_result=false;try {_boolean_result=((Boolean)((hasNext("Page") ? Boolean.TRUE : Boolean.FALSE))).booleanValue();} catch (Exception e) {Logger.debug(this,"Boolean expression in line {} could not be evaluated. False returned. Consider using the 'isDefined' ISML function.",12,e);}if (_boolean_result) {
out.write(',');
}
}
out.write('\n');
out.write(']');
out.write('\n');
}
printFooter(out);
} catch (java.lang.Throwable t) {
if (!(t instanceof javax.servlet.jsp.SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
try { out.clearBuffer(); } catch (java.io.IOException e) {}
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
else throw new ServletException(t);
}
} finally {
_jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
| [
"root@Inteshoppa1v11.yyrtatjsacuefh5ihlz5gkzqpd.ax.internal.cloudapp.net"
] | root@Inteshoppa1v11.yyrtatjsacuefh5ihlz5gkzqpd.ax.internal.cloudapp.net |
a6067332f288c6d46ba8deef4f3d01d36bbe2928 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/finder/ui/FinderEditTextUI$$ExternalSyntheticLambda3.java | 20f4b03bcb72930d96f6bd93b9817842f97230c5 | [] | 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 | 530 | java | package com.tencent.mm.plugin.finder.ui;
import android.view.MenuItem;
import android.view.MenuItem.OnMenuItemClickListener;
public final class FinderEditTextUI$$ExternalSyntheticLambda3
implements MenuItem.OnMenuItemClickListener
{
public final boolean onMenuItemClick(MenuItem arg1) {}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes9.jar
* Qualified Name: com.tencent.mm.plugin.finder.ui.FinderEditTextUI..ExternalSyntheticLambda3
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
f2f30c6e7ac531efe8cbc33b037e0d78b8c7f38e | 68f33dfb3b6d50e0c86f2dc204d77ddf1792761c | /src/main/java/lesson02/VarArgsApp.java | 66d29a962e71eb8fb03f900b1bab69c0c28676d2 | [] | no_license | Niyaz-H/Java-IBA-Tech | 9d2fc54ef2930263e7ef2b0c2200b6354079b950 | 11122acbaf3b5051c1b87e2b00a1a6384b6cc521 | refs/heads/master | 2022-11-21T04:51:53.182484 | 2019-12-28T13:13:35 | 2019-12-28T13:13:35 | 215,538,497 | 0 | 0 | null | 2022-11-15T23:53:36 | 2019-10-16T12:06:10 | Java | UTF-8 | Java | false | false | 1,007 | java | package lesson02;
public class VarArgsApp {
public static void main(String[] args) {
int x = 5;
int y = 7;
int z = add(x, y);
int a = 1;
int b = 2;
int c = 3;
int d = add(a,b,c);
int h1 = smart_add_(1);
int h2 = smart_add_(1,2);
int h3 = smart_add(new int[]{1,3,4});
int h4 = smart_add_(1,6,7,7);
int h5 = smart_add(new int[]{});
}
// overloading
private static int add(int a, int b, int c) {
return add(a,b) + c;
}
private static int add(int x, int y) {
return x + y;
}
private static int add(int x, boolean y) {
return x;
}
// varArgs
private static int smart_add_(int... a) { // an array
return smart_add(a);
}
// varArgs2
private static int smart_add(int[] a) { // an array
int result = 0;
for (int value : a) {
result = result + value;
}
return result;
}
}
| [
"alexey.rykhalskiy@gmail.com"
] | alexey.rykhalskiy@gmail.com |
7abbb015f62bdb235a00f5338944361fd914b39b | c2e58ac4e8364eb7d2701ac481117d9c759121f8 | /src/main/java/com/iuling/mods/base/web/ColorsController.java | 490258294eeb31007016c5de61b7be9a36dea38e | [] | no_license | wolfmuzi/test | fbde72530fd504f712376a11aac17c0118a07dde | 63494be8221a6e5d93e3b26785f1297c19f894e2 | refs/heads/master | 2021-04-27T02:50:00.124416 | 2018-02-24T03:29:44 | 2018-02-24T03:29:44 | 122,700,176 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,631 | java | /**
* Copyright © 2015-2020 <a href="http://www.iuling.com/">Jeehop</a> All rights reserved.
*/
package com.iuling.mods.base.web;
import com.google.common.collect.Lists;
import com.iuling.comm.config.Global;
import com.iuling.comm.json.AjaxJson;
import com.iuling.comm.utils.DateUtils;
import com.iuling.comm.utils.StringUtils;
import com.iuling.comm.utils.excel.ExportExcel;
import com.iuling.comm.utils.excel.ImportExcel;
import com.iuling.core.persistence.Page;
import com.iuling.core.web.BaseController;
import com.iuling.mods.base.entity.Colors;
import com.iuling.mods.base.service.ColorsService;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolationException;
import java.util.List;
import java.util.Map;
/**
* 颜色信息管理Controller
* @author 宋小雄
* @version 2017-09-20
*/
@Controller
@RequestMapping(value = "${adminPath}/base/colors")
public class ColorsController extends BaseController {
@Autowired
private ColorsService colorsService;
@ModelAttribute
public Colors get(@RequestParam(required=false) String id) {
Colors entity = null;
if (StringUtils.isNotBlank(id)){
entity = colorsService.get(id);
}
if (entity == null){
entity = new Colors();
}
return entity;
}
/**
* 颜色信息列表页面
*/
@RequiresPermissions("base:colors:list")
@RequestMapping(value = {"list", ""})
public String list() {
return "mods/base/colorsList";
}
/**
* 颜色信息列表数据
*/
@ResponseBody
@RequiresPermissions("base:colors:list")
@RequestMapping(value = "data")
public Map<String, Object> data(Colors colors, HttpServletRequest request, HttpServletResponse response, Model model) {
Page<Colors> page = colorsService.findPage(new Page<Colors>(request, response), colors);
return getBootstrapData(page);
}
/**
* 查看,增加,编辑颜色信息表单页面
*/
@RequiresPermissions(value={"base:colors:view","base:colors:add","base:colors:edit"},logical=Logical.OR)
@RequestMapping(value = "form")
public String form(Colors colors, Model model) {
model.addAttribute("colors", colors);
return "mods/base/colorsForm";
}
/**
* 保存颜色信息
*/
@ResponseBody
@RequiresPermissions(value={"base:colors:add","base:colors:edit"},logical=Logical.OR)
@RequestMapping(value = "save")
public AjaxJson save(Colors colors, Model model, RedirectAttributes redirectAttributes) throws Exception{
AjaxJson j = new AjaxJson();
if (!beanValidator(model, colors)){
j.setSuccess(false);
j.setMsg("非法参数!");
return j;
}
/**
* 判断条码是否重复
*/
Colors f = new Colors();
f.setNumber(colors.getNumber());
List<Colors> list = colorsService.findList(f);
if (StringUtils.isBlank(colors.getId())) {
if (list.size() > 0) {
j.setSuccess(false);
j.setMsg("颜色编码不能重复!");
return j;
}
}else{
Colors fab = colorsService.get(colors.getId());
if (list.size() > 0 && !fab.getNumber().equals(list.get(0).getNumber())) {
j.setSuccess(false);
j.setMsg("颜色编码不能重复!");
return j;
}
}
colorsService.save(colors);//新建或者编辑保存
j.setSuccess(true);
j.setMsg("保存颜色信息成功");
return j;
}
/**
* 删除颜色信息
*/
@ResponseBody
@RequiresPermissions("base:colors:del")
@RequestMapping(value = "delete")
public AjaxJson delete(Colors colors, RedirectAttributes redirectAttributes) {
AjaxJson j = new AjaxJson();
colorsService.delete(colors);
j.setMsg("删除颜色信息成功");
return j;
}
/**
* 批量删除颜色信息
*/
@ResponseBody
@RequiresPermissions("base:colors:del")
@RequestMapping(value = "deleteAll")
public AjaxJson deleteAll(String ids, RedirectAttributes redirectAttributes) {
AjaxJson j = new AjaxJson();
String idArray[] =ids.split(",");
for(String id : idArray){
colorsService.delete(colorsService.get(id));
}
j.setMsg("删除颜色信息成功");
return j;
}
/**
* 导出excel文件
*/
@ResponseBody
@RequiresPermissions("base:colors:export")
@RequestMapping(value = "export", method=RequestMethod.POST)
public AjaxJson exportFile(Colors colors, HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
AjaxJson j = new AjaxJson();
try {
String fileName = "颜色信息"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
Page<Colors> page = colorsService.findPage(new Page<Colors>(request, response, -1), colors);
new ExportExcel("颜色信息", Colors.class).setDataList(page.getList()).write(response, fileName).dispose();
j.setSuccess(true);
j.setMsg("导出成功!");
return j;
} catch (Exception e) {
j.setSuccess(false);
j.setMsg("导出颜色信息记录失败!失败信息:"+e.getMessage());
}
return j;
}
/**
* 导入Excel数据
*/
@RequiresPermissions("base:colors:import")
@RequestMapping(value = "import", method=RequestMethod.POST)
public String importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
try {
int successNum = 0;
int failureNum = 0;
int chong = 0;
StringBuilder failureMsg = new StringBuilder();
ImportExcel ei = new ImportExcel(file, 1, 0);
List<Colors> list = ei.getDataList(Colors.class);
for (Colors colors : list){
try{
Colors f=colorsService.findUniqueByProperty("number",colors.getNumber());
if (f != null){//如果有重复
chong++;
continue;
}
// Colors f = new Colors();
// f.setNumber(colors.getNumber());
// List<Colors> temp = colorsService.findList(f);
// if (temp.size() > 0) {//如果有重复
// chong++;
// continue;
// }
colorsService.save(colors);
successNum++;
}catch(ConstraintViolationException ex){
failureNum++;
}catch (Exception ex) {
failureNum++;
}
}
if (failureNum>0){
failureMsg.insert(0, ",失败 "+failureNum+" 条颜色信息记录。");
}
String msg = "";
if(chong > 0){
msg = chong+"条记录重复条码未导入";
}
addMessage(redirectAttributes, "已成功导入 "+successNum+" 条颜色信息记录"+failureMsg+" , "+msg);
} catch (Exception e) {
addMessage(redirectAttributes, "导入颜色信息失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/base/colors/?repage";
}
/**
* 下载导入颜色信息数据模板
*/
@RequiresPermissions("base:colors:import")
@RequestMapping(value = "import/template")
public String importFileTemplate(HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
String fileName = "颜色信息数据导入模板.xlsx";
List<Colors> list = Lists.newArrayList();
new ExportExcel("颜色信息数据", Colors.class, 1).setDataList(list).write(response, fileName).dispose();
return null;
} catch (Exception e) {
addMessage(redirectAttributes, "导入模板下载失败!失败信息:"+e.getMessage());
}
return "redirect:"+Global.getAdminPath()+"/base/colors/?repage";
}
} | [
"email@example.com"
] | email@example.com |
8ef2eccda487f609946d17e02e541d1cd16b35ae | 863acb02a064a0fc66811688a67ce3511f1b81af | /sources/p026rx/exceptions/MissingBackpressureException.java | 71c64726e7d75355bfe490bd386fdcd8d4f91127 | [
"MIT"
] | permissive | Game-Designing/Custom-Football-Game | 98d33eb0c04ca2c48620aa4a763b91bc9c1b7915 | 47283462b2066ad5c53b3c901182e7ae62a34fc8 | refs/heads/master | 2020-08-04T00:02:04.876780 | 2019-10-06T06:55:08 | 2019-10-06T06:55:08 | 211,914,568 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 294 | java | package p026rx.exceptions;
/* renamed from: rx.exceptions.MissingBackpressureException */
public class MissingBackpressureException extends Exception {
public MissingBackpressureException() {
}
public MissingBackpressureException(String message) {
super(message);
}
}
| [
"tusharchoudhary0003@gmail.com"
] | tusharchoudhary0003@gmail.com |
1d108a85f68393a5a2579fa647a9ae78ea39c224 | 17e8438486cb3e3073966ca2c14956d3ba9209ea | /dso/branches/sessionLocking/code/base/dso-l1-api/src/com/tc/object/bytecode/NullManager.java | 2ed9f6a1e73ab05b731b8293783f14d769447f06 | [] | no_license | sirinath/Terracotta | fedfc2c4f0f06c990f94b8b6c3b9c93293334345 | 00a7662b9cf530dfdb43f2dd821fa559e998c892 | refs/heads/master | 2021-01-23T05:41:52.414211 | 2015-07-02T15:21:54 | 2015-07-02T15:21:54 | 38,613,711 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,555 | java | /*
* All content copyright (c) 2003-2008 Terracotta, Inc., except as may otherwise be noted in a separate copyright
* notice. All rights reserved.
*/
package com.tc.object.bytecode;
import com.tc.cluster.ClusterEventListener;
import com.tc.logging.TCLogger;
import com.tc.management.beans.sessions.SessionMonitorMBean;
import com.tc.object.ObjectID;
import com.tc.object.TCObject;
import com.tc.object.event.DmiManager;
import com.tc.object.logging.InstrumentationLogger;
import com.tc.object.logging.NullInstrumentationLogger;
import com.tc.properties.TCProperties;
import java.lang.reflect.Field;
/**
* Null implementation of the manager.
*/
public final class NullManager implements Manager {
public static final String CLASS = "com/tc/object/bytecode/NullManager";
public static final String TYPE = "L" + CLASS + ";";
private static final Manager INSTANCE = new NullManager();
private static final InstrumentationLogger instrumentationLogger = new NullInstrumentationLogger();
/**
* Get instance of the null manager
*
* @return NullManager
*/
public static Manager getInstance() {
return INSTANCE;
}
private NullManager() {
//
}
public final void init() {
//
}
public final void initForTests() {
//
}
public final void stop() {
//
}
public final Object lookupOrCreateRoot(String name, Object object) {
throw new UnsupportedOperationException();
}
public final Object lookupOrCreateRootNoDepth(String name, Object obj) {
throw new UnsupportedOperationException();
}
public final Object createOrReplaceRoot(String name, Object object) {
throw new UnsupportedOperationException();
}
public final void beginLock(String lockID, int type) {
//
}
public final void beginLock(String lockID, int type, String lockType) {
//
}
public final TCObject lookupExistingOrNull(Object obj) {
return null;
}
public final void objectNotify(Object obj) {
obj.notify();
}
public final void objectNotifyAll(Object obj) {
obj.notifyAll();
}
public final void objectWait0(Object obj) throws InterruptedException {
obj.wait();
}
public final void objectWait1(Object obj, long millis) throws InterruptedException {
obj.wait(millis);
}
public final void objectWait2(Object obj, long millis, int nanos) throws InterruptedException {
obj.wait(millis, nanos);
}
public final void monitorEnter(Object obj, int type) {
//
}
public void monitorEnterInterruptibly(Object obj, int type) {
//
}
public final void monitorExit(Object obj) {
//
}
public final void logicalInvoke(Object object, String methodName, Object[] params) {
//
}
public final boolean distributedMethodCall(Object receiver, String method, Object[] params, boolean runOnAllNodes) {
return true;
}
public final void distributedMethodCallCommit() {
//
}
public final void checkWriteAccess(Object context) {
//
}
public final boolean isManaged(Object object) {
return false;
}
public final boolean isLogical(Object object) {
throw new UnsupportedOperationException();
}
public final boolean isRoot(Field field) {
return false;
}
public final Object lookupRoot(String name) {
throw new UnsupportedOperationException();
}
public final void beginVolatile(TCObject tcObject, String fieldName, int type) {
// do nothing
}
public final void commitLock(String lockName) {
// do nothing
}
public final boolean isLocked(Object obj, int lockLevel) {
return false;
}
public final int queueLength(Object obj) {
return 0;
}
public final void commitVolatile(TCObject tcObject, String fieldName) {
//
}
public final int waitLength(Object obj) {
return 0;
}
public final boolean isHeldByCurrentThread(Object obj, int lockLevel) {
return false;
}
public final void logicalInvokeWithTransaction(Object object, Object lockObject, String methodName, Object[] params) {
throw new UnsupportedOperationException();
}
public final boolean tryMonitorEnter(Object obj, long timeoutInNanos, int type) {
throw new UnsupportedOperationException();
}
public final boolean tryBeginLock(String lockID, int type) {
throw new UnsupportedOperationException();
}
public boolean tryBeginLock(String lockID, long timeoutInNanos, int type) {
throw new UnsupportedOperationException();
}
public final TCObject shareObjectIfNecessary(Object pojo) {
throw new UnsupportedOperationException();
}
public final boolean isPhysicallyInstrumented(Class clazz) {
return false;
}
public final String getClientID() {
// XXX: even though this should *probably* throw UnsupportedOperationException, because some innocent tests use
// ManagerUtil (e.g. ConfigPropertiesTest), it was decided to return "" from this method.
return "";
}
public final TCLogger getLogger(String loggerName) {
throw new UnsupportedOperationException();
}
public final SessionMonitorMBean getSessionMonitorMBean() {
throw new UnsupportedOperationException();
}
public final TCObject lookupOrCreate(Object obj) {
throw new UnsupportedOperationException();
}
public final Object lookupObject(ObjectID id) {
throw new UnsupportedOperationException();
}
public Object lookupObject(ObjectID id, ObjectID parentContext) {
throw new UnsupportedOperationException();
}
public final TCProperties getTCProperites() {
throw new UnsupportedOperationException();
}
public final void addClusterEventListener(ClusterEventListener cel) {
throw new UnsupportedOperationException();
}
public final DmiManager getDmiManager() {
throw new UnsupportedOperationException();
}
public final int localHeldCount(Object obj, int lockLevel) {
throw new UnsupportedOperationException();
}
public boolean isDsoMonitored(Object obj) {
return false;
}
public boolean isDsoMonitorEntered(Object obj) {
return false;
}
public boolean isFieldPortableByOffset(Object pojo, long fieldOffset) {
throw new UnsupportedOperationException();
}
public void monitorEnter(Object obj, int type, String contextInfo) {
//
}
public InstrumentationLogger getInstrumentationLogger() {
return instrumentationLogger;
}
public boolean overridesHashCode(Object obj) {
throw new UnsupportedOperationException();
}
}
| [
"asingh@7fc7bbf3-cf45-46d4-be06-341739edd864"
] | asingh@7fc7bbf3-cf45-46d4-be06-341739edd864 |
f57f643b14fafa89cf48eea6b1eff902f26c8c54 | a1826c2ed9c12cfc395fb1a14c1a2e1f097155cb | /umeng-apm-20220214/src/main/java/com/aliyun/umeng_apm20220214/models/GetTodayStatTrendResponse.java | c7187c22cf57c1017f9b9d38e78737e7203cfd81 | [
"Apache-2.0"
] | permissive | aliyun/alibabacloud-java-sdk | 83a6036a33c7278bca6f1bafccb0180940d58b0b | 008923f156adf2e4f4785a0419f60640273854ec | refs/heads/master | 2023-09-01T04:10:33.640756 | 2023-09-01T02:40:45 | 2023-09-01T02:40:45 | 288,968,318 | 40 | 45 | null | 2023-06-13T02:47:13 | 2020-08-20T09:51:08 | Java | UTF-8 | Java | false | false | 1,393 | java | // This file is auto-generated, don't edit it. Thanks.
package com.aliyun.umeng_apm20220214.models;
import com.aliyun.tea.*;
public class GetTodayStatTrendResponse extends TeaModel {
@NameInMap("headers")
@Validation(required = true)
public java.util.Map<String, String> headers;
@NameInMap("statusCode")
@Validation(required = true)
public Integer statusCode;
@NameInMap("body")
@Validation(required = true)
public GetTodayStatTrendResponseBody body;
public static GetTodayStatTrendResponse build(java.util.Map<String, ?> map) throws Exception {
GetTodayStatTrendResponse self = new GetTodayStatTrendResponse();
return TeaModel.build(map, self);
}
public GetTodayStatTrendResponse setHeaders(java.util.Map<String, String> headers) {
this.headers = headers;
return this;
}
public java.util.Map<String, String> getHeaders() {
return this.headers;
}
public GetTodayStatTrendResponse setStatusCode(Integer statusCode) {
this.statusCode = statusCode;
return this;
}
public Integer getStatusCode() {
return this.statusCode;
}
public GetTodayStatTrendResponse setBody(GetTodayStatTrendResponseBody body) {
this.body = body;
return this;
}
public GetTodayStatTrendResponseBody getBody() {
return this.body;
}
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
af09c6b666d2ca35754aaae4378f3fd63a0af2d2 | 8160730dbfc837ba0f5882743c84e5ec22756879 | /cloudnet-modules/cloudnet-cloudperms/src/main/java/de/dytanic/cloudnet/ext/cloudperms/bukkit/BukkitCloudNetCloudPermissionsPermissible.java | 509a54353a6b58a29bf2c6700583ccf81f205f46 | [] | no_license | derrop/CloudNet-v3 | 60198fdbade1e6a532650811f61e3e939f326163 | 754a196b07efb2a4b8574001b996d9e0a133f30c | refs/heads/master | 2020-07-25T23:00:44.559269 | 2019-06-21T12:28:55 | 2019-06-21T12:29:54 | 208,450,593 | 0 | 0 | null | 2019-12-22T12:40:04 | 2019-09-14T14:17:37 | null | UTF-8 | Java | false | false | 1,854 | java | package de.dytanic.cloudnet.ext.cloudperms.bukkit;
import de.dytanic.cloudnet.common.collection.Iterables;
import de.dytanic.cloudnet.driver.permission.IPermissionUser;
import de.dytanic.cloudnet.ext.cloudperms.CloudPermissionsPermissionManagement;
import lombok.Getter;
import org.bukkit.entity.Player;
import org.bukkit.permissions.PermissibleBase;
import org.bukkit.permissions.Permission;
import java.util.Arrays;
import java.util.Collection;
@Getter
public final class BukkitCloudNetCloudPermissionsPermissible extends PermissibleBase {
private static final Collection<String> DEFAULT_ALLOWED_PERMISSION_COLLECTION = Iterables.newArrayList(Arrays.asList(
"bukkit.broadcast.user"
));
private final Player player;
public BukkitCloudNetCloudPermissionsPermissible(Player player)
{
super(player);
this.player = player;
}
@Override
public boolean isPermissionSet(String name)
{
return hasPermission(name);
}
@Override
public boolean isPermissionSet(Permission perm)
{
return isPermissionSet(perm.getName());
}
@Override
public boolean hasPermission(Permission perm)
{
return hasPermission(perm.getName());
}
@Override
public boolean hasPermission(String inName)
{
if (inName == null) return false;
if (DEFAULT_ALLOWED_PERMISSION_COLLECTION.contains(inName.toLowerCase())) return true;
try
{
IPermissionUser permissionUser = CloudPermissionsPermissionManagement.getInstance().getUser(player.getUniqueId());
return permissionUser != null && CloudPermissionsPermissionManagement.getInstance().hasPlayerPermission(permissionUser, inName);
} catch (Exception ex)
{
ex.printStackTrace();
return false;
}
}
} | [
"tarekhosni1410@hotmail.com"
] | tarekhosni1410@hotmail.com |
170588ff64bb9c8896d54b753d0b3064330aef90 | 8b7f3152ec27b2468c0f3e574583eee615cd4752 | /junit/junit-spring/src/main/java/org/example/junit/HomeController.java | 2a0aa69dc460fa821028680d83c08c5c2a4797cd | [] | no_license | gochaorg/samples | 1ac5865926490af68ea738a3dbe8468e43f31071 | a61d411ccb767842f6957ee4bb9c98951456320a | refs/heads/master | 2023-07-25T15:27:04.198343 | 2023-05-06T21:58:35 | 2023-05-06T21:58:35 | 91,985,642 | 0 | 1 | null | 2023-07-07T21:54:00 | 2017-05-21T20:32:02 | Java | UTF-8 | Java | false | false | 359 | java | package org.example.junit;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class HomeController {
@RequestMapping("/")
public @ResponseBody
String greeting() {
return "Hello, World";
}
}
| [
"nt.gocha@gmail.com"
] | nt.gocha@gmail.com |
44f7b7e108feb61faeef93c507bf75fe73b31e59 | 884557ac73eff99ccb985febe0ed1c5a46a9969c | /Libraries/SC-PaymentGatewayPlugins/src/main/java/com/smilecoms/commons/paymentgateway/Pesapal.java | 7635c1ecc9e7d40dbd43a24addef26d264471009 | [] | no_license | vikaspshelar/SMILE | 732ef4b80655f246b43997d8407653cf7ffddad0 | 7ffc19eafef4d53a33e3d4bc658a1266b1087b27 | refs/heads/master | 2023-07-17T14:21:28.863986 | 2021-08-28T07:08:39 | 2021-08-28T07:08:39 | 400,570,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,719 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.smilecoms.commons.paymentgateway;
import com.smilecoms.commons.paymentgateway.helpers.PaymentGatewayHelper;
import com.smilecoms.commons.util.Oauth1Utils;
import java.util.HashMap;
import java.util.Map;
/**
*
* @author sabza
*/
public class Pesapal {
private final String reqURL;
private final String aouthKeyProp;
public Pesapal(String reqURL, String aouthKeyProp) {
this.reqURL = reqURL;
this.aouthKeyProp = aouthKeyProp;
}
public Pesapal() {
this.reqURL = null;
this.aouthKeyProp = null;
}
public String getTransactionDetailsOld(String orderId) throws Exception {
return queryPaymentStatusByMerchantRef(orderId);
}
public String getTransactionDetails(String transactionReference, String orderId, boolean statusOnly) throws Exception {
if (statusOnly) {
return queryPaymentStatus(transactionReference, orderId);
}
return queryPaymentDetails(transactionReference, orderId);
}
/*
QueryPaymentStatusByMerchantRef
Once the transaction has been posted to PesaPal, you may use QueryPaymentStatus to query the status
of the payment.
URL:
https://www.pesapal.com/API/QueryPaymentStatusByMerchantRef
Parameters:
pesapal_merchant_reference = <the Reference you sent to PesaPal when posting the transaction>
Return Value:
pesapal_response_data =<PENDING|COMPLETED|FAILED|INVALID>
*/
private String queryPaymentStatusByMerchantRef(String orderId) throws Exception {
Map<String, String> oauthParams = new HashMap<>();
oauthParams.put("pesapal_merchant_reference", orderId);
//http://www.paysmile.co.tz/index.php?option=com_users&task=paybill.checkStatus&reference=19
String ret = Oauth1Utils.getHttpRequestResponse(reqURL, "GET", oauthParams, null, aouthKeyProp);
return ret;
}
private String queryPaymentStatusByMerchantRef1(String orderId) throws Exception {
Map<String, String> oauthParams = new HashMap<>();
oauthParams.put("pesapal_merchant_reference", orderId);
String ret = Oauth1Utils.getHttpRequestResponse(reqURL, "GET", oauthParams, null, aouthKeyProp);
return ret;
}
/*
QueryPaymentStatus
Once the transaction has been posted to PesaPal, you may use QueryPaymentStatus to query the status
of the payment.
URL:
https://www.pesapal.com/API/QueryPaymentStatus
Parameters:
pesapal_merchant_reference = <the Reference you sent to PesaPal when posting the transaction>
pesapal_transaction_tracking_id = <the id returned to you by PesaPal (as a query parameter) when redirecting to your website>
Return Value:
pesapal_response_data =<PENDING|COMPLETED|FAILED|INVALID>
*/
private String queryPaymentStatus(String transactionReference, String orderId) throws Exception {
Map<String, String> oauthParams = new HashMap<>();
oauthParams.put("pesapal_merchant_reference", orderId);
oauthParams.put("pesapal_transaction_tracking_id", transactionReference);
String ret = Oauth1Utils.getHttpRequestResponse(reqURL, "GET", oauthParams, null, aouthKeyProp);
return ret;
}
/*
QueryPaymentDetails
Once the transaction has been posted to PesaPal, you may use QueryPaymentStatus to query the status
of the payment.
URL:
https://www.pesapal.com/API/QueryPaymentDetails
Parameters:
pesapal_merchant_reference = <the Reference you sent to PesaPal when posting the transaction>
pesapal_transaction_tracking_id = <the id returned to you by PesaPal (as a query parameter) when redirecting to your website>
Return Value:
pesapal_response_data =<pesapal_transaction_tracking_id,payment_method,payment_status,pesapal_merchant_reference>
*/
private String queryPaymentDetails(String transactionReference, String orderId) throws Exception {
Map<String, String> oauthParams = new HashMap<>();
oauthParams.put("pesapal_merchant_reference", orderId);
oauthParams.put("pesapal_transaction_tracking_id", transactionReference);
String ret = Oauth1Utils.getHttpRequestResponse(reqURL, "GET", oauthParams, null, aouthKeyProp);
return ret;
}
public String getTransactionDetails(String requestURL) throws Exception {
return PaymentGatewayHelper.sendHTTPRequest("QUERY_STRING", "GET", requestURL, new HashMap<>(), new HashMap<>(), "Pesapal");
}
}
| [
"sbaranwal@futurerx.com"
] | sbaranwal@futurerx.com |
5917bc212648c73b1dabcb41e44d68bb9592c1dc | 84a2b5b3b636c07564d449c402b458c4e8ec0760 | /kafka-manager-common/src/main/java/com/xiaojukeji/kafka/manager/common/zookeeper/znode/brokers/PartitionState.java | ade9680bd58a213e22247d73260801e0c6ee1d61 | [
"Apache-2.0"
] | permissive | tcf1207239873/Logi-KafkaManager | 535b663d24c988425ec564fbe072a7910e6c86af | 73e51a888b0c1fcda186e2a08e224e5c1fb80a08 | refs/heads/master | 2023-05-07T02:19:23.776822 | 2021-05-10T09:30:59 | 2021-05-10T09:30:59 | 360,016,146 | 2 | 0 | Apache-2.0 | 2021-06-08T06:55:35 | 2021-04-21T03:03:59 | Java | UTF-8 | Java | false | false | 4,217 | java | package com.xiaojukeji.kafka.manager.common.zookeeper.znode.brokers;
import java.util.ArrayList;
import java.util.List;
/**
* PartitionState实例
* 对应zookeeper下的state节点信息以及partition的其它信息
* @author tukun
* @date 2015/11/10.
*/
public class PartitionState implements Cloneable {
/**
* partition id
*/
private int partitionId;
/**
* kafka集群中的中央控制器选举次数
*/
private int controller_epoch;
/**
* Partition所属的leader broker编号
*/
private int leader;
/**
* partition的版本号
*/
private int version;
/**
* 该partition leader选举次数
*/
private int leader_epoch;
/**
* 同步副本组brokerId列表
*/
private List<Integer> isr;
/**
* 是否处于复制同步状态, true表示未同步, false表示已经同步
*/
private boolean isUnderReplicated;
/**
* Partition的offset
*/
private long offset;
/**
* 被消费的offset
*/
private long consumeOffset;
/**
* 消费者对应的消费group
*/
private String consumerGroup;
public int getPartitionId() {
return partitionId;
}
public void setPartitionId(int partitionId) {
this.partitionId = partitionId;
}
public int getControllerEpoch() {
return controller_epoch;
}
public void setControllerEpoch(int controllerEpoch) {
this.controller_epoch = controllerEpoch;
}
public int getLeader() {
return leader;
}
public void setLeader(int leader) {
this.leader = leader;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public int getLeaderEpoch() {
return leader_epoch;
}
public void setLeaderEpoch(int leaderEpoch) {
this.leader_epoch = leaderEpoch;
}
public List<Integer> getIsr() {
return isr;
}
public void setIsr(List<Integer> isr) {
this.isr = isr;
}
public boolean isUnderReplicated() {
return isUnderReplicated;
}
public void setUnderReplicated(boolean underReplicated) {
isUnderReplicated = underReplicated;
}
public long getOffset() {
return offset;
}
public void setOffset(long offset) {
this.offset = offset;
}
public long getConsumeOffset() {
return consumeOffset;
}
public void setConsumeOffset(long consumeOffset) {
this.consumeOffset = consumeOffset;
}
public String getConsumerGroup() {
return consumerGroup;
}
public void setConsumerGroup(String consumerGroup) {
this.consumerGroup = consumerGroup;
}
@Override
public String toString() {
return "PartitionState{" +
"partitionId=" + partitionId +
", controller_epoch=" + controller_epoch +
", leader=" + leader +
", version=" + version +
", leader_epoch=" + leader_epoch +
", isr=" + isr +
", isUnderReplicated=" + isUnderReplicated +
", offset=" + offset +
", consumeOffset=" + consumeOffset +
", consumerGroup='" + consumerGroup + '\'' +
'}';
}
@Override
public PartitionState clone() {
try {
PartitionState partitionState = (PartitionState) super.clone();
partitionState.setPartitionId(this.partitionId);
partitionState.setControllerEpoch(this.controller_epoch);
partitionState.setLeader(this.leader);
partitionState.setVersion(this.version);
partitionState.setLeaderEpoch(this.leader_epoch);
partitionState.setIsr(new ArrayList<>(this.isr));
partitionState.setOffset(this.offset);
partitionState.setConsumeOffset(this.consumeOffset);
partitionState.setConsumerGroup(this.consumerGroup);
return partitionState;
} catch (CloneNotSupportedException e) {
}
return null;
}
}
| [
"zengqiao@didiglobal.com"
] | zengqiao@didiglobal.com |
b991c09933692b7a5815bf8de7cd74566f0eab24 | 31db60fe49ef7d31f3fc29221a69b97c19c59bb3 | /src/main/resources/oracle-db/kv-18.1.19/src/oracle/kv/impl/topo/RepNodeComponentMap.java | c9746f4af312258ed9f164c9ccf933c0f6ddc387 | [
"Apache-2.0",
"Zlib",
"MIT",
"CC0-1.0",
"FSFAP",
"BSD-3-Clause"
] | permissive | joelnewcom/embeddedOracleKv | d39cc4db1aa26962d7a1c721b87aa55a23124c3e | 138d23c66ae91d8e367b5456e4c5ab85dc47fcdc | refs/heads/master | 2021-06-25T20:24:13.850335 | 2019-06-02T19:43:27 | 2019-06-02T19:43:27 | 134,009,219 | 0 | 0 | Apache-2.0 | 2020-10-13T01:06:34 | 2018-05-18T22:19:51 | Java | UTF-8 | Java | false | false | 2,063 | java | /*-
* Copyright (C) 2011, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This file was distributed by Oracle as part of a version of Oracle NoSQL
* Database made available at:
*
* http://www.oracle.com/technetwork/database/database-technologies/nosqldb/downloads/index.html
*
* Please see the LICENSE file included in the top-level directory of the
* appropriate version of Oracle NoSQL Database for a copy of the license and
* additional information.
*/
package oracle.kv.impl.topo;
import java.io.DataInput;
import java.io.IOException;
import oracle.kv.impl.topo.ResourceId.ResourceType;
import com.sleepycat.persist.model.Persistent;
/**
* Defines the RepGroup internal map used collect its rep nodes
*
* @see #writeFastExternal FastExternalizable format
*/
@Persistent
public class RepNodeComponentMap extends ComponentMap<RepNodeId, RepNode> {
private static final long serialVersionUID = 1L;
/* The owning rep group. */
private final RepGroup repGroup;
public RepNodeComponentMap(RepGroup repGroup, Topology topology) {
super(topology);
this.repGroup = repGroup;
}
RepNodeComponentMap(RepGroup repGroup,
Topology topology,
DataInput in,
short serialVersion)
throws IOException {
super(topology, in, serialVersion);
this.repGroup = repGroup;
}
@SuppressWarnings("unused")
private RepNodeComponentMap() {
this.repGroup = null;
}
/* (non-Javadoc)
* @see oracle.kv.impl.topo.ComponentMap#nextId()
*/
@Override
RepNodeId nextId() {
return new RepNodeId(this.repGroup.getResourceId().getGroupId(),
nextSequence());
}
/* (non-Javadoc)
* @see oracle.kv.impl.topo.ComponentMap#getResourceType()
*/
@Override
ResourceType getResourceType() {
return ResourceType.REP_NODE;
}
@Override
Class<RepNode> getComponentClass() {
return RepNode.class;
}
}
| [
"joel.neukom@gmx.ch"
] | joel.neukom@gmx.ch |
29ac284534832e5626f5d060b7ee9ba1d5588171 | 5d947685fec60ad07d9d5c86eb002527f3ba4e7b | /Chapter09/javaEE8ExampleSSOAppService/src/main/java/com/packt/rhuan/auth/AuthSession.java | de7bf9b34643fd75c2cceabf7d6975f830918842 | [
"MIT"
] | permissive | PacktPublishing/Java-EE-8-Design-Patterns-and-Best-Practices | 3e4d350631a1e94cf919204852fbba98985c4532 | bbb15647f30c4b2fb4aa5cce4d2b2e239294bb4b | refs/heads/master | 2023-02-08T12:54:38.189327 | 2023-01-30T08:50:34 | 2023-01-30T08:50:34 | 131,253,422 | 22 | 17 | MIT | 2021-12-14T21:14:24 | 2018-04-27T06:12:23 | Java | UTF-8 | Java | false | false | 1,403 | java | package com.packt.rhuan.auth;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
@ApplicationScoped
public class AuthSession {
private Map<String,Auth> authenticated;
private Map<String,Auth> dataSource;
@PostConstruct
public void init(){
authenticated = new HashMap<>();
dataSource = new HashMap<>();
for(int i = 1; i <= 50; i++)
dataSource.put("login"+i, new Auth("login"+i, "123456") );
}
public AuthSession putAuthenticated(String key, Auth auth){
authenticated.put(key, auth);
return this;
}
public AuthSession removeAuthenticated(String key, Auth auth){
authenticated.remove(key, auth);
return this;
}
public Map<String, Auth> getAuthenticated() {
return authenticated;
}
public Map<String, Auth> getDataSource() {
return dataSource;
}
public Optional<String> getToken(String login, String password){
for( String key : authenticated.keySet() ){
Auth auth = authenticated.get( key );
if( auth.getLogin().equals(login)
&& auth.getPassword().equals( password )){
return Optional.of(key);
}
}
return Optional.empty();
}
}
| [
"32731556+mehulsingh7@users.noreply.github.com"
] | 32731556+mehulsingh7@users.noreply.github.com |
6af89f519f60204cb42a4686032dcf264c0eff1f | c1b940c548890b1f8834586ddcda06ad79bcb533 | /im-simple-web-app/src/main/java/by/vironit/training/basumatarau/simpleMessengerApp/command/SignUpCommand.java | 3f4b0afcdbcb0f893a3e958bb8aff0b1e9eabac9 | [] | no_license | basumatarau/instant-messenger-app | 355e53deee45fada2a667e61a77ca6e4a70d7515 | 9c3333f38c3e1fb48a017191a09e6c2f1a79633d | refs/heads/master | 2022-09-25T00:44:43.335849 | 2019-09-24T11:13:09 | 2019-09-24T11:13:09 | 199,909,978 | 3 | 0 | null | 2022-09-08T01:01:49 | 2019-07-31T18:35:54 | Java | UTF-8 | Java | false | false | 4,856 | java | package by.vironit.training.basumatarau.simpleMessengerApp.command;
import by.vironit.training.basumatarau.simpleMessengerApp.controller.Action;
import by.vironit.training.basumatarau.simpleMessengerApp.validator.RequestHandler;
import by.vironit.training.basumatarau.simpleMessengerApp.controller.SessionHandler;
import by.vironit.training.basumatarau.simpleMessengerApp.dao.DaoProvider;
import by.vironit.training.basumatarau.simpleMessengerApp.exception.*;
import by.vironit.training.basumatarau.simpleMessengerApp.model.Role;
import by.vironit.training.basumatarau.simpleMessengerApp.model.User;
import by.vironit.training.basumatarau.simpleMessengerApp.service.ServiceProvider;
import by.vironit.training.basumatarau.simpleMessengerApp.service.UserService;
import by.vironit.training.basumatarau.simpleMessengerApp.util.PasswordEncoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.Optional;
public class SignUpCommand extends Command {
private static final Logger logger = LoggerFactory.getLogger(SignUpCommand.class);
private UserService userService;
private static final String EMAIL_REG_PATTERN = "([-_А-Яа-яЁё\\w\\d]{3,40})@([-_А-Яа-яЁё\\w\\d]{1,20}).([-_А-Яа-яЁё\\w\\d]{1,4})";
private final static String FNAME_REG_PATTERN = "([-_А-Яа-яЁё\\w\\d]{0,150})";
private final static String LNAME_REG_PATTERN = "([-_А-Яа-яЁё\\w\\d]{0,150})";
private final static String NICK_REG_PATTERN = "([-_А-Яа-яЁё\\w\\d]{1,60})";
private final static String PASSWORD_REG_PATTERN = "[-_+\\d\\w]+";
public SignUpCommand(){
init();
}
private void init(){
this.userService = ServiceProvider.SERV.userService;
}
@Override
public Command process(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException, ValidationException, ControllerException {
final User authorizedUser = SessionHandler.getAuthorizedUser(req);
if(authorizedUser!=null){
return Action.USERPROFILE.getCommand();
}
if(RequestHandler.isPost(req, resp)){
final String email = RequestHandler.getString(req, "emailInput", EMAIL_REG_PATTERN);
final String password = RequestHandler.getString(req, "passwordInput", PASSWORD_REG_PATTERN );
final String firstName = RequestHandler.getString(req, "firstNameInput", FNAME_REG_PATTERN);
final String lastName = RequestHandler.getString(req, "lastNameInput", LNAME_REG_PATTERN);
final String nickName = RequestHandler.getString(req, "nickNameInput", NICK_REG_PATTERN);
try {
if(userService
.findUserByEmail(email)
.isPresent()) {
throw new UserCredentialsOccupied("user credentials occupied for email: " + email);
}
} catch (ServiceException e) {
logger.warn("email look up failure during sign-up for email: " + email);
return Action.ERROR.getCommand();
}
byte[] salt = new byte[16];
new SecureRandom().nextBytes(salt);
final String pwdHash = PasswordEncoder.getPwdHash(password, salt);
try {
final Role freshUserRole;
try {
final Optional<Role> optRole = DaoProvider.DAO.roleDao.findByName("USER");
freshUserRole = optRole.orElseThrow(() -> new DaoException("no USER role present in db"));
} catch (DaoException e) {
logger.error("sign-up failure for: " + email);
throw new ServiceException("failed to fetch roles", e);
}
final User newUser = new User.UserBuilder()
.enabled(true)
.email(email)
.firstName(firstName)
.lastName(lastName)
.nickName(nickName)
.role(freshUserRole)
.passwordHash(pwdHash)
.salt(salt)
.build();
userService.registerNewUserAccount(newUser);
} catch (ServiceException | InstantiationException e) {
logger.error("persistence failure at sign-up for user with email: " + email);
return Action.ERROR.getCommand();
}
return Action.LOGINATION.getCommand();
}
return null;
}
@Override
public String getViewName() {
return "sign-up";
}
}
| [
"basumatarau@gmail.com"
] | basumatarau@gmail.com |
c00af582c22f0f43723daa92c9702fd745211911 | 0f77c5ec508d6e8b558f726980067d1058e350d7 | /1_39_120042/com/ankamagames/baseImpl/graphics/opengl/SkinnedComponent.java | be15f2d199a8def2bedbfbe1de231722cbedb96e | [] | no_license | nightwolf93/Wakxy-Core-Decompiled | aa589ebb92197bf48e6576026648956f93b8bf7f | 2967f8f8fba89018f63b36e3978fc62908aa4d4d | refs/heads/master | 2016-09-05T11:07:45.145928 | 2014-12-30T16:21:30 | 2014-12-30T16:21:30 | 29,250,176 | 5 | 5 | null | 2015-01-14T15:17:02 | 2015-01-14T15:17:02 | null | UTF-8 | Java | false | false | 1,099 | java | package com.ankamagames.baseImpl.graphics.opengl;
import javax.swing.*;
import org.apache.log4j.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.image.*;
public class SkinnedComponent extends JComponent
{
public static final Logger m_logger;
private Image m_image;
public SkinnedComponent() {
this(null);
}
public SkinnedComponent(final Image image) {
super();
this.setBorder(new EmptyBorder(0, 0, 0, 0));
this.setOpaque(true);
this.setDoubleBuffered(true);
this.m_image = image;
}
public void setImage(final Image image) {
this.m_image = image;
this.repaint();
}
@Override
protected void paintComponent(final Graphics g) {
if (this.m_image == null) {
return;
}
g.drawImage(this.m_image, 0, 0, this.getWidth(), this.getHeight(), null);
}
@Override
protected void paintBorder(final Graphics graphics) {
}
static {
m_logger = Logger.getLogger((Class)SkinnedComponent.class);
}
}
| [
"totomakers@hotmail.fr"
] | totomakers@hotmail.fr |
c1e0bddbcc99d81e3c6efd32feb75c61f835e665 | 7d6737c3799b0b85c72907f95886b6b132812a17 | /src/cn/shgx/hashtable/Entry.java | 6716445d8fcd69d2afd15651a669f47477e4fd62 | [] | no_license | guangxush/JavaAlgorithms | 60e05522a5d94a5d4c91884035a91c3d26b0247e | c7230a528e028fe3b0584a7de132471d2201661c | refs/heads/master | 2022-03-18T18:35:39.678862 | 2019-10-11T11:44:36 | 2019-10-11T11:44:36 | 110,700,460 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 207 | java | package cn.shgx.hashtable;
public class Entry {
int key ;
int value;
Entry next;
public Entry(int key,int value,Entry next) {
super();
this.key = key;
this.value = value;
this.next = next;
}
}
| [
"guangxush@163.com"
] | guangxush@163.com |
f683d213c030c9875e60193288d4fecef4c3caf1 | 00a957c9884ac3ac70b068bff84fb326419e0faf | /src/test/java/com/imooc/o2o/dao/ProductImgDaoTest.java | 4e3b51b68fe85b2c9161e668edb38841fca920ce | [] | no_license | Goinsist/o2o | 74d0d18cc39304b039d299e53dbfd29a7981cb0b | f1e7fdca92f7e5c0ff1992fdc748e00c829d645b | refs/heads/master | 2020-04-19T08:54:22.643299 | 2019-01-29T04:30:59 | 2019-01-29T04:31:00 | 168,092,942 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,021 | java | package com.imooc.o2o.dao;
import com.imooc.o2o.entity.ProductImg;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import static org.junit.Assert.assertEquals;
@RunWith(SpringRunner.class)
@SpringBootTest
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class ProductImgDaoTest {
@Autowired
private ProductImgDao productImgDao;
@Test
public void testABatchInsertProductImg() throws Exception {
ProductImg productImg1 = new ProductImg();
productImg1.setImgAddr("图片1");
productImg1.setImgDesc("测试图片1");
productImg1.setPriority(1);
productImg1.setCreateTime(new Date());
productImg1.setProductId(13L);
ProductImg productImg2 = new ProductImg();
productImg2.setImgAddr("图片2");
productImg2.setPriority(1);
productImg2.setCreateTime(new Date());
productImg2.setProductId(13L);
List<ProductImg> productImgList = new ArrayList<ProductImg>();
productImgList.add(productImg1);
productImgList.add(productImg2);
int effectedNum = productImgDao.batchInsertProductImg(productImgList);
assertEquals(2, effectedNum);
}
@Test
public void testBQueryProductImgList(){
//检查productId为1的商品是否有且仅有两张商品详情图片
List<ProductImg> productImgList=productImgDao.queryProductImgList(13L);
assertEquals(2,productImgList.size());
}
@Test
public void testCDeleteProductImgByProductId() throws Exception {
long productId = 13;
int effectedNum = productImgDao.deleteProductImgByProductId(productId);
assertEquals(2, effectedNum);
}
}
| [
"2830849518@qq.com"
] | 2830849518@qq.com |
11f2ca29c72381530a2dca5b8d54a591d3fe3ab6 | edfb435ee89eec4875d6405e2de7afac3b2bc648 | /tags/selenium-2.17.0/java/client/test/com/thoughtworks/selenium/corebased/TestType.java | fc475776104c4b9d7bbd8382e95842fb8f181bd8 | [
"Apache-2.0"
] | permissive | Escobita/selenium | 6c1c78fcf0fb71604e7b07a3259517048e584037 | f4173df37a79ab6dd6ae3f1489ae0cd6cc7db6f1 | refs/heads/master | 2021-01-23T21:01:17.948880 | 2012-12-06T22:47:50 | 2012-12-06T22:47:50 | 8,271,631 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,572 | java | package com.thoughtworks.selenium.corebased;
import com.thoughtworks.selenium.InternalSelenseTestBase;
import org.junit.Test;
import org.openqa.selenium.internal.WrapsDriver;
public class TestType extends InternalSelenseTestBase {
@Test
public void testType() throws Exception {
selenium.open("../tests/html/test_type_page1.html");
verifyEquals(selenium.getValue("username"), "");
selenium.shiftKeyDown();
selenium.type("username", "x");
verifyEquals(selenium.getValue("username"), "X");
selenium.shiftKeyUp();
selenium.type("username", "TestUserWithLongName");
verifyEquals(selenium.getValue("username"), "TestUserWi");
selenium.type("username", "TestUser");
verifyEquals(selenium.getValue("username"), "TestUser");
verifyEquals(selenium.getValue("password"), "");
selenium.type("password", "testUserPasswordIsVeryLong");
verifyEquals(selenium.getValue("password"), "testUserPasswordIsVe");
selenium.type("password", "testUserPassword");
verifyEquals(selenium.getValue("password"), "testUserPassword");
if (isAbleToUpdateFileElements()) {
selenium.type("file", "/test/file");
selenium.click("submitButton");
selenium.waitForPageToLoad("30000");
verifyTrue(selenium.isTextPresent("Welcome, TestUser!"));
}
}
private boolean isAbleToUpdateFileElements() {
String browser = System.getProperty("selenium.browser", runtimeBrowserString());
return selenium instanceof WrapsDriver ||
"*firefox".equals(browser) || "*firefoxchrome".equals(browser);
}
}
| [
"dawagner@07704840-8298-11de-bf8c-fd130f914ac9"
] | dawagner@07704840-8298-11de-bf8c-fd130f914ac9 |
c5bd581395d8f0dc26378549931e7e617f47f101 | e31880a194faa3e9f04611f4f6be792b3c3c6cc9 | /war/src/main/java/ru/korus/tmis/pdm/ws/hl7/MFMIMT700701UV01PriorRegisteredAct.java | 45f6ab2d37e41fe9ee5342abe46da334cf2cb49d | [] | no_license | konglinghai123/pdm | e42c4350194825f9f9b0a7fc2a6c8760486ecaf4 | 64c192f43557107d0ff73dcd4c04fc961c244cc0 | refs/heads/master | 2020-05-15T10:07:35.796734 | 2015-09-09T16:45:27 | 2015-09-09T16:45:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,388 | java |
package ru.korus.tmis.pdm.ws.hl7;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
/**
* <p>Java class for MFMI_MT700701UV01.PriorRegisteredAct complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="MFMI_MT700701UV01.PriorRegisteredAct">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <group ref="{urn:hl7-org:v3}InfrastructureRootElements"/>
* <element name="id" type="{urn:hl7-org:v3}II" maxOccurs="unbounded"/>
* </sequence>
* <attGroup ref="{urn:hl7-org:v3}InfrastructureRootAttributes"/>
* <attribute name="nullFlavor" type="{urn:hl7-org:v3}NullFlavor" />
* <attribute name="classCode" use="required" type="{urn:hl7-org:v3}cs" />
* <attribute name="moodCode" use="required" type="{urn:hl7-org:v3}ActMoodCompletionTrack" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MFMI_MT700701UV01.PriorRegisteredAct", propOrder = {
"realmCode",
"typeId",
"templateId",
"id"
})
public class MFMIMT700701UV01PriorRegisteredAct {
protected List<CS> realmCode;
protected II typeId;
protected List<II> templateId;
@XmlElement(required = true)
protected List<II> id;
@XmlAttribute(name = "nullFlavor")
protected NullFlavor nullFlavor;
@XmlAttribute(name = "classCode", required = true)
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
protected String classCode;
@XmlAttribute(name = "moodCode", required = true)
protected ActMoodCompletionTrack moodCode;
/**
* Gets the value of the realmCode property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the realmCode property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getRealmCode().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link CS }
*
*
*/
public List<CS> getRealmCode() {
if (realmCode == null) {
realmCode = new ArrayList<CS>();
}
return this.realmCode;
}
/**
* Gets the value of the typeId property.
*
* @return
* possible object is
* {@link II }
*
*/
public II getTypeId() {
return typeId;
}
/**
* Sets the value of the typeId property.
*
* @param value
* allowed object is
* {@link II }
*
*/
public void setTypeId(II value) {
this.typeId = value;
}
/**
* Gets the value of the templateId property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the templateId property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getTemplateId().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link II }
*
*
*/
public List<II> getTemplateId() {
if (templateId == null) {
templateId = new ArrayList<II>();
}
return this.templateId;
}
/**
* Gets the value of the id property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the id property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getId().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link II }
*
*
*/
public List<II> getId() {
if (id == null) {
id = new ArrayList<II>();
}
return this.id;
}
/**
* Gets the value of the nullFlavor property.
*
* @return
* possible object is
* {@link NullFlavor }
*
*/
public NullFlavor getNullFlavor() {
return nullFlavor;
}
/**
* Sets the value of the nullFlavor property.
*
* @param value
* allowed object is
* {@link NullFlavor }
*
*/
public void setNullFlavor(NullFlavor value) {
this.nullFlavor = value;
}
/**
* Gets the value of the classCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getClassCode() {
return classCode;
}
/**
* Sets the value of the classCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setClassCode(String value) {
this.classCode = value;
}
/**
* Gets the value of the moodCode property.
*
* @return
* possible object is
* {@link ActMoodCompletionTrack }
*
*/
public ActMoodCompletionTrack getMoodCode() {
return moodCode;
}
/**
* Sets the value of the moodCode property.
*
* @param value
* allowed object is
* {@link ActMoodCompletionTrack }
*
*/
public void setMoodCode(ActMoodCompletionTrack value) {
this.moodCode = value;
}
}
| [
"szgrebelny@korusconsulting.ru"
] | szgrebelny@korusconsulting.ru |
f1ecab5e6e7039466ab0bbf9e8de39005691215d | c4ca391ff5dc34b3552e5cbe31c55f6d16cfab21 | /external/demo/src/main/java/com/sf/demo/picker/PickerShowActivity.java | 0c94240a8bab68705f404626ee419438419f4b1c | [] | no_license | JacksonNing/SofarMusic | 3ab31b32a198b0bf40bee5652c63d8275a1f4b78 | 1f1e74fb4145d92b81883214203811182833d631 | refs/heads/master | 2020-05-16T22:11:40.842638 | 2018-12-20T12:52:26 | 2018-12-20T12:52:26 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,891 | java | package com.sf.demo.picker;
import com.sf.base.UIRootActivity;
import com.sf.demo.R;
import com.sf.demo.picker.city.CityPicker;
import com.sf.demo.picker.city2.CityPicker2;
import com.sf.demo.picker.date.DatePicker;
import com.sf.demo.picker.text.TextPicker;
import com.sf.demo.picker.time.TimePicker;
import com.sf.utility.ToastUtil;
import com.sf.widget.flowlayout.FlowTagList;
/**
* Created by sufan on 17/6/20.
* 后缀的数字相同,代表时同一种style
*/
public class PickerShowActivity extends UIRootActivity{
private FlowTagList tag_fl;
private String[] mTags = {"城市选择器", "文字滚轮", "日期选择器", "时间选择器",
"城市选择器2"};
@Override
protected int getLayoutId() {
return R.layout.activity_demo_show;
}
@Override
protected void initTitle() {
head_title.setText("展示滚轮组件");
}
@Override
public void initView() {
tag_fl = (FlowTagList) findViewById(R.id.tag_fl);
dynamicAddView(tag_fl, "tagColor", R.color.themeColor);
}
@Override
public void initData() {
tag_fl.setTags(mTags);
}
@Override
public void initEvent() {
tag_fl.setOnTagClickListener(new FlowTagList.OnTagClickListener() {
@Override
public void OnTagClick(String text, int position) {
for (int i = 0; i < mTags.length; i++) {
if (i == position) {
tag_fl.setChecked(true, position);
} else {
tag_fl.setChecked(false, i);
}
}
tag_fl.notifyAllTag();
doTag(text,position);
}
});
}
private void doTag(String text,int position){
if("城市选择器".equals(text)){
showCityPicker();
}else if("文字滚轮".equals(text)){
showTextPicker();
}else if("日期选择器".equals(text)){
showDatePicker();
}else if("时间选择器".equals(text)){
showTimePicker();
}else if("城市选择器2".equals(text)){
showCityPicker2();
}
}
private void showCityPicker(){
CityPicker cityPicker=new CityPicker(this,null);
cityPicker.show();
cityPicker.setOnCitySelectListener(new CityPicker.OnCitySelectListener() {
@Override
public void onCitySelect(String province, String city, String county) {
ToastUtil.startShort(baseAt,province+city+county);
}
});
}
private void showTextPicker(){
TextPicker textPicker=new TextPicker(this,null);
textPicker.show();
textPicker.setOnTextSelectListener(new TextPicker.OnTextSelectListener() {
@Override
public void onTextSelect(String text) {
ToastUtil.startShort(baseAt,text);
}
});
}
private void showDatePicker(){
DatePicker datePicker=new DatePicker(this,null);
datePicker.show();
datePicker.setOnDateSelectListener(new DatePicker.OnDateSelectListener() {
@Override
public void onDateSelect(String year, String month, String day) {
ToastUtil.startShort(baseAt,year+"-"+month+"-"+day);
}
});
}
private void showTimePicker(){
TimePicker timePicker=new TimePicker(this,null);
timePicker.show();
timePicker.setOnTimeSelectListener(new TimePicker.OnTimeSelectListener() {
@Override
public void onTimeSelect(String hour, String min) {
ToastUtil.startShort(baseAt,hour+":"+min);
}
});
}
private void showCityPicker2(){
CityPicker2 picker2=new CityPicker2(this,null);
picker2.show();
}
}
| [
"sofarsogood001@163.com"
] | sofarsogood001@163.com |
f9b4fa564bdd282273a6857a97ac2c8192f6235b | 6a380e53a0221719c6d31b3e0c976cffb81ad9d6 | /src/main/java/me/dags/brushes/brush/MultiPointBrush.java | 579ca50243fd0e97cfefb3255dab3c0779037ea4 | [] | no_license | dags-/ExtraBrushes | 9f92bf76bf8685c1864e5a0d59196961469733fe | 12b7eaa6d6c05be7917d0a1be39ad82ec40a5117 | refs/heads/master | 2021-01-09T06:48:51.899128 | 2017-02-06T16:52:41 | 2017-02-06T16:52:41 | 81,080,876 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,396 | java | package me.dags.brushes.brush;
import com.thevoxelbox.voxelsniper.Message;
import com.thevoxelbox.voxelsniper.SnipeAction;
import com.thevoxelbox.voxelsniper.SnipeData;
import com.thevoxelbox.voxelsniper.brush.Brush;
import com.thevoxelbox.voxelsniper.brush.IBrush;
import org.spongepowered.api.block.BlockState;
import org.spongepowered.api.data.property.block.SolidCubeProperty;
import org.spongepowered.api.world.Location;
import org.spongepowered.api.world.World;
import java.util.Random;
/**
* @author dags <dags@dags.me>
*/
public class MultiPointBrush extends Brush {
private IBrush brush = null;
private int spacing = 1;
private int chance = 10;
@Override
public void info(Message vm) {
vm.brushMessage(getName());
}
@Override
public String getPermissionNode() {
return brush == null ? "extrabrushes.multipointbrush" : brush.getPermissionNode();
}
@Override
protected void arrow(final SnipeData data) {
apply(SnipeAction.ARROW, data);
}
@Override
protected void powder(final SnipeData data) {
apply(SnipeAction.GUNPOWDER, data);
}
@Override
public void parameters(final String[] args, final SnipeData data) {
if (this.brush == null) {
String id = data.owner().getCurrentToolId();
this.brush = data.owner().previousBrush(id);
data.sendMessage("Set wrapped brush to: " + this.brush.getName());
}
for (String arg : args) {
if (arg.startsWith("s")) {
int spacing = parseInt(arg.substring(1), this.spacing);
this.spacing = Math.max(spacing, 1);
data.sendMessage("Set spacing to: " + this.spacing);
} else if (arg.startsWith("c")) {
int chance = parseInt(arg.substring(1), this.chance);
this.chance = Math.max(chance, 1);
data.sendMessage("Set chance to: " + this.chance);
}
}
}
private void apply(SnipeAction action, SnipeData data) {
if (this.brush == null) {
return;
}
float radius = (float) data.getBrushSize();
float radsq = radius * radius;
Random random = new Random();
int minX = Math.round(targetBlock.getBlockX() - radius);
int maxX = Math.round(targetBlock.getBlockX() + radius);
int minZ = Math.round(targetBlock.getBlockZ() - radius);
int maxZ = Math.round(targetBlock.getBlockZ() + radius);
int yOffset = action == SnipeAction.GUNPOWDER ? 1 : 0;
for (int x = minX + random.nextInt(spacing); x <= maxX; x += spacing) {
for (int z = minZ + random.nextInt(spacing); z <= maxZ; z += spacing) {
int dx = x - targetBlock.getBlockX();
int dz = z - targetBlock.getBlockZ();
int dsq = (dx * dx) + (dz * dz);
if (dsq <= radsq && chance > random.nextInt(100)) {
Location<World> target = getSolidBlockAt(data.getWorld(), x, targetBlock.getBlockY(), z, yOffset);
if (target != null) {
this.brush.perform(action, data, target, target);
}
}
}
}
}
private static Location<World> getSolidBlockAt(World world, int x, int startY, int z, int offsetY) {
for (int offset = 0; offset < 256; offset++) {
if ((startY - offset + offsetY) >= 0) {
Location<World> down = new Location<>(world, x, startY - offset, z);
if (isSolidCube(down.getBlock())) {
return down.add(0, offsetY, 0);
}
}
if ((startY + offset + offsetY) < 256) {
Location<World> up = new Location<>(world, x, startY + offset, z);
if (isSolidCube(up.getBlock())) {
return up.add(0, offsetY, 0);
}
}
}
return null;
}
private static boolean isSolidCube(BlockState state) {
return state.getProperty(SolidCubeProperty.class).map(SolidCubeProperty::getValue).orElse(false);
}
private static int parseInt(String in, int defaulVal) {
try {
return Integer.parseInt(in);
} catch (NumberFormatException e) {
return defaulVal;
}
}
}
| [
"dags@dags.me"
] | dags@dags.me |
936c1c143829ca007fcb84f0b7d4f5ab4815bb4a | 77ab4c46295084f75b2b741207ee26c5a7d9f20f | /src/main/java/com/vonchange/jsqlparser/expression/operators/relational/ExistsExpression.java | 329ec586307ab6d6513648a9fd3945c70308004d | [] | no_license | VonChange/jsqlparser | 63ad5e246b3d4b149c945c59f1ff1da515ddd5e2 | e031e32b802ee9e5246435f85b436e5be78c7ede | refs/heads/master | 2022-10-13T06:23:03.935147 | 2020-05-24T03:01:51 | 2020-05-24T03:01:51 | 270,620,571 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,201 | java | /*-
* #%L
* JSQLParser library
* %%
* Copyright (C) 2004 - 2019 JSQLParser
* %%
* Dual licensed under GNU LGPL 2.1 or Apache License 2.0
* #L%
*/
package com.vonchange.jsqlparser.expression.operators.relational;
import com.vonchange.jsqlparser.expression.Expression;
import com.vonchange.jsqlparser.expression.ExpressionVisitor;
import com.vonchange.jsqlparser.parser.ASTNodeAccessImpl;
public class ExistsExpression extends ASTNodeAccessImpl implements Expression {
private Expression rightExpression;
private boolean not = false;
public Expression getRightExpression() {
return rightExpression;
}
public void setRightExpression(Expression expression) {
rightExpression = expression;
}
public boolean isNot() {
return not;
}
public void setNot(boolean b) {
not = b;
}
@Override
public void accept(ExpressionVisitor expressionVisitor) {
expressionVisitor.visit(this);
}
public String getStringExpression() {
return (not ? "NOT " : "") + "EXISTS";
}
@Override
public String toString() {
return getStringExpression() + " " + rightExpression.toString();
}
}
| [
"80767699@yonghui.cn"
] | 80767699@yonghui.cn |
1a7c71c5485c7fa98ffb944b3b68602f0008c81a | 04596f24743a90bd214cac1dfbbd448d33201f1f | /com-parent/finance-server-shiro/src/main/java/com/zc/dao/bankcard/BankcardMapper.java | b76d9b6a371f13a53b8391d079954c57f8f2a455 | [] | no_license | WorkJun/Finance-Management | b0b0ef6e827695cfcd7ac7058d15fb4d66439506 | e8f4873f37422568a8add4c1352c7ae843f2a045 | refs/heads/master | 2020-03-26T10:27:25.379010 | 2018-08-15T05:16:35 | 2018-08-15T05:18:11 | 144,798,457 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,065 | java | package com.zc.dao.bankcard;
import com.zc.common.core.orm.mybatis.MyBatisRepository;
import com.zc.entity.bankcard.Bankcard;
import com.zc.entity.logs.LoginOperatingLogs;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.common.BaseMapper;
import java.util.List;
/**
* @author 杨文杰
* @Title: BankcardMapper
* @Description: 测试银行卡Mapper
* @date 2018/6/4
*/
@MyBatisRepository
@Component
public interface BankcardMapper extends BaseMapper<Bankcard> {
/**
* 获取测试银行卡页面
* @author : 杨文杰
* @Creation Date : 2018/6/4
* @version 1.0.0
* @param
*
*/
public List<Bankcard> getBankcardList();
int updateStatus(@Param("id")Long id, @Param("status") Integer status);
int selectByBankcardNum(String bankcardNum);
int deleteBankcard(Bankcard bankcard);
void insertLog(LoginOperatingLogs loginOperatingLogs);
void insertBankcard(Bankcard bankcard);
Bankcard selectBankcardById(Long id);
}
| [
"1754031481@qq.com"
] | 1754031481@qq.com |
99289e389d1e9ca8768fc2209a9f92f8ed155cbe | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_9c6241f9e5151441e21c7c25693eec5dca316f0e/ExportTestSuiteAction/1_9c6241f9e5151441e21c7c25693eec5dca316f0e_ExportTestSuiteAction_s.java | 7c8072417f932b803f4249d1bbd1a3f6326c9cc6 | [] | 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 | 1,502 | java | /*
* soapUI, copyright (C) 2004-2008 eviware.com
*
* soapUI is free software; you can redistribute it and/or modify it under the
* terms of version 2.1 of the GNU Lesser General Public License as published by
* the Free Software Foundation.
*
* soapUI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
* even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details at gnu.org.
*/
package com.eviware.soapui.impl.wsdl.actions.testsuite;
import java.io.File;
import com.eviware.soapui.impl.wsdl.WsdlTestSuite;
import com.eviware.soapui.support.UISupport;
import com.eviware.soapui.support.action.support.AbstractSoapUIAction;
public class ExportTestSuiteAction extends AbstractSoapUIAction<WsdlTestSuite>
{
public ExportTestSuiteAction()
{
super("Export", "Export this test suite");
}
@Override
public void perform(WsdlTestSuite tSuite, Object param)
{
tSuite.beforeSave();
String defaultFileName = System.getProperty("user.home") + File.separator + tSuite.getName() + ".xml";
File file = UISupport.getFileDialogs().saveAs(this, "Select test case file", "xml", "XML", new File(defaultFileName));
if( file == null ) return;
String fileName = file.getAbsolutePath();
if( fileName == null ) return;
tSuite.export(file);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
fae44c45050f35253be200abbb78dd5f39d08020 | c26c934a95f5fd6b9b2362072dbc2474d1d87e13 | /spring-v4/src/main/java/com/dn/spring/context/config/annotation/Component.java | a352a808fab85bc8db1964769388cb9e121d1706 | [] | no_license | K-Darker/Spring | 21e28b22a3b5605cdcc597370079e9bb9f8ad70f | f9480e15d0b127123e3bf970d2a403354dfed6be | refs/heads/master | 2022-12-25T08:11:55.762216 | 2019-06-02T02:11:02 | 2019-06-02T02:12:44 | 189,795,285 | 1 | 0 | null | 2022-11-16T11:46:44 | 2019-06-02T02:07:52 | Java | UTF-8 | Java | false | false | 676 | java | package com.dn.spring.context.config.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.dn.spring.beans.BeanDefinition;
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Component {
String value() default "";
String name() default "";
String scope() default BeanDefinition.SCOPE_SINGLETION;
String factoryMethodName() default "";
String factoryBeanName() default "";
String initMethodName() default "";
String destroyMethodName() default "";
}
| [
"614720519@qq.com"
] | 614720519@qq.com |
0b75cd9e1ddd63ebfa93639d9e1e2af9b613f6fe | f0489dac17a48f535420651e6492a7d857e1ea03 | /Java SE/Spring Transaction-Annotations-app/src/main/java/com/app/App.java | 9dc9f70654728ef6c28600553e6c82aa21539f71 | [] | no_license | tracksdata/Java-Pennant | d696c78aa75a4c6cafeceec3fd0f6c9defcd0370 | b5cd10e8ad936b6589742122d241389f9084d109 | refs/heads/master | 2021-09-13T13:01:30.673956 | 2018-04-30T06:56:23 | 2018-04-30T06:56:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,218 | java | package com.app;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import com.app.config.AppConfig;
import com.app.model.Account;
import com.app.repository.AccountRepository;
import com.app.service.TxrService;
public class App {
public static void main(String[] args) {
// init
ConfigurableApplicationContext context = null;
context = new AnnotationConfigApplicationContext(AppConfig.class);
// --------------------------------------------------------------
// use
try {
TxrService txrService = context.getBean("txrService", TxrService.class);
txrService.txr(500, "2", "1");
} catch (Exception e) {
System.out.println("Ex-" + e.getMessage());
}
// --------------------------------------------------------------
// Testing
AccountRepository accountRepository = context.getBean("accRepo", AccountRepository.class);
Account account1 = accountRepository.load("1");
Account account2 = accountRepository.load("2");
System.out.println(account1);
System.out.println(account2);
// --------------------------------------------------------------
// destroy
context.close();
}
}
| [
"praveen.somireddy@gmail.com"
] | praveen.somireddy@gmail.com |
61afb9a06f43fa4e222de5343e1c29a799de2a95 | facb068d2ce9cc224fb8c8e9d0893d7c3dcda69e | /src/ru/io/aimc/Main.java | 165299d1b535cc1f441162aa1b88c66ca4a47eb2 | [] | no_license | NMakhamatov/TestAC | 447977d5183308becc8b41f536f55effb4d58215 | 8ff2e917c6ac9bde93465d4f7b009ec893ca4c77 | refs/heads/master | 2020-06-26T18:50:39.305276 | 2019-07-30T20:13:36 | 2019-07-30T20:13:36 | 199,720,222 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 925 | java | package ru.io.aimc;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
/**
* Main
*/
public class Main {
public static void main(String[] args) {
Storage storage = new Storage();
String[] fileNames = getFileNames();
Arrays.stream(fileNames)
.forEach(
it -> new Thread(new RunnableFile(it, storage)).start()
);
}
private static String[] getFileNames() {
String[] result = null;
try (
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
) {
String string = bufferedReader.readLine();
result = string.split(";");
} catch (IOException e) {
System.out.println("Что-то пошло не так... :(");
}
return result;
}
}
| [
"zeropulse8@gmail.com"
] | zeropulse8@gmail.com |
c56bb200d73240d79267a7038322fc1f78b4a712 | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XRENDERING-418-36-14-FEMO-WeightedSum:TestLen:CallDiversity/org/xwiki/rendering/internal/parser/wikimodel/AbstractWikiModelParser_ESTest.java | b95dbda0ebdc190a6def1b4447040ee26d2c3d15 | [] | 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 | 598 | java | /*
* This file was automatically generated by EvoSuite
* Sat Apr 04 03:08:08 UTC 2020
*/
package org.xwiki.rendering.internal.parser.wikimodel;
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 AbstractWikiModelParser_ESTest extends AbstractWikiModelParser_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
e4696ca606c27e9f88e2ef2f78220b598aa76c68 | 99491debb70866677edc01d9af1bfaadac914978 | /src/main/java/com/id/wasta/bean/TIdBusinessPotentialInfoAccess.java | 402e971875feb860ad1f5df54ab384b4c2211eae | [] | no_license | srnu/wasta | a9dbf4772d6584aacb952b12a4d0e6842d8fa77c | c55498cd42b8114ee0bb9342c9905868632e9ddc | refs/heads/master | 2022-12-12T06:54:57.769288 | 2020-09-13T09:41:53 | 2020-09-13T09:41:53 | 295,119,733 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,080 | java | /*
* Created on 19 Mar 2019 ( Time 15:03:42 )
* Generated by Telosys Tools Generator ( version 2.1.1 )
*/
package com.id.wasta.bean;
import java.io.Serializable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
public class TIdBusinessPotentialInfoAccess implements Serializable {
private static final long serialVersionUID = 1L;
//----------------------------------------------------------------------
// ENTITY PRIMARY KEY ( BASED ON A SINGLE FIELD )
//----------------------------------------------------------------------
@NotNull
private Long bpiaKey;
//----------------------------------------------------------------------
// ENTITY DATA FIELDS
//----------------------------------------------------------------------
@NotNull
private Long bpiaBpiKey;
@NotNull
@Size( min = 1, max = 2250 )
private String bpiaAccessInfo;
@NotNull
@Size( min = 1, max = 1 )
private String activeStatus;
@NotNull
private Long lockKey;
@NotNull
private Long createdBy;
//----------------------------------------------------------------------
// GETTER & SETTER FOR THE KEY FIELD
//----------------------------------------------------------------------
public void setBpiaKey( Long bpiaKey ) {
this.bpiaKey = bpiaKey ;
}
public Long getBpiaKey() {
return this.bpiaKey;
}
//----------------------------------------------------------------------
// GETTERS & SETTERS FOR FIELDS
//----------------------------------------------------------------------
public void setBpiaBpiKey( Long bpiaBpiKey ) {
this.bpiaBpiKey = bpiaBpiKey;
}
public Long getBpiaBpiKey() {
return this.bpiaBpiKey;
}
public void setBpiaAccessInfo( String bpiaAccessInfo ) {
this.bpiaAccessInfo = bpiaAccessInfo;
}
public String getBpiaAccessInfo() {
return this.bpiaAccessInfo;
}
public void setActiveStatus( String activeStatus ) {
this.activeStatus = activeStatus;
}
public String getActiveStatus() {
return this.activeStatus;
}
public void setLockKey( Long lockKey ) {
this.lockKey = lockKey;
}
public Long getLockKey() {
return this.lockKey;
}
public Long getCreatedBy() {
return createdBy;
}
public void setCreatedBy(Long createdBy) {
this.createdBy = createdBy;
}
//----------------------------------------------------------------------
// toString METHOD
//----------------------------------------------------------------------
public String toString() {
StringBuffer sb = new StringBuffer();
sb.append(bpiaKey);
sb.append("|");
sb.append(bpiaBpiKey);
sb.append("|");
sb.append(bpiaAccessInfo);
sb.append("|");
sb.append(activeStatus);
sb.append("|");
sb.append(lockKey);
sb.append("|");
sb.append(createdBy);
return sb.toString();
}
}
| [
"venkatrao@infodynamic.in"
] | venkatrao@infodynamic.in |
2f0e03a7b956eaea49bac0d505266b4a57211675 | 93f4ddae480d493a57fe3714eca08978303030f3 | /modules/flowable-idm-engine/src/main/java/org/flowable/idm/engine/impl/ServiceImpl.java | 5f5561ddd4a77882e953bff5a54f99dcde2b4b00 | [
"Apache-2.0"
] | permissive | relational-data-systems/flowable-engine | 5f58fda07ea5a7e48c77242ffb0710d783a08142 | beee29a3c3117212d83a8c783e0b971cf215a5ba | refs/heads/master | 2021-01-22T23:27:11.427285 | 2019-04-24T01:59:33 | 2019-04-24T01:59:33 | 85,639,360 | 0 | 0 | Apache-2.0 | 2018-09-12T01:16:28 | 2017-03-21T00:00:03 | Java | UTF-8 | Java | false | false | 1,218 | java | /* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.idm.engine.impl;
import org.flowable.idm.engine.IdmEngineConfiguration;
import org.flowable.idm.engine.impl.interceptor.CommandExecutor;
public abstract class ServiceImpl {
protected IdmEngineConfiguration engineConfig;
protected CommandExecutor commandExecutor;
public ServiceImpl() {
}
public ServiceImpl(IdmEngineConfiguration engineConfig) {
this.engineConfig = engineConfig;
}
public CommandExecutor getCommandExecutor() {
return commandExecutor;
}
public void setCommandExecutor(CommandExecutor commandExecutor) {
this.commandExecutor = commandExecutor;
}
}
| [
"tijs.rademakers@gmail.com"
] | tijs.rademakers@gmail.com |
34ecea8939f5d39ceda59016b209ad6b19d837fc | 32d81b4b9db2b6ea4e5c046688cfa43740500bed | /src/com/netty/io/netty/resolver/dns/SequentialDnsServerAddressStream.java | f93bef536e4d0349b3d09a70bd9e510e4a92bc94 | [] | no_license | zymap/zytest | f1ce4cf0e6c735d35f68ea8c89df98ae6d035821 | b8d9eb6cf46490958d20ebb914d543af50d1b862 | refs/heads/master | 2021-04-03T01:15:30.946483 | 2018-03-24T14:10:57 | 2018-03-24T14:10:57 | 124,623,152 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,216 | java | /*
* Copyright 2015 The Netty Project
*
* The Netty Project licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.netty.io.netty.resolver.dns;
import io.netty.resolver.dns.*;
import io.netty.resolver.dns.DnsServerAddressStream;
import java.net.InetSocketAddress;
final class SequentialDnsServerAddressStream implements DnsServerAddressStream {
private final InetSocketAddress[] addresses;
private int i;
SequentialDnsServerAddressStream(InetSocketAddress[] addresses, int startIdx) {
this.addresses = addresses;
i = startIdx;
}
@Override
public InetSocketAddress next() {
int i = this.i;
InetSocketAddress next = addresses[i];
if (++ i < addresses.length) {
this.i = i;
} else {
this.i = 0;
}
return next;
}
@Override
public int size() {
return addresses.length;
}
@Override
public io.netty.resolver.dns.SequentialDnsServerAddressStream duplicate() {
return new io.netty.resolver.dns.SequentialDnsServerAddressStream(addresses, i);
}
@Override
public String toString() {
return toString("sequential", i, addresses);
}
static String toString(String type, int index, InetSocketAddress[] addresses) {
final StringBuilder buf = new StringBuilder(type.length() + 2 + addresses.length * 16);
buf.append(type).append("(index: ").append(index);
buf.append(", addrs: (");
for (InetSocketAddress a: addresses) {
buf.append(a).append(", ");
}
buf.setLength(buf.length() - 2);
buf.append("))");
return buf.toString();
}
}
| [
"734206637@qq.com"
] | 734206637@qq.com |
95e60f888acc35a1f4f73ac18157a0d421db159d | 5f4054b9c21986d44d3346ba06536b6419308dee | /lib/src/test/java/ru/prolib/bootes/lib/rm/RMPriceStatsSBTest.java | 7a1d8c64539f95ce024b220c8732e61dd3a39811 | [] | no_license | robot-aquila/bootes | 27225fce346c5cb55ee313298770449b89da5d26 | 18c0c06dbcaa0e1b4c4c0b0e9cbf9bb0974ee298 | refs/heads/master | 2022-09-14T02:03:07.130173 | 2020-12-06T23:57:50 | 2020-12-06T23:57:50 | 126,428,636 | 0 | 0 | null | 2022-09-01T23:08:57 | 2018-03-23T03:33:22 | Java | UTF-8 | Java | false | false | 3,683 | java | package ru.prolib.bootes.lib.rm;
import static org.junit.Assert.*;
import static ru.prolib.aquila.core.BusinessEntities.CDecimalBD.*;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;
import org.junit.Before;
import org.junit.Test;
import ru.prolib.aquila.core.BusinessEntities.CDecimal;
import ru.prolib.aquila.core.data.TSeriesImpl;
import ru.prolib.aquila.core.data.ZTFrame;
import ru.prolib.bootes.lib.rm.RMPriceStatsSB;
public class RMPriceStatsSBTest {
private static ZoneId ZONE = ZoneId.of("Europe/Moscow");
static Instant ZT(String timeString) {
return LocalDateTime.parse(timeString).atZone(ZONE).toInstant();
}
private TSeriesImpl<CDecimal> daily, local;
private RMPriceStatsSB service;
@Before
public void setUp() throws Exception {
daily = new TSeriesImpl<>(ZTFrame.D1MSK);
local = new TSeriesImpl<>(ZTFrame.M5MSK);
service = new RMPriceStatsSB();
service.setDailyMoveSeries(daily);
service.setLocalMoveSeries(local);
}
@Test
public void testSettersAndGetters() {
assertSame(daily, service.getDailyMoveSeries());
assertSame(local, service.getLocalMoveSeries());
}
@Test
public void testGetDailyPriceMove() {
assertNull(service.getDailyPriceMove(ZT("2018-12-15T15:35:20")));
daily.set(ZT("2018-12-15T00:00:00"), of("534.902"));
assertNull(service.getDailyPriceMove(ZT("2018-12-15T15:35:20")));
assertNull(service.getDailyPriceMove(ZT("2018-12-14T15:35:20")));
assertEquals(of("534.902"), service.getDailyPriceMove(ZT("2018-12-16T15:35:20")));
daily.set(ZT("2018-12-16T00:00:00"), of("603.015"));
daily.set(ZT("2018-12-17T00:00:00"), of("505.212"));
assertNull(service.getDailyPriceMove(ZT("2018-12-14T02:15:47")));
assertNull(service.getDailyPriceMove(ZT("2018-12-15T03:20:45")));
assertEquals(of("534.902"), service.getDailyPriceMove(ZT("2018-12-16T08:50:45")));
assertEquals(of("603.015"), service.getDailyPriceMove(ZT("2018-12-17T15:47:19")));
assertEquals(of("505.212"), service.getDailyPriceMove(ZT("2018-12-18T00:00:00")));
assertEquals(of("505.212"), service.getDailyPriceMove(ZT("2047-01-01T00:00:00")));
}
@Test
public void testGetLocalPriceMove() {
assertNull(service.getLocalPriceMove(ZT("2018-12-15T22:43:36")));
local.set(ZT("2018-12-15T22:43:36"), of("42.924"));
assertNull(service.getLocalPriceMove(ZT("2018-12-15T22:00:00")));
assertNull(service.getLocalPriceMove(ZT("2018-12-15T22:40:00")));
assertNull(service.getLocalPriceMove(ZT("2018-12-15T22:43:36")));
assertEquals(of("42.924"), service.getLocalPriceMove(ZT("2018-12-15T22:45:00")));
assertEquals(of("42.924"), service.getLocalPriceMove(ZT("2018-12-15T23:12:27")));
local.set(ZT("2018-12-15T22:45:00"), of("49.360"));
local.set(ZT("2018-12-15T23:00:00"), of("51.014"));
assertNull(service.getLocalPriceMove(ZT("2018-01-01T00:00:00")));
assertNull(service.getLocalPriceMove(ZT("2018-12-15T21:14:46")));
assertNull(service.getLocalPriceMove(ZT("2018-12-15T22:40:00")));
assertEquals(of("42.924"), service.getLocalPriceMove(ZT("2018-12-15T22:45:00")));
assertEquals(of("42.924"), service.getLocalPriceMove(ZT("2018-12-15T22:47:41")));
assertEquals(of("49.360"), service.getLocalPriceMove(ZT("2018-12-15T22:51:04")));
assertEquals(of("49.360"), service.getLocalPriceMove(ZT("2018-12-15T23:00:00")));
assertEquals(of("49.360"), service.getLocalPriceMove(ZT("2018-12-15T23:00:19")));
assertEquals(of("51.014"), service.getLocalPriceMove(ZT("2018-12-15T23:07:38")));
assertEquals(of("51.014"), service.getLocalPriceMove(ZT("2018-12-15T23:59:59")));
assertEquals(of("51.014"), service.getLocalPriceMove(ZT("2050-01-01T00:00:00")));
}
}
| [
"robot-aquila@hotmail.com"
] | robot-aquila@hotmail.com |
d2ee10e5fda2a987991f027d5a6915c6acce1a1e | 031b1c5b0c404f23ccd61a08845695bd4c3827f2 | /project/Spring/spring-aop-01/src/main/java/com/slp/version2/inter/impl/MyCalculator.java | e2e416dbe2d16f8b873b7c485fb04f656abc436a | [] | no_license | AndyFlower/zixin | c8d957fd8b1e6ca0e1ae63389bc8151ab93dbb55 | 647705e5f14fae96f82d334ba1eb8a534735bfd9 | refs/heads/master | 2022-12-23T21:10:44.872371 | 2021-02-10T07:15:21 | 2021-02-10T07:15:21 | 232,578,547 | 1 | 0 | null | 2022-12-16T15:41:14 | 2020-01-08T14:13:25 | Java | UTF-8 | Java | false | false | 341 | java | package com.slp.version2.inter.impl;
import com.slp.version2.inter.Calculator;
import org.springframework.stereotype.Service;
@Service
public class MyCalculator implements Calculator {
@Override
public int add(int i, int j) {
return i+j;
}
@Override
public int sub(int i, int j) {
return i-j;
}
}
| [
"1308445442@qq.com"
] | 1308445442@qq.com |
178c56e9a12b7d67b3e6626bb3821761b7047956 | 1e7a4b87edc7e9e6a870b15acf177edf9233932d | /core/impl/src/main/java/com/blazebit/persistence/impl/function/datediff/second/SQLServerSecondDiffFunction.java | d829d6fa570033829fdc2b6754a576036d9d8d7d | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | vincentDAO/blaze-persistence | 4b98c168024371a62e0d2e7756c20ec7ef9081c2 | 9d30ff5c96cc320d3b8d68492f7dc677a64dd172 | refs/heads/master | 2020-03-26T23:19:04.190101 | 2018-08-17T13:36:41 | 2018-08-19T20:28:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,090 | java | /*
* Copyright 2014 - 2018 Blazebit.
*
* 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.blazebit.persistence.impl.function.datediff.second;
import com.blazebit.persistence.spi.FunctionRenderContext;
/**
* @author Moritz Becker
* @since 1.2.0
*/
public class SQLServerSecondDiffFunction extends SecondDiffFunction {
public SQLServerSecondDiffFunction() {
super("datediff(ss,?1,?2)");
}
@Override
protected void renderDiff(FunctionRenderContext context) {
renderer.start(context).addArgument(0).addArgument(1).build();
}
}
| [
"christian.beikov@gmail.com"
] | christian.beikov@gmail.com |
4f3ad0242ffc8e9bc9dfbceac3531c3c5ac25cf1 | 4b2c63d13f24585a3542576cdf64bd01db67c1ae | /hss/hsscommon/src/main/java/org/freeims/hss/server/db/op/VisitedNetwork_DAO.java | 86933f81db0ef1f2664685e501b94d3003b287b8 | [] | no_license | gugu-lee/freeims | ce1d0d92ab79c93dfc356971363f0faf6d228461 | bbe2de872deb074531e12cf74204b7a29c91c354 | refs/heads/master | 2022-12-01T08:47:38.326261 | 2019-11-02T10:14:33 | 2019-11-02T10:14:33 | 58,299,201 | 0 | 0 | null | 2022-11-24T01:41:17 | 2016-05-08T06:11:46 | Java | UTF-8 | Java | false | false | 4,883 | java | /*
* Copyright (C) 2004-2007 FhG Fokus
*
* This file is part of Open IMS Core - an open source IMS CSCFs & HSS
* implementation
*
* Open IMS Core is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* For a license to use the Open IMS Core software under conditions
* other than those described here, or to purchase support for this
* software, please contact Fraunhofer FOKUS by e-mail at the following
* addresses:
* info@open-ims.org
*
* Open IMS Core is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* It has to be noted that this Open Source IMS Core System is not
* intended to become or act as a product in a commercial context! Its
* sole purpose is to provide an IMS core reference implementation for
* IMS technology testing and IMS application prototyping for research
* purposes, typically performed in IMS test-beds.
*
* Users of the Open Source IMS Core System have to be aware that IMS
* technology may be subject of patents and licence terms, as being
* specified within the various IMS-related IETF, ITU-T, ETSI, and 3GPP
* standards. Thus all Open IMS Core users have to take notice of this
* fact and have to agree to check out carefully before installing,
* using and extending the Open Source IMS Core System, if related
* patents and licenses may become applicable to the intended usage
* context.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
package org.freeims.hss.server.db.op;
import java.util.List;
import org.apache.log4j.Logger;
import org.freeims.hss.server.model.ChargingInfo;
import org.freeims.hss.server.model.TP;
import org.freeims.hss.server.model.VisitedNetwork;
import org.hibernate.Query;
import org.hibernate.Session;
/**
* @author adp dot fokus dot fraunhofer dot de
* Adrian Popescu / FOKUS Fraunhofer Institute
*/
public class VisitedNetwork_DAO {
private static Logger logger = Logger.getLogger(VisitedNetwork_DAO.class);
public static void insert(Session session, VisitedNetwork visited_network){
session.save(visited_network);
}
public static void update(Session session, VisitedNetwork visited_network){
session.save(visited_network);
}
public static VisitedNetwork get_by_ID(Session session, int id){
Query query;
query = session.createSQLQuery("select * from visited_network where id=?")
.addEntity(VisitedNetwork.class);
query.setInteger(0, id);
return (VisitedNetwork) query.uniqueResult();
}
public static VisitedNetwork get_by_Identity(Session session, String identity){
Query query;
query = session.createSQLQuery("select * from visited_network where identity like ?")
.addEntity(VisitedNetwork.class);
query.setString(0, identity);
VisitedNetwork result = null;
try{
result = (VisitedNetwork) query.uniqueResult();
}
catch(org.hibernate.NonUniqueResultException e){
logger.error("Query did not returned an unique result! You have a duplicate in the database!");
e.printStackTrace();
}
return result;
}
public static Object[] get_by_Wildcarded_Identity(Session session, String identity,
int firstResult, int maxResults){
Query query;
query = session.createSQLQuery("select * from visited_network where identity like ?")
.addEntity(VisitedNetwork.class);
query.setString(0, "%" + identity + "%");
Object[] result = new Object[2];
result[0] = new Integer(query.list().size());
query.setFirstResult(firstResult);
query.setMaxResults(maxResults);
result[1] = query.list();
return result;
}
public static Object[] get_all(Session session, int firstResult, int maxResults){
Query query;
query = session.createSQLQuery("select * from visited_network")
.addEntity(VisitedNetwork.class);
Object[] result = new Object[2];
result[0] = new Integer(query.list().size());
query.setFirstResult(firstResult);
query.setMaxResults(maxResults);
result[1] = query.list();
return result;
}
public static List get_all(Session session){
Query query;
query = session.createSQLQuery("select * from visited_network")
.addEntity(VisitedNetwork.class);
return query.list();
}
public static int delete_by_ID(Session session, int id){
Query query = session.createSQLQuery("delete from visited_network where id=?");
query.setInteger(0, id);
return query.executeUpdate();
}
}
| [
"seven.stone.2012@gmail.com"
] | seven.stone.2012@gmail.com |
bb37f1bd8f8f3534af9247c207ac68b77bcda6c2 | 8f5d3d144cf98de0b0c535526eb65db0702d4ffc | /main/java/dqr/entity/mobEntity/monsterNight/DqmEntityNightwalker.java | e4267ca39f6e2aabe33f36a38bc1c605ed16a455 | [] | no_license | azelDqm/MC1.7.10_DQRmod | 54c0790b80c11a8ae591f17d233adc95f1b7e41a | bfec0e17fcade9d4616ac29b5abcbb12aa562d2a | refs/heads/master | 2020-04-16T02:26:44.596119 | 2020-04-06T08:58:47 | 2020-04-06T08:58:47 | 57,311,023 | 6 | 2 | null | null | null | null | UTF-8 | Java | false | false | 4,961 | java | package dqr.entity.mobEntity.monsterNight;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.world.World;
import dqr.DQR;
import dqr.api.Items.DQArmors;
import dqr.api.Items.DQMiscs;
import dqr.api.enums.EnumDqmMonster;
public class DqmEntityNightwalker extends DqmMobBaseNight
{
public DqmEntityNightwalker(World world)
{
super(world, EnumDqmMonster.NIGHTWALKER );
//this.monsterType = EnumDqmMonster.NIGHTWALKER;
/*
this.MobClassName = this.monsterType.getMobClassName();
this.MobName = this.monsterType.getMobName();
this.MobCateg = this.monsterType.getMobCateg();
this.DqmMobEXP = DQR.funcMob.getCalcEXP(this.monsterType.getEXP());
this.DqmMobGOLD = DQR.funcMob.getCalcGOLD(this.monsterType.getGOLD());
this.DqmMobMP = this.monsterType.getMP();
this.DqmMobPW = DQR.funcMob.getCalcPW(this.monsterType.getPW());
this.DqmMobDEF = this.monsterType.getDF();
this.CFIRE = this.monsterType.isCFIRE();
this.CPET = this.monsterType.getCPET();
this.CAI = this.monsterType.isCAI();
this.CTENSEI = this.monsterType.getCTENSEI();
this.CTENSEIsp = DQR.funcMob.getCalcTENSEIsp(this.monsterType.getCTENSEIsp());
this.KougekiPat = this.monsterType.getKougekiPat();
this.TenseiMob = this.monsterType.getTenseiMob();
this.TenseiMin = this.monsterType.getTenseiMin();
this.TenseiMax = this.monsterType.getTenseiMax();
this.MobRoot = this.monsterType.getMobRoot();
this.KakuseiMob = this.monsterType.getKakuseiMob();
this.experienceValue = this.monsterType.getXPS();
*/
}
/*
* AIを使うかどうか.
* 今回は使うのでtrueを返している.
*/
@Override
public boolean isAIEnabled()
{
return EnumDqmMonster.NIGHTWALKER.isCAI();
}
/*
* このEntityに性質を付与する.
* 今回は移動速度を変更.
*/
@Override
protected void applyEntityAttributes()
{
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(DQR.funcMob.getCalcSPEED(EnumDqmMonster.NIGHTWALKER.getSPEED()));
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(DQR.funcMob.getCalcHP(EnumDqmMonster.NIGHTWALKER.getHP()));
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(DQR.funcMob.getCalcPW(EnumDqmMonster.NIGHTWALKER.getPW()));
}
@Override
public int getTotalArmorValue()
{
return EnumDqmMonster.NIGHTWALKER.getDF();
}
@Override
protected void dropFewItems(boolean par1, int par2)
{
if (DQR.funcMob.getCalcDROP(1, 1))
{
this.dropItem(DQMiscs.itemYorunotobari, 1);
}
if (DQR.funcMob.getCalcDROP(4, 1))
{
this.dropItem(DQMiscs.itemKoumorinohane, 1);
}
if (DQR.funcMob.getCalcDROP(50, 1))
{
this.dropItem(DQMiscs.itemLittlemedal, 1);
}
if (DQR.funcMob.getCalcDROP(50, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori0, 1);
}
if (DQR.funcMob.getCalcDROP(50, 1))
{
this.dropItem(DQMiscs.itemTiisaitamasii, 1);
}
if (DQR.funcMob.getCalcDROP(100, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori1, 1);
}
if (DQR.funcMob.getCalcDROP(50, 1))
{
this.dropItem(DQMiscs.itemDouka, 1);
}
if (DQR.funcMob.getCalcDROP(200, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori2, 1);
}
if (DQR.funcMob.getCalcDROP(400, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori3, 1);
}
if (DQR.funcMob.getCalcDROP(800, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori4, 1);
}
if (DQR.funcMob.getCalcDROP(1600, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori5, 1);
}
if (DQR.funcMob.getCalcDROP(3200, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori6, 1);
}
if (DQR.funcMob.getCalcDROP(6400, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori7, 1);
}
if (DQR.funcMob.getCalcDROP(12800, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori8, 1);
}
if (DQR.funcMob.getCalcDROP(25600, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori9, 1);
}
if (DQR.funcMob.getCalcDROP(51200, 1))
{
this.dropItem(DQMiscs.itemMegaminoinori10, 1);
}
if (DQR.funcMob.getCalcDROP(3000, 1))
{
this.dropItem(DQArmors.itemSabitakabuto, 1);
}
if (DQR.funcMob.getCalcDROP(3000, 1))
{
this.dropItem(DQArmors.itemSabitakabuto, 1);
}
if (DQR.funcMob.getCalcDROP(3000, 1))
{
this.dropItem(DQArmors.itemSabitakote, 1);
}
if (DQR.funcMob.getCalcDROP(3000, 1))
{
this.dropItem(DQArmors.itemSabitakutu, 1);
}
}
}
| [
"azel.dqm@gmail.com"
] | azel.dqm@gmail.com |
818ce01058baacc21c93eb2a8ccad1fe7913e97c | 447520f40e82a060368a0802a391697bc00be96f | /apks/malware/app52/source/com/baidu/mobstat/ae.java | 9dcc79b0c5b538e7cb61be548116c0e31ab11dc2 | [
"Apache-2.0"
] | permissive | iantal/AndroidPermissions | 7f3343a9c29d82dbcd4ecd98b3a50ddf8d179465 | d623b732734243590b5f004d167e542e2e2ae249 | refs/heads/master | 2023-07-19T01:29:26.689186 | 2019-09-30T19:01:42 | 2019-09-30T19:01:42 | 107,239,248 | 0 | 0 | Apache-2.0 | 2023-07-16T07:41:38 | 2017-10-17T08:22:57 | null | UTF-8 | Java | false | false | 1,991 | java | package com.baidu.mobstat;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
class ae
{
List<af> a = new ArrayList();
private long b = 0L;
private long c = 0L;
private int d = 0;
public ae()
{
a(System.currentTimeMillis());
}
public long a()
{
return this.b;
}
public void a(int paramInt)
{
this.d = paramInt;
}
public void a(long paramLong)
{
this.b = paramLong;
}
public void a(String paramString, long paramLong1, long paramLong2)
{
paramString = new af(this, paramString, paramLong1, paramLong2);
this.a.add(paramString);
}
public void b()
{
this.b = 0L;
this.c = 0L;
this.d = 0;
this.a.clear();
a(System.currentTimeMillis());
}
public void b(long paramLong)
{
this.c = paramLong;
}
public JSONObject c()
{
JSONObject localJSONObject1 = new JSONObject();
try
{
localJSONObject1.put("s", this.b);
localJSONObject1.put("e", this.c);
localJSONObject1.put("i", System.currentTimeMillis());
localJSONObject1.put("c", this.d);
JSONArray localJSONArray = new JSONArray();
int i = 0;
while (i < this.a.size())
{
JSONObject localJSONObject2 = new JSONObject();
localJSONObject2.put("n", ((af)this.a.get(i)).a());
localJSONObject2.put("d", ((af)this.a.get(i)).b());
long l2 = ((af)this.a.get(i)).c() - this.b;
long l1 = l2;
if (l2 < 0L) {
l1 = 0L;
}
localJSONObject2.put("ps", l1);
localJSONArray.put(localJSONObject2);
i += 1;
}
localJSONObject1.put("p", localJSONArray);
return localJSONObject1;
}
catch (JSONException localJSONException)
{
au.a().a("statsdk", "StatSession.constructJSONObject() failed");
}
return localJSONObject1;
}
public int d()
{
return this.d;
}
}
| [
"antal.micky@yahoo.com"
] | antal.micky@yahoo.com |
f544a5b0294700cc0959bfa347bb6ed654aec72f | f7eb57cf3027c562764ba1242cebfcd2fb077130 | /app/src/main/java/arcus/app/subsystems/alarm/promonitoring/presenters/HubAlarmDisconnectedContract.java | f7dba12949534f98c9ad766fe9eacfac41d5da63 | [
"Apache-2.0"
] | permissive | arcus-smart-home/arcusandroid | e866ab720c7f023a8c6ed0f4bff782fb3d17a366 | 845b23b6ee913c58e009914e920242e29d0b137a | refs/heads/master | 2021-07-16T05:00:28.554875 | 2020-01-04T19:29:05 | 2020-01-05T05:45:36 | 168,191,380 | 30 | 29 | Apache-2.0 | 2020-06-14T18:27:29 | 2019-01-29T16:51:39 | Java | UTF-8 | Java | false | false | 1,170 | java | /*
* Copyright 2019 Arcus Project.
*
* 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 arcus.app.subsystems.alarm.promonitoring.presenters;
import arcus.cornea.common.PresentedView;
import arcus.cornea.common.Presenter;
public class HubAlarmDisconnectedContract {
public class HubAlarmDisconnectedModel {
}
public interface HubAlarmDisconnectedView extends PresentedView<HubAlarmDisconnectedModel> {
void setHubLastChangedTime(String hubLastChangedTime);
void setSecurityModeChanged(String newMode);
}
public interface HubAlarmDisconnectedPresenter extends Presenter<HubAlarmDisconnectedView> {}
}
| [
"b@yoyo.com"
] | b@yoyo.com |
3b4b9aa10f5061f0e8d399d00f5259acb49d0238 | 03d61086047f041168f9a77b02a63a9af83f0f3f | /newrelic/src/main/java/com/newrelic/agent/instrumentation/pointcuts/frameworks/faces/PhasePointCut.java | 2f5b5b8992a00b88dba46d7b60932e22c4b6622e | [] | no_license | masonmei/mx2 | fa53a0b237c9e2b5a7c151999732270b4f9c4f78 | 5a4adc268ac1e52af1adf07db7a761fac4c83fbf | refs/heads/master | 2021-01-25T10:16:14.807472 | 2015-07-30T21:49:33 | 2015-07-30T21:49:35 | 39,944,476 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,375 | java | //
// Decompiled by Procyon v0.5.29
//
package com.newrelic.agent.instrumentation.pointcuts.frameworks.faces;
import com.newrelic.agent.tracers.metricname.MetricNameFormat;
import com.newrelic.agent.tracers.DefaultTracer;
import com.newrelic.agent.tracers.metricname.ClassMethodMetricNameFormat;
import com.newrelic.agent.tracers.Tracer;
import com.newrelic.agent.tracers.ClassMethodSignature;
import com.newrelic.agent.Transaction;
import com.newrelic.agent.instrumentation.classmatchers.ClassMatcher;
import com.newrelic.agent.instrumentation.classmatchers.ExactClassMatcher;
import com.newrelic.agent.instrumentation.PointCut;
import com.newrelic.agent.instrumentation.PointCutConfiguration;
import com.newrelic.agent.instrumentation.TracerFactoryPointCut;
public class PhasePointCut extends TracerFactoryPointCut
{
public PhasePointCut() {
super(new PointCutConfiguration(PhasePointCut.class), new ExactClassMatcher("com/sun/faces/lifecycle/Phase"), PointCut.createExactMethodMatcher("doPhase", "(Ljavax/faces/context/FacesContext;Ljavax/faces/lifecycle/Lifecycle;Ljava/util/ListIterator;)V"));
}
public Tracer doGetTracer(final Transaction transaction, final ClassMethodSignature sig, final Object phase, final Object[] args) {
return new DefaultTracer(transaction, sig, phase, new ClassMethodMetricNameFormat(sig, phase));
}
}
| [
"dongxu.m@gmail.com"
] | dongxu.m@gmail.com |
301b414c16f880fb0cb117da728d4fab6f448e87 | ffe51120e37c281c0203fba02b61122cc6fafe21 | /src/zamk/lib/runtime/Assembler.java | ca954d80763d79d360a87adfef0f3b3dcee6f31d | [] | no_license | zygote1984/zamk | ccb6f6beb190c1491bae9b68768d8950f4009742 | 97e331b70c31184eeec11f0c4d9c47d7136cd876 | refs/heads/master | 2016-08-06T12:44:34.087964 | 2012-11-30T11:48:00 | 2012-11-30T11:48:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 216 | java | package zamk.lib.runtime;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
/**
* @since 1.0
*/
public class Assembler {
}
| [
"kardelenhatun@gmail.com"
] | kardelenhatun@gmail.com |
e5b4fbd039070051f954ae3a1dae251d406b03cc | 16878f5521cf1b9d6b7223a9436da3e2b7780b29 | /20200113-최종프로젝트/src/com/sist/dao/MemberDAO.java | 99ad75931b00a15dd797ec2ca36b8f19a56daaca | [] | no_license | hsj304/JavaStudy | 549d78e53dd6209b0fe64d786c145755a6fd2b13 | d6991a2a62d82ffab09340124652353492fd3391 | refs/heads/master | 2023-04-01T16:09:50.032850 | 2020-01-22T03:50:47 | 2020-01-22T03:50:47 | null | 0 | 0 | null | null | null | null | UHC | Java | false | false | 2,807 | java | package com.sist.dao;
import java.sql.*;
public class MemberDAO {
private Connection conn;//오라클 연결 => Socket
private PreparedStatement ps;// BufferedReader,OutputStream
private final String URL="jdbc:oracle:thin:@localhost:1521:XE";
// 오라클 연결 주소
// 1. 드라이버 등록 => 한번 수행 => 생성자
public MemberDAO()
{
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
}catch(Exception ex)
{
System.out.println(ex.getMessage());
}
}
// 2. 연결
public void getConnection()
{
try
{
conn=DriverManager.getConnection(URL,"hr","happy");
// conn hr/happy
}catch(Exception ex) {}
}
// 3. 연결해제
public void disConnection()
{
try
{
if(ps!=null) ps.close();
if(conn!=null) conn.close();
// exit
}catch(Exception ex) {}
}
// 4. 기능 처리
public String isLogin(String id,String pwd)
{
String result="";
try
{
// 연결
getConnection();
// 오라클에 요청
String sql="SELECT COUNT(*) FROM member WHERE id=?";
ps=conn.prepareStatement(sql); // 오라클로 전송
// ?에 값을 채운다
ps.setString(1, id);
// 실행요청
ResultSet rs=ps.executeQuery();
rs.next(); // 실제 출력위치에 커서를 이동한다
int count=rs.getInt(1);
rs.close();
if(count==0)
{
result="NOID";
}
else
{
// 요청
sql="SELECT * FROM member WHERE id=?";
ps=conn.prepareStatement(sql);// 전송
ps.setString(1, id);// 실행전에 ?에 값을 채운다
rs=ps.executeQuery();// 실행
rs.next();
// 값을 받는다
String mid=rs.getString(1);
String mpwd=rs.getString(2);
String name=rs.getString(3);
String sex=rs.getString(4);
int avata=rs.getInt(5);
System.out.println(name+" "+sex);
rs.close();
if(mpwd.equals(pwd))
{
// 로그인
result=mid+"|"+name+"|"+sex+"|"+avata;
}
else
{
// 비밀번호가 틀리다
result="NOPWD";
}
/*
* String name="";
* String sex="";
* String id="";
* int age=10;
* VARCHAR
* sql="INSERT INTO member VALUES('"+name+"','"+sex
* +"','"+id+"',"+age+")"
* sql="INSERT INTO member VALUES(?,?,?,?)"
*/
}
}catch(Exception ex)
{
System.out.println(ex.getMessage());
}
// CREATE ....(avata NUMBER)
/*
* INSERT INTO ~~ ( '남자',1) m1,m2...
* "C:\\image\\m"+no+".png"
*/
finally
{
// 연결 해제
disConnection();
}
return result;
}
}
| [
"vcandjava@nate.com"
] | vcandjava@nate.com |
f404b0ba4f8cfc514d0d8228c7d455c87a866aab | 6e0fe0c6b38e4647172259d6c65c2e2c829cdbc5 | /modules/base/dvcs-api/src/main/java/com/intellij/dvcs/push/PushSpec.java | 1dff187d6ad233dce1d8c37fe61881724660cbef | [
"Apache-2.0",
"LicenseRef-scancode-jgraph"
] | permissive | TCROC/consulo | 3f9a6df84e0fbf2b6211457b8a5f5857303b3fa6 | cda24a03912102f916dc06ffce052892a83dd5a7 | refs/heads/master | 2023-01-30T13:19:04.216407 | 2020-12-06T16:57:00 | 2020-12-06T16:57:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,195 | java | /*
* Copyright 2000-2014 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.dvcs.push;
import javax.annotation.Nonnull;
/**
* For a single repository, specifies what is pushed and where.
*/
public class PushSpec<S extends PushSource, T extends PushTarget> {
@Nonnull
private S mySource;
@Nonnull
private T myTarget;
public PushSpec(@Nonnull S source, @Nonnull T target) {
mySource = source;
myTarget = target;
}
@Nonnull
public S getSource() {
return mySource;
}
@Nonnull
public T getTarget() {
return myTarget;
}
@Override
public String toString() {
return mySource + "->" + myTarget;
}
}
| [
"vistall.valeriy@gmail.com"
] | vistall.valeriy@gmail.com |
1c8149b7ff3d94c7d510cfd4eb85673334a34ab0 | 208ba847cec642cdf7b77cff26bdc4f30a97e795 | /ej/ei/src/main/java/org.wp.ei/util/ProfilingUtils.java | 975307a82de542738042ec82e0e103ef9aa67ede | [] | no_license | kageiit/perf-android-large | ec7c291de9cde2f813ed6573f706a8593be7ac88 | 2cbd6e74837a14ae87c1c4d1d62ac3c35df9e6f8 | refs/heads/master | 2021-01-12T14:00:19.468063 | 2016-09-27T13:10:42 | 2016-09-27T13:10:42 | 69,685,305 | 0 | 0 | null | 2016-09-30T16:59:49 | 2016-09-30T16:59:48 | null | UTF-8 | Java | false | false | 2,154 | java | package org.wp.ei.util;
import android.os.SystemClock;
import org.wp.ei.util.AppLog.T;
import java.util.ArrayList;
/**
* forked from android.util.TimingLogger to use AppLog instead of Log + new static interface.
*/
public class ProfilingUtils {
private static ProfilingUtils sInstance;
private String mLabel;
private ArrayList<Long> mSplits;
private ArrayList<String> mSplitLabels;
public static void start(String label) {
getInstance().reset(label);
}
public static void split(String splitLabel) {
getInstance().addSplit(splitLabel);
}
public static void dump() {
getInstance().dumpToLog();
}
public static void stop() {
getInstance().reset(null);
}
private static ProfilingUtils getInstance() {
if (sInstance == null) {
sInstance = new ProfilingUtils();
}
return sInstance;
}
public ProfilingUtils() {
reset("init");
}
public void reset(String label) {
mLabel = label;
reset();
}
public void reset() {
if (mSplits == null) {
mSplits = new ArrayList<Long>();
mSplitLabels = new ArrayList<String>();
} else {
mSplits.clear();
mSplitLabels.clear();
}
addSplit(null);
}
public void addSplit(String splitLabel) {
if (mLabel == null) {
return;
}
long now = SystemClock.elapsedRealtime();
mSplits.add(now);
mSplitLabels.add(splitLabel);
}
public void dumpToLog() {
if (mLabel == null) {
return;
}
AppLog.d(T.PROFILING, mLabel + ": begin");
final long first = mSplits.get(0);
long now = first;
for (int i = 1; i < mSplits.size(); i++) {
now = mSplits.get(i);
final String splitLabel = mSplitLabels.get(i);
final long prev = mSplits.get(i - 1);
AppLog.d(T.PROFILING, mLabel + ": " + (now - prev) + " ms, " + splitLabel);
}
AppLog.d(T.PROFILING, mLabel + ": end, " + (now - first) + " ms");
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
57acfba8d88be7a7c81cc998b46150caacd8a7c4 | f7f9d7fa841e856927e02513ecc74dc00c935f8a | /server/src/main/java/org/codelibs/fesen/gateway/Gateway.java | 61600f59b1d070ddb22ac55c4a2da5e6ce5baf49 | [
"CDDL-1.0",
"MIT",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LGPL-2.1-only",
"NAIST-2003",
"LicenseRef-scancode-generic-export-compliance",
"ICU",
"SunPro",
"Python-2.0",
"CC-BY-SA-3.0",
"MPL-1.1",
"GPL-2.0-only",
"CPL-1.0",
"LicenseRef-scancode-other-copyleft",
"Apache-2.0",
"LicenseRef... | permissive | codelibs/fesen | 3f949fd3533e8b25afc3d3475010d1b1a0d95c09 | b2440fbda02e32f7abe77d2be95ead6a16c8af06 | refs/heads/main | 2022-07-27T21:14:02.455938 | 2021-12-21T23:54:20 | 2021-12-21T23:54:20 | 330,334,670 | 4 | 0 | Apache-2.0 | 2022-05-17T01:54:31 | 2021-01-17T07:07:56 | Java | UTF-8 | Java | false | false | 6,202 | java | /*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.codelibs.fesen.gateway;
import com.carrotsearch.hppc.ObjectFloatHashMap;
import com.carrotsearch.hppc.cursors.ObjectCursor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.codelibs.fesen.action.FailedNodeException;
import org.codelibs.fesen.cluster.ClusterState;
import org.codelibs.fesen.cluster.metadata.IndexMetadata;
import org.codelibs.fesen.cluster.metadata.Metadata;
import org.codelibs.fesen.cluster.service.ClusterService;
import org.codelibs.fesen.common.settings.Settings;
import org.codelibs.fesen.discovery.zen.ElectMasterService;
import org.codelibs.fesen.index.Index;
import java.util.Arrays;
import java.util.function.Function;
public class Gateway {
private static final Logger logger = LogManager.getLogger(Gateway.class);
private final ClusterService clusterService;
private final TransportNodesListGatewayMetaState listGatewayMetaState;
private final int minimumMasterNodes;
public Gateway(final Settings settings, final ClusterService clusterService,
final TransportNodesListGatewayMetaState listGatewayMetaState) {
this.clusterService = clusterService;
this.listGatewayMetaState = listGatewayMetaState;
this.minimumMasterNodes = ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING.get(settings);
}
public void performStateRecovery(final GatewayStateRecoveredListener listener) throws GatewayException {
final String[] nodesIds = clusterService.state().nodes().getMasterNodes().keys().toArray(String.class);
logger.trace("performing state recovery from {}", Arrays.toString(nodesIds));
final TransportNodesListGatewayMetaState.NodesGatewayMetaState nodesState = listGatewayMetaState.list(nodesIds, null).actionGet();
final int requiredAllocation = Math.max(1, minimumMasterNodes);
if (nodesState.hasFailures()) {
for (final FailedNodeException failedNodeException : nodesState.failures()) {
logger.warn("failed to fetch state from node", failedNodeException);
}
}
final ObjectFloatHashMap<Index> indices = new ObjectFloatHashMap<>();
Metadata electedGlobalState = null;
int found = 0;
for (final TransportNodesListGatewayMetaState.NodeGatewayMetaState nodeState : nodesState.getNodes()) {
if (nodeState.metadata() == null) {
continue;
}
found++;
if (electedGlobalState == null) {
electedGlobalState = nodeState.metadata();
} else if (nodeState.metadata().version() > electedGlobalState.version()) {
electedGlobalState = nodeState.metadata();
}
for (final ObjectCursor<IndexMetadata> cursor : nodeState.metadata().indices().values()) {
indices.addTo(cursor.value.getIndex(), 1);
}
}
if (found < requiredAllocation) {
listener.onFailure("found [" + found + "] metadata states, required [" + requiredAllocation + "]");
return;
}
// update the global state, and clean the indices, we elect them in the next phase
final Metadata.Builder metadataBuilder = Metadata.builder(electedGlobalState).removeAllIndices();
assert !indices.containsKey(null);
final Object[] keys = indices.keys;
for (int i = 0; i < keys.length; i++) {
if (keys[i] != null) {
final Index index = (Index) keys[i];
IndexMetadata electedIndexMetadata = null;
int indexMetadataCount = 0;
for (final TransportNodesListGatewayMetaState.NodeGatewayMetaState nodeState : nodesState.getNodes()) {
if (nodeState.metadata() == null) {
continue;
}
final IndexMetadata indexMetadata = nodeState.metadata().index(index);
if (indexMetadata == null) {
continue;
}
if (electedIndexMetadata == null) {
electedIndexMetadata = indexMetadata;
} else if (indexMetadata.getVersion() > electedIndexMetadata.getVersion()) {
electedIndexMetadata = indexMetadata;
}
indexMetadataCount++;
}
if (electedIndexMetadata != null) {
if (indexMetadataCount < requiredAllocation) {
logger.debug("[{}] found [{}], required [{}], not adding", index, indexMetadataCount, requiredAllocation);
} // TODO if this logging statement is correct then we are missing an else here
metadataBuilder.put(electedIndexMetadata, false);
}
}
}
ClusterState recoveredState = Function.<ClusterState>identity()
.andThen(state -> ClusterStateUpdaters.upgradeAndArchiveUnknownOrInvalidSettings(state, clusterService.getClusterSettings()))
.apply(ClusterState.builder(clusterService.getClusterName()).metadata(metadataBuilder).build());
listener.onSuccess(recoveredState);
}
public interface GatewayStateRecoveredListener {
void onSuccess(ClusterState build);
void onFailure(String s);
}
}
| [
"shinsuke@apache.org"
] | shinsuke@apache.org |
4657570972c04b149c9d9321d0296770ff7c409a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/29/29_f69eb2e3f5c008ec4ad2ffdebaf66062adb2062a/UpdateRecentDataTask/29_f69eb2e3f5c008ec4ad2ffdebaf66062adb2062a_UpdateRecentDataTask_s.java | f4d6d26af99577d1f279623a3f6cc62571fa5790 | [] | 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 | 4,681 | java | /*
* Copyright (C) 2007 The Android Open Source Project
*
* 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 net.redgeek.android.eventrend.backgroundtasks;
import java.util.Calendar;
import net.redgeek.android.eventrend.db.EntryDbTable;
import net.redgeek.android.eventrend.primitives.Datapoint;
import net.redgeek.android.eventrend.primitives.TimeSeries;
import net.redgeek.android.eventrend.primitives.TimeSeriesCollector;
import net.redgeek.android.eventrend.util.DateUtil;
import net.redgeek.android.eventrend.util.DateUtil.Period;
/**
* Task to perform one or both of the two actions:
* <ul>
* <li>Zero-fill any periods for a category, or all categories, that have no
* entries since the last entry.
* <li>Fetch the recent history for a category, or all categories, calculate the
* new trend, and store the results.
* </ul>
*
* <p>
* If both actions are to be performed, the actions are performed in the order
* listed above, so that the zeros can be taken into account when calculating
* the new trend.
*
* <p>
* Note that since this is "backgroundtask", no UI operations may be performed.
*
* @author barclay
*
*/
public class UpdateRecentDataTask {
private TimeSeriesCollector mTSC;
private Calendar mCal;
private int mHistory;
private boolean mZerofill;
private boolean mUpdateTrend;
public UpdateRecentDataTask(TimeSeriesCollector tsc, int history) {
mTSC = tsc;
mCal = Calendar.getInstance();
mHistory = history;
mZerofill = false;
mUpdateTrend = false;
}
public void setZerofill(boolean b) {
mZerofill = b;
}
public void setUpdateTrend(boolean b) {
mUpdateTrend = b;
}
public void fillAllCategories() {
for (int i = 0; i < mTSC.numSeries(); i++) {
fillCategory(mTSC.getSeries(i).getDbRow().getId(), mZerofill,
mUpdateTrend);
}
return;
}
public void fillCategory(long catId) {
fillCategory(catId, mZerofill, mUpdateTrend);
return;
}
private void fillCategory(long catId, boolean zerofill,
boolean updateTrend) {
EntryDbTable.Row entry = new EntryDbTable.Row();
if (zerofill == false && updateTrend == true) {
// quick check to see if we need to update trends only...
mTSC.updateCategoryTrend(catId);
return;
}
TimeSeries ts = mTSC.getSeriesByIdLocking(catId);
if (ts.getDbRow().getZeroFill() == false)
return;
mTSC.gatherLatestDatapointsLocking(catId, mHistory);
Datapoint d = mTSC.getLastDatapoint(catId);
if (d == null)
return;
long periodMs = ts.getDbRow().getPeriodMs();
long now = System.currentTimeMillis();
mCal.setTimeInMillis(d.mMillis);
while (mCal.getTimeInMillis() + periodMs < now) {
if (periodMs == DateUtil.HOUR_MS) {
DateUtil.setToPeriodStart(mCal, Period.HOUR);
mCal.add(Calendar.HOUR, 1);
} else if (periodMs == DateUtil.AMPM_MS) {
DateUtil.setToPeriodStart(mCal, Period.AMPM);
mCal.add(Calendar.HOUR, 12);
} else if (periodMs == DateUtil.DAY_MS) {
DateUtil.setToPeriodStart(mCal, Period.DAY);
mCal.add(Calendar.DAY_OF_MONTH, 1);
} else if (periodMs == DateUtil.WEEK_MS) {
DateUtil.setToPeriodStart(mCal, Period.WEEK);
mCal.add(Calendar.WEEK_OF_YEAR, 1);
} else if (periodMs == DateUtil.MONTH_MS) {
DateUtil.setToPeriodStart(mCal, Period.MONTH);
mCal.add(Calendar.MONTH, 1);
} else if (periodMs == DateUtil.QUARTER_MS) {
DateUtil.setToPeriodStart(mCal, Period.QUARTER);
mCal.add(Calendar.MONTH, 3);
} else if (periodMs == DateUtil.YEAR_MS) {
DateUtil.setToPeriodStart(mCal, Period.YEAR);
mCal.add(Calendar.YEAR, 1);
}
entry.setCategoryId(catId);
entry.setTimestamp(mCal.getTimeInMillis());
entry.setValue(0.0f);
entry.setNEntries(0);
mTSC.getDbh().createEntry(entry);
}
if (updateTrend == true)
mTSC.updateCategoryTrend(entry.getCategoryId());
return;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.