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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d40a8ea2583e670fc8a937cbe3be63e3d2ba6656
|
86ccbc67fa6fd41ca1ac5c8d258aa62879ae014e
|
/wms-base-core/src/main/java/com/tudou/system/platform/base/annotation/BaseResource.java
|
60e78a71494c7162aed4c4b710cec9fc174e7ad4
|
[] |
no_license
|
979982272/wms-dubbo
|
be20cdaf597c77dd9a32b4d7b90b041813cac529
|
76332adabfd25fb09c4002ada1b09539483d5c7c
|
refs/heads/master
| 2022-12-23T21:53:09.258735
| 2020-01-10T04:06:06
| 2020-01-10T04:06:06
| 232,962,338
| 0
| 0
| null | 2022-12-16T11:37:38
| 2020-01-10T04:01:29
|
HTML
|
UTF-8
|
Java
| false
| false
| 271
|
java
|
package com.tudou.system.platform.base.annotation;
import java.lang.annotation.*;
/**
* Created by Administrator on 2017/2/12 0012.
*/
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface BaseResource {
}
|
[
"kt_wangweihua@tcl.com"
] |
kt_wangweihua@tcl.com
|
8a8c6362da0f6b63dfe3b9a5e0df90786692d10e
|
9eec8574e953598429d4562055b1957b2d5583c5
|
/jfluentvalidation-core/src/main/java/jfluentvalidation/constraints/array/contains/ContainsLongConstraint.java
|
f6ac30649525d6e115c40d2393b757e39cd00a30
|
[
"MIT"
] |
permissive
|
seancarroll/jfluentvalidation
|
f9e04753931af90da775e6a4ecc0e3312f91cc1c
|
67f581aa50b1efa52a461345982856503b04e987
|
refs/heads/master
| 2023-06-22T00:27:58.078302
| 2020-08-27T02:43:10
| 2020-08-27T02:43:10
| 146,148,457
| 2
| 1
|
MIT
| 2023-06-20T16:05:52
| 2018-08-26T03:32:04
|
Java
|
UTF-8
|
Java
| false
| false
| 934
|
java
|
package jfluentvalidation.constraints.array.contains;
import jfluentvalidation.common.MoreArrays;
import jfluentvalidation.constraints.AbstractConstraint;
import jfluentvalidation.constraints.DefaultMessages;
import jfluentvalidation.validators.ConstraintContext;
public class ContainsLongConstraint<T> extends AbstractConstraint<T, long[]> {
private final long element;
public ContainsLongConstraint(long element) {
super(DefaultMessages.ARRAY_CONTAINS);
this.element = element;
}
@Override
public boolean isValid(ConstraintContext<T, long[]> context) {
if (context.getPropertyValue() == null) {
return true;
}
return MoreArrays.contains(context.getPropertyValue(), element);
}
@Override
public void addParametersToContext(ConstraintContext<T, long[]> context) {
context.getMessageContext().appendArgument("element", element);
}
}
|
[
"seanc28@gmail.com"
] |
seanc28@gmail.com
|
7097d98b2ea39153a6a791655a7333e6ad34cba6
|
473b76b1043df2f09214f8c335d4359d3a8151e0
|
/benchmark/bigclonebenchdata_partial/13726761.java
|
0dbfc9a67660dea3e95cbe2ece6ab19e4ff88b2c
|
[] |
no_license
|
whatafree/JCoffee
|
08dc47f79f8369af32e755de01c52d9a8479d44c
|
fa7194635a5bd48259d325e5b0a190780a53c55f
|
refs/heads/master
| 2022-11-16T01:58:04.254688
| 2020-07-13T20:11:17
| 2020-07-13T20:11:17
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 480
|
java
|
class c13726761 {
protected void handleUrl(URL url) throws Exception {
File file = new File(dir.getAbsolutePath() + "/" + new Date().getTime() + "." + this.ext);
FileWriter writer = new FileWriter(file);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
String s;
while ((s = in.readLine()) != null) {
writer.write(s + "\n");
}
in.close();
writer.close();
}
}
|
[
"piyush16066@iiitd.ac.in"
] |
piyush16066@iiitd.ac.in
|
a35a4dbc9141eca2815b53f506d41a9e636aa321
|
15d55ff9cddff64dd1460b0134d98803adac2f44
|
/gulimall-product/src/main/java/cn/lxtkj/gulimall/product/dao/SpuInfoDescDao.java
|
5df380f529ca371e6caf63d756f3272105d70bc5
|
[
"Apache-2.0"
] |
permissive
|
leiphp/gulimall
|
b70bb4ac62b09bca61b5d321240ad4018401ab4c
|
6c53e6db69444cac73899f97e1d5c47b8d5fb43a
|
refs/heads/master
| 2023-08-22T22:14:29.676944
| 2021-10-18T09:42:47
| 2021-10-18T09:42:47
| 394,718,467
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 396
|
java
|
package cn.lxtkj.gulimall.product.dao;
import cn.lxtkj.gulimall.product.entity.SpuInfoDescEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* spu信息介绍
*
* @author leixiaotian
* @email 1124378213@qq.com
* @date 2021-08-12 00:20:21
*/
@Mapper
public interface SpuInfoDescDao extends BaseMapper<SpuInfoDescEntity> {
}
|
[
"657106593@qq.com"
] |
657106593@qq.com
|
9c69924429c712512e8223b615350c693b9476c7
|
d6cf28d1b37216c657d23d8e512c15bdd9d3f226
|
/dependencies/w6s-ui-component/src/main/java/com/foreverht/workplus/ui/component/recyclerview/adapter/AdapterPath.java
|
3eb2d4adf153325d34861f40bbb8e96b97c1683d
|
[
"MIT"
] |
permissive
|
AoEiuV020/w6s_lite_android
|
a2ec1ca8acdc848592266b548b9ac6b9a4117cd3
|
1c4ca5bdaea6d5230d851fb008cf2578a23b2ce5
|
refs/heads/master
| 2023-08-22T00:46:03.054115
| 2021-10-27T06:21:32
| 2021-10-27T07:45:41
| 421,650,297
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,038
|
java
|
/*
* Copyright (C) 2016 Haruki Hasegawa
*
* 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.foreverht.workplus.ui.component.recyclerview.adapter;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.RecyclerView;
import java.util.ArrayList;
import java.util.List;
/**
* Adapter path. This class represents how nested {@link WrapperAdapter}s route items.
*/
public class AdapterPath {
@NonNull
private final List<AdapterPathSegment> mSegments = new ArrayList<>();
/**
* Constructor.
*/
public AdapterPath() {
}
/**
* Appends path segment.
*
* @param wrapResult The result object returned by {@link WrapperAdapter#wrapPosition(AdapterPathSegment, int)}.
*/
@NonNull
public AdapterPath append(@NonNull UnwrapPositionResult wrapResult) {
return append(wrapResult.adapter, wrapResult.tag);
}
/**
* Appends path segment.
*
* @param adapter The adapter
* @param tag The tag object
*/
@NonNull
public AdapterPath append(@NonNull RecyclerView.Adapter adapter, @Nullable Object tag) {
return append(new AdapterPathSegment(adapter, tag));
}
/**
* Appends path segment.
*
* @param segment The path segment
*/
@NonNull
public AdapterPath append(@NonNull AdapterPathSegment segment) {
mSegments.add(segment);
return this;
}
/**
* Clears path segments.
*
*/
@NonNull
public AdapterPath clear() {
mSegments.clear();
return this;
}
/**
* Gets whether the path is empty.
*
* @return True if the path is empty. Otherwise, false.
*/
public boolean isEmpty() {
return mSegments.isEmpty();
}
/**
* Gets path segments.
*
* @return The collection of path segments.
*/
@NonNull
public List<AdapterPathSegment> segments() {
return mSegments;
}
/**
* Retrieves the first path segment.
*
* @return The first path segment.
*/
@Nullable
public AdapterPathSegment firstSegment() {
return (!mSegments.isEmpty()) ? (mSegments.get(0)) : null;
}
/**
* Retrieves the last path segment.
*
* @return THe last path segment.
*/
@Nullable
public AdapterPathSegment lastSegment() {
return (!mSegments.isEmpty()) ? (mSegments.get(mSegments.size() - 1)) : null;
}
}
|
[
"lingen.liu@gmail.com"
] |
lingen.liu@gmail.com
|
536c2113773a71cbefecf1ca4d91130e3a2abca2
|
c908d6a58a7e79f684f9d430fa39ba34f8a320c8
|
/eclipse/portal/plugins/com.liferay.ide.eclipse.layouttpl.ui/src/com/liferay/ide/eclipse/layouttpl/ui/cmd/PortletColumnDeleteCommand.java
|
3d7035ea641c38138ca36d97086e367e06e45cf6
|
[] |
no_license
|
admhouss/liferay-ide
|
b2f08294c6ac5d8dc909b97236f3006cd1f734e5
|
3b8b0bf1b98cd79b8dc794c4bd4fe4dc086fde34
|
refs/heads/master
| 2021-01-18T08:36:01.718248
| 2012-10-12T06:21:24
| 2012-10-12T06:21:24
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,913
|
java
|
/*******************************************************************************
* Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
*******************************************************************************/
package com.liferay.ide.eclipse.layouttpl.ui.cmd;
import com.liferay.ide.eclipse.layouttpl.ui.model.LayoutTplDiagram;
import com.liferay.ide.eclipse.layouttpl.ui.model.PortletColumn;
import com.liferay.ide.eclipse.layouttpl.ui.model.PortletLayout;
import org.eclipse.gef.commands.Command;
public class PortletColumnDeleteCommand extends Command {
protected final PortletColumn child;
protected final PortletLayout parent;
protected LayoutTplDiagram diagram = null;
protected boolean wasRemoved;
public PortletColumnDeleteCommand(PortletLayout parent, PortletColumn child) {
if (parent == null || child == null) {
throw new IllegalArgumentException();
}
setLabel("Portlet Column deleted");
this.parent = parent;
this.child = child;
}
public boolean canUndo() {
return wasRemoved;
}
public void execute() {
redo();
}
public void redo() {
wasRemoved = parent.removeColumn(child);
if (parent.getColumns().size() == 0) {
diagram = (LayoutTplDiagram) parent.getParent();
diagram.removeChild(parent);
}
}
public void undo() {
parent.addColumn(child);
if (diagram != null) {
diagram.addRow(parent);
}
}
}
|
[
"gregory.amerson@liferay.com"
] |
gregory.amerson@liferay.com
|
af1ca1a605525d30b921af93af07910322b03dbf
|
32b72e1dc8b6ee1be2e80bb70a03a021c83db550
|
/ast_results/BrandroidTools_OpenExplorer/src/com/box/androidlib/RegisterNewUserListener.java
|
0cfb6a8975f5b94b385a96b2b105dc58a69a4551
|
[] |
no_license
|
cmFodWx5YWRhdjEyMTA5/smell-and-machine-learning
|
d90c41a17e88fcd99d543124eeb6e93f9133cb4a
|
0564143d92f8024ff5fa6b659c2baebf827582b1
|
refs/heads/master
| 2020-07-13T13:53:40.297493
| 2019-01-11T11:51:18
| 2019-01-11T11:51:18
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 689
|
java
|
// isComment
package com.box.androidlib;
/**
* isComment
*/
public interface isClassOrIsInterface extends ResponseListener {
/**
* isComment
*/
String isVariable = "isStringConstant";
/**
* isComment
*/
String isVariable = "isStringConstant";
/**
* isComment
*/
String isVariable = "isStringConstant";
/**
* isComment
*/
String isVariable = "isStringConstant";
/**
* isComment
*/
String isVariable = "isStringConstant";
/**
* isComment
*/
String isVariable = "isStringConstant";
/**
* isComment
*/
void isMethod(User isParameter, String isParameter);
}
|
[
"matheus@melsolucoes.net"
] |
matheus@melsolucoes.net
|
bb5b20b57ba4279f96d37002db8b6846181142d4
|
c0fe21b86f141256c85ab82c6ff3acc56b73d3db
|
/redis/src/main/java/com/jdcloud/sdk/service/redis/model/DescribeHotKeyDetailRequest.java
|
a06dffff0de45fb026cbd6d960a1afd984dc3ddb
|
[
"Apache-2.0"
] |
permissive
|
jdcloud-api/jdcloud-sdk-java
|
3fec9cf552693520f07b43a1e445954de60e34a0
|
bcebe28306c4ccc5b2b793e1a5848b0aac21b910
|
refs/heads/master
| 2023-07-25T07:03:36.682248
| 2023-07-25T06:54:39
| 2023-07-25T06:54:39
| 126,275,669
| 47
| 61
|
Apache-2.0
| 2023-09-07T08:41:24
| 2018-03-22T03:41:41
|
Java
|
UTF-8
|
Java
| false
| false
| 6,625
|
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.
*
* Redis Instance API
* 缓存Redis实例的创建、删除、修改基本信息、设置密码、变配、实例列表、备份、配置参数等接口
*
* OpenAPI spec version: v1
* Contact:
*
* NOTE: This class is auto generated by the jdcloud code generator program.
*/
package com.jdcloud.sdk.service.redis.model;
import com.jdcloud.sdk.annotation.Required;
import com.jdcloud.sdk.service.JdcloudRequest;
/**
* 查询热key分析详情
*/
public class DescribeHotKeyDetailRequest extends JdcloudRequest implements java.io.Serializable {
private static final long serialVersionUID = 1L;
/**
* 节点id
* Required:true
*/
@Required
private String nodeId;
/**
* 页码;默认为1
*/
private Integer pageNumber;
/**
* 分页大小;默认为10;取值范围[10, 100]
*/
private Integer pageSize;
/**
* 开始时间,RFC3339格式,最多可以查询30天内的数据
*/
private String startTime;
/**
* 结束时间,RFC3339格式,查询时间范围最多7天
*/
private String endTime;
/**
* 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2
* Required:true
*/
@Required
private String regionId;
/**
* 缓存Redis实例ID,是访问实例的唯一标识
* Required:true
*/
@Required
private String cacheInstanceId;
/**
* get 节点id
*
* @return
*/
public String getNodeId() {
return nodeId;
}
/**
* set 节点id
*
* @param nodeId
*/
public void setNodeId(String nodeId) {
this.nodeId = nodeId;
}
/**
* get 页码;默认为1
*
* @return
*/
public Integer getPageNumber() {
return pageNumber;
}
/**
* set 页码;默认为1
*
* @param pageNumber
*/
public void setPageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
}
/**
* get 分页大小;默认为10;取值范围[10, 100]
*
* @return
*/
public Integer getPageSize() {
return pageSize;
}
/**
* set 分页大小;默认为10;取值范围[10, 100]
*
* @param pageSize
*/
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
/**
* get 开始时间,RFC3339格式,最多可以查询30天内的数据
*
* @return
*/
public String getStartTime() {
return startTime;
}
/**
* set 开始时间,RFC3339格式,最多可以查询30天内的数据
*
* @param startTime
*/
public void setStartTime(String startTime) {
this.startTime = startTime;
}
/**
* get 结束时间,RFC3339格式,查询时间范围最多7天
*
* @return
*/
public String getEndTime() {
return endTime;
}
/**
* set 结束时间,RFC3339格式,查询时间范围最多7天
*
* @param endTime
*/
public void setEndTime(String endTime) {
this.endTime = endTime;
}
/**
* get 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2
*
* @return
*/
public String getRegionId() {
return regionId;
}
/**
* set 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2
*
* @param regionId
*/
public void setRegionId(String regionId) {
this.regionId = regionId;
}
/**
* get 缓存Redis实例ID,是访问实例的唯一标识
*
* @return
*/
public String getCacheInstanceId() {
return cacheInstanceId;
}
/**
* set 缓存Redis实例ID,是访问实例的唯一标识
*
* @param cacheInstanceId
*/
public void setCacheInstanceId(String cacheInstanceId) {
this.cacheInstanceId = cacheInstanceId;
}
/**
* set 节点id
*
* @param nodeId
*/
public DescribeHotKeyDetailRequest nodeId(String nodeId) {
this.nodeId = nodeId;
return this;
}
/**
* set 页码;默认为1
*
* @param pageNumber
*/
public DescribeHotKeyDetailRequest pageNumber(Integer pageNumber) {
this.pageNumber = pageNumber;
return this;
}
/**
* set 分页大小;默认为10;取值范围[10, 100]
*
* @param pageSize
*/
public DescribeHotKeyDetailRequest pageSize(Integer pageSize) {
this.pageSize = pageSize;
return this;
}
/**
* set 开始时间,RFC3339格式,最多可以查询30天内的数据
*
* @param startTime
*/
public DescribeHotKeyDetailRequest startTime(String startTime) {
this.startTime = startTime;
return this;
}
/**
* set 结束时间,RFC3339格式,查询时间范围最多7天
*
* @param endTime
*/
public DescribeHotKeyDetailRequest endTime(String endTime) {
this.endTime = endTime;
return this;
}
/**
* set 缓存Redis实例所在区域的Region ID。目前有华北-北京、华南-广州、华东-上海三个区域,Region ID分别为cn-north-1、cn-south-1、cn-east-2
*
* @param regionId
*/
public DescribeHotKeyDetailRequest regionId(String regionId) {
this.regionId = regionId;
return this;
}
/**
* set 缓存Redis实例ID,是访问实例的唯一标识
*
* @param cacheInstanceId
*/
public DescribeHotKeyDetailRequest cacheInstanceId(String cacheInstanceId) {
this.cacheInstanceId = cacheInstanceId;
return this;
}
}
|
[
"jdcloud-api@jd.com"
] |
jdcloud-api@jd.com
|
58f75200bb7d89fd9e7cdb1078a8fe304fa8c55f
|
377e5e05fb9c6c8ed90ad9980565c00605f2542b
|
/bin/platform/ext/platformservices/src/de/hybris/platform/category/daos/impl/DefaultCategoryDao.java
|
a716840b419cf43f3f329dee5f2d21ee5c031b7e
|
[] |
no_license
|
automaticinfotech/HybrisProject
|
c22b13db7863e1e80ccc29774f43e5c32e41e519
|
fc12e2890c569e45b97974d2f20a8cbe92b6d97f
|
refs/heads/master
| 2021-07-20T18:41:04.727081
| 2017-10-30T13:24:11
| 2017-10-30T13:24:11
| 108,957,448
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,178
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with SAP Hybris.
*/
package de.hybris.platform.category.daos.impl;
import de.hybris.platform.catalog.model.CatalogVersionModel;
import de.hybris.platform.category.constants.CategoryConstants;
import de.hybris.platform.category.daos.CategoryDao;
import de.hybris.platform.category.model.CategoryModel;
import de.hybris.platform.core.model.link.LinkModel;
import de.hybris.platform.core.model.product.ProductModel;
import de.hybris.platform.servicelayer.internal.dao.AbstractItemDao;
import de.hybris.platform.servicelayer.search.SearchResult;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* Default implementation for {@link CategoryDao}.
*/
public class DefaultCategoryDao extends AbstractItemDao implements CategoryDao
{
/**
* {@inheritDoc}
*/
@SuppressWarnings("deprecation")
@Deprecated
@Override
public Collection<CategoryModel> findCategories(final CatalogVersionModel catalogVersion, final String code)
{
return findCategoriesByCode(catalogVersion, code);
}
/**
* {@inheritDoc}
*/
@Override
public Collection<CategoryModel> findCategoriesByCode(final CatalogVersionModel catalogVersion, final String code)
{
final StringBuilder query = new StringBuilder("SELECT {cat." + CategoryModel.PK + "} ");
query.append("FROM {" + CategoryModel._TYPECODE + " AS cat} ");
query.append("WHERE {cat." + CategoryModel.CODE + "} = ?" + CategoryModel.CODE);
query.append(" AND {cat." + CategoryModel.CATALOGVERSION + "} = (?" + CategoryModel.CATALOGVERSION + ")");
final Map<String, Object> params = new HashMap<String, Object>(2);
params.put(CategoryModel.CATALOGVERSION, catalogVersion);
params.put(CategoryModel.CODE, code);
final SearchResult<CategoryModel> searchRes = search(query.toString(), params);
return searchRes.getResult();
}
/**
* {@inheritDoc}
*/
@Override
public Collection<CategoryModel> findCategoriesByCode(final String code)
{
final StringBuilder query = new StringBuilder("SELECT {cat." + CategoryModel.PK + "} ");
query.append("FROM {" + CategoryModel._TYPECODE + " AS cat} ");
query.append("WHERE {cat." + CategoryModel.CODE + "} = ?" + CategoryModel.CODE);
final Map<String, Object> params = (Map) Collections.singletonMap(CategoryModel.CODE, code);
final SearchResult<CategoryModel> searchRes = search(query.toString(), params);
return searchRes.getResult();
}
/**
* {@inheritDoc}
*/
@Override
public Collection<CategoryModel> findCategoriesByCatalogVersionAndProduct(final CatalogVersionModel catver,
final ProductModel product)
{
final StringBuilder query = new StringBuilder();
query.append("SELECT {").append(CategoryModel.PK).append("} ");
query.append("FROM {").append(CategoryModel._TYPECODE).append(" AS cat ");
query.append("JOIN ").append(CategoryConstants.Relations.CATEGORYPRODUCTRELATION).append(" AS c2pRel ");
query.append("ON {c2pRel:").append(LinkModel.SOURCE).append("}={cat:").append(CategoryModel.PK).append("} } ");
query.append("WHERE {cat:").append(CategoryModel.CATALOGVERSION).append("}=?cv ");
query.append("AND {c2pRel:").append(LinkModel.TARGET).append("}=?product ");
final Map<String, Object> params = new HashMap<String, Object>();
params.put("cv", catver);
params.put("product", product);
final SearchResult<CategoryModel> searchResult = search(query.toString(), params);
return searchResult.getResult();
}
@SuppressWarnings("deprecation")
@Deprecated
@Override
public Collection<CategoryModel> findRootCategories(final CatalogVersionModel catalogVersion)
{
return findRootCategoriesByCatalogVersion(catalogVersion);
}
/**
* {@inheritDoc}
*/
@Override
public Collection<CategoryModel> findRootCategoriesByCatalogVersion(final CatalogVersionModel catalogVersion)
{
final StringBuilder query = new StringBuilder("SELECT {cat." + CategoryModel.PK + "} ");
query.append("FROM {" + CategoryModel._TYPECODE + " AS cat} ");
query.append("WHERE NOT EXISTS ({{");
query.append("SELECT {pk} FROM {" + CategoryModel._CATEGORYCATEGORYRELATION + " AS rel ");
query.append("JOIN " + CategoryModel._TYPECODE + " AS super ON {rel.source}={super.PK} } ");
query.append("WHERE {rel:target}={cat.pk} ");
query.append("AND {super." + CategoryModel.CATALOGVERSION + "}={cat." + CategoryModel.CATALOGVERSION + "} }}) ");
query.append("AND {cat." + CategoryModel.CATALOGVERSION + "} = ?" + CategoryModel.CATALOGVERSION);
final Map<String, Object> params = (Map) Collections.singletonMap(CategoryModel.CATALOGVERSION, catalogVersion);
final SearchResult<CategoryModel> searchRes = search(query.toString(), params);
return searchRes.getResult();
}
}
|
[
"santosh.kshirsagar@automaticinfotech.com"
] |
santosh.kshirsagar@automaticinfotech.com
|
400cd18cd4e4399680b5b4b79113f04ef18d108e
|
f379a93728c71b2384c78afbe7604853de34b8fd
|
/app/src/main/java/com/app/mobile/royal/Driver/SignUpAgent/ResponseAuthority.java
|
55eca8c4bd7e6904f77f192231987a31c5e328d8
|
[] |
no_license
|
priyankagiri14/royal_mobile
|
20fe91c893ac342148f7b73f8a86a4b787302ac1
|
1d8887c3c19feee68db737b73971ace8b683d0bc
|
refs/heads/master
| 2020-09-25T14:17:23.660783
| 2020-02-18T11:46:25
| 2020-02-18T11:46:25
| 226,021,648
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,054
|
java
|
package com.app.mobile.royal.Driver.SignUpAgent;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import java.util.List;
public class ResponseAuthority {
@SerializedName("success")
@Expose
private Boolean success;
@SerializedName("message")
@Expose
private Object message;
@SerializedName("body")
@Expose
private List<Body> body = null;
@SerializedName("page")
@Expose
private Object page;
public Boolean getSuccess() {
return success;
}
public void setSuccess(Boolean success) {
this.success = success;
}
public Object getMessage() {
return message;
}
public void setMessage(Object message) {
this.message = message;
}
public List<Body> getBody() {
return body;
}
public void setBody(List<Body> body) {
this.body = body;
}
public Object getPage() {
return page;
}
public void setPage(Object page) {
this.page = page;
}
}
|
[
"priyanka@ontrackis.com"
] |
priyanka@ontrackis.com
|
bb5b2ef3a42c7b31b0a8325c499274a3c2e71df7
|
d2984ba2b5ff607687aac9c65ccefa1bd6e41ede
|
/src/net/datenwerke/gf/client/theme/ThemeUiService.java
|
c67e93ea176b72b8c8d376b71a175ae5ef73e728
|
[] |
no_license
|
bireports/ReportServer
|
da979eaf472b3e199e6fbd52b3031f0e819bff14
|
0f9b9dca75136c2bfc20aa611ebbc7dc24cfde62
|
refs/heads/master
| 2020-04-18T10:18:56.181123
| 2019-01-25T00:45:14
| 2019-01-25T00:45:14
| 167,463,795
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,155
|
java
|
/*
* ReportServer
* Copyright (c) 2018 InfoFabrik GmbH
* http://reportserver.net/
*
*
* This file is part of ReportServer.
*
* ReportServer 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.
*
* 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 Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.datenwerke.gf.client.theme;
import com.google.gwt.user.client.ui.HTML;
import net.datenwerke.gf.client.theme.dto.ThemeUiConfig;
public interface ThemeUiService {
void setThemeConfig(ThemeUiConfig result);
ThemeUiConfig getThemeConfig();
HTML getHeaderLogo();
HTML getLoginLogo();
}
|
[
"srbala@gmail.com"
] |
srbala@gmail.com
|
24cf819ce9649e4e728e2c33cbbd77512d82c0f2
|
a2b18a0e642ebd697fd8675d1a28aef15b326744
|
/sources/android/support/p000v4/view/ViewGroupCompatLollipop.java
|
e375cb0dfa1d08fa1709b3e53719d9c9a1a43cfe
|
[] |
no_license
|
redhead1999/woman_dictionary
|
32cdf685df1be38613d4cd3d56d18f489184e51f
|
7fec2b842677d6bbe52082595b9dbde9881f1e02
|
refs/heads/master
| 2023-04-07T09:14:06.952886
| 2021-04-14T06:41:17
| 2021-04-14T06:41:17
| 292,493,891
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 574
|
java
|
package android.support.p000v4.view;
import android.view.ViewGroup;
/* renamed from: android.support.v4.view.ViewGroupCompatLollipop */
class ViewGroupCompatLollipop {
ViewGroupCompatLollipop() {
}
public static void setTransitionGroup(ViewGroup viewGroup, boolean z) {
viewGroup.setTransitionGroup(z);
}
public static boolean isTransitionGroup(ViewGroup viewGroup) {
return viewGroup.isTransitionGroup();
}
public static int getNestedScrollAxes(ViewGroup viewGroup) {
return viewGroup.getNestedScrollAxes();
}
}
|
[
"t70052@gmail.com"
] |
t70052@gmail.com
|
1721e1970435e4c2204d5b75da55a861be053189
|
4013ea05acab4e97670f974f7a02ad6c5d10be83
|
/src/test/java/icecube/daq/oldtrigger/test/MockPayload.java
|
c23b44f9e0dd8268e0eca031163331f4ca8c15ee
|
[] |
no_license
|
dglo/oldtrigger
|
f51d46a1a49f41e8cd87bbfbbbb69cf00f127d84
|
fe949e35aab14be44d84ff6275290ae6e11d7c21
|
refs/heads/main
| 2023-06-04T13:38:45.538298
| 2013-10-14T16:35:55
| 2013-10-14T16:35:55
| 295,557,339
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,147
|
java
|
package icecube.daq.oldtrigger.test;
import icecube.daq.oldpayload.PayloadInterfaceRegistry;
import icecube.daq.payload.ILoadablePayload;
import icecube.daq.payload.IPayloadDestination;
import icecube.daq.payload.IUTCTime;
import icecube.daq.payload.IWriteablePayload;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.zip.DataFormatException;
public abstract class MockPayload
implements Comparable, ILoadablePayload, IWriteablePayload
{
private IUTCTime time;
private DataFormatException loadDFException;
private IOException loadIOException;
public MockPayload(long timeVal)
{
time = new MockUTCTime(timeVal);
}
public int compareTo(Object obj)
{
if (obj == null) {
return 1;
}
if (!(obj instanceof MockPayload)) {
return getClass().getName().compareTo(obj.getClass().getName());
}
MockPayload mp = (MockPayload) obj;
if (time == null) {
if (mp.time == null) {
return 0;
}
return 1;
} else if (mp.time == null) {
return -1;
}
return (int) (mp.time.longValue() - time.longValue());
}
public abstract Object deepCopy();
public void dispose()
{
throw new Error("Unimplemented");
}
public boolean equals(Object obj)
{
return compareTo(obj) == 0;
}
public abstract int getPayloadInterfaceType();
public abstract int getPayloadLength();
public IUTCTime getPayloadTimeUTC()
{
return time;
}
public abstract int getPayloadType();
public long getUTCTime()
{
return time.longValue();
}
public int hashCode()
{
if (time == null) {
return 0;
}
final long timeVal = time.longValue();
final long modValue = Integer.MAX_VALUE / 256;
final long topTwo = timeVal / modValue;
return (int) (topTwo / modValue) + (int) (topTwo % modValue) +
(int) (timeVal % modValue);
}
public void loadPayload()
throws IOException, DataFormatException
{
if (loadDFException != null) {
throw loadDFException;
} else if (loadIOException != null) {
throw loadIOException;
}
// do nothing
}
public void recycle()
{
// do nothing
}
public void setLoadPayloadException(Exception ex)
{
if (ex instanceof DataFormatException) {
loadDFException = (DataFormatException) ex;
} else if (ex instanceof IOException) {
loadIOException = (IOException) ex;
} else {
throw new Error("Unknown exception type " +
ex.getClass().getName() + ": " + ex);
}
}
public abstract int writePayload(boolean writeLoaded,
IPayloadDestination dest)
throws IOException;
public abstract int writePayload(boolean writeLoaded, int offset,
ByteBuffer buf)
throws IOException;
}
|
[
"dglo@icecube.wisc.edu"
] |
dglo@icecube.wisc.edu
|
c535704ab9a0061013e0d873ab8308c4e7d2dc16
|
0dcad1d1969b0c127546244947d66a3a5cb13185
|
/Exemplo02_8puzzle/src/estruturas/FilaDePrioridade.java
|
0dd365c3b75e7d5e82d1be34d217e40b45b57f5e
|
[] |
no_license
|
viniciusdenovaes/Unip201IAdiurno
|
600077bfe2856bf89ee647565940df5753a84965
|
7a8e370ae51451ede7eda1f62252d2ac2352ae2b
|
refs/heads/master
| 2021-03-08T05:12:55.119856
| 2020-05-19T14:13:48
| 2020-05-19T14:13:48
| 246,319,515
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 748
|
java
|
package estruturas;
import java.util.Comparator;
import java.util.PriorityQueue;
import entity.Estado;
import solver.HeuristicaDeAvaliacao;
public class FilaDePrioridade implements EstadoAbertos{
PriorityQueue<Estado> fila = new PriorityQueue<>(
new Comparator<Estado>() {
@Override
public int compare(Estado e1, Estado e2) {
int nota01 = e1.getNivel() + HeuristicaDeAvaliacao.PecasForaDoLugar(e1);
int nota02 = e2.getNivel() + HeuristicaDeAvaliacao.PecasForaDoLugar(e2);
return Integer.compare(nota01, nota02);
}
});
@Override
public void push(Estado estado) {
fila.add(estado);
}
@Override
public Estado pop() {
return fila.poll();
}
@Override
public int size() {
return fila.size();
}
}
|
[
"viniciusdenovaes@gmail.com"
] |
viniciusdenovaes@gmail.com
|
0332f72db18213ad9316d3c2841fa0a4d93b06a1
|
97b0945c7dd37a4c97ff1e015143790bf9696cbf
|
/src/main/java/pl/azpal/azrank/manager/AZPlayersGroup.java
|
be31059397719b7da53a2d60c4eac56b29e02150
|
[] |
no_license
|
DevelopmentHigh/AZRank
|
374075146153d9a1784e4e691d7f05877be91eb1
|
07492040308f289b5570b09d36fdaba209458c7c
|
refs/heads/master
| 2021-05-28T09:43:49.839430
| 2015-01-06T21:30:41
| 2015-01-06T21:30:41
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,511
|
java
|
package pl.azpal.azrank.manager;
/**
*
* @author Rutr <artuczapl at gmail.com>
*/
public class AZPlayersGroup {
public String playerName;
public String groupName;
public Long from;
public Long to;
public String world=null;
public String[] restoreGroups = new String[]{};
public AZPlayersGroup(String playerName,String groupName,long from, long to)
{
this.playerName = playerName;
this.groupName = groupName;
this.from = from;
this.to = to;
}
public AZPlayersGroup(String playerName,String groupName,long from, long to,String[] restoreGroups)
{
this.playerName = playerName;
this.groupName = groupName;
this.from = from;
this.to = to;
if(restoreGroups!=null)
this.restoreGroups = restoreGroups;
}
public AZPlayersGroup(String playerName,String groupName,long from, long to,String world)
{
this.playerName = playerName;
this.groupName = groupName;
this.from = from;
this.to = to;
this.world = world;
}
public AZPlayersGroup(String playerName,String groupName,long from, long to,String world,String[] restoreGroups)
{
this.playerName = playerName;
this.groupName = groupName;
this.from = from;
this.to = to;
this.world = world;
if(restoreGroups!=null)
this.restoreGroups = restoreGroups;
}
}
|
[
"themolkapl@gmail.com"
] |
themolkapl@gmail.com
|
48da91bc767ce079e50e021acde4339f929b4774
|
4f4f1173b58ea70c8e8612aca4b3a87dc7bb8438
|
/src/main/java/io/github/aquerr/eaglefactions/api/entities/Claim.java
|
43c9dd48f3c26f86525efa887092dee4eff57cb3
|
[
"MIT"
] |
permissive
|
alfoworks/EagleFactionsAPI
|
e1bb9e78061d7ef135e9a2b955d67fc40d8d7f73
|
07d4ad5ab755bd4cd80b7df9e7015688694b9633
|
refs/heads/master
| 2022-04-19T05:41:25.551784
| 2020-03-10T17:16:16
| 2020-03-10T17:16:16
| 255,974,510
| 0
| 0
| null | 2020-04-15T16:25:29
| 2020-04-15T16:25:28
| null |
UTF-8
|
Java
| false
| false
| 1,691
|
java
|
package io.github.aquerr.eaglefactions.api.entities;
import com.flowpowered.math.vector.Vector3i;
import java.util.Objects;
import java.util.UUID;
public class Claim
{
private final UUID worldUUID;
private final Vector3i chunkPosition;
public static Claim valueOf(String claimAsString)
{
String[] worldUUIDAndChunkPosition = claimAsString.split("\\|");
UUID worldUUID = UUID.fromString(worldUUIDAndChunkPosition[0]);
String[] vectors = worldUUIDAndChunkPosition[1].replace("(", "").replace(")", "").replace(" ", "").split(",");
int x = Integer.parseInt(vectors[0]);
int y = Integer.parseInt(vectors[1]);
int z = Integer.parseInt(vectors[2]);
Vector3i chunkPosition = Vector3i.from(x, y, z);
return new Claim(worldUUID, chunkPosition);
}
public Claim(UUID worldUUID, Vector3i chunkPosition)
{
this.worldUUID = worldUUID;
this.chunkPosition = chunkPosition;
}
public UUID getWorldUUID()
{
return this.worldUUID;
}
public Vector3i getChunkPosition()
{
return this.chunkPosition;
}
@Override
public boolean equals(Object o)
{
if(this == o) return true;
if(o == null || getClass() != o.getClass()) return false;
Claim claim = (Claim) o;
return worldUUID.equals(claim.worldUUID) &&
chunkPosition.equals(claim.chunkPosition);
}
@Override
public int hashCode()
{
return Objects.hash(worldUUID, chunkPosition);
}
@Override
public String toString()
{
return this.worldUUID.toString() + "|" + this.chunkPosition.toString();
}
}
|
[
"nerdianin@gmail.com"
] |
nerdianin@gmail.com
|
a67434bcecf3b3b59e9c4aeb37c69bbef2c11b54
|
a34026eed3dcf676c5fc8c8819e62e3447ae7142
|
/source/builder/src/com/ocs/indaba/dao/ScContributorDAO.java
|
7a62a1cad793d59bef964aeaab52a445eee04833
|
[
"Apache-2.0"
] |
permissive
|
amida-tech/indaba
|
49dbc251c22190c0ccbeb8db18ca4b9f9d4584c9
|
c41a237d9420231af7a119fee9ec7e77719accf0
|
refs/heads/master
| 2022-05-03T12:17:59.823348
| 2022-04-01T18:30:03
| 2022-04-01T18:30:03
| 43,233,278
| 3
| 1
|
NOASSERTION
| 2022-04-01T18:30:04
| 2015-09-27T03:47:07
|
Java
|
UTF-8
|
Java
| false
| false
| 1,993
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.ocs.indaba.dao;
import com.ocs.common.db.SmartDaoMySqlImpl;
import com.ocs.indaba.po.ScContributor;
import java.util.List;
import org.apache.log4j.Logger;
/**
*
* @author yc06x
*/
public class ScContributorDAO extends SmartDaoMySqlImpl<ScContributor, Integer> {
private static final Logger log = Logger.getLogger(ScContributorDAO.class);
private static final String SELECT_PRIVATE_CONTRIBUTORS =
"SELECT scc.* FROM sc_contributor scc JOIN survey_config sc ON scc.survey_config_id=sc.id WHERE sc.visibility=?";
private static final String SELECT_CONTRIBUTORS_BY_SC_ID =
"SELECT scc.* FROM sc_contributor scc JOIN survey_config sc ON scc.survey_config_id=sc.id WHERE sc.id=?";
private static final String SELECT_ORG_IDS_BY_SC_ID =
"SELECT org_id FROM sc_contributor WHERE survey_config_id=?";
private static final String EXISTS_BY_SURVEY_CONFIGID_AND_ORGID =
"SELECT COUNT(1) FROM sc_contributor WHERE survey_config_id=? AND org_id=?";
private static final String DELETE_BY_SC_ID =
"DELETE FROM sc_contributor WHERE survey_config_id=?";
public boolean exists(int surveyConfigId, int orgId) {
return super.count(EXISTS_BY_SURVEY_CONFIGID_AND_ORGID, surveyConfigId, orgId) > 0;
}
public List<ScContributor> selectContributorsByVisibility(int visibility) {
return super.find(SELECT_PRIVATE_CONTRIBUTORS, visibility);
}
public List<ScContributor> selectContributorsBySurveyConfigId(int scId) {
return super.find(SELECT_CONTRIBUTORS_BY_SC_ID, scId);
}
public List<Integer> selectOrgIdsBySurveyConfigId(int scId) {
return super.getJdbcTemplate().query(SELECT_ORG_IDS_BY_SC_ID, new Object[]{scId}, super.getIdRowMapper("org_id"));
}
public void deleteByConfigId(int scId) {
super.delete(DELETE_BY_SC_ID, scId);
}
}
|
[
"dmitry.kachaev@gmail.com"
] |
dmitry.kachaev@gmail.com
|
e5c5250047f9e64a8a1bad3e416356a07ff1a6c8
|
bb7be5b4175efccf3edad6e89aad95a589a9dc6c
|
/Others/Message2/src/com/belong/dao/IMessage2DAO.java
|
0579ba41db20d224dc2143f6aaaceca4257cb030
|
[] |
no_license
|
BarryPro/JavaEE_Eclipse
|
5fde49bfcedf88d660319ab7c9da187f0eaddcea
|
df5bacbc094e49c693eb8b18f8b734835665b068
|
refs/heads/master
| 2021-06-25T04:21:16.572515
| 2017-09-13T04:10:01
| 2017-09-13T04:10:01
| 99,305,991
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 257
|
java
|
package com.belong.dao;
import java.util.List;
import com.belong.vo.Message2;
public interface IMessage2DAO {
public boolean addMessage(Message2 message);
public boolean delMessage(Message2 message);
public List<Message2> queryMessage();
}
|
[
"belong.belong@outlook.com"
] |
belong.belong@outlook.com
|
dcb7845e7abd914ee11e95dd0c096a1b5107383a
|
cb2e0b45e47ebeb518f1c8d7d12dfa0680aed01c
|
/openbanking-api-test/src/test/java/com/laegler/openbanking/api/feature/certificate/CertificateApiFeatureSteps.java
|
035208a0d53964853dcbce75a3043841df89f84b
|
[
"MIT"
] |
permissive
|
thlaegler/openbanking
|
4909cc9e580210267874c231a79979c7c6ec64d8
|
924a29ac8c0638622fba7a5674c21c803d6dc5a9
|
refs/heads/develop
| 2022-12-23T15:50:28.827916
| 2019-10-30T09:11:26
| 2019-10-31T05:43:04
| 213,506,933
| 1
| 0
|
MIT
| 2022-11-16T11:55:44
| 2019-10-07T23:39:49
|
HTML
|
UTF-8
|
Java
| false
| false
| 716
|
java
|
package com.laegler.openbanking.api.feature.certificate;
import features.steps.AbstractFeatureSteps;
import com.laegler.openbanking.api.*;
import static io.restassured.RestAssured.*;
import static org.hamcrest.core.StringContains.*;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
@javax.annotation.Generated(value = "class com.laegler.openbanking.codegen.module.OpenbankingTestCodegen", date = "2019-10-21T07:47:41.234+13:00")
public class CertificateApiFeatureSteps extends AbstractFeatureSteps {
//TODO: Create your custom steps here
//@Given("^an example step$")
//public void an_example_step() throws Throwable {
// given().spec(spec());
//}
}
|
[
"thomas.laegler@googlemail.com"
] |
thomas.laegler@googlemail.com
|
c1b83ce26c2e6ec73a1c11c48f553fb1ff440c63
|
caaffff72d43cc31a5de6746429d32c989685c7c
|
/net.jplugin.core.das.hib/src/net/jplugin/core/das/hib/Plugin.java
|
9b48ea39f935a55cd466c219d77530390e6eeec3
|
[] |
no_license
|
iamlibo/jplugin
|
8c0ebf3328bdb90d7db80606d46453778c25f4f4
|
4f8b65dd285f986a3c54b701a25fabca3bba5ed9
|
refs/heads/master
| 2021-01-12T02:10:35.903062
| 2016-12-08T12:42:33
| 2016-12-08T12:42:33
| null | 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 2,657
|
java
|
package net.jplugin.core.das.hib;
import net.jplugin.core.das.hib.api.IDataService;
import net.jplugin.core.das.hib.api.IMtDataService;
import net.jplugin.core.das.hib.api.IPersistObjDefinition;
import net.jplugin.core.das.hib.api.SinglePoDefine;
import net.jplugin.core.das.hib.impl.DataService4Hibernate;
import net.jplugin.core.das.hib.mt.MtDataService;
import net.jplugin.core.kernel.api.AbstractPlugin;
import net.jplugin.core.kernel.api.CoreServicePriority;
import net.jplugin.core.kernel.api.Extension;
import net.jplugin.core.kernel.api.ExtensionPoint;
import net.jplugin.core.kernel.api.PluginEnvirement;
import net.jplugin.core.service.api.Constants;
import net.jplugin.core.service.api.ServiceFactory;
/**
*
* @author: LiuHang
* @version 创建时间:2015-2-9 上午08:35:48
**/
public class Plugin extends AbstractPlugin{
public static final String EP_DATAMAPPING = "EP_DATAMAPPING";
public static final String EP_DATAMAPPING_SINGLE = "EP_DATAMAPPING_SINGLE";
public Plugin(){
if (noHib()){
// System.out.println("Hiberinate env not found,skipped!");
return;
}
addExtensionPoint(ExtensionPoint.create(EP_DATAMAPPING, IPersistObjDefinition.class));
addExtensionPoint(ExtensionPoint.create(EP_DATAMAPPING_SINGLE, SinglePoDefine.class));
addExtension(Extension.create(Constants.EP_SERVICE, IDataService.class.getName(),DataService4Hibernate.class));
addExtension(Extension.create(Constants.EP_SERVICE, IMtDataService.class.getName(),MtDataService.class));
}
public static boolean noHib() {
try {
Class.forName("org.hibernate.SessionFactory");
return false;
} catch (Exception e) {
return true;
}
}
/* (non-Javadoc)
* @see net.luis.common.kernel.AbstractPlugin#getPrivority()
*/
@Override
public int getPrivority() {
return CoreServicePriority.DAS_HIB;
}
/* (non-Javadoc)
* @see net.luis.common.kernel.api.IPlugin#init()
*/
public void init() {
if (noHib()){
System.out.println("Hiberinate env not found,not init!");
return;
}
IPersistObjDefinition[] podefs = (IPersistObjDefinition[]) PluginEnvirement.getInstance().getExtensionObjects(EP_DATAMAPPING);
SinglePoDefine[] singlePoDefs = (SinglePoDefine[]) PluginEnvirement.getInstance().getExtensionObjects(EP_DATAMAPPING_SINGLE);
DataService4Hibernate das = ((DataService4Hibernate)ServiceFactory.getService(IDataService.class));
das.init(podefs,singlePoDefs);
MtDataService mtsvc = (MtDataService) ServiceFactory.getService(IMtDataService.class);
mtsvc.initDataService(ServiceFactory.getService(IDataService.class));
}
}
|
[
"liuhang.163@163.com"
] |
liuhang.163@163.com
|
d87f341ddb76c8db59df019481a96a82424bdf63
|
e381a5353139716b5460a933691692ae21d7af11
|
/android-pad/build/generated/source/apt/debug/com/pactera/financialmanager/credit/main/service/study/adapter/FilestudyAdapter$FilesAdapter$ViewHolder$$ViewBinder.java
|
ce87cc4b3c85b0df8ceae4c7ca0ec988de8e748f
|
[] |
no_license
|
dysen2014/AS_Test
|
b432147a162ca0f696bc96c3ed7453906b48a635
|
1c29ece453b200f13519cfd6d1ac1c10f06346ae
|
refs/heads/master
| 2020-05-21T11:49:50.689822
| 2018-12-23T08:39:53
| 2018-12-23T08:39:53
| 47,237,181
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,479
|
java
|
// Generated code from Butter Knife. Do not modify!
package com.pactera.financialmanager.credit.main.service.study.adapter;
import android.view.View;
import butterknife.ButterKnife.Finder;
import butterknife.ButterKnife.ViewBinder;
public class FilestudyAdapter$FilesAdapter$ViewHolder$$ViewBinder<T extends com.pactera.financialmanager.credit.main.service.study.adapter.FilestudyAdapter.FilesAdapter.ViewHolder> implements ViewBinder<T> {
@Override public void bind(final Finder finder, final T target, Object source) {
View view;
view = finder.findRequiredView(source, 2131298662, "field 'fileType'");
target.fileType = finder.castView(view, 2131298662, "field 'fileType'");
view = finder.findRequiredView(source, 2131298640, "field 'fileName'");
target.fileName = finder.castView(view, 2131298640, "field 'fileName'");
view = finder.findRequiredView(source, 2131296469, "field 'btnOpenFile'");
target.btnOpenFile = finder.castView(view, 2131296469, "field 'btnOpenFile'");
view = finder.findRequiredView(source, 2131297501, "field 'img'");
target.img = finder.castView(view, 2131297501, "field 'img'");
view = finder.findRequiredView(source, 2131297581, "field 'llLay'");
target.llLay = finder.castView(view, 2131297581, "field 'llLay'");
}
@Override public void unbind(T target) {
target.fileType = null;
target.fileName = null;
target.btnOpenFile = null;
target.img = null;
target.llLay = null;
}
}
|
[
"dysen@outlook.com"
] |
dysen@outlook.com
|
1699f58f30c41fd52b37936b724321f2f6823c6a
|
55bf3cf97644af0bcbec091532fe83c99ba592f6
|
/org/w3c/css/properties/css2/CssClip.java
|
4b5db09d817cb3bf47430c6fd54ccc0c70c89db9
|
[
"W3C-20150513",
"W3C"
] |
permissive
|
w3c/css-validator
|
dda4f191ff839b392440d91f9012ba2d2d63d0c6
|
6874d1990af57d3260fdc2a9420b09077cf2ed06
|
refs/heads/main
| 2023-09-03T12:40:19.427371
| 2023-03-13T13:59:56
| 2023-03-13T13:59:56
| 40,552,697
| 223
| 124
|
NOASSERTION
| 2023-09-13T17:38:37
| 2015-08-11T16:28:14
|
Java
|
UTF-8
|
Java
| false
| false
| 4,287
|
java
|
// $Id$
// Author: Yves Lafon <ylafon@w3.org>
//
// (c) COPYRIGHT MIT, ERCIM and Keio University, 2012.
// Please first read the full copyright statement in file COPYRIGHT.html
package org.w3c.css.properties.css2;
import org.w3c.css.properties.css.CssProperty;
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
import org.w3c.css.values.CssFunction;
import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssTypes;
import org.w3c.css.values.CssValue;
import static org.w3c.css.values.CssOperator.COMMA;
import static org.w3c.css.values.CssOperator.SPACE;
/**
* @spec http://www.w3.org/TR/2008/REC-CSS2-20080411/visufx.html#clipping
*/
public class CssClip extends org.w3c.css.properties.css.CssClip {
public static final CssIdent auto = CssIdent.getIdent("auto");
/**
* Create a new CssClip
*/
public CssClip() {
}
/**
* Creates a new CssClip
*
* @param expression The expression for this property
* @throws org.w3c.css.util.InvalidParamException
* Expressions are incorrect
*/
public CssClip(ApplContext ac, CssExpression expression, boolean check)
throws InvalidParamException {
if (check && expression.getCount() > 1) {
throw new InvalidParamException("unrecognize", ac);
}
setByUser();
CssValue val = expression.getValue();
switch (val.getType()) {
case CssTypes.CSS_FUNCTION:
CssFunction func = (CssFunction) val;
String funcname = func.getName().toLowerCase();
if (!funcname.equals("rect")) {
throw new InvalidParamException("shape", val,
getPropertyName(), ac);
}
checkShape(ac, func.getParameters(), this);
value = val;
break;
case CssTypes.CSS_IDENT:
if (inherit.equals(val)) {
value = inherit;
break;
} else if (auto.equals(val)) {
value = auto;
break;
}
// let if fail.
default:
throw new InvalidParamException("value", val,
getPropertyName(), ac);
}
expression.next();
}
public CssClip(ApplContext ac, CssExpression expression)
throws InvalidParamException {
this(ac, expression, false);
}
static void checkShape(ApplContext ac, CssExpression expression,
CssProperty caller) throws InvalidParamException {
if (expression.getCount() < 4) {
throw new InvalidParamException("few-value", caller.getPropertyName(), ac);
}
if (expression.getCount() > 4) {
throw new InvalidParamException("unrecognize", ac);
}
CssValue val;
char op, firstop;
firstop = expression.getOperator();
if (firstop == SPACE) {
// we add a warning for SPACE
ac.getFrame().addWarning("shape-separator");
}
for (int i = 0; i < 4; i++) {
val = expression.getValue();
op = expression.getOperator();
switch (val.getType()) {
case CssTypes.CSS_NUMBER:
val.getLength();
case CssTypes.CSS_LENGTH:
break;
case CssTypes.CSS_IDENT:
if (auto.equals(val)) {
break;
}
default:
throw new InvalidParamException("value",
val.toString(),
caller.getPropertyName(), ac);
}
expression.next();
// as the spec was unclear, we allow comma or space
// but no mix of the two
// special case at the end as default separator is SPACE
if (((op != firstop) || (op != COMMA && op != SPACE)) && !expression.end()) {
throw new InvalidParamException("shape-separator",
Character.toString(op), ac);
}
}
}
}
|
[
"ylafon@w3.org"
] |
ylafon@w3.org
|
dd33532c0e4b55deaeb915d04ee11ed77ca20b94
|
b8ab8c96dd7776aaaf522b04173a9646e5e28ab4
|
/src/crs-core/src/test/java/pl/nask/crs/commons/utils/ValidatorTest.java
|
b4454759c1ee98edfca201f83453041e926c235d
|
[] |
no_license
|
srirammails/iedr
|
f7638717a62b5b12add24fb70515e982a0a687c6
|
848c2560e9e0c73d93b40e31ce0d0ce2453969d1
|
refs/heads/master
| 2023-02-18T21:51:23.701880
| 2017-08-22T08:17:24
| 2017-08-22T08:17:24
| 101,394,020
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,468
|
java
|
package pl.nask.crs.commons.utils;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import org.junit.Assert;
import org.junit.Test;
public class ValidatorTest {
@Test
public void assertNotEmptyShouldFailForNullString() {
try {
Validator.assertNotEmpty((String) null, "valueName");
Assert.fail("Expected to fail with IllegalArgumentException!");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertNotEmptyShouldFailForNullCollection() {
try {
Validator.assertNotEmpty((Collection<?>) null, "valueName");
Assert.fail("Expected to fail with IllegalArgumentException!");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertNotEmptyShouldFailForEmptyString() {
try {
Validator.assertNotEmpty("", "valueName");
Assert.fail("Expected to fail with IllegalArgumentException!");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertNotEmptyShouldFailForEmptyCollection() {
try {
Validator.assertNotEmpty(Collections.EMPTY_SET, "valueName");
Assert.fail("Expected to fail with IllegalArgumentException!");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertNotEmptyShouldFailForWhitespaces() {
try {
Validator.assertNotEmpty(" \n\t", "valueName");
Assert.fail("Expected to fail with IllegalArgumentException!");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertNotEmptyShouldNotFailForNotEmptyString() {
Validator.assertNotEmpty("a string", "valueName");
}
@Test
public void assertNotEmptyShouldNotFailForNotEmptyCollection() {
Validator.assertNotEmpty(Collections.singleton("a"), "valueName");
}
@Test
public void isEmptyShouldBeTrueForNullString() {
Assert.assertTrue(Validator.isEmpty((String) null));
}
@Test
public void isEmptyShouldBeTrueForNullCollection() {
Assert.assertTrue(Validator.isEmpty((Collection<?>) null));
}
@Test
public void isEmptyShouldBeTrueForEmptyString() {
Assert.assertTrue(Validator.isEmpty(""));
}
@Test
public void isEmptyShouldBeTrueForEmptyCollection() {
Assert.assertTrue(Validator.isEmpty(Collections.EMPTY_SET));
}
@Test
public void isEmptyShouldBeTrueForWhitespaces() {
Assert.assertTrue(Validator.isEmpty(" \n\t"));
}
@Test
public void isEmptyShouldBeFalseForNotEmptyString() {
Assert.assertFalse(Validator.isEmpty("a string"));
}
@Test
public void isEmptyShouldBeFalseForNotEmptyCollection() {
Assert.assertFalse(Validator.isEmpty(Collections.singleton("a")));
}
private void assertExceptionMessage(IllegalArgumentException e, String paramName) {
Assert.assertTrue("Exception message should contain info about the validated param name", e.getMessage().contains(paramName));
}
@Test
public void assertNotNullShouldFailForNullValue() {
try {
Validator.assertNotNull(null, "valueName");
Assert.fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertNotNullShouldNotFailForNonNullValue() {
Validator.assertNotNull("aaa", "valueName");
}
public void assertNullShouldFailForNonNullValue() {
try {
Validator.assertNull("a", "valueName");
Assert.fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertNullShouldNotFailForNullValue() {
Validator.assertNull(null, "valueName");
}
@Test
public void assertTrueShouldFailForFalseValue() {
try {
Validator.assertTrue(false, "valueName");
Assert.fail("IllegalArgumentException expected");
} catch (IllegalArgumentException e) {
assertExceptionMessage(e, "valueName");
}
}
@Test
public void assertTrueShouldNotFailForTrueValue() {
Validator.assertTrue(true, "valueName");
}
@Test
public void hasDuplicatesShouldReturnFalseIfCollectionElementsAreUnique() {
Assert.assertFalse(Validator.hasDuplicates(Arrays.asList("a", "b", "c", "d")));
}
@Test
public void hasDuplicatesShouldReturnTrueIfCollectionHasDuplicatedElements() {
Assert.assertTrue(Validator.hasDuplicates(Arrays.asList("a", "b", "c", "b")));
}
@Test
public void getDuplicatesShouldReturnNullIfCollectionElementsAreUnique() {
Assert.assertNull(Validator.getDuplicates(Arrays.asList("a", "b", "c", "d")));
}
@Test
public void getDuplicatesShouldReturnDuplicatedElementIfCollectionHasDuplicatedElements() {
Assert.assertEquals("b", Validator.getDuplicates(Arrays.asList("a", "b", "c", "b")));
}
@Test
public void isEqualShouldBeTrueForNullArguments() {
Assert.assertTrue(Validator.isEqual(null, null));
}
@Test
public void isEqualShouldBeTrueForEqualArguments() {
Assert.assertTrue(Validator.isEqual("a", "a"));
}
@Test
public void isEqualShouldBeFalseIfOneArgumentIsNull() {
Assert.assertFalse(Validator.isEqual("a", null));
Assert.assertFalse(Validator.isEqual(null, "a"));
}
@Test
public void isEqualShouldBeFalseIfArgumentsAreNotEqual() {
Assert.assertFalse(Validator.isEqual("a", "b"));
}
}
|
[
"admin@work-vm.localdomain"
] |
admin@work-vm.localdomain
|
f71767179889a0eb0b37d5dc61fbcd67252a83c0
|
20a68bc8842f2de6f241da165f99650639dcf3f8
|
/006Spring/JdbcSpittr/src/main/java/com/hef/spittr/service/imple/SpittlerServiceImpl.java
|
375d1f832e93103cf69ac354b0b7b9b97c11d03a
|
[] |
no_license
|
kinoko67/learning-area
|
6c7af64b677f60f0aa690348da7738615cf81711
|
6cf460938624833f6c7d586ffaae5c68fbbdae61
|
refs/heads/master
| 2023-02-17T14:17:11.059096
| 2019-10-23T05:39:13
| 2019-10-23T05:39:13
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,261
|
java
|
package com.hef.spittr.service.imple;
import com.hef.spittr.dao.JNDIDao;
import com.hef.spittr.dao.SpittlerDao;
import com.hef.spittr.entities.Spittler;
import com.hef.spittr.service.SpittlerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.naming.NamingException;
import java.sql.Connection;
import java.sql.SQLException;
@Component
public class SpittlerServiceImpl implements SpittlerService {
@Autowired
private JNDIDao jndiDao;
@Autowired
private SpittlerDao spittlerDao;
@Override
public void getConnection() {
try {
Connection connection = jndiDao.getConnection();
System.out.println(connection);
} catch (NamingException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
@Override
public void addSpittler(Spittler spittler) {
spittlerDao.addSpittler(spittler);
}
@Override
public void updateSpittler(Spittler spittler) {
spittlerDao.updateSpittler(spittler);
}
@Override
public Spittler findOneSpittler(String fullname) {
return spittlerDao.findOne(fullname);
}
}
|
[
"hefrankeleyn@gamil.com"
] |
hefrankeleyn@gamil.com
|
21bd9d9dd884d5a2d7684f6cf9c86ec21c1fd1df
|
729c264356632a88d0c46f7798d99ec477ea9d9f
|
/jOOR/src/test/java/org/joor/test/CompileTest.java
|
84d67b7ca3a9bf94e3b7d373988b25f48ec3738f
|
[
"Apache-2.0"
] |
permissive
|
642190410/jOOR
|
74d17f6531e66b10b84af1866a9cb0249967a12c
|
94eb965b6cec25dbb644034057e31d463949d660
|
refs/heads/master
| 2020-04-07T07:56:42.154332
| 2018-10-25T12:27:27
| 2018-10-25T12:27:27
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,962
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.joor.test;
/* [java-8] */
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.joor.Reflect;
import org.joor.ReflectException;
import org.joor.test.CompileTest.J;
import org.junit.Test;
import org.junit.validator.TestClassValidator;
/**
* @author Lukas Eder
*/
public class CompileTest {
@Test
public void testCompileWithClasspathDependency() throws Exception {
TestClassValidator v = Reflect.compile("org.joor.test.TestClassValidatorImplementation",
"package org.joor.test; public class TestClassValidatorImplementation implements org.junit.validator.TestClassValidator {"
+ "public java.util.List<Exception> validateTestClass(org.junit.runners.model.TestClass testClass) {"
+ "return new java.util.ArrayList<>();"
+ "}"
+ "}").create().get();
assertEquals(new ArrayList<Object>(), v.validateTestClass(null));
}
@Test
public void testCompileLocalInterfaceHierarchy() throws Exception {
I i = Reflect.compile("org.joor.test.CompileTest1", "package org.joor.test; public class CompileTest1 implements org.joor.test.I {}").create().get();
assertEquals("I.m()", i.m());
J j = Reflect.compile("org.joor.test.CompileTest2", "package org.joor.test; public class CompileTest2 implements org.joor.test.CompileTest.J {}").create().get();
assertEquals("J.m()", j.m());
}
@Test
public void testCompileSamePackage() {
Supplier<String> supplier = Reflect.compile(
"org.joor.test.CompileTest3",
"package org.joor.test;\n" +
"class CompileTest3 implements java.util.function.Supplier<String> {\n" +
" public String get() {\n" +
" return \"Hello World!\";\n" +
" }\n" +
"}\n"
).create().get();
assertEquals("Hello World!", supplier.get());
}
@Test
public void testCompileDifferentPackage() {
Supplier<String> supplier = Reflect.compile(
"com.example.CompileTestDifferentPackage",
"package com.example;\n" +
"class CompileTestDifferentPackage implements java.util.function.Supplier<String> {\n" +
" public String get() {\n" +
" return \"Hello World!\";\n" +
" }\n" +
"}\n"
).create().get();
assertEquals("Hello World!", supplier.get());
}
@Test
public void testRecompileSameClassName() {
// The class loader will cache the class name by default, so a new content shouldn't affect the type
Object o1 = Reflect.compile(
"org.joor.test.CompileSameClassName",
"package org.joor.test;" +
"class CompileSameClassName { public String toString() { return \"a\"; } }")
.create()
.get();
assertEquals("a", o1.toString());
Object o2 = Reflect.compile(
"org.joor.test.CompileSameClassName",
"package org.joor.test;" +
"class CompileSameClassName { public String toString() { return \"b\"; } }")
.create()
.get();
assertEquals("a", o2.toString());
}
@Test
public void testCompileEnums() {
Class<Enum<?>> e = Reflect.compile(
"org.joor.test.CompiledEnum",
"package org.joor.test;" +
"enum CompiledEnum { a, b, c }")
.get();
assertEquals(Arrays.asList("a", "b", "c"), Stream.of(e.getEnumConstants()).map(Enum::name).collect(Collectors.toList()));
}
@Test
public void testCompilationError() {
try {
Reflect.compile(
"org.joor.test.CompilationError",
"package org.joor.test;" +
"class CompilationError { a }"
);
}
catch (ReflectException e) {
assertTrue(e.getMessage(), e.getMessage().contains("Compilation error:"));
}
}
interface J {
default String m() {
return "J.m()";
}
}
}
interface I extends J {
@Override
default String m() {
return "I.m()";
}
}
/* [/java-8] */
|
[
"lukas.eder@gmail.com"
] |
lukas.eder@gmail.com
|
a53fde957d12b97908ed846817bc6cc158d40cc9
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/large-multiproject/project35/src/test/java/org/gradle/test/performance35_3/Test35_209.java
|
25e34ec23d80077c0b23696e9d1d1d6eb59be0e5
|
[] |
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.performance35_3;
import static org.junit.Assert.*;
public class Test35_209 {
private final Production35_209 production = new Production35_209("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
}
|
[
"cedric.champeau@gmail.com"
] |
cedric.champeau@gmail.com
|
2217e18ea97723107b09d1aad2b7b9c02bd6a3a6
|
cb5e302cbbb3da0d6d6b0011768cd7466efa6183
|
/src/com/xiaomi/hm/bleservice/gatt/AbsGattCallback$2.java
|
fccf1a4575003e397c64af4acb474365b564b998
|
[] |
no_license
|
marcusrogerio/miband-1
|
e6cdcfce00d7186e25e184ca4c258a72b0aba097
|
b3498784582eb30eb2b06c3d054bcf80b04138d0
|
refs/heads/master
| 2021-05-06T23:33:01.192152
| 2014-08-30T11:42:00
| 2014-08-30T11:42:00
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 487
|
java
|
package com.xiaomi.hm.bleservice.gatt;
import com.xiaomi.hm.bleservice.util.Debug;
class AbsGattCallback$2
implements Thread.UncaughtExceptionHandler
{
public void uncaughtException(Thread paramThread, Throwable paramThrowable)
{
Debug.TRACE();
paramThrowable.printStackTrace();
}
}
/* Location: C:\Users\Fernando\Desktop\Mibandesv2.3\classes-dex2jar.jar
* Qualified Name: com.xiaomi.hm.bleservice.gatt.AbsGattCallback.2
* JD-Core Version: 0.6.2
*/
|
[
"kilfer.zgz@gmail.com"
] |
kilfer.zgz@gmail.com
|
be7e2b962a53c227a3e4b77ef5cdac5f4e27ba56
|
fc0879f1a64a9b12f191b46f3ee08f32114519af
|
/gameserver/src/ru/catssoftware/gameserver/util/XMLoader.java
|
ddb57866e9eca49cc0c7e36a3ff723c8dba41dc8
|
[] |
no_license
|
Snikers0309/lucera2
|
b26f59953edec905aefeb2c4273f3dec17e88a9d
|
53d623903322e177cc7eb34a7e292878cbc74841
|
refs/heads/master
| 2023-03-23T00:25:53.002593
| 2013-01-30T01:11:33
| 2013-01-30T01:11:33
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,060
|
java
|
package ru.catssoftware.gameserver.util;
import org.w3c.dom.Node;
import java.util.logging.Logger;
/*
* @author Ro0TT
* @date 07.01.2012
*/
public abstract class XMLoader
{
protected static Logger _log = Logger.getLogger(XMLoader.class.getName());
/**
* Возращает по дефолту Empty String (isEmpty())
* @param node - элемент парсинга.
* @param param - что парсим.
* @param debug - нужно ли выводить оишбку если возникла ошибка при парсе параметра.
* @return что спарсили.
*/
protected static String get(Node node, String param, boolean debug)
{
if (node==null || node.getAttributes()==null || node.getAttributes().getNamedItem(param)==null || node.getAttributes().getNamedItem(param).getNodeValue()==null)
{
if(debug) _log.info("Error parsing for param: " + param);
return "";
}
else
return node.getAttributes().getNamedItem(param).getNodeValue();
}
protected static String get(Node n, String param)
{
return get(n,param,true);
}
/**
* Возращает дефолтное значение.
* @param n
* @param param
* @param def
* @return String
*/
protected static String get(Node n, String param, String def)
{
String ret = get(n, param, false);
return ret.isEmpty() ? def : ret;
}
/**
* Возращает дефолтное значение.
* @param n
* @param param
* @param def
* @return int
*/
protected static int getInt(Node n, String param, int def)
{
return Integer.parseInt(get(n, param, Integer.toString(def)));
}
/**
* Возращает по дефолту 0.
* @return int
*/
protected static int getInt(Node n, String param)
{
return getInt(n, param, 0);
}
/**
* Возращает дефолтное значение.
* @return long
*/
protected static long getLong(Node n, String param, long def)
{
return Long.parseLong(get(n, param, Long.toString(def)));
}
/**
* Возращает по дефолту 0.
* @return long
*/
protected static long getLong(Node n, String param)
{
return getLong(n, param, 0);
}
/**
* Возращает дефолтное значение.
* @return boolean
*/
protected static boolean getBoolean(Node n, String param, boolean def)
{
return Boolean.parseBoolean(get(n, param, Boolean.toString(def)));
}
/**
* Возращает по дефолту false.
* @return boolean
*/
protected static boolean getBoolean(Node n, String param)
{
return getBoolean(n, param, false);
}
protected static boolean isNodeName(Node node, String name)
{
return name.equalsIgnoreCase(node.getNodeName());
}
public Node findSubNode(Node n, String name)
{
if(name == null)
return null;
for(Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
if(name.equalsIgnoreCase(d.getNodeName()))
return d;
return null;
}
public String getSubNodeAttr(Node n, String name, String atrName)
{
return getSubNodeAttr(n, name, atrName, "");
}
/**
* Ищет вложенный нод и возвращает значение его атрибута
* @param n
* @param name
* @param atrName
* @param def
* @return
*/
public String getSubNodeAttr(Node n, String name, String atrName, String def)
{
String ret = def;
if(findSubNode(n, name) != null)
{
ret = get(findSubNode(n, name), atrName, def);
}
return ret;
}
public int getSubNodeAttr(Node n, String name, String atrName, int def)
{
return Integer.parseInt(getSubNodeAttr(n, name, atrName, "" + def));
}
public String getSet(Node n, String name, String def)
{
for(Node nn = n.getFirstChild(); nn != null; nn = nn.getNextSibling())
{
if(nn.getNodeName().equalsIgnoreCase("set") && get(nn, "name").equalsIgnoreCase(name))
return get(nn, "val");
}
return def;
}
}
|
[
"topp3000@mail.ru"
] |
topp3000@mail.ru
|
11c697c6e879b12b8fe0d08df865bb2bb5660747
|
7f53ff59587c1feea58fb71f7eff5608a5846798
|
/temp/ffout/client/net/minecraft/src/WorldGenDeadBush.java
|
96036fe32c99b6022fb978a8683efd449503c0d1
|
[] |
no_license
|
Orazur66/Minecraft-Client
|
45c918d488f2f9fca7d2df3b1a27733813d957a5
|
70a0b63a6a347fd87a7dbe28c7de588f87df97d3
|
refs/heads/master
| 2021-01-15T17:08:18.072298
| 2012-02-14T21:29:14
| 2012-02-14T21:29:14
| 3,423,624
| 3
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,241
|
java
|
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) braces deadcode fieldsfirst
package net.minecraft.src;
import java.util.Random;
// Referenced classes of package net.minecraft.src:
// WorldGenerator, World, Block, BlockLeaves,
// BlockFlower
public class WorldGenDeadBush extends WorldGenerator
{
private int field_28058_a;
public WorldGenDeadBush(int i)
{
field_28058_a = i;
}
public boolean func_516_a(World world, Random random, int i, int j, int k)
{
for(int l = 0; ((l = world.func_600_a(i, j, k)) == 0 || l == Block.field_384_L.field_376_bc) && j > 0; j--) { }
for(int i1 = 0; i1 < 4; i1++)
{
int j1 = (i + random.nextInt(8)) - random.nextInt(8);
int k1 = (j + random.nextInt(4)) - random.nextInt(4);
int l1 = (k + random.nextInt(8)) - random.nextInt(8);
if(world.func_20084_d(j1, k1, l1) && ((BlockFlower)Block.field_345_n[field_28058_a]).func_223_g(world, j1, k1, l1))
{
world.func_634_a(j1, k1, l1, field_28058_a);
}
}
return true;
}
}
|
[
"Ninja_Buta@hotmail.fr"
] |
Ninja_Buta@hotmail.fr
|
4e35cd982c0dfd9be598dc458e1f9f08b3c35feb
|
eb9f655206c43c12b497c667ba56a0d358b6bc3a
|
/java/java-tests/testData/inspection/duplicateBranchesInEnhancedSwitchFix/beforeStatementThreeDuplicatesDefaultDelete.java
|
54a89e0548da5f4aa2ff1ba226492b18680891ed
|
[
"Apache-2.0"
] |
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
| 296
|
java
|
// "Delete redundant 'switch' branch" "GENERIC_ERROR_OR_WARNING"
class C {
void foo(int n) {
switch (n) {
case 1 -> bar("A");<caret>
case 2 -> bar("B");
case 3 -> bar("A");
default -> bar("A");
}
}
void bar(String s){}
}
|
[
"pavel.dolgov@jetbrains.com"
] |
pavel.dolgov@jetbrains.com
|
eacd1018fd65da2309f29831fc3651716741909c
|
2660d5ddb1d6451eeb3c30aba5b6095e5776ab73
|
/웹_프로젝트/소스코드/SpringCommon/src/main/java/edu/iot/common/util/Util.java
|
cd002d279035dc63bb6bf8c44a274ae586bcdd22
|
[] |
no_license
|
eldrk/portfolio
|
819ce411a1ae7932d2384961851c71f783a7dbd6
|
3c2728852cb57e3bdbc195196e6bc9930ac6236a
|
refs/heads/master
| 2020-04-17T22:08:49.652901
| 2019-02-26T14:54:22
| 2019-02-26T14:54:22
| 166,982,252
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 243
|
java
|
package edu.iot.common.util;
import java.text.SimpleDateFormat;
import java.util.Date;
public class Util {
public static String getToday() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(new Date());
}
}
|
[
"ubjaeeun@daum.net"
] |
ubjaeeun@daum.net
|
e4a106e1a81b60853f0f4f896311293a715d2437
|
be5c86e8fe3f5836b7d2097dd5272c72b5b28f15
|
/binary-search/Java/0004-median-of-two-sorted-arrays/src/Solution.java
|
c1844bfb1fbc47cc11275c7bd22dfe03b8dba935
|
[
"Apache-2.0"
] |
permissive
|
lemonnader/LeetCode-Solution-Well-Formed
|
d24674898ceb5441c036016dc30afc58e4a1247a
|
baabdb1990fd49ab82a712e121f49c4f68b29459
|
refs/heads/master
| 2021-04-23T18:49:40.337569
| 2020-03-24T04:50:27
| 2020-03-24T04:50:27
| 249,972,064
| 1
| 0
|
Apache-2.0
| 2020-03-25T12:26:25
| 2020-03-25T12:26:24
| null |
UTF-8
|
Java
| false
| false
| 1,600
|
java
|
public class Solution {
// 不符合题目时间复杂度要求的做法,是常规思路
public double findMedianSortedArrays(int[] nums1, int[] nums2) {
int m = nums1.length;
int n = nums2.length;
// 最后要找到合并以后索引是 median_index 的这个数
int medianIndex = (m + n) >>> 1;
// 计数器从 -1 开始,在循环开始之前加 1
// 这样在退出循环的时候,counter 能指向它最后赋值的那个元素
int counter = -1;
// nums1 的索引
int i = 0;
// nums2 的索引
int j = 0;
int[] res = new int[]{0, 0};
while (counter < medianIndex) {
counter++;
// 先写 i 和 j 遍历完成的情况,否则会出现数组下标越界
if (i == m) {
res[counter & 1] = nums2[j];
j++;
} else if (j == n) {
res[counter & 1] = nums1[i];
i++;
} else if (nums1[i] < nums2[j]) {
res[counter & 1] = nums1[i];
i++;
} else {
res[counter & 1] = nums2[j];
j++;
}
}
// 如果 m + n 是奇数,median_index 就是我们要找的
// 如果 m + n 是偶数,有一点麻烦,要考虑其中有一个用完的情况,其实也就是把上面循环的过程再进行一步
if (((m + n) & 1) == 1) {
return res[counter & 1];
} else {
return (double) (res[0] + res[1]) / 2;
}
}
}
|
[
"121088825@qq.com"
] |
121088825@qq.com
|
f55d461f98421915ea736413931a4129379659a9
|
67cbc9c5125df76324d78624e2281cb1fefc8a12
|
/application/src/main/java/org/mifos/reports/business/ReportsBO.java
|
2b280f45f6f10eacd58d6aa43003388bd0419ee4
|
[
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] |
permissive
|
mifos/1.5.x
|
86e785c062cb14be4597b33d15c38670c176120e
|
5734370912c47973de3889db21debb3ff7f0f6db
|
refs/heads/master
| 2023-08-28T09:48:46.266018
| 2010-07-12T04:43:46
| 2010-07-12T04:43:46
| 2,946,757
| 2
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,836
|
java
|
/*
* Copyright (c) 2005-2010 Grameen Foundation USA
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* See also http://www.apache.org/licenses/LICENSE-2.0.html for an
* explanation of the license and how it is applied.
*/
package org.mifos.reports.business;
import org.mifos.framework.business.BusinessObject;
import org.mifos.security.util.UserContext;
public class ReportsBO extends BusinessObject {
public ReportsBO() {
this.reportsCategoryBO = new ReportsCategoryBO();
this.reportsJasperMap = new ReportsJasperMap();
}
public ReportsBO(UserContext userContext) {
super(userContext);
}
private Short reportId;
private String reportName;
private String reportIdentifier;
private ReportsCategoryBO reportsCategoryBO;
private ReportsJasperMap reportsJasperMap;
private Short activityId;
private Short isActive;
public static final Short ACTIVE = Short.valueOf("1");
public Short getReportId() {
return reportId;
}
public void setReportId(Short reportId) {
this.reportId = reportId;
}
public String getReportName() {
return reportName;
}
public void setReportName(String reportName) {
this.reportName = reportName;
}
public String getReportIdentifier() {
return reportIdentifier;
}
public void setReportIdentifier(String reportIdentifier) {
this.reportIdentifier = reportIdentifier;
}
public ReportsCategoryBO getReportsCategoryBO() {
return reportsCategoryBO;
}
public void setReportsCategoryBO(ReportsCategoryBO reportsCategoryBO) {
this.reportsCategoryBO = reportsCategoryBO;
}
public Short getEntityID() {
return null;
}
public ReportsJasperMap getReportsJasperMap() {
return reportsJasperMap;
}
public void setReportsJasperMap(ReportsJasperMap reportsJasperMap) {
this.reportsJasperMap = reportsJasperMap;
}
public Short getActivityId() {
return activityId;
}
public void setActivityId(Short activityId) {
this.activityId = activityId;
}
public Short getIsActive() {
return isActive;
}
public void setIsActive(Short isActive) {
this.isActive = isActive;
}
}
|
[
"meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4"
] |
meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4
|
fd94bf8c3d2809ee4746d166a8b373229770943f
|
cb5f27eb6960c64542023d7382d6b917da38f0fc
|
/sources/com/google/firebase/iid/zzaw.java
|
8ff8fb58491ecea3d33e8235f3d957b8b390339a
|
[] |
no_license
|
djtwisty/ccah
|
a9aee5608d48448f18156dd7efc6ece4f32623a5
|
af89c8d3c216ec3371929436545227682e811be7
|
refs/heads/master
| 2020-04-13T05:33:08.267985
| 2018-12-24T13:52:39
| 2018-12-24T13:52:39
| 162,995,366
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,218
|
java
|
package com.google.firebase.iid;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.support.v4.p013b.C0100a;
import android.support.v4.p017e.C0238a;
import android.util.Log;
import java.io.File;
import java.io.IOException;
import java.util.Map;
final class zzaw {
private final SharedPreferences zzdc;
private final zzy zzdd;
private final Map<String, zzz> zzde;
private final Context zzx;
public zzaw(Context context) {
this(context, new zzy());
}
private zzaw(Context context, zzy zzy) {
this.zzde = new C0238a();
this.zzx = context;
this.zzdc = context.getSharedPreferences("com.google.android.gms.appid", 0);
this.zzdd = zzy;
File file = new File(C0100a.m127b(this.zzx), "com.google.android.gms.appid-no-backup");
if (!file.exists()) {
try {
if (file.createNewFile() && !isEmpty()) {
Log.i("FirebaseInstanceId", "App restored, clearing state");
zzal();
FirebaseInstanceId.getInstance().zzm();
}
} catch (IOException e) {
if (Log.isLoggable("FirebaseInstanceId", 3)) {
String str = "FirebaseInstanceId";
String str2 = "Error creating file in no backup dir: ";
String valueOf = String.valueOf(e.getMessage());
Log.d(str, valueOf.length() != 0 ? str2.concat(valueOf) : new String(str2));
}
}
}
}
public final synchronized String zzak() {
return this.zzdc.getString("topic_operaion_queue", "");
}
public final synchronized void zzf(String str) {
this.zzdc.edit().putString("topic_operaion_queue", str).apply();
}
private final synchronized boolean isEmpty() {
return this.zzdc.getAll().isEmpty();
}
private static String zza(String str, String str2, String str3) {
return new StringBuilder(((String.valueOf(str).length() + 4) + String.valueOf(str2).length()) + String.valueOf(str3).length()).append(str).append("|T|").append(str2).append("|").append(str3).toString();
}
static String zzd(String str, String str2) {
return new StringBuilder((String.valueOf(str).length() + 3) + String.valueOf(str2).length()).append(str).append("|S|").append(str2).toString();
}
public final synchronized void zzal() {
this.zzde.clear();
zzy.zza(this.zzx);
this.zzdc.edit().clear().commit();
}
public final synchronized zzax zzb(String str, String str2, String str3) {
return zzax.zzi(this.zzdc.getString(zza(str, str2, str3), null));
}
public final synchronized void zza(String str, String str2, String str3, String str4, String str5) {
String zza = zzax.zza(str4, str5, System.currentTimeMillis());
if (zza != null) {
Editor edit = this.zzdc.edit();
edit.putString(zza(str, str2, str3), zza);
edit.commit();
}
}
public final synchronized void zzc(String str, String str2, String str3) {
String zza = zza(str, str2, str3);
Editor edit = this.zzdc.edit();
edit.remove(zza);
edit.commit();
}
public final synchronized zzz zzg(String str) {
zzz zzz;
zzz = (zzz) this.zzde.get(str);
if (zzz == null) {
try {
zzz = this.zzdd.zzb(this.zzx, str);
} catch (zzaa e) {
Log.w("FirebaseInstanceId", "Stored data is corrupt, generating new identity");
FirebaseInstanceId.getInstance().zzm();
zzz = this.zzdd.zzc(this.zzx, str);
}
this.zzde.put(str, zzz);
}
return zzz;
}
public final synchronized void zzh(String str) {
String concat = String.valueOf(str).concat("|T|");
Editor edit = this.zzdc.edit();
for (String str2 : this.zzdc.getAll().keySet()) {
if (str2.startsWith(concat)) {
edit.remove(str2);
}
}
edit.commit();
}
}
|
[
"alex@Alexs-MacBook-Pro.local"
] |
alex@Alexs-MacBook-Pro.local
|
9290f8a960c7eb9e35baa3c50c5b42cfd1a1e671
|
c09df1a29d77a327b34665653ae5b5e8729e8bc7
|
/src/main/java/io/github/bigbio/pgatk/io/mzxml/mzxml/model/Orientation.java
|
176dd5dd74fb0f303cd8236cc4380f40f4657ef4
|
[
"Apache-2.0"
] |
permissive
|
bigbio/pgatk-io
|
b37356cb92f9d24cce554df089f7fc0616af459d
|
6d3ffe6c31817d2e0d52d4b7ab0de1acaf07a12b
|
refs/heads/master
| 2022-10-15T19:53:50.184760
| 2021-05-08T15:55:33
| 2021-05-08T15:55:33
| 178,229,940
| 0
| 0
|
Apache-2.0
| 2022-10-05T04:48:51
| 2019-03-28T15:18:18
|
Java
|
UTF-8
|
Java
| false
| false
| 2,182
|
java
|
package io.github.bigbio.pgatk.io.mzxml.mzxml.model;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <attribute name="firstSpotID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="secondSpotID" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
public class Orientation
implements Serializable, MzXMLObject
{
private final static long serialVersionUID = 320L;
@XmlAttribute(required = true)
protected String firstSpotID;
@XmlAttribute(required = true)
protected String secondSpotID;
/**
* Gets the value of the firstSpotID property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getFirstSpotID() {
return firstSpotID;
}
/**
* Sets the value of the firstSpotID property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setFirstSpotID(String value) {
this.firstSpotID = value;
}
/**
* Gets the value of the secondSpotID property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSecondSpotID() {
return secondSpotID;
}
/**
* Sets the value of the secondSpotID property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSecondSpotID(String value) {
this.secondSpotID = value;
}
}
|
[
"ypriverol@gmail.com"
] |
ypriverol@gmail.com
|
8f3e214dbc011f48016678f7b2c6567359a8c3ea
|
c782eb3c853a75ffd190569c76d25a8260ede928
|
/src/com/facebook/buck/distributed/ThriftCoordinatorServer.java
|
e71d23da4cd97aeaa7871eab2a3a21d761f0797e
|
[
"Apache-2.0"
] |
permissive
|
jasch-shah/buck
|
0fd1c409f0272ca14540875e3fc00d332a3a8ab2
|
3651f1e024dcc7daa734c71dec3cd06354d77aa9
|
refs/heads/master
| 2021-06-30T14:08:57.736820
| 2017-09-14T18:26:56
| 2017-09-14T20:29:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,977
|
java
|
/*
* Copyright 2016-present Facebook, 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.facebook.buck.distributed;
import com.facebook.buck.distributed.thrift.CoordinatorService;
import com.facebook.buck.distributed.thrift.FinishedBuildingRequest;
import com.facebook.buck.distributed.thrift.FinishedBuildingResponse;
import com.facebook.buck.distributed.thrift.GetTargetsToBuildAction;
import com.facebook.buck.distributed.thrift.GetTargetsToBuildRequest;
import com.facebook.buck.distributed.thrift.GetTargetsToBuildResponse;
import com.facebook.buck.distributed.thrift.StampedeId;
import com.facebook.buck.log.Logger;
import com.facebook.buck.slb.ThriftException;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import java.io.Closeable;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.annotation.Nullable;
import org.apache.thrift.TException;
import org.apache.thrift.server.TThreadedSelectorServer;
import org.apache.thrift.transport.TNonblockingServerSocket;
import org.apache.thrift.transport.TTransportException;
public class ThriftCoordinatorServer implements Closeable {
private static final Logger LOG = Logger.get(ThriftCoordinatorServer.class);
private static final long MAX_TEAR_DOWN_MILLIS = TimeUnit.SECONDS.toMillis(2);
private static final long MAX_DIST_BUILD_DURATION_MILLIS = TimeUnit.HOURS.toMillis(2);
private final MinionWorkloadAllocator allocator;
private final int port;
private final CoordinatorServiceHandler handler;
private final CoordinatorService.Processor<CoordinatorService.Iface> processor;
private final Object lock;
private final CompletableFuture<Integer> exitCodeFuture;
private final StampedeId stampedeId;
@Nullable private TNonblockingServerSocket transport;
@Nullable private TThreadedSelectorServer server;
@Nullable private Thread serverThread;
public ThriftCoordinatorServer(
int port, BuildTargetsQueue queue, StampedeId stampedeId, int maxBuildNodesPerMinion) {
this.stampedeId = stampedeId;
this.lock = new Object();
this.exitCodeFuture = new CompletableFuture<>();
this.allocator = new MinionWorkloadAllocator(queue, maxBuildNodesPerMinion);
this.port = port;
this.handler = new CoordinatorServiceHandler();
this.processor = new CoordinatorService.Processor<>(handler);
}
public ThriftCoordinatorServer start() throws IOException {
synchronized (lock) {
try {
transport = new TNonblockingServerSocket(this.port);
} catch (TTransportException e) {
throw new ThriftException(e);
}
TThreadedSelectorServer.Args serverArgs = new TThreadedSelectorServer.Args(transport);
serverArgs.processor(processor);
server = new TThreadedSelectorServer(serverArgs);
serverThread = new Thread(() -> Preconditions.checkNotNull(server).serve());
serverThread.start();
}
return this;
}
public ThriftCoordinatorServer stop() throws IOException {
synchronized (lock) {
Preconditions.checkNotNull(server, "Server has already been stopped.").stop();
server = null;
try {
Preconditions.checkNotNull(serverThread).join(MAX_TEAR_DOWN_MILLIS);
} catch (InterruptedException e) {
throw new IOException("Coordinator thrift server took too long to tear down.", e);
} finally {
serverThread = null;
}
}
return this;
}
public int getPort() {
return port;
}
@Override
public void close() throws IOException {
if (server != null) {
stop();
}
}
public Future<Integer> getExitCode() {
return exitCodeFuture;
}
private void setBuildExitCode(int exitCode) {
exitCodeFuture.complete(exitCode);
}
public int waitUntilBuildCompletesAndReturnExitCode() {
try {
LOG.verbose("Coordinator going into blocking wait mode...");
return getExitCode().get(MAX_DIST_BUILD_DURATION_MILLIS, TimeUnit.MILLISECONDS);
} catch (ExecutionException | TimeoutException | InterruptedException e) {
LOG.error(e);
throw new RuntimeException("The distributed build Coordinator was interrupted.", e);
}
}
private class CoordinatorServiceHandler implements CoordinatorService.Iface {
@Override
public GetTargetsToBuildResponse getTargetsToBuild(GetTargetsToBuildRequest request)
throws TException {
LOG.debug(
String.format("Minion [%s] is requesting for new targets to build.", request.minionId));
checkBuildId(request.getStampedeId());
synchronized (lock) {
Preconditions.checkArgument(request.isSetMinionId());
GetTargetsToBuildResponse response = new GetTargetsToBuildResponse();
if (allocator.isBuildFinished()) {
LOG.debug(
String.format(
"Minion [%s] is being told to exit because the build has finished.",
request.minionId));
return response.setAction(GetTargetsToBuildAction.CLOSE_CLIENT);
}
ImmutableList<String> targets = allocator.getTargetsToBuild(request.getMinionId());
if (targets.isEmpty()) {
LOG.debug(
String.format(
"Minion [%s] is being told to retry getting more workload later.",
request.minionId));
return response.setAction(GetTargetsToBuildAction.RETRY_LATER);
} else {
LOG.debug(
String.format(
"Minion [%s] is being handed [%d] BuildTargets to build: [%s]",
request.minionId, targets.size(), Joiner.on(", ").join(targets)));
return response.setAction(GetTargetsToBuildAction.BUILD_TARGETS).setBuildTargets(targets);
}
}
}
@Override
public FinishedBuildingResponse finishedBuilding(FinishedBuildingRequest request)
throws TException {
LOG.info(String.format("Minion [%s] has finished building.", request.getMinionId()));
checkBuildId(request.getStampedeId());
synchronized (lock) {
Preconditions.checkArgument(request.isSetMinionId());
Preconditions.checkArgument(request.isSetBuildExitCode());
FinishedBuildingResponse response = new FinishedBuildingResponse();
if (request.getBuildExitCode() != 0) {
setBuildExitCode(request.getBuildExitCode());
response.setContinueBuilding(false);
} else {
allocator.finishedBuildingTargets(request.getMinionId());
if (getExitCode().isDone()) {
response.setContinueBuilding(false);
} else {
if (allocator.isBuildFinished()) {
// Build has finished in all Minions successfully!!
setBuildExitCode(0);
response.setContinueBuilding(false);
} else {
response.setContinueBuilding(true);
}
}
}
return response;
}
}
private void checkBuildId(StampedeId buildId) {
Preconditions.checkArgument(
stampedeId.equals(buildId),
"Request stampede build id [%s] does not match the current build id [%s].",
buildId.getId(),
stampedeId.getId());
}
}
}
|
[
"facebook-github-bot@users.noreply.github.com"
] |
facebook-github-bot@users.noreply.github.com
|
5d0553c1c80c6c750d3e7104b77fd1abdb7912e8
|
784420293504203e0485674947e252b9a884f9cf
|
/asciidoctor-editor-plugin/src/main/java/de/jcup/asciidoctoreditor/preview/FinalPreviewFileResolver.java
|
4321d8b7cc08533301f28c2d6049102d6d0da13f
|
[
"Apache-2.0"
] |
permissive
|
de-jcup/eclipse-asciidoctor-editor
|
db5515421613e8ccfec749318fb6366b1f838e76
|
5dbbb4fdeac0634eec94c1cb6773246457ac2c3f
|
refs/heads/master
| 2023-02-16T00:20:39.858165
| 2023-02-10T21:52:39
| 2023-02-10T21:52:54
| 125,332,958
| 49
| 18
|
NOASSERTION
| 2022-08-21T23:26:15
| 2018-03-15T08:06:29
|
Java
|
UTF-8
|
Java
| false
| false
| 2,886
|
java
|
/*
* Copyright 2022 Albert Tregnaghi
*
* 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 de.jcup.asciidoctoreditor.preview;
import java.io.File;
import java.io.IOException;
import de.jcup.asciidoctoreditor.EditorType;
import de.jcup.asciidoctoreditor.asciidoc.AsciiDocFileUtils;
/**
* We always generate HTML 5 output for our previews. But for PlantUML and
* Ditaa, we want to show always the SVG files inside the browser because those
* can be zoomed. With this class it is possible to fetch the SVG file instead
* of HTML. Also it is possible to enable a global feature toggle.
*
* @author albert
*
*/
public class FinalPreviewFileResolver {
public File resolvePreviewFileFromGeneratedHTMLFile(File createdHTML5File, EditorType type) {
if (type == null) {
return createdHTML5File;
}
switch (type) {
case DITAA:
return fetchFirstSVGImage(createdHTML5File);
case PLANTUML:
return fetchFirstSVGImage(createdHTML5File);
case ASCIIDOC:
default:
return createdHTML5File;
}
}
private File fetchFirstSVGImage(File createdHTML5File) {
try {
String html5 = AsciiDocFileUtils.readAsciidocFile(createdHTML5File);
String firstImgSource = parseFirstImageSource(html5);
if (firstImgSource != null) {
return new File(firstImgSource);
}
} catch (IOException e) {
e.printStackTrace();
}
return createdHTML5File;
}
private String parseFirstImageSource(String html5) {
if (html5==null) {
return null;
}
int startIndex = html5.indexOf("<img");
if (startIndex==-1) {
return null;
}
int endIndex = html5.indexOf('>',startIndex);
if (endIndex==-1) {
return null;
}
String imgTag = html5.substring(startIndex,endIndex);
int srcIndex=imgTag.indexOf("src");
if (srcIndex==-1) {
return null;
}
int first = imgTag.indexOf('"');
if (first==-1) {
return null;
}
int last = imgTag.indexOf('"', first+1);
if (last==-1) {
return null;
}
String path = imgTag.substring(first+1,last);
return path;
}
}
|
[
"albert.tregnaghi@gmail.com"
] |
albert.tregnaghi@gmail.com
|
0eaf8934cba77b65a8290b29009118b989bb14b1
|
2b05b6dfee58d164c7b2d59e0f21f0bce8a3298d
|
/ZX/app/src/main/java/com/tch/zx/activity/personal/FriendVerificationActivity.java
|
bb641d990b3a82b89cafc39927999872cdde9da4
|
[] |
no_license
|
JiaoPengJob/AndroidPro
|
f0b3354907f1ff617a8e3826f6c8064160a4e9ea
|
47a36d40ed9f64bdc3e3d3d22efb9830be84ab03
|
refs/heads/master
| 2021-09-14T17:25:06.577698
| 2018-05-16T14:18:34
| 2018-05-16T14:18:34
| 113,555,157
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,995
|
java
|
package com.tch.zx.activity.personal;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Window;
import android.view.WindowManager;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.tch.zx.R;
import com.tch.zx.application.MyApplication;
import com.tch.zx.bean.BaseResultBean;
import com.tch.zx.dao.green.DaoSession;
import com.tch.zx.dao.green.UserBeanDao;
import com.tch.zx.http.presenter.BasePresenter;
import com.tch.zx.http.view.BaseView;
import com.tch.zx.util.HelperUtil;
import java.util.HashMap;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 好友验证
*/
public class FriendVerificationActivity extends AppCompatActivity {
@BindView(R.id.etFriendVerContent)
EditText etFriendVerContent;
@BindView(R.id.tvFriendVerNumber)
TextView tvFriendVerNumber;
private String addAppUserId = "";
private UserBeanDao userBeanDao;
private DaoSession daoSession;
private BasePresenter presenter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//去除标题栏,两种方式
requestWindowFeature(Window.FEATURE_NO_TITLE);
if (getSupportActionBar() != null) {
getSupportActionBar().hide();
}
setContentView(R.layout.activity_friend_verification);
ButterKnife.bind(this);
//设置沉浸式状态栏
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
WindowManager.LayoutParams localLayoutParams = getWindow().getAttributes();
localLayoutParams.flags = (WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS | localLayoutParams.flags);
}
initView();
}
private void initView() {
if (getIntent().getStringExtra("addAppUserId") != null) {
addAppUserId = getIntent().getStringExtra("addAppUserId");
}
daoSession = ((MyApplication) getApplication()).getDaoSession();
userBeanDao = daoSession.getUserBeanDao();
etFriendVerContent.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
}
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
if (etFriendVerContent.length() <= 60) {
handler.sendEmptyMessage(0);
}
}
@Override
public void afterTextChanged(Editable editable) {
}
});
}
private Handler handler = new Handler() {
@Override
public void handleMessage(Message msg) {
tvFriendVerNumber.setText(String.valueOf(60 - etFriendVerContent.length()));
}
};
/*--------------点击事件-----------------------------*/
/**
* 返回
*/
@OnClick(R.id.llReturnFriendVer)
public void returnFriendVer() {
FriendVerificationActivity.this.finish();
}
/**
* 发送
*/
@OnClick(R.id.llFriendVerSend)
public void friendVerSend() {
if (!TextUtils.isEmpty(etFriendVerContent.getText().toString())) {
getUserInfo();
} else {
Toast.makeText(FriendVerificationActivity.this, "验证信息不能为空!", Toast.LENGTH_SHORT).show();
}
}
private void getUserInfo() {
presenter = new BasePresenter<Object>(FriendVerificationActivity.this);
presenter.onCreate();
presenter.attachView(addFriendView);
Map<String, Object> map = new HashMap<String, Object>();
map.put("appUserId", userBeanDao.loadAll().get(0).getAppUserId());
map.put("addAppUserId", addAppUserId);
map.put("verification_message", etFriendVerContent.getText().toString());
String data = HelperUtil.getParameter(map);
presenter.addFriend(data);
}
private BaseView<Object> addFriendView = new BaseView<Object>() {
@Override
public void onSuccess(BaseResultBean<Object> baseResultBean) {
if (baseResultBean.getResult() != null && baseResultBean.getRet().equals("1")) {
Toast.makeText(FriendVerificationActivity.this, "申请成功!", Toast.LENGTH_SHORT).show();
FriendVerificationActivity.this.finish();
} else {
Toast.makeText(FriendVerificationActivity.this, "申请失败!", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(String result) {
Log.e("ZX", "addFriendView接口错误" + result);
}
};
}
|
[
"jiaopengjob@outlook.com"
] |
jiaopengjob@outlook.com
|
7f3fc3ceeda0f67e442e162b30ff2ee3e46b5cda
|
a823d48f9c18a308d389492471f205365bb4e578
|
/0000-java8-master/src/main/java/com/sun/org/apache/bcel/internal/generic/DASTORE.java
|
aa27ec0ed9dadfb565f88bd73b0bb2c6a8a9b705
|
[] |
no_license
|
liuawen/Learning-Algorithms
|
3e145915ceecb93e88ca92df5dc1d0bf623db429
|
983c93a96ce0807534285782a55b22bb31252078
|
refs/heads/master
| 2023-07-19T17:04:39.723755
| 2023-07-14T14:59:03
| 2023-07-14T14:59:03
| 200,856,810
| 16
| 6
| null | 2023-04-17T19:13:20
| 2019-08-06T13:26:41
|
Java
|
UTF-8
|
Java
| false
| false
| 3,762
|
java
|
/*
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.sun.org.apache.bcel.internal.generic;
/* ====================================================================
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Apache" and "Apache Software Foundation" and
* "Apache BCEL" must not be used to endorse or promote products
* derived from this software without prior written permission. For
* written permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache BCEL", nor may "Apache" appear in their name, without
* prior written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
/**
* DASTORE - Store into double array
* <PRE>Stack: ..., arrayref, index, value.word1, value.word2 -> ...</PRE>
*
* @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
*/
public class DASTORE extends ArrayInstruction implements StackConsumer {
/** Store double into array
*/
public DASTORE() {
super(com.sun.org.apache.bcel.internal.Constants.DASTORE);
}
/**
* Call corresponding visitor method(s). The order is:
* Call visitor methods of implemented interfaces first, then
* call methods according to the class hierarchy in descending order,
* i.e., the most specific visitXXX() call comes last.
*
* @param v Visitor object
*/
public void accept(Visitor v) {
v.visitStackConsumer(this);
v.visitExceptionThrower(this);
v.visitTypedInstruction(this);
v.visitArrayInstruction(this);
v.visitDASTORE(this);
}
}
|
[
"157514367@qq.com"
] |
157514367@qq.com
|
99e489ee408bb32a48d354ff0dc6624c9da51600
|
1f8535dc9e944878432cb38a123bb2995cbf8d58
|
/providers/trystack-nova/src/main/java/org/jclouds/trystack/nova/TryStackNovaProviderMetadata.java
|
fa58662f0190f4b215f29c33fc7b94085ec1f50c
|
[
"Apache-2.0"
] |
permissive
|
swashbuck1r/jclouds
|
cb1b89fa1d71f662f5d7143277b9c0854afc3a45
|
7d56117915ac23db1e9609fe408a483538c1c45c
|
refs/heads/master
| 2020-12-25T15:39:52.129808
| 2012-09-27T16:58:29
| 2012-09-27T16:58:29
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,356
|
java
|
/**
* Licensed to jclouds, Inc. (jclouds) under one or more
* contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. jclouds 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.jclouds.trystack.nova;
import static org.jclouds.Constants.PROPERTY_TRUST_ALL_CERTS;
import static org.jclouds.openstack.nova.v2_0.config.NovaProperties.AUTO_GENERATE_KEYPAIRS;
import java.net.URI;
import java.util.Properties;
import org.jclouds.openstack.nova.v2_0.NovaApiMetadata;
import org.jclouds.openstack.nova.v2_0.config.NovaRestClientModule;
import org.jclouds.providers.ProviderMetadata;
import org.jclouds.providers.internal.BaseProviderMetadata;
import org.jclouds.trystack.nova.config.TryStackNovaServiceContextModule;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
/**
* Implementation of {@link org.jclouds.types.ProviderMetadata} for TryStack Nova
*
* @author Adrian Cole
*/
public class TryStackNovaProviderMetadata extends BaseProviderMetadata {
/** The serialVersionUID */
private static final long serialVersionUID = -8567407993297259224L;
public static Builder builder() {
return new Builder();
}
@Override
public Builder toBuilder() {
return builder().fromProviderMetadata(this);
}
public TryStackNovaProviderMetadata() {
super(builder());
}
public TryStackNovaProviderMetadata(Builder builder) {
super(builder);
}
public static Properties defaultProperties() {
Properties properties = new Properties();
properties.setProperty(PROPERTY_TRUST_ALL_CERTS, "true");
properties.setProperty(AUTO_GENERATE_KEYPAIRS, "true");
return properties;
}
public static class Builder extends BaseProviderMetadata.Builder {
protected Builder(){
id("trystack-nova")
.name("TryStack.org (Nova)")
.apiMetadata(
new NovaApiMetadata().toBuilder()
.defaultModules(ImmutableSet.<Class<? extends Module>>of(NovaRestClientModule.class, TryStackNovaServiceContextModule.class))
.build())
.homepage(URI.create("https://trystack.org"))
.console(URI.create("https://trystack.org/dash"))
.iso3166Codes("US-CA")
.endpoint("https://nova-api.trystack.org:5443/v2.0/")
.defaultProperties(TryStackNovaProviderMetadata.defaultProperties());
}
@Override
public TryStackNovaProviderMetadata build() {
return new TryStackNovaProviderMetadata(this);
}
@Override
public Builder fromProviderMetadata(
ProviderMetadata in) {
super.fromProviderMetadata(in);
return this;
}
}
}
|
[
"adrian@jclouds.org"
] |
adrian@jclouds.org
|
22267de2682a3452ca905496e7f08933069e7ad3
|
10eec5ba9e6dc59478cdc0d7522ff7fc6c94cd94
|
/maind/src/main/java/com/vvt/shell/a.java
|
72443a981df3a01a9fe3323fb829d928f480fe35
|
[] |
no_license
|
EchoAGI/Flexispy.re
|
a2f5fec409db083ee3fe0d664dc2cca7f9a4f234
|
ba65a5b8b033b92c5867759f2727c5141b7e92fc
|
refs/heads/master
| 2023-04-26T02:52:18.732433
| 2018-07-16T07:46:56
| 2018-07-16T07:46:56
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 430
|
java
|
package com.vvt.shell;
import java.util.concurrent.Callable;
final class a
implements Callable
{
a(Process paramProcess) {}
public Integer a()
{
this.a.waitFor();
return Integer.valueOf(this.a.exitValue());
}
}
/* Location: /Volumes/D1/codebase/android/POC/assets/product/maind/classes-enjarify.jar!/com/vvt/shell/a.class
* Java compiler version: 5 (49.0)
* JD-Core Version: 0.7.1
*/
|
[
"52388483@qq.com"
] |
52388483@qq.com
|
adba8cbe62c29164eece202de86de725f7438db6
|
41ef91a44c88d9d9bfd527e26995ef3040cf95ad
|
/app/src/main/java/com/example/chelianwang/Activity/xiugaimima2.java
|
9db595bdad9132237341a36ab27b8a25c674a317
|
[] |
no_license
|
guangxush/CarNetworkingApp
|
66b3937c075d0840b3636d84cb660c9cb3deb83e
|
ea7891f87204459238a6a135f4745978be3f37ee
|
refs/heads/master
| 2020-04-04T23:55:18.056708
| 2018-11-06T13:07:35
| 2018-11-06T13:07:35
| 156,376,400
| 6
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,630
|
java
|
package com.example.chelianwang.Activity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.chelianwang.R;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Random;
public class xiugaimima2 extends AppCompatActivity {
private ProgressDialog pDialog;
JSONParser jsonParser = new JSONParser();
EditText inputuserid;
EditText inputusertel;
EditText inputyanzhengma;
EditText inputuserpwd1;
EditText inputuserpwd2;
Button btnUpdateuser;
Button btnhuoqu;
String yanzhengma;
String userid=null;
private static String url_update_user = "http://"+ConstantApis.ip+"/carnetserver/update_user.php";
private static final String TAG_SUCCESS = "success";
private static final String TAG_userid = "userid";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getSupportActionBar() != null) {
getSupportActionBar().hide();
}
if (getActionBar() != null) {
getActionBar().hide();
}
setContentView(R.layout.activity_xiugaimima);
inputuserid = (EditText) findViewById(R.id.etshoujihao);
inputusertel = (EditText) findViewById(R.id.etshoujihao);
inputyanzhengma=(EditText)findViewById(R.id.etyanzhengma);
btnhuoqu=(Button)findViewById(R.id.btnhuoqu);
inputuserpwd1 = (EditText) findViewById(R.id.etmima1);
inputuserpwd2 = (EditText) findViewById(R.id.etmima2);
btnUpdateuser = (Button) findViewById(R.id.btnqueren);
Map<String, String> userInfo = Utils.getUserInfo(this);
if(userInfo != null) {
userid=userInfo.get("number");
}
//Intent i = getIntent();
// userid = i.getStringExtra(TAG_userid);
Button btnCreateuser = (Button) findViewById(R.id.btnqueren);
btnhuoqu.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Random rand = new Random();
int suijishu= (rand.nextInt(9)+1)*1000+(rand.nextInt(9)+0)*100+(rand.nextInt(9)+0)*10+(rand.nextInt(9)+0);
yanzhengma=Integer.toString(suijishu);
inputyanzhengma.setText(yanzhengma);
}
});
btnUpdateuser.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String yanzhengma2 = inputyanzhengma.getText().toString().trim();
String userpwd1 = inputuserpwd1.getText().toString();
String userpwd2 = inputuserpwd2.getText().toString();
if(!yanzhengma2.equals(yanzhengma)){
Toast.makeText(getApplicationContext(), "验证码错误!",
Toast.LENGTH_SHORT).show();
}
else if(!userpwd1.equals(userpwd2)) {
Toast.makeText(getApplicationContext(), "两次密码输入不一致,请重新输入!",
Toast.LENGTH_SHORT).show();
inputuserpwd1.setText("");
inputuserpwd2.setText("");
}
else if(userpwd1.equals("")||userpwd2.equals("")){
Toast.makeText(getApplicationContext(), "密码不能为空!",
Toast.LENGTH_SHORT).show();
}
else if(userpwd1.length()<6)
{
Toast.makeText(getApplicationContext(), "密码长度不能少于六位!",
Toast.LENGTH_SHORT).show();
}
else{
new CreateNewProduct().execute();
Toast.makeText(getApplicationContext(), "修改密码成功!",
Toast.LENGTH_SHORT).show();
}
}
});
}
class CreateNewProduct extends AsyncTask<String, String, String> {
String userid = "\""+inputuserid.getText().toString().trim()+"\"";
String usertel = "\""+inputusertel.getText().toString().trim()+"\"";
String userpwd = "\""+inputuserpwd1.getText().toString().trim()+"\"";
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(xiugaimima2.this);
pDialog.setMessage("正在修改·····");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
protected String doInBackground(String... args) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("userid", userid));
params.add(new BasicNameValuePair("usertel", usertel));
params.add(new BasicNameValuePair("userpwd", userpwd));
JSONObject json = jsonParser.makeHttpRequest(url_update_user,
"POST", params);
Log.d("修改密码:", json.toString());
try {
int success = json.getInt(TAG_SUCCESS);
if (success == 1) {
Intent i = new Intent(getApplicationContext(), denglu.class);
startActivity(i);
xiugaimima2.this.finish();
} else {
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
protected void onPostExecute(String file_url) {
pDialog.dismiss();
}
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
if(keyCode == KeyEvent.KEYCODE_BACK)
{
Intent i = new Intent(xiugaimima2.this, denglu.class);
i.putExtra(TAG_userid, userid);
startActivity(i);
xiugaimima2.this.finish();
} return false;
}
}
|
[
"guangxush@163.com"
] |
guangxush@163.com
|
d29d6bdb560e2ad4c7e04b5e416b4e423a5d87d8
|
7e3a7f5d9cd4d98bba4ea68b399fb883d96cd50b
|
/JavaOOPAdvanced/src/H_IntefaceSegregation_DependencyInvertion_Lab/p03_employee_info/business_layer/ConsoleFormatter.java
|
15253e7fdb7f10328735c1fb1c6cfc1e221e0f50
|
[] |
no_license
|
ISpectruM/Java-fundamentals
|
9f51b3658dd55326c4b817d9f62b76d001eb3244
|
ac3ea51a4edf0ca430f23655a37c3417ac9afb95
|
refs/heads/master
| 2021-01-21T11:30:08.901909
| 2017-05-15T14:09:57
| 2017-05-15T14:09:57
| 83,553,470
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 586
|
java
|
package H_IntefaceSegregation_DependencyInvertion_Lab.p03_employee_info.business_layer;
import H_IntefaceSegregation_DependencyInvertion_Lab.p03_employee_info.models.Employee;
import H_IntefaceSegregation_DependencyInvertion_Lab.p03_employee_info.ui_layer.Formatter;
public class ConsoleFormatter implements Formatter{
public String format(Iterable<Employee> employees) {
StringBuilder sb = new StringBuilder();
for (Employee employee : employees) {
sb.append(employee).append(System.lineSeparator());
}
return sb.toString();
}
}
|
[
"ispectrumcode@gmail.com"
] |
ispectrumcode@gmail.com
|
edf102544209d727ad26986cb1ebd98fa961a75f
|
460805f5ce256852e96da8a02dadc4a220313901
|
/original-java/com/ifengyu/library/widget/a.java
|
e75be3539ceadef1dc1b6efe44dcb6e0c2158548
|
[] |
no_license
|
Mi-Walkie-Talkie-by-Darkhorse/Mi-Walkie-Talkie-Plus
|
bab78cd8cea85af901d1bab6dc9f68f673727419
|
d47857800bb3a9f1deae5b4b6c6a3c44c1a78748
|
refs/heads/2.9.34-plus
| 2023-05-29T20:00:38.390971
| 2022-02-22T11:03:47
| 2022-02-22T11:03:47
| 221,777,793
| 49
| 10
| null | 2019-12-13T12:13:29
| 2019-11-14T20:07:47
|
Smali
|
UTF-8
|
Java
| false
| false
| 719
|
java
|
package com.ifengyu.library.widget;
import android.content.Context;
import com.google.devtools.build.android.desugar.runtime.ThrowableExtension;
/* compiled from: QMUIPackageHelper */
public class a {
private static String a;
private static int b = -1;
private static int c = -1;
private static int d = -1;
public static String a(Context context) {
if (a == null) {
try {
a = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
} catch (Exception e) {
ThrowableExtension.printStackTrace(e);
}
}
if (a == null) {
return "";
}
return a;
}
}
|
[
"Mi-Walkie-Talkie-by-Darkhorse@der-ball-ist-rund.net"
] |
Mi-Walkie-Talkie-by-Darkhorse@der-ball-ist-rund.net
|
57b277a7f8b3ab15875a7c1444b552046644720b
|
ee7de424b9db9df64956bb409357d3cf9b28e48f
|
/Algorithm/Test_Algorithm-Liuxiangwin/tmp/shortName/CountandSay.java
|
2f2c7bcecbd69e2e7a211cbb221dd6a513729eac
|
[] |
no_license
|
liuxiangwin/Algorithm
|
7075428f13cc0d6d12f78a12bafbc8ad7810163c
|
5f579df829cbe049d343c8b4afa1d5e4f2fce8c5
|
refs/heads/master
| 2020-12-25T17:13:48.665474
| 2016-08-08T10:28:34
| 2016-08-08T10:28:34
| 19,633,505
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 945
|
java
|
package shortName;
/**
* The count-and-say sequence is the sequence of integers beginning as follows:
* 1, 11, 21, 1211, 111221, ...
*
* 1 is read off as "one 1" or 11. 11 is read off as "two 1s" or 21. 21 is read
* off as "one 2, then one 1" or 1211.
*
* Given an integer n, generate the nth sequence.
*
* Note: The sequence of integers will be represented as a string.
*/
public class CountandSay {
public String countAndSay(int n) {
StringBuilder s1 = new StringBuilder("1");
StringBuilder s2 = new StringBuilder();
for (int i = 1; i < n; i++) {
int j = 0;
int len = s1.length();
while (j < len) {
int count = 1;
char c = s1.charAt(j);
while (j < len - 1 && s1.charAt(j + 1) == s1.charAt(j)) {
count++;
j++;
}
s2.append(count + "");
s2.append(c);
if (j == len - 1) {
break;
}
j++;
}
s1 = s2;
s2 = new StringBuilder();
}
return s1.toString();
}
}
|
[
"liuxiangwin@163.com"
] |
liuxiangwin@163.com
|
9da66071355c9b1817a87832a75a6a9b427b731a
|
16cfdabf71c3e4ecebb9c571a27d5b8e357b761b
|
/qs-hadoop-streaming-action-webUi/src/main/java/com/qs/game/streaming/model/AccessSuccessCount.java
|
20c9e05964ebf1e3ffb2c909b49188301eef5bf8
|
[] |
no_license
|
zunzhuowei/qs-hadoop
|
8cf67cb5509862962213bfe8cd5f052b794423dd
|
87704659780b0feb2ba22bf4c2a5fe6ce3874790
|
refs/heads/master
| 2022-10-23T00:28:25.108682
| 2019-05-29T16:25:35
| 2019-05-29T16:25:35
| 136,602,471
| 23
| 8
| null | 2022-10-05T18:55:34
| 2018-06-08T10:08:13
|
Java
|
UTF-8
|
Java
| false
| false
| 643
|
java
|
package com.qs.game.streaming.model;
/**
* Created by zun.wei on 2018/6/27 18:43.
* Description:
*/
public class AccessSuccessCount {
private long count;
private String name;
public long getCount() {
return count;
}
public void setCount(long count) {
this.count = count;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return "AccessSuccessCount{" +
"count=" + count +
", name='" + name + '\'' +
'}';
}
}
|
[
"1808862723@qq.com"
] |
1808862723@qq.com
|
d11ee39a6974f133639f8d42686587e932dc9fe4
|
1ec1773fd62e0a48f5c042ab0c5547decc9ac11b
|
/presto-main/src/main/java/com/facebook/presto/execution/resourceGroups/IndexedPriorityQueue.java
|
14355cb5ddec4d0024062f50a88661afb0ffde17
|
[
"Apache-2.0"
] |
permissive
|
zuoyebushiwo/weiwodb
|
71c31a2c82c84eab959020aee9ce784ea43518cc
|
6768496f0b6aa1e8d6f486e71e4711a1a3432c84
|
refs/heads/master
| 2021-09-06T09:56:34.499258
| 2018-02-05T07:41:20
| 2018-02-05T07:41:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,963
|
java
|
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.execution.resourceGroups;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
/**
* A priority queue with constant time contains(E) and log time remove(E)
* Ties are broken by insertion order
*/
final class IndexedPriorityQueue<E>
implements UpdateablePriorityQueue<E>
{
private final Map<E, Entry<E>> index = new HashMap<>();
private final Set<Entry<E>> queue = new TreeSet<>((entry1, entry2) -> {
int priorityComparison = Integer.compare(entry2.getPriority(), entry1.getPriority());
if (priorityComparison != 0) {
return priorityComparison;
}
return Long.compare(entry1.getGeneration(), entry2.getGeneration());
});
private long generation;
@Override
public boolean addOrUpdate(E element, int priority)
{
Entry<E> entry = index.get(element);
if (entry != null) {
queue.remove(entry);
Entry<E> newEntry = new Entry<>(element, priority, entry.getGeneration());
queue.add(newEntry);
index.put(element, newEntry);
return false;
}
Entry<E> newEntry = new Entry<>(element, priority, generation);
generation++;
queue.add(newEntry);
index.put(element, newEntry);
return true;
}
@Override
public boolean contains(E element)
{
return index.containsKey(element);
}
@Override
public boolean remove(E element)
{
Entry<E> entry = index.remove(element);
if (entry != null) {
queue.remove(entry);
return true;
}
return false;
}
@Override
public E poll()
{
Iterator<Entry<E>> iterator = queue.iterator();
if (!iterator.hasNext()) {
return null;
}
Entry<E> entry = iterator.next();
iterator.remove();
checkState(index.remove(entry.getValue()) != null, "Failed to remove entry from index");
return entry.getValue();
}
@Override
public E peek()
{
Iterator<Entry<E>> iterator = queue.iterator();
if (!iterator.hasNext()) {
return null;
}
Entry<E> entry = iterator.next();
return entry.getValue();
}
@Override
public int size()
{
return queue.size();
}
@Override
public boolean isEmpty()
{
return queue.isEmpty();
}
private static final class Entry<E>
{
private final E value;
private final int priority;
private final long generation;
private Entry(E value, int priority, long generation)
{
this.value = requireNonNull(value, "value is null");
this.priority = priority;
this.generation = generation;
}
public E getValue()
{
return value;
}
public int getPriority()
{
return priority;
}
public long getGeneration()
{
return generation;
}
}
}
|
[
"27547073@qq.com"
] |
27547073@qq.com
|
fa5506ecd19ac4e3475c6a74af7b631627504ed6
|
60444dd2295b114b035c546035aa39540889e625
|
/workspace/jquantlib/src/test/java/org/jquantlib/testsuite/math/interpolations/BackwardInterpolationTest.java
|
94b75e7d92e27595afb06c0c4636771feb12b96c
|
[
"BSD-3-Clause"
] |
permissive
|
gmakhobe/Quant
|
13c3a78c2a60d5bf4e725fab3ef2352a37135610
|
6557af79fc4b02cdb19dbbb410b0e45198d4e94a
|
refs/heads/master
| 2022-11-24T11:54:59.992914
| 2020-07-26T17:31:05
| 2020-07-26T17:31:05
| 264,510,073
| 0
| 0
| null | 2020-05-16T19:20:36
| 2020-05-16T19:20:35
| null |
UTF-8
|
Java
| false
| false
| 4,878
|
java
|
/*
Copyright (C) 2008 Daniel Kong
This source code is release under the BSD License.
This file is part of JQuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://jquantlib.org/
JQuantLib is free software: you can redistribute it and/or modify it
under the terms of the JQuantLib license. You should have received a
copy of the license along with this program; if not, please email
<jquant-devel@lists.sourceforge.net>. The license is also available online at
<http://www.jquantlib.org/index.php/LICENSE.TXT>.
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 license for more details.
JQuantLib is based on QuantLib. http://quantlib.org/
When applicable, the original copyright notice follows this notice.
*/
package org.jquantlib.testsuite.math.interpolations;
import static java.lang.Math.abs;
import static org.junit.Assert.assertFalse;
import org.jquantlib.QL;
import org.jquantlib.math.interpolations.Interpolation;
import org.jquantlib.math.interpolations.factories.BackwardFlat;
import org.jquantlib.math.matrixutilities.Array;
import org.junit.Test;
/**
* @author Daniel Kong
**/
public class BackwardInterpolationTest {
private static final Array x = new Array( new double[] { 0.0, 1.0, 2.0, 3.0, 4.0 });
private static final Array y = new Array( new double[] { 5.0, 4.0, 3.0, 2.0, 1.0 });
private final Interpolation interpolation;
private final int length;
private final double tolerance;
public BackwardInterpolationTest() {
QL.info("::::: "+this.getClass().getSimpleName()+" :::::");
interpolation = new BackwardFlat().interpolate(x, y);
length = x.size();
tolerance = 1.0e-12;
}
@Test
public void checkAtOriginalPoints(){
for(int i=0; i<length; i++){
final double d = x.get(i);
final double calculated = interpolation.op(d);
final double expected = y.get(i);
assertFalse("failed to reproduce "+i+" datum"
+"\n expected: "+expected
+"\n calculated: "+calculated
+"\n error: "+abs(expected-calculated),
abs(expected-calculated) > tolerance);
}
}
@Test
public void checkAtMiddlePoints() {
for(int i=0; i<length-1; i++){
final double d = (x.get(i)+x.get(i+1))/2;
final double calculated = interpolation.op(d);
final double expected = y.get(i+1);
assertFalse("failed to interpolate correctly at "+d
+"\n expected: "+expected
+"\n calculated: "+calculated
+"\n error: "+abs(expected-calculated),
abs(expected-calculated) > tolerance);
}
}
@Test
public void checkOutsideOriginalRange() {
interpolation.enableExtrapolation();
double d = x.first() - 0.5;
double calculated = interpolation.op(d);
double expected = y.first();
assertFalse("failed to extrapolate correctly at "+d
+"\n expected: "+expected
+"\n calculated: "+calculated
+"\n error: "+abs(expected-calculated),
abs(expected-calculated) > tolerance);
d= x.last()+0.5;
calculated = interpolation.op(d);
expected = y.last();
assertFalse("failed to extrapolate correctly at "+d
+"\n expected: "+expected
+"\n calculated: "+calculated
+"\n error: "+abs(expected-calculated),
abs(expected-calculated) > tolerance);
}
@Test
public void checkPrimitiveAtOriginalPoints() {
double calculated = interpolation.primitive(x.first());
double expected = 0.0;
assertFalse("failed to calculate primitive at "+x.first()
+"\n expected: "+expected
+"\n calculated: "+calculated
+"\n error: "+abs(expected-calculated),
abs(expected-calculated) > tolerance);
double sum = 0.0;
for (int i=1; i<length-1; i++) {
sum += (x.get(i)-x.get(i-1))*y.get(i);
calculated = interpolation.primitive(x.get(i));
expected=sum;
assertFalse("failed to calculate primitive at "+x.get(i)
+"\n expected: "+expected
+"\n calculated: "+calculated
+"\n error: "+abs(expected-calculated),
abs(expected-calculated) > tolerance);
}
}
@Test
public void checkPrimitiveAtMiddlePoints() {
double sum = 0.0;
for (int i=0; i<length-1; i++) {
final double d = (x.get(i)+x.get(i+1))/2;
sum += (x.get(i+1)-x.get(i))*y.get(i+1)/2;
final double calculated = interpolation.primitive(d);
final double expected=sum;
sum += (x.get(i+1)-x.get(i))*y.get(i+1)/2;
assertFalse("failed to calculate primitive at "+x.get(i)
+"\n expected: "+expected
+"\n calculated: "+calculated
+"\n error: "+abs(expected-calculated),
abs(expected-calculated) > tolerance);
}
}
}
|
[
"plamen_stilyianov@yahoo.com"
] |
plamen_stilyianov@yahoo.com
|
d7f4581ef7fe84f6ab25b6b041b450115d4db1b6
|
1ae6abc37d7844879916e8f612ba1d616bc0c3cb
|
/src/private/nc/bs/pub/action/N_XC18_SAVE.java
|
94c061edaf59b90c08d79fb2fcafea6bf970e916
|
[] |
no_license
|
menglingrui/xcgl
|
7a3b3f03f14b21fbd25334042f87fa570758a7ad
|
525b4e38cf52bb75c83762a9c27862b4f86667e8
|
refs/heads/master
| 2020-06-05T20:10:09.263291
| 2014-09-11T11:00:34
| 2014-09-11T11:00:34
| null | 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 1,898
|
java
|
package nc.bs.pub.action;
import java.util.Hashtable;
import nc.bs.pub.compiler.AbstractCompiler2;
import nc.vo.pub.BusinessException;
import nc.vo.pub.compiler.PfParameterVO;
import nc.vo.uap.pf.PFBusinessException;
/**
* @author ddk
*/
public class N_XC18_SAVE extends AbstractCompiler2 {
private java.util.Hashtable m_methodReturnHas = new java.util.Hashtable();
private Hashtable m_keyHas = null;
public N_XC18_SAVE() {
super();
}
public Object runComClass(PfParameterVO vo) throws BusinessException {
try {
super.m_tmpVo = vo;
setParameter ( "INCURVO",vo.m_preValueVo);
setParameter ( "BillType",vo.m_billType);
setParameter ( "BillDate",getUserDate ().toString ());
setParameter ( "ActionName", "SAVE");
setParameter ( "P3",null);
setParameter ( "P5",null); //getUserObj ());
Object obj1 = runClass("nc.bs.xcgl.pub.HYBillCommit", "commitHYBill","nc.vo.pub.AggregatedValueObject:01", vo, m_keyHas, m_methodReturnHas);
return obj1;
} catch (Exception ex) {
if (ex instanceof BusinessException)
throw (BusinessException) ex;
else
throw new PFBusinessException(ex.getMessage(), ex);
}
}
/*
* 备注:平台编写原始脚本
*/
public String getCodeRemark() {
return " //####本脚本必须含有返回值,返回DLG和PNL的组件不允许有返回值####\nrunClassCom@ \"nc.bs.pp.pp0201.BillCommit\", \"beforeCommitCheck\", \"nc.vo.pub.AggregatedValueObject:01\"@;\nObject retObj =runClassCom@ \"nc.bs.pp.pub.comstatus.HYBillCommit\", \"commitHYBill\", \"nc.vo.pub.AggregatedValueObject:01\"@;\nreturn retObj;\n";
}
/*
* 备注:设置脚本变量的HAS
*/
private void setParameter(String key, Object val) {
if (m_keyHas == null) {
m_keyHas = new Hashtable();
}
if (val != null) {
m_keyHas.put(key, val);
}
}
}
|
[
"menlging.rui@163.com"
] |
menlging.rui@163.com
|
87d51e524ada3a6b4e9740894274057998c78d60
|
4551dc48911ba4e7662e80dd9271f60ffa7d7fb3
|
/RMS/src/com/ixora/rms/services/QueryRepositoryService.java
|
95e37b75780b09276c7365489866f70397ae97ec
|
[] |
no_license
|
vmmelnikov/ixora-rms
|
856dec0c2538b2a84f731ebef315abf46076a859
|
85cd658b44bc5952214c51d16c571b83e02c6c71
|
refs/heads/master
| 2021-01-17T23:38:25.864542
| 2011-11-10T09:06:26
| 2011-11-10T09:06:26
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,672
|
java
|
/*
* Created on 27-Apr-2004
*/
package com.ixora.rms.services;
import com.ixora.common.Service;
import com.ixora.rms.EntityId;
import com.ixora.rms.repository.QueryMap;
import com.ixora.rms.repository.exception.FailedToSaveRepository;
/**
* Repository for data queries.
* @author Daniel Moraru
*/
public interface QueryRepositoryService extends Service {
/**
* @param agentId
* @param entityId
* @return predefined queries for the given entity
*/
public QueryMap getEntityQueries(String agentId,
EntityId entityId);
/**
* Sets entity queries.
* @param agentId
* @param entityId
* @param queries
*/
public void setEntityQueries(String agentId,
EntityId entityId, QueryMap queries);
/**
* @param agentId
* @return predefined queries for the given agent
*/
public QueryMap getAgentQueries(
String agentId);
/**
* Sets agent queries.
* @param agentId
* @param queries
*/
public void setAgentQueries(String agentId,
QueryMap queries);
/**
* @return predefined global queries
*/
public QueryMap getGlobalQueries();
/**
* Sets global queries.
* @param queries
*/
public void setGlobalQueries(QueryMap queries);
/**
* @param host
* @return user defined queries for the given host
*/
public QueryMap getHostQueries(
String host);
/**
* Sets user defined host queries.
* @param host
* @param queries
*/
public void setHostQueries(String host,
QueryMap queries);
/**
* Saves changes made to the repository.
* @throws FailedToSaveRepository
*/
public void save() throws FailedToSaveRepository;
}
|
[
"danielm777@gmail.com@a886d41a-b2a9-11de-b8dd-ab4b6ce6d521"
] |
danielm777@gmail.com@a886d41a-b2a9-11de-b8dd-ab4b6ce6d521
|
59efb8581c425f10aa6324014973b822683b570a
|
75b88cd5ddff13477c4dadb6c39d144a6a3a3f9b
|
/mybatis-simple/src/main/java/com/tianhy/mybatis/version2/executor/StatementHandler.java
|
40764b760be35dc91069e26ebfaa550c1dd43dab
|
[] |
no_license
|
AsTheStarsFall/Mybatis
|
24590f71a66a6e9313d41ee02cb3fc5d63c9f908
|
9123bb09bb565a830bb6325117866cfd25963b62
|
refs/heads/master
| 2022-07-04T12:54:32.540632
| 2020-03-20T03:08:44
| 2020-03-20T03:08:44
| 248,651,606
| 0
| 0
| null | 2022-06-21T03:01:32
| 2020-03-20T02:35:18
|
Java
|
UTF-8
|
Java
| false
| false
| 2,279
|
java
|
package com.tianhy.mybatis.version2.executor;
import com.tianhy.mybatis.version2.parameter.ParameterHandler;
import lombok.extern.slf4j.Slf4j;
import java.sql.*;
import java.util.List;
import java.util.ResourceBundle;
/**
* {@link ResultSetHandler}
*
* @Desc: 封装JDBC Statement,用于操作数据库
* @Author: thy
* @CreateTime: 2019/5/7
**/
@Slf4j
public class StatementHandler {
private ResourceBundle resourceBundle = ResourceBundle.getBundle("jdbc");
private String driver = resourceBundle.getString("jdbc.driver");
private String url = resourceBundle.getString("jdbc.url");
private String userName = resourceBundle.getString("jdbc.username");
private String passWord = resourceBundle.getString("jdbc.password");
/**
* 结果集处理器
*/
private ResultSetHandler resultSetHandler = new ResultSetHandler();
public <T> List<T> query(String statement, Class pojo, Object[] parameter) {
Connection conn = null;
PreparedStatement preparedStatement = null;
try {
conn = getConnection();
preparedStatement = conn.prepareStatement(statement);
//入参处理
ParameterHandler parameterHandler = new ParameterHandler(preparedStatement);
if(parameter != null){
parameterHandler.setParameters(parameter);
}
log.debug(preparedStatement.toString().split(":")[1]);
preparedStatement.execute();
return resultSetHandler.handler(preparedStatement.getResultSet(), pojo);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (conn != null) {
try {
conn.close();
} catch (SQLException e) {
e.printStackTrace();
}
conn = null;
}
}
return null;
}
private Connection getConnection() {
Connection conn = null;
try {
//注册JDBC驱动
Class.forName(driver);
//获取连接
conn = DriverManager.getConnection(url, userName, passWord);
} catch (Exception e) {
e.printStackTrace();
}
return conn;
}
}
|
[
"1295029807@qq.com"
] |
1295029807@qq.com
|
6350bf3d6bf7175b7b4aca1f5aa4ed68c8eafb21
|
3999d8b817b9d827f407f56be9f118c030145ae3
|
/app/src/main/java/com/cybermax/digitaloutpatient/activity/workstation/RegisterDeskActivity.java
|
f61f1d946d1ee98c4a0c0b336732e324bcb499df
|
[] |
no_license
|
androiddeveloper007/digitalOutpatient
|
6c9a8ff03e56239dccc840e7e61de1909a63f2d0
|
917227d978dea830ea2b92ede45fd42e9fdef6af
|
refs/heads/master
| 2020-05-03T14:12:48.434874
| 2019-03-31T10:15:03
| 2019-03-31T10:15:03
| 178,671,121
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,166
|
java
|
package com.cybermax.digitaloutpatient.activity.workstation;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils;
import com.cybermax.digitaloutpatient.R;
import com.cybermax.digitaloutpatient.bean.TabEntity;
import com.cybermax.digitaloutpatient.fragment.desk.InoculateDeskMainFragment;
import com.cybermax.digitaloutpatient.fragment.SetFragment;
import com.cybermax.digitaloutpatient.fragment.SimpleCardFragment;
import com.flyco.tablayout.CommonTabLayout;
import com.flyco.tablayout.listener.CustomTabEntity;
import java.util.ArrayList;
/**
* 登记台
*/
public class RegisterDeskActivity extends AppCompatActivity {
private ArrayList<CustomTabEntity> mTabEntities = new ArrayList<>();
private String[] mTitles = {"首页", "消耗", "统计", "设置"};
private ArrayList<Fragment> mFragments = new ArrayList<>();
private int[] mIconUnselectIds = {
R.mipmap.tab_home_unselect, R.mipmap.tab_speech_unselect,
R.mipmap.tab_contact_unselect, R.mipmap.tab_more_unselect};
private int[] mIconSelectIds = {
R.mipmap.tab_home_select, R.mipmap.tab_speech_select,
R.mipmap.tab_contact_select, R.mipmap.tab_more_select};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_register_desk);
CommonTabLayout tabLayout = findViewById(R.id.tl_1);
for (int i = 0; i < mTitles.length; i++) {
mTabEntities.add(new TabEntity(mTitles[i], mIconSelectIds[i], mIconUnselectIds[i]));
}
for (String title : mTitles) {
if(TextUtils.equals("首页", title)){
mFragments.add(new InoculateDeskMainFragment());
} else if (TextUtils.equals("设置", title)) {
mFragments.add(new SetFragment());
} else{
mFragments.add(SimpleCardFragment.getInstance("Switch ViewPager " + title));
}
}
tabLayout.setTabData(mTabEntities, this, R.id.fl_content, mFragments);
}
}
|
[
"zhu852514500@163.com"
] |
zhu852514500@163.com
|
2a16792b83fd0feb77cbe77ce7f149a4685b00d9
|
7d169e796639b01c6b652f12effa1d59951b8345
|
/src/java/javay/mail/LoginView.java
|
30affb1ae009722adbdced052ac8f6127a00f568
|
[
"Apache-2.0"
] |
permissive
|
dubenju/javay
|
65555744a895ecbd345df07e5537072985095e3b
|
29284c847c2ab62048538c3973a9fb10090155aa
|
refs/heads/master
| 2021-07-09T23:44:55.086890
| 2020-07-08T13:03:50
| 2020-07-08T13:03:50
| 47,082,846
| 7
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,823
|
java
|
package javay.mail;
import java.awt.Component;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
public class LoginView {
public static void main(String[] args) {
JFrame frame = new JFrame("Demo application");
frame.setSize(300, 150);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = new JPanel();
frame.add(panel);
placeComponents(panel);
frame.setVisible(true);
}
private static void placeComponents(JPanel panel) {
panel.setLayout(null);
JLabel userLabel = new JLabel("User");
userLabel.setBounds(10, 10, 80, 25);
panel.add(userLabel);
JTextField userText = new JTextField(20);
userText.setBounds(100, 10, 160, 25);
panel.add(userText);
JLabel passwordLabel = new JLabel("Password");
passwordLabel.setBounds(10, 40, 80, 25);
panel.add(passwordLabel);
JPasswordField passwordText = new JPasswordField(20);
passwordText.setBounds(100, 40, 160, 25);
panel.add(passwordText);
JButton loginButton = new JButton("login");
loginButton.setBounds(10, 80, 80, 25);
panel.add(loginButton);
JButton registerButton = new JButton("register");
registerButton.setBounds(180, 80, 80, 25);
panel.add(registerButton);
ActionListener myButtonListener = new MyButtonListener();
loginButton.addActionListener(myButtonListener);
registerButton.addActionListener(myButtonListener);
registerButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog((Component) e.getSource(),
"button has been pressed");
}
});
}
}
|
[
"dubenju@163.com"
] |
dubenju@163.com
|
321f9f59bc611831f1a7d88ae1c6efae1014122a
|
a5f06feb050fc0daeab331aa1eeda94069c1492c
|
/src/test/java/leetcode/tree/BinaryTree.java
|
4eb1831b27919fb92aad9cb93d7a14cc7934b43a
|
[
"Apache-2.0",
"BSD-3-Clause"
] |
permissive
|
aiguoxin/mybatis-3-study
|
d8e6cb16e860f8c064bb9a82e8d295c8348f8f41
|
79128bab36613883777875546239b1d892bc84d3
|
refs/heads/master
| 2023-02-16T19:36:14.954704
| 2023-02-06T13:54:40
| 2023-02-06T13:54:40
| 221,410,454
| 0
| 0
|
Apache-2.0
| 2022-09-08T01:04:01
| 2019-11-13T08:33:13
|
Java
|
UTF-8
|
Java
| false
| false
| 3,039
|
java
|
/**
* Copyright 2009-2021 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 leetcode.tree;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* 2020/8/23 上午9:49
* aiguoxin
* 说明: 二叉树,一般用链表存储。如果是满二叉树或完全二叉树、堆,一般用数组存储
*/
public class BinaryTree {
public static void main(String[] args) {
Node A = new Node(1);
Node B = new Node(2);
Node C = new Node(3);
A.left = B;
A.right = C;
// preOrder(A);
// middleOrder(A);
// afterOrder(A);
levelOrder(A);
}
static class Node{
public Node(int value) {
this.value = value;
}
private int value;
private Node left;
private Node right;
}
/**
* 前序遍历
*/
static void preOrder(Node root){
if (Objects.isNull(root)) {
return;
}
System.out.print(root.value+"\t");
preOrder(root.left);
preOrder(root.right);
}
/**
* 中序遍历
* @param root
*/
static void middleOrder(Node root){
if (Objects.isNull(root)) {
return;
}
middleOrder(root.left);
System.out.print(root.value+"\t");
middleOrder(root.right);
}
/**
* 后序遍历
* @param root
*/
static void afterOrder(Node root){
if (Objects.isNull(root)) {
return;
}
afterOrder(root.left);
afterOrder(root.right);
System.out.print(root.value+"\t");
}
/**
* 按层遍历
* @param root
*/
static List<List<Integer>> levels = new ArrayList<>();
static void levelOrder(Node root){
if(Objects.isNull(root)){
return;
}
fromLevel(root,0);
for(int i=0;i<levels.size();i++){
List<Integer> values = levels.get(i);
values.forEach(val->System.out.print(val+"\t"));
System.out.println("");
}
}
private static void fromLevel(Node node, int level) {
if(levels.size() == level){
levels.add(new ArrayList<>());
}
levels.get(level).add(node.value);
if(Objects.nonNull(node.left)){
fromLevel(node.left,level+1);
}
if(Objects.nonNull(node.right)){
fromLevel(node.right, level+1);
}
}
}
|
[
"aiguoxin@qiyi.com"
] |
aiguoxin@qiyi.com
|
57dc2d00b01410d25960a52a6df64f5513fa59bb
|
2c2481682dbd0d928ec318370319a0b114d7d768
|
/design-patterns/module-project/database-mapper/src/module-info.java
|
2e4e5b919f20c2a01dd0c0d7882dd6a7fb11c685
|
[] |
no_license
|
ChernetsovNG/geekbrains
|
f3e5fa947460d79ee7742c16a1718917df740fd0
|
0cd3dc0491b4993eaf3f91eed0b1d6572f561795
|
refs/heads/master
| 2021-01-18T13:16:49.811653
| 2019-03-03T13:13:09
| 2019-03-03T13:13:09
| 100,375,364
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 151
|
java
|
module database.mapper {
requires persistence.api;
requires java.sql;
requires postgresql;
requires reflections;
requires junit;
}
|
[
"n.chernetsov86@gmail.com"
] |
n.chernetsov86@gmail.com
|
1e53684188ac35717297564ca05055569d7cba74
|
eb9f655206c43c12b497c667ba56a0d358b6bc3a
|
/plugins/kotlin/compiler-reference-index/tests/testData/customCompilerIndexData/testTopLevelConstantWithJvmName/JavaRead.java
|
d33f0498f474029ebdd79981296352caa97a8508
|
[
"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
| 140
|
java
|
import top.level.MainKt;
public class JavaRead {
public static void main(String[] args) {
int i = MainKt.customJvmName;
}
}
|
[
"intellij-monorepo-bot-no-reply@jetbrains.com"
] |
intellij-monorepo-bot-no-reply@jetbrains.com
|
7346709850a1696e732dc48bbe41a14621c6f7a2
|
8dbec88ff48b20e940e25a6d10f5b31da1b2e150
|
/repo-service/repo-service/src/main/java/com/tianhy/study/reposervice/RepoController.java
|
6ccb51f461d2123541e2310e51cf64cf89ff53dc
|
[] |
no_license
|
AsTheStarsFall/Zookeeper
|
a52f654a49b6b5ae45894bea3dc1460009de025e
|
255eb3f7b00db15c30ef1bd1084e587ff928b3cc
|
refs/heads/master
| 2022-11-29T18:20:48.924044
| 2020-03-20T01:27:17
| 2020-03-20T01:27:17
| 175,997,740
| 0
| 0
| null | 2022-11-16T11:33:38
| 2019-03-16T16:42:09
|
Java
|
UTF-8
|
Java
| false
| false
| 372
|
java
|
package com.tianhy.study.reposervice;
import org.springframework.web.bind.annotation.*;
/**
* {@link}
*
* @Desc:
* @Author: thy
* @CreateTime: 2020/1/7 6:59
**/
@RestController
public class RepoController {
@PutMapping("/repo/{pid}")
public void repo(@PathVariable("pid") String pid) {
System.out.println("扣减库存商品:" + pid);
}
}
|
[
"1295029807@qq.com"
] |
1295029807@qq.com
|
5f04edd075f96feee72b81a904451d1902f696ec
|
a901abdca092650e0eb277f04c988200796b1d7d
|
/aart-main/AartDomain/src/main/java/edu/ku/cete/domain/property/Identifiable.java
|
7c2f66597274d31fe09141c50db40cc7cd6102ab
|
[] |
no_license
|
krishnamohankaruturi/secret
|
5acafbde49b9fa9e24f89534d14e7b01f863f775
|
4da83d113d3620d4c2c84002fecbe4bdd759c1a2
|
refs/heads/master
| 2022-03-24T22:09:41.325033
| 2019-11-15T12:14:07
| 2019-11-15T12:14:07
| 219,771,956
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 796
|
java
|
package edu.ku.cete.domain.property;
/**
* @author m802r921
* All AART database objects can optionally implement this.
* implementing this interface indicates that the implementing object has first order, 2nd order and
* 3rd order identifiers. This is in turn is leveraged in AART utility classes.
*
* CAUTION:- This overloads the getter of "id" and bean resolvers won't be
* able to find the getId() method.
* The same happens for restful calls also.
*/
public interface Identifiable {
/**
* @return get primary identifier.
*/
Long getId();
/**
* TODO rename this method so that it does not overload getId()
* @param order
* @return nth order identifier.
*/
Long getId(int order);
/**
* @param order
* @return
*/
String getStringIdentifier(int order);
}
|
[
"Venkatakrishna.k@CTL.local"
] |
Venkatakrishna.k@CTL.local
|
5613295c68ffc6cd119d261c14376e12a5aeae77
|
e392b4010fcba59e158598754be39f3b2b1ace12
|
/example_apps/AndroidStudioMinnie/sapphire/src/main/java/boofcv/alg/feature/detect/extract/GenericNonMaxAlgorithmTests.java
|
61c0cf6e7ffa88b3b28cd4aa1fc828ee9b3495a5
|
[
"MIT"
] |
permissive
|
bladestery/Sapphire
|
f5a0efb180fa9c70a159c3223622f3e9ec8e8bd9
|
5ad2132ebd760a0c842004186652427bc8f498e6
|
refs/heads/master
| 2021-01-11T23:36:36.141976
| 2017-06-16T04:02:29
| 2017-06-16T04:02:29
| 78,609,801
| 0
| 0
| null | 2017-01-11T06:32:11
| 2017-01-11T06:32:11
| null |
UTF-8
|
Java
| false
| false
| 7,126
|
java
|
/*
* Copyright (c) 2011-2016, Peter Abeles. All Rights Reserved.
*
* This file is part of BoofCV (http://boofcv.org).
*
* 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 boofcv.alg.feature.detect.extract;
import boofcv.alg.InputSanityCheck;
import boofcv.alg.misc.ImageMiscOps;
import boofcv.alg.misc.PixelMath;
import boofcv.struct.QueueCorner;
import boofcv.struct.image.GrayF32;
import georegression.struct.point.Point2D_I16;
import org.junit.Test;
import java.util.Random;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
/**
* Compares the results against a naive algorithm and other basic tests. More rigorous tests are part of the abstracted
* {@link boofcv.abst.feature.detect.extract.NonMaxSuppression} compliance tests.
*
* @author Peter Abeles
*/
public abstract class GenericNonMaxAlgorithmTests {
private ImageMiscOps IMO;
private static InputSanityCheck ISC;
Random rand = new Random(2134);
int width = 30;
int height = 40;
protected QueueCorner foundMinimum = new QueueCorner(100);
protected QueueCorner foundMaximum = new QueueCorner(100);
protected GrayF32 intensity = new GrayF32(width, height);
boolean canDetectMin;
boolean canDetectMax;
boolean strict;
protected GenericNonMaxAlgorithmTests(boolean strict, boolean canDetectMin, boolean canDetectMax ) {
this.strict = strict;
this.canDetectMin = canDetectMin;
this.canDetectMax = canDetectMax;
}
private void findLocalPeaks(GrayF32 intensity, float threshold, int radius, int border) {
foundMinimum.reset();
foundMaximum.reset();
findMaximums(intensity, threshold, radius, border, foundMinimum, foundMaximum);
}
public abstract void findMaximums(GrayF32 intensity, float threshold, int radius, int border,
QueueCorner foundMinimum, QueueCorner foundMaximum );
public void reset() {
IMO.fill(intensity, 0);
}
public void allStandard() {
checkDetectionRule();
compareToNaive();
checkBorderMaximum();
}
/**
* Makes sure that the border just defines the region in which an exteme can be found. If a pixel is within
* the exclusion zone and larger magnitude than a near by pixel inside, the inside pixel can't be an exteme
*/
@Test
public void checkBorderMaximum() {
if (canDetectMax)
checkBorderMaximum(1);
if( canDetectMin)
checkBorderMaximum(-1);
}
private void checkBorderMaximum( float sign ) {
reset();
intensity.set(0, 1, sign*90);
intensity.set(1, 1, sign*30);
// with no border (0,1) should be a peak
findLocalPeaks(intensity, 5, 1, 0);
if( sign > 0 ) {
assertEquals(0, foundMinimum.size);
assertEquals(1, foundMaximum.size);
} else {
assertEquals(1, foundMinimum.size);
assertEquals(0, foundMaximum.size);
}
// now with a border there should be no maximum. 30 gets knocked out because 90 is next to it
findLocalPeaks(intensity, 5, 1, 1);
assertEquals(0, foundMinimum.size);
assertEquals(0, foundMaximum.size);
}
/**
* Makes sure that features along the image border can be detected as an extreme
*/
@Test
public void checkCanDetectAlongImageBorder() {
if (canDetectMax)
checkCanDetectAlongImageBorder(1);
if( canDetectMin)
checkCanDetectAlongImageBorder(-1);
}
public void checkCanDetectAlongImageBorder( float sign ) {
reset();
intensity.set(width/2, 0, sign*90);
intensity.set(width/2, height-1, sign*90);
intensity.set(0, height/2, sign*90);
intensity.set(width-1, height/2, sign*90);
findLocalPeaks(intensity, 5, 2, 0);
if( sign > 0 ) {
assertEquals(0, foundMinimum.size);
assertEquals(4, foundMaximum.size);
} else {
assertEquals(4, foundMinimum.size);
assertEquals(0, foundMaximum.size);
}
}
@Test
public void checkDetectionRule() {
if (strict)
testStrictRule();
else
testNotStrictRule();
}
public void testStrictRule() {
reset();
intensity.set(3, 5, 30);
intensity.set(5, 7, 30);
intensity.set(7, 7, 30);
intensity.set(2, 5, -30);
intensity.set(4, 7, -30);
intensity.set(6, 7, -30);
// none of these points are a strict maximum
findLocalPeaks(intensity, 5, 2, 0);
assertEquals(0, foundMinimum.size);
assertEquals(0, foundMaximum.size);
}
public void testNotStrictRule() {
reset();
intensity.set(3, 5, 30);
intensity.set(3, 6, 30);
intensity.set(4, 5, 30);
intensity.set(2, 5, -30);
intensity.set(4, 7, -30);
intensity.set(6, 7, -30);
// none of these points are a strict maximum and all should be returned
findLocalPeaks(intensity, 5, 2, 0);
if( canDetectMin)
assertEquals(3, foundMinimum.size);
if( canDetectMax)
assertEquals(3, foundMaximum.size);
}
/**
* Compares output against naive algorithm. Checks for compliance with sub-images
*/
@Test
public void compareToNaive() {
GrayF32 inten = new GrayF32(30, 40);
QueueCorner naiveMin = new QueueCorner(inten.getWidth() * inten.getHeight());
QueueCorner naiveMax = new QueueCorner(inten.getWidth() * inten.getHeight());
for (int useSubImage = 0; useSubImage <= 1; useSubImage++) {
// make sure it handles sub images correctly
if (useSubImage == 1) {
GrayF32 larger = new GrayF32(inten.width + 10, inten.height + 8);
inten = larger.subimage(5, 5, inten.width + 5, inten.height + 5, null);
}
for (int nonMaxWidth = 3; nonMaxWidth <= 9; nonMaxWidth += 2) {
int radius = nonMaxWidth / 2;
NonMaxExtractorNaive reg = new NonMaxExtractorNaive(strict);
reg.setSearchRadius(radius);
reg.setThreshold(0.6f);
for (int i = 0; i < 10; i++) {
IMO.fillGaussian(inten, rand, 0, 3, -100, 100);
// detect the corners
findLocalPeaks(inten, 0.6f, radius, 0);
naiveMin.reset();naiveMax.reset();
reg.process(inten, naiveMax);
PixelMath.invert(inten, inten, ISC);
reg.process(inten, naiveMin);
// check the number of corners
if( canDetectMin ) {
assertTrue(foundMinimum.size() > 0);
assertEquals(naiveMin.size(), foundMinimum.size());
checkSamePoints(naiveMin,foundMinimum);
}
if( canDetectMax ) {
assertTrue(foundMaximum.size() > 0);
assertEquals(naiveMax.size(), foundMaximum.size());
checkSamePoints(naiveMax,foundMaximum);
}
}
}
}
}
private void checkSamePoints( QueueCorner list0 , QueueCorner list1 ) {
for (int j = 0; j < list0.size(); j++) {
Point2D_I16 b = list0.get(j);
boolean foundMatch = false;
for (int k = 0; k < list1.size(); k++) {
Point2D_I16 a = list1.get(k);
if (a.x == b.x && a.y == b.y) {
foundMatch = true;
break;
}
}
assertTrue(foundMatch);
}
}
}
|
[
"benbeyblade@hotmail.com"
] |
benbeyblade@hotmail.com
|
e7d4bdf4418bb766d7b77c877448cad61e9a7c63
|
30bf3463a07e2cb19d6a13d5a2ce2ce8dcdaabd9
|
/biblioteca/src/main/java/br/com/ifsp/es4a4/projeto/utils/interceptor/Interceptor.java
|
f18ec9dd6301963cbc2fec735bc2677ec0736768
|
[] |
no_license
|
leonarita/ProjetoES4A4
|
e1bf6da3a7714e1c2cce28080845078bc9c81915
|
1594ee2421c815659809d74f9a434faa8eabbc27
|
refs/heads/master
| 2023-04-14T17:45:44.086548
| 2021-04-29T02:55:20
| 2021-04-29T02:55:20
| 322,770,358
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,518
|
java
|
package br.com.ifsp.es4a4.projeto.utils.interceptor;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import br.com.ifsp.es4a4.projeto.utils.jwt.service.UserSecurityService;
import br.com.ifsp.es4a4.projeto.utils.routes.AllowAnnonymous;
import br.com.ifsp.es4a4.projeto.utils.routes.CacheAnnotedClasses;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Component
@RequiredArgsConstructor
public class Interceptor implements HandlerInterceptor {
private final UserSecurityService userSecurityService;
private final CacheAnnotedClasses cacheAnnotedClasses;
private static final Logger logger = LoggerFactory.getLogger(Interceptor.class);
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
try {
if(request.getAttribute("org.springframework.web.servlet.HandlerMapping.bestMatchingHandler").toString().startsWith("ResourceHttpRequestHandler")) {
return true;
}
HandlerMethod handlerMethod = (HandlerMethod)request.getAttribute("org.springframework.web.servlet.HandlerMapping.bestMatchingHandler");
//final AllowAnnonymous allowAnnonymousMethod = ((HandlerMethod)handler).getMethod().getAnnotation((AllowAnnonymous.class));
final AllowAnnonymous allowAnnonymousMethod = handlerMethod.getMethod().getAnnotation((AllowAnnonymous.class));
if( cacheAnnotedClasses.classHasAnonymousAnnotation(handlerMethod.getBeanType().toString().replace("class ", "")) || allowAnnonymousMethod != null )
return true;
if (validateToken(request.getHeader("Authorization"))) {
response.addHeader("Interceptor", "Authorization OK");
log.info("Autenticação válida e autorização permitida!");
return true;
}
response.addHeader("Interceptor", "Authorization Invalid");
log.error("Autenticação inválida e autorização não permitida!");
return false;
}
catch (Exception e) {
logger.error("Erro ao acessar endpoint: " + e.getMessage());
return false;
}
}
private Boolean validateToken(String authorization) {
if(this.userSecurityService.validate(authorization))
return Boolean.TRUE;
return Boolean.FALSE;
}
}
|
[
"leo_narita@hotmail.com"
] |
leo_narita@hotmail.com
|
50b9f21084803b68f7d534f63757c76f17613960
|
7f7cb7388a57b066b04ec863df7fe681515854c5
|
/src/main/java/com/klzan/p2p/model/PlatformCapital.java
|
24f3658ea386e8fbf2302f7768770995d7e92776
|
[] |
no_license
|
ybak/karazam-santian
|
9541fc0e02774ee5c5a27218a2639fbcb078ca93
|
dbd905913b9b6273d2028853d14396b0adc01ccc
|
refs/heads/master
| 2021-03-24T01:10:59.376527
| 2018-05-27T03:45:28
| 2018-05-27T03:45:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,008
|
java
|
package com.klzan.p2p.model;
import com.klzan.p2p.enums.CapitalMethod;
import com.klzan.p2p.enums.CapitalType;
import com.klzan.p2p.model.base.BaseModel;
import javax.persistence.*;
import java.math.BigDecimal;
/**
* 平台资金
*/
@Entity
@Table(name = "karazam_platform_capital")
public class PlatformCapital extends BaseModel {
/**
* 类型
*/
@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 50)
private CapitalType type;
/**
* 方式
*
*/
@Enumerated(EnumType.STRING)
@Column(nullable = false, length = 50)
private CapitalMethod method;
/**
* 收入
*/
@Column(precision = 16, scale = 2)
private BigDecimal credit;
/**
* 支出
*/
@Column(precision = 16, scale = 2)
private BigDecimal debit;
/**
* 关联资金记录ID
*/
private Integer userFinanceId;
/**
* 备注
*/
private String memo;
/**
* 操作人
*/
private String operator;
/**
* IP
*/
private String ip;
/**
* 订单号
*/
@Column(updatable = false, length = 100)
private String orderNo;
public PlatformCapital() {
}
public PlatformCapital(CapitalType type, CapitalMethod method, BigDecimal credit, BigDecimal debit, Integer userFinanceId, String memo, String operator, String ip, String orderNo) {
this.type = type;
this.method = method;
this.credit = credit;
this.debit = debit;
this.userFinanceId = userFinanceId;
this.memo = memo;
this.operator = operator;
this.ip = ip;
this.orderNo = orderNo;
}
public CapitalType getType() {
return type;
}
public void setType(CapitalType type) {
this.type = type;
}
public CapitalMethod getMethod() {
return method;
}
public void setMethod(CapitalMethod method) {
this.method = method;
}
public BigDecimal getCredit() {
return credit;
}
public void setCredit(BigDecimal credit) {
this.credit = credit;
}
public BigDecimal getDebit() {
return debit;
}
public void setDebit(BigDecimal debit) {
this.debit = debit;
}
public Integer getUserFinanceId() {
return userFinanceId;
}
public void setUserFinanceId(Integer userFinanceId) {
this.userFinanceId = userFinanceId;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public String getOperator() {
return operator;
}
public void setOperator(String operator) {
this.operator = operator;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getOrderNo() {
return orderNo;
}
public void setOrderNo(String orderNo) {
this.orderNo = orderNo;
}
}
|
[
"1922448115@qq.com"
] |
1922448115@qq.com
|
b9ffa1b97a66baa81691c1c91fc79af555044cb3
|
8ec69fe6574ce6cb40ad97801a8299000581c869
|
/projects/batfish/src/batfish/representation/juniper/CommunityMemberList.java
|
f7ff169a685c3547b8dfd64754a47d51e646edef
|
[
"Apache-2.0"
] |
permissive
|
karthikBG/batfish
|
f7e1c7a16b11f6f9d84d236022bed47144575fea
|
db62d4eb904df1893420ad9a9929f37d5b487560
|
refs/heads/master
| 2021-01-18T16:00:49.231078
| 2014-12-10T03:21:04
| 2014-12-10T03:21:22
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 795
|
java
|
package batfish.representation.juniper;
import java.util.List;
public class CommunityMemberList {
private String _name;
private List<CommunityMemberListLine> _communityIds;
/* ------------------------------ Constructor ----------------------------*/
public CommunityMemberList(String n, List<CommunityMemberListLine> cs) {
_name = n;
_communityIds = cs;
}
/* ----------------------------- Other Methods ---------------------------*/
/* ---------------------------- Getters/Setters --------------------------*/
public List<CommunityMemberListLine> get_communityIds() {
return _communityIds;
}
public String get_name() {
return _name;
}
/* --------------------------- Inherited Methods -------------------------*/
}
|
[
"arifogel@ucla.edu"
] |
arifogel@ucla.edu
|
3523aa5aaebe778e42ddc9080766f3ba99df5609
|
42b68636b37a1804d193a9c70dc83e33e060da61
|
/src/in/ac/iitb/glossary/GlossaryDocumentCreateException.java
|
75db758950585a815b600e56db161af37e0ff778
|
[] |
no_license
|
kulashish/GlossaryDocument
|
102137d22104c4284f552c477fab118013d98c43
|
65f7d71fd10769504b80490a3f01c989198bcac5
|
refs/heads/master
| 2021-01-01T20:41:58.342799
| 2012-06-14T11:33:20
| 2012-06-14T11:33:20
| 4,570,585
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 169
|
java
|
package in.ac.iitb.glossary;
public class GlossaryDocumentCreateException extends Exception {
public GlossaryDocumentCreateException(Throwable e) {
super(e);
}
}
|
[
"kulashish@gmail.com"
] |
kulashish@gmail.com
|
7d32e307fc05046cc448a8834d828bfbe06835f4
|
3df2c0132487b6fff67fe2bcbf6dfa127d2cfb0b
|
/src/lectures/arrays/ArraysExample.java
|
800efb72e24af0bc6dc2217f704385111b3920d4
|
[] |
no_license
|
Dnam00/JavaTeaching
|
e899df112324c6b390d7f46f3113804a98152e9e
|
68647445ad774cbaabac9c154eb31b7bf8115a8b
|
refs/heads/master
| 2023-05-04T18:38:20.750596
| 2021-05-15T21:53:42
| 2021-05-15T21:53:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,176
|
java
|
package lectures.arrays;
import lectures.extra.ALoan;
import lectures.extra.AnotherLoan;
import lectures.extra.Loan;
import lectures.interfaces.ABMISpreadsheet;
import lectures.interfaces.ALoopingFactorialSpreadsheet;
import lectures.interfaces.ARecursiveFactorialSpreadsheet;
import lectures.interfaces.BMISpreadsheet;
import lectures.interfaces.FactorialSpreadsheet;
import lectures.interfaces.extra.AnotherBMISpreadsheet;
public class ArraysExample {
// initialized arrays
int[] assignmentScores = {100, 98, 99, 100, 90, 80};
double[] gpas = {3.8, 3.1, 3.7, 3.1, 3.6, 3.9};
String[] initials = {"JFK", "FDR", "JC", "BC", "RR", "GB"};
FactorialSpreadsheet[] factorialSpreadsheets = {
new ALoopingFactorialSpreadsheet(),
new ARecursiveFactorialSpreadsheet()};
int[] unInitializedAssignmentScores;
int[] assignmentScoresWithUninitializedElements = new int[3];
String[] initialsWithUninitializedElements = new String[3];
public void assignNewArrayWithDifferentSize() {
assignmentScores = new int[] {60, 40, 50};
}
public void operateOnArrays() {
assignmentScores = new int[] {60, 40, 50};
System.out.println (
initials.length + " " +
initials[0] + " " + " " +
initials[initials.length - 1]);
initials[0] = "HT";
}
public void causeArrayIndexOutOfBoundsException() {
initials[initials.length] = "HT";
}
public void initializeAfterDeclaration() {
int[] assignmentScores;
unInitializedAssignmentScores = new int[] {60, 40, 50};
}
public void accessUninitializedArray () {
System.out.println(unInitializedAssignmentScores.length);
}
public void accessUninitializedPrimitiveArrayElements () {
System.out.println(assignmentScoresWithUninitializedElements.length);
System.out.println(assignmentScoresWithUninitializedElements[0]);
System.out.println(assignmentScoresWithUninitializedElements[0]);
}
public void accessUninitializedObjectArrayElements () {
System.out.println(initialsWithUninitializedElements[0]);
System.out.println(initialsWithUninitializedElements[0].length());
}
public static void main (String[] anArgs) {
}
}
|
[
"dewan@cs.unc.edu"
] |
dewan@cs.unc.edu
|
10c1f3d8dab34d0de732804f990e9ced164bcf70
|
d8c5f1d5f5b7d222834d233db26d8b03e37bdfa3
|
/clients/kratos/java/src/main/java/sh/ory/kratos/model/AdminCreateSelfServiceRecoveryLinkBody.java
|
0a4ed20fe9a5d89b3ba14e8d39d27c6668a8548c
|
[
"Apache-2.0"
] |
permissive
|
kolotaev/sdk
|
31a9585720c3649b8830cf054fc7e404abe8e588
|
0dda1becd70be8d7b9d678321ebe780c1ba00485
|
refs/heads/master
| 2023-07-09T21:36:44.459798
| 2021-08-17T09:05:22
| 2021-08-17T09:05:22
| 397,220,777
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,010
|
java
|
/*
* Ory Kratos API
* Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.
*
* The version of the OpenAPI document: v0.7.1-alpha.1
* Contact: hi@ory.sh
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package sh.ory.kratos.model;
import java.util.Objects;
import java.util.Arrays;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
import java.util.UUID;
/**
* AdminCreateSelfServiceRecoveryLinkBody
*/
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2021-07-22T18:06:07.711120196Z[Etc/UTC]")
public class AdminCreateSelfServiceRecoveryLinkBody {
public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in";
@SerializedName(SERIALIZED_NAME_EXPIRES_IN)
private String expiresIn;
public static final String SERIALIZED_NAME_IDENTITY_ID = "identity_id";
@SerializedName(SERIALIZED_NAME_IDENTITY_ID)
private UUID identityId;
public AdminCreateSelfServiceRecoveryLinkBody expiresIn(String expiresIn) {
this.expiresIn = expiresIn;
return this;
}
/**
* Link Expires In The recovery link will expire at that point in time. Defaults to the configuration value of `selfservice.flows.recovery.request_lifespan`.
* @return expiresIn
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "Link Expires In The recovery link will expire at that point in time. Defaults to the configuration value of `selfservice.flows.recovery.request_lifespan`.")
public String getExpiresIn() {
return expiresIn;
}
public void setExpiresIn(String expiresIn) {
this.expiresIn = expiresIn;
}
public AdminCreateSelfServiceRecoveryLinkBody identityId(UUID identityId) {
this.identityId = identityId;
return this;
}
/**
* Get identityId
* @return identityId
**/
@ApiModelProperty(required = true, value = "")
public UUID getIdentityId() {
return identityId;
}
public void setIdentityId(UUID identityId) {
this.identityId = identityId;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
AdminCreateSelfServiceRecoveryLinkBody adminCreateSelfServiceRecoveryLinkBody = (AdminCreateSelfServiceRecoveryLinkBody) o;
return Objects.equals(this.expiresIn, adminCreateSelfServiceRecoveryLinkBody.expiresIn) &&
Objects.equals(this.identityId, adminCreateSelfServiceRecoveryLinkBody.identityId);
}
@Override
public int hashCode() {
return Objects.hash(expiresIn, identityId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class AdminCreateSelfServiceRecoveryLinkBody {\n");
sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n");
sb.append(" identityId: ").append(toIndentedString(identityId)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
|
[
"3372410+aeneasr@users.noreply.github.com"
] |
3372410+aeneasr@users.noreply.github.com
|
863886cea78d8d433a62a76bc7dde8687893fd04
|
11ed2e3e853eaea0b3dc4c95e7cd06c8787e3a48
|
/src/main/java/gov/step/app/repository/search/HrEmpAwardInfoSearchRepository.java
|
812396d0b6b905ae672c148f45f830d1d4e57e56
|
[] |
no_license
|
JCN-DEV/master
|
3337a51dac56c61b75e4a31fea440ef36f6698c1
|
f9c456fde8c1f682cff851b3bcd0c9051f53da0d
|
refs/heads/master
| 2021-01-11T15:35:51.197579
| 2017-02-11T06:53:19
| 2017-02-11T06:53:19
| 81,628,866
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 352
|
java
|
package gov.step.app.repository.search;
import gov.step.app.domain.HrEmpAwardInfo;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
/**
* Spring Data ElasticSearch repository for the HrEmpAwardInfo entity.
*/
public interface HrEmpAwardInfoSearchRepository extends ElasticsearchRepository<HrEmpAwardInfo, Long> {
}
|
[
"rana@devlead"
] |
rana@devlead
|
47e659edcaed7b2b43f80feb633938e26af8699b
|
140e5dd4d5e721958f0f0673db0adfff8d3e100b
|
/src/main/java/minecrafttransportsimulator/entities/instances/PartEffector.java
|
1028b26fdbf6ff30074287a3a15861cf7f97cacb
|
[] |
no_license
|
helpmegetaname/MinecraftTransportSimulator
|
c1c210fb8f662a0d1d3cd9f236f98c27b386e731
|
8a83280c24e28fc44416eb86ea0bac6076c2760d
|
refs/heads/master
| 2023-08-26T20:54:33.498839
| 2021-10-30T01:29:08
| 2021-10-30T01:29:08
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,939
|
java
|
package minecrafttransportsimulator.entities.instances;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import minecrafttransportsimulator.baseclasses.BoundingBox;
import minecrafttransportsimulator.baseclasses.Point3d;
import minecrafttransportsimulator.entities.components.AEntityE_Multipart;
import minecrafttransportsimulator.jsondefs.JSONPart.InteractableComponentType;
import minecrafttransportsimulator.jsondefs.JSONPartDefinition;
import minecrafttransportsimulator.mcinterface.WrapperNBT;
import minecrafttransportsimulator.packets.components.InterfacePacket;
import minecrafttransportsimulator.packets.instances.PacketPartEffector;
import net.minecraft.item.ItemStack;
public class PartEffector extends APart{
private final List<ItemStack> drops = new ArrayList<ItemStack>();
//Variables used for drills.
public int blocksBroken;
private final Point3d flooredCenter = new Point3d();
private final Map<BoundingBox, Point3d> boxLastPositionsFloored = new HashMap<BoundingBox, Point3d>();
private final Map<BoundingBox, Integer> boxTimeSpentAtPosition = new HashMap<BoundingBox, Integer>();
private final Set<Point3d> blockFlooredPositionsBrokeThisTick = new HashSet<Point3d>()
;
public PartEffector(AEntityE_Multipart<?> entityOn, JSONPartDefinition placementDefinition, WrapperNBT data, APart parentPart){
super(entityOn, placementDefinition, data, parentPart);
this.blocksBroken = data.getInteger("blocksBroken");
}
@Override
public boolean update(){
if(super.update()){
//If we are active, do effector things.
if(isActive && !world.isClient()){
drops.clear();
blockFlooredPositionsBrokeThisTick.clear();
for(BoundingBox box : entityCollisionBoxes){
switch(definition.effector.type){
case FERTILIZER: {
//Search all inventories for fertilizer and try to use it.
for(APart part : entityOn.parts){
if(part instanceof PartInteractable && part.definition.interactable.interactionType.equals(InteractableComponentType.CRATE) && part.definition.interactable.feedsVehicles){
EntityInventoryContainer inventory = ((PartInteractable) part).inventory;
for(int i=0; i<inventory.getSize(); ++i){
ItemStack stack = inventory.getStack(i);
if(world.fertilizeBlock(box.globalCenter, stack)){
inventory.removeItems(i, 1, true);
break;
}
}
}
}
break;
}
case HARVESTER: {
//Harvest drops, and add to inventories.
drops.addAll(world.harvestBlock(box.globalCenter));
break;
}
case PLANTER: {
//Search all inventories for seeds and try to plant them.
for(APart part : entityOn.parts){
if(part instanceof PartInteractable && part.definition.interactable.interactionType.equals(InteractableComponentType.CRATE) && part.definition.interactable.feedsVehicles){
EntityInventoryContainer inventory = ((PartInteractable) part).inventory;
for(int i=0; i<inventory.getSize(); ++i){
ItemStack stack = inventory.getStack(i);
if(world.plantBlock(box.globalCenter, stack)){
inventory.removeItems(i, 1, true);
break;
}
}
}
}
break;
}
case PLOW:{
if(world.plowBlock(box.globalCenter)){
//Harvest blocks on top of this block in case they need to be dropped.
List<ItemStack> harvestedDrops = world.harvestBlock(box.globalCenter);
if(!harvestedDrops.isEmpty()){
for(ItemStack stack : harvestedDrops){
if(stack.getCount() > 0){
world.spawnItemStack(stack, position);
}
}
}
}
break;
}
case SNOWPLOW:{
world.removeSnow(box.globalCenter);
break;
}
case DRILL:{
if(!world.isAir(box.globalCenter)){
float blockHardness = world.getBlockHardness(box.globalCenter);
if(blockHardness <= definition.effector.drillHardness){
if(!boxLastPositionsFloored.containsKey(box)){
boxLastPositionsFloored.put(box, new Point3d());
boxTimeSpentAtPosition.put(box, 0);
}
flooredCenter.set(Math.floor(box.globalCenter.x), Math.floor(box.globalCenter.y), Math.floor(box.globalCenter.z));
if(boxLastPositionsFloored.get(box).equals(flooredCenter) && !blockFlooredPositionsBrokeThisTick.contains(flooredCenter)){
int timeSpentBreaking = boxTimeSpentAtPosition.get(box);
if(timeSpentBreaking >= definition.effector.drillSpeed*blockHardness/definition.effector.drillHardness){
drops.addAll(world.getBlockDrops(flooredCenter));
world.destroyBlock(flooredCenter, false);
boxTimeSpentAtPosition.put(box, 0);
blockFlooredPositionsBrokeThisTick.add(flooredCenter.copy());
if(++blocksBroken == definition.effector.drillDurability){
this.isValid = false;
}else{
InterfacePacket.sendToAllClients(new PacketPartEffector(this));
}
}else{
boxTimeSpentAtPosition.put(box, timeSpentBreaking + 1);
}
break;
}
boxLastPositionsFloored.put(box, flooredCenter.copy());
}
}
boxTimeSpentAtPosition.put(box, 0);
break;
}
}
//Handle any drops we got from our effector.
if(!drops.isEmpty()){
Iterator<ItemStack> iterator = drops.iterator();
while(iterator.hasNext()){
ItemStack dropStack = iterator.next();
for(APart part : entityOn.parts){
if(part instanceof PartInteractable && part.definition.interactable.interactionType.equals(InteractableComponentType.CRATE)){
if(((PartInteractable) part).inventory.addStack(dropStack, true) == dropStack.getCount()){
iterator.remove();
break;
}
}
}
}
//Check our drops. If we couldn't add any of them to any inventory, drop them on the ground instead.
for(ItemStack stack : drops){
world.spawnItemStack(stack, position);
}
}
}
}
return true;
}else{
return false;
}
}
@Override
public double getRawVariableValue(String variable, float partialTicks){
switch(variable){
case("effector_active"): return isActive ? 1 : 0;
case("effector_drill_broken"): return blocksBroken;
case("effector_drill_max"): return definition.effector.drillDurability;
case("effector_drill_percentage"): return blocksBroken/(double)definition.effector.drillDurability;
}
return super.getRawVariableValue(variable, partialTicks);
}
@Override
public WrapperNBT save(WrapperNBT data){
super.save(data);
data.setInteger("blocksBroken", blocksBroken);
return data;
}
}
|
[
"rapscallion827@gmail.com"
] |
rapscallion827@gmail.com
|
ff353d2d9747ae45b9ac2f52c632303b7c016a47
|
b6fc979935dfa41c4de283e21508c93c36586559
|
/src/main/java/org/ssssssss/script/convert/BooleanImplicitConvert.java
|
48720b309020b3c0d27b7f3e73b1e2fe07be8fbd
|
[
"MIT"
] |
permissive
|
bluegitter/magic-script
|
60c71dfa5576603bff00fa823a6295ac18194d68
|
59fcae8c5e8c30bf474284f7fb339146db3e446f
|
refs/heads/master
| 2023-07-20T08:12:49.186346
| 2021-08-08T02:38:47
| 2021-08-08T02:38:47
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 406
|
java
|
package org.ssssssss.script.convert;
import org.ssssssss.script.parsing.ast.literal.BooleanLiteral;
public class BooleanImplicitConvert implements ClassImplicitConvert{
@Override
public boolean support(Class<?> from, Class<?> to) {
return to == Boolean.class || to == boolean.class;
}
@Override
public Object convert(Object source, Class<?> target) {
return BooleanLiteral.isTrue(source);
}
}
|
[
"838425805@qq.com"
] |
838425805@qq.com
|
e0f8c5fa32b1f98b50a7b90c22372d47dea3c9f0
|
e0c4ff78565b6db4e59869a5b4317473b6197372
|
/java01t/src/net/bitacademy/java72/step06/v09/BoardDao.java
|
79c6e0bc0afb6e2db77f392f311f42891d4b3ce0
|
[] |
no_license
|
eomjinyoung/Java72
|
5ca8bac37974085b07d23559788ef3430f2416ca
|
b584aee7a673aaa9a6eac5749682993c25715055
|
refs/heads/master
| 2016-08-07T09:45:41.243648
| 2015-12-01T14:31:39
| 2015-12-01T14:31:39
| 38,226,378
| 8
| 6
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,870
|
java
|
package net.bitacademy.java72.step06.v09;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
public class BoardDao {
DBConnectionPool dbPool;
public BoardDao(DBConnectionPool dbPool) {
this.dbPool = dbPool;
}
public List<Board> list() {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = dbPool.getConnection();
stmt = con.createStatement();
rs = stmt.executeQuery(
"SELECT bno,title,cre_dt,views"
+ " FROM board10"
+ " ORDER BY bno desc");
ArrayList<Board> boards = new ArrayList<Board>();
Board board = null;
while (rs.next()) {
board = new Board();
board.setNo(rs.getInt("bno"));
board.setTitle(rs.getString("title"));
board.setCreateDate(rs.getDate("cre_dt"));
board.setViewCount(rs.getInt("views"));
boards.add(board);
}
return boards;
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
try {rs.close();} catch (Exception e) {}
try {stmt.close();} catch (Exception e) {}
dbPool.returnConnection(con);
}
}
public void delete(String no) {
Connection con = null;
Statement stmt = null;
try {
con = dbPool.getConnection();
stmt = con.createStatement();
int count = stmt.executeUpdate(
"DELETE FROM board10 WHERE bno=" + no);
System.out.printf("삭제 완료!: %d\n", count);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {stmt.close();} catch (Exception e) {}
dbPool.returnConnection(con);
}
}
public int update(Board board) {
Connection con = null;
PreparedStatement stmt = null;
try {
con = dbPool.getConnection();
stmt = con.prepareStatement(
"UPDATE board10 SET title=?,content=? WHERE bno=?");
stmt.setString(1, board.getTitle());
stmt.setString(2, board.getContent());
stmt.setInt(3, board.getNo());
return stmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
return 0;
} finally {
try {stmt.close();} catch (Exception e) {}
dbPool.returnConnection(con);
}
}
public int insert(Board board) {
Connection con = null;
PreparedStatement stmt = null;
try {
con = dbPool.getConnection();
stmt = con.prepareStatement(
"INSERT INTO board10(title,content,pwd,cre_dt)"
+ " values(?, ?, ?, now())");
stmt.setString(1, board.getTitle());
stmt.setString(2, board.getContent());
stmt.setString(3, board.getPassword());
return stmt.executeUpdate();
} catch (Exception e) {
e.printStackTrace();
return 0;
} finally {
try {stmt.close();} catch (Exception e) {}
dbPool.returnConnection(con);
}
}
public Board get(int no) {
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
try {
con = dbPool.getConnection();
stmt = con.createStatement();
rs = stmt.executeQuery(
"SELECT bno,title,content"
+ " FROM board10"
+ " WHERE bno=" + no);
Board board = null;
if (rs.next()) {
board = new Board();
board.setNo(rs.getInt("bno"));
board.setTitle(rs.getString("title"));
board.setContent(rs.getString("content"));
}
return board;
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
try {rs.close();} catch (Exception e) {}
try {stmt.close();} catch (Exception e) {}
dbPool.returnConnection(con);
}
}
}
|
[
"jinyoung.eom@gmail.com"
] |
jinyoung.eom@gmail.com
|
d2fc615618a829344cb929155fbb5a6f8c4589d3
|
5a027c7a6d9afc1bbc8b2bc86e43e96b80dd9fa8
|
/workspace_movistar_wl11/zejbComunClient/utiles/com/telefonica_chile/atiempo/utiles/BuscadorPeticionUtiles.java
|
19b7ec74ab52eae3ca204adca5e5c4119bf6c881
|
[] |
no_license
|
alexcamp/ArrobaTiempoGradle
|
00135dc6f101e99026a377adc0d3b690cb5f2bd7
|
fc4a845573232e332c5f1211b72216ce227c3f38
|
refs/heads/master
| 2020-12-31T00:18:57.337668
| 2016-05-27T15:02:04
| 2016-05-27T15:02:04
| 59,520,455
| 0
| 0
| null | null | null | null |
ISO-8859-1
|
Java
| false
| false
| 4,903
|
java
|
/*
* CR - 00027016 - Jul 1, 2009
* Clase auxiliar que contiene metodos utiles para la busqueda de peticiones - German P.
*/
package com.telefonica_chile.atiempo.utiles;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import co.com.atiempo.dto.BuscadorPeticionVpiDTO;
import co.com.atiempo.dto.DominioTipoPcDTO;
/**
* @author 810884
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class BuscadorPeticionUtiles {
public static final int COD_PETICION = 1;
public static final int COD_IDENTIFICADOR_CLIENTE = 2;
public static final int COD_IDENTIFICADOR_PC_LINEA = 3;
public static final int COD_IDENTIFICADOR_PC_TV = 4;
public static final int COD_IDENTIFICADOR_PC_IC = 5;
public static final int COD_BUSCADOR_VPI = 6;
public static final int COD_BUSCADOR_GES_OS = 7;
public static final int COD_BUSCADOR_OUTBOUND = 8;
public static final int COD_BUSCADOR_INBOUND = 9;
public static final int COD_BUSCADOR_INSTALAR_EQUIPOS = 10;
public static final int COD_BUSCADOR_RECOGIDA_EQUIPOS = 11;
public static int obtenerCodigoConsulta(Long idPeticionAtis, String rutCli, String rutDv, String idPc, int typePc){
int cod = -1;
if (idPeticionAtis != null){
cod = COD_PETICION;
}else if(!rutCli.equals("") || !rutDv.equals("")){
cod = COD_IDENTIFICADOR_CLIENTE;
}else if(idPc!=null && !idPc.equals("")){ //cambio validación para corregir full scan - Gustavo
if (typePc == 1){
cod = COD_IDENTIFICADOR_PC_LINEA;
}else if (typePc == 2){
cod = COD_IDENTIFICADOR_PC_TV;
}else if (typePc == 3){
cod = COD_IDENTIFICADOR_PC_IC;
}
}
return cod;
}
public static String mensajeResultado (BuscadorPeticionVpiDTO buscadorPeticionVpiDTO){
int codigo = buscadorPeticionVpiDTO.getIdBusqueda();
Long idPeticionAtis = buscadorPeticionVpiDTO.getIdPeticionAtis();
String rutCli = buscadorPeticionVpiDTO.getRutCli();
String rutDv = buscadorPeticionVpiDTO.getRutDv();
String idPc = buscadorPeticionVpiDTO.getIdPc();
String mens = "";
switch (codigo){
case COD_PETICION:
mens = "Listado de Peticiones encontradas para Petición " + idPeticionAtis + "";
break;
case COD_IDENTIFICADOR_CLIENTE:
mens = "Listado de Peticiones encontradas para Cliente " + rutCli + "-" + rutDv + "";
break;
case COD_IDENTIFICADOR_PC_LINEA:
mens = "Listado de Peticiones encontradas para PC - LINEA " + idPc + "";
break;
case COD_IDENTIFICADOR_PC_TV:
mens = "Listado de Peticiones encontradas para PC - TV " + idPc + "";
break;
case COD_IDENTIFICADOR_PC_IC:
mens = "Listado de Peticiones encontradas para PC - IC " + idPc + "";
break;
}
return mens;
}
public static String mensajeResultadoVacio (BuscadorPeticionVpiDTO buscadorPeticionVpiDTO){
int codigo = buscadorPeticionVpiDTO.getIdBusqueda();
Long idPeticionAtis = buscadorPeticionVpiDTO.getIdPeticionAtis();
String rutCli = buscadorPeticionVpiDTO.getRutCli();
String rutDv = buscadorPeticionVpiDTO.getRutDv();
String idPc = buscadorPeticionVpiDTO.getIdPc();
String mens = "";
switch (codigo){
case COD_PETICION:
mens = "No se encontraron Peticiones para Petición [" + idPeticionAtis + "]";
break;
case COD_IDENTIFICADOR_CLIENTE:
mens = "No se encontraron Peticiones para Cliente [" + rutCli + "-" + rutDv + "]";
break;
case COD_IDENTIFICADOR_PC_LINEA:
mens = "No se encontraron Peticiones para PC - LINEA [" + idPc + "]";
break;
case COD_IDENTIFICADOR_PC_TV:
mens = "No se encontraron Peticiones para PC - TV [" + idPc + "]";
break;
case COD_IDENTIFICADOR_PC_IC:
mens = "No se encontraron Peticiones para PC - IC [" + idPc + "]";
break;
}
return mens;
}
public static List mensajeSugerencias (BuscadorPeticionVpiDTO busquedaPeticionDTO){
List listaSugerencias = null;
int codigo = busquedaPeticionDTO.getIdBusqueda();
boolean limiteAlcanzado = busquedaPeticionDTO.isLimiteAlcanzado();
if (limiteAlcanzado){
listaSugerencias = new ArrayList();
String mensLimite = "Se llegó al limite (" + busquedaPeticionDTO.getLimitePeticiones() + ") de visualización, existen mas peticiones coincidentes que no se visualizan";
listaSugerencias.add(mensLimite);
if (codigo == COD_PETICION || codigo == COD_IDENTIFICADOR_CLIENTE){
String mens = "Utilice el filtro Identificador PC para reducir la cantidad de peticiones coincidentes";
listaSugerencias.add(mens);
}
}
return listaSugerencias;
}
public static void cargarComboTipoPc(HttpServletRequest request){
List ls = new ArrayList();
ls.add(new DominioTipoPcDTO("1","Linea"));
ls.add(new DominioTipoPcDTO("2","Tv"));
ls.add(new DominioTipoPcDTO("3","IC (PCs)"));
request.setAttribute("comboTipoPc", ls);
}
}
|
[
"alexander5075@hotmail.com"
] |
alexander5075@hotmail.com
|
1abcf8322779d7126343b6ca96fee3b3ca63e82b
|
0d06e8e3d655f68b41a86561baf3aef0008368f5
|
/tenio-core/src/main/java/com/tenio/core/entity/annotation/Entity.java
|
362d8edcd30ad0cbefc7c079c5db96ad666d607a
|
[
"MIT"
] |
permissive
|
wasabmyan/tenio
|
ca539e0d0daa1ee3e09d945cc37c2a0ab5807af9
|
e3551bd36b6465e03f037de28260981043919b2a
|
refs/heads/master
| 2023-07-06T07:59:38.439931
| 2020-07-01T23:43:53
| 2020-07-01T23:43:53
| 285,201,798
| 0
| 0
|
MIT
| 2021-07-07T20:38:17
| 2020-08-05T06:33:35
| null |
UTF-8
|
Java
| false
| false
| 1,472
|
java
|
/*
The MIT License
Copyright (c) 2016-2020 kong <congcoi123@gmail.com>
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.tenio.core.entity.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* This annotation is treated as a "Table".
*
* @author kong
*
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Entity {
}
|
[
"congcoi123@gmail.com"
] |
congcoi123@gmail.com
|
8cc4338f9a295101fa5e07082fa60ff20020bdc4
|
9410dce51573400952f575760946a4f14c3813ff
|
/WebApp-Build/src/com/server/Person.java
|
ddb56fc43be477fca3b7bea3eb85119c17c45cf1
|
[] |
no_license
|
pbadhe34/Ant-Web-Build
|
75a10613ddc0b873b1a24a8b45b6eeb896adbb0d
|
2ee44e5ebe2b923fcbe6a8b7b71e83051dada47d
|
refs/heads/master
| 2021-06-27T06:22:34.656704
| 2017-09-13T11:09:21
| 2017-09-13T11:09:21
| 103,380,264
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,035
|
java
|
package com.server;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
/**
* Entity bean with JPA annotations
* Hibernate provides JPA implementation *
*
*/
@Entity
@Table(name="PersonTable")
public class Person {
@Id
@Column(name="id")
@GeneratedValue(strategy=GenerationType.AUTO)
private int id;
private String name;
private String country;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCountry() {
System.out.println("The Person get Country");
return country;
}
public void setCountry(String country) {
System.out.println("The Person set Country");
this.country = country;
}
@Override
public String toString(){
return "id="+id+", name="+name+", country="+country;
}
}
|
[
"prakash.badhe@agilesoft.in"
] |
prakash.badhe@agilesoft.in
|
b5fe3759a49d26a056a21f9c1014bb6b5ced4017
|
2c46d89ba6a49eea9f63d782561fd29bcf87daa1
|
/src/com/javaex/ex04/Ex08.java
|
8a53d6d569a2f52d9d961b23296aee0bec20ecfe
|
[] |
no_license
|
JeongYunu/chapter01
|
1c2ba365f4d01b2741715d5d677682d6106d8f64
|
9d23bea92abb57a404ebf1403b9fc0c515869381
|
refs/heads/master
| 2023-05-12T13:56:56.732936
| 2021-06-01T09:01:36
| 2021-06-01T09:01:36
| 370,630,968
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 670
|
java
|
package com.javaex.ex04;
import java.util.Scanner;
public class Ex08 {
public static void main(String[] args) {
boolean action = true;
Scanner sc = new Scanner(System.in);
while(action) {
System.out.println("숫자를 입력하세요.");
int num = sc.nextInt();
if(num==0) {
System.out.println("비밀을 알아냈구나?");
System.out.println("종료");
action = false;
}else if(num%3==0) {
System.out.println("3의 배수입니다.");
}else {
System.out.println("3의 배수가 아닙니다.");
}
System.out.println("************");
}
sc.close();
}
}
|
[
"oa8859@gmail.com"
] |
oa8859@gmail.com
|
e390e57e4a8b381a956deb32e86156748e65a963
|
f5d5b368c1ae220b59cfb26bc26526b494c54d0e
|
/PhoneCallBlocker/src/com/iqrasys/callblocker/model/SimpleHttpClient.java
|
3eb597ed354da13adaaf51c7e143f41457d08dbf
|
[] |
no_license
|
kishordgupta/2012_bkup
|
3778c26082697b1cf223e27822d8efe90b35fc76
|
53ef4014fb3e11158c3f9242cb1f829e02e3ef69
|
refs/heads/master
| 2021-01-10T08:25:57.122415
| 2020-10-16T12:06:52
| 2020-10-16T12:06:52
| 47,512,520
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,569
|
java
|
package com.iqrasys.callblocker.model;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URI;
import java.util.ArrayList;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.conn.params.ConnManagerParams;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
public class SimpleHttpClient {
/** The time it takes for our client to timeout */
public static final int HTTP_TIMEOUT = 30 * 1000; // milliseconds
/** Single instance of our HttpClient */
private static HttpClient mHttpClient;
/**
* Get our single instance of our HttpClient object.
*
* @return an HttpClient object with connection parameters set
*/
private static HttpClient getHttpClient() {
if (mHttpClient == null) {
mHttpClient = new DefaultHttpClient();
final HttpParams params = mHttpClient.getParams();
HttpConnectionParams.setConnectionTimeout(params, HTTP_TIMEOUT);
HttpConnectionParams.setSoTimeout(params, HTTP_TIMEOUT);
ConnManagerParams.setTimeout(params, HTTP_TIMEOUT);
}
return mHttpClient;
}
/**
* Performs an HTTP Post request to the specified url with the specified
* parameters.
*
* @param url
* The web address to post the request to
* @param postParameters
* The parameters to send via the request
* @return The result of the request
* @throws Exception
*/
public static String executeHttpPost(String url,
ArrayList<NameValuePair> postParameters) throws Exception {
BufferedReader in = null;
try {
HttpClient client = getHttpClient();
HttpPost request = new HttpPost(url);
UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(
postParameters);
request.setEntity(formEntity);
HttpResponse response = client.execute(request);
in = new BufferedReader(new InputStreamReader(response.getEntity()
.getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
String result = sb.toString();
return result;
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* Performs an HTTP GET request to the specified url.
*
* @param url
* The web address to post the request to
* @return The result of the request
* @throws Exception
*/
public static String executeHttpGet(String url) throws Exception {
BufferedReader in = null;
try {
HttpClient client = getHttpClient();
HttpGet request = new HttpGet();
request.setURI(new URI(url));
HttpResponse response = client.execute(request);
in = new BufferedReader(new InputStreamReader(response.getEntity()
.getContent()));
StringBuffer sb = new StringBuffer("");
String line = "";
String NL = System.getProperty("line.separator");
while ((line = in.readLine()) != null) {
sb.append(line + NL);
}
in.close();
String result = sb.toString();
return result;
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
}
|
[
"kdgupta87@gmail.com"
] |
kdgupta87@gmail.com
|
42dd84b7de4b14a6a4d046646d29b1a95dabdb35
|
80403ec5838e300c53fcb96aeb84d409bdce1c0c
|
/server/customModules/WNPRC_EHR/src/org/labkey/wnprc_ehr/dataentry/BloodDrawRequest/BloodDrawRequestForm.java
|
c12ca3b6639871479b55621b119b5f8d121e0797
|
[] |
no_license
|
scchess/LabKey
|
7e073656ea494026b0020ad7f9d9179f03d87b41
|
ce5f7a903c78c0d480002f738bccdbef97d6aeb9
|
refs/heads/master
| 2021-09-17T10:49:48.147439
| 2018-03-22T13:01:41
| 2018-03-22T13:01:41
| 126,447,224
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,607
|
java
|
/*
* Copyright (c) 2015-2016 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.labkey.wnprc_ehr.dataentry.BloodDrawRequest;
import org.labkey.api.ehr.dataentry.AnimalDetailsFormSection;
import org.labkey.api.ehr.dataentry.DataEntryFormContext;
import org.labkey.api.ehr.dataentry.FormSection;
import org.labkey.api.ehr.dataentry.TaskForm;
import org.labkey.api.ehr.dataentry.TaskFormSection;
import org.labkey.api.module.Module;
import org.labkey.api.view.template.ClientDependency;
import org.labkey.wnprc_ehr.WNPRCConstants;
import java.util.Arrays;
public class BloodDrawRequestForm extends TaskForm {
public static final String NAME = "Blood Draw Request";
public BloodDrawRequestForm(DataEntryFormContext ctx, Module owner) {
super(ctx, owner, NAME, "Request Blood Draws", WNPRCConstants.DataEntrySections.COLONY_RECORDS, Arrays.asList(
new TaskFormSection(),
new AnimalDetailsFormSection()
));
addClientDependency(ClientDependency.fromPath("wnprc_ehr/model/sources/Request.js"));
}
}
|
[
"klum@labkey.com"
] |
klum@labkey.com
|
de06c6f18ab27f59beb26cc3b02fccf563519124
|
b7974697cde0431c70a05d35969a35a051ca3a68
|
/nucleus-core/src/main/java/io/github/nucleuspowered/nucleus/modules/deathmessage/DeathMessageModule.java
|
5991a071c81c15464c3f925d21680752a159406e
|
[
"MIT"
] |
permissive
|
NickImpact/Nucleus
|
254e02bdfc01074b270b85b76912e10fb788bbcf
|
c94f39877a3671501c99992c21d73d34fc1a13f4
|
refs/heads/v2/S7
| 2022-11-10T05:45:11.607325
| 2021-02-25T16:58:23
| 2021-02-25T16:58:34
| 284,608,226
| 0
| 0
|
MIT
| 2020-08-03T05:06:22
| 2020-08-03T05:06:21
| null |
UTF-8
|
Java
| false
| false
| 1,349
|
java
|
/*
* This file is part of Nucleus, licensed under the MIT License (MIT). See the LICENSE.txt file
* at the root of this project for more details.
*/
package io.github.nucleuspowered.nucleus.modules.deathmessage;
import static io.github.nucleuspowered.nucleus.modules.deathmessage.DeathMessageModule.ID;
import io.github.nucleuspowered.nucleus.modules.deathmessage.config.DeathMessageConfig;
import io.github.nucleuspowered.nucleus.modules.deathmessage.config.DeathMessageConfigAdapter;
import io.github.nucleuspowered.nucleus.quickstart.module.ConfigurableModule;
import io.github.nucleuspowered.nucleus.services.INucleusServiceCollection;
import uk.co.drnaylor.quickstart.annotations.ModuleData;
import uk.co.drnaylor.quickstart.holders.DiscoveryModuleHolder;
import java.util.function.Supplier;
import javax.inject.Inject;
@ModuleData(id = ID, name = "Death Messages")
public class DeathMessageModule extends ConfigurableModule<DeathMessageConfig, DeathMessageConfigAdapter> {
public static final String ID = "death-message";
@Inject
public DeathMessageModule(Supplier<DiscoveryModuleHolder<?, ?>> moduleHolder, INucleusServiceCollection collection) {
super(moduleHolder, collection);
}
@Override
public DeathMessageConfigAdapter createAdapter() {
return new DeathMessageConfigAdapter();
}
}
|
[
"git@drnaylor.co.uk"
] |
git@drnaylor.co.uk
|
09140ba23559cab3e3afe71918bb58bcf3ecd202
|
f9817d637c17d5e6a71f154b9ad9e90f2d63ad91
|
/21MergeTwoSortedLists3.java
|
cfcc2b366595e928179840577e06a0b643c77a20
|
[] |
no_license
|
samuelyo/Leetcode
|
b5710612013da8c939f659222d9ed340ae480285
|
19533a8d5fadce65a0d225c2309eaf2381fdc482
|
refs/heads/master
| 2021-01-19T10:31:46.544133
| 2019-12-23T15:58:19
| 2019-12-23T15:58:19
| 87,869,193
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,357
|
java
|
package com.leetcode.MergeTwoSortedLists;
public class MergeTwoSortedLists3 {
static class ListNode {
int val;
ListNode next;
ListNode(int x) {
val = x;
}
}
public static void main(String[] args) {
int[] nums1 = {2,3,5};
int[] nums2 = {3,4,5};
ListNode l1 = buildList(nums1);
ListNode l2 = buildList(nums2);
ListNode res = mergeTwoLists(l1, l2);
while(null != res){
System.out.print(res.val + " ");
res = res.next;
}
}
public static ListNode mergeTwoLists(ListNode l1,ListNode l2){
ListNode fakeHead = new ListNode(0);
ListNode l1Index = l1;
ListNode l2Index = l2;
ListNode cur = fakeHead;
while(l1Index != null && l2Index != null) {
if(l1Index.val <= l2Index.val) {
cur.next = l1Index;
l1Index = l1Index.next;
}else {
cur.next = l2Index;
l2Index = l2Index.next;
}
cur = cur.next;
}
if(l1Index != null) {
cur.next = l1Index;
}else if(l2Index != null) {
cur.next = l2Index;
}
return fakeHead.next;
}
public static ListNode buildList(int[] nums){
ListNode first = null;
ListNode last = null;
ListNode newNode = null;
for(int i = 0;i<nums.length;i++){
newNode = new ListNode(nums[i]);
if(null == first){
first = newNode;
last = newNode;
}else{
last.next = newNode;
last = newNode;
}
}
return first;
}
}
|
[
"1120780416@qq.com"
] |
1120780416@qq.com
|
28cc10f869c5c3e7bfafb144852368b08748a885
|
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
|
/crash-reproduction-ws/results/MATH-31b-3-9-Single_Objective_GGA-WeightedSum/org/apache/commons/math3/special/Beta_ESTest_scaffolding.java
|
98086c79efc23c5bf5163777a4953b3281a5b690
|
[
"MIT",
"CC-BY-4.0"
] |
permissive
|
STAMP-project/Botsing-basic-block-coverage-application
|
6c1095c6be945adc0be2b63bbec44f0014972793
|
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
|
refs/heads/master
| 2022-07-28T23:05:55.253779
| 2022-04-20T13:54:11
| 2022-04-20T13:54:11
| 285,771,370
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 441
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Jan 17 22:00:44 UTC 2020
*/
package org.apache.commons.math3.special;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class Beta_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
782f633077de693dc7742ee05c3a6fcffe4dd994
|
de3c2d89f623527b35cc5dd936773f32946025d2
|
/src/main/java/com/yanzhenjie/album/widget/LoadingDialog.java
|
e69e998b07ca25d86a7ccc812314bd90b4f957e4
|
[] |
no_license
|
ren19890419/lvxing
|
5f89f7b118df59fd1da06aaba43bd9b41b5da1e6
|
239875461cb39e58183ac54e93565ec5f7f28ddb
|
refs/heads/master
| 2023-04-15T08:56:25.048806
| 2020-06-05T10:46:05
| 2020-06-05T10:46:05
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,146
|
java
|
package com.yanzhenjie.album.widget;
import android.app.Dialog;
import android.content.Context;
import android.widget.TextView;
import androidx.core.content.ContextCompat;
import com.yanzhenjie.album.R;
import com.yanzhenjie.album.api.widget.Widget;
public class LoadingDialog extends Dialog {
/* renamed from: a */
private ColorProgressBar f26342a = ((ColorProgressBar) findViewById(R.id.progress_bar));
/* renamed from: b */
private TextView f26343b = ((TextView) findViewById(R.id.tv_message));
public LoadingDialog(Context context) {
super(context, R.style.Album_Dialog);
setCancelable(false);
setCanceledOnTouchOutside(false);
setContentView(R.layout.album_dialog_loading);
}
/* renamed from: a */
public void mo37717a(Widget widget) {
if (widget.mo37545a() == 1) {
this.f26342a.setColorFilter(ContextCompat.getColor(getContext(), R.color.albumLoadingDark));
return;
}
this.f26342a.setColorFilter(widget.mo37547c());
}
/* renamed from: a */
public void mo37716a(int i) {
this.f26343b.setText(i);
}
}
|
[
"593746220@qq.com"
] |
593746220@qq.com
|
63f7750ab74551addcadcdf0003e633e368577e8
|
f4b1534db460f96cc4c71bf9355dda320ad0672f
|
/src/main/java/com/company/ch01Common/item020/Client.java
|
8723779c7f7f861a382d703ce4a570925866975f
|
[] |
no_license
|
zhzhouq9/item
|
be4f012c1a8f2f3d8a33039d3fde5f3e4e2eb814
|
053307fa5f825c044b7569c9662f9d6c31c702cc
|
refs/heads/master
| 2022-10-26T05:13:57.826196
| 2020-06-14T09:52:56
| 2020-06-14T09:52:56
| 272,170,896
| 0
| 0
| null | 2020-06-14T09:29:57
| 2020-06-14T09:29:56
| null |
UTF-8
|
Java
| false
| false
| 225
|
java
|
package com.company.ch01Common.item020;
/**
* 引用常量
*/
public class Client {
public static void main(String[] args) {
System.out.println("人类寿命极限是:" + Constant.MAX_AGE);
}
}
|
[
"mosoft521@gmail.com"
] |
mosoft521@gmail.com
|
26880990df9830b3c8f587d6c12ff32b30359333
|
ce7f98ec5cc68025f2b97aeceaeb83c73c760392
|
/src/main/java/com/nokchax/watcher/scrap/filter/doc/ElementsByIndexLessThan.java
|
909a9d89495953d45c8882a22f9e1eb31ae09566
|
[] |
no_license
|
nokchax/watcher
|
2019cea39c86c8812fd2a89d3b3e66f30cdf2939
|
2cf464ca3b63419805360bfe2a2c5aeb0296b4b4
|
refs/heads/master
| 2020-08-01T18:24:34.807596
| 2019-11-20T11:28:34
| 2019-11-20T11:28:34
| 211,075,901
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 508
|
java
|
package com.nokchax.watcher.scrap.filter.doc;
import com.nokchax.watcher.scrap.filter.Filter;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
public class ElementsByIndexLessThan extends Filter<Document, Elements> {
public ElementsByIndexLessThan(String index) {
super(index);
Integer.parseInt(index);
}
@Override
public Elements filtering(Document document) {
return document.getElementsByIndexLessThan(Integer.parseInt(filterString));
}
}
|
[
"nokchax@gmail.com"
] |
nokchax@gmail.com
|
66bb569750cd815ddec3e7e3aae8265281133391
|
be73270af6be0a811bca4f1710dc6a038e4a8fd2
|
/crash-reproduction-moho/results/XWIKI-13372-17-18-PESA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/extension/job/internal/InstallJob_ESTest_scaffolding.java
|
b196f2e73e9ea33c83461b7a2477bfde3ac5a7c9
|
[] |
no_license
|
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
|
cf118b23ecb87a8bf59643e42f7556b521d1f754
|
3bb39683f9c343b8ec94890a00b8f260d158dfe3
|
refs/heads/master
| 2022-07-29T14:44:00.774547
| 2020-08-10T15:14:49
| 2020-08-10T15:14:49
| 285,804,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 447
|
java
|
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Fri Apr 03 04:40:38 UTC 2020
*/
package org.xwiki.extension.job.internal;
import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.junit.BeforeClass;
import org.junit.Before;
import org.junit.After;
@EvoSuiteClassExclude
public class InstallJob_ESTest_scaffolding {
// Empty scaffolding for empty test suite
}
|
[
"pouria.derakhshanfar@gmail.com"
] |
pouria.derakhshanfar@gmail.com
|
eed22804260e663767c1f7f4bf2a380b20977d9e
|
1a83f3f213dca04890764ac096ba3613f50e5665
|
/src/main/java/io/server/game/world/entity/combat/magic/MagicSpell.java
|
1d0ad4eaf58dca6d20966d9938129e160ca22c75
|
[] |
no_license
|
noveltyps/NewRunityRebelion
|
52dfc757d6f784cce4d536c509bcdd6247ae57ef
|
6b0e5c0e7330a8a9ee91c691fb150cb1db567457
|
refs/heads/master
| 2020-05-20T08:44:36.648909
| 2019-05-09T17:23:50
| 2019-05-09T17:23:50
| 185,468,893
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,393
|
java
|
package io.server.game.world.entity.combat.magic;
import java.util.Optional;
import io.server.game.world.entity.mob.Mob;
import io.server.game.world.entity.mob.player.Player;
import io.server.game.world.entity.skill.Skill;
import io.server.game.world.items.Item;
import io.server.net.packet.out.SendMessage;
/**
* Represents a combat spell. Created by mmaks on 8/24/2017.
*/
public abstract class MagicSpell {
public final int level;
final double baseExperience;
public final RequiredRune[] runes;
MagicSpell(int level, double baseExperience, RequiredRune... runes) {
this.level = level;
this.baseExperience = baseExperience;
this.runes = runes;
}
public Optional<Item[]> equipmentRequired() {
return Optional.empty();
}
boolean canCast(Mob attacker, Optional<Mob> defender) {
if (attacker.isNpc()) {
return true;
}
Player player = attacker.getPlayer();
if (player.skills.getLevel(Skill.MAGIC) < level) {
player.send(new SendMessage("You need a Magic level of " + level + " to cast this spell."));
player.getCombat().reset();
return false;
}
if (equipmentRequired().isPresent() && !player.equipment.containsAll(equipmentRequired().get())) {
player.send(new SendMessage("You do not have the required equipment to cast this spell."));
player.getCombat().reset();
return false;
}
return MagicRune.hasRunes(player, runes);
}
}
|
[
"43006455+donvlee97@users.noreply.github.com"
] |
43006455+donvlee97@users.noreply.github.com
|
50cb7619015d68e4816071a3e4b1b2bc370eb73f
|
ed865190ed878874174df0493b4268fccb636a29
|
/PuridiomBrowse/src/com/tsa/puridiom/browse/tasks/GenerateBrowseFilter.java
|
caf1619b11128d5601a8d3603ad05c6e83f74adf
|
[] |
no_license
|
zach-hu/srr_java8
|
6841936eda9fdcc2e8185b85b4a524b509ea4b1b
|
9b6096ba76e54da3fe7eba70989978edb5a33d8e
|
refs/heads/master
| 2021-01-10T00:57:42.107554
| 2015-11-06T14:12:56
| 2015-11-06T14:12:56
| 45,641,885
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,978
|
java
|
package com.tsa.puridiom.browse.tasks;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import com.tsa.puridiom.browse.BrowseFilter;
import com.tsa.puridiom.browse.BrowseObject;
import com.tsa.puridiom.browse.BrowseValidationUtility;
import com.tsa.puridiom.common.utility.HiltonUtility;
import com.tsa.puridiom.property.PropertiesManager;
import com.tsagate.foundation.processengine.Status;
import com.tsagate.foundation.processengine.Task;
import com.tsagate.foundation.utility.Utility;
public class GenerateBrowseFilter extends Task
{
public Object executeTask (Object object) throws Exception
{
Object result;
try {
Map incomingRequest = (Map)object;
String organizationId = (String)incomingRequest.get("organizationId");
String isActivityCatalogSecurity = (String)PropertiesManager.getInstance(organizationId).getProperty("CATALOG SECURITY DEFAULTS", "CATALOGSECURITYACTIVE", "N");
BrowseObject b = (BrowseObject) incomingRequest.get("browseObject");
Object filterColObject = incomingRequest.get("colname");
Map columnTypes = b.getColumnTypes();
String fromPage = Utility.ckNull((String) incomingRequest.get("fromPage"));
if (filterColObject instanceof String[]) {
String filterColumns[] = (String[]) filterColObject;
String filterTextValues[] = (String[]) incomingRequest.get("filter_txt");
String sortValues[] = (String[]) incomingRequest.get("sort");
String operators[] = (String[]) incomingRequest.get("operator");
String logicalOperators[] = (String[]) incomingRequest.get("logicalOperator");
String originalFilters[] = (String[]) incomingRequest.get("originalFilter");
String previousLogicalOperator = "AND";
if (fromPage.indexOf("main_menu") > 0)
{
previousLogicalOperator = "OR";
}
if( isActivityCatalogSecurity.equalsIgnoreCase("Y") )
{
previousLogicalOperator = "AND";
}
for (int i=0; i < filterColumns.length; i++) {
String filterColumn = filterColumns[i];
String filterValue = HiltonUtility.decodeHtml(filterTextValues[i]);
String sort = sortValues[i];
if (!Utility.isEmpty(filterValue) || (!Utility.isEmpty(sort) && !sort.equalsIgnoreCase("N"))) {
BrowseFilter filter = null;
String type = "STRING";
if (columnTypes.containsKey(filterColumn)){
type = (String) columnTypes.get(filterColumn);
}
filterColumn = filterColumn.replaceAll("_",".");
if (!Utility.isEmpty(filterValue) || (!Utility.isEmpty(sort) && !sort.equalsIgnoreCase("N")) ) {
if(filterColumn.equalsIgnoreCase("CatalogItem.description") && logicalOperators[i].equalsIgnoreCase("OR"))
{
previousLogicalOperator = logicalOperators[i];
}
filter = this.setupBrowseFilter(filterColumn, filterValue, operators[i], previousLogicalOperator, sort, originalFilters[i], type);
previousLogicalOperator = logicalOperators[i];
b.addBrowseFilter(filter);
}
}
}
}
else {
String filterColumn = (String) filterColObject;
String filterValue = (String) incomingRequest.get("filter_txt");
String sort = (String) incomingRequest.get("sort");
if (!Utility.isEmpty(filterValue) || (!Utility.isEmpty(sort) && !sort.equalsIgnoreCase("N"))) {
BrowseFilter filter = null;
String operator = (String) incomingRequest.get("operator");
String logicalOperator = (String) incomingRequest.get("logicalOperator");
String originalFilter = (String) incomingRequest.get("originalFilter");
String type = "STRING";
if (columnTypes.containsKey(filterColumn)){
type = (String) columnTypes.get(filterColumn);
}
filterColumn = filterColumn.replaceAll("_",".");
filter = this.setupBrowseFilter(filterColumn, filterValue, operator, logicalOperator, sort, originalFilter, type);
b.addBrowseFilter(filter);
}
}
result = b;
this.setStatus(Status.SUCCEEDED);
}
catch (Exception e) {
throw e;
}
return result ;
}
private BrowseFilter setupBrowseFilter(String filterKey, String filterValue, String operator,
String logicalOperator, String sort, String original, String type) {
BrowseFilter filter = new BrowseFilter();
if (Utility.isEmpty(operator) || !BrowseValidationUtility.permissibleOperators.contains(operator)) {
operator = "=";
}
if (Utility.isEmpty(logicalOperator) || !BrowseValidationUtility.permissibleLogicalOperators.contains(logicalOperator)) {
logicalOperator = "AND";
}
if (Utility.isEmpty(sort) || !BrowseValidationUtility.permissibleSortOperators.contains(sort)) {
sort = "N";
}
if (Utility.isEmpty(original)) {
original = "N";
}
filter.setColumnName(filterKey);
filter.setValue(filterValue.trim());
filter.setOperator(operator);
filter.setLogicalOperator(logicalOperator);
filter.setSort(sort);
filter.setOriginalFilter(original.equalsIgnoreCase("Y"));
filter.setType(type);
return filter;
}
}
|
[
"brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466"
] |
brickerz@9227675a-84a3-4efe-bc6c-d7b3a3cf6466
|
70ba1a6139877606e7efb13df432eaed47a2f501
|
e89dc01c95b8b45404f971517c2789fd21657749
|
/src/main/java/com/alipay/api/domain/AlipayZmScoreZrankResult.java
|
0857a218b380245c7d047c0aca1abd81062a4c74
|
[
"Apache-2.0"
] |
permissive
|
guoweiecust/alipay-sdk-java-all
|
3370466eec70c5422c8916c62a99b1e8f37a3f46
|
bb2b0dc8208a7a0ab8521a52f8a5e1fcef61aeb9
|
refs/heads/master
| 2023-05-05T07:06:47.823723
| 2021-05-25T15:26:21
| 2021-05-25T15:26:21
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 564
|
java
|
package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 芝麻分分段
*
* @author auto create
* @since 1.0, 2018-01-22 10:52:40
*/
public class AlipayZmScoreZrankResult extends AlipayObject {
private static final long serialVersionUID = 3184691737232714654L;
/**
* 芝麻分分段 Z0-Z7
*/
@ApiField("zrank")
private String zrank;
public String getZrank() {
return this.zrank;
}
public void setZrank(String zrank) {
this.zrank = zrank;
}
}
|
[
"ben.zy@antfin.com"
] |
ben.zy@antfin.com
|
f6c3c8bb2e1cdbfaaed47c9c347a30c7aca60fd8
|
6775412013350bceefa00a8197a31a74b7ff5b46
|
/bridge-api/src/main/java/javax/portlet/faces/BridgeWriteBehindResponse.java
|
e74bad7c21f58c036cde7d615f01ae097c2f2160
|
[] |
no_license
|
ceidion/liferay-faces
|
757cd9694d189e017a7568bbca0c98b2deb39c5b
|
e4a96ca8a01e82d648cc183b4ccc87f215e2772c
|
refs/heads/master
| 2023-04-15T22:02:12.121241
| 2019-11-02T17:40:52
| 2019-11-02T17:40:52
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 910
|
java
|
/**
* Copyright (c) 2000-2015 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package javax.portlet.faces;
import java.io.IOException;
/**
* @author Neil Griffin
*/
public interface BridgeWriteBehindResponse {
void flushMarkupToWrappedResponse() throws IOException;
boolean hasFacesWriteBehindMarkup();
byte[] getBytes();
char[] getChars();
boolean isBytes();
boolean isChars();
}
|
[
"neil.griffin.scm@gmail.com"
] |
neil.griffin.scm@gmail.com
|
2b8c75f3b87f07a36aea53861a44500ef40e9b91
|
f238f2c3d71cd57c94fcc4a0d2066298a01e6481
|
/source/Interface58.java
|
5f6c0bc81fd206f1145950a8370fa03aa9c36742
|
[] |
no_license
|
MeezyProductions/Virtue857-Client
|
61cecd8dc4c8c5d2f91759948a71d2bb251c63d9
|
03500f26e96a3ad21f04de74e28b9db18769f8ec
|
refs/heads/master
| 2016-08-12T17:00:11.422440
| 2015-10-27T01:58:43
| 2015-10-27T01:58:43
| 44,935,063
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,234
|
java
|
/* Interface58 - Decompiled by JODE
* Visit http://jode.sourceforge.net/
*/
import java.applet.Applet;
import java.awt.Graphics;
public interface Interface58
{
public void method364();
public void method365();
public void method366();
public void method367();
public void destroy();
public void update(Graphics graphics);
public void paint(Graphics graphics);
public void method368();
public void method369(Applet applet);
public void method370(Applet applet);
public void method371(Applet applet);
public void supplyApplet(Applet applet);
public void method372();
public void method373();
public void method374();
public void method375();
public void start();
public void method376();
public void method377();
public void method378(Graphics graphics);
public void method379(Graphics graphics);
public void method380(Graphics graphics);
public void method381();
public void stop();
public void init();
public void method382(Applet applet);
}
|
[
"jamiemoore7746@gmail.com"
] |
jamiemoore7746@gmail.com
|
dea325df85ca366439667106367e0031136983b5
|
86505462601eae6007bef6c9f0f4eeb9fcdd1e7b
|
/bin/modules/base-accelerator/yacceleratorcore/src/de/hybris/platform/yacceleratorcore/event/SubmitOrderEventListener.java
|
a5cba962d13158f0697a10939915cfb5ad42bc9e
|
[] |
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
| 4,221
|
java
|
/*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package de.hybris.platform.yacceleratorcore.event;
import de.hybris.platform.acceleratorservices.site.AbstractAcceleratorSiteEventListener;
import de.hybris.platform.basecommerce.model.site.BaseSiteModel;
import de.hybris.platform.commerceservices.enums.SiteChannel;
import de.hybris.platform.core.model.order.OrderModel;
import de.hybris.platform.order.events.SubmitOrderEvent;
import de.hybris.platform.orderprocessing.model.OrderProcessModel;
import de.hybris.platform.processengine.BusinessProcessService;
import de.hybris.platform.servicelayer.model.ModelService;
import de.hybris.platform.servicelayer.util.ServicesUtil;
import de.hybris.platform.store.BaseStoreModel;
import de.hybris.platform.store.services.BaseStoreService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Required;
/**
* Listener for order submits.
*/
public class SubmitOrderEventListener extends AbstractAcceleratorSiteEventListener<SubmitOrderEvent>
{
private static final Logger LOG = Logger.getLogger(SubmitOrderEventListener.class);
private BusinessProcessService businessProcessService;
private BaseStoreService baseStoreService;
private ModelService modelService;
/**
* @return the businessProcessService
*/
protected BusinessProcessService getBusinessProcessService()
{
return businessProcessService;
}
/**
* @param businessProcessService
* the businessProcessService to set
*/
@Required
public void setBusinessProcessService(final BusinessProcessService businessProcessService)
{
this.businessProcessService = businessProcessService;
}
/**
* @return the baseStoreService
*/
protected BaseStoreService getBaseStoreService()
{
return baseStoreService;
}
/**
* @param baseStoreService
* the baseStoreService to set
*/
@Required
public void setBaseStoreService(final BaseStoreService baseStoreService)
{
this.baseStoreService = baseStoreService;
}
/**
* @return the modelService
*/
protected ModelService getModelService()
{
return modelService;
}
/**
* @param modelService
* the modelService to set
*/
@Required
public void setModelService(final ModelService modelService)
{
this.modelService = modelService;
}
@Override
protected void onSiteEvent(final SubmitOrderEvent event)
{
final OrderModel order = event.getOrder();
ServicesUtil.validateParameterNotNullStandardMessage("event.order", order);
// Try the store set on the Order first, then fallback to the session
BaseStoreModel store = order.getStore();
if (store == null)
{
store = getBaseStoreService().getCurrentBaseStore();
}
if (store == null)
{
LOG.warn("Unable to start fulfilment process for order [" + order.getCode()
+ "]. Store not set on Order and no current base store defined in session.");
}
else
{
final String fulfilmentProcessDefinitionName = store.getSubmitOrderProcessCode();
if (fulfilmentProcessDefinitionName == null || fulfilmentProcessDefinitionName.isEmpty())
{
LOG.warn("Unable to start fulfilment process for order [" + order.getCode() + "]. Store [" + store.getUid()
+ "] has missing SubmitOrderProcessCode");
}
else
{
final String processCode = fulfilmentProcessDefinitionName + "-" + order.getCode() + "-" + System.currentTimeMillis();
final OrderProcessModel businessProcessModel = getBusinessProcessService().createProcess(processCode,
fulfilmentProcessDefinitionName);
businessProcessModel.setOrder(order);
getModelService().save(businessProcessModel);
getBusinessProcessService().startProcess(businessProcessModel);
if (LOG.isInfoEnabled())
{
LOG.info(String.format("Started the process %s", processCode));
}
}
}
}
@Override
protected SiteChannel getSiteChannelForEvent(final SubmitOrderEvent event)
{
final OrderModel order = event.getOrder();
ServicesUtil.validateParameterNotNullStandardMessage("event.order", order);
final BaseSiteModel site = order.getSite();
ServicesUtil.validateParameterNotNullStandardMessage("event.order.site", site);
return site.getChannel();
}
}
|
[
"juan.gonzalez.working@gmail.com"
] |
juan.gonzalez.working@gmail.com
|
ab3561d11792046e67239bb4bc279d203ba95c5c
|
6d1ca1c702421d54ce077c3f623bcf636aa85c8f
|
/src/main/java/com/mycompany/feign/Constants.java
|
faa2db9dbf28008914255f62c770c64c4b9496d2
|
[] |
no_license
|
colinbut/java-feign-example
|
22d1de6547b6c844a09526621812f0c0e3ba0f6c
|
1d8c82c49d28acf46fdeee6a1d5ca6a2a5d0b8bc
|
refs/heads/master
| 2020-04-02T01:00:45.425483
| 2018-10-20T21:23:45
| 2018-10-20T21:23:45
| 153,833,099
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 429
|
java
|
/*
* |-------------------------------------------------
* | Copyright © 2018 Colin But. All rights reserved.
* |-------------------------------------------------
*/
package com.mycompany.feign;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class Constants {
public static final String BOOK_SERVICE_URL = "Http://localhost:8081/api/books";
}
|
[
"colinbut@users.noreply.github.com"
] |
colinbut@users.noreply.github.com
|
ad129de6b115fa2df68d0bd19a167903f0e837d4
|
7e1511cdceeec0c0aad2b9b916431fc39bc71d9b
|
/flakiness-predicter/input_data/original_tests/joel-costigliola-assertj-core/nonFlakyMethods/org.assertj.core.internal.comparables.Comparables_assertLessThan_Test-should_fail_if_actual_is_null.java
|
ed53c391c737cb5392ad07e2855286634bb738bd
|
[
"BSD-3-Clause"
] |
permissive
|
Taher-Ghaleb/FlakeFlagger
|
6fd7c95d2710632fd093346ce787fd70923a1435
|
45f3d4bc5b790a80daeb4d28ec84f5e46433e060
|
refs/heads/main
| 2023-07-14T16:57:24.507743
| 2021-08-26T14:50:16
| 2021-08-26T14:50:16
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 149
|
java
|
@Test public void should_fail_if_actual_is_null(){
thrown.expectAssertionError(actualIsNull());
comparables.assertLessThan(someInfo(),null,8);
}
|
[
"aalsha2@masonlive.gmu.edu"
] |
aalsha2@masonlive.gmu.edu
|
40ddc3434d1cdfcf377aa54be64d350853e4089b
|
88ceb05a4833b80ef5ec8f1f1d42575ca18c2cff
|
/src/org/waveprotocol/wave/client/wavepanel/impl/contact/ContactModelList.java
|
59f1fd5539840296db0e3ad41a770b59b69cc266
|
[
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-indiana-extreme",
"Apache-2.0"
] |
permissive
|
wave-protocol/Wiab.pro
|
144e99bf191e98da9e54de6f135c14d863ccce05
|
b492a98d1ca5eeb5c0249c03d22ca18c05fedb97
|
refs/heads/master
| 2021-05-08T12:47:00.598612
| 2016-03-14T14:33:53
| 2016-03-14T14:33:53
| 119,965,901
| 2
| 0
| null | 2018-02-02T10:08:41
| 2018-02-02T10:08:40
| null |
UTF-8
|
Java
| false
| false
| 2,433
|
java
|
/**
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package org.waveprotocol.wave.client.wavepanel.impl.contact;
import org.waveprotocol.wave.client.account.ContactListener;
import org.waveprotocol.wave.client.account.ContactManager;
import org.waveprotocol.wave.client.account.Profile;
import org.waveprotocol.wave.client.account.ProfileListener;
import org.waveprotocol.wave.client.account.ProfileManager;
import org.waveprotocol.wave.model.wave.ParticipantId;
import java.util.ArrayList;
/**
* A contacts view list.
*
* @author akaplanov@gmail.com (Andrew Kaplanov)
*/
public class ContactModelList extends ArrayList<ContactModel> implements ContactListener, ProfileListener {
interface Listener {
void onContactsUpdated();
void onContactUpdated(ContactModel contact);
}
private final ContactManager contactManager;
private final ProfileManager profileManager;
private Listener listener;
public ContactModelList(ContactManager contactManager, ProfileManager profileManager) {
this.contactManager = contactManager;
this.profileManager = profileManager;
contactManager.addListener(this);
profileManager.addListener(this);
update();
}
public void setListener(Listener listener) {
this.listener = listener;
}
@Override
public void onContactsUpdated() {
update();
if (listener != null) {
listener.onContactsUpdated();
}
}
@Override
public void onProfileUpdated(Profile profile) {
if (listener != null) {
for (ContactModel contact : this) {
if (contact.getParticipantId().equals(profile.getParticipantId())) {
listener.onContactUpdated(contact);
break;
}
}
}
}
private void update() {
clear();
for (ParticipantId participantId : contactManager.getContacts()) {
add(new ContactModelImpl(participantId, profileManager.getProfile(participantId)));
}
}
}
|
[
"akaplanov@gmail.com"
] |
akaplanov@gmail.com
|
9d835a8aa29d60a4722be7dea5c48c7abdc55948
|
fd3cd43652fa2279a4df1647cb164cfa18040a2a
|
/andbase/src/main/java/com/andbase/ssk/entity/AppVersion.java
|
668280a6ee353519ce7ad776e8a318ee6190fc39
|
[] |
no_license
|
jielysong/android-HsanAnd
|
665df97f0e06b91a0f4714258a8b69e7498534af
|
c0c2e823a0c791d802c9568ec5466094e4864cc5
|
refs/heads/master
| 2021-01-19T02:28:05.845711
| 2017-05-24T05:53:28
| 2017-05-24T05:53:42
| 87,281,555
| 0
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,480
|
java
|
package com.andbase.ssk.entity;
public class AppVersion {
private int id;
private String createDateString;
private String desc;
private String url;
private String version;
private int nshversion;
public int getNshversion() {
return nshversion;
}
public void setNshversion(int nshversion) {
this.nshversion = nshversion;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getCreateDateString() {
return createDateString;
}
public void setCreateDateString(String createDateString) {
this.createDateString = createDateString;
}
public String getDesc() {
return desc;
}
public void setDesc(String desc) {
this.desc = desc;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
@Override
public String toString() {
return "AppVersion{" +
"id=" + id +
", createDateString='" + createDateString + '\'' +
", desc='" + desc + '\'' +
", url='" + url + '\'' +
", version='" + version + '\'' +
", nshversion=" + nshversion +
'}';
}
}
|
[
"jielysong@163.com"
] |
jielysong@163.com
|
aa91e6f22312c95ef290c5f38a1c7050aff9a1d5
|
5f8c84de8b2c30b0b96ee0d2e73b16235cc2eb54
|
/modules/API/src/main/java/net/prisontech/prisonbreak/api/IPrisonBreakMain.java
|
64770dcf60d46e28d0a2e48b2437b5455d2b8c1e
|
[] |
no_license
|
jared-paul/PrisonBreak
|
522adb3519a402744a31ccc46984a0d8b4aea83c
|
9f7463a657f2b8af5965f810941919508acedc10
|
refs/heads/master
| 2020-05-24T06:35:40.659972
| 2019-05-17T03:45:39
| 2019-05-17T03:45:39
| 187,141,495
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 625
|
java
|
package net.prisontech.prisonbreak.api;
import net.prisontech.prisonbreak.api.blackmarket.IBlackMarketRegistry;
import net.prisontech.prisonbreak.api.kits.IKitRegistry;
import net.prisontech.prisonbreak.api.loot.IChestRegistry;
import net.prisontech.prisonbreak.api.util.BungeeChannelApi;
import org.bukkit.World;
import org.bukkit.plugin.Plugin;
public interface IPrisonBreakMain extends Plugin
{
IKitRegistry getKitRegistry();
IChestRegistry getChestRegistry();
IBlackMarketRegistry getBlackMarketRegistry();
BungeeChannelApi getChannelAPI();
World getWorld();
IMainConfig getMainConfig();
}
|
[
"unconfigured@null.spigotmc.org"
] |
unconfigured@null.spigotmc.org
|
009fbfc11c7e1afd83c25c8ce174f5268d4bff2f
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/11/11_f3f8563224a3560e04c63933a19832bc57f9deeb/DanmakuFilters/11_f3f8563224a3560e04c63933a19832bc57f9deeb_DanmakuFilters_s.java
|
7898e9de244d3864d6f155b8323d4078b38f0d62
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 8,256
|
java
|
package master.flame.danmaku.controller;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import master.flame.danmaku.danmaku.model.BaseDanmaku;
import master.flame.danmaku.danmaku.model.IDanmakuIterator;
import master.flame.danmaku.danmaku.model.IDanmakus;
import master.flame.danmaku.danmaku.model.android.Danmakus;
public class DanmakuFilters {
public static interface IDanmakuFilter {
/*
* 是否过滤
*/
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
Long drawingStartTime);
public void setData(Object data);
public void reset();
}
/**
* 根据弹幕类型过滤
*
* @author ch
*/
public static class TypeDanmakuFilter implements IDanmakuFilter {
final List<Integer> mFilterTypes = Collections.synchronizedList(new ArrayList<Integer>());
public void enableType(Integer type) {
if (!mFilterTypes.contains(type))
mFilterTypes.add(type);
}
public void disableType(Integer type) {
if (mFilterTypes.contains(type))
mFilterTypes.remove(type);
}
@Override
public boolean filter(BaseDanmaku danmaku, int orderInScreen, int totalsizeInScreen,
Long drawingStartTime) {
if (danmaku != null && mFilterTypes.contains(danmaku.getType()))
return true;
return false;
}
@Override
public void setData(Object data) {
if (data == null || data instanceof List<?>) {
mFilterTypes.clear();
if (data != null) {
@SuppressWarnings("unchecked")
List<Integer> list = (List<Integer>) data;
for (Integer i : list) {
enableType(i);
}
}
}
}
@Override
public void reset() {
mFilterTypes.clear();
}
}
/**
* 根据同屏数量过滤弹幕
*
* @author ch
*/
public static class QuantityDanmakuFilter implements IDanmakuFilter {
protected int mMaximumSize = -1;
protected final IDanmakus danmakus = new Danmakus();
protected BaseDanmaku mLastSkipped = null;
@Override
public boolean filter(BaseDanmaku danmaku, int orderInScreen, int totalsizeInScreen,
Long drawingStartTime) {
BaseDanmaku last = danmakus.last();
if (last != null && last.isTimeOut()) {
reset();
last = null;
}
if (mMaximumSize <= 0 || danmaku.getType() != BaseDanmaku.TYPE_SCROLL_RL) {
return false;
}
if (danmakus.contains(danmaku)) {
return true;
}
if (totalsizeInScreen < mMaximumSize || danmaku.isShown()
|| (mLastSkipped != null && (danmaku.time - mLastSkipped.time > 500))) {
mLastSkipped = danmaku;
return false;
}
if (orderInScreen > mMaximumSize && !danmaku.isTimeOut()) {
danmakus.addItem(danmaku);
return true;
}
mLastSkipped = danmaku;
return false;
}
@Override
public void setData(Object data) {
if (data instanceof Integer) {
Integer maximumSize = (Integer) data;
if (maximumSize != mMaximumSize) {
mMaximumSize = maximumSize;
danmakus.clear();
}
}
}
@Override
public void reset() {
danmakus.clear();
}
}
/**
* 根据绘制耗时过滤弹幕
*
* @author ch
*/
public static class ElapsedTimeFilter implements IDanmakuFilter {
long mMaxTime = 20; // 绘制超过20ms就跳过 ,默认保持接近50fps
protected final IDanmakus danmakus = new Danmakus();
@Override
public boolean filter(BaseDanmaku danmaku, int orderInScreen, int totalsizeInScreen,
Long drawingStartTime) {
if (danmakus.last() != null && danmakus.last().isTimeOut()) {
reset();
}
if (danmakus.contains(danmaku)) {
return true;
}
if (drawingStartTime == null || !danmaku.isOutside()) {
return false;
}
long elapsedTime = System.currentTimeMillis() - drawingStartTime.longValue();
if (elapsedTime >= mMaxTime) {
danmakus.addItem(danmaku);
return true;
}
return false;
}
@Override
public void setData(Object data) {
}
@Override
public void reset() {
danmakus.clear();
}
}
public final static String TAG_TYPE_DANMAKU_FILTER = "1010_Filter";
public final static String TAG_QUANTITY_DANMAKU_FILTER = "1011_Filter";
public final static String TAG_ELAPSED_TIME_FILTER = "1012_Filter";
private static DanmakuFilters instance = null;
public final Exception filterException = new Exception("not suuport this filter tag");
public boolean filter(BaseDanmaku danmaku, int index, int totalsizeInScreen,
Long drawingStartTime) {
if (mFilterArray == null)
return false;
for (IDanmakuFilter f : mFilterArray) {
if (f.filter(danmaku, index, totalsizeInScreen, drawingStartTime)) {
return true;
}
}
return false;
}
private final static Map<String, IDanmakuFilter> filters = Collections
.synchronizedSortedMap(new TreeMap<String, IDanmakuFilter>());
public IDanmakuFilter get(String tag) {
IDanmakuFilter f = filters.get(tag);
if (f == null) {
f = registerFilter(tag, null);
}
return f;
}
IDanmakuFilter[] mFilterArray;
public IDanmakuFilter registerFilter(String tag, Object data) {
if (tag == null) {
throwFilterException();
return null;
}
IDanmakuFilter filter = filters.get(tag);
if (filter == null) {
if (TAG_TYPE_DANMAKU_FILTER.equals(tag)) {
filter = new TypeDanmakuFilter();
} else if (TAG_QUANTITY_DANMAKU_FILTER.equals(tag)) {
filter = new QuantityDanmakuFilter();
} else if (TAG_ELAPSED_TIME_FILTER.equals(tag)) {
filter = new ElapsedTimeFilter();
}
// add more filter
}
if (filter == null) {
throwFilterException();
return null;
}
filter.setData(data);
filters.put(tag, filter);
mFilterArray = (IDanmakuFilter[]) filters.values().toArray();
return filter;
}
public void unregisterFilter(String tag) {
IDanmakuFilter f = filters.remove(tag);
if (f != null){
f.reset();
f = null;
mFilterArray = (IDanmakuFilter[]) filters.values().toArray();
}
}
public void clear() {
filters.clear();
mFilterArray = null;
}
public void reset() {
if (mFilterArray == null) {
return;
}
for (IDanmakuFilter f : mFilterArray) {
f.reset();
}
}
private void throwFilterException() {
try {
throw filterException;
} catch (Exception e) {
}
}
public static DanmakuFilters getDefault() {
if (instance == null) {
instance = new DanmakuFilters();
}
return instance;
}
}
|
[
"yuzhongxing88@gmail.com"
] |
yuzhongxing88@gmail.com
|
333a4f43d4930e53c141976549f37a91fcc1228d
|
6b2f8416ac025de775c8acef458b908690c3816e
|
/src/main/java/org/joda/beans/impl/map/MapBeanPropertyMap.java
|
97d9bbdb43e90bf413a3008973640f9678d9df3e
|
[
"Apache-2.0"
] |
permissive
|
worldticket/joda-beans
|
76ea0a24cad595d13c47be65c368cef55ffe95aa
|
199547956d92db47ba11b033a1cb1116899efa7e
|
refs/heads/master
| 2021-01-24T18:27:01.816221
| 2017-01-24T10:16:49
| 2017-01-24T10:16:49
| 84,445,136
| 0
| 0
| null | 2017-03-09T13:29:25
| 2017-03-09T13:29:24
| null |
UTF-8
|
Java
| false
| false
| 3,986
|
java
|
/*
* Copyright 2001-present Stephen Colebourne
*
* 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.joda.beans.impl.map;
import java.util.AbstractMap;
import java.util.AbstractSet;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.joda.beans.MetaBean;
import org.joda.beans.Property;
import org.joda.beans.PropertyMap;
import org.joda.beans.impl.BasicProperty;
/**
* A map of properties for a {@code MapBean}.
*
* @author Stephen Colebourne
*/
final class MapBeanPropertyMap
extends AbstractMap<String, Property<?>> implements PropertyMap {
/** The bean. */
private final MapBean bean;
/**
* Factory to create a property map avoiding duplicate generics.
*
* @param bean the bean, not null
* @return the property map, not null
*/
public static MapBeanPropertyMap of(MapBean bean) {
return new MapBeanPropertyMap(bean);
}
/**
* Creates a property map.
*
* @param bean the bean that the property is bound to, not null
*/
private MapBeanPropertyMap(MapBean bean) {
if (bean == null) {
throw new NullPointerException("Bean must not be null");
}
this.bean = bean;
}
//-----------------------------------------------------------------------
@Override
public int size() {
return bean.size();
}
@Override
public boolean containsKey(Object obj) {
return bean.containsKey(obj);
}
@Override
public Property<?> get(Object obj) {
return containsKey(obj) ? bean.property(obj.toString()) : null;
}
@Override
public Set<String> keySet() {
return bean.keySet();
}
@Override
public Set<Entry<String, Property<?>>> entrySet() {
final MetaBean metaBean = bean.metaBean();
return new AbstractSet<Entry<String, Property<?>>>() {
// TODO: possibly override contains()
@Override
public int size() {
return bean.size();
}
@Override
public Iterator<Entry<String, Property<?>>> iterator() {
final Iterator<String> it = bean.keySet().iterator();
return new Iterator<Entry<String, Property<?>>>() {
@Override
public boolean hasNext() {
return it.hasNext();
}
@Override
public Entry<String, Property<?>> next() {
String name = it.next();
Property<?> prop = BasicProperty.of(bean, MapBeanMetaProperty.of(metaBean, name));
return new SimpleImmutableEntry<String, Property<?>>(name, prop);
}
@Override
public void remove() {
throw new UnsupportedOperationException("Unmodifiable");
}
};
}
};
}
//-----------------------------------------------------------------------
@Override
public Map<String, Object> flatten() {
Map<String, Object> copy = new HashMap<String, Object>(bean);
return Collections.unmodifiableMap(copy);
}
}
|
[
"scolebourne@joda.org"
] |
scolebourne@joda.org
|
ae3bddbf1bbbb46be972858b30439dfc9896420b
|
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
|
/LaserTank/src/com/puttysoftware/lasertank/arena/objects/MetallicRotaryMirror.java
|
341be73e4f95a7e210fcb755f62697a5f2b0101c
|
[
"Unlicense"
] |
permissive
|
retropipes/older-java-games
|
777574e222f30a1dffe7936ed08c8bfeb23a21ba
|
786b0c165d800c49ab9977a34ec17286797c4589
|
refs/heads/master
| 2023-04-12T14:28:25.525259
| 2021-05-15T13:03:54
| 2021-05-15T13:03:54
| 235,693,016
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,798
|
java
|
/* LaserTank: An Arena-Solving Game
Copyright (C) 2008-2013 Eric Ahnell
Any questions should be directed to the author via email at: products@puttysoftware.com
*/
package com.puttysoftware.lasertank.arena.objects;
import com.puttysoftware.lasertank.LaserTank;
import com.puttysoftware.lasertank.arena.abstractobjects.AbstractArenaObject;
import com.puttysoftware.lasertank.arena.abstractobjects.AbstractReactionWall;
import com.puttysoftware.lasertank.resourcemanagers.SoundConstants;
import com.puttysoftware.lasertank.resourcemanagers.SoundManager;
import com.puttysoftware.lasertank.utilities.Direction;
import com.puttysoftware.lasertank.utilities.DirectionResolver;
import com.puttysoftware.lasertank.utilities.MaterialConstants;
public class MetallicRotaryMirror extends AbstractReactionWall {
// Constructors
public MetallicRotaryMirror() {
super();
this.setDirection(Direction.NORTHEAST);
this.setDiagonalOnly(true);
this.setMaterial(MaterialConstants.MATERIAL_METALLIC);
}
@Override
public Direction laserEnteredActionHook(final int locX, final int locY,
final int locZ, final int dirX, final int dirY, final int laserType,
final int forceUnits) {
final Direction dir = DirectionResolver
.resolveRelativeDirectionInvert(dirX, dirY);
if (AbstractArenaObject.hitReflectiveSide(dir)) {
// Reflect laser
return this.getDirection();
} else {
// Rotate mirror
this.toggleDirection();
SoundManager.playSound(SoundConstants.SOUND_ROTATE);
return Direction.NONE;
}
}
@Override
public Direction laserExitedAction(final int locX, final int locY,
final int locZ, final int dirX, final int dirY,
final int laserType) {
// Finish reflecting laser
SoundManager.playSound(SoundConstants.SOUND_REFLECT);
final Direction oldlaser = DirectionResolver
.resolveRelativeDirectionInvert(locX, locY);
final Direction currdir = this.getDirection();
if (oldlaser == Direction.NORTH) {
if (currdir == Direction.NORTHWEST) {
return Direction.WEST;
} else if (currdir == Direction.NORTHEAST) {
return Direction.EAST;
}
} else if (oldlaser == Direction.SOUTH) {
if (currdir == Direction.SOUTHWEST) {
return Direction.WEST;
} else if (currdir == Direction.SOUTHEAST) {
return Direction.EAST;
}
} else if (oldlaser == Direction.WEST) {
if (currdir == Direction.SOUTHWEST) {
return Direction.SOUTH;
} else if (currdir == Direction.NORTHWEST) {
return Direction.NORTH;
}
} else if (oldlaser == Direction.EAST) {
if (currdir == Direction.SOUTHEAST) {
return Direction.SOUTH;
} else if (currdir == Direction.NORTHEAST) {
return Direction.NORTH;
}
}
return Direction.NONE;
}
@Override
public boolean rangeActionHook(final int locX, final int locY,
final int locZ, final int dirX, final int dirY, final int rangeType,
final int forceUnits) {
// Rotate mirror
this.toggleDirection();
SoundManager.playSound(SoundConstants.SOUND_ROTATE);
LaserTank.getApplication().getArenaManager().getArena()
.markAsDirty(locX + dirX, locY + dirY, locZ);
return true;
}
@Override
public boolean doLasersPassThrough() {
return true;
}
@Override
public final int getStringBaseID() {
return 66;
}
}
|
[
"eric.ahnell@puttysoftware.com"
] |
eric.ahnell@puttysoftware.com
|
f4c82768ccc7a7cc055ec641435e01962e2dc1d8
|
dcb64d4a551470dc077b6502a2fe583e78275abc
|
/Fathom_com.brynk.fathom-dex2jar.src/com/facebook/common/internal/Objects.java
|
aad7ef1ffc60e893030070b22a7f0ab272c004bd
|
[] |
no_license
|
lenjonemcse/Fathom-Drone-Android-App
|
d82799ee3743404dd5d7103152964a2f741b88d3
|
f3e3f0225680323fa9beb05c54c98377f38c1499
|
refs/heads/master
| 2022-01-13T02:10:31.014898
| 2019-07-10T19:42:02
| 2019-07-10T19:42:02
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,637
|
java
|
package com.facebook.common.internal;
import java.util.Arrays;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
public final class Objects
{
@CheckReturnValue
public static boolean equal(@Nullable Object paramObject1, @Nullable Object paramObject2)
{
return (paramObject1 == paramObject2) || ((paramObject1 != null) && (paramObject1.equals(paramObject2)));
}
public static <T> T firstNonNull(@Nullable T paramT1, @Nullable T paramT2)
{
if (paramT1 != null)
return paramT1;
return Preconditions.checkNotNull(paramT2);
}
public static int hashCode(@Nullable Object[] paramArrayOfObject)
{
return Arrays.hashCode(paramArrayOfObject);
}
private static String simpleName(Class<?> paramClass)
{
paramClass = paramClass.getName().replaceAll("\\$[0-9]+", "\\$");
int j = paramClass.lastIndexOf('$');
int i = j;
if (j == -1)
i = paramClass.lastIndexOf('.');
return paramClass.substring(i + 1);
}
public static ToStringHelper toStringHelper(Class<?> paramClass)
{
return new ToStringHelper(simpleName(paramClass), null);
}
public static ToStringHelper toStringHelper(Object paramObject)
{
return new ToStringHelper(simpleName(paramObject.getClass()), null);
}
public static ToStringHelper toStringHelper(String paramString)
{
return new ToStringHelper(paramString, null);
}
public static final class ToStringHelper
{
private final String className;
private ValueHolder holderHead = new ValueHolder(null);
private ValueHolder holderTail = this.holderHead;
private boolean omitNullValues = false;
private ToStringHelper(String paramString)
{
this.className = ((String)Preconditions.checkNotNull(paramString));
}
private ValueHolder addHolder()
{
ValueHolder localValueHolder = new ValueHolder(null);
this.holderTail.next = localValueHolder;
this.holderTail = localValueHolder;
return localValueHolder;
}
private ToStringHelper addHolder(@Nullable Object paramObject)
{
addHolder().value = paramObject;
return this;
}
private ToStringHelper addHolder(String paramString, @Nullable Object paramObject)
{
ValueHolder localValueHolder = addHolder();
localValueHolder.value = paramObject;
localValueHolder.name = ((String)Preconditions.checkNotNull(paramString));
return this;
}
public ToStringHelper add(String paramString, char paramChar)
{
return addHolder(paramString, String.valueOf(paramChar));
}
public ToStringHelper add(String paramString, double paramDouble)
{
return addHolder(paramString, String.valueOf(paramDouble));
}
public ToStringHelper add(String paramString, float paramFloat)
{
return addHolder(paramString, String.valueOf(paramFloat));
}
public ToStringHelper add(String paramString, int paramInt)
{
return addHolder(paramString, String.valueOf(paramInt));
}
public ToStringHelper add(String paramString, long paramLong)
{
return addHolder(paramString, String.valueOf(paramLong));
}
public ToStringHelper add(String paramString, @Nullable Object paramObject)
{
return addHolder(paramString, paramObject);
}
public ToStringHelper add(String paramString, boolean paramBoolean)
{
return addHolder(paramString, String.valueOf(paramBoolean));
}
public ToStringHelper addValue(char paramChar)
{
return addHolder(String.valueOf(paramChar));
}
public ToStringHelper addValue(double paramDouble)
{
return addHolder(String.valueOf(paramDouble));
}
public ToStringHelper addValue(float paramFloat)
{
return addHolder(String.valueOf(paramFloat));
}
public ToStringHelper addValue(int paramInt)
{
return addHolder(String.valueOf(paramInt));
}
public ToStringHelper addValue(long paramLong)
{
return addHolder(String.valueOf(paramLong));
}
public ToStringHelper addValue(@Nullable Object paramObject)
{
return addHolder(paramObject);
}
public ToStringHelper addValue(boolean paramBoolean)
{
return addHolder(String.valueOf(paramBoolean));
}
public ToStringHelper omitNullValues()
{
this.omitNullValues = true;
return this;
}
public String toString()
{
boolean bool = this.omitNullValues;
Object localObject1 = "";
StringBuilder localStringBuilder = new StringBuilder(32).append(this.className).append('{');
ValueHolder localValueHolder = this.holderHead.next;
while (localValueHolder != null)
{
Object localObject2;
if (bool)
{
localObject2 = localObject1;
if (localValueHolder.value == null);
}
else
{
localStringBuilder.append((String)localObject1);
localObject2 = ", ";
if (localValueHolder.name != null)
localStringBuilder.append(localValueHolder.name).append('=');
localStringBuilder.append(localValueHolder.value);
}
localValueHolder = localValueHolder.next;
localObject1 = localObject2;
}
return (String)(String)'}';
}
private static final class ValueHolder
{
String name;
ValueHolder next;
Object value;
}
}
}
/* Location: C:\Users\c_jealom1\Documents\Scripts\Android\Fathom_com.brynk.fathom\Fathom_com.brynk.fathom-dex2jar.jar
* Qualified Name: com.facebook.common.internal.Objects
* JD-Core Version: 0.6.0
*/
|
[
"jean-francois.lombardo@exfo.com"
] |
jean-francois.lombardo@exfo.com
|
ede55bc72c6b3c37c32c87bb8d16d0c314202fa1
|
da6e646b9303b4be34446927f2f8f3062757aec4
|
/src/net/minecraft/network/play/server/S2BPacketChangeGameState.java
|
97a1acb5bb589d29797e0ce7aa0eaa5b6bbe0391
|
[] |
no_license
|
RainbowyDev/HawkClientSRC
|
f12fbecb43b7eb502208a1ea91baf55110d1abe7
|
81829724db6ecf9cdf07b3468df14c3d860b3475
|
refs/heads/main
| 2023-04-20T21:31:01.940981
| 2021-04-28T14:39:24
| 2021-04-28T14:39:24
| 362,495,695
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,780
|
java
|
package net.minecraft.network.play.server;
import java.io.*;
import net.minecraft.network.*;
import net.minecraft.network.play.*;
public class S2BPacketChangeGameState implements Packet
{
private /* synthetic */ int state;
private /* synthetic */ float field_149141_c;
public S2BPacketChangeGameState(final int llllllllllllllllIlIlIIIIlIIIlIIl, final float llllllllllllllllIlIlIIIIlIIIlIll) {
this.state = llllllllllllllllIlIlIIIIlIIIlIIl;
this.field_149141_c = llllllllllllllllIlIlIIIIlIIIlIll;
}
@Override
public void writePacketData(final PacketBuffer llllllllllllllllIlIlIIIIIlllllII) throws IOException {
llllllllllllllllIlIlIIIIIlllllII.writeByte(this.state);
llllllllllllllllIlIlIIIIIlllllII.writeFloat(this.field_149141_c);
}
@Override
public void processPacket(final INetHandler llllllllllllllllIlIlIIIIIllIlIlI) {
this.processPacket((INetHandlerPlayClient)llllllllllllllllIlIlIIIIIllIlIlI);
}
public S2BPacketChangeGameState() {
}
public void processPacket(final INetHandlerPlayClient llllllllllllllllIlIlIIIIIllllIII) {
llllllllllllllllIlIlIIIIIllllIII.handleChangeGameState(this);
}
public int func_149138_c() {
return this.state;
}
public float func_149137_d() {
return this.field_149141_c;
}
static {
__OBFID = "CL_00001301";
MESSAGE_NAMES = new String[] { "tile.bed.notValid" };
}
@Override
public void readPacketData(final PacketBuffer llllllllllllllllIlIlIIIIlIIIIIlI) throws IOException {
this.state = llllllllllllllllIlIlIIIIlIIIIIlI.readUnsignedByte();
this.field_149141_c = llllllllllllllllIlIlIIIIlIIIIIlI.readFloat();
}
}
|
[
"Tecnio@users.noreply.github.com"
] |
Tecnio@users.noreply.github.com
|
a473574b89d95729b6af56b54cc1f5eee643a6e8
|
149704dbb4150b932197bf0aafb66541e82d719e
|
/Introducao_a_Design_Patterns/Aulas/aula6/parte4/StaticSingleton.java
|
d134ec7e4f933d146a71e9248a5b7cc39c097b08
|
[] |
no_license
|
fa3io/Introducao-a-Design-Patterns
|
ce3a1794bb61f4028b1e54e8e999d1e537fb1373
|
c0f9e7a3761eecb0407e47e954a0da05ef9cd3fe
|
refs/heads/master
| 2020-05-26T19:32:21.492835
| 2015-01-17T23:00:13
| 2015-01-17T23:00:13
| 23,962,655
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 130
|
java
|
package aula6.parte4;
public class StaticSingleton {
public static final StaticSingleton instance = new StaticSingleton();
}
|
[
"fa3io.santos.alves@gmail.com"
] |
fa3io.santos.alves@gmail.com
|
8b3d2cf55d77cafd68260d5cda1052325600f90a
|
da770a961a9b446b7b1760909eb4e49a694a2533
|
/src/test/java/com/learn/test/IocTest_Aop.java
|
5c83349d8953230139a778a7c0d6d9f7b0dc02a6
|
[] |
no_license
|
LJLintermittent/spring-annotation
|
22116c64a49333f432ab6cbd5e26b02994f9c65e
|
cd36b830ae7cd6b215e66e9966cc3751becd9742
|
refs/heads/master
| 2023-05-26T14:03:46.083513
| 2021-06-09T08:18:02
| 2021-06-09T08:18:02
| 375,277,130
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 538
|
java
|
package com.learn.test;
import com.learn.aop.MathCalculator;
import com.learn.config.MainConfigOfAOP;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class IocTest_Aop {
@Test
public void test01(){
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MainConfigOfAOP.class);
MathCalculator mathCalculator = context.getBean(MathCalculator.class);
mathCalculator.div(10,2);
context.close();
}
}
|
[
"18066550996@163.com"
] |
18066550996@163.com
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.