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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
df9084df47647169410975933544a5074e24a4d1 | e587c46b88f34b037ed53307aaaf1e6283713093 | /plugins/au.gov.ga.earthsci.worldwind/src/au/gov/ga/earthsci/worldwind/common/util/MapBackedNamespaceContext.java | 6449a027d8cbe43b4caeda99bb78ca4485f78787 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | GeoscienceAustralia/earthsci | 1fe97deeae176eca836499b4854589a474dd5e89 | d44f448f992536c971ac4721ee550021dcea4543 | refs/heads/master | 2022-09-04T13:40:51.102793 | 2022-08-03T07:10:45 | 2022-08-03T07:10:45 | 6,183,254 | 51 | 30 | null | 2022-06-21T03:30:15 | 2012-10-12T00:46:12 | Java | UTF-8 | Java | false | false | 1,927 | java | /*******************************************************************************
* Copyright 2012 Geoscience Australia
*
* 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 au.gov.ga.earthsci.worldwind.common.util;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.xml.XMLConstants;
import javax.xml.namespace.NamespaceContext;
/**
* A simple implementation of the {@link NamespaceContext} that maintains a map of prefix->URI mappings
*
* @author James Navin (james.navin@ga.gov.au)
*/
public class MapBackedNamespaceContext implements NamespaceContext
{
private Map<String, String> prefixToUriMap = new HashMap<String, String>();
private Map<String, String> uriToPrefixMap = new HashMap<String, String>();
public void addMapping(String prefix, String uri)
{
prefixToUriMap.put(prefix, uri);
uriToPrefixMap.put(uri, prefix);
}
@Override
public String getNamespaceURI(String prefix)
{
String result = prefixToUriMap.get(prefix);
if (result != null)
{
return result;
}
return XMLConstants.NULL_NS_URI;
}
@Override
public String getPrefix(String namespaceURI)
{
return uriToPrefixMap.get(namespaceURI);
}
@SuppressWarnings("rawtypes")
@Override
public Iterator getPrefixes(String namespaceURI)
{
return prefixToUriMap.keySet().iterator();
}
}
| [
"michael.dehoog@ga.gov.au"
] | michael.dehoog@ga.gov.au |
f20a53d10896677f686d03d40de7200319fb3c9b | 41b5626593f86fe60035fdaae236edf2c9352926 | /roncoo-education-user/roncoo-education-user-service/src/main/java/com/roncoo/education/user/common/bo/UserRegionLevelBO.java | 693dc9927f0842aea54b4ee1573c2aa0c192c0ad | [
"MIT"
] | permissive | chenhaoaixuexi/cloudCourse | 5b662a822108efa70606c06e590870a9aa6dbbe7 | eafac97da0a08d7a3245aef2a248778d963c1997 | refs/heads/master | 2023-04-06T11:30:58.368217 | 2020-04-08T05:10:53 | 2020-04-08T05:10:53 | 253,463,242 | 0 | 0 | MIT | 2023-03-27T22:19:49 | 2020-04-06T10:22:05 | Java | UTF-8 | Java | false | false | 598 | java | /**
* Copyright 2015-现在 广州市领课网络科技有限公司
*/
package com.roncoo.education.user.common.bo;
import java.io.Serializable;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* <p>
* 用户基本信息
* </p>
*
* @author wujing123
*/
@Data
@Accessors(chain = true)
public class UserRegionLevelBO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 级别
*/
@ApiModelProperty(value = "级别", required = true)
private Integer level;
}
| [
"chen@LAPTOP-0BE253LS.localdomain"
] | chen@LAPTOP-0BE253LS.localdomain |
c940af5c3485badbbab8036e3a702a333ca793fe | 0c993ac3c8ac60aa0765561530959feb9847c0a3 | /JavaAlgorithms/src/lesson_1/Test.java | 542f8690b2ab4f3b5eaafca0cd28637be3a5cc79 | [] | no_license | D1mkaGit/GeekBrains | 0b96bb871b70708e6ad3f8f7ca74ad3908d9205e | a638f697e3380c2c1461156fa8b8153f825f220e | refs/heads/master | 2023-04-06T06:47:20.423827 | 2022-12-25T19:31:18 | 2022-12-25T19:31:18 | 221,762,240 | 1 | 1 | null | 2023-03-24T01:17:50 | 2019-11-14T18:30:42 | Java | UTF-8 | Java | false | false | 6,061 | java | package lesson_1;
public class Test {
// public static void main(String[] args) {
// System.out.println(1%2 == 1);
// }
// public static void main(String[] args) {
// {
// int i = 20;
// }
// int i = 15;
//
// System.out.println(i);
// }
}
//1 Какой будет результат выполнения следующего кода
//
//
// а) true
// b) false
// c) 1
// d) Ошибка компиляции
//
//
// 2 Какой будет результат выполнения следующего кода
//
// String str = "abc";
//
// switch (str) {
// case "ab":
// System.out.println("ab");
// case "abc":
// System.out.println("abc");
// default:
// System.out.println("break");
// case "abcd":
// System.out.println("abcd");
// }
//
// а) abc
// b) abc break abcd
// c) abc abcd
// d) Ошибка компиляции
//
//
// 3 Какой будет результат выполнения следующего кода
//
// public static void main(String[] args) {
// {
// int i = 20;
// }
// int i = 15;
//
// System.out.println(i);
// }
//
// а) 15
// b) 20
// c) Ошибка компиляции
//
//
//
// 4 Какой будет результат выполнения следующего кода
//
//class Test44 {
// public static void main(String[] args) {
// for (int i = 0; i < 5; i += 2) {
// System.out.println(i++);
// }
// }
//}
//public static void main(String[] args) {
// for (int i = 0; i < 5; i+=2) {
// System.out.println(i++);
// }
// }
//
// а) 0 2 4
// b) 2 5
// c) 0 3
// d) 3
//
// 5 Какой будет результат выполнения следующего кода
//
//public static void main(String[] args) {
// float d = 12.3;
// System.out.println(d);
// }
//
// а) 12.3
// b) 12
// c) Ошибка при компиляции
// d) Ошибка при выполнении
//
// 6 Какой будет результат выполнения следующего кода
//
//class Test66 {
// public static void main(String[] args) {
// int i = 2;
//
// do {
// System.out.println(++i);
// } while (i == 3);
// }
//}
//public static void main(String[] args) {
// int i = 2;
//
// do {
// System.out.println(++i);
// } while (i == 3);
// }
//
// а) 3 4
// b) 3
// c) ничего
// d) Ошибка компиляции
//
//
//
//
//
//
//
//
//
//
//
//
//
// 7 Какой будет результат выполнения следующего кода
//
//public static void main(String[] args) {
// int a = 1;
// int b = 2;
// c = a + b;
// System.out.println(c);
// }
//
// а) 3
// b) "3"
// c) Ошибка компиляции
//
//
// 8 Какой будет результат выполнения следующего кода
//
//public static void main(String[] args) {
// char d2 = “Java”;
// System.out.println(d2);
// }
//
//
// а) Java
// b) d2
// c) Ошибка компиляции
//
// 9 Какой будет результат выполнения следующего кода
//
//public static void main(String[] args) {
// int x = 20;
// String y = “my var: “;
// x *= x;
// System.out.println(x + y);
// }
//
// а) 400my var:
// b) my var 400
// c) Ошибка компиляции
//
// 10 Какой будет результат выполнения следующего кода
//
//public static void main(String[] args) {
// System.out.println(9/0);
// }
//
// а) Nan
// b) Ошибка при выполнении кода
// c) Ошибка компиляции
///////// 1
//interface I1 {
// void copy() throws IOException;
//}
//
//interface I2 {
// void copy() throws FileNotFoundException;
//}
//
//
//class A implements I1, I2 {
//
// // вопрос: какие исключения нужно использовать и нужно ли?
// @Override
// public void copy() {
//
// }
//}
//////////// 2
class Main {
public static void main(String[] args) {
System.out.print(Values.A);
}
}
enum Values {
A(1), B(2), C(3);
Values(int i) {
System.out.print(i);
}
static {
System.out.print("static");
}
}
////////// какой будет результат
class equalsLong {
public static void main(String[] args) {
Long a = 120L;
Long b = 120L;
Long c = 222L;
Long d = 222L;
System.out.println(a == b);
System.out.println(c == d);
}
}
class Test4{
// public static void main(String[] args) {
// System.out.println(11/0);
// }
// public static void main(String[] args) {
// double d1 = 11./0;
// double d2 = 15./0;
// System.out.println(d1);
// System.out.println(d2);
// System.out.println(d1 - d2);
// }
}
//
// public static void main(String[] args) {
// System.out.println(11/0);
// }
//
// public static void main(String[] args) {
// double d1 = 11./0;
// double d2 = 15./0;
// System.out.println(d1);
// System.out.println(d2);
// System.out.println(d1 - d2);
// } | [
"30922998+D1mkaGit@users.noreply.github.com"
] | 30922998+D1mkaGit@users.noreply.github.com |
13be9944c61b43ba887041784b5cadb236f763d4 | 9ac44c1a03bc097702ac2d492e21b22ffa09652e | /src/main/java/com/github/bingoohuang/springboottrial/service/BookService.java | b2e0013bb0f001c038c5f80f6c316db9aa21135e | [
"MIT"
] | permissive | bingoohuang/springboot15demo | b2f24e297457f43f692bb006a6e9de829564f8c9 | f0733a3667bebf0db8a0fe1393977df4e701aef0 | refs/heads/master | 2022-06-26T02:08:38.840084 | 2019-07-22T05:22:34 | 2019-07-22T05:22:34 | 195,940,142 | 0 | 0 | MIT | 2022-06-17T02:20:59 | 2019-07-09T05:42:40 | Java | UTF-8 | Java | false | false | 1,272 | java | package com.github.bingoohuang.springboottrial.service;
import com.github.bingoohuang.springboottrial.entity.Book;
import com.github.bingoohuang.springboottrial.repository.BookRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.List;
@Service
public class BookService {
@Autowired
private BookRepository repository;
@PostConstruct
public void initBooks() {
List<Book> books = new ArrayList<>();
books.add(new Book("101", "The Science of Marvel",
"22-12-2017", new String[]{"Sebastian"},
"Infinity Stones"));
books.add(new Book("102", "The Sixth Extinction",
"22-12-2017", new String[]{"Sebastian", "Elizabeth"},
"Infinity Stones"));
books.add(new Book("103", "The Science of Marvel -2",
"22-12-2019", new String[]{"Sebastian"},
"Infinity Stones"));
repository.save(books);
}
public List<Book> findAllBooks() {
return repository.findAll();
}
public Book findBookById(String movieId) {
return repository.findOne(movieId);
}
}
| [
"bingoo.huang@gmail.com"
] | bingoo.huang@gmail.com |
358053bf49d32d4e59b1fe5554e1364f90ba75e5 | dc25b23f8132469fd95cee14189672cebc06aa56 | /vendor/mediatek/proprietary/packages/apps/RCSe/RcsStack/src/com/orangelabs/rcs/core/ims/protocol/rtp/codec/video/h264/profiles/H264Profile1_2.java | 0dee89bec14fea52addaaf0c9dadc97a3badb8ad | [
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | nofearnohappy/alps_mm | b407d3ab2ea9fa0a36d09333a2af480b42cfe65c | 9907611f8c2298fe4a45767df91276ec3118dd27 | refs/heads/master | 2020-04-23T08:46:58.421689 | 2019-03-28T21:19:33 | 2019-03-28T21:19:33 | 171,048,255 | 1 | 5 | null | 2020-03-08T03:49:37 | 2019-02-16T20:25:00 | Java | UTF-8 | Java | false | false | 2,655 | java | /*******************************************************************************
* Software Name : RCS IMS Stack
*
* Copyright (C) 2010 France Telecom S.A.
*
* 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.orangelabs.rcs.core.ims.protocol.rtp.codec.video.h264.profiles;
import com.orangelabs.rcs.core.ims.protocol.rtp.codec.video.h264.H264Config;
import com.orangelabs.rcs.core.ims.protocol.rtp.codec.video.h264.JavaPacketizer;
/**
* Represent H264 Profile to Level 1.2
*
* @author Deutsche Telekom AG
*/
public class H264Profile1_2 extends H264Profile {
/**
* Profile name
*/
public static final String PROFILE_NAME = "H264Profile1.2";
/**
* Profile Id
* 42 (Baseline 66), 80 (Constrained Baseline), 0c (level 1.2)
*/
public static final String BASELINE_PROFILE_ID = "42800c";
private static final int BASELINE_PROFILE_BITRATE = 384000;
// private static final int HIGH_PROFILE_BITRATE = 480000;
private static final String base64CodeSPS = "J0KADJY1BYnI"; // QCIF
// static final String base64CodeSPS = "J0KADJo1AoPy"; // QVGA
private static final String base64CodePPS = "KM4C/IA="; // QCIF
// static final String base64CodePPS = "KM4C/IA="; // QVGA
private static String profileParams;
static {
profileParams = H264Config.CODEC_PARAM_PROFILEID + "=" + BASELINE_PROFILE_ID + ";" +
H264Config.CODEC_PARAM_PACKETIZATIONMODE + "=1;" +
H264Config.CODEC_PARAM_SPROP_PARAMETER_SETS + "=" +
base64CodeSPS + "," + base64CodePPS + ";";
}
/**
* Constructor
*/
public H264Profile1_2() {
super(PROFILE_NAME,
H264TypeLevel.LEVEL_1_2,
H264TypeProfile.PROFILE_BASELINE,
BASELINE_PROFILE_ID,
176, 144, 15.0f, // QCIF
// 320, 240, 20.0f, // QVGA
BASELINE_PROFILE_BITRATE,
JavaPacketizer.H264_MAX_PACKET_FRAME_SIZE,
profileParams);
}
}
| [
"fetpoh@mail.ru"
] | fetpoh@mail.ru |
b72acb3d9e615234a3be1f850c0c7e4a4bc7cffe | 747766676a6392701caa94a204ce5e8eb24fa6af | /src/main/java/apps/sharer/message/processors/EnabledMessageProcessor.java | 3c2d44c294dda5cb053b22e0e9d7254d41b7d347 | [] | no_license | jonathanKing12/app-sharer | fcabb23470fa17bcb7ba1efafae1749fdb04f331 | db44ce96b14ad0d649105fde25112c8a175c2caa | refs/heads/master | 2021-01-01T04:25:37.097198 | 2016-05-14T17:16:59 | 2016-05-14T17:16:59 | 57,596,437 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package apps.sharer.message.processors;
import apps.sharer.message.EnableMessage;
import apps.sharer.message.Message;
import apps.sharer.model.Model;
import apps.sharer.user.User;
public class EnabledMessageProcessor implements MessageProcessor {
private final Model model;
public EnabledMessageProcessor(final Model model) {
this.model = model;
}
@Override
public Message processMessage(final Message message) {
EnableMessage enableMessage = (EnableMessage) message;
User user = model.getUser(enableMessage.getUsername());
user.setUserEnabledHost(true);
return null;
}
}
| [
"you@example.com"
] | you@example.com |
edc03dfe28b032b17f5287b0a2841cc5fb0abda8 | df47c2c7af26983898a2ba3827a814672a9bf145 | /src/main/java/firefly/sms/config/SwaggerConfig.java | c47d3b06ded3f78a7697771f0c71ce6bd8cb8717 | [] | no_license | Fierygit/SMS | cfa76023f0f9e917786f211e26e122348a6f7495 | 709c96e28a9e73d7ee6ff0b8afca6af3ef8fe61c | refs/heads/master | 2022-09-21T02:47:28.940017 | 2020-06-06T08:21:51 | 2020-06-06T08:21:51 | 269,252,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 818 | java | package firefly.sms.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
/**
* @author Firefly
* @version 1.0
* @date 2020/6/4 11:13
*/
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.select()
.apis(RequestHandlerSelectors.any())
.paths(PathSelectors.any())
.build();
}
} | [
"531109985@qq.com"
] | 531109985@qq.com |
9974127e686a2b3883b2459f0f756af49f870d30 | 95a54e3f3617bf55883210f0b5753b896ad48549 | /java_src/kotlinx/coroutines/JobCancellingNode.java | 2f90a415a9a83e2c85d31a4aa04eeae9197115b3 | [] | no_license | aidyk/TagoApp | ffc5a8832fbf9f9819f7f8aa7af29149fbab9ea5 | e31a528c8f931df42075fc8694754be146eddc34 | refs/heads/master | 2022-12-22T02:20:58.486140 | 2021-05-16T07:42:02 | 2021-05-16T07:42:02 | 325,695,453 | 3 | 1 | null | 2022-12-16T00:32:10 | 2020-12-31T02:34:45 | Smali | UTF-8 | Java | false | false | 1,014 | java | package kotlinx.coroutines;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;
import kotlinx.coroutines.Job;
import org.jetbrains.annotations.NotNull;
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\b \u0018\u0000*\n\b\u0000\u0010\u0001 \u0001*\u00020\u00022\b\u0012\u0004\u0012\u0002H\u00010\u0003B\r\u0012\u0006\u0010\u0004\u001a\u00028\u0000¢\u0006\u0002\u0010\u0005¨\u0006\u0006"}, d2 = {"Lkotlinx/coroutines/JobCancellingNode;", "J", "Lkotlinx/coroutines/Job;", "Lkotlinx/coroutines/JobNode;", "job", "(Lkotlinx/coroutines/Job;)V", "kotlinx-coroutines-core"}, k = 1, mv = {1, 1, 13})
/* compiled from: JobSupport.kt */
public abstract class JobCancellingNode<J extends Job> extends JobNode<J> {
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public JobCancellingNode(@NotNull J j) {
super(j);
Intrinsics.checkParameterIsNotNull(j, "job");
}
}
| [
"ai@AIs-MacBook-Pro.local"
] | ai@AIs-MacBook-Pro.local |
15114a7a20d812c483e96be9247b1f5c85c39b45 | 55f49873b2281da14d6e6d106de4b87a86a9129e | /Tool-My/SystemTool/src/test/java/xdean/tool/sys/other/TestCustomCommandTool.java | dc40cd85228610472ecfc585a8b4d5c801212ea0 | [
"Apache-2.0"
] | permissive | XDean/ExtendableTool | 1699a19507cdc052b375ba4607c034d94b6306f8 | cb9410fdb696b480d956b64ac69e9fc1a19431e4 | refs/heads/master | 2021-06-10T18:13:18.099884 | 2021-03-18T03:16:37 | 2021-03-18T03:16:37 | 90,104,910 | 0 | 0 | Apache-2.0 | 2021-03-18T03:16:38 | 2017-05-03T03:37:23 | Java | UTF-8 | Java | false | false | 641 | java | package xdean.tool.sys.other;
import io.reactivex.Flowable;
import org.junit.Test;
public class TestCustomCommandTool {
@Test
public void testSplitCommand() {
assertSplit("1 2 3", "1", "2", "3");
assertSplit("1 \"2 3\"", "1", "\"2 3\"");
assertSplit("1 \\\\", "1", "\\\\");
assertSplit("1 \"2 \\\"3\"", "1", "\"2 \\\"3\"");
assertSplit("\\ \\\" \"\\ \\ \"", "\\", "\\\"", "\"\\ \\ \"");
}
private void assertSplit(String command, String... answer) {
Flowable.fromArray(CustomCommandTool.split(command))
.test()
.assertValues(answer);
System.out.println();
}
}
| [
"373216024@qq.com"
] | 373216024@qq.com |
04379b90bf3fda42330c126cab27be015749ebf7 | 88f036937e330c5c111df0aa681f8a6339bdb644 | /src/main/java/org/openstack4j/openstack/compute/domain/MetaDataWrapper.java | bb935f471134e908dd215c9af610b70500a660b3 | [
"MIT"
] | permissive | esasisa/openstack4j | 00009c5120383802ea4e3ae55decaba840c4e893 | 5554f598ada64517689e8a300a96a189871187cc | refs/heads/master | 2020-12-24T17:54:41.138406 | 2014-07-23T07:27:30 | 2014-07-23T07:27:30 | 22,135,650 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 894 | java | package org.openstack4j.openstack.compute.domain;
import java.util.Map;
import org.codehaus.jackson.annotate.JsonProperty;
import org.openstack4j.model.ModelEntity;
/**
* A Wrapper for Rest calls to set/update Meta Data
*
* @author Jeremy Unruh
*/
public class MetaDataWrapper implements ModelEntity {
private static final long serialVersionUID = 1L;
@JsonProperty("metadata")
Map<String, String> metadata;
public MetaDataWrapper() { }
private MetaDataWrapper(Map<String, String> metadata) {
this.metadata = metadata;
}
/**
* Wraps the given MetaData map into the wrapper
*
* @param metadata the metadata
* @return the meta data wrapper
*/
public static MetaDataWrapper wrap(Map<String, String> metadata) {
return new MetaDataWrapper(metadata);
}
/**
* @return the meta data
*/
public Map<String, String> getMetaData() {
return metadata;
}
}
| [
"jeremyunruh@sbcglobal.net"
] | jeremyunruh@sbcglobal.net |
a05038b14731c6067af931e9fce4b1cf0bba2c10 | dfb9a72f22b6ff4a70df533c595c34ac3c1d46f2 | /spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/ribbon/RestClientRibbonConfiguration.java | 0e597fa90c56199dee29756ec4ca7a326df57297 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | songshuiyang/spring-cloud-netflix-1.4.3.RELEASE | 4ca3351acadce250a93fc95ba26f8221c2e806c3 | 1e7e68223502ddbe937a1448c3656fdcddc7ed3f | refs/heads/master | 2022-12-22T23:55:09.053974 | 2019-08-19T05:22:16 | 2019-08-19T05:22:16 | 201,168,472 | 0 | 0 | Apache-2.0 | 2022-12-12T21:41:43 | 2019-08-08T03:10:38 | Java | UTF-8 | Java | false | false | 2,624 | java | /*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.springframework.cloud.netflix.ribbon;
import com.netflix.client.AbstractLoadBalancerAwareClient;
import com.netflix.client.RetryHandler;
import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.niws.client.http.RestClient;
import com.netflix.servo.monitor.Monitors;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
/**
* @author Spencer Gibb
*/
@SuppressWarnings("deprecation")
@Configuration
@RibbonAutoConfiguration.ConditionalOnRibbonRestClient
class RestClientRibbonConfiguration {
@Value("${ribbon.client.name}")
private String name = "client";
/**
* Create a Netflix {@link RestClient} integrated with Ribbon if none already exists
* in the application context. It is not required for Ribbon to work properly and is
* therefore created lazily if ever another component requires it.
*
* @param config the configuration to use by the underlying Ribbon instance
* @param loadBalancer the load balancer to use by the underlying Ribbon instance
* @param serverIntrospector server introspector to use by the underlying Ribbon instance
* @param retryHandler retry handler to use by the underlying Ribbon instance
* @return a {@link RestClient} instances backed by Ribbon
*/
@Bean
@Lazy
@ConditionalOnMissingBean(AbstractLoadBalancerAwareClient.class)
public RestClient ribbonRestClient(IClientConfig config, ILoadBalancer loadBalancer,
ServerIntrospector serverIntrospector, RetryHandler retryHandler) {
RestClient client = new RibbonClientConfiguration.OverrideRestClient(config, serverIntrospector);
client.setLoadBalancer(loadBalancer);
client.setRetryHandler(retryHandler);
return client;
}
}
| [
"1459074711@qq.com"
] | 1459074711@qq.com |
a3921b64daa06a674f8f5aa6128353379eb9c3d2 | 8e73325e2c99d26c1b6a8a90fa9cc69d2dc5c48a | /T_1_100/T35.java | 08741d7911aae8b3f6a9e50f19bd92970161d55a | [] | no_license | HWenTing/leetcode | 16720a986cc8da29bf34b6a4650691e74293cb64 | 7a4d5ea0ba6ecc2642bfc39d86203e54058690f0 | refs/heads/master | 2023-02-26T12:35:34.203470 | 2021-01-29T15:59:17 | 2021-01-29T15:59:17 | 197,868,512 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 884 | java | package T_1_100;
public class T35 {
// 给定一个排序数组和一个目标值,在数组中找到目标值,并返回其索引。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。
// 你可以假设数组中无重复元素。
// public int searchInsert(int[] nums, int target) {
// for(int i =0;i<nums.length;i++){
// if(target <=nums[i]){
// return i;
// }
// }
// return nums.length;
// }
// 二分法呗
public int searchInsert(int[] nums, int target) {
int left = 0;
int right = nums.length;
int mid ;
while(left<right){
mid = left + (right-left)/2;
if(nums[mid]==target) return mid;
else if(nums[mid]<target)
left = mid+1;
else
right = mid;
}
return left;
}
} | [
"982740445@qq.com"
] | 982740445@qq.com |
14f7a4e8a3b74d9994595105e2b3dd499960c804 | fa55027e10c36977b4a50946d663e15f8fe0faf7 | /src/org/wshuai/leetcode/InvalidTransactions.java | 078817c9546cd0d5b6e68662fd89ad0426de3739 | [] | no_license | relentlesscoder/Leetcode | 773a207c15ea72f6027eade8565377f11a856672 | 6b3ecd82d01739f6adb1caf86a770fcff0d6a54b | refs/heads/master | 2021-07-05T13:35:37.312910 | 2020-06-21T12:48:54 | 2020-06-21T12:48:54 | 40,448,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,105 | java | package org.wshuai.leetcode;
import java.util.*;
/**
* Created by Wei on 11/18/19.
* #1169 https://leetcode.com/problems/invalid-transactions/
*/
public class InvalidTransactions {
// pointless question
public List<String> invalidTransactions(String[] transactions) {
List<String> ans = new ArrayList();
int n = transactions.length;
if (n == 0) return ans;
String[] name = new String[n];
int[] time = new int[n];
int[] money = new int[n];
String[] city = new String[n];
boolean[] add = new boolean[n];
for (int i = 0; i < n; i++) {
String[] items = transactions[i].split(",");
name[i] = items[0];
time[i] = Integer.parseInt(items[1]);
money[i] = Integer.parseInt(items[2]);
city[i] = items[3];
}
for (int i = 0; i < n; i++) {
if (money[i] > 1000)
add[i] = true;
for (int j = i + 1; j < n; j++) {
if (name[i].equals(name[j]) && Math.abs(time[i] - time[j]) <= 60 && !city[i].equals(city[j])) {
add[i] = true;
add[j] = true;
}
}
}
for (int i = 0; i < n; i++) {
if (add[i])
ans.add(transactions[i]);
}
return ans;
}
} | [
"relentless.code@gmail.com"
] | relentless.code@gmail.com |
8d3cea48cdb006ced5a1b3f435e8a142ee587f02 | efea07f32c57c84d9c137fd9fd287f77d039d919 | /javasource/customlvnl/proxies/ImportCallCustom.java | 640d77b32e6ca060d6a24e4f801644c198fb3709 | [
"MIT"
] | permissive | McDoyen/yavasource | a4e53bb519ded49f85c8475fca7c94abf1cfdaee | fe15e7d9c3d230465583764d01daedd6157060a8 | refs/heads/master | 2021-05-07T01:22:45.391241 | 2017-11-10T11:48:54 | 2017-11-10T11:48:54 | 110,241,187 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,258 | java | // This file was generated by Mendix Modeler.
//
// WARNING: Code you write here will be lost the next time you deploy the project.
package customlvnl.proxies;
public class ImportCallCustom extends databasereplication.proxies.ImportCall
{
/**
* Internal name of this entity
*/
public static final java.lang.String entityName = "CustomLVNL.ImportCallCustom";
/**
* Enum describing members of this entity
*/
public enum MemberNames
{
InterfaceType("InterfaceType"),
ConstraintDependency("ConstraintDependency"),
ImportTable("ImportTable"),
ConstraintMode("ConstraintMode"),
RefNr("RefNr"),
ImportRefNr("ImportRefNr"),
SetReferenceToEntityOne("SetReferenceToEntityOne"),
SetReferenceToEntityTwo("SetReferenceToEntityTwo"),
ImportCall_TableMapping("DatabaseReplication.ImportCall_TableMapping"),
ImportCallOne_MxObjectType("DatabaseReplication.ImportCallOne_MxObjectType"),
ImportCalTwo_MxObjectType("DatabaseReplication.ImportCalTwo_MxObjectType"),
ImportCallOne_MxObjectReference("DatabaseReplication.ImportCallOne_MxObjectReference"),
ImportCallTwo_MxObjectReference("DatabaseReplication.ImportCallTwo_MxObjectReference");
private java.lang.String metaName;
MemberNames(java.lang.String s)
{
metaName = s;
}
@Override
public java.lang.String toString()
{
return metaName;
}
}
public ImportCallCustom(com.mendix.systemwideinterfaces.core.IContext context)
{
this(context, com.mendix.core.Core.instantiate(context, "CustomLVNL.ImportCallCustom"));
}
protected ImportCallCustom(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject importCallCustomMendixObject)
{
super(context, importCallCustomMendixObject);
if (!com.mendix.core.Core.isSubClassOf("CustomLVNL.ImportCallCustom", importCallCustomMendixObject.getType()))
throw new java.lang.IllegalArgumentException("The given object is not a CustomLVNL.ImportCallCustom");
}
/**
* @deprecated Use 'ImportCallCustom.load(IContext, IMendixIdentifier)' instead.
*/
@Deprecated
public static customlvnl.proxies.ImportCallCustom initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException
{
return customlvnl.proxies.ImportCallCustom.load(context, mendixIdentifier);
}
/**
* Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called.
* The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access).
*/
public static customlvnl.proxies.ImportCallCustom initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject)
{
return new customlvnl.proxies.ImportCallCustom(context, mendixObject);
}
public static customlvnl.proxies.ImportCallCustom load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException
{
com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier);
return customlvnl.proxies.ImportCallCustom.initialize(context, mendixObject);
}
public static java.util.List<customlvnl.proxies.ImportCallCustom> load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException
{
java.util.List<customlvnl.proxies.ImportCallCustom> result = new java.util.ArrayList<customlvnl.proxies.ImportCallCustom>();
for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//CustomLVNL.ImportCallCustom" + xpathConstraint))
result.add(customlvnl.proxies.ImportCallCustom.initialize(context, obj));
return result;
}
/**
* Set value of InterfaceType
* @param interfacetype
*/
public final customlvnl.proxies.InterfaceType getInterfaceType()
{
return getInterfaceType(getContext());
}
/**
* @param context
* @return value of InterfaceType
*/
public final customlvnl.proxies.InterfaceType getInterfaceType(com.mendix.systemwideinterfaces.core.IContext context)
{
Object obj = getMendixObject().getValue(context, MemberNames.InterfaceType.toString());
if (obj == null)
return null;
return customlvnl.proxies.InterfaceType.valueOf((java.lang.String) obj);
}
/**
* Set value of InterfaceType
* @param interfacetype
*/
public final void setInterfaceType(customlvnl.proxies.InterfaceType interfacetype)
{
setInterfaceType(getContext(), interfacetype);
}
/**
* Set value of InterfaceType
* @param context
* @param interfacetype
*/
public final void setInterfaceType(com.mendix.systemwideinterfaces.core.IContext context, customlvnl.proxies.InterfaceType interfacetype)
{
if (interfacetype != null)
getMendixObject().setValue(context, MemberNames.InterfaceType.toString(), interfacetype.toString());
else
getMendixObject().setValue(context, MemberNames.InterfaceType.toString(), null);
}
@Override
public boolean equals(Object obj)
{
if (obj == this)
return true;
if (obj != null && getClass().equals(obj.getClass()))
{
final customlvnl.proxies.ImportCallCustom that = (customlvnl.proxies.ImportCallCustom) obj;
return getMendixObject().equals(that.getMendixObject());
}
return false;
}
@Override
public int hashCode()
{
return getMendixObject().hashCode();
}
/**
* @return String name of this class
*/
public static java.lang.String getType()
{
return "CustomLVNL.ImportCallCustom";
}
/**
* @return String GUID from this object, format: ID_0000000000
* @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object.
*/
@Override
@Deprecated
public java.lang.String getGUID()
{
return "ID_" + getMendixObject().getId().toLong();
}
}
| [
"mrpoloh@yahoo.co.uk"
] | mrpoloh@yahoo.co.uk |
6313d0432d0b808cb5cc541f0b7606823a043a2f | c4623aa95fb8cdd0ee1bc68962711c33af44604e | /src/com/adjust/sdk/AttributionHandler$1.java | c9f7e27e3697889798c42b350a8844d773fb9e14 | [] | no_license | reverseengineeringer/com.yelp.android | 48f7f2c830a3a1714112649a6a0a3110f7bdc2b1 | b0ac8d4f6cd5fc5543f0d8de399b6d7b3a2184c8 | refs/heads/master | 2021-01-19T02:07:25.997811 | 2016-07-19T16:37:24 | 2016-07-19T16:37:24 | 38,555,675 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 359 | java | package com.adjust.sdk;
class AttributionHandler$1
implements Runnable
{
AttributionHandler$1(AttributionHandler paramAttributionHandler) {}
public void run()
{
AttributionHandler.access$000(this$0);
}
}
/* Location:
* Qualified Name: com.adjust.sdk.AttributionHandler.1
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"reverseengineeringer@hackeradmin.com"
] | reverseengineeringer@hackeradmin.com |
a2c47539d154921f6f0e82456ce6d0baedf2bed4 | 3aa8fe14b6498ae4ed1473e89945ee6741db69e4 | /spring-source-analysis-parent/spring-source-analysis-temp1/src/test/java/cn/wulin/temp1/test/cache/TestCache.java | dd3106afb65c725a2b52f18639c14cda5a30e81d | [] | no_license | wulin-challenge/spring-framework-3.2.12 | 34a60b2e2dca77d9b744b84543b2a61ddcefe0c9 | d500b8e29a8b198bb1aa4c7eba444afcfc44200a | refs/heads/master | 2023-01-13T16:00:05.190322 | 2022-01-17T05:56:55 | 2022-01-17T05:56:55 | 185,803,317 | 0 | 0 | null | 2023-01-02T21:52:02 | 2019-05-09T13:22:29 | Java | UTF-8 | Java | false | false | 1,044 | java | package cn.wulin.temp1.test.cache;
import java.util.List;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import cn.wulin.temp1.domain.cache.domain.Account;
import cn.wulin.temp1.domain.cache.service.AccountService;
import cn.wulin.temp1.domain.cache.service.AccountServiceImpl;
public class TestCache {
@Test
@SuppressWarnings("resource")
public void springCacheTest() {
ApplicationContext context = new ClassPathXmlApplicationContext("cache/spring-cache.xml");
AccountService accountService = context.getBean(AccountService.class);
for (int i = 0; i < 5; i++) {
Account findByUsername = accountService.findByUsername("zs");
System.out.println(findByUsername);
if(i==0) {
accountService.save(new Account("ww",20l));
}
accountService.update(new Account("ls",15l));
accountService.delete("zl");
List<Account> findAll = accountService.findAll();
System.out.println(findAll);
}
}
}
| [
"1178649872@qq.com"
] | 1178649872@qq.com |
5f7dbc41df2490ebbc849e7ec45c7d426d8747e5 | d2b6cb18a365c8e5ab6d15bc7640bec7f25765d1 | /src/main/java/com/github/cuter44/wxmp/reqs/UserInfo.java | 1a57ecf6d9b7b80272e0935da9a758369a2b944b | [] | no_license | qinkangkang/czyhInterface | 4da328c307ac16b00f7e2b30ca1c520aa403241a | 6098e9a518557bb9ac899dadde464aa575478786 | refs/heads/master | 2021-07-25T21:05:39.105492 | 2017-11-07T08:42:23 | 2017-11-07T08:42:23 | 109,808,532 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,292 | java | package com.github.cuter44.wxmp.reqs;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import com.github.cuter44.wxmp.resps.SnsOAuthAccessTokenResponse;
import com.github.cuter44.wxmp.resps.UserInfoResponse;
/**
* 获取用户基本信息(UnionID机制) <br />
* <a href=
* "http://mp.weixin.qq.com/wiki/14/bb5031008f1494a59c6f71fa0f319c66.html">ref
* ↗</a> <br />
*
* <pre style="font-size:12px">
参数说明
access_token 调用接口凭证
openid 普通用户的标识,对当前公众号唯一
lang 返回国家地区语言版本,zh_CN 简体,zh_TW 繁体,en 英语
* </pre>
*/
public class UserInfo extends WxmpRequestBase {
// KEYS
protected static final List<String> KEYS_PARAM = Arrays.asList("access_token", "openid", "lang");
public static final String KEY_ACCESS_TOKEN = "access_token";
public static final String KEY_OPENID = "openid";
public static final String KEY_LANG = "lang";
public static final String URL_API_BASE = "https://api.weixin.qq.com/cgi-bin/user/info";
// CONSTRUCT
public UserInfo(Properties prop) {
super(prop);
if (super.getProperty(KEY_LANG) == null)
super.setProperty(KEY_LANG, "zh_CN");
return;
}
public UserInfo(String accessToken, String openid) {
super(new Properties());
this.setProperty(KEY_ACCESS_TOKEN, accessToken).setProperty(KEY_OPENID, openid).setProperty(KEY_LANG, "zh_CN");
return;
}
public UserInfo(SnsOAuthAccessTokenResponse resp) {
super(new Properties());
super.setProperty(KEY_ACCESS_TOKEN, resp.getAccessToken()).setProperty(KEY_OPENID, resp.getOpenid())
.setProperty(KEY_LANG, "zh_CN");
return;
}
// BUILD
@Override
public UserInfo build() {
return (this);
}
// TO_URL
@Override
public String toURL() {
throw (new UnsupportedOperationException("This request does not execute on client side."));
}
// EXECUTE
@Override
public UserInfoResponse execute() throws IOException {
String url = URL_API_BASE + "?" + super.toQueryString(KEYS_PARAM);
String respJson = super.executeGet(url);
return (new UserInfoResponse(respJson));
}
// MISC
public UserInfo setOpenid(String openid) {
super.setProperty(KEY_OPENID, openid);
return (this);
}
}
| [
"shemar.qin@sdeals.me"
] | shemar.qin@sdeals.me |
01e9ba49886bae15ed14043f967404a623bbab69 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/9/9_a88ab7819700bed29da890b80e9abfe5337a9e81/StaffChat/9_a88ab7819700bed29da890b80e9abfe5337a9e81_StaffChat_s.java | e3ee43712c79c6f0f36eb64d98750affb67a1bce | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 7,334 | java | package com.hotmail.shinyclef.shinychannels;
import com.hotmail.shinyclef.shinybase.ShinyBaseAPI;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
/**
* User: Peter
* Date: 14/07/13
* Time: 4:17 AM
*/
public class StaffChat
{
private static ShinyChannels plugin;
private static ShinyBaseAPI shinyBaseAPI;
private static Server server;
private static List<String> staffChatGuests;
public static void initializeStaffChat(ShinyChannels thePlugin, ShinyBaseAPI theShinyBaseAPI)
{
plugin = thePlugin; //test
shinyBaseAPI = theShinyBaseAPI;
server = plugin.getServer();
staffChatGuests = new ArrayList<String>();
}
//this method is being called from the commandPreProcess event, not CmdExecutor
public static void modChat(CommandSender sender, String sentence)
{
//args for sentence
if (sentence == null)
{
sender.sendMessage("/mb [message]");
return;
}
//check perm
if (!sender.hasPermission("rolyd.mod"))
{
sender.sendMessage(ChatColor.RED + "Sorry, you do not have permission to do that.");
return;
}
//broadcast
server.broadcast(ChatColor.RED + "[MB] " + sender.getName() + ": "
+ ChatColor.GREEN + sentence, "rolyd.mod");
}
public static boolean staffChat(CommandSender sender, String[] args)
{
//args length
if (args.length < 1)
{
return false;
}
//check perm
if (!sender.hasPermission("rolyd.exp") && !staffChatGuests.contains(sender.getName().toLowerCase()))
{
sender.sendMessage(ChatColor.RED + "Sorry, you do not have permission to do that.");
return true;
}
//make sentence
String sentence = ShinyChannels.makeSentence(args);
//guest qty
String guestQty = " ";
if (staffChatGuests.size() > 0)
{
guestQty = "(+" + staffChatGuests.size() + ") ";
}
//perms broadcast
server.broadcast(ChatColor.RED + "[Staff]" + guestQty + sender.getName() + ": "
+ ChatColor.AQUA + sentence, "rolyd.exp");
//guest broadcast
for (String playerName : staffChatGuests)
{
if (server.getOfflinePlayer(playerName).isOnline())
{
server.getPlayer(playerName).sendMessage(ChatColor.RED + "[Staff] " + sender.getName()
+ ": " + ChatColor.AQUA + sentence);
}
}
return true;
}
public static boolean staffChatAdd(CommandSender sender, String[] args)
{
//check perm
if (!sender.hasPermission("rolyd.mod"))
{
sender.sendMessage(ChatColor.RED + "Sorry, you do not have permission to do that.");
return true;
}
//args length
if (args.length < 1)
{
return false;
}
//has played check
String playerName = args[0].toLowerCase();
if (!shinyBaseAPI.isExistingPlayer(playerName))
{
sender.sendMessage(ChatColor.RED + "That player does not exist.");
return true;
}
//if the player is already in the list
if (staffChatGuests.contains(playerName))
{
sender.sendMessage(ChatColor.RED + "That player is already in the staff channel.");
return true;
}
//add to list and inform staff
staffChatGuests.add(playerName);
server.broadcast(ChatColor.YELLOW + playerName + ChatColor.BLUE
+ " has been added to the staff channel.", "rolyd.mod");
//notify guests
for (String listName : staffChatGuests)
{
if (server.getOfflinePlayer(listName).isOnline() && listName != playerName)
{
server.getPlayer(listName).sendMessage(ChatColor.YELLOW + playerName + ChatColor.BLUE
+ " has been added to the staff channel.");
}
}
//notify added player if online
if (server.getOfflinePlayer(args[0]).isOnline())
{
plugin.getServer().getPlayer(playerName).sendMessage(ChatColor.BLUE
+ "You have been added to the staff channel. Type " + ChatColor.YELLOW
+ "/sb [message]" + ChatColor.BLUE + " to post a message.");
}
return true;
}
public static boolean staffChatRemove(CommandSender sender, String[] args)
{
//check perm
if (!sender.hasPermission("rolyd.mod"))
{
sender.sendMessage(ChatColor.RED + "Sorry, you do not have permission to do that.");
return true;
}
//args length
if (args.length < 1)
{
return false;
}
//has played check
String playerName = args[0].toLowerCase();
if (!shinyBaseAPI.isExistingPlayer(playerName))
{
sender.sendMessage(ChatColor.RED + "That player does not exist.");
return true;
}
//if the player is not in the list
if (!staffChatGuests.contains(playerName))
{
sender.sendMessage(ChatColor.RED + "That player is not in the staff channel.");
return true;
}
//remove from list and inform staff
staffChatGuests.remove(playerName);
server.broadcast(ChatColor.YELLOW + playerName + ChatColor.BLUE
+ " has been removed from the staff channel.", "rolyd.mod");
//notify guests
for (String name : staffChatGuests)
{
if (server.getOfflinePlayer(name).isOnline())
{
server.getPlayer(name).sendMessage(ChatColor.YELLOW + playerName + ChatColor.BLUE
+ " has been removed from the staff channel.");
}
}
//notify removed player if online
if (server.getOfflinePlayer(args[0]).isOnline())
{
plugin.getServer().getPlayer(playerName).sendMessage(ChatColor.BLUE
+ "You have been removed from the staff channel.");
}
return true;
}
public static boolean staffList(CommandSender sender, String[] args)
{
//check perm
if (!sender.hasPermission("rolyd.mod"))
{
sender.sendMessage(ChatColor.RED + "Sorry, you do not have permission to do that.");
return true;
}
if (args.length > 0)
{
sender.sendMessage(ChatColor.RED + "/sblist does not require any parameters (just type /sblist).");
return true;
}
//return a list of players to command sender
sender.sendMessage(ChatColor.BLUE + staffChatGuests.toString());
return true;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
cdbe04938dfb92da0e67961c0470aa6f7477452a | 1f71ab1d79fb5d93b9017e84399b08540f646379 | /src/ro/nextreports/server/web/core/settings/GeneralSettingsPanel.java | dfd669e9962da0dfe56c7158bde98c03e1b8fab6 | [
"MIT",
"Apache-2.0"
] | permissive | yikunw/nextreports-server | 7e5dca06d85e21f8a8b4391075d79f9e97857386 | 199a014b158e6bb830f0f1890ac3e5bfd5cecd2a | refs/heads/master | 2021-01-22T07:23:07.532380 | 2014-03-13T12:19:16 | 2014-03-13T12:19:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,164 | 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 ro.nextreports.server.web.core.settings;
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.form.FormComponent;
import org.apache.wicket.markup.html.image.ContextImage;
import org.apache.wicket.spring.injection.annot.SpringBean;
import org.apache.wicket.validation.validator.UrlValidator;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import ro.nextreports.server.domain.Settings;
import ro.nextreports.server.service.StorageService;
import ro.nextreports.server.web.NextServerApplication;
import ro.nextreports.server.web.common.behavior.SimpleTooltipBehavior;
import ro.nextreports.server.web.core.validation.MailServerValidator;
/**
* User: mihai.panaitescu
* Date: 17-Nov-2009
* Time: 15:16:22
*/
public class GeneralSettingsPanel extends AbstractSettingsPanel {
@SpringBean
private StorageService storageService;
private String oldReportsHome;
private String oldMailIp;
private Integer oldMailPort;
public GeneralSettingsPanel(String id) {
super(id);
}
@Override
protected void addComponents(Form<Settings> form) {
final TextField<String> urlField = new TextField<String>("baseUrl");
urlField.add(new UrlValidator());
urlField.setRequired(true);
form.add(urlField);
ContextImage urlImage = new ContextImage("urlImage","images/exclamation.png");
urlImage.add(new SimpleTooltipBehavior(getString("Settings.general.baseUrlTooltip")));
form.add(urlImage);
final TextField<String> reportsHomeField = new TextField<String>("reportsHome");
reportsHomeField.setRequired(true);
form.add(reportsHomeField);
ContextImage homeImage = new ContextImage("homeImage","images/exclamation.png");
homeImage.add(new SimpleTooltipBehavior(getString("Settings.general.reportsHomeTooltip")));
form.add(homeImage);
final TextField<String> reportsUrlField = new TextField<String>("reportsUrl");
reportsUrlField.add(new UrlValidator());
reportsUrlField.setRequired(true);
form.add(reportsUrlField);
ContextImage repImage = new ContextImage("repImage","images/exclamation.png");
repImage.add(new SimpleTooltipBehavior(getString("Settings.general.reportsUrlTooltip")));
form.add(repImage);
final TextField<String> mailServerIpField = new TextField<String>("mailServer.ip");
form.add(mailServerIpField);
final TextField<Integer> mailServerPortField = new TextField<Integer>("mailServer.port");
form.add(mailServerPortField);
final TextField<String> mailServerSenderField = new TextField<String>("mailServer.from");
form.add(mailServerSenderField);
form.add(new MailServerValidator(new FormComponent[] {mailServerIpField, mailServerPortField, mailServerSenderField}));
final TextField<Integer> conTimeoutField = new TextField<Integer>("connectionTimeout");
conTimeoutField.setRequired(true);
form.add(conTimeoutField);
ContextImage conImage = new ContextImage("conImage","images/information.png");
conImage.add(new SimpleTooltipBehavior(getString("Settings.general.connectTimeoutTooltip")));
form.add(conImage);
final TextField<Integer> timeoutField = new TextField<Integer>("queryTimeout");
timeoutField.setRequired(true);
form.add(timeoutField);
ContextImage timeoutImage = new ContextImage("timeoutImage","images/information.png");
timeoutImage.add(new SimpleTooltipBehavior(getString("Settings.general.queryTimeoutTooltip")));
form.add(timeoutImage);
final TextField<Integer> updateIntervalField = new TextField<Integer>("updateInterval");
updateIntervalField.setRequired(true);
form.add(updateIntervalField);
ContextImage updateImage = new ContextImage("updateImage","images/information.png");
updateImage.add(new SimpleTooltipBehavior(getString("Settings.general.updateIntervalTooltip")));
form.add(updateImage);
Settings settings = storageService.getSettings();
oldReportsHome = String.valueOf(settings.getReportsHome());
oldMailPort = settings.getMailServer().getPort();
oldMailIp = settings.getMailServer().getIp();
}
protected void beforeChange(Form form, AjaxRequestTarget target) {
Settings settings = (Settings)form.getModelObject();
if (settings.getReportsUrl().endsWith("/")) {
settings.setReportsUrl(settings.getReportsUrl().substring(0, settings.getReportsUrl().length()-1));
}
}
protected void afterChange(Form form, AjaxRequestTarget target) {
Settings settings = (Settings)form.getModelObject();
if (!oldReportsHome.equals(settings.getReportsHome())) {
// add new reports home to classpath
try {
addURL(new File(settings.getReportsHome()).toURI().toURL());
} catch (Exception e) {
e.printStackTrace();
}
}
if (!oldMailIp.equals(settings.getMailServer().getIp()) ||
!oldMailPort.equals(settings.getMailServer().getPort())) {
JavaMailSenderImpl mailSender = (JavaMailSenderImpl) NextServerApplication.get().getSpringBean("mailSender");
mailSender.setHost(settings.getMailServer().getIp());
mailSender.setPort(settings.getMailServer().getPort());
}
}
public void setStorageService(StorageService storageService) {
this.storageService = storageService;
}
// just a hack
// http://stackoverflow.com/questions/252893/how-do-you-change-the-classpath-within-java
@SuppressWarnings("unchecked")
private void addURL(URL url) throws Exception {
URLClassLoader classLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
Class clazz = URLClassLoader.class;
Method method = clazz.getDeclaredMethod("addURL", new Class[] { URL.class });
method.setAccessible(true);
method.invoke(classLoader, new Object[] { url });
}
}
| [
"decebal.suiu@gmail.com"
] | decebal.suiu@gmail.com |
da483843c662079e4f19212682427cbd67b1c7ca | 5b32059a1ff9e8a8dedc311bc68bba5f5375c381 | /src/main/java/travel_20190226/City/Repos/CityRepos.java | b21bb85e79d691a8184f60f0e4bf876a8dbd573b | [] | no_license | morristech/Travel | 7c24b053473f75b9cbbdb373edf4f75440d95d61 | 1164fb93fbd840daf6347eb57726b1cda09c7ab9 | refs/heads/master | 2020-07-20T13:33:00.429622 | 2019-04-14T22:43:11 | 2019-04-14T22:43:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 543 | 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 main.java.travel_20190226.City.Repos;
import main.java.travel_20190226.City.Domain.City;
import main.java.travel_20190226.Common.Business.Repos.BaseRepos;
/**
*
* @author Виталий
*/
public interface CityRepos extends BaseRepos {
void addCity(City city);
City findCityById(long id);
City findCityByName(String name);
}
| [
"morozov_spmt@mail.ru"
] | morozov_spmt@mail.ru |
840ad4b2fe5523d5c4b5cbcd128b887c52603eed | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/7/7_3b111da838a1e62467ad0fe811c1835c5877c9a2/TestController/7_3b111da838a1e62467ad0fe811c1835c5877c9a2_TestController_t.java | 48caa3adcd45c0af9dc9075a57f645205d2c5b72 | [] | 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,802 | java | package com.springapp.mvc;
import com.google.gson.Gson;
import com.springapp.models.PatientModel;
import com.springapp.service.PatientService;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List;
/**
* Created with IntelliJ IDEA.
* User: dkozar
* Date: 7/2/13
* Time: 11:58 AM
* To change this template use File | Settings | File Templates.
*/
@Controller
public class TestController {
@Autowired
private PatientService patientService;
@RequestMapping(value="/test", method = RequestMethod.GET)
public @ResponseBody String printWelcome(@RequestParam("requestString") String requestString ,ModelMap model) {
//model.addAttribute("message", "{'FirstName':'Dima', 'LastName':'Kozaryok'}");
System.out.println(requestString + " string");
List<PatientModel> result = patientService.searchPatient(requestString);
String json = new Gson().toJson(result);
return json;
}
@RequestMapping(value="/addPatient", method = RequestMethod.POST)
public String addNewPatient(PatientModel patientModel){
// String a = patientService.createPatient(patientModel);
//System.out.print(a);
return "addNew";
}
@RequestMapping(value="/updatePatient", method = RequestMethod.POST)
public @ResponseBody String updatePatient(PatientModel patientModel){
//String result = patientService.editPatient(patientModel);
return "Dane!";
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
c9b57fb4d6af420173fde41a04ff0d38b84ab3cc | c4a8396c99ced99bb136b8ffe9dbce70701f94ab | /spring-beans/src/main/java/org/springframework/beans/factory/annotation/Configurable.java | b297e7a442503695e2c5906bcb34c60b1f6e223c | [] | no_license | liuguangjie/spring-study | 0ca962e9d1a434138795f93ea3ef909bd90ee906 | 2923d905918954548bc0bca71ff79e6ceace3aae | refs/heads/master | 2020-07-11T15:48:28.505897 | 2018-08-21T14:18:02 | 2018-08-21T14:18:02 | 73,999,933 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,456 | java | /*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.beans.factory.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Marks a class as being eligible for Spring-driven configuration.
*
* <p>Typically used with the AspectJ <code>AnnotationBeanConfigurerAspect</code>.
*
* ****************************************************************************
* ~$ 标记一个类作为资格之配置
* <p>通常使用AspectJ <code>AnnotationBeanConfigurerAspect</code>.
*
* @author Rod Johnson
* @author Rob Harrop
* @author Adrian Colyer
* @author Ramnivas Laddad
* @since 2.0
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface Configurable {
/**
* The name of the bean definition that serves as the configuration template.
* *************************************************************************
* ~$ bean定义的名称作为模板的配置.
*/
String value() default "";
/**
* Are dependencies to be injected via autowiring?
* ***********************************************
* ~$ 依赖关系是通过自动装配注射吗?
*/
Autowire autowire() default Autowire.NO;
/**
* Is dependency checking to be performed for configured objects?
* **************************************************************
* ~$ 配置对象的依赖性检查要执行吗?
*/
boolean dependencyCheck() default false;
/**
* Are dependencies to be injected prior to the construction of an object?
* ***********************************************************************
* ~$ 是依赖注入前施工对象的吗?
*/
boolean preConstruction() default false;
}
| [
"1316421727@qq.com"
] | 1316421727@qq.com |
a9a48a28b56a4da158b842aed9441a8744c1f60b | 456d43c584fb66f65c6a7147cdd22595facf8bd9 | /jpa/deferred/src/main/java/example/model/Customer1654.java | 491fe086b750916fa6280a92facab7910fcf42e4 | [
"Apache-2.0"
] | permissive | niushapaks/spring-data-examples | 283eec991014e909981055f48efe67ff1e6e19e6 | 1ad228b04523e958236d58ded302246bba3c1e9b | refs/heads/main | 2023-08-21T14:25:55.998574 | 2021-09-29T13:14:33 | 2021-09-29T13:14:33 | 411,679,335 | 1 | 0 | Apache-2.0 | 2021-09-29T13:11:03 | 2021-09-29T13:11:02 | null | UTF-8 | Java | false | false | 628 | java | package example.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class Customer1654 {
@Id @GeneratedValue(strategy = GenerationType.AUTO) private long id;
private String firstName;
private String lastName;
protected Customer1654() {}
public Customer1654(String firstName, String lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
@Override
public String toString() {
return String.format("Customer1654[id=%d, firstName='%s', lastName='%s']", id, firstName, lastName);
}
}
| [
"ogierke@pivotal.io"
] | ogierke@pivotal.io |
9f5822418d89524045ad70473f30e083caa6a1db | 3b8690b659fffe81298f91d39c4d5e38e8ffea15 | /wc18-back/wc18-domain/src/main/java/com/github/mjeanroy/wc18/domain/configuration/liquibase/LiquibaseProperties.java | 0f5b7ad228120e0528eaf27f4957f9301399f044 | [] | no_license | mjeanroy/wc18 | ce0a6924d5a193e0d2c1ed5ef98d7e7d08d00fdf | aea9e8a0ddf3ef4ad67dbbde6fac84a421707068 | refs/heads/master | 2020-03-21T03:53:49.338315 | 2018-09-19T14:28:26 | 2018-09-19T15:08:28 | 138,079,874 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,711 | java | /**
* The MIT License (MIT)
*
* Copyright (c) 2018 Mickael Jeanroy
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package com.github.mjeanroy.wc18.domain.configuration.liquibase;
import com.google.common.base.MoreObjects;
import java.util.Objects;
/**
* Liquibase properties.
*/
public final class LiquibaseProperties {
/**
* The liquibase {@code "changeLog"} property.
*
* @see liquibase.integration.spring.SpringLiquibase#changeLog
*/
private final String changeLog;
/**
* The liquibase {@code "shouldRun"} property.
*
* @see liquibase.integration.spring.SpringLiquibase#shouldRun
*/
private final boolean shouldRun;
/**
* The liquibase {@code "dropFirst"} property.
*
* @see liquibase.integration.spring.SpringLiquibase#dropFirst
*/
private final boolean dropFirst;
/**
* The liquibase {@code "contexts"} property.
*
* @see liquibase.integration.spring.SpringLiquibase#contexts
*/
private final String contexts;
/**
* Create liquibase properties.
*
* @param changeLog Changelog path.
* @param shouldRun The liquibase {@code shouldRun} flag.
* @param dropFirst The liquibase {@code dropFirst} flag.
* @param contexts The liquibase contexts.
*/
public LiquibaseProperties(String changeLog, boolean shouldRun, boolean dropFirst, String contexts) {
this.changeLog = changeLog;
this.shouldRun = shouldRun;
this.dropFirst = dropFirst;
this.contexts = contexts;
}
/**
* Get {@link #changeLog}
*
* @return {@link #changeLog}
*/
public String getChangeLog() {
return changeLog;
}
/**
* Get {@link #shouldRun}
*
* @return {@link #shouldRun}
*/
public boolean isShouldRun() {
return shouldRun;
}
/**
* Get {@link #dropFirst}
*
* @return {@link #dropFirst}
*/
public boolean isDropFirst() {
return dropFirst;
}
/**
* Get {@link #contexts}
*
* @return {@link #contexts}
*/
public String getContexts() {
return contexts;
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof LiquibaseProperties) {
LiquibaseProperties p = (LiquibaseProperties) o;
return Objects.equals(changeLog, p.changeLog)
&& Objects.equals(shouldRun, p.shouldRun)
&& Objects.equals(dropFirst, p.dropFirst)
&& Objects.equals(contexts, p.contexts);
}
return false;
}
@Override
public int hashCode() {
return Objects.hash(changeLog, shouldRun, dropFirst, contexts);
}
@Override
public String toString() {
return MoreObjects.toStringHelper(getClass())
.add("changeLog", changeLog)
.add("shouldRun", shouldRun)
.add("dropFirst", dropFirst)
.add("contexts", contexts)
.toString();
}
}
| [
"mickael.jeanroy@gmail.com"
] | mickael.jeanroy@gmail.com |
aa0579258ec7af1009606d84b517e47a4c0279de | c0644f65e8e7578f0db49ce2f87e40d6843ed297 | /src/main/java/uk/joshiejack/penguinlib/data/generators/builders/SimplePenguinRecipeBuilder.java | 3429c775802e09043f41c7c4b47c34e1553ac76b | [
"MIT"
] | permissive | Brun333rp/Penguin-Lib | cd1d9e925c934a9b41878cab10f6dab118f34006 | d1510c5cd2968e781b3b2b0c7f68611437e94a38 | refs/heads/main | 2023-07-20T10:21:22.971519 | 2021-07-23T13:39:18 | 2021-07-23T13:39:18 | 397,721,770 | 0 | 0 | MIT | 2021-08-18T20:02:50 | 2021-08-18T20:02:49 | null | UTF-8 | Java | false | false | 4,582 | java | package uk.joshiejack.penguinlib.data.generators.builders;
import com.google.gson.JsonObject;
import net.minecraft.advancements.Advancement;
import net.minecraft.advancements.AdvancementRewards;
import net.minecraft.advancements.ICriterionInstance;
import net.minecraft.advancements.IRequirementsStrategy;
import net.minecraft.advancements.criterion.RecipeUnlockedTrigger;
import net.minecraft.data.IFinishedRecipe;
import net.minecraft.item.Item;
import net.minecraft.item.crafting.IRecipeSerializer;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.registry.Registry;
import javax.annotation.Nullable;
import java.util.function.Consumer;
@SuppressWarnings("NullableProblems")
public class SimplePenguinRecipeBuilder {
protected final Item result;
protected final Ingredient ingredient;
protected final int count;
protected final Advancement.Builder advancement = Advancement.Builder.advancement();
protected final IRecipeSerializer<?> type;
public SimplePenguinRecipeBuilder(IRecipeSerializer<?> serializer, Ingredient ingredient, IItemProvider output, int amount) {
this.type = serializer;
this.result = output.asItem();
this.ingredient = ingredient;
this.count = amount;
}
public SimplePenguinRecipeBuilder unlocks(String name, ICriterionInstance criterion) {
this.advancement.addCriterion(name, criterion);
return this;
}
public void save(Consumer<IFinishedRecipe> consumer, String name) {
ResourceLocation resourcelocation = Registry.ITEM.getKey(this.result);
if ((new ResourceLocation(name)).equals(resourcelocation)) {
throw new IllegalStateException("Single Item Recipe " + name + " should remove its 'save' argument");
} else {
this.save(consumer, new ResourceLocation(name));
}
}
public void save(Consumer<IFinishedRecipe> consumer, ResourceLocation resource) {
ensureValid(resource);
advancement.parent(new ResourceLocation("recipes/root")).addCriterion("has_the_recipe", RecipeUnlockedTrigger.unlocked(resource)).rewards(AdvancementRewards.Builder.recipe(resource)).requirements(IRequirementsStrategy.OR);
consumer.accept(accept(resource));
}
protected IFinishedRecipe accept(ResourceLocation resource) {
assert this.result.getItemCategory() != null;
return new Result(resource, this.type, this.ingredient, this.result, this.count, this.advancement,
new ResourceLocation(resource.getNamespace(), "recipes/" + this.result.getItemCategory().getRecipeFolderName() + "/" + resource.getPath()));
}
protected void ensureValid(ResourceLocation p_218646_1_) {
if (this.advancement.getCriteria().isEmpty()) {
throw new IllegalStateException("No way of obtaining recipe " + p_218646_1_);
}
}
@SuppressWarnings("deprecation")
public static class Result implements IFinishedRecipe {
private final ResourceLocation id;
private final Ingredient ingredient;
private final Item result;
private final int count;
private final Advancement.Builder advancement;
private final ResourceLocation advancementId;
private final IRecipeSerializer<?> type;
public Result(ResourceLocation rl, IRecipeSerializer<?> serializer, Ingredient ingredient, Item output, int count,
Advancement.Builder advancementBuilder, ResourceLocation advancementID) {
this.id = rl;
this.type = serializer;
this.ingredient = ingredient;
this.result = output;
this.count = count;
this.advancement = advancementBuilder;
this.advancementId = advancementID;
}
public void serializeRecipeData(JsonObject json) {
json.add("ingredient", this.ingredient.toJson());
json.addProperty("result", Registry.ITEM.getKey(this.result).toString());
json.addProperty("count", this.count);
}
public ResourceLocation getId() {
return this.id;
}
public IRecipeSerializer<?> getType() {
return this.type;
}
@Nullable
public JsonObject serializeAdvancement() {
return this.advancement.serializeToJson();
}
@Nullable
public ResourceLocation getAdvancementId() {
return this.advancementId;
}
}
} | [
"joshjackwildman@gmail.com"
] | joshjackwildman@gmail.com |
8d05129e769be4c8c6b668c3a3a4aa8fd1ca1492 | 67a1248d981248ac9c00861ecc76d822fc637312 | /modules/ImportAPI/src/main/java/org/gephi/io/importer/spi/ImporterBuilder.java | ffcda623a459712aa91d0b872c1898ee8619a5ba | [
"Apache-2.0",
"CDDL-1.0",
"GPL-3.0-only",
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-free-unknown"
] | permissive | LiXiaoRan/Gephi_improved | 186d229e14dfa83caaa3b3c12a7caa832b8107ee | c9d7ca0c9ac00b2519d1b3837ccc732b1cfe33bb | refs/heads/master | 2022-09-21T19:12:39.263426 | 2019-07-01T08:49:13 | 2019-07-01T08:49:13 | 174,827,977 | 0 | 0 | Apache-2.0 | 2022-09-08T00:59:36 | 2019-03-10T13:33:43 | Java | UTF-8 | Java | false | false | 2,654 | java | /*
Copyright 2008-2010 Gephi
Authors : Mathieu Bastian <mathieu.bastian@gephi.org>
Website : http://www.gephi.org
This file is part of Gephi.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
Copyright 2011 Gephi Consortium. All rights reserved.
The contents of this file are subject to the terms of either the GNU
General Public License Version 3 only ("GPL") or the Common
Development and Distribution License("CDDL") (collectively, the
"License"). You may not use this file except in compliance with the
License. You can obtain a copy of the License at
http://gephi.org/about/legal/license-notice/
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
specific language governing permissions and limitations under the
License. When distributing the software, include this License Header
Notice in each file and include the License files at
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
License Header, with the fields enclosed by brackets [] replaced by
your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"
If you wish your version of this file to be governed by only the CDDL
or only the GPL Version 3, indicate your decision by adding
"[Contributor] elects to include this software in this distribution
under the [CDDL or GPL Version 3] license." If you do not indicate a
single choice of license, a recipient has the option to distribute
your version of this file under either the CDDL, the GPL Version 3 or
to extend the choice of license to its licensees as provided above.
However, if you add GPL Version 3 code and therefore, elected the GPL
Version 3 license, then the option applies only if the new code is
made subject to such option by the copyright holder.
Contributor(s):
Portions Copyrighted 2011 Gephi Consortium.
*/
package org.gephi.io.importer.spi;
import org.gephi.io.importer.api.ImportController;
/**
* Factory class for building importer instances. Declared in the system as
* services (i.e. singleton), the role of builders is simply the create new
* instances of particular importer on demand.
* <p>
* To be recognized by the system, implementations must just add the following
* annotation:
* <pre>@ServiceProvider(service=ImporterBuilder.class)</pre>
*
* @author Mathieu Bastian
* @see ImportController
*/
public interface ImporterBuilder {
/**
* Builds a new importer instance, ready to be used.
*
* @return a new importer
*/
public Importer buildImporter();
/**
* Returns the name of this builder
*
* @return the name of this importer
*/
public String getName();
}
| [
"997843911@qq.com"
] | 997843911@qq.com |
da1262031fe2d0e171c4a986c60dfdba4a930d8c | edafeaf327e3378cda15903aa9f130af88ba57b0 | /core/src/test/java/com/vladmihalcea/hibernate/masterclass/laboratory/concurrency/OptimisticLockingOneRootOneVersionTest.java | 9b7fcf818f4ef18ae8cf3dcc1eb2f46dc96cb9f4 | [
"Apache-2.0"
] | permissive | jmilkiewicz/hibernate-master-class | 11b9f87394988e9008ae50f432251636fb59ced3 | 6a6b7bd21dc9ac4f34c670de994b73b360abfbbc | refs/heads/master | 2021-01-18T01:54:07.925632 | 2014-12-09T22:54:16 | 2014-12-10T08:33:01 | 27,784,454 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,340 | java | package com.vladmihalcea.hibernate.masterclass.laboratory.concurrency;
import com.vladmihalcea.hibernate.masterclass.laboratory.util.AbstractTest;
import org.hibernate.Session;
import org.hibernate.StaleObjectStateException;
import org.junit.Test;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.concurrent.CountDownLatch;
/**
* OptimisticLockingOneRootOneVersionTest - Test to check optimistic checking on a single entity being updated by many threads
*
* @author Vlad Mihalcea
*/
public class OptimisticLockingOneRootOneVersionTest extends AbstractTest {
private final CountDownLatch loadProductsLatch = new CountDownLatch(3);
private final CountDownLatch aliceLatch = new CountDownLatch(1);
public class AliceTransaction implements Runnable {
@Override
public void run() {
try {
doInTransaction(new TransactionCallable<Void>() {
@Override
public Void execute(Session session) {
try {
Product product = (Product) session.get(Product.class, 1L);
loadProductsLatch.countDown();
loadProductsLatch.await();
product.setQuantity(6L);
return null;
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
}
});
} catch (StaleObjectStateException expected) {
LOGGER.info("Alice: Optimistic locking failure", expected);
}
aliceLatch.countDown();
}
}
public class BobTransaction implements Runnable {
@Override
public void run() {
try {
doInTransaction(new TransactionCallable<Void>() {
@Override
public Void execute(Session session) {
try {
Product product = (Product) session.get(Product.class, 1L);
loadProductsLatch.countDown();
loadProductsLatch.await();
aliceLatch.await();
product.incrementLikes();
return null;
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
}
});
} catch (StaleObjectStateException expected) {
LOGGER.info("Bob: Optimistic locking failure", expected);
}
}
}
public class VladTransaction implements Runnable {
@Override
public void run() {
try {
doInTransaction(new TransactionCallable<Void>() {
@Override
public Void execute(Session session) {
try {
Product product = (Product) session.get(Product.class, 1L);
loadProductsLatch.countDown();
loadProductsLatch.await();
aliceLatch.await();
product.setDescription("Plasma HDTV");
return null;
} catch (InterruptedException e) {
throw new IllegalStateException(e);
}
}
});
} catch (StaleObjectStateException expected) {
LOGGER.info("Vlad: Optimistic locking failure", expected);
}
}
}
@Test
public void testOptimisticLocking() throws InterruptedException {
doInTransaction(new TransactionCallable<Void>() {
@Override
public Void execute(Session session) {
Product product = new Product();
product.setId(1L);
product.setName("TV");
product.setDescription("Plasma TV");
product.setPrice(BigDecimal.valueOf(199.99));
product.setQuantity(7L);
session.persist(product);
return null;
}
});
Thread alice = new Thread(new AliceTransaction());
Thread bob = new Thread(new BobTransaction());
Thread vlad = new Thread(new VladTransaction());
alice.start();
bob.start();
vlad.start();
alice.join();
bob.join();
vlad.join();
}
@Override
protected Class<?>[] entities() {
return new Class<?>[]{
Product.class
};
}
/**
* Product - Product
*
* @author Vlad Mihalcea
*/
@Entity(name = "product")
@Table(name = "product")
public static class Product {
@Id
private Long id;
@Column(unique = true, nullable = false)
private String name;
@Column(nullable = false)
private String description;
@Column(nullable = false)
private BigDecimal price;
private long quantity;
private int likes;
@Version
private int version;
public Product() {
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public long getQuantity() {
return quantity;
}
public void setQuantity(long quantity) {
this.quantity = quantity;
}
public int getLikes() {
return likes;
}
public int incrementLikes() {
return ++likes;
}
}
}
| [
"mih_vlad@yahoo.com"
] | mih_vlad@yahoo.com |
fda93ce2b9fbe5183ed172860ff829f7dcc937e4 | 589c6ee52f2ce3b935fcd58299a16619ca0f2c34 | /rwiki/rwiki-util/radeox/src/java/org/radeox/macro/api/RubyApiConverter.java | 7062641a42d4e4e95c1853306610a85b65af33a5 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-only",
"ECL-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-generic-cla",
"GPL-1.0-or-later"
] | permissive | sakaiproject/sakai | f8f44eef300fee1557aea97e70273955b8f57360 | 657ee6ed3b92785ed9f38dc9f57592f96f1be385 | refs/heads/master | 2023-09-03T23:27:38.862565 | 2023-09-01T20:05:22 | 2023-09-01T20:05:22 | 28,589,709 | 1,042 | 1,142 | ECL-2.0 | 2023-09-14T17:14:16 | 2014-12-29T11:14:17 | Java | UTF-8 | Java | false | false | 1,381 | java | /*
* This file is part of "SnipSnap Radeox Rendering Engine".
*
* Copyright (c) 2002 Stephan J. Schmidt, Matthias L. Jugel
* All Rights Reserved.
*
* Please visit http://radeox.org/ for updates and contact.
*
* --LICENSE NOTICE--
* 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.
* --LICENSE NOTICE--
*/
package org.radeox.macro.api;
import java.io.IOException;
import java.io.Writer;
/**
* Converts a Ruby class name to an Ruby api doku url
*
* @author Stephan J. Schmidt
* @version $Id: RubyApiConverter.java 7707 2006-04-12 17:30:19Z
* ian@caret.cam.ac.uk $
*/
public class RubyApiConverter extends BaseApiConverter
{
public void appendUrl(Writer writer, String className) throws IOException
{
writer.write(baseUrl);
writer.write(className.toLowerCase());
writer.write(".html");
}
public String getName()
{
return "Ruby";
}
}
| [
"ieb@tfd.co.uk"
] | ieb@tfd.co.uk |
67003d5c77ea66105e03544c9a62803d60ff3c5d | f2b9c9bc8c0423d8121634361d53b920d1418149 | /src/main/java/lk/css/garmentManagement/asset/employee/entity/Enum/CivilStatus.java | 16d7dd67c3d4bf6672041bf9b7b5fc94ec9d8f36 | [] | no_license | prasad5793/garmentManagement | 833e766f35825868367e128357c9bf8bebc7d1ae | 48051a4f80b8cb7bb5c066d7264f7729f91392dd | refs/heads/master | 2022-03-17T10:46:06.214928 | 2019-09-18T14:48:49 | 2019-09-18T14:48:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 358 | java | package lk.css.garmentManagement.asset.employee.entity.Enum;
public enum CivilStatus {
MARRIED("Married"),
UNMARRIED("Unmarried"),
WIDOW("Widow");
private final String civilStatus;
CivilStatus(String civilStatus) {
this.civilStatus = civilStatus;
}
public String getCivilStatus() {
return civilStatus;
}
}
| [
"asakahatapitiya@gmail.com"
] | asakahatapitiya@gmail.com |
9abe1618df8fb8e9c82be0a25946c6f71f142a5e | 4417886f50f85f3348a44b417e57c1ecac9930a4 | /src/main/java/com/sliu/framework/app/wfw/dao/ZsJsjkxxDao.java | b116a35bf24c51ae02fabe575e2cf052dc51fdd7 | [] | no_license | itxiaojian/wechatpf | 1fcf2ecc783c36c5c84d8408d78639de22263bde | bdf2b36c9733b1125feabb5d078e84f51034f718 | refs/heads/master | 2021-01-19T20:55:50.196667 | 2017-04-19T02:20:35 | 2017-04-19T02:20:35 | 88,578,665 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,543 | java | package com.sliu.framework.app.wfw.dao;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import com.sliu.framework.app.common.dao.hibernate4.HibernateBaseDaoImpl;
import com.sliu.framework.app.common.dao.jdbc.NamedParameterJdbcPager;
import com.sliu.framework.app.wfw.model.ZsJsjkxx;
@Repository
public class ZsJsjkxxDao extends HibernateBaseDaoImpl<ZsJsjkxx, String>{
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private NamedParameterJdbcPager jdbcPager;
@Autowired
private ZsXscjDao dao;
/**
*
* @author liujiansen
* @date 2015年8月4日
* @param str
* @param user
* @param code
* @return
*/
public String getCxtj(String str,List<Map<String,Object>> user,String code){
List<Map<String,Object>> yh=dao.getYh(user.get(0).get("yhid")+"");
if(yh.size()!=0){
String js=(yh.get(0).get("jsmc")+"").trim();
if("ROLE_TEACHER".equals(js)){
//老师角色
str=" and a.jsgh like '%"+yh.get(0).get("dlm")+"%'";
}else{
if(code!=null&&!"".equals(code)){
str=str+" and concat(ifnull(a.jsgh,''),ifnull(a.xm,'')) like '%"+code+"%'";
}
}
}
return str;
}
/**
* 根据页数和标题查询教师监考信息
* @author duanpeijun
* @date 2015年6月18日
* @param pages 页数
* @param code 教师工号和姓名
* @return
*/
public List<Map<String,Object>> getJsjkxxList(String pages,String code,String openId){
String str="";
List<Map<String,Object>> user=dao.getWxyh(openId);
if(user.size()!=0){
str=str+this.getCxtj(str, user, code);
}
if(Integer.parseInt(pages)==1){
int num=Integer.parseInt(pages)*10;
str=str+" order by a.jsgh DESC limit "+num+" ";
}else{
int num=(Integer.parseInt(pages)-1)*10;
str=str+" order by a.jsgh DESC limit "+num+",5 ";
}
// String sql="select a.id,a.jsgh,a.xm,DATE_FORMAT(a.jkrq,'%Y-%m-%d') as jkrq,DATE_FORMAT(a.kssj,'%Y-%m-%d') as kssj,a.jkkcbh,a.jkkcmc,a.ksxz,"
// + "a.ksfs,a.kssc,a.jkdd,a.cjbj,a.ksrs,a.bz from zs_jsjkxx a left join sys_xsbjb b on a.jsgh=b.dlm where 1=1 "+str;
String sql="select a.id,a.jsgh,a.xm,DATE_FORMAT(a.jkrq,'%Y-%m-%d') as jkrq,DATE_FORMAT(a.kssj,'%Y-%m-%d') as kssj,a.jkkcbh,a.jkkcmc,a.ksxz,"
+ "a.ksfs,a.kssc,a.jkdd,a.cjbj,a.ksrs,a.bz from zs_jsjkxx a where 1=1 "+str;
return jdbcTemplate.queryForList(sql);
}
}
| [
"2629690209@qq.com"
] | 2629690209@qq.com |
e27511ce887ee94d8a6ded0f7e508bb0cd9a9058 | f5049214ff99cdd7c37da74619b60ac4a26fc6ba | /fileshare/app/eu.agno3.fileshare.webgui/src/main/java/eu/agno3/fileshare/webgui/init/FileshareThemeConfig.java | 35d46c9d61e204b50e525fb87ff0eedb5f579a75 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | AgNO3/code | d17313709ee5db1eac38e5811244cecfdfc23f93 | b40a4559a10b3e84840994c3fd15d5f53b89168f | refs/heads/main | 2023-07-28T17:27:53.045940 | 2021-09-17T14:25:01 | 2021-09-17T14:31:41 | 407,567,058 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 613 | java | /**
* © 2016 AgNO3 Gmbh & Co. KG
* All right reserved.
*
* Created: 15.06.2016 by mbechler
*/
package eu.agno3.fileshare.webgui.init;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Alternative;
import eu.agno3.runtime.jsf.config.ThemeConfig;
/**
* @author mbechler
*
*/
@ApplicationScoped
@Alternative
public class FileshareThemeConfig implements ThemeConfig {
/**
* {@inheritDoc}
*
* @see eu.agno3.runtime.jsf.config.ThemeSelector#getTheme()
*/
@Override
public String getTheme () {
return "agno3"; //$NON-NLS-1$
}
}
| [
"bechler@agno3.eu"
] | bechler@agno3.eu |
8962812702b7edd2b009a0a1c204c3cc3c9e897a | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/15/15_fd3537f54d0ed94906570f72fab4ce5aef8773a0/GetMultipleAttributeTest/15_fd3537f54d0ed94906570f72fab4ce5aef8773a0_GetMultipleAttributeTest_s.java | 0f8914c8419e4a08f275f3d309cfafc627d89a62 | [] | 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,654 | java | package org.openqa.selenium;
import org.junit.Test;
import org.openqa.selenium.testing.JUnit4TestBase;
import static org.junit.Assert.assertEquals;
public class GetMultipleAttributeTest extends JUnit4TestBase {
@Test
public void testMultipleAttributeShouldBeFalseWhenNotSet() {
driver.get(pages.selectPage);
WebElement element = driver.findElement(By.id("selectWithoutMultiple"));
assertEquals("false", element.getAttribute("multiple"));
}
@Test
public void testMultipleAttributeShouldBeTrueWhenSet() {
driver.get(pages.selectPage);
WebElement element = driver.findElement(By.id("selectWithMultipleEqualsMultiple"));
assertEquals("true", element.getAttribute("multiple"));
}
@Test
public void testMultipleAttributeShouldBeTrueWhenSelectHasMutilpeWithValueAsBlank() {
driver.get(pages.selectPage);
WebElement element = driver.findElement(By.id("selectWithEmptyStringMultiple"));
assertEquals("true", element.getAttribute("multiple"));
}
@Test
public void testMultipleAttributeShouldBeTrueWhenSelectHasMutilpeWithoutAValue() {
driver.get(pages.selectPage);
WebElement element = driver.findElement(By.id("selectWithMultipleWithoutValue"));
assertEquals("true", element.getAttribute("multiple"));
}
@Test
public void testMultipleAttributeShouldBeTrueWhenSelectHasMutilpeWithValueAsSomethingElse() {
driver.get(pages.selectPage);
WebElement element = driver.findElement(By.id("selectWithRandomMultipleValue"));
assertEquals("true", element.getAttribute("multiple"));
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
972c1d21e5610b6c0ea8f883508876779eb42336 | 23f27a4609c6125a7308117fe0ae9e4e9578ffa4 | /src/main/java/duelistmod/cards/other/tempCards/SplendidConfirmCard.java | 4580331428f1fe54fd204f2cd6e6bd4176c23426 | [
"Unlicense"
] | permissive | ascriptmaster/StS-DuelistMod | 269b078b074b4a76828d86d98cf03c7446510995 | 251c29117779f0e75c3424263e669b720f35ed1a | refs/heads/master | 2023-05-26T09:23:07.510791 | 2021-04-05T05:07:42 | 2021-04-05T05:14:42 | 226,347,190 | 0 | 0 | Unlicense | 2019-12-06T14:30:34 | 2019-12-06T14:30:33 | null | UTF-8 | Java | false | false | 3,300 | java | package duelistmod.cards.other.tempCards;
import java.util.ArrayList;
import com.megacrit.cardcrawl.actions.common.ExhaustSpecificCardAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.core.CardCrawlGame;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.localization.CardStrings;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import duelistmod.DuelistMod;
import duelistmod.abstracts.DuelistCard;
import duelistmod.patches.AbstractCardEnum;
import duelistmod.powers.StrengthDownPower;
import duelistmod.variables.Tags;
public class SplendidConfirmCard extends DuelistCard
{
// TEXT DECLARATION
public static final String ID = DuelistMod.makeID("SplendidConfirmCard");
private static final CardStrings cardStrings = CardCrawlGame.languagePack.getCardStrings(ID);
public static final String IMG = DuelistMod.makeCardPath("SplendidRoseSkill.png");
public static final String NAME = cardStrings.NAME;
public static final String DESCRIPTION = cardStrings.DESCRIPTION;
public static final String UPGRADE_DESCRIPTION = cardStrings.UPGRADE_DESCRIPTION;
// /TEXT DECLARATION/
// STAT DECLARATION
private static final CardRarity RARITY = CardRarity.SPECIAL;
private static final CardTarget TARGET = CardTarget.NONE;
private static final CardType TYPE = CardType.SKILL;
public static final CardColor COLOR = AbstractCardEnum.DUELIST_SPELLS;
private static final int COST = -2;
// /STAT DECLARATION/
public SplendidConfirmCard(int magic)
{
super(ID, NAME, IMG, COST, DESCRIPTION, TYPE, COLOR, RARITY, TARGET);
this.purgeOnUse = true;
this.dontTriggerOnUseCard = true;
this.magicNumber = this.baseMagicNumber = magic;
}
@Override public String getID() { return this.cardID; }
@Override public AbstractCard makeCopy() { return new SplendidConfirmCard(this.magicNumber); }
@Override public AbstractCard makeStatEquivalentCopy() { return new SplendidConfirmCard(this.magicNumber); }
@Override public void use(AbstractPlayer p, AbstractMonster m)
{
ArrayList<DuelistCard> plants = new ArrayList<DuelistCard>();
for (AbstractCard c : p.discardPile.group)
{
if (c.hasTag(Tags.PLANT) && allowResummonsWithExtraChecks(c))
{
plants.add((DuelistCard) c);
}
}
if (plants.size() > 0)
{
AbstractCard randomPlant = plants.get(AbstractDungeon.cardRandomRng.random(plants.size() - 1));
AbstractMonster mon = AbstractDungeon.getRandomMonster();
if (mon != null)
{
AbstractDungeon.actionManager.addToTop(new ExhaustSpecificCardAction(randomPlant, p.discardPile));
applyPower(new StrengthDownPower(mon, p, 1, this.magicNumber), mon);
}
}
}
@Override public void onTribute(DuelistCard tributingCard) {}
@Override public void onResummon(int summons) {}
@Override public void summonThis(int summons, DuelistCard c, int var) { }
@Override public void summonThis(int summons, DuelistCard c, int var, AbstractMonster m) { }
@Override public void upgrade() {}
@Override public void optionSelected(AbstractPlayer arg0, AbstractMonster arg1, int arg2) {}
} | [
"nyoxidetwitter@gmail.com"
] | nyoxidetwitter@gmail.com |
527de5a9b7f0918cfd62d8e34e540f4b4470d110 | 2312f07ef2524597a00ac84c5537563f950690f7 | /decompile/src/main/java/com/badlogic/gdx/scenes/scene2d/actions/MoveBy.java | 8dd81b967eaf25cf85838f9a8323a7e673867b55 | [] | no_license | jinkg/ETW_Components | 6cd1ed14c334779947f09d9e8609552cf9ecfbdd | b16fb28acd4b3e0c68ffd1dbeeb567b6c0371dbc | refs/heads/master | 2021-05-07T06:29:01.507396 | 2018-09-26T12:44:26 | 2018-09-26T12:44:28 | 111,760,297 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,378 | java | /*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* 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.badlogic.gdx.scenes.scene2d.actions;
import com.badlogic.gdx.scenes.scene2d.Action;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.AnimationAction;
public class MoveBy extends AnimationAction {
private static final ActionResetingPool<MoveBy> pool = new ActionResetingPool<MoveBy>(4, 100) {
@Override
protected MoveBy newObject () {
return new MoveBy();
}
};
protected float initialX;
protected float initialY;
protected float x;
protected float y;
protected float startX;
protected float startY;
protected float deltaX;
protected float deltaY;
public static MoveBy $ (float x, float y, float duration) {
MoveBy action = pool.obtain();
action.x = action.initialX = x;
action.y = action.initialY = y;
action.duration = duration;
action.invDuration = 1 / duration;
return action;
}
@Override
public void setTarget (Actor actor) {
this.target = actor;
this.startX = target.x;
this.startY = target.y;
this.deltaX = x;
this.deltaY = y;
this.x = target.x + x;
this.y = target.y + y;
this.taken = 0;
this.done = false;
}
@Override
public void act (float delta) {
float alpha = createInterpolatedAlpha(delta);
if (done) {
target.x = x;
target.y = y;
} else {
target.x = startX + deltaX * alpha;
target.y = startY + deltaY * alpha;
}
}
@Override
public void finish () {
super.finish();
pool.free(this);
}
@Override
public Action copy () {
MoveBy moveBy = $(initialX, initialY, duration);
if (interpolator != null) moveBy.setInterpolator(interpolator.copy());
return moveBy;
}
}
| [
"jinyalin@baidu.com"
] | jinyalin@baidu.com |
98d954186d8e9275e5b0c4e03be29c9e01c8d653 | 063f3b313356c366f7c12dd73eb988a73130f9c9 | /erp_ejb/src_inventario/com/bydan/erp/inventario/util/report/MovimientosResumidosParameterReturnGeneral.java | 262b200ccf0c379ba001c5522fc0cf32b3e24aac | [
"Apache-2.0"
] | permissive | bydan/pre | 0c6cdfe987b964e6744ae546360785e44508045f | 54674f4dcffcac5dbf458cdf57a4c69fde5c55ff | refs/heads/master | 2020-12-25T14:58:12.316759 | 2016-09-01T03:29:06 | 2016-09-01T03:29:06 | 67,094,354 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,711 | java | /*
*AVISO LEGAL
© Copyright
*Este programa esta protegido por la ley de derechos de autor.
*La reproduccion o distribucion ilicita de este programa o de cualquiera de
*sus partes esta penado por la ley con severas sanciones civiles y penales,
*y seran objeto de todas las sanciones legales que correspondan.
*Su contenido no puede copiarse para fines comerciales o de otras,
*ni puede mostrarse, incluso en una version modificada, en otros sitios Web.
Solo esta permitido colocar hipervinculos al sitio web.
*/
package com.bydan.erp.inventario.util.report;
import java.util.Set;
import java.util.HashSet;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
import java.util.Date;
import java.sql.Timestamp;
import org.hibernate.validator.*;
import com.bydan.framework.erp.business.entity.GeneralEntity;
import com.bydan.framework.erp.business.entity.GeneralEntityParameterReturnGeneral;
import com.bydan.framework.erp.business.entity.GeneralEntityReturnGeneral;
import com.bydan.framework.erp.business.entity.Classe;
import com.bydan.framework.erp.business.dataaccess.ConstantesSql;
//import com.bydan.framework.erp.business.entity.Mensajes;
import com.bydan.framework.erp.util.Constantes;
import com.bydan.framework.erp.util.DeepLoadType;
import com.bydan.erp.inventario.util.report.MovimientosResumidosConstantesFunciones;
import com.bydan.erp.inventario.business.entity.report.*;//MovimientosResumidos
import com.bydan.erp.seguridad.business.entity.*;
import com.bydan.erp.tesoreria.business.entity.*;
@SuppressWarnings("unused")
public class MovimientosResumidosParameterReturnGeneral extends GeneralEntityParameterReturnGeneral implements Serializable {
private static final long serialVersionUID=1L;
protected MovimientosResumidos movimientosresumidos;
protected List<MovimientosResumidos> movimientosresumidoss;
public List<Empresa> empresasForeignKey;
public List<Sucursal> sucursalsForeignKey;
public List<Transaccion> transaccionsForeignKey;
public MovimientosResumidosParameterReturnGeneral () throws Exception {
super();
this.movimientosresumidoss= new ArrayList<MovimientosResumidos>();
this.movimientosresumidos= new MovimientosResumidos();
this.empresasForeignKey=new ArrayList<Empresa>();
this.sucursalsForeignKey=new ArrayList<Sucursal>();
this.transaccionsForeignKey=new ArrayList<Transaccion>();
}
public MovimientosResumidos getMovimientosResumidos() throws Exception {
return movimientosresumidos;
}
public void setMovimientosResumidos(MovimientosResumidos newMovimientosResumidos) {
this.movimientosresumidos = newMovimientosResumidos;
}
public List<MovimientosResumidos> getMovimientosResumidoss() throws Exception {
return movimientosresumidoss;
}
public void setMovimientosResumidoss(List<MovimientosResumidos> newMovimientosResumidoss) {
this.movimientosresumidoss = newMovimientosResumidoss;
}
public List<Empresa> getempresasForeignKey() {
return this.empresasForeignKey;
}
public List<Sucursal> getsucursalsForeignKey() {
return this.sucursalsForeignKey;
}
public List<Transaccion> gettransaccionsForeignKey() {
return this.transaccionsForeignKey;
}
public void setempresasForeignKey(List<Empresa> empresasForeignKey) {
this.empresasForeignKey=empresasForeignKey;
}
public void setsucursalsForeignKey(List<Sucursal> sucursalsForeignKey) {
this.sucursalsForeignKey=sucursalsForeignKey;
}
public void settransaccionsForeignKey(List<Transaccion> transaccionsForeignKey) {
this.transaccionsForeignKey=transaccionsForeignKey;
}
}
| [
"byrondanilo10@hotmail.com"
] | byrondanilo10@hotmail.com |
53bb852b00305ae63c0a3d01804af5d3950db382 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/JetBrains--intellij-community/653b6df9ecdabcfac96679833ebc7611cf313bce/before/ToolRunProfile.java | f6f9c6a0004ab13e5fbeeca863e117a69a07a68f | [] | 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 | 3,785 | java | /*
* Copyright (c) 2000-2004 by JetBrains s.r.o. All Rights Reserved.
* Use is subject to license terms.
*/
package com.intellij.tools;
import com.intellij.execution.ExecutionException;
import com.intellij.execution.ExecutionResult;
import com.intellij.execution.configurations.*;
import com.intellij.execution.filters.RegexpFilter;
import com.intellij.execution.filters.TextConsoleBuilder;
import com.intellij.execution.filters.TextConsoleBuilderFactory;
import com.intellij.execution.process.OSProcessHandler;
import com.intellij.execution.process.ProcessHandler;
import com.intellij.execution.process.ProcessTerminatedListener;
import com.intellij.execution.runners.ProgramRunner;
import com.intellij.execution.runners.RunnerInfo;
import com.intellij.ide.IdeEventQueue;
import com.intellij.ide.impl.DataManagerImpl;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
/**
* @author Eugene Zhuravlev
* Date: Mar 30, 2005
*/
public class ToolRunProfile implements RunProfile{
private final Tool myTool;
private final GeneralCommandLine myCommandLine;
public ToolRunProfile(final Tool tool, final DataContext context) {
myTool = tool;
myCommandLine = myTool.createCommandLine(context);
if (context instanceof DataManagerImpl.MyDataContext) {
// hack: macro.expand() can cause UI events such as showing dialogs ('Prompt' macro) which may 'invalidate' the datacontext
// since we know exactly that context is valid, we need to update its event count
((DataManagerImpl.MyDataContext)context).setEventCount(IdeEventQueue.getInstance().getEventCount());
}
}
public String getName() {
return myTool.getName();
}
public void checkConfiguration() throws RuntimeConfigurationException {
}
public Module[] getModules() {
return null;
}
public RunProfileState getState(DataContext context, RunnerInfo runnerInfo, RunnerSettings runnerSettings, ConfigurationPerRunnerSettings configurationSettings) {
final Project project = PlatformDataKeys.PROJECT.getData(context);
if (project == null || myCommandLine == null) {
// can return null if creation of cmd line has been cancelled
return null;
}
final CommandLineState commandLineState = new CommandLineState(runnerSettings, configurationSettings) {
GeneralCommandLine createCommandLine() {
return myCommandLine;
}
protected OSProcessHandler startProcess() throws ExecutionException {
final GeneralCommandLine commandLine = createCommandLine();
final OSProcessHandler processHandler = new OSProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString());
ProcessTerminatedListener.attach(processHandler);
return processHandler;
}
public ExecutionResult execute(@NotNull ProgramRunner runner) throws ExecutionException {
final ExecutionResult result = super.execute(runner);
final ProcessHandler processHandler = result.getProcessHandler();
if (processHandler != null) {
processHandler.addProcessListener(new ToolProcessAdapter(project, myTool.synchronizeAfterExecution(), getName()));
}
return result;
}
};
TextConsoleBuilder builder = TextConsoleBuilderFactory.getInstance().createBuilder(project);
final FilterInfo[] outputFilters = myTool.getOutputFilters();
for (int i = 0; i < outputFilters.length; i++) {
builder.addFilter(new RegexpFilter(project, outputFilters[i].getRegExp()));
}
commandLineState.setConsoleBuilder(builder);
return commandLineState;
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
4094fd0e51409e4189ed9840bf759e993a694d07 | 5598faaaaa6b3d1d8502cbdaca903f9037d99600 | /code_changes/Apache_projects/HDFS-40/32c5e8f49fa483c7580cc70c606da7413cdc3f7b/TestUnderReplicatedBlocks.java | 8eaa2ece54bfebfa6ad2eeefccb6356b3c52774b | [] | no_license | SPEAR-SE/LogInBugReportsEmpirical_Data | 94d1178346b4624ebe90cf515702fac86f8e2672 | ab9603c66899b48b0b86bdf63ae7f7a604212b29 | refs/heads/master | 2022-12-18T02:07:18.084659 | 2020-09-09T16:49:34 | 2020-09-09T16:49:34 | 286,338,252 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,791 | java | package org.apache.hadoop.hdfs.server.namenode;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.FsShell;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hdfs.DFSTestUtil;
import org.apache.hadoop.hdfs.MiniDFSCluster;
import org.apache.hadoop.hdfs.protocol.Block;
import junit.framework.TestCase;
public class TestUnderReplicatedBlocks extends TestCase {
public void testSetrepIncWithUnderReplicatedBlocks() throws Exception {
Configuration conf = new Configuration();
final short REPLICATION_FACTOR = 2;
final String FILE_NAME = "/testFile";
final Path FILE_PATH = new Path(FILE_NAME);
MiniDFSCluster cluster = new MiniDFSCluster(conf, REPLICATION_FACTOR+1, true, null);
try {
// create a file with one block with a replication factor of 2
final FileSystem fs = cluster.getFileSystem();
DFSTestUtil.createFile(fs, FILE_PATH, 1L, REPLICATION_FACTOR, 1L);
DFSTestUtil.waitReplication(fs, FILE_PATH, REPLICATION_FACTOR);
// remove one replica from the blocksMap so block becomes under-replicated
// but the block does not get put into the under-replicated blocks queue
FSNamesystem namesystem = cluster.getNameNode().getNamesystem();
Block b = DFSTestUtil.getFirstBlock(fs, FILE_PATH);
DatanodeDescriptor dn = namesystem.blocksMap.nodeIterator(b).next();
namesystem.addToInvalidates(b, dn);
namesystem.blocksMap.removeNode(b, dn);
// increment this file's replication factor
FsShell shell = new FsShell(conf);
assertEquals(0, shell.run(new String[]{
"-setrep", "-w", Integer.toString(1+REPLICATION_FACTOR), FILE_NAME}));
} finally {
cluster.shutdown();
}
}
}
| [
"archen94@gmail.com"
] | archen94@gmail.com |
1fde11ffcc837810c6158fe1ddc00f6ce7780396 | 5d66694b414cd8dedca808e8a15cce3596ef3dc5 | /src/main/java/com/fseconomy2/config/WebsocketConfiguration.java | ef622297a3afad0a69faa190cc2318a4f5ef8f23 | [] | no_license | postalservice14/fseconomy2 | fc32d63e56c1d20164c85fc096fef58c6785c740 | 9f175bcf7b7332d2d7fb8670be946c7c87dc4def | refs/heads/master | 2020-04-17T19:01:43.017585 | 2019-01-21T17:17:41 | 2019-01-21T17:17:41 | 166,851,335 | 0 | 0 | null | 2019-01-21T17:17:41 | 2019-01-21T17:13:32 | Java | UTF-8 | Java | false | false | 3,465 | java | package com.fseconomy2.config;
import com.fseconomy2.security.AuthoritiesConstants;
import java.security.Principal;
import java.util.*;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.server.*;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.security.authentication.AnonymousAuthenticationToken;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.config.annotation.*;
import org.springframework.web.socket.server.HandshakeInterceptor;
import org.springframework.web.socket.server.support.DefaultHandshakeHandler;
import io.github.jhipster.config.JHipsterProperties;
@Configuration
@EnableWebSocketMessageBroker
public class WebsocketConfiguration implements WebSocketMessageBrokerConfigurer {
public static final String IP_ADDRESS = "IP_ADDRESS";
private final JHipsterProperties jHipsterProperties;
public WebsocketConfiguration(JHipsterProperties jHipsterProperties) {
this.jHipsterProperties = jHipsterProperties;
}
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/topic");
}
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
String[] allowedOrigins = Optional.ofNullable(jHipsterProperties.getCors().getAllowedOrigins()).map(origins -> origins.toArray(new String[0])).orElse(new String[0]);
registry.addEndpoint("/websocket/tracker")
.setHandshakeHandler(defaultHandshakeHandler())
.setAllowedOrigins(allowedOrigins)
.withSockJS()
.setInterceptors(httpSessionHandshakeInterceptor());
}
@Bean
public HandshakeInterceptor httpSessionHandshakeInterceptor() {
return new HandshakeInterceptor() {
@Override
public boolean beforeHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Map<String, Object> attributes) throws Exception {
if (request instanceof ServletServerHttpRequest) {
ServletServerHttpRequest servletRequest = (ServletServerHttpRequest) request;
attributes.put(IP_ADDRESS, servletRequest.getRemoteAddress());
}
return true;
}
@Override
public void afterHandshake(ServerHttpRequest request, ServerHttpResponse response, WebSocketHandler wsHandler, Exception exception) {
}
};
}
private DefaultHandshakeHandler defaultHandshakeHandler() {
return new DefaultHandshakeHandler() {
@Override
protected Principal determineUser(ServerHttpRequest request, WebSocketHandler wsHandler, Map<String, Object> attributes) {
Principal principal = request.getPrincipal();
if (principal == null) {
Collection<SimpleGrantedAuthority> authorities = new ArrayList<>();
authorities.add(new SimpleGrantedAuthority(AuthoritiesConstants.ANONYMOUS));
principal = new AnonymousAuthenticationToken("WebsocketConfiguration", "anonymous", authorities);
}
return principal;
}
};
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
56020249952116fc9e34f94430f446cb33b679b2 | eb9f655206c43c12b497c667ba56a0d358b6bc3a | /plugins/kotlin/jvm-debugger/test/k2/test/org/jetbrains/kotlin/idea/k2/debugger/test/cases/K2IdeK1CodeContinuationStackTraceTestGenerated.java | 2714dcc6122dc0e3e0020f3e1357874036f4275a | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | JetBrains/intellij-community | 2ed226e200ecc17c037dcddd4a006de56cd43941 | 05dbd4575d01a213f3f4d69aa4968473f2536142 | refs/heads/master | 2023-09-03T17:06:37.560889 | 2023-09-03T11:51:00 | 2023-09-03T12:12:27 | 2,489,216 | 16,288 | 6,635 | Apache-2.0 | 2023-09-12T07:41:58 | 2011-09-30T13:33:05 | null | UTF-8 | Java | false | false | 1,543 | java | // Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.k2.debugger.test.cases;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.idea.test.JUnit3RunnerWithInners;
import org.jetbrains.kotlin.idea.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.TestMetadata;
import org.jetbrains.kotlin.idea.base.test.TestRoot;
import org.junit.runner.RunWith;
/**
* This class is generated by {@link org.jetbrains.kotlin.testGenerator.generator.TestGenerator}.
* DO NOT MODIFY MANUALLY.
*/
@SuppressWarnings("all")
@TestRoot("jvm-debugger/test/k2")
@TestDataPath("$CONTENT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../testData/continuation")
public class K2IdeK1CodeContinuationStackTraceTestGenerated extends AbstractK2IdeK1CodeContinuationStackTraceTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("suspendFun.kt")
public void testSuspendFun() throws Exception {
runTest("../testData/continuation/suspendFun.kt");
}
@TestMetadata("suspendFunWithInner.kt")
public void testSuspendFunWithInner() throws Exception {
runTest("../testData/continuation/suspendFunWithInner.kt");
}
@TestMetadata("suspendLambda.kt")
public void testSuspendLambda() throws Exception {
runTest("../testData/continuation/suspendLambda.kt");
}
}
| [
"intellij-monorepo-bot-no-reply@jetbrains.com"
] | intellij-monorepo-bot-no-reply@jetbrains.com |
4bdc42eef126b849d8342ebde921b7d1f484b3e7 | 4f75aced9df84e9866b2c5581b774d08d03f5b8b | /app/src/main/java/com/example/wolfknight/alphabet/CanvasView.java | 31b4197a7d2960dfad989c9f32c9a2eca687458a | [] | no_license | chaudharydevender95/alphabet | 66d87326079446a5d911b4160b2660629cff066a | 9cf0da08f3c4d852c57d3c0d0be4e809948b2ca8 | refs/heads/master | 2021-08-15T07:51:00.058624 | 2017-11-17T15:35:28 | 2017-11-17T15:35:28 | 109,419,881 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,538 | java | package com.example.wolfknight.alphabet;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
/**
* Created by lenovo on 5/6/2017.
*/
public class CanvasView extends View {
public int width;
public int height;
private Bitmap mBitmap;
private Canvas mCanvas;
private Path mPath;
Context context;
private Paint mPaint;
private float mX, mY;
private static final float TOLERANCE = 5;
public CanvasView(Context context) {
super(context);
}
public CanvasView(Context c, @Nullable AttributeSet attrs) {
super(c, attrs);
context = c;
// we set a new Path
mPath = new Path();
// and we set a new Paint with the desired attributes
mPaint = new Paint();
mPaint.setAntiAlias(true);
mPaint.setColor(Color.GREEN);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeWidth(15);
}
public CanvasView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
public CanvasView(Context context, @Nullable AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
// override onSizeChanged
@Override
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
// your Canvas will draw onto the defined Bitmap
mBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
mCanvas = new Canvas(mBitmap);
}
// override onDraw
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
// draw the mPath with the mPaint on the canvas when onDraw
canvas.drawPath(mPath, mPaint);
}
// when ACTION_DOWN start touch according to the x,y values
private void startTouch(float x, float y) {
mPath.moveTo(x, y);
mX = x;
mY = y;
}
// when ACTION_MOVE move touch according to the x,y values
private void moveTouch(float x, float y) {
float dx = Math.abs(x - mX);
float dy = Math.abs(y - mY);
if (dx >= TOLERANCE || dy >= TOLERANCE) {
mPath.quadTo(mX, mY, (x + mX) / 2, (y + mY) / 2);
mX = x;
mY = y;
}
}
public void clearCanvas() {
mPath.reset();
invalidate();
}
// when ACTION_UP stop touch
private void upTouch() {
mPath.lineTo(mX, mY);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
float x = event.getX();
float y = event.getY();
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
startTouch(x, y);
invalidate();
break;
case MotionEvent.ACTION_MOVE:
moveTouch(x, y);
invalidate();
break;
case MotionEvent.ACTION_UP:
upTouch();
invalidate();
break;
}
return true;
}
}
| [
"root@localhost.localdomain"
] | root@localhost.localdomain |
d4b92c3cb59a5625a9a0e96c41caac00633202f9 | 847118a8f7454f95c025d9f6408ba7a35a678eab | /src/test/java/org/reaktivity/nukleus/tls/internal/control/ControlIT.java | 1b73efd32ca4b0932a1ae6729f11caf36d75552f | [
"Apache-2.0"
] | permissive | dpwspoon/nukleus-tls.java | 6b3fe59cd480a2f6b3dfa7e3a12ebf168fa94391 | a902f7ff775aa959ef074def438066c252370f41 | refs/heads/develop | 2020-06-28T01:59:34.444613 | 2017-10-31T20:42:11 | 2017-10-31T20:42:11 | 94,258,114 | 0 | 0 | null | 2017-06-13T21:08:48 | 2017-06-13T21:08:48 | null | UTF-8 | Java | false | false | 2,543 | java | /**
* Copyright 2016-2017 The Reaktivity Project
*
* The Reaktivity 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 org.reaktivity.nukleus.tls.internal.control;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.junit.rules.RuleChain.outerRule;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.DisableOnDebug;
import org.junit.rules.TestRule;
import org.junit.rules.Timeout;
import org.kaazing.k3po.junit.annotation.Specification;
import org.kaazing.k3po.junit.rules.K3poRule;
import org.reaktivity.reaktor.test.ReaktorRule;
public class ControlIT
{
private final K3poRule k3po = new K3poRule()
.addScriptRoot("route", "org/reaktivity/specification/nukleus/tls/control/route")
.addScriptRoot("unroute", "org/reaktivity/specification/nukleus/tls/control/unroute");
private final TestRule timeout = new DisableOnDebug(new Timeout(5, SECONDS));
private final ReaktorRule reaktor = new ReaktorRule()
.directory("target/nukleus-itests")
.commandBufferCapacity(1024)
.responseBufferCapacity(1024)
.counterValuesBufferCapacity(1024)
.nukleus("tls"::equals);
@Rule
public final TestRule chain = outerRule(k3po).around(timeout).around(reaktor);
@Test
@Specification({
"${route}/server/controller"
})
public void shouldRouteServer() throws Exception
{
k3po.finish();
}
@Test
@Specification({
"${route}/client/controller"
})
public void shouldRouteClient() throws Exception
{
k3po.finish();
}
@Test
@Specification({
"${route}/server/controller",
"${unroute}/server/controller"
})
public void shouldUnrouteServer() throws Exception
{
k3po.finish();
}
@Test
@Specification({
"${route}/client/controller",
"${unroute}/client/controller"
})
public void shouldUnrouteClient() throws Exception
{
k3po.finish();
}
}
| [
"john.fallows@kaazing.com"
] | john.fallows@kaazing.com |
253efa9da4e11bc086b1d057b1177d3e8aa88309 | 983dfd9db8e98d1db49220b54be2facd9c1c7272 | /bypass/build/generated/source/r/debug/in/uncod/android/bypass/R.java | daac0bfe69db82e62f08572e8954f2b18201571f | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | amit-upadhyay-IT/AboutForAPI21andAbove | 5ee616d69068e1d4c262b386ca2c73d5b60e8d30 | 62382bba1dc271093222cb05c40225308b54bad3 | refs/heads/master | 2021-01-11T12:30:09.457565 | 2016-12-14T15:01:16 | 2016-12-14T15:01:16 | 76,300,150 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 376 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package in.uncod.android.bypass;
public final class R {
public static final class attr {
}
public static final class string {
public static int app_name=0x7f020000;
}
}
| [
"youarefreak1@gmail.com"
] | youarefreak1@gmail.com |
5648070ae1a85257ad28e86fc505823df62b3b84 | 73a82bfb539e6200554b7309fff657e70e53ac64 | /concurrent-simple/src/main/java/cn/edu/cqvie/thread/tc/tc6/Demo.java | efd8e0b0397074553aff7107db409c4204bba4be | [] | no_license | rwindwh/concurrent-demo | 305667232436bddff53cf5e4d473be0f5e3eb53d | f0c87eb2b48852e698135e33648641d551012680 | refs/heads/master | 2021-03-17T04:34:16.146363 | 2020-02-22T13:23:59 | 2020-02-22T13:23:59 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,365 | java | package cn.edu.cqvie.thread.tc.tc6;
import java.util.concurrent.*;
public class Demo {
public static void main(String[] args) {
int nThread = Runtime.getRuntime().availableProcessors();
ExecutorService executorService =
new ThreadPoolExecutor(nThread,
4, 8, TimeUnit.SECONDS,
new LinkedBlockingDeque<>(16),
new ThreadFactory() {
int i = 0;
@Override
public Thread newThread(Runnable r) {
return new Thread(r, "pool-" + i++);
}
}, new ThreadPoolExecutor.CallerRunsPolicy());
for (int i = 0; i < 100; i++) {
executorService.submit(() -> {
System.out.println(Thread.currentThread().getName());
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
}
executorService.isShutdown();
while (executorService.isTerminated()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
| [
"xxx@xxx.com"
] | xxx@xxx.com |
727d97176e49de707b6daa3da0277edf2c7afbf4 | 38b42aa714e2489714dd02f45d9fa88665257f5f | /logs/src/main/java/com/jdcloud/sdk/service/logs/model/DescribeLogtopicResult.java | 34ea0d7b4dfcead1ed7f34f66c173327f29b0855 | [
"Apache-2.0"
] | permissive | Tanc009/jdcloud-sdk-java | 6de6c2cb521d5946de08b9503baa37f859f89848 | 12181e43d1396218e79639dbee387852c85b93b2 | refs/heads/master | 2021-08-09T01:17:14.569048 | 2021-06-25T02:51:24 | 2021-06-25T02:51:24 | 130,201,324 | 0 | 0 | Apache-2.0 | 2018-04-19T10:48:05 | 2018-04-19T10:48:05 | null | UTF-8 | Java | false | false | 6,403 | java | /*
* Copyright 2018 JDCLOUD.COM
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:#www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Logtopic APIs
* 日志服务日志主题相关的管理控制接口
*
* OpenAPI spec version: v1
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
package com.jdcloud.sdk.service.logs.model;
import com.jdcloud.sdk.service.JdcloudResult;
/**
* 查询日志主题基本信息。如配置了采集配置,将返回采集配置的UID
*/
public class DescribeLogtopicResult extends JdcloudResult implements java.io.Serializable {
private static final long serialVersionUID = 1L;
/**
* UID
*/
private String uID;
/**
* 日志来源,只在查询单个日志主题并且创建了采集配置时返回值
*/
private String appCode;
/**
* 采集配置UID
*/
private String collectInfoUID;
/**
* 创建时间
*/
private String createTime;
/**
* 描述信息
*/
private String description;
/**
* 所属日志集名称
*/
private String logsetName;
/**
* 所属日志集
*/
private String logsetUID;
/**
* 日志主题名称
*/
private String name;
/**
* 地域信息
*/
private String region;
/**
* get UID
*
* @return
*/
public String getUID() {
return uID;
}
/**
* set UID
*
* @param uID
*/
public void setUID(String uID) {
this.uID = uID;
}
/**
* get 日志来源,只在查询单个日志主题并且创建了采集配置时返回值
*
* @return
*/
public String getAppCode() {
return appCode;
}
/**
* set 日志来源,只在查询单个日志主题并且创建了采集配置时返回值
*
* @param appCode
*/
public void setAppCode(String appCode) {
this.appCode = appCode;
}
/**
* get 采集配置UID
*
* @return
*/
public String getCollectInfoUID() {
return collectInfoUID;
}
/**
* set 采集配置UID
*
* @param collectInfoUID
*/
public void setCollectInfoUID(String collectInfoUID) {
this.collectInfoUID = collectInfoUID;
}
/**
* get 创建时间
*
* @return
*/
public String getCreateTime() {
return createTime;
}
/**
* set 创建时间
*
* @param createTime
*/
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
/**
* get 描述信息
*
* @return
*/
public String getDescription() {
return description;
}
/**
* set 描述信息
*
* @param description
*/
public void setDescription(String description) {
this.description = description;
}
/**
* get 所属日志集名称
*
* @return
*/
public String getLogsetName() {
return logsetName;
}
/**
* set 所属日志集名称
*
* @param logsetName
*/
public void setLogsetName(String logsetName) {
this.logsetName = logsetName;
}
/**
* get 所属日志集
*
* @return
*/
public String getLogsetUID() {
return logsetUID;
}
/**
* set 所属日志集
*
* @param logsetUID
*/
public void setLogsetUID(String logsetUID) {
this.logsetUID = logsetUID;
}
/**
* get 日志主题名称
*
* @return
*/
public String getName() {
return name;
}
/**
* set 日志主题名称
*
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* get 地域信息
*
* @return
*/
public String getRegion() {
return region;
}
/**
* set 地域信息
*
* @param region
*/
public void setRegion(String region) {
this.region = region;
}
/**
* set UID
*
* @param uID
*/
public DescribeLogtopicResult uID(String uID) {
this.uID = uID;
return this;
}
/**
* set 日志来源,只在查询单个日志主题并且创建了采集配置时返回值
*
* @param appCode
*/
public DescribeLogtopicResult appCode(String appCode) {
this.appCode = appCode;
return this;
}
/**
* set 采集配置UID
*
* @param collectInfoUID
*/
public DescribeLogtopicResult collectInfoUID(String collectInfoUID) {
this.collectInfoUID = collectInfoUID;
return this;
}
/**
* set 创建时间
*
* @param createTime
*/
public DescribeLogtopicResult createTime(String createTime) {
this.createTime = createTime;
return this;
}
/**
* set 描述信息
*
* @param description
*/
public DescribeLogtopicResult description(String description) {
this.description = description;
return this;
}
/**
* set 所属日志集名称
*
* @param logsetName
*/
public DescribeLogtopicResult logsetName(String logsetName) {
this.logsetName = logsetName;
return this;
}
/**
* set 所属日志集
*
* @param logsetUID
*/
public DescribeLogtopicResult logsetUID(String logsetUID) {
this.logsetUID = logsetUID;
return this;
}
/**
* set 日志主题名称
*
* @param name
*/
public DescribeLogtopicResult name(String name) {
this.name = name;
return this;
}
/**
* set 地域信息
*
* @param region
*/
public DescribeLogtopicResult region(String region) {
this.region = region;
return this;
}
} | [
"tancong@jd.com"
] | tancong@jd.com |
2307d77de94ec7adc5ddb454f90ceab837924f44 | dede6aaca13e69cb944986fa3f9485f894444cf0 | /media-hapi/src/main/java/com/dangdang/digital/processor/QueryNewBarrageCommentListsForRangeProcessor.java | 81638102a3f92417fd409844ee7a206620d65b36 | [] | no_license | summerxhf/dang | c0d1e7c2c9436a7c7e7f9c8ef4e547279ec5d441 | f1b459937d235637000fb433919a7859dcd77aba | refs/heads/master | 2020-03-27T08:32:33.743260 | 2015-06-03T08:12:45 | 2015-06-03T08:12:45 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,734 | java | package com.dangdang.digital.processor;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import com.alibaba.dubbo.common.utils.StringUtils;
import com.dangdang.base.comment.client.api.IBarrageCommentApi;
import com.dangdang.base.comment.client.vo.BarrageCommentApiParameterVo;
import com.dangdang.base.comment.client.vo.BarrageCommentVo;
import com.dangdang.common.api.ICommonApi;
import com.dangdang.digital.constant.ErrorCodeEnum;
import com.dangdang.digital.utils.LogUtil;
import com.dangdang.digital.utils.ResultSender;
import com.dangdang.digital.utils.ReturnBeanUtils;
import com.dangdang.digital.vo.ReturnBarrageCommentVo;
/**
*
* Description: 获取指定范围内新增弹幕列表 All Rights Reserved.
*
* @version 1.0 2015年1月6日 下午4:58:19 by 许文轩(xuwenxuan@dangdang.com)创建
*/
@Component("hapiqueryNewBarrageCommentListsForRangeprocessor")
public class QueryNewBarrageCommentListsForRangeProcessor extends BaseApiProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(QueryNewBarrageCommentListsForRangeProcessor.class);
@Resource
private IBarrageCommentApi barrageCommentApi;
@Resource
private ICommonApi commonApi;
@Override
protected void process(HttpServletRequest request, HttpServletResponse response, ResultSender sender)
throws Exception {
// 入参:偏移字数
String offsetWordsStr = request.getParameter("offsetWords");
// 入参: 章节Id
String chapterIdStr = request.getParameter("chapterId");
// 入参: 书籍Id
String mediaIdStr = request.getParameter("mediaId");
// 当前页字符起始位置
String characterStartIndexStr = request.getParameter("characterStartIndex");
// 上次获取的弹幕id
String lastBarrageCommentIdStr = request.getParameter("lastBarrageCommentId");
// 滑动方式 "UP" "DOWN"
String slideWay = request.getParameter("slideWay");
// 入参: 排序方式 ASC DESC
String sequenceWay = request.getParameter("sequenceWay");
if (!checkParams(offsetWordsStr, chapterIdStr, mediaIdStr, characterStartIndexStr, slideWay)) {
sender.fail(ErrorCodeEnum.ERROR_CODE_10002.getErrorCode(),
ErrorCodeEnum.ERROR_CODE_10002.getErrorMessage(), response);
return;
}
try {
Long chapterId = Long.valueOf(chapterIdStr);
Long mediaId = Long.valueOf(mediaIdStr);
Long characterStartIndex = Long.valueOf(characterStartIndexStr);
Integer offsetWords = Integer.valueOf(offsetWordsStr);
if (characterStartIndex < 0 || offsetWords < 0) {
sender.fail(ErrorCodeEnum.ERROR_CODE_10002.getErrorCode(),
ErrorCodeEnum.ERROR_CODE_10002.getErrorMessage(), response);
return;
}
Long lastBarrageCommentId = null;
if (lastBarrageCommentIdStr != null) {
lastBarrageCommentId = Long.valueOf(lastBarrageCommentIdStr);
}
BarrageCommentApiParameterVo barrageCommentApiParameterVo = new BarrageCommentApiParameterVo();
barrageCommentApiParameterVo.setMediaId(mediaId);
barrageCommentApiParameterVo.setChapterId(chapterId);
barrageCommentApiParameterVo.setOffsetWords(offsetWords);
barrageCommentApiParameterVo.setCharacterStartIndex(characterStartIndex);
barrageCommentApiParameterVo.setLastBarrageCommentId(lastBarrageCommentId);
barrageCommentApiParameterVo.setSlideWay(slideWay);
if (StringUtils.isBlank(sequenceWay)) {
sequenceWay = "DESC";
}
barrageCommentApiParameterVo.setSequenceWay(sequenceWay);
List<BarrageCommentVo> barrageCommentList = barrageCommentApi
.queryNewBarrageCommentListsForRange(barrageCommentApiParameterVo);
if (CollectionUtils.isEmpty(barrageCommentList)) {
sender.put("barrageCommentList", null);
sender.success(response);
return;
}
List<String> custIds = new ArrayList<String>();
for (BarrageCommentVo barrageCommentVo : barrageCommentList) {
custIds.add(String.valueOf(barrageCommentVo.getCustId()));
}
Map<String, Map<String, String>> userInfoMap = commonApi.getBatchCustInfos(custIds, 60 * 60 * 2);
List<ReturnBarrageCommentVo> returnList = ReturnBeanUtils.getReturnBarrageCommentVoList(barrageCommentList,
userInfoMap, null, null);
sender.put("barrageCommentList", returnList);
sender.success(response);
} catch (NumberFormatException e) {
LogUtil.error(LOGGER, e, "参数错误");
sender.fail(ErrorCodeEnum.ERROR_CODE_10002.getErrorCode(),
ErrorCodeEnum.ERROR_CODE_10002.getErrorMessage(), response);
}
}
}
| [
"maqiang@dangdang.com"
] | maqiang@dangdang.com |
54b276387318e376951d619b9d1a844260409080 | c22e314eb8b33bb7823f72653e931f82e5ac4175 | /org.dbdoclet.tag/src/main/java/org/dbdoclet/tag/docbook/Tr.java | 6a804c3f207709357c55fa051cb1d921e64144c8 | [] | no_license | mfuchs23/markup | 5239a0448ef07deb8df5751d1e2e9666cdf1501e | af0d1610a1be93c4f1f3bda8ee1e6d9e66cbeaa2 | refs/heads/master | 2023-06-24T15:50:15.997213 | 2023-06-07T10:45:48 | 2023-06-07T10:45:48 | 22,429,612 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 428 | java | /*
* ### Copyright (C) 2015 Michael Fuchs ###
* ### All Rights Reserved. ###
*
* Author: Michael Fuchs
* E-Mail: michael.fuchs@dbdoclet.org
* URL: http://www.michael-a-fuchs.de
*/
package org.dbdoclet.tag.docbook;
public class Tr extends DocBookElement {
private static String tag = "tr";
public static String getTag() {
return tag;
}
Tr() {
super(tag);
setFormatType(FORMAT_BLOCK);
}
}
| [
"michael.fuchs@dbdoclet.org"
] | michael.fuchs@dbdoclet.org |
c1e088408ff0b70c23ee8d705b8e8f6252ca13f5 | 3650ed995c0c1a3835e1905a66bc45d8850d2be0 | /TestStickyListHeaders/src/com/example/teststickylistheaders/headers/ExpandableStickyListHeadersListView.java | 06f73e45bafcf57d2de26ad7c9ba5e05afd69d11 | [] | no_license | maxdeny/test | 7d38f42296822dc4174e25f2e056ef09c2374d9f | 1408429cbf5cc896cf4dfaeb21c6c6faaa9932c7 | refs/heads/master | 2021-01-10T07:25:33.543500 | 2016-04-08T06:00:10 | 2016-04-08T06:00:10 | 55,743,264 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,968 | java | package com.example.teststickylistheaders.headers;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import java.util.List;
/**
* add expand/collapse functions like ExpandableListView
* @author lsjwzh
*/
public class ExpandableStickyListHeadersListView extends StickyListHeadersListView {
public interface IAnimationExecutor{
public void executeAnim(View target,int animType);
}
public final static int ANIMATION_COLLAPSE = 1;
public final static int ANIMATION_EXPAND = 0;
ExpandableStickyListHeadersAdapter mExpandableStickyListHeadersAdapter;
IAnimationExecutor mDefaultAnimExecutor = new IAnimationExecutor() {
@Override
public void executeAnim(View target, int animType) {
if(animType==ANIMATION_EXPAND){
target.setVisibility(VISIBLE);
}else if(animType==ANIMATION_COLLAPSE){
target.setVisibility(GONE);
}
}
};
public ExpandableStickyListHeadersListView(Context context) {
super(context);
}
public ExpandableStickyListHeadersListView(Context context, AttributeSet attrs) {
super(context, attrs);
}
public ExpandableStickyListHeadersListView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
}
@Override
public ExpandableStickyListHeadersAdapter getAdapter() {
return mExpandableStickyListHeadersAdapter;
}
@Override
public void setAdapter(StickyListHeadersAdapter adapter) {
mExpandableStickyListHeadersAdapter = new ExpandableStickyListHeadersAdapter(adapter);
super.setAdapter(mExpandableStickyListHeadersAdapter);
}
public View findViewByItemId(long itemId){
return mExpandableStickyListHeadersAdapter.findViewByItemId(itemId);
}
public long findItemIdByView(View view){
return mExpandableStickyListHeadersAdapter.findItemIdByView(view);
}
public void expand(long headerId) {
if(!mExpandableStickyListHeadersAdapter.isHeaderCollapsed(headerId)){
return;
}
mExpandableStickyListHeadersAdapter.expand(headerId);
//find and expand views in group
List<View> itemViews = mExpandableStickyListHeadersAdapter.getItemViewsByHeaderId(headerId);
if(itemViews==null){
return;
}
for (View view : itemViews) {
animateView(view, ANIMATION_EXPAND);
}
}
public void collapse(long headerId) {
if(mExpandableStickyListHeadersAdapter.isHeaderCollapsed(headerId)){
return;
}
mExpandableStickyListHeadersAdapter.collapse(headerId);
//find and hide views with the same header
List<View> itemViews = mExpandableStickyListHeadersAdapter.getItemViewsByHeaderId(headerId);
if(itemViews==null){
return;
}
for (View view : itemViews) {
animateView(view, ANIMATION_COLLAPSE);
}
}
public boolean isHeaderCollapsed(long headerId){
return mExpandableStickyListHeadersAdapter.isHeaderCollapsed(headerId);
}
public void setAnimExecutor(IAnimationExecutor animExecutor) {
this.mDefaultAnimExecutor = animExecutor;
}
/**
* Performs either COLLAPSE or EXPAND animation on the target view
*
* @param target the view to animate
* @param type the animation type, either ExpandCollapseAnimation.COLLAPSE
* or ExpandCollapseAnimation.EXPAND
*/
private void animateView(final View target, final int type) {
if(ANIMATION_EXPAND==type&&target.getVisibility()==VISIBLE){
return;
}
if(ANIMATION_COLLAPSE==type&&target.getVisibility()!=VISIBLE){
return;
}
if(mDefaultAnimExecutor !=null){
mDefaultAnimExecutor.executeAnim(target,type);
}
}
}
| [
"iamzhuolei@gmail.com"
] | iamzhuolei@gmail.com |
40eb3a5bf06361c1d65dd7a8690c3fdbc89c8b84 | 09960b68707da3891f45ac2eda90e177a742b28d | /web/ahnew/src/main/java/com/szty/aihao/service/aihaospecialkey_service.java | 0bd6436d5219263110505ff2c13f1e3550cabcdb | [] | no_license | jiangyiman/szty | a72434d586f836f8a9039b3a5a293f614a1e4b99 | 9087733b2b88b6ac0e0cd7d13652f02b42cdb848 | refs/heads/master | 2021-05-30T22:03:01.114487 | 2016-03-25T06:25:18 | 2016-03-25T06:25:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,045 | java | /*
*@===================================================================
*@项目说明
*@作者:宋春林
*@版本信息:@Copy Right 2011-2015
*@文件: iDataAihaospecialkey.java
*@项目名称:JAVA项目管理
*@创建时间:2015/10/15
*@===================================================================
*/
package com.szty.aihao.service;
import com.szty.aihao.dao.aihaospecialkey_Dao;
import com.szty.aihao.core.aihaospecialkey_core;
import com.szty.aihao.factory.classFactory;
import java.util.Dictionary;
import java.util.List;
/**
*@文件说明
*@AIHAOSPECIALKEY逻辑层接口
*@作者:宋春林
*/
public class aihaospecialkey_service
{
public aihaospecialkey_core _dal=classFactory.getaihaospecialkey();
/**
* 向数据库中插入一条新记录。
* @param AIHAOSPECIALKEY实体
* @return 新插入记录的编号
*/
public int insert_aihaospecialkey (aihaospecialkey_Dao _AIHAOSPECIALKEYModel ) throws Exception{
return _dal.insert_aihaospecialkey( _AIHAOSPECIALKEYModel);
}
/**
* 向数据库中插入一条新记录。
* @param AIHAOSPECIALKEYprrameter
* @return 新插入记录的编号
*/
public int insert_aihaospecialkey(Object[] _para) throws Exception{
return _dal.insert_aihaospecialkey( _para);
}
/**
* 向数据库中插入一条新记录。
* @param AIHAOSPECIALKEY实体
* @return 影响的行数
*/
public int update_aihaospecialkey(aihaospecialkey_Dao _AIHAOSPECIALKEYModel) throws Exception{
return _dal.update_aihaospecialkey( _AIHAOSPECIALKEYModel);
}
/**
* 删除数据表AIHAOSPECIALKEY中的一条记录
* @param AIHAOSPECIALKEY实体
* @return 新插入记录的编号
*/
public int delete_aihaospecialkey(int Specialkeyid) throws Exception{
return _dal.delete_aihaospecialkey( Specialkeyid);
}
/**
* 得到 aihaospecialkey 数据实体
* @param Specialkeyid">Specialkeyid
* @return<aihaospecialkey 数据实体
* @throws Exception
*/
public aihaospecialkey_Dao get_aihaospecialkeyDao(int Specialkeyid) throws Exception{
return _dal.get_aihaospecialkeyDao( Specialkeyid);
}
/**
* 根据AIHAOSPECIALKEY返回的查询DataRow创建一个AIHAOSPECIALKEYEntity对象
* @param AIHAOSPECIALKEY row
* @returnAIHAOSPECIALKEYList对象
* @throws Exception
*/
public List<aihaospecialkey_Dao> get_aihaospecialkey_All() throws Exception{
return _dal.get_aihaospecialkey_All();
}
/**
* 根据AIHAOSPECIALKEY返回的查询DataRow创建一个AIHAOSPECIALKEYEntity对象
* @param AIHAOSPECIALKEY row
* @returnAIHAOSPECIALKEYList对象
* @throws Exception
*/
public List<aihaospecialkey_Dao> get_aihaospecialkey_All(String strWhere) throws Exception{
return _dal.get_aihaospecialkey_All(strWhere);
}
/* 根据SCLTEST返回 分页数据
*
* @param SCLTEST
* row
* @returnSCLTESTList对象
* @throws Exception
*/
public List<aihaospecialkey_Dao> get_aihaospecialkey_Page(int pageSize, int pageIndex,String strWhere) throws Exception
{
return _dal.get_aihaospecialkey_Page(pageSize,pageIndex,strWhere);
}
/**
* 根据AIHAOSPECIALKEY返回的查询DataRow创建一个AIHAOSPECIALKEYEntity对象
* @param AIHAOSPECIALKEY row
* @returnAIHAOSPECIALKEYDictionary对象
* @throws Exception
*/
public Dictionary<Integer, aihaospecialkey_Dao> get_aihaospecialkey_Dictionary(String strWhere) throws Exception{
return _dal.get_aihaospecialkey_Dictionary(strWhere);
}
/**
* 更新AIHAOSPECIALKEY字段加一
* @param FieldName
* @param sid
*/
public int create_aihaospecialkey_UpdateIncreate(String FieldName,int sid) throws Exception{
return _dal.create_aihaospecialkey_UpdateIncreate( FieldName, sid);
}
/**
* 更新AIHAOSPECIALKEYInt型字段
* @param FieldName
* @param Num
* @param sid
*/
public int create_aihaospecialkey_UpdateInteger(String FieldName,int Num,int sid) throws Exception{
return _dal.create_aihaospecialkey_UpdateInteger( FieldName, Num, sid);
}
/**
* 更新AIHAOSPECIALKEYIString型字段
* @param FieldName
* @param Value
* @param sid
*/
public int createaihaospecialkey_UpdateString(String FieldName,String Value,int sid) throws Exception{
return _dal.create_aihaospecialkey_UpdateString( FieldName, Value, sid);
}
}
| [
"279941737@qq.com"
] | 279941737@qq.com |
44c2ba3356359855ece44686c2f8a997b6f132ed | 97b172cc992acd59736a118006c8020026b8d2e0 | /module-backend/src/test/java/de/weltraumschaf/caythe/backend/vm/VirtualMachineTest.java | e4b3a36fe4051a3953ad8bc7a07b34a07a9301f9 | [] | no_license | Weltraumschaf/cay-the | c07df8717ab1b07b2c3b54eb42a31829fbd76a18 | c5a78119995f9c36391981b9bb28ff61e8e24315 | refs/heads/master | 2023-01-24T06:10:57.847887 | 2020-04-24T19:21:39 | 2020-04-24T19:21:39 | 3,006,606 | 1 | 0 | null | 2023-01-11T16:04:26 | 2011-12-18T16:01:00 | Java | UTF-8 | Java | false | false | 1,781 | java | package de.weltraumschaf.caythe.backend.vm;
import de.weltraumschaf.commons.testing.CapturingPrintStream;
import org.junit.Before;
import org.junit.Test;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertThat;
public final class VirtualMachineTest {
private final CapturingPrintStream out = new CapturingPrintStream();
private final Assembler asm = new Assembler();
public VirtualMachineTest() throws UnsupportedEncodingException {
super();
}
@Before
public void setUp() throws Exception {
out.reset();
}
private byte[] source(final String file) throws URISyntaxException, IOException {
final Path source = Paths.get(getClass().getResource("/de/weltraumschaf/caythe/backend/vm/" + file).toURI());
return asm.assemble(source);
}
@Test
public void run_hello() throws IOException, URISyntaxException {
final FunctionMetaData[] main = {
new FunctionMetaData("main", 0, 0, 0),
};
final VirtualMachine sut = new VirtualMachine(
source("hello.ctasm"),
main,
out);
sut.run(0);
assertThat(out.getCapturedOutput(), is("44"));
}
@Test
public void run_loop() throws URISyntaxException, IOException {
final FunctionMetaData[] main = {
new FunctionMetaData("main", 0, 0, 0),
};
final VirtualMachine sut = new VirtualMachine(
source("loop.ctasm"),
main,
out);
sut.run(0);
assertThat(out.getCapturedOutput(), is("10"));
}
} | [
"ich@weltraumschaf.de"
] | ich@weltraumschaf.de |
0e9109bf076a1c4bce9e3510bca86d37e7339001 | 8ab159ea4a510853b754416f048424fc4fd25fdb | /src/main/java/radar/UI/ContentPanel/ManagerExportExcel.java | 24e1c93a32a8abf3bd87d42dcec30d8003908735 | [] | no_license | 79370911/Radar | af159d0f03cd7f08afa8db3bf12f97fb95549b67 | 5627e52f18e657f4d4e8ae93dda17c39ca4381bc | refs/heads/master | 2022-10-03T23:18:09.908521 | 2020-06-08T09:03:17 | 2020-06-08T09:03:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 714 | java | package radar.UI.ContentPanel;
import radar.UI.Components.ContentPanel;
public class ManagerExportExcel extends ContentPanel implements InterfaceForContentPanel{
/**
* 部队管理-数据统计-报表导出页面
*/
private static final long serialVersionUID = 9143528372340271758L;
@Override
public void init() {
// TODO Auto-generated method stub
}
@Override
public void Action() {
// TODO Auto-generated method stub
}
@Override
public void initContentTop() {
// TODO Auto-generated method stub
}
@Override
public void initContentBody() {
// TODO Auto-generated method stub
}
@Override
public void initContentFoot() {
// TODO Auto-generated method stub
}
}
| [
"1615168893@qq.com"
] | 1615168893@qq.com |
041380454c1e24d0569e43fb0132ba111cb38673 | d60e287543a95a20350c2caeabafbec517cabe75 | /LACCPlus/Cloudstack/926_2.java | 735520edf994ab1a04c25ce54363dc7a9dcccf9d | [
"MIT"
] | permissive | sgholamian/log-aware-clone-detection | 242067df2db6fd056f8d917cfbc143615c558b2c | 9993cb081c420413c231d1807bfff342c39aa69a | refs/heads/main | 2023-07-20T09:32:19.757643 | 2021-08-27T15:02:50 | 2021-08-27T15:02:50 | 337,837,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 795 | java | //,temp,UpdateStorageNetworkIpRangeCmd.java,102,115,temp,AddBaremetalPxeCmd.java,80,92
//,3
public class xxx {
@Override
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException,
ResourceAllocationException, NetworkRuleConflictException {
try {
BaremetalPxeVO vo = pxeMgr.addPxeServer(this);
BaremetalPxeResponse rsp = pxeMgr.getApiResponse(vo);
rsp.setResponseName(getCommandName());
this.setResponseObject(rsp);
} catch (Exception e) {
s_logger.warn("Unable to add external pxe server with url: " + getUrl(), e);
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}
}
}; | [
"sgholami@uwaterloo.ca"
] | sgholami@uwaterloo.ca |
0d1dde3be91121af9f9f95e63a71696b63c33566 | 0260e9b9f8befa39871f6cd0aefb3e368f40d0ef | /org.panlab.software.fsdl2/src/org/panlab/software/fsdl2/FSDLStandaloneSetup.java | 1280856c84636098eb112cbbfca8d3bde36410ef | [] | no_license | ctranoris/fstoolkit | ae84a98a9196fae4ad094e1b0aa53ef876715e37 | 4adf7fa92135a002107f0c750d1068dc39857f6f | refs/heads/master | 2016-09-06T07:30:31.100001 | 2012-10-17T07:31:55 | 2012-10-17T07:31:55 | 2,185,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 314 | java |
package org.panlab.software.fsdl2;
/**
* Initialization support for running Xtext languages
* without equinox extension registry
*/
public class FSDLStandaloneSetup extends FSDLStandaloneSetupGenerated{
public static void doSetup() {
new FSDLStandaloneSetup().createInjectorAndDoEMFRegistration();
}
}
| [
"tranoris@88d6be61-b049-4d1a-ac2d-38c3f0f8cafa"
] | tranoris@88d6be61-b049-4d1a-ac2d-38c3f0f8cafa |
0c87514629fc8e0068bdf52627c56a706c214dae | ac6ea9302cc62a07dca25662c720115833371bf8 | /ch12/src/p287/EqualsEx2.java | 3914b198292f8031716d43154e85b409e8e64e32 | [] | no_license | kimhalyn/Java | c2f54301540cef94f9fa7ff954784d6c985d042e | ceaa21390b963b629c004d598b1c777bc360e4e7 | refs/heads/master | 2023-06-07T12:59:42.137817 | 2021-07-01T04:33:03 | 2021-07-01T04:33:03 | 311,218,125 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 508 | java | package p287;
public class EqualsEx2 {
public static void main(String[] args) {
String str1 = new String("abc");
String str2 = new String("abc");
if(str1 == str2) {
System.out.println("str1 객체와 str2 객체는 같음");
} else {
System.out.println("str1 객체와 str2 객체는 다름");
}
if(str1.equals(str2)) {
System.out.println("str1 문자열과 str2 문자열은 같음");
} else {
System.out.println("str1 문자열과 str2 문자열은 다름");
}
}
}
| [
"reedweed@naver.com"
] | reedweed@naver.com |
dce0f52c8ab994e47f564d4025fd3c6d815bf096 | f5398748ea435d203248eb208850a1d36939e3a8 | /Tools/EASy-ANT/EASyLoader/src/de/uni_hildesheim/sse/easy/loader/framework/BundleRegistry.java | 7a2e2559e36b778b510d42173c51ef0790685fe0 | [
"Apache-2.0"
] | permissive | SSEHUB/EASyProducer | 20b5a01019485428b642bf3c702665a257e75d1b | eebe4da8f957361aa7ebd4eee6fff500a63ba6cd | refs/heads/master | 2023-06-25T22:40:15.997438 | 2023-06-22T08:54:00 | 2023-06-22T08:54:00 | 16,176,406 | 12 | 2 | null | null | null | null | UTF-8 | Java | false | false | 7,742 | java | package de.uni_hildesheim.sse.easy.loader.framework;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
* A registry of created bundle information objects supporting the resolution of bundles.
*
* @author Holger Eichelberger
*/
public class BundleRegistry {
private static final Set<String> IGNORE = new HashSet<String>();
private static BundleRegistry instance = new BundleRegistry();
private boolean emitIgoredWarnings = true;
private final Map<String, List<BundleInfo>> bundles = new HashMap<String, List<BundleInfo>>();
private BundleRegistry parent;
/**
* Creates the root bundle registry.
*/
private BundleRegistry() {
}
/**
* Creates a delegating bundle registry which asks <code>parent</code> if bundles cannot be found.
*
* @param parent the parent registry
*/
public BundleRegistry(BundleRegistry parent) {
this.parent = parent;
}
/**
* Adds a symbolic bundle name to the global ignore list.
*
* @param name the name of the bundle (<b>null</b> will be ignored)
*/
public static void addGlobalIgnore(String name) {
if (null != name) {
IGNORE.add(name);
}
}
/**
* Returns the current instance of this registry.
*
* @return the current instance
*/
public static BundleRegistry getInstance() {
return instance;
}
/**
* Redefines the current bundle registry.
*
* @param registry the current registry (<b>null</b> will be ignored)
*/
public static void setInstance(BundleRegistry registry) {
if (null != registry) {
instance = registry;
}
}
/**
* Returns whether the given bundle shall be ignored.
*
* @param name the name of the bundle
* @return <code>true</code> if it shall be ignored, <code>false</code> else
*/
boolean ignoreBundle(String name) {
return IGNORE.contains(name);
}
/**
* Defines whether ignored warnings shall be emitted.
*
* @param emit <code>true</code> if these warnings are emitted, <code>false</code> else
*/
public void setEmitIgoredWarnings(boolean emit) {
emitIgoredWarnings = emit;
}
/**
* Adds a bundle information object to this registry.
*
* @param info the information object
*/
void add(BundleInfo info) {
String name = info.getName();
List<BundleInfo> sameName = getInfoSafe(name);
if (sameName.isEmpty()) {
sameName.add(info);
} else {
if (emitIgoredWarnings) {
Log.warn("Multiple bundles with symbolic name " + name + " being registered. ("
+ collectVersions(sameName)
+ ") This is currently not supported and version " + info.getVersion() + " is ignored.");
}
//sameName.get(0).resolve(info);
//sameName.remove(0);
sameName.add(info); //patrik: added these lines to add them anyways since version should be checked now!
}
}
/**
* Collects the version information from <code>infos</code>.
*
* @param infos the information instances to be considered
* @return the version information as String
*/
private static String collectVersions(List<BundleInfo> infos) {
StringBuilder tmp = new StringBuilder();
for (BundleInfo info : infos) {
Version version = info.getVersion();
if (tmp.length() > 0) {
tmp.append(", ");
}
if (null == version) {
tmp.append("?");
} else {
tmp.append(version);
}
}
return tmp.toString();
}
/**
* Returns the list of bundles with the same <code>name</code>.
*
* @param name the symbolic bundle name
* @return the list of bundles (created and hooked in if required)
*/
private List<BundleInfo> getInfoSafe(String name) {
List<BundleInfo> sameName = bundles.get(name);
if (null == sameName) {
sameName = new ArrayList<BundleInfo>();
bundles.put(name, sameName);
}
return sameName;
}
/**
* Returns a bundle information instance with the specified <code>name</code>.
* If multiple bundle versions for the same name are registered, the first is returned
* (version specification is currently not supported).
*
* @param name the symbolic name
* @param versionSpec the version specification (currently not considered in resolution, just stored)
* @return the related bundle information object, resolved or unresolved or <b>null</b> if not found
*/
public BundleInfo get(String name, EasyDependency versionSpec) {
BundleInfo result;
List<BundleInfo> sameName = bundles.get(name);
if (null == sameName || sameName.isEmpty()) {
if (null != parent) {
result = parent.get(name, versionSpec);
if (null != result) {
add(result);
}
} else {
result = null;
}
} else {
//versionSpec needs to be supported here!
result = null;
for (int i = 0; i < sameName.size(); i++) {
if (null != sameName.get(i).getVersion() && sameName.get(i).getVersion()
.isInRange(versionSpec.getBundleVersionMin(), versionSpec.getBundleVersionMax())) {
if (null == result || result.getVersion()
.compareTo(sameName.get(i).getVersion()) == -1) {
result = sameName.get(i);
}
}
}
//result = sameName.get(0);
}
return result;
}
/**
* Returns all bundles known to this registry.
*
* @return all bundles
*/
public List<BundleInfo> getAllBundles() {
List<BundleInfo> roots = new ArrayList<BundleInfo>();
for (List<BundleInfo> sameName : bundles.values()) {
for (BundleInfo info : sameName) {
roots.add(info);
}
}
return roots;
}
/**
* Returns the root bundles, i.e., those without required bundles.
*
* @return the root bundles (may be empty)
*/
public List<BundleInfo> getRootBundles() {
List<BundleInfo> roots = new ArrayList<BundleInfo>();
Set<BundleInfo> unused = new HashSet<BundleInfo>();
// initialize with all
for (BundleInfo info : getAllBundles()) {
unused.add(info);
}
// remove used
for (BundleInfo info : getAllBundles()) {
for (int p = 0; p < info.getRequiredBundlesCount(); p++) {
unused.remove(info.getRequiredBundle(p));
}
}
// now unused are roots
for (BundleInfo info : unused) {
roots.add(info);
}
return roots;
}
/**
* Returns currently unresolved bundles, i.e., those without resolving JAR file.
*
* @return the unresolved bundles (may be empty)
*/
public List<BundleInfo> getUnresolvedBundles() {
List<BundleInfo> roots = new ArrayList<BundleInfo>();
for (BundleInfo info : getAllBundles()) {
if (null == info.getResolvedJar()) {
roots.add(info);
}
}
return roots;
}
} | [
"elscha@sse.uni-hildesheim.de"
] | elscha@sse.uni-hildesheim.de |
ecc9812627c87205058a2f1cdb379c3359f7190a | f45c2611ebecaa7458bf453deb04392f4f9d591f | /lib/HTMLUnit/htmlunit-2.26-src/src/main/java/com/gargoylesoftware/htmlunit/html/FrameWindow.java | 64b4ca3adfb48dae67dabe43dbbd5e81add7170a | [
"Apache-2.0"
] | permissive | abdallah-95/Arabic-News-Reader-Server | 92dc9db0323df0d5694b6c97febd1d04947c740d | ef986c40bc7ccff261e4c1c028ae423573ee4a74 | refs/heads/master | 2021-05-12T05:08:23.710984 | 2018-01-15T01:46:25 | 2018-01-15T01:46:25 | 117,183,791 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,390 | java | /*
* Copyright (c) 2002-2017 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.html;
import com.gargoylesoftware.htmlunit.Page;
import com.gargoylesoftware.htmlunit.StringWebResponse;
import com.gargoylesoftware.htmlunit.WebResponse;
import com.gargoylesoftware.htmlunit.WebWindow;
import com.gargoylesoftware.htmlunit.WebWindowImpl;
/**
* The web window for a frame or iframe.
*
* @author Brad Clarke
* @author Ahmed Ashour
* @author Ronald Brill
*/
public class FrameWindow extends WebWindowImpl {
private final BaseFrameElement frame_;
/**
* Creates an instance for a given frame.
*/
FrameWindow(final BaseFrameElement frame) {
super(frame.getPage().getWebClient());
frame_ = frame;
final WebWindowImpl parent = (WebWindowImpl) getParentWindow();
performRegistration();
parent.addChildWindow(this);
}
/**
* {@inheritDoc}
* A FrameWindow shares it's name with it's containing frame.
*/
@Override
public String getName() {
return frame_.getNameAttribute();
}
/**
* {@inheritDoc}
* A FrameWindow shares it's name with it's containing frame.
*/
@Override
public void setName(final String name) {
frame_.setNameAttribute(name);
}
/**
* {@inheritDoc}
*/
@Override
public WebWindow getParentWindow() {
return frame_.getPage().getEnclosingWindow();
}
/**
* {@inheritDoc}
*/
@Override
public WebWindow getTopWindow() {
return getParentWindow().getTopWindow();
}
/**
* {@inheritDoc}
*/
@Override
protected boolean isJavaScriptInitializationNeeded() {
return getScriptableObject() == null
|| !(getEnclosedPage().getWebResponse() instanceof StringWebResponse);
// TODO: find a better way to distinguish content written by document.open(),...
}
/**
* Returns the HTML page in which the <frame> or <iframe> tag is contained
* for this frame window.
* This is a facility method for <code>(HtmlPage) (getParentWindow().getEnclosedPage())</code>.
* @return the page in the parent window
*/
public HtmlPage getEnclosingPage() {
return (HtmlPage) frame_.getPage();
}
/**
* {@inheritDoc}
*/
@Override
public void setEnclosedPage(final Page page) {
super.setEnclosedPage(page);
// we have updated a frame window by javascript write();
// so we have to disable future updates during initialization
// see com.gargoylesoftware.htmlunit.html.HtmlPage.loadFrames()
final WebResponse webResponse = page.getWebResponse();
if (webResponse instanceof StringWebResponse) {
final StringWebResponse response = (StringWebResponse) webResponse;
if (response.isFromJavascript()) {
final BaseFrameElement frame = getFrameElement();
frame.setContentLoaded();
}
}
}
/**
* Gets the DOM node of the (i)frame containing this window.
* @return the DOM node
*/
public BaseFrameElement getFrameElement() {
return frame_;
}
/**
* Gives a basic representation for debugging purposes.
* @return a basic representation
*/
@Override
public String toString() {
return "FrameWindow[name=\"" + getName() + "\"]";
}
/**
* Closes this frame window.
*/
public void close() {
final WebWindowImpl parent = (WebWindowImpl) getParentWindow();
parent.removeChildWindow(this);
getWebClient().deregisterWebWindow(this);
}
}
| [
"abdallah.x95@gmail.com"
] | abdallah.x95@gmail.com |
41c9d49099469b8321111711a9a50a58fe6d7066 | 470e669e6e217bc04702b89883b0fdc397b82aef | /protocol-ldap/src/main/java/org/apache/directory/server/ldap/handlers/extended/WhoAmIHandler.java | 0644796776e76cf33cf331382cd5ce285b2bc507 | [
"OLDAP-2.8",
"LicenseRef-scancode-warranty-disclaimer",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown"
] | permissive | mchoma/directory-server | 9b6fdc7ab08e0c4e15348908357402f22d4c1ca6 | 1399b77e0205b8b5dd8f67fe188f8fc99979ca8e | refs/heads/master | 2021-03-30T21:19:27.176358 | 2018-01-23T07:20:36 | 2018-01-23T07:20:36 | 124,422,178 | 0 | 0 | Apache-2.0 | 2018-03-08T17:10:00 | 2018-03-08T16:59:41 | Java | UTF-8 | Java | false | false | 3,207 | 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.directory.server.ldap.handlers.extended;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIRequest;
import org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIResponse;
import org.apache.directory.api.ldap.extras.extended.whoAmI.WhoAmIResponseImpl;
import org.apache.directory.api.ldap.model.message.ResultCodeEnum;
import org.apache.directory.api.util.Strings;
import org.apache.directory.server.core.api.LdapPrincipal;
import org.apache.directory.server.ldap.ExtendedOperationHandler;
import org.apache.directory.server.ldap.LdapServer;
import org.apache.directory.server.ldap.LdapSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* An handler to manage the WhoAmI extended request operation
*
* @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
*/
public class WhoAmIHandler implements ExtendedOperationHandler<WhoAmIRequest, WhoAmIResponse>
{
private static final Logger LOG = LoggerFactory.getLogger( WhoAmIHandler.class );
public static final Set<String> EXTENSION_OIDS;
static
{
Set<String> set = new HashSet<String>( 2 );
set.add( WhoAmIRequest.EXTENSION_OID );
set.add( WhoAmIResponse.EXTENSION_OID );
EXTENSION_OIDS = Collections.unmodifiableSet( set );
}
/**
* {@inheritDoc}
*/
public String getOid()
{
return WhoAmIRequest.EXTENSION_OID;
}
/**
* {@inheritDoc}
*/
public void handleExtendedOperation( LdapSession requestor, WhoAmIRequest req ) throws Exception
{
LOG.debug( "WhoAmI requested" );
LdapPrincipal ldapPrincipal = requestor.getCoreSession().getAuthenticatedPrincipal();
WhoAmIResponse whoAmIResponse = new WhoAmIResponseImpl( req.getMessageId(), ResultCodeEnum.SUCCESS );
String authzId = "dn:" + ldapPrincipal.getDn();
whoAmIResponse.setAuthzId( Strings.getBytesUtf8( authzId ) );
// write the response
requestor.getIoSession().write( whoAmIResponse );
}
/**
* {@inheritDoc}
*/
public Set<String> getExtensionOids()
{
return EXTENSION_OIDS;
}
/**
* {@inheritDoc}
*/
public void setLdapServer( LdapServer ldapServer )
{
}
}
| [
"elecharny@apache.org"
] | elecharny@apache.org |
f248b19acc55a6554865d316b1fb04f7f2f387bd | d46fb42170b9f9845ab488706dcfea6494275b5a | /src/com/onekeyshare/classic/port/PlatformPageAdapterPort.java | 9051fcd2c9698fd47b7eca9b861aead6c2b0bb19 | [] | no_license | liushiyun8/AppCust | f6764d74daf7b8719bf4c3a537efefeb41c83a59 | aaaced289e873e038c9a37ad0a5532048b43128c | refs/heads/master | 2021-06-30T17:21:39.922759 | 2017-09-18T09:49:57 | 2017-09-18T09:49:57 | 103,921,650 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,450 | java | /*
* 官网地站:http://www.mob.com
* 技术支持QQ: 4006852216
* 官方微信:ShareSDK (如果发布新版本的话,我们将会第一时间通过微信将版本更新内容推送给您。如果使用过程中有任何问题,也可以通过微信与我们取得联系,我们将会在24小时内给予回复)
*
* Copyright (c) 2013年 mob.com. All rights reserved.
*/
package com.onekeyshare.classic.port;
import java.util.ArrayList;
import android.content.Context;
import com.onekeyshare.classic.PlatformPage;
import com.onekeyshare.classic.PlatformPageAdapter;
import com.mob.tools.utils.R;
/** 竖屏的九宫格页面适配器 */
public class PlatformPageAdapterPort extends PlatformPageAdapter {
private static final int DESIGN_SCREEN_WIDTH_P = 720;
private static final int DESIGN_SEP_LINE_WIDTH = 1;
private static final int DESIGN_LOGO_HEIGHT = 76;
private static final int DESIGN_PADDING_TOP = 20;
private static final int PAGE_SIZE_P = 12;
private static final int LINE_SIZE_P = 4;
public PlatformPageAdapterPort(PlatformPage page, ArrayList<Object> cells) {
super(page, cells);
}
protected void calculateSize(Context context, ArrayList<Object> plats) {
int screenWidth = R.getScreenWidth(context);
lineSize = LINE_SIZE_P;
float ratio = ((float) screenWidth) / DESIGN_SCREEN_WIDTH_P;
sepLineWidth = (int) (DESIGN_SEP_LINE_WIDTH * ratio);
sepLineWidth = sepLineWidth < 1 ? 1 : sepLineWidth;
logoHeight = (int) (DESIGN_LOGO_HEIGHT * ratio);
paddingTop = (int) (DESIGN_PADDING_TOP * ratio);
bottomHeight = (int) (DESIGN_BOTTOM_HEIGHT * ratio);
cellHeight = (screenWidth - sepLineWidth * 3) / 4;
if (plats.size() <= lineSize) {
panelHeight = cellHeight + sepLineWidth;
} else if (plats.size() <= PAGE_SIZE_P - lineSize) {
panelHeight = (cellHeight + sepLineWidth) * 2;
} else {
panelHeight = (cellHeight + sepLineWidth) * 3;
}
}
protected void collectCells(ArrayList<Object> plats) {
int count = plats.size();
if (count < PAGE_SIZE_P) {
int lineCount = (count / lineSize);
if (count % lineSize != 0) {
lineCount++;
}
cells = new Object[1][lineCount * lineSize];
} else {
int pageCount = (count / PAGE_SIZE_P);
if (count % PAGE_SIZE_P != 0) {
pageCount++;
}
cells = new Object[pageCount][PAGE_SIZE_P];
}
for (int i = 0; i < count; i++) {
int p = i / PAGE_SIZE_P;
cells[p][i - PAGE_SIZE_P * p] = plats.get(i);
}
}
}
| [
"764512727@qq.com"
] | 764512727@qq.com |
1a2a8ddb8d36b09f07923251b2cff9072cf4b1d4 | a4e0f5d38301cbc506191020afdfbef4bf5d4915 | /workspace/glaf-web/src/main/java/com/glaf/apps/trip/mapper/TripMapper.java | edf6e93b3e79b5356b8c85c9a370e9a66058f2da | [
"Apache-2.0"
] | permissive | magoo-lau/glaf | 14f95ddcee026f28616027a601f97e8d7df44102 | 9c325128afc4325bc37655d54bc65f34ecc41089 | refs/heads/master | 2020-12-02T12:47:14.959928 | 2017-07-09T08:08:51 | 2017-07-09T08:08:51 | 96,594,013 | 0 | 0 | null | 2017-07-08T03:41:28 | 2017-07-08T03:41:28 | null | UTF-8 | Java | false | false | 461 | java | package com.glaf.apps.trip.mapper;
import java.util.*;
import org.springframework.stereotype.Component;
import com.glaf.apps.trip.model.*;
import com.glaf.apps.trip.query.*;
@Component
public interface TripMapper {
void deleteTrips(TripQuery query);
void deleteTripById(String id);
Trip getTripById(String id);
int getTripCount(TripQuery query);
List<Trip> getTrips(TripQuery query);
void insertTrip(Trip model);
void updateTrip(Trip model);
}
| [
"jior2008@gmail.com"
] | jior2008@gmail.com |
342472f4fc996420748ee2cfb1c912e05200c922 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/smallest/346b1d3c1cdc3032d07222a8a5e0027a2abf95bb1697b9d367d7cca7db1af769d8298e232c56471a122f05e87e79f4bd965855c9c0f8b173ebc0ef5d0abebc7b/002/mutations/557/smallest_346b1d3c_002.java | 32e44f4674bdc374ff118630f5386d61b72ae8da | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,505 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class smallest_346b1d3c_002 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
smallest_346b1d3c_002 mainClass = new smallest_346b1d3c_002 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
IntObj a = new IntObj (), b = new IntObj (), c = new IntObj (), d =
new IntObj (), num_1 = new IntObj (), num_2 = new IntObj (), num_3 =
new IntObj (), num_4 = new IntObj ();
output +=
(String.format ("Please enter 4 numbers seperated by spaces > "));
num_1.value = scanner.nextInt ();
num_2.value = scanner.nextInt ();
num_3.value = scanner.nextInt ();
num_4.value = scanner.nextInt ();
a.value = (num_1.value);
b.value = (num_2.value);
c.value = (num_3.value);
d.value = (num_4.value);
if (a.value < b.value && a.value < c.value && a.value < d.value) {
output += (String.format ("%d is the smallest\n", a.value));
} else if (b.value < a.value && b.value < c.value && b.value < d.value) {
output += (String.format ("%d is the smalles\n", b.value));
} else if (c.value < a.value && c.value < b.value && c.value < d.value) {
output += (String.format ("%d is the smallest\n", c.value));
} else if (d.value < a.value && (b.value) < (c.value) && d.value < c.value) {
output += (String.format ("%d is the smallest\n", d.value));
}
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
63a0acbed950a03cabe09c023ebd365aee3e88d2 | 019edd34f4e9a6086a17f9dbc4606e08bb76557b | /io.reactivex.common/src/io/reactivex/common/internal/util/HashMapSupplier.java | 8e0682b8daf226fefec9e9ece1cf4cf0ed5f4c50 | [
"Apache-2.0"
] | permissive | Prerna11082/rxjava | 7f74c920789ac6486d1278b6e4f6a9d09935e900 | 2b5d4b55ad112d38a3599d4981fb2d35da6978f5 | refs/heads/master | 2020-04-06T13:29:23.714616 | 2018-11-21T17:46:04 | 2018-11-21T17:46:04 | 157,502,034 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,097 | java | /**
* Copyright (c) 2016-present, RxJava Contributors.
*
* 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.reactivex.common.internal.util;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
public enum HashMapSupplier implements Callable<Map<Object, Object>> {
INSTANCE;
@SuppressWarnings({ "unchecked", "rawtypes" })
public static <K, V> Callable<Map<K, V>> asCallable() {
return (Callable)INSTANCE;
}
@Override public Map<Object, Object> call() throws Exception {
return new HashMap<Object, Object>();
}
}
| [
"sumersingh@PS-MacBook.local"
] | sumersingh@PS-MacBook.local |
68e56fbe13093055cd3138a26383d7144600c56b | 672831dbaf084fc52f92cb763cadb96935058fe1 | /src/model/Credential.java | 860330d7c4deb8b697b02dbd65d9cf5cb9970be4 | [] | no_license | gustavodasneves/SmartPass | 3a0ba275a722fc75371636e8874a5699f2bbc334 | 9cb0ead160a450a711120cc70eec6c8317c2509c | refs/heads/master | 2021-01-15T11:50:12.467044 | 2014-03-26T11:29:10 | 2014-03-26T11:29:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 596 | java | package model;
public class Credential {
private long id;
private String system;
private String user;
private Password password;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getSystem() {
return system;
}
public void setSystem(String system) {
this.system = system;
}
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public Password getPassword() {
return password;
}
public void setPassword(Password password) {
this.password = password;
}
}
| [
"robson.luizv@gmail.com"
] | robson.luizv@gmail.com |
d9b8eca0c1b7ab47af0b9d2e5adaaf8fa0a3950a | 72b32da4e06500cc705ecea0c949d81fc03dcabb | /Code/chapter_13/examples/unit_13.5/StringMethodDemo.java | 4aaa1870d8c1e25c8c79c124c31686bbc054dc31 | [] | no_license | desioc/JFACode | 358c941f52a0a6a75e0c8be6ce4708296aa11e64 | e0f40b14dde2fe43b3193fa02a865bc875e937e7 | refs/heads/master | 2023-05-15T03:01:00.575551 | 2021-06-09T07:48:52 | 2021-06-09T07:48:52 | 347,454,318 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,384 | java | public class StringMethodDemo {
public static void main(String args[]) {
//charAt
System.out.println("It is not logical, but it is often true.".charAt(3));
//concat
String string1 ="Mc";
String string2 ="Guffin";
String string3 = string1.concat(string2);
System.out.println("string1 = "+ string1);
System.out.println("string2 = "+ string2);
System.out.println("string3 = "+ string3);
//compareTo
System.out.println("A".compareTo("B"));
System.out.println("C".compareTo("B"));
System.out.println("D".compareTo("D"));
//endsWith
String name ="Viola";
System.out.println(name.endsWith("a"));
//equals
System.out.println("Equals: " + new String("sapore").equals("Sapore"));
//equalsIgnoreCase
System.out.println("EqualsIgnoreCase: " + new String("battista").equalsIgnoreCase("Battista"));
//format
System.out.println("Format: " + String.format("String = %s, boolean = %b", "a", 1==1));
//indexOf
System.out.println("IndexOf: " + "Ligeia".indexOf("i"));
System.out.println("IndexOf: " + "Ligeia".indexOf("i", 2));
//join
String message = String.join("\\", "C:", "Examples", "Java");
System.out.println(message);
//lastIndexOf
System.out.println("LastIndexOf: " + "Rosalia".lastIndexOf("a"));
//trim
String stringToTrim = " Emanuele ";
final String STAR= "*";
System.out.println(STAR+stringToTrim.trim()+STAR);
//length
System.out.println("Claudio".length());
//repeat
System.out.println("01".repeat(4));
//replaceFirst
String newString = "aomame".replaceFirst("a", "A");
System.out.println(newString);
//Split
String deepPurple = "Gillan-Glover-Paice-Blackmore-Lord";
String[] components = deepPurple.split("-");
for (String component: components) {
System.out.println(component);
}
//startsWith
String cantoPrimo = "When half way through the journey of our life I found that I was in a gloomy wood, because the path which led aright was lost.";
System.out.println(cantoPrimo.startsWith("hal"));
System.out.println(cantoPrimo.startsWith("hal",5));
}
} | [
"61605795+desioc@users.noreply.github.com"
] | 61605795+desioc@users.noreply.github.com |
bd8e8e588338c3385bd89aac270877b20d690c98 | e55a58425a0d6183f38bc4bddfdd471019180b94 | /preparation/src/main/java/ru/shcheglov/Homework8/FifteenPuzzleGame.java | d0b2c7be2816a352e147107ec4359c1881c95c15 | [] | no_license | Pharmazon/GeekUniversity | d4b90f94bc99ef12dd1fef70b2cd0ac3988f4e20 | ae09e6bc95a1552a5a38d969d8c1be4288e32c61 | refs/heads/master | 2022-09-24T18:12:36.349879 | 2019-10-13T20:44:12 | 2019-10-13T20:44:12 | 206,953,109 | 0 | 0 | null | 2022-09-08T01:06:58 | 2019-09-07T10:37:14 | Java | UTF-8 | Java | false | false | 7,689 | java | package ru.shcheglov.Homework8;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
/**
* Java 1. Homework 8. FifteenPuzzleGame game.
* Class: MainClass FifteenPuzzleGame
*
* @author Alexey Shcheglov
* @link https://github.com/Pharmazon
* @version 0.1 dated Dec 20, 2017
*/
class FifteenPuzzleGame extends JFrame implements ActionListener {
final String WINDOW_TITLE = "Fifteen Puzzle Game by Alexey Shcheglov";
final int WINDOW_WIDTH = 500;
final int WINDOW_HEIGHT = 550;
final String BTN_NEWGAME = "New game";
final String BTN_EXIT = "Exit";
Button[][] arr = new Button[4][4];
GamePanel gamepanel = new GamePanel();
JPanel panelbtn = new JPanel();
Button mem = new Button("");
public FifteenPuzzleGame() {
//initialize the main window
this.setTitle(WINDOW_TITLE);
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT);
this.setLocationRelativeTo(null);
this.setResizable(false);
this.setLayout(new BorderLayout());
//Button panel
panelbtn.setLayout(new GridLayout());
this.add(panelbtn, BorderLayout.NORTH);
//Game panel
gamepanel.setLayout(new GridLayout(4, 4));
this.add(gamepanel, BorderLayout.CENTER);
//initial fill the field
initGameField();
//Shuffling gamefield
shuffle();
//Button "New game"
Button btnnewgame = new Button(BTN_NEWGAME);
btnnewgame.addActionListener(e -> {
int resnew = JOptionPane.showConfirmDialog(null, "Do you want to start a new game?",
"New game", JOptionPane.YES_NO_OPTION);
if (resnew == JOptionPane.YES_OPTION) {
initGameField();
shuffle();
}
});
panelbtn.add(btnnewgame);
//Button "Exit"
Button btnexit = new Button(BTN_EXIT);
btnexit.addActionListener(e -> {
int resexit = JOptionPane.showConfirmDialog(null, "Do you want to exit?",
"Exit confirmation", JOptionPane.YES_NO_OPTION);
if (resexit == JOptionPane.YES_OPTION) System.exit(0);
});
panelbtn.add(btnexit);
setVisible(true);
//show message if win
if (isGameOver()) {
JOptionPane.showMessageDialog(null, "YOU WIN!", "Congratulations!", JOptionPane.INFORMATION_MESSAGE);
initGameField();
shuffle();
}
}
//click on field buttons events
@Override
public void actionPerformed(ActionEvent e) {
Button curbtn = (Button)(e.getSource());
int[] xy = curbtn.getElementByXY(curbtn.getX(), curbtn.getY());
int k = xy[0];
int l = xy[1];
mem = null;
if (l + 1 < 4) {
if (arr[k][l + 1].getText().equals("")) {
gamepanel.remove(arr[k][l]);
gamepanel.remove(arr[k][l + 1]);
this.repaint();
mem = arr[k][l + 1];
arr[k][l + 1] = arr[k][l];
arr[k][l] = mem;
gamepanel.add(arr[k][l]);
gamepanel.add(arr[k][l + 1]);
}
}
if (l - 1 >= 0) {
if (arr[k][l - 1].getText().equals("")) {
gamepanel.remove(arr[k][l]);
gamepanel.remove(arr[k][l - 1]);
this.repaint();
mem = arr[k][l - 1];
arr[k][l - 1] = arr[k][l];
arr[k][l] = mem;
gamepanel.add(arr[k][l]);
gamepanel.add(arr[k][l - 1]);
}
}
if (k + 1 < 4) {
if (arr[k + 1][l].getText().equals("")) {
gamepanel.remove(arr[k][l]);
gamepanel.remove(arr[k + 1][l]);
this.repaint();
mem = arr[k + 1][l];
arr[k + 1][l] = arr[k][l];
arr[k][l] = mem;
gamepanel.add(arr[k][l]);
gamepanel.add(arr[k + 1][l]);
}
}
if (k - 1 >= 0) {
if (arr[k - 1][l].getText().equals("")) {
gamepanel.remove(arr[k][l]);
gamepanel.remove(arr[k - 1][l]);
this.repaint();
mem = arr[k - 1][l];
arr[k - 1][l] = arr[k][l];
arr[k][l] = mem;
gamepanel.add(arr[k][l]);
gamepanel.add(arr[k - 1][l]);
}
}
gamepanel.repaintField(arr);
}
//Initial fill the array by buttons
void initGameField() {
gamepanel.removeAll();
int textnum = 1;
for (int i = 0; i < arr.length; i++) {
for (int j = 0; j < arr.length; j++) {
if (textnum == 16) {
arr[i][j] = new Button("", 70);
} else {
arr[i][j] = new Button(Integer.toString(textnum), 70);
}
arr[i][j].addActionListener(this);
gamepanel.add(arr[i][j]);
textnum++;
}
}
gamepanel.repaintField(arr);
}
//check if win method
boolean isGameOver() {
int count = 1;
int sum = 0;
boolean status = false;
for (Button[] buttons : arr) {
for (int j = 0; j < arr.length; j++) {
if (!buttons[j].getText().equals("")) {
if (Integer.parseInt(buttons[j].getText()) == count) {
sum += count;
}
}
count++;
}
}
if (sum == 120) status = true;
return status;
}
//shuffling method
void shuffle() {
Random rnd = new Random();
Button mem;
int[][] txtarr = new int[4][4];
int txtnum = 1;
int ind1;
int ind2;
int a;
gamepanel.removeAll();
//fill index array 'txtarr' by numbers from 1 to 16
for (int i = 0; i < txtarr.length; i++) {
for (int j = 0; j < txtarr.length; j++) {
txtarr[i][j] = txtnum;
txtnum++;
}
}
//shuffling index array 'txtarr'
for (int i = txtarr.length - 1; i >= 0; i--) {
for (int j = txtarr.length - 1; j >= 0; j--) {
ind1 = rnd.nextInt(i + 1);
ind2 = rnd.nextInt(j + 1);
a = txtarr[ind1][ind2];
txtarr[ind1][ind2] = txtarr[i][j];
txtarr[i][j] = a;
}
}
//shuffling Buttons array 'arr'
for (int i = 0; i < txtarr.length; i++) {
for (int j = 0; j < txtarr.length; j++) {
for (int k = 0; k < arr.length; k++) {
for (int l = 0; l < arr.length; l++) {
if (!arr[k][l].getText().equals("") && txtarr[i][j] < 16) {
if (Integer.parseInt(arr[k][l].getText()) == txtarr[i][j]) {
mem = arr[i][j];
arr[i][j] = arr[k][l];
arr[k][l] = mem;
}
} else if (arr[k][l].getText().equals("") && txtarr[i][j] == 16) {
mem = arr[i][j];
arr[i][j] = arr[k][l];
arr[k][l] = mem;
}
}
}
}
}
gamepanel.repaintField(arr);
}
} | [
"as.shcheglov@gmail.com"
] | as.shcheglov@gmail.com |
5b663236fb94a5502025eab46f8e69e0aa76acbb | c19435aface677d3de0958c7fa8b0aa7e3b759f3 | /base/common/src/main/java/org/artifactory/rest/resource/task/BackgroundTask.java | 12f31e1ad59fcc41155bdecf4edd5a93add4a207 | [] | no_license | apaqi/jfrog-artifactory-5.11.0 | febc70674b4a7b90f37f2dfd126af36b90784c28 | 6a4204ed9ce9334d3eb7a8cb89c1d9dc72d709c1 | refs/heads/master | 2020-03-18T03:13:41.286825 | 2018-05-21T06:57:30 | 2018-05-21T06:57:30 | 134,229,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,783 | java | /*
*
* Artifactory is a binaries repository manager.
* Copyright (C) 2016 JFrog Ltd.
*
* Artifactory is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Artifactory 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Artifactory. If not, see <http://www.gnu.org/licenses/>.
*
*/
package org.artifactory.rest.resource.task;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.joda.time.format.ISODateTimeFormat;
import static org.artifactory.api.rest.search.result.LastDownloadRestResult.toIsoDateString;
/**
* Data object to hold background tasks data. Translates into JSON string.
*
* @author Yossi Shaul
*/
public class BackgroundTask {
private String id;
private String type;
private String state;
private String description;
/**
* Start time in ISO8601 format
*/
private String started;
private String nodeId;
@JsonCreator
private BackgroundTask() {
}
/**
* Time the task has started
*/
public BackgroundTask(String id, String type, String state, String description, long started) {
this.id = id;
this.type = type;
this.state = state;
this.description = description;
if (started > 0) {
this.started = toIsoDateString(started);
}
}
public String getId() {
return id;
}
public String getType() {
return type;
}
public String getState() {
return state;
}
public String getDescription() {
return description;
}
public String getStarted() {
return started;
}
public String getNodeId() {
return nodeId;
}
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
@JsonIgnore
public long getStartedMillis() {
//copied from RestUtils
return started == null ? 0 : ISODateTimeFormat.dateTime().parseMillis((started));
}
@Override
public String toString() {
return "BackgroundTask{" +
"id='" + id + '\'' +
", type='" + type + '\'' +
", state='" + state + '\'' +
", started='" + started + '\'' +
", nodeId='" + nodeId + '\'' +
'}';
}
}
| [
"wangpeixuan00@126.com"
] | wangpeixuan00@126.com |
7858f79d9cfe2c48a3276c097cb37ad6ee0b9675 | d55b044ce60c06d69325b4634ddb1a46eedc6e1e | /valley/src/main/java/com/hn/d/valley/x5/SecurityJsBridgeBundle.java | f0d0a3f0a0a656f5c37d153f35c4d791839f87e8 | [] | no_license | AppSecAI-TEST/UIView2 | dc40b8554fe130a3e08bc15a0282f3d4ae046e8a | b6e4f10e4e51206c9d76954fa27e185362738495 | refs/heads/master | 2021-01-16T11:41:44.850053 | 2017-08-11T06:13:09 | 2017-08-11T06:13:09 | 100,001,170 | 0 | 0 | null | 2017-08-11T06:53:18 | 2017-08-11T06:53:18 | null | UTF-8 | Java | false | false | 2,310 | java | package com.hn.d.valley.x5;
import android.content.Context;
import java.util.Map;
public abstract class SecurityJsBridgeBundle {
public static final String METHOD = "method";
public static final String BLOCK = "block";
public static final String CALLBACK = "callback";
public static final String PROMPT_START_OFFSET = "local_js_bridge::";
///////////////////////////////////////////////////////////////////////////////
//add js
private final static String DEFAULT_JS_BRIDGE = "JsBridge";
private Context mContext;
private String mJsBlockName;
private String mMethodName;
public SecurityJsBridgeBundle(String JsBlockName, String methodName) throws Exception {
if (methodName == null) {
throw new Exception("methodName can not be null!");
}
if (JsBlockName != null) {
this.mJsBlockName = JsBlockName;
} else {
this.mJsBlockName = DEFAULT_JS_BRIDGE;
}
}
private static String getStandardMethodSignature() {
return null;
}
public abstract void onCallMethod();
public String getMethodName() {
return this.mMethodName;
}
public String getJsBlockName() {
return this.mJsBlockName;
}
private void injectJsMsgPipecode(Map<String, Object> data) {
if (data == null) {
return;
}
String injectCode = "javascript:(function JsAddJavascriptInterface_(){ " +
"if (typeof(window.jsInterface)!='undefined') {" +
"console.log('window.jsInterface_js_interface_name is exist!!');} " +
"else {" +
data.get(BLOCK) + data.get(METHOD) +
"window.jsBridge = {" +
"onButtonClick:function(arg0) {" +
"return prompt('MyApp:'+JSON.stringify({obj:'jsInterface',func:'onButtonClick',args:[arg0]}));" +
"}," +
"onImageClick:function(arg0,arg1,arg2) {" +
"prompt('MyApp:'+JSON.stringify({obj:'jsInterface',func:'onImageClick',args:[arg0,arg1,arg2]}));" +
"}," +
"};" +
"}" +
"}" +
")()";
}
}
| [
"angcyo@126.com"
] | angcyo@126.com |
9a06f0f7315f9d9bf61d79fe25442e350614359c | 75950d61f2e7517f3fe4c32f0109b203d41466bf | /modules/tags/fabric3-modules-parent-pom-0.7/kernel/impl/fabric3-transform/src/main/java/org/fabric3/transform/dom2java/String2Byte.java | 2d436d3580e7eba7caba32b85218618fa21e3ea2 | [] | no_license | codehaus/fabric3 | 3677d558dca066fb58845db5b0ad73d951acf880 | 491ff9ddaff6cb47cbb4452e4ddbf715314cd340 | refs/heads/master | 2023-07-20T00:34:33.992727 | 2012-10-31T16:32:19 | 2012-10-31T16:32:19 | 36,338,853 | 0 | 0 | null | null | null | null | MacCentralEurope | Java | false | false | 1,686 | java | /*
* Fabric3
* Copyright © 2008 Metaform Systems Limited
*
* This proprietary software may be used only connection with the Fabric3 license
* (the “License”), a copy of which is included in the software or may be
* obtained at: http://www.metaformsystems.com/licenses/license.html.
* Software distributed under the License is distributed on an “as is” basis,
* without warranties or conditions of any kind. See the License for the
* specific language governing permissions and limitations of use of the software.
* This software is distributed in conjunction with other software licensed under
* different terms. See the separate licenses for those programs included in the
* distribution for the permitted and restricted uses of such software.
*
*/
package org.fabric3.transform.dom2java;
import org.w3c.dom.Node;
import org.fabric3.model.type.service.DataType;
import org.fabric3.spi.model.type.JavaClass;
import org.fabric3.spi.transform.TransformationException;
import org.fabric3.spi.transform.TransformContext;
import org.fabric3.transform.AbstractPullTransformer;
/**
* @version $Rev$ $Date$
*/
public class String2Byte extends AbstractPullTransformer<Node, Byte> {
private static final JavaClass<Byte> TARGET = new JavaClass<Byte>(Byte.class);
public DataType<?> getTargetType() {
return TARGET;
}
public Byte transform(Node node, TransformContext context) throws TransformationException {
try {
return Byte.valueOf(node.getTextContent());
} catch (NumberFormatException ex) {
throw new TransformationException("Unsupportable byte " + node.getTextContent(), ex);
}
}
}
| [
"meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf"
] | meerajk@83866bfc-822f-0410-aa35-bd5043b85eaf |
f6c81ff5ec4702fb65dd648f245cf4d54f6901d7 | 9c9e3a946e6d6f09b14b4243d6191d17bbd964db | /src/jd/plugins/decrypter/BlurGa.java | 7264462f69fd0416b5648d4cfb7884a22c7cab5b | [] | no_license | liancastellon/jd-trunk | 3ebf496cc57ab4dc8c283e4c999576d741ea0881 | 9c34cd6b90b477781c2d3fecce8793c0e08f86e3 | refs/heads/master | 2020-07-18T03:05:20.768922 | 2019-09-03T19:47:01 | 2019-09-03T19:47:01 | 206,158,196 | 3 | 3 | null | null | null | null | UTF-8 | Java | false | false | 2,134 | java | //jDownloader - Downloadmanager
//Copyright (C) 2009 JD-Team support@jdownloader.org
//
//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program. If not, see <http://www.gnu.org/licenses/>.
package jd.plugins.decrypter;
import java.util.ArrayList;
import jd.PluginWrapper;
import jd.controlling.ProgressController;
import jd.plugins.CryptedLink;
import jd.plugins.DecrypterPlugin;
import jd.plugins.DownloadLink;
import jd.plugins.PluginForDecrypt;
@DecrypterPlugin(revision = "$Revision$", interfaceVersion = 3, names = { "blur.ga" }, urls = { "https?://(?:www\\.)?blur\\.ga/[A-Za-z0-9]+" })
public class BlurGa extends PluginForDecrypt {
public BlurGa(PluginWrapper wrapper) {
super(wrapper);
}
public ArrayList<DownloadLink> decryptIt(CryptedLink param, ProgressController progress) throws Exception {
final ArrayList<DownloadLink> decryptedLinks = new ArrayList<DownloadLink>();
final String parameter = param.toString();
br.getPage(parameter);
if (br.getHttpConnection().getResponseCode() == 404) {
decryptedLinks.add(this.createOfflinelink(parameter));
return decryptedLinks;
}
final String finallink = this.br.getRegex("title=\"Click to proceed[^\"]*?\" target=\"_blank\" href=\"(http[^<>\"]+)\"").getMatch(0);
if (finallink == null) {
logger.warning("Decrypter broken for link: " + parameter);
return null;
}
decryptedLinks.add(createDownloadlink(finallink));
return decryptedLinks;
}
}
| [
"psp@ebf7c1c2-ba36-0410-9fe8-c592906822b4"
] | psp@ebf7c1c2-ba36-0410-9fe8-c592906822b4 |
f5f9812063d1a48627c230520f374ad8e540ae6e | ae12996324ff89489ded4c10163f7ff9919d080b | /LeetCodePractice/src/Palindrome/LongestPalindromeByConcatenatingTwoLetterWords.java | b1343b59f285306242b0d1a9f9cdcfccfc916dba | [] | no_license | DeanHe/Practice | 31f1f2522f3e7a35dc57f6c1ae74487ad044e2df | 3230cda09ad345f71bb1537cb66124ec051de3a5 | refs/heads/master | 2023-07-05T20:31:33.033409 | 2023-07-01T18:02:32 | 2023-07-01T18:02:32 | 149,399,927 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,368 | java | package Palindrome;
/*
You are given an array of strings words. Each element of words consists of two lowercase English letters.
Create the longest possible palindrome by selecting some elements from words and concatenating them in any order. Each element can be selected at most once.
Return the length of the longest palindrome that you can create. If it is impossible to create any palindrome, return 0.
A palindrome is a string that reads the same forward and backward.
Example 1:
Input: words = ["lc","cl","gg"]
Output: 6
Explanation: One longest palindrome is "lc" + "gg" + "cl" = "lcggcl", of length 6.
Note that "clgglc" is another longest palindrome that can be created.
Example 2:
Input: words = ["ab","ty","yt","lc","cl","ab"]
Output: 8
Explanation: One longest palindrome is "ty" + "lc" + "cl" + "yt" = "tylcclyt", of length 8.
Note that "lcyttycl" is another longest palindrome that can be created.
Example 3:
Input: words = ["cc","ll","xx"]
Output: 2
Explanation: One longest palindrome is "cc", of length 2.
Note that "ll" is another longest palindrome that can be created, and so is "xx".
Constraints:
1 <= words.length <= 10^5
words[i].length == 2
words[i] consists of lowercase English letters.
hint:
1 A palindrome must be mirrored over the center. Suppose we have a palindrome. If we prepend the word "ab" on the left,
what must we append on the right to keep it a palindrome?
2 We must append "ba" on the right. The number of times we can do this is the minimum of (occurrences of "ab") and (occurrences of "ba").
3 For words that are already palindromes, e.g. "aa", we can prepend and append these in pairs as described in the previous hint.
We can also use exactly one in the middle to form an even longer palindrome.
*/
public class LongestPalindromeByConcatenatingTwoLetterWords {
public int longestPalindrome(String[] words) {
int[][] cnt = new int[26][26];
int res = 0;
for(String w : words){
int a = w.charAt(0) - 'a';
int b = w.charAt(1) - 'a';
if(cnt[b][a] > 0){
cnt[b][a]--;
res += 4;
} else {
cnt[a][b]++;
}
}
for(int i = 0; i < 26; i++){
if(cnt[i][i] > 0){
res += 2;
break;
}
}
return res;
}
}
| [
"tengh@amazon.com"
] | tengh@amazon.com |
715a5353fbf58a39e6ef316474dd3c81f5288039 | 6c4b3ce3e12c5a8ceda91006dfaceddbcd5908aa | /com/afrisoftech/accounting/AgedcreditorsIntfr.java | 1c2e92eca00081b3e3acbc9d33f0561699c2c917 | [] | no_license | josefloso/FunsoftHMIS | a34bcc6f88c15e85069804814ecef1f9738d7576 | 0ba481260737382e57ac2c674acd03e00e9dde90 | refs/heads/master | 2021-01-15T22:20:32.504511 | 2015-12-01T07:02:42 | 2015-12-01T07:02:42 | 50,920,224 | 1 | 0 | null | 2016-02-02T12:49:53 | 2016-02-02T12:49:53 | null | UTF-8 | Java | false | false | 6,789 | java | /*
* loanpymntintfr.java
*
* Created on August 13, 2002, 1:09 PM
*/
package com.afrisoftech.accounting;
/**
*
* @author root
*/
public class AgedcreditorsIntfr extends javax.swing.JInternalFrame {
/** Creates new form loanpymntintfr */
java.sql.Connection connectDB = null;
org.netbeans.lib.sql.pool.PooledConnectionSource pConnDB = null;
public AgedcreditorsIntfr(java.sql.Connection connDb, org.netbeans.lib.sql.pool.PooledConnectionSource pconnDB) {
connectDB = connDb;
pConnDB = pconnDB;
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
try {
nBCachedRowSet1 = new org.netbeans.lib.sql.NBCachedRowSet();
} catch (java.sql.SQLException e1) {
e1.printStackTrace();
}
jButton4 = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
jLabel7 = new javax.swing.JLabel();
jTextField6 = new javax.swing.JTextField();
jPanel2 = new javax.swing.JPanel();
jPanel21 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new com.afrisoftech.dbadmin.JTable();
nBCachedRowSet1.setConnectionSource(pConnDB);
getContentPane().setLayout(new java.awt.GridBagLayout());
setClosable(true);
setIconifiable(true);
setMaximizable(true);
setResizable(true);
setTitle("Aged Creditors");
setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
setFrameIcon(new javax.swing.ImageIcon(getClass().getResource("/ColorPreview.gif")));
try {
setSelected(true);
} catch (java.beans.PropertyVetoException e1) {
e1.printStackTrace();
}
setVisible(true);
jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/BD14755_.GIF")));
jButton4.setMnemonic('C');
jButton4.setText("Close");
jButton4.setToolTipText("Click here to close window");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 5;
gridBagConstraints.gridy = 14;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
getContentPane().add(jButton4, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 12;
gridBagConstraints.gridwidth = 6;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.SOUTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
getContentPane().add(jSeparator1, gridBagConstraints);
jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 13;
gridBagConstraints.gridwidth = 6;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.weightx = 1.0;
getContentPane().add(jLabel7, gridBagConstraints);
jTextField6.setEditable(false);
jTextField6.setMinimumSize(new java.awt.Dimension(0, 0));
jTextField6.setPreferredSize(new java.awt.Dimension(0, 0));
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 11;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
getContentPane().add(jTextField6, gridBagConstraints);
jPanel2.setLayout(new java.awt.GridBagLayout());
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jPanel21.setLayout(new java.awt.GridBagLayout());
jPanel21.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
jScrollPane1.setViewportView(jTable1);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 1.0;
jPanel21.add(jScrollPane1, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 4;
gridBagConstraints.gridwidth = 5;
gridBagConstraints.gridheight = 3;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 3.0;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 10);
jPanel2.add(jPanel21, gridBagConstraints);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 6;
gridBagConstraints.gridwidth = 6;
gridBagConstraints.gridheight = 4;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
gridBagConstraints.weightx = 1.0;
gridBagConstraints.weighty = 8.0;
gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 10);
getContentPane().add(jPanel2, gridBagConstraints);
setBounds(0, 0, 697, 281);
}// </editor-fold>//GEN-END:initComponents
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
this.setVisible(false); // Add your handling code here:
}//GEN-LAST:event_jButton4ActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel21;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTable jTable1;
private javax.swing.JTextField jTextField6;
private org.netbeans.lib.sql.NBCachedRowSet nBCachedRowSet1;
// End of variables declaration//GEN-END:variables
}
| [
"Charles@Funsoft"
] | Charles@Funsoft |
0495fa124c691f3f3ec83c3057dba8409e0dbfd5 | 86505462601eae6007bef6c9f0f4eeb9fcdd1e7b | /bin/modules/web-content-management-system/cmsfacades/src/de/hybris/platform/cmsfacades/navigations/populator/data/NavigationNodeDataToModelUidGenerationPopulator.java | 17f3b7f214959b6e409ede2d5ebff0e4a90c5de9 | [] | no_license | jp-developer0/hybrisTrail | 82165c5b91352332a3d471b3414faee47bdb6cee | a0208ffee7fee5b7f83dd982e372276492ae83d4 | refs/heads/master | 2020-12-03T19:53:58.652431 | 2020-01-02T18:02:34 | 2020-01-02T18:02:34 | 231,430,332 | 0 | 4 | null | 2020-08-05T22:46:23 | 2020-01-02T17:39:15 | null | UTF-8 | Java | false | false | 1,651 | java | /*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package de.hybris.platform.cmsfacades.navigations.populator.data;
import de.hybris.platform.cms2.model.navigation.CMSNavigationNodeModel;
import de.hybris.platform.cmsfacades.data.NavigationNodeData;
import de.hybris.platform.converters.Populator;
import de.hybris.platform.servicelayer.dto.converter.ConversionException;
import de.hybris.platform.servicelayer.keygenerator.KeyGenerator;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Required;
/**
* This populator will populate the {@link CMSNavigationNodeModel}'s uid attribute with a generated key if the source's
* uid is empty.
*
* @deprecated since 1811, please use {@link de.hybris.platform.cmsfacades.cmsitems.CMSItemFacade} instead.
*/
@Deprecated
public class NavigationNodeDataToModelUidGenerationPopulator implements Populator<NavigationNodeData, CMSNavigationNodeModel>
{
private static final String DEFAULT_UID_PREFIX = "navnode_";
private KeyGenerator processCodeGenerator;
@Override
public void populate(final NavigationNodeData source, final CMSNavigationNodeModel target) throws ConversionException
{
if (StringUtils.isEmpty(source.getUid()))
{
target.setUid(DEFAULT_UID_PREFIX + String.valueOf(processCodeGenerator.generate()));
}
else
{
target.setUid(source.getUid());
}
}
protected KeyGenerator getProcessCodeGenerator()
{
return processCodeGenerator;
}
@Required
public void setProcessCodeGenerator(final KeyGenerator processCodeGenerator)
{
this.processCodeGenerator = processCodeGenerator;
}
}
| [
"juan.gonzalez.working@gmail.com"
] | juan.gonzalez.working@gmail.com |
fe91f72dbdf8c76b81c608fa745471e5885db94d | ea87e7258602e16675cec3e29dd8bb102d7f90f8 | /fest-swing/src/test/java/org/fest/swing/fixture/ConcreteContainerFixture.java | beca984c4e6c6ce7135bf5bd9ed430416b99d9f4 | [
"Apache-2.0"
] | permissive | codehaus/fest | 501714cb0e6f44aa1b567df57e4f9f6586311862 | a91c0c0585c2928e255913f1825d65fa03399bc6 | refs/heads/master | 2023-07-20T01:30:54.762720 | 2010-09-02T00:56:33 | 2010-09-02T00:56:33 | 36,525,844 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,257 | java | /*
* Created on Jun 7, 2009
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*
* Copyright @2009-2010 the original author or authors.
*/
package org.fest.swing.fixture;
import java.awt.Point;
import javax.swing.JFrame;
import org.fest.swing.core.Robot;
/**
* Understands an implementation of <code>{@link ContainerFixture}</code> for testing purposes.
*
* @author Alex Ruiz
*/
public class ConcreteContainerFixture extends ContainerFixture<JFrame> {
public ConcreteContainerFixture(Robot robot, JFrame target) { super(robot, target); }
public JPopupMenuFixture showPopupMenu() { return null; }
public JPopupMenuFixture showPopupMenuAt(Point p) {
if (p == null) return null; // just to satisfy compiler warning
return null;
}
}
| [
"alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc"
] | alexruiz@0e018e5f-c563-0410-a877-f7675914c6cc |
6475743dc5b8dd5e4e10fd9d875846b01a2e68c1 | d2dd8300ff8a22a8b76e6eeadc8cad25c9094ce2 | /src/main/java/com/changhong/app/repository/UserDaoImpl.java | 82ee5865ba0ddb5b39945000767fe623ae1302b9 | [] | no_license | kunkun39/CH_DEV | 8593b0b9bb8d03c442be47bdfcb6034b6cebb5ae | 9def29990e1a2aa98e444cb1793173abd731abe4 | refs/heads/master | 2021-01-10T07:57:05.027773 | 2016-01-27T03:41:06 | 2016-01-27T03:41:06 | 48,478,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,861 | java | package com.changhong.app.repository;
import com.changhong.app.domain.*;
import com.changhong.app.utils.EscapesUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.hibernate.Query;
import org.hibernate.Session;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.stereotype.Repository;
import org.springframework.util.StringUtils;
import java.util.List;
/**
* User: Jack Wang
* Date: 15-10-15
* Time: 上午10:38
*/
@Repository("userDao")
public class UserDaoImpl extends HibernateEntityObjectDao implements UserDao {
private static final Log log= LogFactory.getLog(UserDaoImpl.class);
public UserDetails findUserByName(String username) {
List<Auth> auths = getHibernateTemplate().find("from AdminUser u where u.username = ? and u.enabled = true", username);
if (!auths.isEmpty()) {
return auths.get(0);
}
auths = getHibernateTemplate().find("from ClientUser u where u.username = ? and u.enabled = true and u.active = true", username);
return auths.isEmpty() ? null : auths.get(0);
}
@Override
public EntityBase findById(int id, Class clazz) {
return super.findById(id, clazz);
}
@Override
public void saveOrUpdate(EntityBase entity) {
super.saveOrUpdate(entity);
}
public List<AdminUser> loadAdminUsersByNameOrContactway(String keyWords, int startPosition, int pageSize) {
StringBuilder builder = new StringBuilder();
builder.append("from AdminUser u");
if (StringUtils.hasText(keyWords)) {
String keyWord = EscapesUtils.escapesLikeQueryForSQL(keyWords);
builder.append(" where u.username like '%" + keyWord + "%' or u.contactWay like '%" + keyWord + "%'");
}
builder.append(" order by u.id desc");
Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
Query query = session.createQuery(builder.toString());
query.setMaxResults(pageSize);
query.setFirstResult(startPosition);
List<AdminUser> users = query.list();
return users;
}
public int loadAdminUserSizeByNameOrContactway(String keyWords) {
StringBuilder builder = new StringBuilder();
builder.append("select count(u.id) from AdminUser u");
if (StringUtils.hasText(keyWords)) {
String keyWord = EscapesUtils.escapesLikeQueryForSQL(keyWords);
builder.append(" where u.username like '%" + keyWord + "%' or u.contactWay like '%" + keyWord + "%'");
}
List list = getHibernateTemplate().find(builder.toString());
return ((Long) list.get(0)).intValue();
}
public List<ClientUser> loadAdminDevelopers(String name, int startPosition, int pageSize) {
StringBuilder builder = new StringBuilder();
builder.append("from ClientUser u where u.active=1");
if (StringUtils.hasText(name)) {
String keyWord = EscapesUtils.escapesLikeQueryForSQL(name);
builder.append(" and (u.username like '%" + keyWord + "%' or u.name like '%" + keyWord + "%')");
}
Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
Query query = session.createQuery(builder.toString());
query.setMaxResults(pageSize);
query.setFirstResult(startPosition);
List<ClientUser> users = query.list();
return users;
}
public int loadAdminDeveloperSize(String name) {
StringBuilder builder = new StringBuilder();
builder.append("select count(u.id) from ClientUser u where u.active=1");
if (StringUtils.hasText(name)) {
String keyWord = EscapesUtils.escapesLikeQueryForSQL(name);
builder.append(" and (u.username like '%" + keyWord + "%' or u.name like '%" + keyWord + "%')");
}
List list = getHibernateTemplate().find(builder.toString());
return ((Long) list.get(0)).intValue();
}
public List<AdminUser> loadAdminUserByName(String userName) {
StringBuilder builder = new StringBuilder();
builder.append("from AdminUser u");
if (StringUtils.hasText(userName)) {
builder.append(" where u.username='" + EscapesUtils.escapesEqualQueryForSQL(userName) + "'");
}
List<AdminUser> users = getHibernateTemplate().find(builder.toString());
return users;
}
public boolean loadClientUserExist(String username) {
List userList = getHibernateTemplate().find("select count(u.id) from ClientUser u where u.username = ?", new Object[]{username});
return ((Long) userList.get(0)).intValue() > 0 ? true : false;
}
@Override
public ClientUser loadClientUser(String username) {
List<ClientUser> userList = getHibernateTemplate().find("from ClientUser u where u.username = ? ", new Object[]{username});
return userList.isEmpty() ? null : userList.get(0);
}
public boolean loadClientUserEnable(String username) {
if (StringUtils.hasText(username) && username.indexOf("@") > 0) {
List<ClientUser> clients = getHibernateTemplate().find("from ClientUser u where u.username = ?", new Object[]{username});
if (clients.isEmpty()) {
return true;
} else {
ClientUser user = clients.get(0);
return user.isEnabled();
}
}
return true;
}
@Override
public RegisterConfirm loadClientUserRegisterConfirm(String validateNumber) {
//and r.validateConfirm = false 去掉改查询语句,因为之前加上改查询语句就默认判断空的时候是已经注册成功,但是没考虑到用户乱注册情况
List<RegisterConfirm> confirms = getHibernateTemplate().find("from RegisterConfirm r where r.validateNumber = ? order by r.timestamp desc", new Object[]{validateNumber});
if (confirms.isEmpty()) {
return null;
}
return confirms.get(0);
}
@Override
public RegisterConfirm loadRegisterConfirmByUsername(String username) {
List<RegisterConfirm> confirms = getHibernateTemplate().find("from RegisterConfirm r where r.username = ? order by r.timestamp desc", new Object[]{username});
if (confirms.isEmpty()) {
return null;
}
return confirms.get(0);
}
public void updateUserPassword(String username, String newPassword) {
ClientUser clientUser=loadClientUser(username);
clientUser.setPassword(newPassword);
getHibernateTemplate().update(clientUser);
}
}
| [
"34445282@qq.com"
] | 34445282@qq.com |
733d67050e7f9a7a8f24133b8a07c585ad42a948 | 22b1fe6a0af8ab3c662551185967bf2a6034a5d2 | /experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_6697.java | acfcf2f48f0b347852f5f8299067cb16dcdbd85a | [
"Apache-2.0"
] | permissive | lesaint/experimenting-annotation-processing | b64ed2182570007cb65e9b62bb2b1b3f69d168d6 | 1e9692ceb0d3d2cda709e06ccc13290262f51b39 | refs/heads/master | 2021-01-23T11:20:19.836331 | 2014-11-13T10:37:14 | 2014-11-13T10:37:14 | 26,336,984 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 151 | java | package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_6697 {
}
| [
"sebastien.lesaint@gmail.com"
] | sebastien.lesaint@gmail.com |
dbabaad827816b585fa055573b5413be3576cffd | 293af812d3ebf4acafe0c90d1986849046f23dad | /src/main/java/com/hncboy/design/principle/liskovsubstitution/Square.java | df0a3407977137a5a07cd687b07c65ab32f79c3f | [] | no_license | hncboy/DesignPattern | e9dd33cbfb9a966245dbb13b9244a5817c43a624 | 3cc4a04023d6368918f5a6697f4feacdd8a813af | refs/heads/master | 2022-12-23T08:31:35.204325 | 2019-09-05T09:11:31 | 2019-09-05T09:11:31 | 182,771,259 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 539 | java | package com.hncboy.design.principle.liskovsubstitution;
/**
* Created by IntelliJ IDEA.
* User: hncboy
* Date: 2019-05-08
* Time: 18:36
*/
public class Square implements Quadrangle {
private long sideLength;
public long getSideLength() {
return sideLength;
}
public void setSideLength(long sideLength) {
this.sideLength = sideLength;
}
@Override
public long getLength() {
return sideLength;
}
@Override
public long getWidth() {
return sideLength;
}
}
| [
"619452863@qq.com"
] | 619452863@qq.com |
0c542ac9a9c3357613697179e521d9dc4e104b0f | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project20/src/test/java/org/gradle/test/performance20_4/Test20_379.java | 3807de2ff0308770a1cb45d2d48f04639d66abf7 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 292 | java | package org.gradle.test.performance20_4;
import static org.junit.Assert.*;
public class Test20_379 {
private final Production20_379 production = new Production20_379("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
43a276a879188115197a65b6eef7fe2ada425e1b | 470a082b80b92541a0c982e922b3ebd5106b338d | /RewardedVideoExample/src/main/java/org/robovm/pods/google/GADAppEventDelegate.java | d58fbd5673017275a78dfcb5a1834b7ab12f131b | [] | no_license | dkimitsa/codesnippets | e4052e76287763c770893865f66004114a82b52f | 52e33354b7f2dce871544d4dfcabb571255d861d | refs/heads/master | 2023-04-19T00:58:50.394356 | 2023-04-01T18:15:22 | 2023-04-01T18:15:22 | 107,535,220 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,861 | java | /*
* Copyright (C) 2013-2015 RoboVM AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.robovm.pods.google;
/*<imports>*/
import java.io.*;
import java.nio.*;
import java.util.*;
import org.robovm.objc.*;
import org.robovm.objc.annotation.*;
import org.robovm.objc.block.*;
import org.robovm.rt.*;
import org.robovm.rt.annotation.*;
import org.robovm.rt.bro.*;
import org.robovm.rt.bro.annotation.*;
import org.robovm.rt.bro.ptr.*;
import org.robovm.apple.foundation.*;
import org.robovm.apple.uikit.*;
import org.robovm.apple.storekit.*;
import org.robovm.apple.coregraphics.*;
/*</imports>*/
/*<javadoc>*/
/*</javadoc>*/
/*<annotations>*//*</annotations>*/
/*<visibility>*/public/*</visibility>*/ interface /*<name>*/GADAppEventDelegate/*</name>*/
/*<implements>*/extends NSObjectProtocol/*</implements>*/ {
/*<ptr>*/
/*</ptr>*/
/*<bind>*/
/*</bind>*/
/*<constants>*//*</constants>*/
/*<properties>*/
/*</properties>*/
/*<methods>*/
@Method(selector = "adView:didReceiveAppEvent:withInfo:")
void didReceiveAppEvent(GADBannerView banner, String name, String info);
@Method(selector = "interstitial:didReceiveAppEvent:withInfo:")
void didReceiveAppEvent(GADInterstitial interstitial, String name, String info);
/*</methods>*/
/*<adapter>*/
/*</adapter>*/
}
| [
"demyan.kimitsa@gmail.com"
] | demyan.kimitsa@gmail.com |
20a33b4e153d186f041138f398a4df76acd55f1b | c71140cde8034e35faf2f67e85710611797ad49b | /plugin-infra/go-plugin-infra/src/main/java/com/thoughtworks/go/plugin/infra/plugininfo/GoPluginOSGiManifest.java | 5703e9267d911d1f3d865aeeaa9f3aed1d92d1ac | [
"Apache-2.0"
] | permissive | cburgmer/gocd | 0c3cc7e2acdb62a5668247f50d533366f1be5395 | 4db1ab38e0ee0b84bad87f532d25440eebc36c18 | refs/heads/master | 2020-03-10T14:16:20.613357 | 2018-04-13T15:38:31 | 2018-04-16T03:56:44 | 129,422,106 | 0 | 0 | Apache-2.0 | 2018-04-13T15:38:53 | 2018-04-13T15:38:53 | null | UTF-8 | Java | false | false | 5,201 | java | /*************************GO-LICENSE-START*********************************
* Copyright 2014 ThoughtWorks, 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.
*************************GO-LICENSE-END***********************************/
package com.thoughtworks.go.plugin.infra.plugininfo;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collection;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
import com.thoughtworks.go.plugin.activation.DefaultGoPluginActivator;
import org.apache.commons.io.FileUtils;
import org.springframework.stereotype.Component;
import static org.osgi.framework.Constants.BUNDLE_ACTIVATOR;
import static org.osgi.framework.Constants.BUNDLE_CLASSPATH;
import static org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME;
public class GoPluginOSGiManifest {
private static final String BUNDLE_ROOT_DIR = ".";
public static final String PLUGIN_DEPENDENCY_DIR = "lib";
private static final String PLUGIN_DEPS_DIR_PREFIX = "," + PLUGIN_DEPENDENCY_DIR + "/";
public static final String ACTIVATOR_JAR_NAME = "go-plugin-activator.jar";
private static final String CLASSPATH_PREFIX = String.format("%s/%s,%s", PLUGIN_DEPENDENCY_DIR, ACTIVATOR_JAR_NAME, BUNDLE_ROOT_DIR);
private GoPluginDescriptor descriptor;
private File manifestLocation;
private File dependenciesDir;
public GoPluginOSGiManifest(GoPluginDescriptor descriptor) {
this.descriptor = descriptor;
manifestLocation = new File(descriptor.bundleLocation(), "META-INF/MANIFEST.MF");
dependenciesDir = new File(descriptor.bundleLocation(), PLUGIN_DEPENDENCY_DIR);
}
public void update() throws IOException {
String symbolicName = descriptor.id();
String classPath = buildClassPath();
String bundleActivator = DefaultGoPluginActivator.class.getCanonicalName();
if (!manifestLocation.exists()) {
manifestLocation.createNewFile();
}
updateManifest(symbolicName, classPath, bundleActivator);
}
private void updateManifest(String symbolicName, String classPath, String bundleActivator) throws IOException {
FileOutputStream manifestOutputStream = null;
FileInputStream manifestInputStream = null;
try {
manifestInputStream = new FileInputStream(manifestLocation);
Manifest manifest = new Manifest(manifestInputStream);
Attributes mainAttributes = manifest.getMainAttributes();
if (mainAttributes.containsKey(new Attributes.Name(BUNDLE_SYMBOLICNAME))) {
descriptor.markAsInvalid(Arrays.asList("Plugin JAR is invalid. MANIFEST.MF already contains header: " + BUNDLE_SYMBOLICNAME), null);
return;
}
mainAttributes.put(new Attributes.Name(BUNDLE_SYMBOLICNAME), symbolicName);
mainAttributes.put(new Attributes.Name(BUNDLE_CLASSPATH), classPath);
mainAttributes.put(new Attributes.Name(BUNDLE_ACTIVATOR), bundleActivator);
descriptor.updateBundleInformation(symbolicName, classPath, bundleActivator);
manifestOutputStream = new FileOutputStream(manifestLocation);
manifest.write(manifestOutputStream);
} finally {
if (manifestInputStream != null) {
manifestInputStream.close();
}
if (manifestOutputStream != null) {
manifestOutputStream.close();
}
}
}
private String buildClassPath() {
StringBuilder header = new StringBuilder(CLASSPATH_PREFIX);
if (!dependenciesDir.exists() || !dependenciesDir.isDirectory()) {
return header.toString();
}
Collection<File> dependencyJars = FileUtils.listFiles(dependenciesDir, new String[]{"jar"}, false);
for (File dependencyJarFileName : dependencyJars) {
if (!ACTIVATOR_JAR_NAME.equals(dependencyJarFileName.getName())) {
header.append(PLUGIN_DEPS_DIR_PREFIX).append(dependencyJarFileName.getName());
}
}
return header.toString();
}
@Component
public static class DefaultGoPluginOSGiManifestCreator implements GoPluginOSGiManifestGenerator {
public void updateManifestOf(GoPluginDescriptor descriptor) {
GoPluginOSGiManifest manifest = new GoPluginOSGiManifest(descriptor);
try {
manifest.update();
} catch (IOException e) {
throw new RuntimeException("Failed to update MANIFEST.MF", e);
}
}
}
}
| [
"godev@thoughtworks.com"
] | godev@thoughtworks.com |
f7d958f173162f31f54140232d70f45600fa9fb0 | fc6c869ee0228497e41bf357e2803713cdaed63e | /weixin6519android1140/src/sourcecode/com/tencent/mm/protocal/c/eg.java | 4531ec307d0394a3145d1cf470f91b0ba5c61746 | [] | no_license | hyb1234hi/reverse-wechat | cbd26658a667b0c498d2a26a403f93dbeb270b72 | 75d3fd35a2c8a0469dbb057cd16bca3b26c7e736 | refs/heads/master | 2020-09-26T10:12:47.484174 | 2017-11-16T06:54:20 | 2017-11-16T06:54:20 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,305 | java | package com.tencent.mm.protocal.c;
import com.tencent.gmtrace.GMTrace;
import java.util.LinkedList;
public final class eg
extends ayx
{
public long jhw;
public int tOG;
public int tSN;
public LinkedList<nu> tSO;
public String tSP;
public String tSQ;
public String tSR;
public String tSS;
public eg()
{
GMTrace.i(3972307877888L, 29596);
this.tSO = new LinkedList();
GMTrace.o(3972307877888L, 29596);
}
protected final int a(int paramInt, Object... paramVarArgs)
{
GMTrace.i(3972442095616L, 29597);
if (paramInt == 0)
{
paramVarArgs = (b.a.a.c.a)paramVarArgs[0];
if (this.uNh != null)
{
paramVarArgs.fm(1, this.uNh.aYq());
this.uNh.a(paramVarArgs);
}
paramVarArgs.fk(2, this.tSN);
paramVarArgs.d(3, 8, this.tSO);
if (this.tSP != null) {
paramVarArgs.e(4, this.tSP);
}
if (this.tSQ != null) {
paramVarArgs.e(5, this.tSQ);
}
paramVarArgs.fk(6, this.tOG);
paramVarArgs.T(7, this.jhw);
if (this.tSR != null) {
paramVarArgs.e(8, this.tSR);
}
if (this.tSS != null) {
paramVarArgs.e(9, this.tSS);
}
GMTrace.o(3972442095616L, 29597);
return 0;
}
int i;
if (paramInt == 1)
{
paramInt = 0;
if (this.uNh != null) {
paramInt = b.a.a.a.fj(1, this.uNh.aYq()) + 0;
}
i = paramInt + b.a.a.a.fh(2, this.tSN) + b.a.a.a.c(3, 8, this.tSO);
paramInt = i;
if (this.tSP != null) {
paramInt = i + b.a.a.b.b.a.f(4, this.tSP);
}
i = paramInt;
if (this.tSQ != null) {
i = paramInt + b.a.a.b.b.a.f(5, this.tSQ);
}
i = i + b.a.a.a.fh(6, this.tOG) + b.a.a.a.S(7, this.jhw);
paramInt = i;
if (this.tSR != null) {
paramInt = i + b.a.a.b.b.a.f(8, this.tSR);
}
i = paramInt;
if (this.tSS != null) {
i = paramInt + b.a.a.b.b.a.f(9, this.tSS);
}
GMTrace.o(3972442095616L, 29597);
return i;
}
if (paramInt == 2)
{
paramVarArgs = (byte[])paramVarArgs[0];
this.tSO.clear();
paramVarArgs = new b.a.a.a.a(paramVarArgs, unknownTagHandler);
for (paramInt = ayx.a(paramVarArgs); paramInt > 0; paramInt = ayx.a(paramVarArgs)) {
if (!super.a(paramVarArgs, this, paramInt)) {
paramVarArgs.csW();
}
}
GMTrace.o(3972442095616L, 29597);
return 0;
}
if (paramInt == 3)
{
Object localObject1 = (b.a.a.a.a)paramVarArgs[0];
eg localeg = (eg)paramVarArgs[1];
paramInt = ((Integer)paramVarArgs[2]).intValue();
Object localObject2;
boolean bool;
switch (paramInt)
{
default:
GMTrace.o(3972442095616L, 29597);
return -1;
case 1:
paramVarArgs = ((b.a.a.a.a)localObject1).Gv(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject2 = (byte[])paramVarArgs.get(paramInt);
localObject1 = new er();
localObject2 = new b.a.a.a.a((byte[])localObject2, unknownTagHandler);
for (bool = true; bool; bool = ((er)localObject1).a((b.a.a.a.a)localObject2, (com.tencent.mm.bm.a)localObject1, ayx.a((b.a.a.a.a)localObject2))) {}
localeg.uNh = ((er)localObject1);
paramInt += 1;
}
GMTrace.o(3972442095616L, 29597);
return 0;
case 2:
localeg.tSN = ((b.a.a.a.a)localObject1).yqV.nj();
GMTrace.o(3972442095616L, 29597);
return 0;
case 3:
paramVarArgs = ((b.a.a.a.a)localObject1).Gv(paramInt);
i = paramVarArgs.size();
paramInt = 0;
while (paramInt < i)
{
localObject2 = (byte[])paramVarArgs.get(paramInt);
localObject1 = new nu();
localObject2 = new b.a.a.a.a((byte[])localObject2, unknownTagHandler);
for (bool = true; bool; bool = ((nu)localObject1).a((b.a.a.a.a)localObject2, (com.tencent.mm.bm.a)localObject1, ayx.a((b.a.a.a.a)localObject2))) {}
localeg.tSO.add(localObject1);
paramInt += 1;
}
GMTrace.o(3972442095616L, 29597);
return 0;
case 4:
localeg.tSP = ((b.a.a.a.a)localObject1).yqV.readString();
GMTrace.o(3972442095616L, 29597);
return 0;
case 5:
localeg.tSQ = ((b.a.a.a.a)localObject1).yqV.readString();
GMTrace.o(3972442095616L, 29597);
return 0;
case 6:
localeg.tOG = ((b.a.a.a.a)localObject1).yqV.nj();
GMTrace.o(3972442095616L, 29597);
return 0;
case 7:
localeg.jhw = ((b.a.a.a.a)localObject1).yqV.nk();
GMTrace.o(3972442095616L, 29597);
return 0;
case 8:
localeg.tSR = ((b.a.a.a.a)localObject1).yqV.readString();
GMTrace.o(3972442095616L, 29597);
return 0;
}
localeg.tSS = ((b.a.a.a.a)localObject1).yqV.readString();
GMTrace.o(3972442095616L, 29597);
return 0;
}
GMTrace.o(3972442095616L, 29597);
return -1;
}
}
/* Location: D:\tools\apktool\weixin6519android1140\jar\classes-dex2jar.jar!\com\tencent\mm\protocal\c\eg.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"robert0825@gmail.com"
] | robert0825@gmail.com |
6bce8cd4911a777ef08ada167bc188ea32369584 | 0ca75c22c050b6df85b4f0c50879a614c06139e5 | /trunk/Workflow/SigmaProject/src/java/registrarproveedor/GestorRegistrarProveedor.java | 07f657377107d9d8be6f4dd14895fd33e183695d | [] | no_license | BGCX067/fabricamuebles-svn-to-git | 23fe0b21a691647f2eb2f29fb4d8539c532358bd | c841245e9980895cc019ea561a1d3ba33e013c41 | refs/heads/master | 2016-09-01T08:53:03.050078 | 2015-12-28T14:25:56 | 2015-12-28T14:25:56 | 48,699,139 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,560 | java | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package registrarproveedor;
import entidades.Direccion;
import entidades.Proveedor;
import entidades.Telefono;
import java.util.Collection;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
/**
*
* @author Cristian
*/
@Stateful
//@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
public class GestorRegistrarProveedor {
@PersistenceContext//(type=PersistenceContextType.EXTENDED)
EntityManager em;
private Boolean modo = null;
private Proveedor nuevo;
public GestorRegistrarProveedor() {
nuevo = new Proveedor();
}
public void descartarCambiosProveedor() {
nuevo = null;
//((EntityManagerImpl)em.getDelegate()).getSession().refresh(this.proveedorElegido);
}
public Proveedor getNuevoProveedor() {
return nuevo;
}
public void registrarProveedor() {
Collection<Direccion> direcciones = nuevo.getDirecciones();
Collection<Telefono> telefonos = nuevo.getTelefonos();
nuevo.setDirecciones(null);
nuevo.setTelefonos(null);
em.persist(nuevo);
nuevo.setDirecciones(direcciones);
nuevo.setTelefonos(telefonos);
em.merge(nuevo);
}
public void reiniciar() {
this.modo = null;
this.nuevo = null;
this.nuevo = new Proveedor();
}
public void setNuevoProveedor(Proveedor p) {
this.nuevo = p;
}
}
| [
"you@example.com"
] | you@example.com |
3ead4a5180047e9d7a19c2abf348f71b99b9e963 | 6920d1920310170d0a415d53937fe05560253716 | /Sanae/src/main/java/com/meng/modules/qq/handler/friend/IFriendMessageEvent.java | 8f15aa542b7c3470e94bef8445b792a70666ba77 | [] | no_license | THSJF/SJFBot | 62840c3477379d8a8468ac02c4fe3d8a9033d308 | 2fcf5a7db85637118afa260eb54798590afd82cb | refs/heads/master | 2023-07-10T01:31:27.743098 | 2021-08-08T08:28:08 | 2021-08-08T08:28:08 | 295,124,266 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 239 | java | package com.meng.modules.qq.handler.friend;
import net.mamoe.mirai.event.events.FriendMessageEvent;
/**
* @author: 司徒灵羽
**/
public interface IFriendMessageEvent {
public boolean onFriendMessage(FriendMessageEvent event);
}
| [
"2856986197@qq.com"
] | 2856986197@qq.com |
c12d765a32ec508faa8cd3b02484899a7925857c | 5a57df50988072d1fc20518e6b22cbd866985f00 | /app/src/main/java/com/example/rendondev/readreddit/ReadRedditMvp/Model/Repository/IReadRedditRepository.java | ab2be6d47141c63910e3e58fde835ccf93c34acc | [] | no_license | rendondeveloper/ReadReddit | 85fd44bc0fc147524f72ccd067eeef4c2306ac62 | ee687fb340b5c678e1931d2c468e61e672954680 | refs/heads/master | 2020-07-20T20:48:01.965820 | 2019-09-08T05:31:50 | 2019-09-08T05:31:50 | 206,700,319 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 161 | java | package com.example.rendondev.readreddit.ReadRedditMvp.Model.Repository;
public interface IReadRedditRepository {
void GetRedditList(final String topic);
}
| [
"12345678"
] | 12345678 |
fbf51ea564736286847e6159f301ebdc0076e256 | 2f3c04382a66dbf222c8587edd67a5df4bc80422 | /src/com/cedar/cp/dto/extsys/ExternalSystemPK.java | ec6f8503340112c28b1ef736cd78ae2ddc21ce87 | [] | no_license | arnoldbendaa/cppro | d3ab6181cc51baad2b80876c65e11e92c569f0cc | f55958b85a74ad685f1360ae33c881b50d6e5814 | refs/heads/master | 2020-03-23T04:18:00.265742 | 2018-09-11T08:15:28 | 2018-09-11T08:15:28 | 141,074,966 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,024 | java | /* */ package com.cedar.cp.dto.extsys;
/* */
/* */ import com.cedar.cp.dto.base.PrimaryKey;
/* */ import java.io.Serializable;
/* */
/* */ public class ExternalSystemPK extends PrimaryKey
/* */ implements Serializable
/* */ {
/* 114 */ private int mHashCode = -2147483648;
/* */ int mExternalSystemId;
/* */
/* */ public ExternalSystemPK(int newExternalSystemId)
/* */ {
/* 23 */ this.mExternalSystemId = newExternalSystemId;
/* */ }
/* */
/* */ public int getExternalSystemId()
/* */ {
/* 32 */ return this.mExternalSystemId;
/* */ }
/* */
/* */ public int hashCode()
/* */ {
/* 40 */ if (this.mHashCode == -2147483648)
/* */ {
/* 42 */ this.mHashCode += String.valueOf(this.mExternalSystemId).hashCode();
/* */ }
/* */
/* 45 */ return this.mHashCode;
/* */ }
/* */
/* */ public boolean equals(Object obj)
/* */ {
/* 53 */ ExternalSystemPK other = null;
/* */
/* 55 */ if ((obj instanceof ExternalSystemCK)) {
/* 56 */ other = ((ExternalSystemCK)obj).getExternalSystemPK();
/* */ }
/* 58 */ else if ((obj instanceof ExternalSystemPK))
/* 59 */ other = (ExternalSystemPK)obj;
/* */ else {
/* 61 */ return false;
/* */ }
/* 63 */ boolean eq = true;
/* */
/* 65 */ eq = (eq) && (this.mExternalSystemId == other.mExternalSystemId);
/* */
/* 67 */ return eq;
/* */ }
/* */
/* */ public String toString()
/* */ {
/* 75 */ StringBuffer sb = new StringBuffer();
/* 76 */ sb.append(" ExternalSystemId=");
/* 77 */ sb.append(this.mExternalSystemId);
/* 78 */ return sb.toString().substring(1);
/* */ }
/* */
/* */ public String toTokens()
/* */ {
/* 86 */ StringBuffer sb = new StringBuffer();
/* 87 */ sb.append(" ");
/* 88 */ sb.append(this.mExternalSystemId);
/* 89 */ return "ExternalSystemPK|" + sb.toString().substring(1);
/* */ }
/* */
/* */ public static ExternalSystemPK getKeyFromTokens(String extKey)
/* */ {
/* 94 */ String[] extValues = extKey.split("[|]");
/* */
/* 96 */ if (extValues.length != 2) {
/* 97 */ throw new IllegalStateException(extKey + ": format incorrect");
/* */ }
/* 99 */ if (!extValues[0].equals("ExternalSystemPK")) {
/* 100 */ throw new IllegalStateException(extKey + ": format incorrect - must start with 'ExternalSystemPK|'");
/* */ }
/* 102 */ extValues = extValues[1].split(",");
/* */
/* 104 */ int i = 0;
/* 105 */ int pExternalSystemId = new Integer(extValues[(i++)]).intValue();
/* 106 */ return new ExternalSystemPK(pExternalSystemId);
/* */ }
/* */ }
/* Location: /home/oracle/coa/cp.ear/cp-extracted/utc.war/cp-common.jar
* Qualified Name: com.cedar.cp.dto.extsys.ExternalSystemPK
* JD-Core Version: 0.6.0
*/ | [
"arnoldbendaa@gmail.com"
] | arnoldbendaa@gmail.com |
bd87e33341255348205cb3f8de798d77b918bb05 | 017b6dd7d3a526ff1664c3f5734d7943c4a30815 | /src/main/java/com/bfsi/mfi/dao/CashRecDao.java | 530731b98ac00c2309d7b63e2fe659e5c9107cb4 | [
"Apache-2.0"
] | permissive | ltphan/egalite-web-service | bfa3418cfecc750303a73c1234dbd237119bc3b1 | 8f47a544b5508a490ef18d45b62621857915c156 | refs/heads/develop | 2021-01-22T00:30:01.371799 | 2016-08-07T18:14:00 | 2016-08-07T18:14:00 | 63,091,292 | 0 | 0 | null | 2016-07-11T18:15:18 | 2016-07-11T18:15:17 | null | UTF-8 | Java | false | false | 339 | java | package com.bfsi.mfi.dao;
import java.util.List;
import com.bfsi.mfi.entity.CashRecSumupView;
import com.bfsi.mfi.entity.CashRecordDetail;
public interface CashRecDao extends MaintenanceDao<CashRecSumupView>{
List<CashRecSumupView> getSearch(String agtid, String tdate);
List<CashRecordDetail> cashRecordDetail(String agentId);
}
| [
"mgeiss@mifos.org"
] | mgeiss@mifos.org |
5bb1e8c0e28f89c59854b9974499fba273d405c6 | a0bd4eb9abcb4358e1614ddb10e064be504cd44c | /sourcecode/project/xmeeting/padapp/xMeeting_3/src/com/nmbb/oplayer/database/MeetingDbHelper.java | de8bd916d1119def5bf1353ab5bc09f509ae55ca | [] | no_license | ljvblfz/x00001 | 543a7ec9f0b7d4f15e994f2cf27327f9809beb04 | 91ae562082352a895e9e153540c1f6a2a8aef143 | refs/heads/master | 2023-08-19T20:03:54.286131 | 2013-10-21T14:31:14 | 2013-10-21T14:31:14 | 47,921,116 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,765 | java | package com.nmbb.oplayer.database;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import android.content.ContentValues;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.stmt.UpdateBuilder;
import com.nmbb.oplayer.exception.Logger;
@SuppressWarnings({ "unchecked", "rawtypes" })
public class MeetingDbHelper<T> {
/** 新增一条记录 */
public int create(T po) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(po.getClass());
return dao.create(po);
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return -1;
}
public boolean exists(T po, Map<String, Object> where) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(po.getClass());
if (dao.queryForFieldValues(where).size() > 0) {
return true;
}
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return false;
}
public int createIfNotExists(T po, Map<String, Object> where) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(po.getClass());
if (dao.queryForFieldValues(where).size() < 1) {
return dao.create(po);
}
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return -1;
}
/** 查询一条记录 */
public List<T> queryForEq(Class<T> c, String fieldName, Object value) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(c);
return dao.queryForEq(fieldName, value);
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return new ArrayList<T>();
}
/** 删除一条记录 */
public int remove(T po) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(po.getClass());
return dao.delete(po);
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return -1;
}
/** 查询所有记录 */
public int removeAll(Class<T> c) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(c);
List<T> list = dao.queryForAll();
for(T o: list){
remove(o);
}
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return -1;
}
/**
* 根据特定条件更新特定字段
*
* @param c
* @param values
* @param columnName where字段
* @param value where值
* @return
*/
public int update(Class<T> c, ContentValues values, String columnName, Object value) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(c);
UpdateBuilder<T, Long> updateBuilder = dao.updateBuilder();
updateBuilder.where().eq(columnName, value);
for (String key : values.keySet()) {
updateBuilder.updateColumnValue(key, values.get(key));
}
return updateBuilder.update();
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return -1;
}
/** 更新一条记录 */
public int update(T po) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(po.getClass());
return dao.update(po);
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return -1;
}
/** 查询所有记录 */
public List<T> queryForAll(Class<T> c) {
MeetingSQLiteHelperOrm db = new MeetingSQLiteHelperOrm();
try {
Dao dao = db.getDao(c);
return dao.queryForAll();
} catch (SQLException e) {
Logger.e(e);
} finally {
if (db != null)
db.close();
}
return new ArrayList<T>();
}
}
| [
"zivenlu@gmail.com"
] | zivenlu@gmail.com |
767d8e36f4091aaac8c3568502bde6a566353e7e | 5e7749decabdb6bd2618c19df7495ffd0c1cba02 | /app/src/main/java/com/github/xzwj87/todolist/schedule/data/entity/ScheduleEntity.java | 68fc3bd8917709bb071703ab204a25a80b711d65 | [] | no_license | June3Ningxu/ToDoList | 2b467915a94593f72a14a065591cdc4ea70445f5 | 3f929f55fb3ad76491a40e8e115f4f0a7594ad54 | refs/heads/master | 2021-01-18T03:04:00.070534 | 2016-03-08T11:48:59 | 2016-03-08T11:48:59 | 53,009,219 | 0 | 0 | null | 2016-03-08T11:15:52 | 2016-03-03T01:12:33 | Java | UTF-8 | Java | false | false | 3,279 | java | package com.github.xzwj87.todolist.schedule.data.entity;
import android.support.annotation.StringDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Date;
public class ScheduleEntity {
public static final String SCHEDULE_TYPE_DEFAULT = "default";
public static final String SCHEDULE_TYPE_MEETING = "meeting";
public static final String SCHEDULE_TYPE_DATE = "date";
public static final String SCHEDULE_TYPE_ENTERTAINMENT = "entertainment";
@StringDef({SCHEDULE_TYPE_DEFAULT, SCHEDULE_TYPE_MEETING, SCHEDULE_TYPE_DATE,
SCHEDULE_TYPE_ENTERTAINMENT})
@Retention(RetentionPolicy.SOURCE)
public @interface ScheduleType {}
public static final String SCHEDULE_REPEAT_NONE = "none";
public static final String SCHEDULE_REPEAT_EVERY_DAY = "every_day";
public static final String SCHEDULE_REPEAT_EVERY_WEEK = "every_week";
public static final String SCHEDULE_REPEAT_EVERY_MONTH = "every_month";
public static final String SCHEDULE_REPEAT_EVERY_YEAR = "every_year";
@StringDef({SCHEDULE_REPEAT_NONE, SCHEDULE_REPEAT_EVERY_DAY, SCHEDULE_REPEAT_EVERY_WEEK,
SCHEDULE_REPEAT_EVERY_MONTH, SCHEDULE_REPEAT_EVERY_YEAR})
@Retention(RetentionPolicy.SOURCE)
public @interface ScheduleRepeatType {}
private String mTitle;
private String mDetail;
@ScheduleType private String mType;
private Date mScheduleStart;
private Date mScheduleEnd;
@ScheduleRepeatType private String mScheduleRepeatType;
private Date mAlarmTime;
private int mRepeatAlarmTimes;
private int mRepeatAlarmInterval;
public String getTitle() {
return mTitle;
}
public void setTitle(String title) {
this.mTitle = title;
}
public String getDetail() {
return mDetail;
}
public void setDetail(String detail) {
this.mDetail = detail;
}
@ScheduleType
public String getType() {
return mType;
}
public void setType(@ScheduleType String type) {
this.mType = type;
}
public Date getScheduleStart() {
return mScheduleStart;
}
public void setScheduleStart(Date scheduleStart) {
this.mScheduleStart = scheduleStart;
}
public Date getScheduleEnd() {
return mScheduleEnd;
}
public void setScheduleEnd(Date scheduleEnd) {
this.mScheduleEnd = scheduleEnd;
}
@ScheduleRepeatType
public String getScheduleRepeatType() {
return mScheduleRepeatType;
}
public void setScheduleRepeatType(@ScheduleRepeatType String scheduleRepeatType) {
this.mScheduleRepeatType = scheduleRepeatType;
}
public Date getAlarmTime() {
return mAlarmTime;
}
public void setAlarmTime(Date alarmTime) {
this.mAlarmTime = alarmTime;
}
public int getRepeatAlarmTimes() {
return mRepeatAlarmTimes;
}
public void setRepeatAlarmTimes(int repeatAlarmTimes) {
this.mRepeatAlarmTimes = repeatAlarmTimes;
}
public int getRepeatAlarmInterval() {
return mRepeatAlarmInterval;
}
public void setRepeatAlarmInterval(int repeatAlarmInterval) {
this.mRepeatAlarmInterval = repeatAlarmInterval;
}
}
| [
"litianxing9@gmail.com"
] | litianxing9@gmail.com |
254b2b82cfb7e2ee0a0eb759fec6e352c7221522 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/stanfordnlp--CoreNLP/a0fb86fa1c62e2e9a7764733f04872230751fb38/after/XMLBeginEndIteratorTest.java | adebebe48dcf723cea2d9c359dd7bb91de4de452 | [] | 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 | 5,270 | java | package edu.stanford.nlp.objectbank;
// Copyright 2010, Stanford NLP
// Author: John Bauer
// Test that the XMLBeginEndIterator will successfully find a bunch of
// text inside xml tags.
// TODO: can add tests for the String->Object conversion and some of
// the other options the XMLBeginEndIterator has
import junit.framework.TestCase;
import java.io.BufferedReader;
import java.io.StringReader;
import java.util.ArrayList;
public class XMLBeginEndIteratorTest extends TestCase {
public static final String TEST_STRING = "<xml><tagger>\n <text>\n This tests the xml input.\n </text> \n This should not be found. \n <text>\n This should be found.\n </text>\n <text>\n The dog's barking kept the\n neighbors up all night.\n </text>\n</tagging></xml>";
public static final String EMPTY_TEST_STRING = "<text></text>";
public static final String SINGLE_TAG_TEST_STRING = "<xml><text>This tests the xml input with single tags<text/>, which should not close the input</text><text/>and should not open it either.</xml>";
public static final String NESTING_TEST_STRING = "<xml><text>A<text>B</text>C</text>D <text>A<text>B</text>C<text>D</text>E</text>F <text>A<text>B</text>C<text>D<text/></text>E</text>F</xml>";
public static final String TAG_IN_TEXT_STRING = "<xml><bar>The dog's barking kept the neighbors up all night</bar></xml>";
public static final String TWO_TAGS_STRING = "<xml><foo>This is the first sentence</foo><bar>The dog's barking kept the neighbors up all night</bar><foo>The owner could not stop the dog from barking</foo></xml>";
public static ArrayList<String> getResults(XMLBeginEndIterator<String> iterator) {
ArrayList<String> results = new ArrayList<>();
while (iterator.hasNext()) {
results.add(iterator.next());
}
return results;
}
public static void compareResults(XMLBeginEndIterator<String> iterator,
String... expectedResults) {
ArrayList<String> results = getResults(iterator);
assertEquals(expectedResults.length, results.size());
for (int i = 0; i < expectedResults.length; ++i) {
assertEquals(expectedResults[i], results.get(i));
}
}
public void testNotFound() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(TEST_STRING)), "zzzz");
compareResults(iterator); // eg, should be empty
}
public void testFound() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(TEST_STRING)), "text");
compareResults(iterator,
"\n This tests the xml input.\n ",
"\n This should be found.\n ",
"\n The dog's barking kept the\n neighbors up all night.\n ");
}
public void testEmpty() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(EMPTY_TEST_STRING)), "text");
compareResults(iterator, "");
}
public void testSingleTags() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(SINGLE_TAG_TEST_STRING)), "text");
compareResults(iterator,
"This tests the xml input with single tags, which should not close the input");
}
public void testNesting() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(NESTING_TEST_STRING)), "text",
false, false, true);
compareResults(iterator,
"ABC", "ABCDE", "ABCDE");
}
public void testInternalTags() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(NESTING_TEST_STRING)), "text",
true, false, true);
compareResults(iterator,
"A<text>B</text>C",
"A<text>B</text>C<text>D</text>E",
"A<text>B</text>C<text>D<text/></text>E");
}
public void testContainingTags() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(NESTING_TEST_STRING)), "text",
true, true, true);
compareResults(iterator,
"<text>A<text>B</text>C</text>",
"<text>A<text>B</text>C<text>D</text>E</text>",
"<text>A<text>B</text>C<text>D<text/></text>E</text>");
}
public void testTagInText() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(TAG_IN_TEXT_STRING)), "bar");
compareResults(iterator,
"The dog's barking kept the neighbors up all night");
}
public void testTwoTags() {
XMLBeginEndIterator<String> iterator = new XMLBeginEndIterator<>(new BufferedReader(new StringReader(TWO_TAGS_STRING)), "foo|bar");
compareResults(iterator,
"This is the first sentence",
"The dog's barking kept the neighbors up all night",
"The owner could not stop the dog from barking");
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
22075e3d41ccf555ed3820bcaf631933a2c6a74a | 163e37c8899cd6689828980baa6d058a064dc98e | /o1kuaixue-demo/src/com/gdpph/o1kuaixue/demo/chapter06/section2/section10/SearchString.java | 74108806ecfdf1c1ae729c89d140c619315db734 | [] | 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 | 924 | java | package com.gdpph.o1kuaixue.demo.chapter06.section2.section10;
/**
* 查找字符串-lastIndexOf方法
* @author 零壹学堂
*/
public class SearchString {
public static void main(String[] args) {
String str = "零壹学堂abc零壹学堂abc";
System.out.println("“壹”在str对象中最后一次出现的索引位置为:" + str.lastIndexOf("壹"));
// 零的索引为0,从1开始无法找到该字符串
System.out.println("从索引1开始查询,“零”在str对象中最后一次出现的索引位置为:" + str.lastIndexOf("零", 1));
int ascii = (int) 'a'; // 获取 'a' 字符的ASCII码值
System.out.println("'a'在str对象中最后一次出现的索引位置为:" + str.lastIndexOf(ascii));
System.out.println("从索引1开始查询,'a'在str对象中最后一次出现的索引位置为:" + str.lastIndexOf(ascii, 1));
}
}
| [
"2268411762@qq.com"
] | 2268411762@qq.com |
aaad9fdc59bfd69bd3f33c69dcde7d84509c9778 | f140118cd3f1b4a79159154087e7896960ca0c88 | /sql/catalyst/target/java/org/apache/spark/sql/catalyst/expressions/AttributeReference.java | ee1b90c93ecca2f0e66ca52e09c6cfc7b78e907d | [] | no_license | loisZ/miaomiaomiao | d45dc779355e2280fe6f505d959b5e5c475f9b9c | 6236255e4062d1788d7a212fa49af1849965f22c | refs/heads/master | 2021-08-24T09:22:41.648169 | 2017-12-09T00:56:41 | 2017-12-09T00:56:41 | 111,349,685 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,063 | java | package org.apache.spark.sql.catalyst.expressions;
/**
* A reference to an attribute produced by another operator in the tree.
* <p>
* @param name The name of this attribute, should only be used during analysis or for debugging.
* @param dataType The {@link DataType} of this attribute.
* @param nullable True if null is a valid value for this attribute.
* @param metadata The metadata of this attribute.
* @param exprId A globally unique id used to check if different AttributeReferences refer to the
* same attribute.
* @param qualifiers a list of strings that can be used to referred to this attribute in a fully
* qualified way. Consider the examples tableName.name, subQueryAlias.name.
* tableName and subQueryAlias are possible qualifiers.
*/
public class AttributeReference extends org.apache.spark.sql.catalyst.expressions.Attribute implements org.apache.spark.sql.catalyst.trees.LeafNode<org.apache.spark.sql.catalyst.expressions.Expression>, scala.Product, scala.Serializable {
public java.lang.String name () { throw new RuntimeException(); }
public org.apache.spark.sql.catalyst.types.DataType dataType () { throw new RuntimeException(); }
public boolean nullable () { throw new RuntimeException(); }
public org.apache.spark.sql.catalyst.util.Metadata metadata () { throw new RuntimeException(); }
public org.apache.spark.sql.catalyst.expressions.ExprId exprId () { throw new RuntimeException(); }
public scala.collection.Seq<java.lang.String> qualifiers () { throw new RuntimeException(); }
// not preceding
public AttributeReference (java.lang.String name, org.apache.spark.sql.catalyst.types.DataType dataType, boolean nullable, org.apache.spark.sql.catalyst.util.Metadata metadata, org.apache.spark.sql.catalyst.expressions.ExprId exprId, scala.collection.Seq<java.lang.String> qualifiers) { throw new RuntimeException(); }
public boolean equals (Object other) { throw new RuntimeException(); }
public int hashCode () { throw new RuntimeException(); }
public org.apache.spark.sql.catalyst.expressions.AttributeReference newInstance () { throw new RuntimeException(); }
/**
* Returns a copy of this {@link AttributeReference} with changed nullability.
*/
public org.apache.spark.sql.catalyst.expressions.AttributeReference withNullability (boolean newNullability) { throw new RuntimeException(); }
public org.apache.spark.sql.catalyst.expressions.AttributeReference withName (java.lang.String newName) { throw new RuntimeException(); }
/**
* Returns a copy of this {@link AttributeReference} with new qualifiers.
*/
public org.apache.spark.sql.catalyst.expressions.AttributeReference withQualifiers (scala.collection.Seq<java.lang.String> newQualifiers) { throw new RuntimeException(); }
public org.apache.spark.sql.catalyst.expressions.AttributeReference eval (org.apache.spark.sql.catalyst.expressions.Row input) { throw new RuntimeException(); }
public java.lang.String toString () { throw new RuntimeException(); }
}
| [
"283802073@qq.com"
] | 283802073@qq.com |
9e671cb5c91d19ca5ca177b1631611d925d2527f | c53870c6996cabd3554b3b9709a8e4234cccd514 | /src/model/SubCategoriaConta.java | 685d69ceb045b0642648013a1ae6d66bbc093363 | [] | no_license | danielbortolozo/sisdb-roupas | 6270b37d8c8b3ee1e3a5d414ea5830e571c967d0 | dba5cf9ef137a5df15fec088fdfd5ea0a529bf5a | refs/heads/master | 2022-12-06T14:00:31.818084 | 2020-09-04T15:58:04 | 2020-09-04T15:58:04 | 262,400,849 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,396 | 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 model;
import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
/**
*
* @author del
*/
@Entity
@Table(name = "sub_categoria_conta")
public class SubCategoriaConta implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@Column(name = "id")
private Integer id;
@Column(name = "descricao")
private String descricao;
@OneToMany(mappedBy = "idSubCategoriaConta")
private List<CategoriaConta> categoriaContaList;
public SubCategoriaConta() {
}
public SubCategoriaConta(Integer id) {
this.id = id;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getDescricao() {
return descricao;
}
public void setDescricao(String descricao) {
this.descricao = descricao;
}
@Override
public int hashCode() {
int hash = 0;
hash += (id != null ? id.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof SubCategoriaConta)) {
return false;
}
SubCategoriaConta other = (SubCategoriaConta) object;
if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
return false;
}
return true;
}
@Override
public String toString() {
return "model.SubCategoriaConta[ id=" + id + " ]";
}
public List<CategoriaConta> getCategoriaContaList() {
return categoriaContaList;
}
public void setCategoriaContaList(List<CategoriaConta> categoriaContaList) {
this.categoriaContaList = categoriaContaList;
}
}
| [
"danielbortolozo@hotmail.com"
] | danielbortolozo@hotmail.com |
cc032a5f9025474166c16e79b8d9920818ed34de | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.mm/classes.jar/com/tencent/mm/plugin/transvoice/a$b.java | ec14b50ec5cb9639dc427c834e3993175ba73fd9 | [] | 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 | 339 | java | package com.tencent.mm.plugin.transvoice;
public final class a$b
{
public static final int design_bottom_sheet_peek_height_min = 2131166222;
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.mm\classes10.jar
* Qualified Name: com.tencent.mm.plugin.transvoice.a.b
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
488987ffb1e38d835ad1723941ba1065e2533a8a | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a040/A040454Test.java | eb791d4d4ab8985040b286082ca2991af576b347 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a040;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A040454Test extends AbstractSequenceTest {
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
a94bfc56cf8a5d2a428040866a09bd09b3cbdae5 | e7fa6d9dd22fe6f1589d90883ce7520b168b68a0 | /src/main/java/com/eivanov/centralserver/thesis/domain/services/CheckType.java | d7ebd8cdf2d38dc4cf27ec092f05805435800f3d | [
"Apache-2.0"
] | permissive | e-ivanov/central_server | b530534aa29cf62786edeb5c8a738506a56926a2 | 70802d04224953a919bafd48362d7b5742fb5588 | refs/heads/master | 2021-01-20T10:19:14.376903 | 2017-09-05T12:13:51 | 2017-09-05T12:13:51 | 101,627,470 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 353 | 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.eivanov.centralserver.thesis.domain.services;
/**
*
* @author killer
*/
public enum CheckType {
CPU,
MEMORY,
DISK_USAGE,
AVAILABILITY
}
| [
"test@example.com"
] | test@example.com |
af8c9b3e21ac06b24e8fee994cd75a5b159bc027 | 491e9e4be3fdbd09b625d41749b8c8bc3ad19605 | /libx4j/jjb/rs/src/main/java/org/libx4j/jjb/rs/JSObjectBodyWriter.java | 91b7ffb19edc8efb3e1e811ebbac15df4f157dae | [
"MIT"
] | permissive | AlekseyYuryev/java | b05726ee05469058b605bc90720bcca9ae5baeae | d9d3ee4993564a922455c02f084664839bab734d | refs/heads/master | 2021-07-11T16:03:12.807505 | 2017-10-13T18:28:41 | 2017-10-13T18:28:41 | 106,962,892 | 0 | 0 | null | 2017-10-14T21:05:59 | 2017-10-14T21:05:59 | null | UTF-8 | Java | false | false | 1,988 | java | /* Copyright (c) 2016 lib4j
*
* 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.
*
* You should have received a copy of The MIT License (MIT) along with this
* program. If not, see <http://opensource.org/licenses/MIT/>.
*/
package org.libx4j.jjb.rs;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.MessageBodyWriter;
import javax.ws.rs.ext.Provider;
import org.libx4j.jjb.runtime.JSObject;
@Provider
@Produces(MediaType.APPLICATION_JSON)
public class JSObjectBodyWriter implements MessageBodyWriter<JSObject> {
@Override
public long getSize(final JSObject t, final Class<?> rawType, final Type genericType, final Annotation[] annotations, final MediaType mediaType) {
return t.toString().length();
}
@Override
public boolean isWriteable(final Class<?> rawType, final Type genericType, final Annotation[] annotations, final MediaType mediaType) {
return JSObject.class.isAssignableFrom(rawType);
}
@Override
public void writeTo(final JSObject t, final Class<?> rawType, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String,Object> httpHeaders, final OutputStream entityStream) throws IOException {
entityStream.write(t.toString().getBytes());
}
} | [
"seva@safris.org"
] | seva@safris.org |
3dca2e33aa79238785ff73713db7b26a70f51b11 | 29e84ae817db0d31a7bd8cd42d14b2c497b0a527 | /src/main/java/com/ftysoft/project/monitor/job/service/JobServiceImpl.java | bbce5fb19b77ef6c15431e51fecf0ce8c6221dad | [] | no_license | ftybeyond/admin | e6fb4729b71482b58c698e02e5b937a9465905af | c6442013d1feccfe060840afff7715b3073898a4 | refs/heads/master | 2022-09-15T05:06:13.078344 | 2019-12-10T01:29:05 | 2019-12-10T01:29:05 | 227,002,329 | 0 | 0 | null | 2022-09-01T23:17:21 | 2019-12-10T01:28:25 | JavaScript | UTF-8 | Java | false | false | 6,760 | java | package com.ftysoft.project.monitor.job.service;
import java.util.List;
import javax.annotation.PostConstruct;
import org.quartz.JobDataMap;
import org.quartz.JobKey;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ftysoft.common.constant.ScheduleConstants;
import com.ftysoft.common.exception.job.TaskException;
import com.ftysoft.common.utils.text.Convert;
import com.ftysoft.project.monitor.job.domain.Job;
import com.ftysoft.project.monitor.job.mapper.JobMapper;
import com.ftysoft.project.monitor.job.util.CronUtils;
import com.ftysoft.project.monitor.job.util.ScheduleUtils;
/**
* 定时任务调度信息 服务层
*
* @author FTY
*/
@Service
public class JobServiceImpl implements IJobService
{
@Autowired
private Scheduler scheduler;
@Autowired
private JobMapper jobMapper;
/**
* 项目启动时,初始化定时器
* 主要是防止手动修改数据库导致未同步到定时任务处理(注:不能手动修改数据库ID和任务组名,否则会导致脏数据)
*/
@PostConstruct
public void init() throws SchedulerException, TaskException
{
List<Job> jobList = jobMapper.selectJobAll();
for (Job job : jobList)
{
updateSchedulerJob(job, job.getJobGroup());
}
}
/**
* 获取quartz调度器的计划任务列表
*
* @param job 调度信息
* @return
*/
@Override
public List<Job> selectJobList(Job job)
{
return jobMapper.selectJobList(job);
}
/**
* 通过调度任务ID查询调度信息
*
* @param jobId 调度任务ID
* @return 调度任务对象信息
*/
@Override
public Job selectJobById(Long jobId)
{
return jobMapper.selectJobById(jobId);
}
/**
* 暂停任务
*
* @param job 调度信息
*/
@Override
@Transactional
public int pauseJob(Job job) throws SchedulerException
{
Long jobId = job.getJobId();
String jobGroup = job.getJobGroup();
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
int rows = jobMapper.updateJob(job);
if (rows > 0)
{
scheduler.pauseJob(ScheduleUtils.getJobKey(jobId, jobGroup));
}
return rows;
}
/**
* 恢复任务
*
* @param job 调度信息
*/
@Override
@Transactional
public int resumeJob(Job job) throws SchedulerException
{
Long jobId = job.getJobId();
String jobGroup = job.getJobGroup();
job.setStatus(ScheduleConstants.Status.NORMAL.getValue());
int rows = jobMapper.updateJob(job);
if (rows > 0)
{
scheduler.resumeJob(ScheduleUtils.getJobKey(jobId, jobGroup));
}
return rows;
}
/**
* 删除任务后,所对应的trigger也将被删除
*
* @param job 调度信息
*/
@Override
@Transactional
public int deleteJob(Job job) throws SchedulerException
{
Long jobId = job.getJobId();
String jobGroup = job.getJobGroup();
int rows = jobMapper.deleteJobById(jobId);
if (rows > 0)
{
scheduler.deleteJob(ScheduleUtils.getJobKey(jobId, jobGroup));
}
return rows;
}
/**
* 批量删除调度信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
@Transactional
public void deleteJobByIds(String ids) throws SchedulerException
{
Long[] jobIds = Convert.toLongArray(ids);
for (Long jobId : jobIds)
{
Job job = jobMapper.selectJobById(jobId);
deleteJob(job);
}
}
/**
* 任务调度状态修改
*
* @param job 调度信息
*/
@Override
@Transactional
public int changeStatus(Job job) throws SchedulerException
{
int rows = 0;
String status = job.getStatus();
if (ScheduleConstants.Status.NORMAL.getValue().equals(status))
{
rows = resumeJob(job);
}
else if (ScheduleConstants.Status.PAUSE.getValue().equals(status))
{
rows = pauseJob(job);
}
return rows;
}
/**
* 立即运行任务
*
* @param job 调度信息
*/
@Override
@Transactional
public void run(Job job) throws SchedulerException
{
Long jobId = job.getJobId();
String jobGroup = job.getJobGroup();
Job properties = selectJobById(job.getJobId());
// 参数
JobDataMap dataMap = new JobDataMap();
dataMap.put(ScheduleConstants.TASK_PROPERTIES, properties);
scheduler.triggerJob(ScheduleUtils.getJobKey(jobId, jobGroup), dataMap);
}
/**
* 新增任务
*
* @param job 调度信息 调度信息
*/
@Override
@Transactional
public int insertJob(Job job) throws SchedulerException, TaskException
{
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
int rows = jobMapper.insertJob(job);
if (rows > 0)
{
ScheduleUtils.createScheduleJob(scheduler, job);
}
return rows;
}
/**
* 更新任务的时间表达式
*
* @param job 调度信息
*/
@Override
@Transactional
public int updateJob(Job job) throws SchedulerException, TaskException
{
Job properties = selectJobById(job.getJobId());
int rows = jobMapper.updateJob(job);
if (rows > 0)
{
updateSchedulerJob(job, properties.getJobGroup());
}
return rows;
}
/**
* 更新任务
*
* @param job 调度信息
* @param jobGroup 任务组名
*/
public void updateSchedulerJob(Job job, String jobGroup) throws SchedulerException, TaskException
{
Long jobId = job.getJobId();
// 判断是否存在
JobKey jobKey = ScheduleUtils.getJobKey(jobId, jobGroup);
if (scheduler.checkExists(jobKey))
{
// 防止创建时存在数据问题 先移除,然后在执行创建操作
scheduler.deleteJob(jobKey);
}
ScheduleUtils.createScheduleJob(scheduler, job);
}
/**
* 校验cron表达式是否有效
*
* @param cronExpression 表达式
* @return 结果
*/
@Override
public boolean checkCronExpressionIsValid(String cronExpression)
{
return CronUtils.isValid(cronExpression);
}
} | [
"123"
] | 123 |
d64e746fbb1b9273b3e280f091bbfc674cc8bf75 | 66e2f35b7b56865552616cf400e3a8f5928d12a2 | /src/main/java/com/alipay/api/domain/KoubeiServindustryReservationResourceSyncModel.java | 7a081ae86df464ceb7e96d50c018d39035ee4f19 | [
"Apache-2.0"
] | permissive | xiafaqi/alipay-sdk-java-all | 18dc797400847c7ae9901566e910527f5495e497 | 606cdb8014faa3e9125de7f50cbb81b2db6ee6cc | refs/heads/master | 2022-11-25T08:43:11.997961 | 2020-07-23T02:58:22 | 2020-07-23T02:58:22 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,391 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 口碑预订资源变更消息
*
* @author auto create
* @since 1.0, 2019-09-19 10:44:29
*/
public class KoubeiServindustryReservationResourceSyncModel extends AlipayObject {
private static final long serialVersionUID = 4757591488873911396L;
/**
* 口碑为第三方ISV分配的渠道标识,如K米的渠道为KMI
*/
@ApiField("channel")
private String channel;
/**
* 行业,如KTV,MASSAGE(足疗)等
*/
@ApiField("industry")
private String industry;
/**
* 商户在ISV创建的门店id
*/
@ApiField("out_shop_id")
private String outShopId;
/**
* 商户在口碑创建的门店id
*/
@ApiField("shop_id")
private String shopId;
public String getChannel() {
return this.channel;
}
public void setChannel(String channel) {
this.channel = channel;
}
public String getIndustry() {
return this.industry;
}
public void setIndustry(String industry) {
this.industry = industry;
}
public String getOutShopId() {
return this.outShopId;
}
public void setOutShopId(String outShopId) {
this.outShopId = outShopId;
}
public String getShopId() {
return this.shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
22fabee958b19eb3c5b17016345896d1254b7bbc | fa00d99efa3931be8a711eeb3a7a46404dd888a8 | /QC_Accouting/src/main/java/tests/JQC_Deceased.java | 2d16c27ee1a334c5e6d02a72a2ee1dc9776ed684 | [] | no_license | indhumanchukonda/Qc_Batch | fe71ecd40ae4604721346588ec82be51b9ae9356 | 82c8c12eb29a80d068372a1e253275c478d674e9 | refs/heads/master | 2022-12-15T07:18:26.327416 | 2020-09-15T12:23:28 | 2020-09-15T12:23:28 | 295,648,801 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,456 | java | package tests;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.Alert;
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.NoAlertPresentException;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import com.relevantcodes.extentreports.LogStatus;
public class JQC_Deceased extends QCStore {
public static void Deceased(String SSN, String AppURL) throws InterruptedException {
int lastrow = TestData.getLastRow("Deceased");
String sheetName = "Deceased";
for (int row = 2; row <= lastrow; row++) {
String RegSSN = TestData.getCellData(sheetName, "SSN", row);
if (SSN.equals(RegSSN)) {
String UserName = TestData.getCellData(sheetName, "UserName", row);
String Password = TestData.getCellData(sheetName, "Password", row);
String PIN = TestData.getCellData(sheetName, "PIN", row);
encryption_store_no = TestData.getCellData(sheetName, "encryption_store_no", row);
String ProductID = TestData.getCellData(sheetName, "ProductID", row);
String ProductType = TestData.getCellData(sheetName, "ProductType", row);
String NextDueDate;
String business_date;
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
String SSN1 = SSN.substring(0, 3);
String SSN2 = SSN.substring(3, 5);
String SSN3 = SSN.substring(5, 9);
Thread.sleep(6000);
test.log(LogStatus.INFO, "CSR Login For Getting Loan Nbr");
driver.switchTo().defaultContent();
wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("topFrame")));
driver.switchTo().frame("topFrame");
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("li[id='910000']")));
Thread.sleep(4000);
driver.findElement(By.cssSelector("li[id='910000']")).click();
Thread.sleep(6000);
test.log(LogStatus.PASS, "Clicked on Loan Transactions");
Thread.sleep(4000);
driver.switchTo().defaultContent();
driver.switchTo().frame("mainFrame");
driver.findElement(By.cssSelector("li[id='911101']")).click();
test.log(LogStatus.PASS, "Clicked on Transactions");
driver.switchTo().frame("main");
driver.findElement(By.name("ssn1")).sendKeys(SSN1);
test.log(LogStatus.PASS, "SSN1 is entered: " + SSN1);
driver.findElement(By.name("ssn2")).sendKeys(SSN2);
test.log(LogStatus.PASS, "SSN2 is entered: " + SSN2);
driver.findElement(By.name("ssn3")).sendKeys(SSN3);
test.log(LogStatus.PASS, "SSN3 is entered: " + SSN3);
driver.findElement(By.name("submit1")).click();
test.log(LogStatus.PASS, "Click on submit Button");
/*driver.findElement(By.xpath("/html/body/table/tbody/tr[1]/td[1]/table[2]/tbody/tr[2]/td/table/tbody/tr[2]/td[8]/input")).click();
test.log(LogStatus.PASS, "Clicked on Go button under search results");
*/
Thread.sleep(3000);
for (String winHandle : driver.getWindowHandles()) {
driver.switchTo().window(winHandle);
}
driver.switchTo().defaultContent();
driver.switchTo().frame("mainFrame");
driver.switchTo().frame("main");
String mainwindow=driver.getWindowHandle();
//Thread.sleep(3000);
driver.findElement(By.xpath("/html/body/table/tbody/tr[1]/td[1]/table[2]/tbody/tr[2]/td/table/tbody/tr[2]/td[2]/a")).click();
test.log(LogStatus.PASS, "Clicked on Customer number link");
Thread.sleep(6000);
for(String winHandle : driver.getWindowHandles()){
if(!mainwindow.equalsIgnoreCase(winHandle))
{
driver.switchTo().window(winHandle);
System.out.println("......");
//loan_number= driver.findElement(locator(Jprop.getProperty("csr_loan_nbr"))).getText();
loan_number=driver.findElement(By.xpath("//*[@id='all']/div[1]/table[1]/tbody/tr[3]/td[2]")).getText();
test.log(LogStatus.PASS, "Loan Number is" + loan_number);
//NextDueDate= driver.findElement(locator(Jprop.getProperty("csr_due_date"))).getText();
NextDueDate=driver.findElement(By.xpath("//*[@id='all']/div[1]/table[1]/tbody/tr[3]/td[5]")).getText();
test.log(LogStatus.PASS, "Next due date is "+NextDueDate);
test.log(LogStatus.PASS, "********************************************");
driver.close();
break;
}
}
driver.switchTo().window(mainwindow);
//driver.switchTo().window(mainwindow);
Thread.sleep(4000);
driver.switchTo().frame("bottom");
business_date=driver.findElement(By.xpath("/html/body/blink/table/tbody/tr/td[4]")).getText();
test.log(LogStatus.PASS, "Businessdate is :"+business_date);
String App_date1[] = business_date.split(":");
String App_date[] = App_date1[1].split("/");
System.out.println("business_date");
Date1 = App_date[0];
System.out.println("Date 1" + Date1);
Date2 = App_date[1];
Date3 = App_date[2];
Thread.sleep(4000);
driver.close();
}
}
}
}
| [
"indhu.manchukonda@qfund.net"
] | indhu.manchukonda@qfund.net |
c707dc1ae14f634a18532d6aa3801ff63ae806e4 | 54f352a242a8ad6ff5516703e91da61e08d9a9e6 | /Source Codes/CodeJamData/10/33/1.java | cbb8b0437953489c4ada633c88d323d490a30ae4 | [] | no_license | Kawser-nerd/CLCDSA | 5cbd8a4c3f65173e4e8e0d7ed845574c4770c3eb | aee32551795763b54acb26856ab239370cac4e75 | refs/heads/master | 2022-02-09T11:08:56.588303 | 2022-01-26T18:53:40 | 2022-01-26T18:53:40 | 211,783,197 | 23 | 9 | null | null | null | null | UTF-8 | Java | false | false | 3,094 | java | import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
public class C {
static boolean[][] grid, used;
static int m,n;
public static void main(String[] args) throws IOException {
PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter("C.txt")));
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int z = Integer.parseInt(br.readLine());
for(int q = 1; q <= z; q++) {
StringTokenizer st = new StringTokenizer(br.readLine());
m = Integer.parseInt(st.nextToken());
n = Integer.parseInt(st.nextToken());
grid = new boolean[m][n];
used = new boolean[m][n];
for(int i = 0; i < m; i++) {
String s = br.readLine();
for(int j = 0; j < (n>>2); j++) {
int k = Integer.parseInt(Character.toString(s.charAt(j)), 16);
grid[i][4*j] = (k&8) == 0;
grid[i][4*j+1] = (k&4) == 0;
grid[i][4*j+2] = (k&2) == 0;
grid[i][4*j+3] = (k&1) == 0;
}
}
ArrayList<Pair> list = new ArrayList<Pair>();
while(true) {
int best = 0;
int num = 0;
for(int i = 0; i < m; i++) {
for(int j = 0; j < n; j++) {
for(int s = best+1; true; s++) {
if(fail(i,j,s)) {
break;
}
System.out.println("Side length " + s + " passes at " + i + " " + j);
best = s;
}
}
}
if(best == 0) {
break;
}
for(int i = 0; i < m; i++) {
for(int j = 0; j < n; j++) {
if(!fail(i,j,best)) {
for(int xAdd = 0; xAdd < best; xAdd++) {
for(int yAdd = 0; yAdd < best; yAdd++) {
used[i+xAdd][j+yAdd] = true;
}
}
num++;
}
}
}
System.out.println("Squares of side " + best + " of number " + num + " computed");
list.add(new Pair(best, num));
}
pw.println("Case #" + q + ": " + list.size());
for(Pair p: list) {
pw.println(p.s + " " + p.n);
}
System.out.println("Case #" + q + " DONE!");
}
pw.close();
}
public static boolean fail(int x, int y, int s) {
if(x+s > m || y+s > n)
return true;
boolean expected = grid[x][y];
for(int xAdd = 0; xAdd < s; xAdd+=2) {
for(int yAdd = 0; yAdd < s; yAdd+=2) {
if(expected != grid[x+xAdd][y+yAdd])
return true;
if(used[x+xAdd][y+yAdd])
return true;
}
}
for(int xAdd = 1; xAdd < s; xAdd+=2) {
for(int yAdd = 1; yAdd < s; yAdd+=2) {
if(expected != grid[x+xAdd][y+yAdd])
return true;
if(used[x+xAdd][y+yAdd])
return true;
}
}
for(int xAdd = 0; xAdd < s; xAdd+=2) {
for(int yAdd = 1; yAdd < s; yAdd+=2) {
if(expected == grid[x+xAdd][y+yAdd])
return true;
if(used[x+xAdd][y+yAdd])
return true;
}
}
for(int xAdd = 1; xAdd < s; xAdd+=2) {
for(int yAdd = 0; yAdd < s; yAdd+=2) {
if(expected == grid[x+xAdd][y+yAdd])
return true;
if(used[x+xAdd][y+yAdd])
return true;
}
}
return false;
}
static class Pair {
public int s,n;
public Pair(int a, int b) {
s=a;
n=b;
}
}
}
| [
"kwnafi@yahoo.com"
] | kwnafi@yahoo.com |
0cadb5d8a08fce867270987d79a27cf1d6f4ac71 | d4e7dede0393640701e7b978aac7a7d2a72604c7 | /base/src/main/java/com/learn/base/algorithm/course/advanced6/Code_06_JosephusProblem.java | 664829071f0a43e0f3db7df0e40efccb7366c41e | [] | no_license | hnustlizeming/lizeming02 | 6b28ef675164499ce9da48ef5a5ce34dfc5896db | 0f65c22bf080e30e2b7c929926d50044fc212846 | refs/heads/master | 2022-12-23T02:16:22.982295 | 2019-07-27T17:53:00 | 2019-07-27T17:53:00 | 199,232,181 | 1 | 0 | null | 2022-12-16T11:17:40 | 2019-07-28T02:10:09 | Java | UTF-8 | Java | false | false | 2,580 | java | package algorithm.course.advanced6;
public class Code_06_JosephusProblem {
public static class Node {
public int value;
public Node next;
public Node(int data) {
this.value = data;
}
}
public static Node josephusKill1(Node head, int m) {
if (head == null || head.next == head || m < 1) {
return head;
}
Node last = head;
while (last.next != head) {
last = last.next;
}
int count = 0;
while (head != last) {
if (++count == m) {
last.next = head.next;
count = 0;
} else {
last = last.next;
}
head = last.next;
}
return head;
}
public static Node josephusKill2(Node head, int m) {
if (head == null || head.next == head || m < 1) {
return head;
}
Node cur = head.next;
int tmp = 1; // tmp -> list size
while (cur != head) {
tmp++;
cur = cur.next;
}
tmp = getLive(tmp, m); // tmp -> service node position
while (--tmp != 0) {
head = head.next;
}
head.next = head;
return head;
}
public static int getLive(int i, int m) {
if (i == 1) {
return 1;
}
return (getLive(i - 1, m) + m - 1) % i + 1;
}
public static void printCircularList(Node head) {
if (head == null) {
return;
}
System.out.print("Circular List: " + head.value + " ");
Node cur = head.next;
while (cur != head) {
System.out.print(cur.value + " ");
cur = cur.next;
}
System.out.println("-> " + head.value);
}
public static void main(String[] args) {
Node head1 = new Node(1);
head1.next = new Node(2);
head1.next.next = new Node(3);
head1.next.next.next = new Node(4);
head1.next.next.next.next = new Node(5);
head1.next.next.next.next.next = head1;
printCircularList(head1);
head1 = josephusKill1(head1, 3);
printCircularList(head1);
Node head2 = new Node(1);
head2.next = new Node(2);
head2.next.next = new Node(3);
head2.next.next.next = new Node(4);
head2.next.next.next.next = new Node(5);
head2.next.next.next.next.next = head2;
printCircularList(head2);
head2 = josephusKill2(head2, 3);
printCircularList(head2);
}
} | [
"2039176261@qq.com"
] | 2039176261@qq.com |
962b509f025147a0c65f6dfd1043b4967d5e3053 | 94dafb3bf3b6919bf4fcb3d460173077bfa29676 | /core/src/main/java/com/wdcloud/lms/core/base/vo/resource/ResourceVersionVO.java | 6fdd133270bec740fcf24ab60e243368a651f8f4 | [] | no_license | Miaosen1202/1126Java | b0fbe58e51b821b1ec8a8ffcfb24b21d578f1b5f | 7c896cffa3c51a25658b76fbef76b83a8963b050 | refs/heads/master | 2022-06-24T12:33:14.369136 | 2019-11-26T05:49:55 | 2019-11-26T05:49:55 | 224,112,546 | 0 | 0 | null | 2021-02-03T19:37:54 | 2019-11-26T05:48:48 | Java | UTF-8 | Java | false | false | 411 | java | package com.wdcloud.lms.core.base.vo.resource;
import lombok.*;
import java.util.Date;
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@Data
public class ResourceVersionVO {
private Long id;
/**
* 资源分享类型
*/
private Integer shareType;
/**
* 版本
*/
private Date version;
/**
* 描述
*/
private String description;
}
| [
"miaosen1202@163.com"
] | miaosen1202@163.com |
e441b9a78214814e39ac59a3f873a14cef8d79ee | ee72095648a280d61f589f0426820669144491c4 | /app/src/main/java/com/shuiwangzhijia/wuliu/fragmentwarehouse/DeliverOrderFragment.java | 392c997291ce89646230489f9571a3270f923ef3 | [] | no_license | 353557447/HelperLogistics | 2276cec1092c50a66491aac563a291ed54a67f2b | 1a555e150497b5da40e9f33fa2ec76981b9f5a83 | refs/heads/master | 2020-06-04T13:04:44.038093 | 2019-06-18T12:02:59 | 2019-06-18T12:02:59 | 192,033,085 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,175 | java | package com.shuiwangzhijia.wuliu.fragmentwarehouse;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.shuiwangzhijia.wuliu.R;
import com.shuiwangzhijia.wuliu.adapter.BaseFmAdapter;
import com.shuiwangzhijia.wuliu.base.BaseFragment;
import com.shuiwangzhijia.wuliu.event.MainEvent;
import com.shuiwangzhijia.wuliu.eventwarehouse.OrderListFlashEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import de.greenrobot.event.EventBus;
import de.greenrobot.event.Subscribe;
import de.greenrobot.event.ThreadMode;
/**
* 新订单页面
* created by wangsuli on 2018/8/17.
*/
public class DeliverOrderFragment extends BaseFragment {
private static final String TAG = "DeliverOrderFragment";
@BindView(R.id.tabLayout)
TabLayout tabLayout;
@BindView(R.id.viewpager)
ViewPager viewPager;
private Unbinder unbinder;
private List<String> titles = new ArrayList<>();
private ArrayList<Object> pageList = new ArrayList<>();
private BaseFmAdapter adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Log.d(TAG,"onCreateView");
if (mRootView == null) {
mRootView = inflater.inflate(R.layout.fragment_warehouse_new_order, container, false);
unbinder = ButterKnife.bind(this, mRootView);
initView();
} else {
// 缓存的rootView需要判断是否已经被加过parent,如果有parent需要从parent删除,要不然会发生这个rootview已经有parent的错误。
ViewGroup parent = (ViewGroup) mRootView.getParent();
if (parent != null) {
parent.removeView(mRootView);
}
unbinder = ButterKnife.bind(this, mRootView);
}
return mRootView;
}
private void initView() {
titles = Arrays.asList(new String[]{"待提货", "待回桶", "已完成"});
pageList.add(setFragment(0));
pageList.add(setFragment(1));
pageList.add(setFragment(2));
adapter = new BaseFmAdapter(getChildFragmentManager(), pageList, titles);
viewPager.setAdapter(adapter);
tabLayout.setupWithViewPager(viewPager);
}
private Fragment setFragment(int type) {
Bundle bundle = new Bundle();
bundle.putInt("type", type);
OrderFragment orderBaseFragment = new OrderFragment();
orderBaseFragment.setArguments(bundle);
return orderBaseFragment;
}
@Override
public void onDestroyView() {
super.onDestroyView();
}
@Subscribe(threadMode = ThreadMode.MainThread)
public void onMessageEventMainThread(MainEvent event) {
viewPager.setCurrentItem(event.index-1);
EventBus.getDefault().post(new OrderListFlashEvent(false, event.index));
}
}
| [
"353557447@qq.com"
] | 353557447@qq.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.