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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b625c276857780d45e941f67279c972c80858e16 | cf729a7079373dc301d83d6b15e2451c1f105a77 | /adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201601/cm/DataServiceInterfacegetCriterionBidLandscape.java | d28bc8f988257f5bf15df38970c7ae95b3dbf1a7 | [] | no_license | cvsogor/Google-AdWords | 044a5627835b92c6535f807ea1eba60c398e5c38 | fe7bfa2ff3104c77757a13b93c1a22f46e98337a | refs/heads/master | 2023-03-23T05:49:33.827251 | 2021-03-17T14:35:13 | 2021-03-17T14:35:13 | 348,719,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,334 | java |
package com.google.api.ads.adwords.jaxws.v201601.cm;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* Returns a list of {@link CriterionBidLandscape}s for the criteria specified in the selector.
* In the result, the returned {@link LandscapePoint}s are grouped into
* {@link CriterionBidLandscape}s by their criteria, and numberResults of paging limits the total
* number of {@link LandscapePoint}s instead of number of {@link CriterionBidLandscape}s.
*
* @param serviceSelector Selects the entities to return bid landscapes for.
* @return A list of bid landscapes.
* @throws ApiException when there is at least one error with the request.
*
*
* <p>Java class for getCriterionBidLandscape element declaration.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <element name="getCriterionBidLandscape">
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="serviceSelector" type="{https://adwords.google.com/api/adwords/cm/v201601}Selector" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </element>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"serviceSelector"
})
@XmlRootElement(name = "getCriterionBidLandscape")
public class DataServiceInterfacegetCriterionBidLandscape {
protected Selector serviceSelector;
/**
* Gets the value of the serviceSelector property.
*
* @return
* possible object is
* {@link Selector }
*
*/
public Selector getServiceSelector() {
return serviceSelector;
}
/**
* Sets the value of the serviceSelector property.
*
* @param value
* allowed object is
* {@link Selector }
*
*/
public void setServiceSelector(Selector value) {
this.serviceSelector = value;
}
}
| [
"vacuum13@gmail.com"
] | vacuum13@gmail.com |
1f71f648d308ee6ea5ead2d56f9ba70d088759d5 | 100ab1a0a6faa2f972d7a64fc85a68095efd7c2b | /upload-file/src/main/java/com/github/jengo/b/FormFieldKeyValuePair.java | 8808d2349941556a2887854518bec3adbb7f473f | [] | no_license | jengowong/test | 9d3210328026ced7d6100fde4bd84fbaa83a87a5 | 55ad62619b117e483777304e6b3833c7eb191dd3 | refs/heads/master | 2016-08-10T18:30:36.049965 | 2015-11-23T02:35:35 | 2015-11-23T02:35:35 | 46,535,786 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,184 | java | package com.github.jengo.b;
import java.io.Serializable;
/**
* 一个POJO。用于处理普通表单域形如key=value对的数据
*/
public class FormFieldKeyValuePair implements Serializable {
private static final long serialVersionUID = 1L;
// The form field used for receiving user's input,
// such as "username" in "<input type="text" name="username"/>"
private String key;
// The value entered by user in the corresponding form field,
// such as "Patrick" the above mentioned form field "username"
private String value;
public FormFieldKeyValuePair(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public String toString() {
StringBuilder strBuilder = new StringBuilder();
strBuilder.append("key=").append(key)
.append("value=").append(value);
return strBuilder.toString();
}
}
| [
"wangzhenguo02@meituan.com"
] | wangzhenguo02@meituan.com |
cf0257b22a1dfb4a9c6dee22dd76dec522fc6c36 | 06ef12912a506d23854988904eb6f686abd98dd0 | /benchmarks/src/aeminium/webserver/Client.java | b35b955369e1d2a5f134314cc5faf7d8fe5c4672 | [] | no_license | autolock-anonymous/autolock-benchmark | bac4fd2981e42a334fd0b102e91390be2f449c7a | b3ecb1c7f0cf9eb87eed977617fb4e83cd0a9a69 | refs/heads/master | 2022-12-21T03:17:30.380261 | 2020-06-08T12:28:06 | 2020-06-08T12:28:06 | 297,629,037 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,085 | java | package aeminium.webserver.withlock;
import java.io.*;
import java.net.*;
import java.util.*;
import top.liebes.anno.Perm;
import java.util.concurrent.locks.ReentrantReadWriteLock;
public class Client {
@Perm(requires="no permission in alive",ensures="no permission in alive") public static void main( String argv[]){
long start=System.nanoTime();
try {
Socket socketClient=new Socket("localhost",3330);
System.out.println("Client: " + "Connection Established");
BufferedReader reader=new BufferedReader(new InputStreamReader(socketClient.getInputStream()));
BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(socketClient.getOutputStream()));
String serverMsg;
writer.write("12\r\n");
writer.write("10\r\n");
writer.flush();
while ((serverMsg=reader.readLine()) != null) {
System.out.println("Client: " + serverMsg);
}
long elapsed=System.nanoTime() - start;
System.out.println("time=" + elapsed / 1000000);
}
catch ( Exception e) {
e.printStackTrace();
}
}
}
| [
"wanghaichi0403@gmail.com"
] | wanghaichi0403@gmail.com |
ebdf724568d9cfbe11c45ac4be1ac6049dba354f | 967ee71257e3b1e1392c38f3e2c9b260c3b9d7a1 | /salt-module/src/test/java/org/saltframework/module/ModuleConfigurationTest.java | 20cacc2b33d2ac65d4d24ac022eb041201bcbf1b | [
"MIT"
] | permissive | syakuis/saltframework | b08c99eec88397acf9798edafb932d4000e431c2 | 8b26b55bb8e73c6e4bd776c5034b4bb7a1c44c9f | refs/heads/master | 2021-10-27T04:29:56.610994 | 2021-10-16T07:13:45 | 2021-10-16T07:13:45 | 131,927,259 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,851 | java | package org.saltframework.module;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.saltframework.module.bean.factory.ModuleContextManagerFactoryBean;
import org.saltframework.module.bean.factory.ModuleRedefinitionAspectFactoryBean;
import org.springframework.aop.Advisor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
/**
* @author Seok Kyun. Choi. 최석균 (Syaku)
* @since 2018. 4. 6.
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = Setting.class)
public class ModuleConfigurationTest {
@Autowired
private ModuleContextManager moduleContextManager;
@Test
public void test() {
Assert.assertNotNull(moduleContextManager);
}
}
@Configuration
class Setting {
@Bean
public ModuleContextManagerFactoryBean moduleContextManager() {
ModuleContextManagerFactoryBean bean = new ModuleContextManagerFactoryBean();
bean.setBasePackages("org.saltframework.module.test");
return bean;
}
@Bean
public ModuleContextService moduleContextService() {
return new BasicModuleContextService();
}
@Bean
public Advisor moduleContextAspect() {
ModuleRedefinitionAspectFactoryBean bean = new ModuleRedefinitionAspectFactoryBean(
moduleContextManager().getObject(), moduleContextService()
);
return bean.getObject();
}
}
class BasicModuleContextService implements ModuleContextService {
@Override
public List<Module> getModules() {
return null;
}
@Override
public Module getModule(String moduleId) {
return null;
}
}
| [
"syaku@naver.com"
] | syaku@naver.com |
fc61003889fc7bd08122b68d9e274317c90a4406 | a11ba1b53c0e1e978b5f4f55a38b4ff5b13d5e36 | /metastore/src/main/java/org/apache/hop/metastore/stores/xml/XmlMetaStoreCache.java | 2967212ca571674754a894e2b496d4fa66e2d45a | [
"Apache-2.0"
] | permissive | lipengyu/hop | 157747f4da6d909a935b4510e01644935333fef9 | 8afe35f0705f44d78b5c33c1ba3699f657f8b9dc | refs/heads/master | 2020-09-12T06:31:58.176011 | 2019-11-11T21:17:59 | 2019-11-11T21:17:59 | 222,341,727 | 1 | 0 | Apache-2.0 | 2019-11-18T01:50:19 | 2019-11-18T01:50:18 | null | UTF-8 | Java | false | false | 4,245 | java | /*!
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License, version 2.1 as published by the Free Software
* Foundation.
*
* You should have received a copy of the GNU Lesser General Public License along with this
* program; if not, you can obtain a copy at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* or from the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* 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 Lesser General Public License for more details.
*
* Copyright (c) 2002-2017 Hitachi Vantara.. All rights reserved.
*/
package org.apache.hop.metastore.stores.xml;
import java.util.Map;
import org.apache.hop.metastore.api.IMetaStoreElementType;
/**
* This interface describes cache object for XmlMetaStore.
*
*/
public interface XmlMetaStoreCache {
/**
* Register elementType id in a namespace with elementTypeName
*
* @param namespace
* the namespace to register the type in
* @param elementTypeName
* the type's name
* @param elementTypeId
* the type's id
*/
void registerElementTypeIdForName( String namespace, String elementTypeName, String elementTypeId );
/**
* Find an elementType id in a namespace by elementTypeName
*
* @param namespace
* the namespace to look in
* @param elementTypeName
* the type's name
* @return the type's id or null if the type name couldn't be found in cache
*/
String getElementTypeIdByName( String namespace, String elementTypeName );
/**
* Unregister an elementType id in namespace
*
* @param namespace
* the namespace to look in
* @param elementTypeId
* the id of the type to remove
*/
void unregisterElementTypeId( String namespace, String elementTypeId );
/**
* Register an element id in a namespace with elementType and elementTypeName
*
* @param namespace
* the namespace to reference
* @param elementType
* the element type to use
* @param elementName
* the element's name
* @param elementId
* the element's id. XmlMetaStoreCache doesn't register element's id with null value.
*/
void registerElementIdForName( String namespace, IMetaStoreElementType elementType, String elementName, String elementId );
/**
* Find an element id in a namespace with elementType and elementTypeName
*
* @param namespace
* the namespace to look in
* @param elementType
* the element type to search
* @param elementName
* the element's name
* @return the element's id or null if no element name could be matched
*/
String getElementIdByName( String namespace, IMetaStoreElementType elementType, String elementName );
/**
* Unregister an element id for namespace and elementType
*
* @param namespace
* the namespace to reference
* @param elementType
* the element type to use
* @param elementId
* the id of the element to remove
*/
void unregisterElementId( String namespace, IMetaStoreElementType elementType, String elementId );
/**
* Register processed file with fullPath and last modified date
*
* @param fullPath
* the full path to file including its name
* @param lastModified
* the last modified time
*/
void registerProcessedFile( String fullPath, long lastModified );
/**
* @return map [full path -> last modified time] of registered processed files.
*/
Map<String, Long> getProcessedFiles();
/**
* Unregister processed file with fullPath
*
* @param fullPath
* the full path to file including its name
*/
void unregisterProcessedFile( String fullPath );
/**
* Clear the cache.
*/
void clear();
}
| [
"mattcasters@gmail.com"
] | mattcasters@gmail.com |
50e08ee32f0bc9c28cf687a8444926ef097cc746 | 13c2d3db2d49c40c74c2e6420a9cd89377f1c934 | /program_data/JavaProgramData/3/2592.java | 29af90e76d5864b90ec3dabd819a631cb481d091 | [
"MIT"
] | permissive | qiuchili/ggnn_graph_classification | c2090fefe11f8bf650e734442eb96996a54dc112 | 291ff02404555511b94a4f477c6974ebd62dcf44 | refs/heads/master | 2021-10-18T14:54:26.154367 | 2018-10-21T23:34:14 | 2018-10-21T23:34:14 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 871 | java | package <missing>;
public class GlobalMembers
{
public static int Main()
{
int n;
int k;
String tempVar = ConsoleInput.scanfRead();
if (tempVar != null)
{
n = Integer.parseInt(tempVar);
}
String tempVar2 = ConsoleInput.scanfRead();
if (tempVar2 != null)
{
k = Integer.parseInt(tempVar2);
}
int[] a = new int[1000];
int[] b = new int[1000];
int[][] sz = new int[1000][1000];
int i;
int j;
for (i = 0;i < n;i++)
{
String tempVar3 = ConsoleInput.scanfRead();
if (tempVar3 != null)
{
a[i] = Integer.parseInt(tempVar3);
}
b[i] = a[i];
}
int m = 0;
for (i = 0;i < n;i++)
{
for (j = 0;j < n;j++)
{
sz[i][j] = a[i] + b[j];
if (sz[i][j] == k)
{
m = 1;
}
}
}
if (m == 1)
{
System.out.print("yes");
}
if (m == 0)
{
System.out.print("no");
}
return 0;
}
}
| [
"y.yu@open.ac.uk"
] | y.yu@open.ac.uk |
9892418a411ce1b68d4cfd057a459a81f1b71e59 | 350a535e3e0fd67af9ad130d1342a8f5deb759df | /src/main/java/com/ileng/modules/sys/service/ILogService.java | 64591f468b7946d5d1185fcd945b2f2284aa9f96 | [] | no_license | xjLeng/forum | a6088173ea98009ba9f698b52b7ec631b2b0c550 | fd9fea3a28b5ee401788f45eb3f4061902b4bea9 | refs/heads/master | 2020-06-26T07:11:48.161650 | 2017-08-27T08:40:21 | 2017-08-27T08:40:21 | 96,981,373 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 300 | java | package com.ileng.modules.sys.service;
import com.ileng.core.common.service.ICommonService;
import com.ileng.modules.sys.entity.Log;
/**
* @Title:
* @Description:
* @author jeeweb
* @date 2017-02-21 16:49:56
* @version V1.0
*
*/
public interface ILogService extends ICommonService<Log> {
}
| [
"18085137706@163.com"
] | 18085137706@163.com |
4ed3cb6a3a49d2d9fe5f949e3c5cc161a8d6b2fc | 0b82313fcb6c0adf71da7c88fb148424d9307446 | /web-console/src/main/java/com/ztgm/base/pojo/ManagerRole.java | 6cff3f7cccb801e12f0adaf429d600ca73276926 | [
"Apache-2.0"
] | permissive | kxjl168/jmqtt | 9777e9800e23d3552f5e4bcd84e2a26c1c2f71a3 | e03a24e16d6262c9bd0c4b781bb968bbd48c27e9 | refs/heads/master | 2020-09-24T16:55:28.962202 | 2020-02-14T05:31:13 | 2020-02-14T05:31:13 | 225,802,304 | 0 | 0 | Apache-2.0 | 2019-12-04T07:08:07 | 2019-12-04T07:08:06 | null | UTF-8 | Java | false | false | 1,125 | java | /**
* @(#)ManagerRole.java 2018-11-14
*
* Copyright (C),2017-2018, ZHONGTONGGUOMAI TECHNOLOGY NANJING
* Co.,Ltd. All Rights Reserved.
* GMWL PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.ztgm.base.pojo;
import java.io.Serializable;
/**
* 后台用户-角色关系
* ManagerRole.java.
*
* @author zj
* @version 1.0.1 2018年11月14日
* @revision zj 2018年11月14日
* @since 1.0.1
*/
public class ManagerRole implements Serializable {
private String id;
private String sysManagerId;
private String sysRoleId;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
public String getSysManagerId() {
return sysManagerId;
}
public void setSysManagerId(String sysManagerId) {
this.sysManagerId = sysManagerId == null ? null : sysManagerId.trim();
}
public String getSysRoleId() {
return sysRoleId;
}
public void setSysRoleId(String sysRoleId) {
this.sysRoleId = sysRoleId == null ? null : sysRoleId.trim();
}
} | [
"kxjl168@foxmail.com"
] | kxjl168@foxmail.com |
faa01c8cb1769229925c33f39ef78d1cc7b2f120 | 85bdd78080bec5243ca0da3b6fae6453215bf85a | /wms-saas/src/main/java/com/zlsrj/wms/saas/rest/RedisRestController.java | 306a27f2137963723699a438a8b7695d8ec34f63 | [] | no_license | myxland/wms-cloud | 67404ea41e02c3b1507ff89120dacae639bc6b6e | 10eb69bde00707bd79ed241c8400cbbed1bda378 | refs/heads/master | 2021-05-22T16:05:06.048111 | 2020-03-19T13:12:24 | 2020-03-19T13:12:24 | 252,992,797 | 0 | 3 | null | 2020-04-04T12:37:09 | 2020-04-04T12:37:08 | null | UTF-8 | Java | false | false | 884 | java | package com.zlsrj.wms.saas.rest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.zlsrj.wms.saas.service.RedisService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
@Api(value = "Redis", tags = { "Redis操作接口" })
@RestController
@Slf4j
public class RedisRestController {
@Autowired
private RedisService<String,String> redisService;
@ApiOperation(value = "redis设置值")
@RequestMapping(value = "/redis/set", method = RequestMethod.GET)
public Object setValue() {
redisService.setValue("t", new java.util.Date().toString());
String d = redisService.getValue("t");
return d;
}
}
| [
"378297869@qq.com"
] | 378297869@qq.com |
2957edc657ca20cbe371b1433489ddd3911e2f56 | 688ee54f310d78c724efa9b0e5f258d6310d023b | /rb-server-master/rb-server-app/src/test/java/net/readybid/auth/invitation/InvitationImplAssert.java | 2dd3f5c4abfe2154616a81c1492ea7ec13c3bd64 | [] | no_license | Ans123/ReadyBid | 344e027839563922c338c6a3261cda5441111f81 | 50186b710b52048358005ce15d56ed783ed00607 | refs/heads/master | 2020-04-07T23:57:28.054043 | 2018-11-23T12:55:54 | 2018-11-23T12:55:54 | 158,831,718 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,991 | java | package net.readybid.auth.invitation;
import net.readybid.test_utils.RbAbstractAssert;
public class InvitationImplAssert extends RbAbstractAssert<InvitationImplAssert, InvitationImpl> {
public static InvitationImplAssert that(InvitationImpl actual) {
return new InvitationImplAssert(actual);
}
private InvitationImplAssert(InvitationImpl actual) {
super(actual, InvitationImplAssert.class);
}
public InvitationImplAssert hasId(Object expected) {
assertFieldEquals("id", String.valueOf(expected), String.valueOf(actual.getId()));
return this;
}
public InvitationImplAssert hasFirstName(Object expected) {
assertFieldEquals("first name", expected, actual.getFirstName());
return this;
}
public InvitationImplAssert hasLastName(Object expected) {
assertFieldEquals("last name", expected, actual.getLastName());
return this;
}
public InvitationImplAssert hasEmailAddress(Object expected) {
assertFieldEquals("email address", expected, actual.getEmailAddress());
return this;
}
public InvitationImplAssert hasPhone(Object expected) {
assertFieldEquals("phone", expected, actual.getPhone());
return this;
}
public InvitationImplAssert hasJobTitle(Object expected) {
assertFieldEquals("job title", expected, actual.getJobTitle());
return this;
}
public InvitationImplAssert hasAccountId(Object expected) {
assertFieldEquals("account id", String.valueOf(expected), String.valueOf(actual.getAccountId()));
return this;
}
public InvitationImplAssert hasAccountName(Object expected) {
assertFieldEquals("account name", expected, actual.getAccountName());
return this;
}
public InvitationImplAssert hasTargetId(Object expected) {
assertFieldEquals("target id", String.valueOf(expected), String.valueOf(actual.getTargetId()));
return this;
}
} | [
"kiplnet13@konstantinfosolutions.com"
] | kiplnet13@konstantinfosolutions.com |
c55480a2b3e4ef7f4cfc507b7864a750f91fb361 | 6bdcc2e0e6cddf16b54dfdee29427c91f5bff3fc | /admin/doris.admin.core/src/main/java/com/alibaba/doris/admin/service/impl/ValueParseUtil.java | d2b0ea5e4268fe0ff51686dc5566fe83af99f3e9 | [
"MIT",
"LicenseRef-scancode-public-domain-disclaimer",
"FSFAP",
"Apache-2.0"
] | permissive | Happy-sc/Doris-api | 2d15185c99243843ec6a275f58c6b5ea281581cc | 51508ef1b8407ee9c7b4d9f87178e2d653a5ffa2 | refs/heads/master | 2021-01-23T15:58:32.067904 | 2017-09-07T10:04:48 | 2017-09-07T10:04:48 | 102,718,780 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,859 | java | /**
* Project: skyline.service
*
* File Created at 2011-6-1
* $Id$
*
* Copyright 1999-2100 Alibaba.com Corporation Limited.
* All rights reserved.
*
* This software is the confidential and proprietary information of
* Alibaba Company. ("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 Alibaba.com.
*/
package com.alibaba.doris.admin.service.impl;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
/**
* 根据类型解析数据:字符转成指定的类型, 比如数字。
*
* @author mian.hem
*/
public final class ValueParseUtil {
public static final String DEF_NULL = "null";
public static final String DEF_EMPTY = "empty";
private ValueParseUtil() {
}
/**
* 采用缺省的默认值策略,获取内置的默认值,
*
* @param clazz
* @return
*/
@SuppressWarnings("unchecked")
private static <T> T getInternalDefaultValue(Class<T> clazz) {
if (!clazz.isPrimitive()) {
return null;
}
if (Short.TYPE.equals(clazz)) {
return (T)Short.valueOf((short) 0);
}
if (Integer.TYPE.equals(clazz)) {
return (T)Integer.valueOf(0);
}
if (Long.TYPE.equals(clazz)) {
return (T)Long.valueOf(0);
}
if (Boolean.TYPE.equals(clazz)) {
return (T)Boolean.valueOf(false);
}
if (Float.TYPE.equals(clazz)) {
return (T)Float.valueOf(0);
}
if (Double.TYPE.equals(clazz)) {
return (T)Double.valueOf(0);
}
if (Byte.TYPE.equals(clazz)) {
return (T)Byte.valueOf((byte) 0);
}
if (Character.TYPE.equals(clazz)) {
return (T) Character.valueOf('\0');
}
return null;
}
/**
* 转换String类型的值到指定的类型 如果没有定义,则采用缺省的默认值策略:
*
* <pre>
* short, int, long, float 等数值类型: 0
* char, byte: 0
* String: null
* Map, List: null
* Integer, Long, Float 等数值对象: null
* Date: null
* array: null
* </pre>
*
* @param strValue
* @param clazz
* @return
*/
@SuppressWarnings("unchecked")
public static <T> T parseStringValue(String strValue, Class<T> clazz, boolean autoDefault) {
if (DEF_NULL.equals(strValue)) {
if (!clazz.isPrimitive()) {
return null;
}
if (autoDefault) {
return (T) getInternalDefaultValue(clazz);
} else {
return null;
}
}
if (DEF_EMPTY.equals(strValue)) {
if (clazz.isArray()) {
return (T) Array.newInstance(clazz.getComponentType(), 0);
}
if (Map.class.isAssignableFrom(clazz)) {
return (T) Collections.EMPTY_MAP;
}
if (List.class.isAssignableFrom(clazz)) {
return (T) new ArrayList<Object>();
}
if (Set.class.isAssignableFrom(clazz)) {
return (T) new HashSet<Object>();
}
if (String.class.equals(clazz)) {
return (T) StringUtils.EMPTY;
}
if (Character.TYPE.equals(clazz) || Character.class.equals(clazz)) {
return (T) Character.valueOf(' ');
}
if (autoDefault) {
return (T) getInternalDefaultValue(clazz);
} else {
return null;
}
}
if (StringUtils.isBlank(strValue)) {// 采用缺省的默认值策略
if (autoDefault) {
return (T) getInternalDefaultValue(clazz);
} else {
return null;
}
} else {
if (String.class.equals(clazz)) {
return (T) strValue;
}
if (Short.TYPE.equals(clazz) || Short.class.equals(clazz)) {
return (T)Short.valueOf(strValue);
}
if (Integer.TYPE.equals(clazz) || Integer.class.equals(clazz)) {
return (T)Integer.valueOf(strValue);
}
if (Long.TYPE.equals(clazz) || Long.class.equals(clazz)) {
return (T)Long.valueOf(strValue);
}
if (Boolean.TYPE.equals(clazz) || Boolean.class.equals(clazz)) {
return (T)Boolean.valueOf(strValue);
}
if (Float.TYPE.equals(clazz) || Float.class.equals(clazz)) {
return (T)Float.valueOf(strValue);
}
if (Double.TYPE.equals(clazz) || Double.class.equals(clazz)) {
return (T)Double.valueOf(strValue);
}
if (Byte.TYPE.equals(clazz) || Byte.class.equals(clazz)) {
return (T)Byte.valueOf(strValue);
}
if (Character.TYPE.equals(clazz) || Character.class.equals(clazz)) {
return (T)Character.valueOf(strValue.charAt(0));
}
if (clazz.isArray()) {
final Class<?> componentType = clazz.getComponentType();
// String[]
if (String.class.equals(componentType)) {
return (T) StringUtils.split(strValue, ',');
}
// 处理char[]
if (Character.TYPE.equals(componentType)) {
return (T) strValue.toCharArray();
}
if (Character.class.equals(componentType)) {
final char[] tmp = strValue.toCharArray();
final Character[] result = new Character[tmp.length];
for (int i = 0; i < result.length; i++) {
result[i] = tmp[i];
}
return (T)result;
}
if (Byte.TYPE.equals(componentType)
|| Byte.class.equals(componentType)) {
return (T) (strValue == null ? null : strValue.getBytes());
}
}
}
return null;
}
public static <T> T parseStringValue(String strValue, Class<T> clazz) {
return parseStringValue(strValue, clazz, true);
}
}
| [
"zhihui.li@intel.com"
] | zhihui.li@intel.com |
2697444dc1fa11438beff4e61e8c6734bedf53cb | 8a98577c5995449677ede2cbe1cc408c324efacc | /Big_Clone_Bench_files_used/bcb_reduced/3/selected/978034.java | 6a05c4eade1df382ed041ed2af7e5b7f43e6b183 | [
"MIT"
] | permissive | pombredanne/lsh-for-source-code | 9363cc0c9a8ddf16550ae4764859fa60186351dd | fac9adfbd98a4d73122a8fc1a0e0cc4f45e9dcd4 | refs/heads/master | 2020-08-05T02:28:55.370949 | 2017-10-18T23:57:08 | 2017-10-18T23:57:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 992 | java | package joliex.security;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import jolie.runtime.FaultException;
import jolie.runtime.JavaService;
import jolie.runtime.Value;
public class MessageDigestService extends JavaService {
public String md5(Value request) throws FaultException {
MessageDigest md = null;
try {
md = MessageDigest.getInstance("MD5");
md.update(request.strValue().getBytes("UTF8"));
} catch (UnsupportedEncodingException e) {
throw new FaultException("UnsupportedOperation", e);
} catch (NoSuchAlgorithmException e) {
throw new FaultException("UnsupportedOperation", e);
}
int radix;
if ((radix = request.getFirstChild("radix").intValue()) < 2) {
radix = 16;
}
return new BigInteger(1, md.digest()).toString(radix);
}
}
| [
"nishima@mymail.vcu.edu"
] | nishima@mymail.vcu.edu |
3ce541130d119fc5129086a005d0b51e10ab2f5e | 139b96e65688b2a8b09cab0b070a8f50a630f6ed | /Project/ebweb2019/src/main/java/vn/softdreams/ebweb/web/rest/dto/ResultCalculateOWDTO.java | 5478465b1954174e8f6c6ef2d41d78594fa672b8 | [] | no_license | hoangpham1997/ChanDoi | 785945b93c11c0081888f45c93b57de7de5d45f7 | 2e62bf65b690ebbf36a7f14bdbdaedae4fe16b36 | refs/heads/master | 2022-09-14T08:08:58.914426 | 2020-07-06T15:10:18 | 2020-07-06T15:10:18 | 242,865,582 | 0 | 0 | null | 2022-09-01T23:29:37 | 2020-02-24T23:24:29 | Java | UTF-8 | Java | false | false | 657 | java | package vn.softdreams.ebweb.web.rest.dto;
import vn.softdreams.ebweb.domain.ViewVoucherNo;
import java.util.List;
public class ResultCalculateOWDTO {
private List<ViewVoucherNo> voucherResultDTOs;
private Integer status;
public ResultCalculateOWDTO() {
}
public List<ViewVoucherNo> getVoucherResultDTOs() {
return voucherResultDTOs;
}
public void setVoucherResultDTOs(List<ViewVoucherNo> voucherResultDTOs) {
this.voucherResultDTOs = voucherResultDTOs;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
}
| [
"hoangpham28121997@gmail.com"
] | hoangpham28121997@gmail.com |
5fae4466d346347d1619913e6cec93e74623cde9 | 0b4844d550c8e77cd93940e4a1d8b06d0fbeabf7 | /JavaSource/dream/ass/base/dao/AssBaseListDAO.java | 676da92b10c6eaad222ebe2a1624e2be4da957df | [] | no_license | eMainTec-DREAM/DREAM | bbf928b5c50dd416e1d45db3722f6c9e35d8973c | 05e3ea85f9adb6ad6cbe02f4af44d941400a1620 | refs/heads/master | 2020-12-22T20:44:44.387788 | 2020-01-29T06:47:47 | 2020-01-29T06:47:47 | 236,912,749 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 1,532 | java | package dream.ass.base.dao;
import java.util.List;
import common.bean.User;
import dream.ass.base.dto.AssBaseCommonDTO;
/**
* 설비등급 평가기준 - List DAO
* @author kim21017
* @version $Id: AssBaseListDAO.java,v 1.0 2015/12/02 09:12:40 kim21017 Exp $
* @since 1.0
*
*/
public interface AssBaseListDAO
{
/**
* FIND LIST
* @param assBaseCommonDTO
* @param user
* @return
* @throws Exception
*/
public List findList(AssBaseCommonDTO assBaseCommonDTO, User user) throws Exception;
/**
* DELETE HDR LIST
* @param id
* @param user
* @return
* @throws Exception
*/
public int deleteList(String id, User user) throws Exception;
/**
* DELETE GRADE LIST
* @param id
* @param user
* @return
* @throws Exception
*/
public int deleteGradeList(String id, User user) throws Exception;
/**
* DELETE POINT LIST
* @param id
* @param user
* @return
* @throws Exception
*/
public int deletePointList(String id, User user) throws Exception;
/**
* DELETE VALUE LIST
* @param id
* @param user
* @return
* @throws Exception
*/
public int deleteValList(String id, User user) throws Exception;
/**
* FIND LIST COUNT
* @param assBaseCommonDTO
* @param user
* @return
* @throws Exception
*/
public String findTotalCount(AssBaseCommonDTO assBaseCommonDTO, User user) throws Exception;
} | [
"HN4741@10.31.0.185"
] | HN4741@10.31.0.185 |
778fb38408b55c1b572573eadc2776158c28bdf3 | 0cc3358e3e8f81b854f9409d703724f0f5ea2ff7 | /src/za/co/mmagon/jwebswing/base/html/InputRadioType.java | 46d1c870d8f389bfbad307b526b310f4de1dd6f7 | [] | no_license | jsdelivrbot/JWebMP-CompleteFree | c229dd405fe44d6c29ab06eedaecb7a733cbb183 | d5f020a19165418eb21507204743e596bee2c011 | refs/heads/master | 2020-04-10T15:12:35.635284 | 2018-12-10T01:03:58 | 2018-12-10T01:03:58 | 161,101,028 | 0 | 0 | null | 2018-12-10T01:45:25 | 2018-12-10T01:45:25 | null | UTF-8 | Java | false | false | 1,196 | java | /*
* Copyright (C) 2017 Marc Magon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package za.co.mmagon.jwebswing.base.html;
import za.co.mmagon.jwebswing.base.html.attributes.InputRadioTypeAttributes;
import za.co.mmagon.jwebswing.base.html.attributes.InputTypes;
/**
*
* @author GedMarc
* @param <J>
*/
public class InputRadioType<J extends InputRadioType> extends Input<InputRadioTypeAttributes, J>
{
private static final long serialVersionUID = 1L;
/**
* Constructs a new check box
*/
public InputRadioType()
{
super(InputTypes.Radio);
}
}
| [
"ged_marc@hotmail.com"
] | ged_marc@hotmail.com |
0f3241e0dba3cbba3757a42149dd515bd7ca6347 | afa2efacde40f198d83719f044e43a3d312a1331 | /data-model/src/main/java/io/micronaut/data/annotation/Join.java | 070269a918af4ec7b9809f6f5780753a2cda5e08 | [
"Apache-2.0"
] | permissive | pollend/micronaut-data | da7111c73a499d2a9d8270b4010c3e0d0d1a8b2e | 45c5a9eb4fb5cfa197b38e94e49348914f904cb8 | refs/heads/master | 2020-12-23T10:38:05.562576 | 2020-01-29T16:49:29 | 2020-01-29T16:49:29 | 237,127,897 | 2 | 0 | Apache-2.0 | 2020-01-30T02:56:54 | 2020-01-30T02:56:53 | null | UTF-8 | Java | false | false | 1,548 | java | /*
* Copyright 2017-2019 original 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.micronaut.data.annotation;
import io.micronaut.data.annotation.repeatable.JoinSpecifications;
import java.lang.annotation.*;
/**
* A @Join defines how a join for a particular association path should be generated.
*
* @author graemerocher
* @since 1.0
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.ANNOTATION_TYPE, ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
@Repeatable(JoinSpecifications.class)
public @interface Join {
/**
* @return The path to join.
*/
String value();
/**
* @return The join type. For JPA this is JOIN FETCH.
*/
Type type() default Type.FETCH;
/**
* @return The alias prefix to use for the join
*/
String alias() default "";
/**
* The type of join.
*/
enum Type {
DEFAULT,
LEFT,
LEFT_FETCH,
RIGHT,
RIGHT_FETCH,
FETCH,
INNER,
OUTER
}
}
| [
"graeme.rocher@gmail.com"
] | graeme.rocher@gmail.com |
e2e5195bf2d1696f526fca6c8c2931755016bbb3 | 036b13f99c161e13ca9a3f3c5262db38544131f7 | /1_java/Chapter12_pattern/src/strategy/academy/modulelization/Student.java | 772356ec12998d68a71fae03bc5ab4e2cb8728f7 | [] | no_license | highwindLeos/Webstudy-In-TheJoeun | 4e442c1ad500232ad69ae11c2a9faa8634ca8ed3 | 06b779765551e617cf37499336d6741720f23fa8 | refs/heads/master | 2022-12-22T10:46:37.241449 | 2020-07-28T09:54:03 | 2020-07-28T09:54:03 | 132,757,543 | 0 | 0 | null | 2022-12-16T01:05:47 | 2018-05-09T13:00:52 | HTML | WINDOWS-1252 | Java | false | false | 593 | java | package strategy.academy.modulelization;
import strategy.academy.inter.GetStudentPay;
import strategy.academy.inter.JobStudy;
public class Student extends Person {
private String ban;
public Student(String id, String name,String ban) {
setId(id);
setName(name);
this.ban = ban;
setJob(new JobStudy());
setPay(new GetStudentPay());
}
@Override
public void print() {
System.out.println("[ID] : " + getId() + "\t [À̸§] : " + getName() + "\t [¹Ý] : " + ban);
}
public String getBan() {
return ban;
}
public void setBan(String ban) {
this.ban = ban;
}
}
| [
"highwind26@gmail.com"
] | highwind26@gmail.com |
41f9b134aec8e3574b1b79750f69383fe355b685 | 09d0ddd512472a10bab82c912b66cbb13113fcbf | /TestApplications/WhereYouGo-0.9.3-beta/DecompiledCode/Procyon/src/main/java/android/support/v4/media/session/MediaSessionCompatApi21.java | 02c20e5d9caf3fc863f594b33807d3d30ea8bf7b | [] | no_license | sgros/activity_flow_plugin | bde2de3745d95e8097c053795c9e990c829a88f4 | 9e59f8b3adacf078946990db9c58f4965a5ccb48 | refs/heads/master | 2020-06-19T02:39:13.865609 | 2019-07-08T20:17:28 | 2019-07-08T20:17:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,111 | java | //
// Decompiled by Procyon v0.5.34
//
package android.support.v4.media.session;
import android.media.MediaDescription;
import android.media.Rating;
import android.content.Intent;
import android.os.ResultReceiver;
import android.media.session.MediaSession$Token;
import java.util.Iterator;
import android.media.session.MediaSession$QueueItem;
import java.util.ArrayList;
import java.util.List;
import android.media.VolumeProvider;
import android.media.AudioAttributes$Builder;
import android.media.session.PlaybackState;
import android.media.MediaMetadata;
import android.app.PendingIntent;
import android.media.session.MediaSession$Callback;
import android.os.Handler;
import android.os.Bundle;
import android.os.Parcelable;
import android.media.session.MediaSession;
import android.content.Context;
import android.support.annotation.RequiresApi;
import android.annotation.TargetApi;
@TargetApi(21)
@RequiresApi(21)
class MediaSessionCompatApi21
{
public static Object createCallback(final Callback callback) {
return new CallbackProxy(callback);
}
public static Object createSession(final Context context, final String s) {
return new MediaSession(context, s);
}
public static Parcelable getSessionToken(final Object o) {
return (Parcelable)((MediaSession)o).getSessionToken();
}
public static boolean isActive(final Object o) {
return ((MediaSession)o).isActive();
}
public static void release(final Object o) {
((MediaSession)o).release();
}
public static void sendSessionEvent(final Object o, final String s, final Bundle bundle) {
((MediaSession)o).sendSessionEvent(s, bundle);
}
public static void setActive(final Object o, final boolean active) {
((MediaSession)o).setActive(active);
}
public static void setCallback(final Object o, final Object o2, final Handler handler) {
((MediaSession)o).setCallback((MediaSession$Callback)o2, handler);
}
public static void setExtras(final Object o, final Bundle extras) {
((MediaSession)o).setExtras(extras);
}
public static void setFlags(final Object o, final int flags) {
((MediaSession)o).setFlags(flags);
}
public static void setMediaButtonReceiver(final Object o, final PendingIntent mediaButtonReceiver) {
((MediaSession)o).setMediaButtonReceiver(mediaButtonReceiver);
}
public static void setMetadata(final Object o, final Object o2) {
((MediaSession)o).setMetadata((MediaMetadata)o2);
}
public static void setPlaybackState(final Object o, final Object o2) {
((MediaSession)o).setPlaybackState((PlaybackState)o2);
}
public static void setPlaybackToLocal(final Object o, final int legacyStreamType) {
final AudioAttributes$Builder audioAttributes$Builder = new AudioAttributes$Builder();
audioAttributes$Builder.setLegacyStreamType(legacyStreamType);
((MediaSession)o).setPlaybackToLocal(audioAttributes$Builder.build());
}
public static void setPlaybackToRemote(final Object o, final Object o2) {
((MediaSession)o).setPlaybackToRemote((VolumeProvider)o2);
}
public static void setQueue(final Object o, final List<Object> list) {
if (list == null) {
((MediaSession)o).setQueue((List)null);
}
else {
final ArrayList<MediaSession$QueueItem> queue = new ArrayList<MediaSession$QueueItem>();
final Iterator<MediaSession$QueueItem> iterator = list.iterator();
while (iterator.hasNext()) {
queue.add(iterator.next());
}
((MediaSession)o).setQueue((List)queue);
}
}
public static void setQueueTitle(final Object o, final CharSequence queueTitle) {
((MediaSession)o).setQueueTitle(queueTitle);
}
public static void setSessionActivity(final Object o, final PendingIntent sessionActivity) {
((MediaSession)o).setSessionActivity(sessionActivity);
}
public static Object verifySession(final Object o) {
if (o instanceof MediaSession) {
return o;
}
throw new IllegalArgumentException("mediaSession is not a valid MediaSession object");
}
public static Object verifyToken(final Object o) {
if (o instanceof MediaSession$Token) {
return o;
}
throw new IllegalArgumentException("token is not a valid MediaSession.Token object");
}
interface Callback extends MediaSessionCompatApi19.Callback
{
void onCommand(final String p0, final Bundle p1, final ResultReceiver p2);
void onCustomAction(final String p0, final Bundle p1);
void onFastForward();
boolean onMediaButtonEvent(final Intent p0);
void onPause();
void onPlay();
void onPlayFromMediaId(final String p0, final Bundle p1);
void onPlayFromSearch(final String p0, final Bundle p1);
void onRewind();
void onSkipToNext();
void onSkipToPrevious();
void onSkipToQueueItem(final long p0);
void onStop();
}
static class CallbackProxy<T extends Callback> extends MediaSession$Callback
{
protected final T mCallback;
public CallbackProxy(final T mCallback) {
this.mCallback = mCallback;
}
public void onCommand(final String s, final Bundle bundle, final ResultReceiver resultReceiver) {
((Callback)this.mCallback).onCommand(s, bundle, resultReceiver);
}
public void onCustomAction(final String s, final Bundle bundle) {
((Callback)this.mCallback).onCustomAction(s, bundle);
}
public void onFastForward() {
((Callback)this.mCallback).onFastForward();
}
public boolean onMediaButtonEvent(final Intent intent) {
return ((Callback)this.mCallback).onMediaButtonEvent(intent) || super.onMediaButtonEvent(intent);
}
public void onPause() {
((Callback)this.mCallback).onPause();
}
public void onPlay() {
((Callback)this.mCallback).onPlay();
}
public void onPlayFromMediaId(final String s, final Bundle bundle) {
((Callback)this.mCallback).onPlayFromMediaId(s, bundle);
}
public void onPlayFromSearch(final String s, final Bundle bundle) {
((Callback)this.mCallback).onPlayFromSearch(s, bundle);
}
public void onRewind() {
((Callback)this.mCallback).onRewind();
}
public void onSeekTo(final long n) {
((MediaSessionCompatApi18.Callback)this.mCallback).onSeekTo(n);
}
public void onSetRating(final Rating rating) {
((MediaSessionCompatApi19.Callback)this.mCallback).onSetRating(rating);
}
public void onSkipToNext() {
((Callback)this.mCallback).onSkipToNext();
}
public void onSkipToPrevious() {
((Callback)this.mCallback).onSkipToPrevious();
}
public void onSkipToQueueItem(final long n) {
((Callback)this.mCallback).onSkipToQueueItem(n);
}
public void onStop() {
((Callback)this.mCallback).onStop();
}
}
static class QueueItem
{
public static Object createItem(final Object o, final long n) {
return new MediaSession$QueueItem((MediaDescription)o, n);
}
public static Object getDescription(final Object o) {
return ((MediaSession$QueueItem)o).getDescription();
}
public static long getQueueId(final Object o) {
return ((MediaSession$QueueItem)o).getQueueId();
}
}
}
| [
"crash@home.home.hr"
] | crash@home.home.hr |
f8a3aaee97d161141e7a1b10958d7ed2edf499de | a85740bfb7def38be54ed1425b7a4a06f9bdcf6a | /mybatis-generator-systests-ibatis2-java5/target/generated-sources/mybatis-generator/mbg/test/ib2j5/generated/conditional/dao/FieldsblobsDAOImpl.java | acdfd80499c68a58bb8841a600b07b2c77ee469f | [
"Apache-2.0"
] | permissive | tianbohao1010/generator-mybatis-generator-1.3.2 | 148841025fa9d52bcda4d529227092892ff2ee89 | f917b1ae550850b76e7ac0c967da60dc87fc6eb5 | refs/heads/master | 2020-03-19T07:18:35.135680 | 2018-06-05T01:41:21 | 2018-06-05T01:41:21 | 136,103,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,914 | java | package mbg.test.ib2j5.generated.conditional.dao;
import com.ibatis.sqlmap.client.SqlMapClient;
import java.sql.SQLException;
import java.util.List;
import mbg.test.ib2j5.generated.conditional.model.Fieldsblobs;
import mbg.test.ib2j5.generated.conditional.model.FieldsblobsExample;
import mbg.test.ib2j5.generated.conditional.model.FieldsblobsWithBLOBs;
public class FieldsblobsDAOImpl implements FieldsblobsDAO {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
private SqlMapClient sqlMapClient;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public FieldsblobsDAOImpl() {
super();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public void setSqlMapClient(SqlMapClient sqlMapClient) {
this.sqlMapClient = sqlMapClient;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public SqlMapClient getSqlMapClient() {
return sqlMapClient;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public int countByExample(FieldsblobsExample example) throws SQLException {
Integer count = (Integer) sqlMapClient.queryForObject("FIELDSBLOBS.countByExample", example);
return count;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public int deleteByExample(FieldsblobsExample example) throws SQLException {
int rows = sqlMapClient.delete("FIELDSBLOBS.deleteByExample", example);
return rows;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public void insert(FieldsblobsWithBLOBs record) throws SQLException {
sqlMapClient.insert("FIELDSBLOBS.insert", record);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public void insertSelective(FieldsblobsWithBLOBs record) throws SQLException {
sqlMapClient.insert("FIELDSBLOBS.insertSelective", record);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
@SuppressWarnings("unchecked")
public List<FieldsblobsWithBLOBs> selectByExampleWithBLOBs(FieldsblobsExample example) throws SQLException {
List<FieldsblobsWithBLOBs> list = sqlMapClient.queryForList("FIELDSBLOBS.selectByExampleWithBLOBs", example);
return list;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
@SuppressWarnings("unchecked")
public List<Fieldsblobs> selectByExampleWithoutBLOBs(FieldsblobsExample example) throws SQLException {
List<Fieldsblobs> list = sqlMapClient.queryForList("FIELDSBLOBS.selectByExample", example);
return list;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public int updateByExampleSelective(FieldsblobsWithBLOBs record, FieldsblobsExample example) throws SQLException {
UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
int rows = sqlMapClient.update("FIELDSBLOBS.updateByExampleSelective", parms);
return rows;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public int updateByExample(FieldsblobsWithBLOBs record, FieldsblobsExample example) throws SQLException {
UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
int rows = sqlMapClient.update("FIELDSBLOBS.updateByExampleWithBLOBs", parms);
return rows;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
public int updateByExample(Fieldsblobs record, FieldsblobsExample example) throws SQLException {
UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
int rows = sqlMapClient.update("FIELDSBLOBS.updateByExample", parms);
return rows;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table FIELDSBLOBS
*
* @mbggenerated Thu Dec 21 14:43:57 CST 2017
*/
protected static class UpdateByExampleParms extends FieldsblobsExample {
private Object record;
public UpdateByExampleParms(Object record, FieldsblobsExample example) {
super(example);
this.record = record;
}
public Object getRecord() {
return record;
}
}
} | [
"unicode1027@163.com"
] | unicode1027@163.com |
bf3fd41f161e42dc8e638f408026ce77821aebf1 | cf7e9fcaa002d7e3a2e4396831bf122fd1ac7bbc | /cards/src/main/java/org/rnd/jmagic/cards/VastwoodAnimist.java | 2f7ece508d290396d6693f300271c0ec1b82389d | [] | no_license | NorthFury/jmagic | 9b28d803ce6f8bf22f22eb41e2a6411bc11c8cdf | efe53d9d02716cc215456e2794a43011759322d9 | refs/heads/master | 2020-05-28T11:04:50.631220 | 2014-06-17T09:48:44 | 2014-06-17T09:48:44 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,666 | java | package org.rnd.jmagic.cards;
import static org.rnd.jmagic.Convenience.*;
import org.rnd.jmagic.engine.*;
import org.rnd.jmagic.engine.generators.*;
@Name("Vastwood Animist")
@Types({Type.CREATURE})
@SubTypes({SubType.ELF, SubType.ALLY, SubType.SHAMAN})
@ManaCost("2G")
@Printings({@Printings.Printed(ex = Expansion.WORLDWAKE, r = Rarity.UNCOMMON)})
@ColorIdentity({Color.GREEN})
public final class VastwoodAnimist extends Card
{
public static final class VastwoodAnimistAbility0 extends ActivatedAbility
{
public VastwoodAnimistAbility0(GameState state)
{
super(state, "(T): Target land you control becomes an X/X Elemental creature until end of turn, where X is the number of Allies you control. It's still a land.");
this.costsTap = true;
SetGenerator landsYouControl = Intersect.instance(LandPermanents.instance(), ControlledBy.instance(You.instance()));
SetGenerator target = targetedBy(this.addTarget(landsYouControl, "target land you control"));
SetGenerator X = Count.instance(ALLIES_YOU_CONTROL);
Animator animator = new Animator(target, X, X);
animator.addSubType(SubType.ELEMENTAL);
this.addEffect(createFloatingEffect("Target land you control becomes an X/X Elemental creature until end of turn, where X is the number of Allies you control. It's still a land.", animator.getParts()));
}
}
public VastwoodAnimist(GameState state)
{
super(state);
this.setPower(1);
this.setToughness(1);
// (T): Target land you control becomes an X/X Elemental creature until
// end of turn, where X is the number of Allies you control. It's still
// a land.
this.addAbility(new VastwoodAnimistAbility0(state));
}
}
| [
"robyter@gmail"
] | robyter@gmail |
e568469c0dfd3b9eae8ea84bc86bdc09ac310da8 | 8567264bdb581e6b566f7b2b710a9a38c5475115 | /testons/adapter/src/main/java/it/mate/testons/shared/utils/RenderUtils.java | 2d162805e9ac801477b9444dc9419b55d893ae03 | [] | no_license | demarcomsevthr/matemob | 5b64f747bebe619091aa9351b9520494d87cc982 | 28c551db99fb47605e4f53ee00733919c7aecde7 | refs/heads/master | 2021-01-17T16:00:34.805766 | 2018-10-18T14:35:10 | 2018-10-18T14:35:10 | 57,871,987 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package it.mate.testons.shared.utils;
public class RenderUtils {
public static String imageTextToHtml(String imageText, String imageType) {
if (imageText == null) {
return null;
}
imageText = !imageText.startsWith("data:") ? ("data:image/"+ imageType +";base64," + imageText) : imageText;
String html = "<img src='"+ imageText +"'/>";
return html;
}
}
| [
"demarco.m73@gmail.com"
] | demarco.m73@gmail.com |
51b4fffdb04f22124da24b483212142b7de1047c | 14746c4b8511abe301fd470a152de627327fe720 | /soroush-android-1.10.0_source_from_JADX/com/google/android/gms/internal/jy.java | 4f009e5755e5bb11815e7f02ffc333efe8e8af85 | [] | no_license | maasalan/soroush-messenger-apis | 3005c4a43123c6543dbcca3dd9084f95e934a6f4 | 29867bf53a113a30b1aa36719b1c7899b991d0a8 | refs/heads/master | 2020-03-21T21:23:20.693794 | 2018-06-28T19:57:01 | 2018-06-28T19:57:01 | 139,060,676 | 3 | 2 | null | null | null | null | UTF-8 | Java | false | false | 6,698 | java | package com.google.android.gms.internal;
public final class jy extends oc<jy> {
public Integer f18237a;
public Boolean f18238b;
public String f18239c;
public String f18240d;
public String f18241e;
public jy() {
this.f18237a = null;
this.f18238b = null;
this.f18239c = null;
this.f18240d = null;
this.f18241e = null;
this.H = null;
this.I = -1;
}
private final com.google.android.gms.internal.jy m16654b(com.google.android.gms.internal.nz r7) {
/* JADX: method processing error */
/*
Error: java.lang.NullPointerException
*/
/*
r6 = this;
L_0x0000:
r0 = r7.m5049a();
if (r0 == 0) goto L_0x0074;
L_0x0006:
r1 = 8;
if (r0 == r1) goto L_0x0041;
L_0x000a:
r1 = 16;
if (r0 == r1) goto L_0x0036;
L_0x000e:
r1 = 26;
if (r0 == r1) goto L_0x002f;
L_0x0012:
r1 = 34;
if (r0 == r1) goto L_0x0028;
L_0x0016:
r1 = 42;
if (r0 == r1) goto L_0x0021;
L_0x001a:
r0 = super.m12032a(r7, r0);
if (r0 != 0) goto L_0x0000;
L_0x0020:
return r6;
L_0x0021:
r0 = r7.m5059e();
r6.f18241e = r0;
goto L_0x0000;
L_0x0028:
r0 = r7.m5059e();
r6.f18240d = r0;
goto L_0x0000;
L_0x002f:
r0 = r7.m5059e();
r6.f18239c = r0;
goto L_0x0000;
L_0x0036:
r0 = r7.m5058d();
r0 = java.lang.Boolean.valueOf(r0);
r6.f18238b = r0;
goto L_0x0000;
L_0x0041:
r1 = r7.m5067l();
r2 = r7.m5062g(); Catch:{ IllegalArgumentException -> 0x006d }
switch(r2) {
case 0: goto L_0x004f;
case 1: goto L_0x004f;
case 2: goto L_0x004f;
case 3: goto L_0x004f;
case 4: goto L_0x004f;
default: goto L_0x004c;
}; Catch:{ IllegalArgumentException -> 0x006d }
L_0x004c:
r3 = new java.lang.IllegalArgumentException; Catch:{ IllegalArgumentException -> 0x006d }
goto L_0x0056; Catch:{ IllegalArgumentException -> 0x006d }
L_0x004f:
r2 = java.lang.Integer.valueOf(r2); Catch:{ IllegalArgumentException -> 0x006d }
r6.f18237a = r2; Catch:{ IllegalArgumentException -> 0x006d }
goto L_0x0000; Catch:{ IllegalArgumentException -> 0x006d }
L_0x0056:
r4 = 46; Catch:{ IllegalArgumentException -> 0x006d }
r5 = new java.lang.StringBuilder; Catch:{ IllegalArgumentException -> 0x006d }
r5.<init>(r4); Catch:{ IllegalArgumentException -> 0x006d }
r5.append(r2); Catch:{ IllegalArgumentException -> 0x006d }
r2 = " is not a valid enum ComparisonType"; Catch:{ IllegalArgumentException -> 0x006d }
r5.append(r2); Catch:{ IllegalArgumentException -> 0x006d }
r2 = r5.toString(); Catch:{ IllegalArgumentException -> 0x006d }
r3.<init>(r2); Catch:{ IllegalArgumentException -> 0x006d }
throw r3; Catch:{ IllegalArgumentException -> 0x006d }
L_0x006d:
r7.m5060e(r1);
r6.m12032a(r7, r0);
goto L_0x0000;
L_0x0074:
return r6;
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.jy.b(com.google.android.gms.internal.nz):com.google.android.gms.internal.jy");
}
public final /* synthetic */ oi mo3038a(nz nzVar) {
return m16654b(nzVar);
}
public final void mo1667a(oa oaVar) {
if (this.f18237a != null) {
oaVar.m5088a(1, this.f18237a.intValue());
}
if (this.f18238b != null) {
oaVar.m5092a(2, this.f18238b.booleanValue());
}
if (this.f18239c != null) {
oaVar.m5091a(3, this.f18239c);
}
if (this.f18240d != null) {
oaVar.m5091a(4, this.f18240d);
}
if (this.f18241e != null) {
oaVar.m5091a(5, this.f18241e);
}
super.mo1667a(oaVar);
}
protected final int mo1668b() {
int b = super.mo1668b();
if (this.f18237a != null) {
b += oa.m5075b(1, this.f18237a.intValue());
}
if (this.f18238b != null) {
this.f18238b.booleanValue();
b += oa.m5081c(16) + 1;
}
if (this.f18239c != null) {
b += oa.m5077b(3, this.f18239c);
}
if (this.f18240d != null) {
b += oa.m5077b(4, this.f18240d);
}
return this.f18241e != null ? b + oa.m5077b(5, this.f18241e) : b;
}
public final boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof jy)) {
return false;
}
jy jyVar = (jy) obj;
if (this.f18237a == null) {
if (jyVar.f18237a != null) {
return false;
}
} else if (!this.f18237a.equals(jyVar.f18237a)) {
return false;
}
if (this.f18238b == null) {
if (jyVar.f18238b != null) {
return false;
}
} else if (!this.f18238b.equals(jyVar.f18238b)) {
return false;
}
if (this.f18239c == null) {
if (jyVar.f18239c != null) {
return false;
}
} else if (!this.f18239c.equals(jyVar.f18239c)) {
return false;
}
if (this.f18240d == null) {
if (jyVar.f18240d != null) {
return false;
}
} else if (!this.f18240d.equals(jyVar.f18240d)) {
return false;
}
if (this.f18241e == null) {
if (jyVar.f18241e != null) {
return false;
}
} else if (!this.f18241e.equals(jyVar.f18241e)) {
return false;
}
if (this.H != null) {
if (!this.H.m5103a()) {
return this.H.equals(jyVar.H);
}
}
return jyVar.H == null || jyVar.H.m5103a();
}
public final int hashCode() {
int i = 0;
int hashCode = (((((((((((527 + getClass().getName().hashCode()) * 31) + (this.f18237a == null ? 0 : this.f18237a.intValue())) * 31) + (this.f18238b == null ? 0 : this.f18238b.hashCode())) * 31) + (this.f18239c == null ? 0 : this.f18239c.hashCode())) * 31) + (this.f18240d == null ? 0 : this.f18240d.hashCode())) * 31) + (this.f18241e == null ? 0 : this.f18241e.hashCode())) * 31;
if (this.H != null) {
if (!this.H.m5103a()) {
i = this.H.hashCode();
}
}
return hashCode + i;
}
}
| [
"Maasalan@riseup.net"
] | Maasalan@riseup.net |
f07f3f897459c3c3f09b79a35bfe205cae041eab | e59ccd9e58239f3fea1dd376cf7dc44b32768f44 | /java-basic/src/main/java/bitcamp/java100/ch21/ex5/proxy1/CalculatorProxy.java | ceeb36a9f85ca8966a29b834d5231ccc067ff7d2 | [] | no_license | zerox7066/bitcamp | 9cdb962478ce5d6f406fecfe6aae1db9cd2575b1 | 3759bf5c9b2c4d7ffa2cf37196e26e12478ccbe2 | refs/heads/master | 2021-09-03T14:04:30.247015 | 2018-01-09T15:35:15 | 2018-01-09T15:35:15 | 104,423,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 362 | java | package bitcamp.java100.ch21.ex5.proxy1;
public class CalculatorProxy implements Calculator {
Calculator realWorker = new CalculatorImpl();
@Override
public int plus(int a, int b) {
return realWorker.plus(a, b);
}
@Override
public int minus(int a, int b) {
return realWorker.minus(a, b);
}
}
| [
"dazzul@naver.com"
] | dazzul@naver.com |
716a886dff7f63a02c049b53767a55c7b0c4b406 | 647ec12ce50f06e7380fdbfb5b71e9e2d1ac03b4 | /com.tencent.minihd.qq/assets/exlibs.1.jar/classes.jar/com/tencent/mobileqq/newfriend/FriendSystemMessage.java | 0c6ec75016fe07938a2661c1b97d79def95fa2c6 | [] | no_license | tsuzcx/qq_apk | 0d5e792c3c7351ab781957bac465c55c505caf61 | afe46ef5640d0ba6850cdefd3c11badbd725a3f6 | refs/heads/main | 2022-07-02T10:32:11.651957 | 2022-02-01T12:41:38 | 2022-02-01T12:41:38 | 453,860,108 | 36 | 9 | null | 2022-01-31T09:46:26 | 2022-01-31T02:43:22 | Java | UTF-8 | Java | false | false | 714 | java | package com.tencent.mobileqq.newfriend;
public class FriendSystemMessage
extends NewFriendMessage
{
public FriendSystemMessage()
{
super(1);
}
public FriendSystemMessage(int paramInt)
{
super(1, paramInt);
}
public FriendSystemMessage(int paramInt, String paramString, long paramLong)
{
super(1);
this.o = paramInt;
this.jdField_a_of_type_JavaLangString = paramString;
this.jdField_a_of_type_Long = paramLong;
}
}
/* Location: L:\local\mybackup\temp\qq_apk\com.tencent.minihd.qq\assets\exlibs.1.jar\classes.jar
* Qualified Name: com.tencent.mobileqq.newfriend.FriendSystemMessage
* JD-Core Version: 0.7.0.1
*/ | [
"98632993+tsuzcx@users.noreply.github.com"
] | 98632993+tsuzcx@users.noreply.github.com |
d8fc6cc47e3138507cb3bfcc8f78e669e1c7e21c | e75be673baeeddee986ece49ef6e1c718a8e7a5d | /submissions/blizzard/Corpus/eclipse.jdt.ui/10278.java | ef897f9eee4b5d71b3553646e8e46cf7f04691a3 | [
"MIT"
] | permissive | zhendong2050/fse18 | edbea132be9122b57e272a20c20fae2bb949e63e | f0f016140489961c9e3c2e837577f698c2d4cf44 | refs/heads/master | 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 312 | java | package trycatch_in;
import java.net.MalformedURLException;
public class TestSuperConstructorCall {
static class A {
public A(int i) throws MalformedURLException {
}
}
static class B extends A {
public B() {
super(10);
}
}
}
| [
"tim.menzies@gmail.com"
] | tim.menzies@gmail.com |
eca354d612fc530805bbf61c4198ed19f2077594 | 22b533fe0c04e96226c81a3a6559e671543bb1f1 | /src/main/java/org/tinymediamanager/ThresholdLoggerFilter.java | a15192d09b9895239e5c6c59e941db95e38a1240 | [
"Apache-2.0"
] | permissive | kenti-lan/tinyPornManager | ff392f6ad12e54d1718d8eb2d33878a18c850993 | d53b0ada8d0211f5d52a887945ce0428f5a65591 | refs/heads/dev | 2023-08-21T23:09:57.934985 | 2021-10-07T16:17:17 | 2021-10-07T16:17:17 | 432,666,109 | 1 | 0 | Apache-2.0 | 2021-11-28T09:11:04 | 2021-11-28T09:11:04 | null | UTF-8 | Java | false | false | 1,366 | java | /*
* Copyright 2012 - 2020 Manuel Laggner
*
* 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.tinymediamanager;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.filter.Filter;
import ch.qos.logback.core.spi.FilterReply;
/**
* log only log messages which have an equal or higher level than the given one
*
* @Manuel Laggner
*/
public class ThresholdLoggerFilter extends Filter<ILoggingEvent> {
private final Level level;
public ThresholdLoggerFilter(Level level) {
this.level = level;
}
@Override
public FilterReply decide(ILoggingEvent event) {
if (!isStarted()) {
return FilterReply.NEUTRAL;
}
if (event.getLevel().isGreaterOrEqual(level)) {
return FilterReply.NEUTRAL;
}
else {
return FilterReply.DENY;
}
}
}
| [
"manuel.laggner@gmail.com"
] | manuel.laggner@gmail.com |
194ebdda2bf6c1dd5230372c3d674f6aed4a9b66 | 87ea840b387ae94f02f02e97b08bd9db0dc580eb | /src/main/java/com/apress/prospring4/ch4/SimpleBean.java | ebc13158b3f6996bc5edc34a7af1577ebda49ed5 | [] | no_license | py4ina/Spring4BOOK | 82213307eb8901aaabc9b0e79ad6922a241e7e29 | 88bf33b7357333e6d5e16563709055e93ebc0526 | refs/heads/master | 2021-04-26T16:47:23.468252 | 2019-01-05T14:53:01 | 2019-01-05T14:53:01 | 123,971,418 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,907 | java | package com.apress.prospring4.ch4;
import org.springframework.beans.factory.BeanCreationException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
public class SimpleBean {
private static final String DEFAULT_NAME = "Luke Skywalker";
private String name;
private int age = Integer.MIN_VALUE;
public void setName(String name) {
this.name = name;
}
public void setAge(int age) {
this.age = age;
}
public void init() {
System.out.println("Initializing bean");
if (name == null){
System.out.println("Using default name");
name = DEFAULT_NAME;
}
if (age == Integer.MIN_VALUE) {
throw new IllegalArgumentException("Уои must set the age property of any beans of type " +
SimpleBean.class);
}
}
@Override
public String toString() {
return "SimpleBean{" +
"name='" + name + '\'' +
", age=" + age +
'}';
}
public static void main(String[] args) {
GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
ctx.load("META-INF/spring/app-context-xml.xml");
ctx.refresh();
SimpleBean simpleBean1 = getBean("simpleBean1", ctx);
SimpleBean simpleBean2 = getBean("simpleBean2", ctx);
SimpleBean simpleBean3 = getBean("simpleBean3", ctx);
}
private static SimpleBean getBean(String beanName, ApplicationContext ctx) {
try {
SimpleBean bean = (SimpleBean) ctx.getBean(beanName);
System.out.println(bean);
return bean;
} catch (BeanCreationException e) {
System.out.println("An error occured in bean configuration: " + e.getMessage());
return null;
}
}
}
| [
"py4ina@gmail.com"
] | py4ina@gmail.com |
23cfb1a280faf9dd7a90b3130692e67284d10f2e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/1/1_7149fdf39503f8a276c375fdd93326db5e530296/SimplifyStartsWithTest/1_7149fdf39503f8a276c375fdd93326db5e530296_SimplifyStartsWithTest_s.java | f10a3f33e825d58d2a8db168ededf75839632ada | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 1,660 | java | package test.net.sourceforge.pmd.rules.optimization;
import test.net.sourceforge.pmd.testframework.SimpleAggregatorTst;
import test.net.sourceforge.pmd.testframework.TestDescriptor;
import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.RuleSetNotFoundException;
import net.sourceforge.pmd.PMD;
public class SimplifyStartsWithTest extends SimpleAggregatorTst {
private Rule rule;
public void setUp() throws RuleSetNotFoundException {
// on release this can go in optimizations ruleset
rule = findRule("rulesets/newrules.xml", "SimplifyStartsWith");
}
public void testAll() {
runTests(new TestDescriptor[] {
new TestDescriptor(TEST1, "failure case", 1, rule),
new TestDescriptor(TEST2, "startsWith multiple chars", 0, rule),
new TestDescriptor(TEST3, "startsWith defined on some other class, doesn't take a String", 0, rule),
});
}
private static final String TEST1 =
"public class Foo {" + PMD.EOL +
" public boolean bar(String x) {" + PMD.EOL +
" return x.startsWith(\"x\");" + PMD.EOL +
" }" + PMD.EOL +
"}";
private static final String TEST2 =
"public class Foo {" + PMD.EOL +
" public boolean bar(Fiddle x) {" + PMD.EOL +
" return x.startsWith(\"abc\");" + PMD.EOL +
" }" + PMD.EOL +
"}";
private static final String TEST3 =
"public class Foo {" + PMD.EOL +
" public boolean bar(Fiddle x) {" + PMD.EOL +
" return x.startsWith(123);" + PMD.EOL +
" }" + PMD.EOL +
"}";
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
8ab160874b0afee4a266a527c7ccc8c7390729d3 | c9da71648dfc400548884bc309cca823450e8663 | /OTAS-DM-Project/nWave-DM-Common/src/com/npower/dm/tracking/DMJobLoggerFactory.java | f0781ba88eb187c40cd0b8fbf5e7e8f29a12fdeb | [] | no_license | chrisyun/macho-project-home | 810f984601bd42bc8bf6879b278e2cde6230e1d8 | f79f18f980178ebd01d3e916829810e94fd7dc04 | refs/heads/master | 2016-09-05T17:10:18.021448 | 2014-05-22T07:46:09 | 2014-05-22T07:46:09 | 36,444,782 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,200 | java | /**
* $Header: /home/master/nWave-DM-Common/src/com/npower/dm/tracking/DMJobLoggerFactory.java,v 1.2 2008/08/04 11:01:33 zhao Exp $
* $Revision: 1.2 $
* $Date: 2008/08/04 11:01:33 $
*
* ===============================================================================================
* License, Version 1.1
*
* Copyright (c) 1994-2008 NPower Network Software Ltd. All rights reserved.
*
* This SOURCE CODE FILE, which has been provided by NPower as part
* of a NPower product for use ONLY by licensed users of the product,
* includes CONFIDENTIAL and PROPRIETARY information of NPower.
*
* USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS
* OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
* THE PRODUCT.
*
* IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD NPower, ITS RELATED
* COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
* OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
* OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
* OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
* OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
* CODE FILE.
* ===============================================================================================
*/
package com.npower.dm.tracking;
import com.npower.dm.tracking.writer.DMJobLogWriterChain;
import com.npower.dm.tracking.writer.DaoDMJobLogWriter;
import com.npower.dm.tracking.writer.SimpleDMJobLogWriter;
/**
* @author Zhao DongLu
* @version $Revision: 1.2 $ $Date: 2008/08/04 11:01:33 $
*/
public class DMJobLoggerFactory {
/**
*
*/
private DMJobLoggerFactory() {
super();
}
/**
* @return
*/
public static DMJobLoggerFactory newInstance() {
return new DMJobLoggerFactory();
}
/**
* @return
*/
public DMJobLogger getLogger() {
DMJobLogger logger = new DMJobLoggerImpl();
DMJobLogWriterChain writerChain = new DMJobLogWriterChain();
writerChain.add(new SimpleDMJobLogWriter());
writerChain.add(new DaoDMJobLogWriter());
logger.setWriter(writerChain);
return logger;
}
}
| [
"machozhao@bea0ad5c-f690-c3dd-0edd-70527fc306d2"
] | machozhao@bea0ad5c-f690-c3dd-0edd-70527fc306d2 |
ab620b242cf3f4f90351b2381fff0f626c1a6154 | 16b2a55c8d0a3b5557d940cebc5ae21c3002d5ec | /tradingplatform-admin/tradingplatform-admin-entity/src/main/java/com/secondhand/tradingplatformadminentity/entity/admin/shiro/UserRole.java | f9782dd120cf9daec0ad1beed2ee89935fe1c6f4 | [] | no_license | 810797860/tradingplatform | c89c866d0112caa3371e8e192678ee5b3eeafc57 | 1b5405fd6aed809adbb0c4e091799c982081e409 | refs/heads/master | 2022-10-18T19:30:55.069579 | 2020-08-06T01:54:20 | 2020-08-06T01:54:20 | 149,142,081 | 0 | 0 | null | 2022-10-12T20:18:54 | 2018-09-17T14:55:18 | JavaScript | UTF-8 | Java | false | false | 1,113 | java | package com.secondhand.tradingplatformadminentity.entity.admin.shiro;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableName;
import com.secondhand.tradingplatformcommon.base.BaseEntity.BaseEntity;
/**
* @author zhangjk
* @description : UserRole 实体类
* ---------------------------------
* @since 2018-11-22
*/
@TableName("s_base_user_role")
public class UserRole extends BaseEntity {
/**
* 序列化标志
*/
private static final long serialVersionUID = 1L;
@TableField("user_id")
private Long userId;
@TableField("role_id")
private Long roleId;
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRoleId() {
return roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
@Override
public String toString() {
return "UserRole{" +
", userId=" + userId +
", roleId=" + roleId +
"}";
}
}
| [
"810797860@qq.com"
] | 810797860@qq.com |
a35f11a39a296ae6f50ad1acce6a3a1a7a7fcab5 | 8d6e0c2eabcfc83b31d936f0a091b612bfba2b22 | /src/com/redmoon/oa/dataimport/service/IDataImport.java | 81994582760911eaab520e6cae1b41287c67b50e | [] | no_license | 503324754/ywoa | 0ed986949ceed0c0b1da0ed5126ea506dcaa325a | c9ffc5a73197ff3c5dad0dd59c72dbf0e72cf91f | refs/heads/master | 2023-05-30T19:42:12.478887 | 2021-06-15T12:00:56 | 2021-06-15T12:00:56 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 805 | java | package com.redmoon.oa.dataimport.service;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import com.redmoon.oa.dataimport.bean.DataImportBean;
/**
* @Description: 接口
* @author: 古月圣
* @Date: 2015-11-25下午04:06:05
*/
public interface IDataImport {
public abstract String getTemplatePath(HttpServletRequest request);
public abstract String importExcel(ServletContext application,
HttpServletRequest request);
public abstract DataImportBean getDataImportBean();
public abstract void setDataImportBean(DataImportBean dataImportBean);
public abstract String create(ServletContext application,
HttpServletRequest request);
public abstract String getErrorMessages();
public abstract String getRangeErrMsg(String field, String value);
}
| [
"bestfeng@163.com"
] | bestfeng@163.com |
fa3d5ae0be27ae998e1882187003a085ed835f92 | 6811fd178ae01659b5d207b59edbe32acfed45cc | /jira-project/jira-components/jira-core/src/main/java/com/atlassian/jira/config/properties/ApplicationPropertiesImpl.java | 0d72b51e5f1f68e72f2606df4a93b8199aeeb468 | [] | no_license | xiezhifeng/mysource | 540b09a1e3c62614fca819610841ddb73b12326e | 44f29e397a6a2da9340a79b8a3f61b3d51e331d1 | refs/heads/master | 2023-04-14T00:55:23.536578 | 2018-04-19T11:08:38 | 2018-04-19T11:08:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,848 | java | package com.atlassian.jira.config.properties;
import java.util.Collection;
import java.util.Locale;
import java.util.Map;
import com.atlassian.event.api.EventListener;
import com.atlassian.jira.EventComponent;
import com.atlassian.jira.event.ClearCacheEvent;
import com.atlassian.jira.util.LocaleParser;
import com.google.common.annotations.VisibleForTesting;
import com.opensymphony.util.TextUtils;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.log4j.Logger;
/**
* A class to manage the interface with a single property set, used for application properties
*/
@EventComponent
public class ApplicationPropertiesImpl implements ApplicationProperties
{
private static final Logger log = Logger.getLogger(ApplicationPropertiesImpl.class);
@VisibleForTesting
public static final String DEFAULT_ENCODING = "UTF-8";
private final ApplicationPropertiesStore applicationPropertiesStore;
private final Locale defaultLocale = Locale.getDefault();
public ApplicationPropertiesImpl(ApplicationPropertiesStore applicationPropertiesStore)
{
this.applicationPropertiesStore = applicationPropertiesStore;
}
@SuppressWarnings ({ "UnusedDeclaration" })
@EventListener
public void onClearCache(final ClearCacheEvent event)
{
refresh();
}
public String getText(final String name)
{
return this.applicationPropertiesStore.getTextFromDb(name);
}
public void setText(final String name, final String value)
{
applicationPropertiesStore.setText(name, value);
}
public String getString(final String name)
{
return applicationPropertiesStore.getStringFromDb(name);
}
public Collection<String> getDefaultKeys()
{
return getDefaultProperties().keySet();
}
public String getDefaultBackedString(final String name)
{
return applicationPropertiesStore.getString(name);
}
public String getDefaultBackedText(final String name)
{
String value = null;
try
{
value = getText(name);
}
catch (final Exception e)
{
log.warn("Exception getting property '" + name + "' from database. Using default");
}
if (value == null)
{
value = getDefaultString(name);
}
return value;
}
public String getDefaultString(final String name)
{
return getDefaultProperties().get(name);
}
public void setString(final String name, final String value)
{
applicationPropertiesStore.setString(name, value);
}
public boolean getOption(final String key)
{
return applicationPropertiesStore.getOption(key);
}
public Collection<String> getKeys()
{
return applicationPropertiesStore.getKeysStoredInDb();
}
public Map<String, Object> asMap()
{
return applicationPropertiesStore.getPropertiesAsMap();
}
public void setOption(final String key, final boolean value)
{
applicationPropertiesStore.setOption(key, value);
}
public String getEncoding()
{
String encoding = getString(APKeys.JIRA_WEBWORK_ENCODING);
if (!TextUtils.stringSet(encoding))
{
encoding = DEFAULT_ENCODING;
setString(APKeys.JIRA_WEBWORK_ENCODING, encoding);
}
return encoding;
}
public String getMailEncoding()
{
String encoding = getDefaultBackedString(APKeys.JIRA_MAIL_ENCODING);
if (!TextUtils.stringSet(encoding))
{
encoding = getEncoding();
}
return encoding;
}
public String getContentType()
{
return "text/html; charset=" + getEncoding();
}
public void refresh()
{
applicationPropertiesStore.refreshDbProperties();
}
@Override
public String toString()
{
return new ToStringBuilder(this).append("propertiesManager", applicationPropertiesStore).toString();
}
private Map<String, String> getDefaultProperties()
{
return applicationPropertiesStore.getDefaultsWithOverlays();
}
public Locale getDefaultLocale()
{
// The default locale almost never changes, but we must handle it correctly when it does.
// We store the Locale for the defaultLocale string, which is expensive to create, in a very small cache (map).
final String localeString = getDefaultBackedString(APKeys.JIRA_I18N_DEFAULT_LOCALE);
if (localeString != null)
{
return LocaleParser.parseLocale(localeString);
}
return defaultLocale;
}
public Collection<String> getStringsWithPrefix(final String prefix)
{
return applicationPropertiesStore.getStringsWithPrefixFromDb(prefix);
}
}
| [
"moink635@gmail.com"
] | moink635@gmail.com |
74d78235f1138c6951aa44ac5052321bf38772c4 | 857870ba40281e9f60a4955fa6325be10c086895 | /base-platform-msg/micro/src/main/java/com/taiji/config/RabbitConfig.java | 3a3051d2de549e0373d5acda6698126c95ec0f6b | [] | no_license | Qiang8/nmyj-micro | f22f6dba0a30128c4dca3ef1ab41c84ec2f8eb08 | 0be5efe946c25a36902c1abfa52e4ce619523228 | refs/heads/master | 2020-05-02T19:08:54.473917 | 2019-03-28T08:05:00 | 2019-03-28T08:05:00 | 178,150,820 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,302 | java | package com.taiji.config;
import org.springframework.amqp.core.*;
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* <p>Title:RabbitConfig.java</p >
* <p>Description: </p >
* <p>Copyright: 公共服务与应急管理战略业务本部 Copyright(c)2018</p >
* <p>Date:2018/11/7 10:01</p >
*
* @author scl (suncla@mail.taiji.com.cn)
* @version 1.0
*/
@Configuration
public class RabbitConfig {
@Bean
public MessageConverter jsonMessageConverter() {
return new Jackson2JsonMessageConverter();
}
@Bean
public RabbitTemplate rabbitTemplate(ConnectionFactory connectionFactory) {
RabbitTemplate template = new RabbitTemplate(connectionFactory);
template.setMessageConverter(jsonMessageConverter());
return template;
}
@Bean
FanoutExchange fanoutExchange() {
return new FanoutExchange("msgFanoutExchange");
}
}
| [
"18222693676@163.com"
] | 18222693676@163.com |
dc4fb82e580f837a914045da88e33f6689810a68 | 9dfb06fb888a7f5d79f590eb11f62618d893af93 | /bit manipulation/401. Binary Watch.java | a5260cd4cc39946cf5aa4aa9d8e94c87b74388d2 | [] | no_license | fanyang88/leetcode_java | ac1b009d2ae374a4a87c92610820af391ec530b8 | 73e145a7f8f5f76c1159e622ccc2c8f6ffa53f48 | refs/heads/master | 2022-07-20T00:47:04.826563 | 2022-07-18T22:25:37 | 2022-07-18T22:25:37 | 163,878,007 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,393 | java | /*
*A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).
Each LED represents a zero or one, with the least significant bit on the right.
For example, the above binary watch reads "3:25".
Given a non-negative integer n which represents the number of LEDs that are currently on, return all possible times the watch could represent.
Example:
Input: n = 1
Return: ["1:00", "2:00", "4:00", "8:00", "0:01", "0:02", "0:04", "0:08", "0:16", "0:32"]
Note:
The order of output does not matter.
The hour must not contain a leading zero, for example "01:00" is not valid, it should be "1:00".
The minute must be consist of two digits and may contain a leading zero, for example "10:2" is not valid, it should be "10:02".
*/
class Solution {
public List<String> readBinaryWatch(int num) {
List<String> res =new ArrayList<>();
for(int h=0; h<12; h++) {
for(int m=0; m<60; m++) {
if(countBit(h) + countBit(m) == num) {
String time = h+":" + (m<10? "0"+m : m);
res.add(time);
}
}
}
return res;
}
public int countBit(int num) {
int count=0;
while(num > 0) {
if((num & 1) >0) count++;
num = num >>1;
}
return count;
}
} | [
"fan.yang@oath.com"
] | fan.yang@oath.com |
bced669d6e278abb58d13a7e7d991445d54d41cf | 7b2b61dee4b85aff9d7fb44f40fcac0fd09b36a3 | /drools-model/drools-model-compiler/src/test/java/org/drools/modelcompiler/BaseModelTest.java | c1de6f5c51043c72d210baefcd5819b910d8e2df | [
"Apache-2.0"
] | permissive | FengZhou4/drools | 4dea9927385f16416eefa6c23987d0b3afc0e2b6 | 19eb7e968350ecbcc5da81656f02991baec06b92 | refs/heads/master | 2021-04-26T23:53:06.221936 | 2018-03-02T14:03:52 | 2018-03-02T14:03:52 | 123,874,804 | 1 | 0 | null | 2018-03-05T06:27:33 | 2018-03-05T06:27:33 | null | UTF-8 | Java | false | false | 6,493 | java | /*
* Copyright 2005 JBoss 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 org.drools.modelcompiler;
import java.util.List;
import java.util.UUID;
import java.util.stream.Collectors;
import org.drools.compiler.kie.builder.impl.InternalKieModule;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;
import org.kie.api.KieServices;
import org.kie.api.builder.KieBuilder;
import org.kie.api.builder.KieFileSystem;
import org.kie.api.builder.Message;
import org.kie.api.builder.ReleaseId;
import org.kie.api.builder.model.KieModuleModel;
import org.kie.api.runtime.ClassObjectFilter;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;
import static org.junit.Assert.fail;
@RunWith(Parameterized.class)
public abstract class BaseModelTest {
public static enum RUN_TYPE {
FLOW_DSL,
PATTERN_DSL,
STANDARD_FROM_DRL;
}
@Parameters(name = "{0}")
public static Object[] params() {
return new Object[]{
BaseModelTest.RUN_TYPE.STANDARD_FROM_DRL,
BaseModelTest.RUN_TYPE.FLOW_DSL,
BaseModelTest.RUN_TYPE.PATTERN_DSL
};
}
protected final CompilerTest.RUN_TYPE testRunType;
public BaseModelTest( CompilerTest.RUN_TYPE testRunType ) {
this.testRunType = testRunType;
}
protected KieSession getKieSession( String... rules ) {
return getKieSession(null, rules);
}
protected KieSession getKieSession(KieModuleModel model, String... stringRules) {
return getKieContainer( model, stringRules ).newKieSession();
}
protected KieContainer getKieContainer( KieModuleModel model, String... stringRules ) {
return getKieContainer( model, toKieFiles( stringRules ) );
}
protected KieContainer getKieContainer( KieModuleModel model, KieFile... stringRules ) {
KieServices ks = KieServices.get();
ReleaseId releaseId = ks.newReleaseId( "org.kie", "kjar-test-" + UUID.randomUUID(), "1.0" );
KieBuilder kieBuilder = createKieBuilder( ks, model, releaseId, stringRules );
return ks.newKieContainer( releaseId );
}
protected KieBuilder createKieBuilder( String... stringRules ) {
KieServices ks = KieServices.get();
ReleaseId releaseId = ks.newReleaseId( "org.kie", "kjar-test-" + UUID.randomUUID(), "1.0" );
return createKieBuilder( ks, null, releaseId, false, toKieFiles( stringRules ) );
}
protected KieBuilder createKieBuilder( KieServices ks, KieModuleModel model, ReleaseId releaseId, KieFile... stringRules ) {
return createKieBuilder( ks, model, releaseId, true, stringRules );
}
protected KieBuilder createKieBuilder( KieServices ks, KieModuleModel model, ReleaseId releaseId, boolean failIfBuildError, KieFile... stringRules ) {
ks.getRepository().removeKieModule( releaseId );
KieFileSystem kfs = ks.newKieFileSystem();
if ( model != null ) {
kfs.writeKModuleXML( model.toXML() );
}
kfs.writePomXML( KJARUtils.getPom( releaseId ) );
for (int i = 0; i < stringRules.length; i++) {
kfs.write( stringRules[i].path, stringRules[i].content );
}
KieBuilder kieBuilder;
if (testRunType == RUN_TYPE.FLOW_DSL) {
kieBuilder = ks.newKieBuilder(kfs).buildAll(ExecutableModelFlowProject.class);
} else if (testRunType == RUN_TYPE.PATTERN_DSL) {
kieBuilder = ks.newKieBuilder(kfs).buildAll(ExecutableModelProject.class);
} else {
kieBuilder = ks.newKieBuilder(kfs).buildAll();
}
if ( failIfBuildError ) {
List<Message> messages = kieBuilder.getResults().getMessages();
if ( !messages.isEmpty() ) {
fail( messages.toString() );
}
}
return kieBuilder;
}
protected KieModuleModel getDefaultKieModuleModel( KieServices ks ) {
KieModuleModel kproj = ks.newKieModuleModel();
kproj.newKieBaseModel( "kbase" ).setDefault( true ).newKieSessionModel( "ksession" ).setDefault( true );
return kproj;
}
public static <T> List<T> getObjectsIntoList(KieSession ksession, Class<T> clazz) {
return (List<T>) ksession.getObjects(new ClassObjectFilter(clazz)).stream().collect(Collectors.toList());
}
protected void createAndDeployJar( KieServices ks, ReleaseId releaseId, String... drls ) {
createAndDeployJar( ks, null, releaseId, drls );
}
protected void createAndDeployJar( KieServices ks, ReleaseId releaseId, KieFile... ruleFiles ) {
createAndDeployJar( ks, null, releaseId, ruleFiles );
}
protected void createAndDeployJar( KieServices ks, KieModuleModel model, ReleaseId releaseId, String... drls ) {
createAndDeployJar( ks, model, releaseId, toKieFiles( drls ) );
}
protected void createAndDeployJar( KieServices ks, KieModuleModel model, ReleaseId releaseId, KieFile... ruleFiles ) {
KieBuilder kieBuilder = createKieBuilder( ks, model, releaseId, ruleFiles );
InternalKieModule kieModule = (InternalKieModule) kieBuilder.getKieModule();
ks.getRepository().addKieModule( kieModule );
}
public static class KieFile {
public final String path;
public final String content;
public KieFile( int index, String content ) {
this( String.format("src/main/resources/r%d.drl", index), content );
}
public KieFile( String path, String content ) {
this.path = path;
this.content = content;
}
}
public KieFile[] toKieFiles(String[] stringRules) {
KieFile[] kieFiles = new KieFile[stringRules.length];
for (int i = 0; i < stringRules.length; i++) {
kieFiles[i] = new KieFile( i, stringRules[i] );
}
return kieFiles;
}
}
| [
"mario.fusco@gmail.com"
] | mario.fusco@gmail.com |
2fba0c54cc6f57908cd9392ecadd1ffaefc46573 | 4d25c1d27cc00c5d71f3513bb9f051ad6afa8368 | /src/com/lbins/FruitsBusiness/city/CityList.java | 829456bfc24aa7ddf6213b91da45c7ecd8af2cd9 | [] | no_license | eryiyi/FruitsBusiness | 147724e69950521cf49b4c85addaec7e1a79c544 | 57e0eccd2c8b8a6273d8351849df3b49b1c79914 | refs/heads/master | 2021-01-10T11:50:40.832316 | 2016-02-07T04:31:41 | 2016-02-07T04:31:41 | 51,229,495 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 7,415 | java | package com.lbins.FruitsBusiness.city;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.graphics.PixelFormat;
import android.os.Bundle;
import android.os.Handler;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import com.lbins.FruitsBusiness.R;
import com.lbins.FruitsBusiness.bean.BaseActivity;
import com.lbins.FruitsBusiness.db.DBManager;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
* �����б�
*
* @author sy
*
*/
public class CityList extends BaseActivity implements View.OnClickListener{
private BaseAdapter adapter;
private ListView mCityLit;
private TextView overlay;
private MyLetterListView letterListView;
private HashMap<String, Integer> alphaIndexer;// ��Ŵ��ڵĺ���ƴ������ĸ����֮��Ӧ���б�λ��
private String[] sections;// ��Ŵ��ڵĺ���ƴ������ĸ
private Handler handler;
private OverlayThread overlayThread;
private SQLiteDatabase database;
private ArrayList<CityModel> mCityNames;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.city_list);
mCityLit = (ListView) findViewById(R.id.city_list);
letterListView = (MyLetterListView) findViewById(R.id.cityLetterListView);
DBManager dbManager = new DBManager(this);
dbManager.openDateBase();
dbManager.closeDatabase();
database = SQLiteDatabase.openOrCreateDatabase(DBManager.DB_PATH + "/"
+ DBManager.DB_NAME, null);
mCityNames = getCityNames();
database.close();
letterListView
.setOnTouchingLetterChangedListener(new LetterListViewListener());
alphaIndexer = new HashMap<String, Integer>();
handler = new Handler();
overlayThread = new OverlayThread();
initOverlay();
setAdapter(mCityNames);
mCityLit.setOnItemClickListener(new CityListOnItemClick());
this.findViewById(R.id.back).setOnClickListener(this);
}
/**
* ����ݿ��ȡ�������
*
* @return
*/
private ArrayList<CityModel> getCityNames() {
ArrayList<CityModel> names = new ArrayList<CityModel>();
Cursor cursor = database.rawQuery(
"SELECT * FROM T_City ORDER BY NameSort", null);
for (int i = 0; i < cursor.getCount(); i++) {
cursor.moveToPosition(i);
CityModel cityModel = new CityModel();
cityModel.setCityName(cursor.getString(cursor
.getColumnIndex("CityName")));
cityModel.setNameSort(cursor.getString(cursor
.getColumnIndex("NameSort")));
names.add(cityModel);
}
return names;
}
@Override
public void onClick(View view) {
switch (view.getId()){
case R.id.back:
finish();
break;
}
}
/**
* �����б����¼�
*
* @author sy
*
*/
class CityListOnItemClick implements OnItemClickListener {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int pos,
long arg3) {
CityModel cityModel = (CityModel) mCityLit.getAdapter()
.getItem(pos);
// Toast.makeText(CityList.this, cityModel.getCityName(),
// Toast.LENGTH_SHORT).show();
save("city", cityModel.getCityName());
Intent intent = new Intent("select_city_success");
CityList.this.sendBroadcast(intent);
finish();
}
}
/**
* ΪListView����������
*
* @param list
*/
private void setAdapter(List<CityModel> list) {
if (list != null) {
adapter = new ListAdapter(this, list);
mCityLit.setAdapter(adapter);
}
}
/**
* ListViewAdapter
*
* @author sy
*
*/
private class ListAdapter extends BaseAdapter {
private LayoutInflater inflater;
private List<CityModel> list;
public ListAdapter(Context context, List<CityModel> list) {
this.inflater = LayoutInflater.from(context);
this.list = list;
alphaIndexer = new HashMap<String, Integer>();
sections = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
// ��ǰ����ƴ������ĸ
// getAlpha(list.get(i));
String currentStr = list.get(i).getNameSort();
// ��һ����ƴ������ĸ��������Ϊ�� ��
String previewStr = (i - 1) >= 0 ? list.get(i - 1)
.getNameSort() : " ";
if (!previewStr.equals(currentStr)) {
String name = list.get(i).getNameSort();
alphaIndexer.put(name, i);
sections[i] = name;
}
}
}
@Override
public int getCount() {
return list.size();
}
@Override
public Object getItem(int position) {
return list.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = inflater.inflate(R.layout.list_item, null);
holder = new ViewHolder();
holder.alpha = (TextView) convertView.findViewById(R.id.alpha);
holder.name = (TextView) convertView.findViewById(R.id.name);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.name.setText(list.get(position).getCityName());
String currentStr = list.get(position).getNameSort();
String previewStr = (position - 1) >= 0 ? list.get(position - 1)
.getNameSort() : " ";
if (!previewStr.equals(currentStr)) {
holder.alpha.setVisibility(View.VISIBLE);
holder.alpha.setText(currentStr);
} else {
holder.alpha.setVisibility(View.GONE);
}
return convertView;
}
private class ViewHolder {
TextView alpha;
TextView name;
}
}
// ��ʼ������ƴ������ĸ������ʾ��
private void initOverlay() {
LayoutInflater inflater = LayoutInflater.from(this);
overlay = (TextView) inflater.inflate(R.layout.overlay, null);
overlay.setVisibility(View.INVISIBLE);
WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,
WindowManager.LayoutParams.TYPE_APPLICATION,
WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE,
PixelFormat.TRANSLUCENT);
WindowManager windowManager = (WindowManager) this
.getSystemService(Context.WINDOW_SERVICE);
windowManager.addView(overlay, lp);
}
private class LetterListViewListener implements
MyLetterListView.OnTouchingLetterChangedListener {
@Override
public void onTouchingLetterChanged(final String s) {
if (alphaIndexer.get(s) != null) {
int position = alphaIndexer.get(s);
mCityLit.setSelection(position);
overlay.setText(sections[position]);
overlay.setVisibility(View.VISIBLE);
handler.removeCallbacks(overlayThread);
// �ӳ�һ���ִ�У���overlayΪ���ɼ�
handler.postDelayed(overlayThread, 1500);
}
}
}
// ����overlay���ɼ�
private class OverlayThread implements Runnable {
@Override
public void run() {
overlay.setVisibility(View.GONE);
}
}
} | [
"826321978@qq.com"
] | 826321978@qq.com |
61931eb91b8f2d40cf184d553bae2cf18ab2b694 | 2daea090c54d11688b7e2f40fbeeda22fe3d01f6 | /header/src/main/java/org/zstack/header/identity/APIAttachPolicyToUserGroupMsg.java | be685f506f4c97b20eaccac476ae8bbae0294cd7 | [
"Apache-2.0"
] | permissive | jxg01713/zstack | 1f0e474daa6ca4647d0481c7e44d86a860ac209c | 182fb094e9a6ef89cf010583d457a9bf4f033f33 | refs/heads/1.0.x | 2021-06-20T12:36:16.609798 | 2016-03-17T08:03:29 | 2016-03-17T08:03:29 | 197,339,567 | 0 | 0 | Apache-2.0 | 2021-03-19T20:23:19 | 2019-07-17T07:36:39 | Java | UTF-8 | Java | false | false | 939 | java | package org.zstack.header.identity;
import org.zstack.header.message.APIMessage;
import org.zstack.header.message.APIParam;
@Action(category = AccountConstant.ACTION_CATEGORY, accountOnly = true)
public class APIAttachPolicyToUserGroupMsg extends APIMessage implements AccountMessage {
@APIParam(checkAccount = true, operationTarget = true)
private String policyUuid;
@APIParam(checkAccount = true, operationTarget = true)
private String groupUuid;
@Override
public String getAccountUuid() {
return this.getSession().getAccountUuid();
}
public String getPolicyUuid() {
return policyUuid;
}
public void setPolicyUuid(String policyUuid) {
this.policyUuid = policyUuid;
}
public String getGroupUuid() {
return groupUuid;
}
public void setGroupUuid(String groupUuid) {
this.groupUuid = groupUuid;
}
}
| [
"xing5820@gmail.com"
] | xing5820@gmail.com |
2e5d736bbc91267a48feff28f065bd0917f6be5a | 35e46a270d1de548763c161c0dac554282a33d9d | /CSIS-DevR3/csis.domain/src/main/java/bo/gob/sin/sre/fac/domain/IRegistrarSolicitudCertificacionDomain.java | 28fcf01a00de67e30d3f69a741f436494ac55d61 | [] | no_license | cruz-victor/ServiciosSOAPyRESTJavaSpringBoot | e817e16c8518b3135a26d7ad7f6b0deb8066fe42 | f04a2b40b118d2d34269c4f954537025b67b3784 | refs/heads/master | 2023-01-07T11:09:30.758600 | 2020-11-15T14:01:08 | 2020-11-15T14:01:08 | 312,744,182 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,159 | java | package bo.gob.sin.sre.fac.domain;
import java.util.Date;
import bo.gob.sin.sre.fac.model.SreSolicitudCertificacion;
public interface IRegistrarSolicitudCertificacionDomain {
//IASC
public SreSolicitudCertificacion registrarSolicitudCertificacion(long pContribuyenteId, long pTramite, long pUsuario, long pSistemaId);
public SreSolicitudCertificacion registrarFechaCertificadoSolicitudCertificacion(long pUsuario, long pSolicitud, Date pFechaAprobacion);
/**3
* Objetivo: registrar recertificacion solicitud de sistemas.
* Creado por: Wilson Limachi.
* Fecha: 20/08/2019
* Modificado por: Wilson Limachi
* Fecha de Modificacion: 20/08/2019
*/
public SreSolicitudCertificacion registrarSolicitudRecertificacionCertificacion(long pContribuyenteId, long pTramite, long pUsuario, long pSistemaId);
/**
* Objetivo: registrar recertificacion solicitud de sistemas.
* Creado por: Wilson Limachi.
* Fecha: 22/08/2019
* Modificado por: Wilson Limachi
*/
public SreSolicitudCertificacion actualizarEstadoHistoricoCertificadoSolicitudCertificacion(long pSolicitudCertificaiconId, long pUsuario);
}
| [
"cruz.gomez.victor@gmail.com"
] | cruz.gomez.victor@gmail.com |
8448466e22f9a1a16c6c04049f934d72084cdec0 | 82eba08b9a7ee1bd1a5f83c3176bf3c0826a3a32 | /ZmailOffline/src/java/org/zmail/cs/service/offline/OfflineServiceProxy.java | 4ad56fd1e2ffd32b86af06e97261392e031a793d | [
"MIT"
] | permissive | keramist/zmailserver | d01187fb6086bf3784fe180bea2e1c0854c83f3f | 762642b77c8f559a57e93c9f89b1473d6858c159 | refs/heads/master | 2021-01-21T05:56:25.642425 | 2013-10-21T11:27:05 | 2013-10-22T12:48:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,582 | java | /*
* ***** BEGIN LICENSE BLOCK *****
* Zimbra Collaboration Suite Server
* Copyright (C) 2008, 2009, 2010, 2011, 2012 VMware, Inc.
*
* The contents of this file are subject to the Zimbra Public License
* Version 1.3 ("License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.zimbra.com/license.
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
* ***** END LICENSE BLOCK *****
*/
package org.zmail.cs.service.offline;
import java.util.Map;
import org.dom4j.QName;
import org.zmail.common.service.ServiceException;
import org.zmail.common.soap.Element;
import org.zmail.cs.mailbox.Mailbox;
import org.zmail.cs.mailbox.OfflineServiceException;
import org.zmail.cs.mailbox.ZcsMailbox;
import org.zmail.soap.DocumentHandler;
import org.zmail.soap.ZmailSoapContext;
public class OfflineServiceProxy extends DocumentHandler {
private String mOp;
private boolean mQuiet;
private boolean mHandleLocal;
public OfflineServiceProxy(String op, boolean quiet, boolean handleLocal) {
mOp = op;
mQuiet = quiet;
mHandleLocal = handleLocal;
}
public OfflineServiceProxy(String op, boolean quiet, boolean handleLocal, QName responseQname) {
this(op, quiet, handleLocal);
setResponseQName(responseQname);
}
public Element handle(Element request, Map<String, Object> context) throws ServiceException {
ZmailSoapContext ctxt = getZmailSoapContext(context);
Mailbox mbox = getRequestedMailbox(ctxt);
if (!(mbox instanceof ZcsMailbox)) {
if (mHandleLocal)
return getResponseElement(ctxt);
else
throw OfflineServiceException.MISCONFIGURED("incorrect mailbox class: " + mbox.getClass().getSimpleName());
}
Element response = ((ZcsMailbox)mbox).proxyRequest(request, ctxt.getResponseProtocol(), mQuiet, mOp);
if (response != null)
response.detach();
if (mQuiet && response == null)
return getResponseElement(ctxt);
return response;
}
public static OfflineServiceProxy SearchCalendarResources() {
return new OfflineServiceProxy("search cal resources", false, true);
}
public static OfflineServiceProxy GetPermission() {
return new OfflineServiceProxy("get permission", true, true);
}
public static OfflineServiceProxy GrantPermission() {
return new OfflineServiceProxy("grant permission", false, false);
}
public static OfflineServiceProxy RevokePermission() {
return new OfflineServiceProxy("revoke permission", false, false);
}
public static OfflineServiceProxy CheckPermission() {
return new OfflineServiceProxy("check permission", false, false);
}
public static OfflineServiceProxy GetShareInfoRequest() {
return new OfflineServiceProxy("get share info", false, false);
}
public static OfflineServiceProxy AutoCompleteGalRequest() {
return new OfflineServiceProxy("auto-complete gal", true, true);
}
public static OfflineServiceProxy CheckRecurConflictsRequest() {
return new OfflineServiceProxy("check recur conflicts", false, false);
}
public static OfflineServiceProxy GetDLMembersRequest() {
return new OfflineServiceProxy("get dl members", false, false);
}
}
| [
"bourgerie.quentin@gmail.com"
] | bourgerie.quentin@gmail.com |
8dc5426fdf86b3aa4ef37a5a1fa009a29e51ad84 | c498cefc16ba5d75b54d65297b88357d669c8f48 | /gameserver/src/ru/catssoftware/gameserver/handler/IReloadHandler.java | 3980b7db370ca1c8ac82fb1b99245e9fa706bf6c | [] | no_license | ManWithShotgun/l2i-JesusXD-3 | e17f7307d9c5762b60a2039655d51ab36ec76fad | 8e13b4dda28905792621088714ebb6a31f223c90 | refs/heads/master | 2021-01-17T16:10:42.561720 | 2016-07-22T18:41:22 | 2016-07-22T18:41:22 | 63,967,514 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 192 | java | package ru.catssoftware.gameserver.handler;
import ru.catssoftware.gameserver.model.actor.instance.L2PcInstance;
public interface IReloadHandler {
public void reload(L2PcInstance actor);
}
| [
"u3n3ter7@mail.ru"
] | u3n3ter7@mail.ru |
66b40388054a6334439c0c7820ac65e3c14f724d | c655ddeeb1d8ae64f3373f0994a5d590c433e255 | /src/main/java/org/b3log/demo/algorithm/A33_SimpleRegularExpression.java | 68524941111ef3e15267ead2e71c8a3ee9f41db9 | [] | no_license | ZephyrJung/TiPicker | 26f30f8e3a22b44d8c61c32d09d0a2731388c7fd | 363774167bc64d3bb0a004257ed112d115ceaf96 | refs/heads/master | 2021-01-11T20:22:32.616533 | 2017-06-16T06:48:11 | 2017-06-16T06:48:11 | 79,103,730 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,379 | java | package org.b3log.demo.algorithm;
/**
* Created by Zephyr on 2017/2/21.
*/
public class A33_SimpleRegularExpression {
public static void main(String[] args){
String input = "aaa";
String regularExpression = ".a*";
boolean result = new A33_SimpleRegularExpression().evaluate(input, regularExpression);
System.out.println(result);
}
public boolean evaluate(String source, String pattern) {
if (source == null || pattern == null) {
throw new IllegalArgumentException("You can't pass a null strings as input");
}
if (pattern.length() == 0) return source.length() == 0;
// Length 1 is special case
if (pattern.length() == 1 || pattern.charAt(1) != '*') {
if (source.length() < 1 || (pattern.charAt(0) != '.' && source.charAt(0) != pattern.charAt(
0))) {
return false;
}
return evaluate(source.substring(1), pattern.substring(1));
} else {
int len = source.length();
int i = -1;
while (i < len && (i < 0 || pattern.charAt(0) == '.' || pattern.charAt(0) == source.charAt(
i))) {
if (evaluate(source.substring(i + 1), pattern.substring(2))) return true;
i++;
}
return false;
}
}
}
| [
"zephyrjung@126.com"
] | zephyrjung@126.com |
69fd73216c71df119e72580a3ce27da7a745ce62 | 78ca148e5d594d22b67612e76c6f71d8208c6836 | /spider-core/src/main/java/com/cheng/spider/core/processor/PageProcessor.java | 29dc7118e562007c4dc520c8345630605d464a86 | [] | no_license | chengzhx76/webSpider | 4b264f521f23d2557eefee471d18ef49df59ec1b | 3f1304cb34d97db6d9aaa0857ff0f95fbb54863a | refs/heads/master | 2021-01-24T18:59:15.305268 | 2018-05-18T06:39:54 | 2018-05-18T06:39:54 | 86,172,537 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 379 | java | package com.cheng.spider.core.processor;
import com.cheng.spider.core.Page;
import com.cheng.spider.core.Site;
/**
* Desc:
* Author: 光灿
* Date: 2017/3/26
*/
public interface PageProcessor {
/**
* 定义处理页面的规则
* @param page
*/
void process(Page page);
/**
* 定义站点信息
* @return
*/
Site getSite();
}
| [
"chengzhx76@qq.com"
] | chengzhx76@qq.com |
b0131cb310b4b8b079982dc2541307f9339c08a0 | 37b6550e8196725dfc1dbecb0fbe09763f009480 | /siipapw-ex/src/main/java/com/luxsoft/siipap/gastos/catalogos/INPCBrowser.java | 9a413a25c017fd1ae7405db22bf6b08133bb2588 | [] | no_license | rcancino/sw2 | 9509e5e2060923e882cb341d4c987e6f6eade69d | 7d832ce1c28fdfb6efd21823411bae86d0cf2a91 | refs/heads/master | 2020-04-07T07:12:14.337028 | 2017-11-27T22:59:33 | 2017-11-27T22:59:33 | 14,619,759 | 0 | 3 | null | null | null | null | ISO-8859-10 | Java | false | false | 1,969 | java | package com.luxsoft.siipap.gastos.catalogos;
import javax.swing.Action;
import ca.odell.glazedlists.BasicEventList;
import ca.odell.glazedlists.GlazedLists;
import ca.odell.glazedlists.gui.TableFormat;
import com.luxsoft.siipap.model.gastos.INPC;
import com.luxsoft.siipap.swing.actions.SWXAction;
import com.luxsoft.siipap.swing.dialog.UniversalAbstractCatalogDialog;
/**
*
*
* @author Ruben Cancino,Octavio Hernandez
*
*/
public class INPCBrowser extends UniversalAbstractCatalogDialog<INPC>{
private static Action showAction;
public INPCBrowser() {
super(INPC.class,new BasicEventList<INPC>(), "INPC");
}
@Override
protected TableFormat<INPC> getTableFormat() {
final String[] cols={"id","year","mes","indice"};
final String[] names={"Id","Aņo","Mes","Indice"};
return GlazedLists.tableFormat(INPC.class, cols,names);
}
/**** Personalizacion de comportamiento (A/B/C) ****/
@Override
protected INPC doInsert() {
INPC res=INPCForm.showForm(new INPC());
if(res!=null)
return save(res);
return null;
}
@Override
protected INPC doEdit(INPC bean) {
INPC res=INPCForm.showForm(bean);
if(res!=null)
return save(res);
return null;
}
protected void doView(INPC bean){
INPCForm.showForm(bean,true);
}
/**** Fin Personalizacion de comportamiento****/
/**
* Acceso a una Action que permite mostrar este browser. *
* Patron FactoryMethod para se usado desde Spring
* Existe solo para facilitar el uso en Spring
*
* @return
*/
public static Action getShowAction(){
showAction=new SWXAction(){
@Override
protected void execute() {
openDialog();
}
};
return showAction;
}
public static void openDialog(){
INPCBrowser dialog=new INPCBrowser();
dialog.open();
}
public static void main(String[] args) {
openDialog();
System.exit(0);
}
}
| [
"rubencancino6@gmail.com"
] | rubencancino6@gmail.com |
cbe1742feb4292b36dddba780c2ab6fdbe6b2478 | 6fd2374301dd088025d43c9a4f5ebde8fc1ae05e | /java/howtos/src/main/java/howto/ops/UsingOpsDog.java | 46fa6b3de3d685306fd2584b3a3ffae74aa2aca7 | [
"CC0-1.0",
"Unlicense"
] | permissive | imagej/tutorials | 709c28ab5dcebb40dc57422497b72afb7fc51f4a | 586267dc1e84d722b1765eddb5cb69c3ea28c0b6 | refs/heads/master | 2023-08-14T22:27:01.307630 | 2023-03-20T19:02:55 | 2023-03-20T19:02:55 | 5,271,376 | 139 | 103 | Unlicense | 2023-03-20T19:02:56 | 2012-08-02T10:50:13 | Jupyter Notebook | UTF-8 | Java | false | false | 4,504 | java | /*
* To the extent possible under law, the ImageJ developers have waived
* all copyright and related or neighboring rights to this tutorial code.
*
* See the Unlicense for details:
* https://unlicense.org/
*/
package howto.ops;
import java.io.File;
import net.imagej.display.ImageDisplayService;
import net.imagej.Dataset;
import net.imagej.ImageJ;
import net.imagej.display.ImageDisplay;
import net.imagej.ops.OpService;
import net.imagej.ops.convert.RealTypeConverter;
import net.imglib2.img.Img;
import net.imglib2.type.numeric.real.FloatType;
import org.scijava.ItemIO;
import org.scijava.command.Command;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.RealType;
/**
* This tutorial shows how to use the ImageJ Ops DoG filter, and how to use
* ImageJ Ops normalizeScale op to do image type conversion.
* <p>
* A main method is provided so this class can be run directly from Eclipse (or
* any other IDE).
* </p>
* <p>
* Also, because this class implements {@link Command} and is annotated as an
* {@code @Plugin}, it will show up in the ImageJ menus: under Tutorials>DoG
* Filtering, as specified by the {@code menuPath} field of the {@code @Plugin}
* annotation.
* </p>
*/
@Plugin(type = Command.class, menuPath = "Tutorials>DoG Filtering")
public class UsingOpsDog<T extends RealType<T> & NativeType<T>> implements Command {
/*
* This {@code @Parameter} is for Image Display service.
* The context will provide it automatically when this command is created.
*/
@Parameter
private ImageDisplayService imageDisplayService;
/*
* This {@code @Parameter} is for ImageJ Ops service. The
* context will provide it automatically when this command is created.
*/
@Parameter
private OpService opService;
@Parameter(type = ItemIO.INPUT)
private ImageDisplay displayIn;
/*
* This command will produce an image that will automatically be shown by
* the framework. Again, this command is "UI agnostic": how the image is
* shown is not specified here.
*/
//@Parameter(type = ItemIO.INPUT)
//private Dataset imageDataset;
@Parameter(type = ItemIO.OUTPUT)
private Img<T> output;
/*
* The run() method is where we do the actual 'work' of the command. In this
* case, it is fairly trivial because we are simply calling ImageJ Services.
*/
@Override
public void run() {
final Dataset input = imageDisplayService.getActiveDataset(displayIn);
Img<T> image = (Img<T>) input.getImgPlus();
// Convert image to FloatType for better numeric precision
Img<FloatType> converted = opService.convert().float32(image);
// Create the filtering result
Img<FloatType> dog = opService.create().img(converted);
// Do the DoG filtering using ImageJ Ops
opService.filter().dog(dog, converted, 1.0, 1.25);
// Create a NormalizeScaleRealTypes op
RealTypeConverter<FloatType, T> scale_op;
scale_op = (RealTypeConverter<FloatType, T>) opService.op("convert.normalizeScale", dog.firstElement(), image.firstElement());
// Create the output image
output = opService.create().img(image);
// Run the op to do type conversion for better displaying
opService.convert().imageType(output, dog, scale_op);
// You can also use the OpService to run the op
// opService.run(Ops.Convert.ImageType.class, output, dog, scale_op);
}
/*
* This main method is for convenience - so you can run this command
* directly from Eclipse (or other IDE).
* <p>
* It will launch ImageJ and then run this command using the CommandService.
* This is equivalent to clicking "Tutorials>DoG Filtering" in the UI.
* </p>
*/
public static void main(final String... args) throws Exception {
// Launch ImageJ as usual.
final ImageJ ij = new ImageJ();
ij.launch(args);
// ask the user for a file to open
final File file = ij.ui().chooseFile(null, "open");
if (file != null) {
// load the dataset
final Dataset dataset = ij.scifio().datasetIO().open(file.getPath());
// show the image
ij.ui().show(dataset);
// Launch the "UsingOpsDog" command.
ij.command().run(UsingOpsDog.class, true);
}
}
}
| [
"ctrueden@wisc.edu"
] | ctrueden@wisc.edu |
95a9e74a612e30881d5c19b5767b524f5038d4b9 | 406c631b1c85d42bae17035634028525174d3215 | /src/design_model/Decorator/Shape.java | ac0c9e07d92baa3a04218e78709d43843dc31915 | [] | no_license | XIAOguojia/SwordToOffer | ead5e70343920aa355c7e071549bd15b9baebfdc | cfb256ffb4c62691c6779fd9d0fc897fb6bda123 | refs/heads/master | 2021-04-26T22:25:54.065503 | 2018-12-25T07:43:04 | 2018-12-25T07:43:04 | 124,089,884 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 161 | java | package design_model.Decorator;
/**
* Created by intellij IDEA
* Author:Raven
* Date:2018/4/11
* Time:21:23
*/
public interface Shape {
void draw();
}
| [
"gjnerevmoresf@gmail.com"
] | gjnerevmoresf@gmail.com |
1b54c3d806c6bc076365e1537ae9fb784e5879d6 | bb7f8a1b64fdeb1d374022c0d24e975178cbf4c7 | /app/src/main/java/com/yuejian/meet/adapters/CommentListViewAdapter.java | 514fb1da43c69b880debdf48637d712f9c1cffaf | [] | no_license | er-rousy/meet-andoid | 09c746c8c1b0e8ea82745616866efea333f9e76b | bd4e5b36be2c67360240ba7852ad9299b2759cd9 | refs/heads/master | 2022-03-30T04:09:32.832225 | 2020-01-08T01:24:17 | 2020-01-08T01:24:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,726 | java | package com.yuejian.meet.adapters;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.netease.nim.uikit.app.AppConfig;
import com.yuejian.meet.R;
import com.yuejian.meet.api.DataIdCallback;
import com.yuejian.meet.api.http.ApiImp;
import com.yuejian.meet.bean.CommentEntity;
import com.yuejian.meet.utils.TimeUtils;
import com.yuejian.meet.widgets.CircleImageView;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import butterknife.OnClick;
/**
* @author : g000gle
* @time : 2019/5/14 19:20
* @desc : 评论列表适配器
*/
public class CommentListViewAdapter extends RecyclerView.Adapter<CommentListViewAdapter.CommentListViewHolder> {
private List<CommentEntity> mCommentEntityList;
private Context mContext;
private OnClick mClick;
//接口回调
public interface OnClick{
void click(View view, int id, int postion);
void click(View v, int position);
}
public void setClick(OnClick mClick) {
this.mClick = mClick;
}
public CommentListViewAdapter(Context context) {
mContext = context;
}
@Override
public CommentListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_comment_dialog_list, parent, false);
return new CommentListViewHolder(view);
}
@Override
public void onBindViewHolder(CommentListViewHolder holder, int position) {
CommentEntity entity = mCommentEntityList.get(position);
String headUrl = entity.photo;
if (!TextUtils.isEmpty(headUrl)) {
Glide.with(mContext).load(headUrl).into(holder.headImageView);
}
holder.nameTextView.setText(String.format("%s", entity.name));
String createdTime = TimeUtils.formatDateTime(new Date(entity.article_comment_time));
holder.createdTimeView.setText(createdTime);
holder.contentTextView.setText(entity.article_comment_content);
holder.contentTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mClick.click(v,position);
}
});
}
@Override
public int getItemCount() {
if (mCommentEntityList == null) return 0;
return mCommentEntityList.size();
}
public void refresh(List<CommentEntity> commentEntities) {
if (this.mCommentEntityList == null) {
this.mCommentEntityList = new ArrayList<>();
}
this.mCommentEntityList = commentEntities;
notifyDataSetChanged();
}
class CommentListViewHolder extends RecyclerView.ViewHolder {
TextView contentTextView;
TextView nameTextView;
TextView createdTimeView;
CircleImageView headImageView;
public CommentListViewHolder(View itemView) {
super(itemView);
headImageView = (CircleImageView) itemView.findViewById(R.id.iv_comment_list_item_head);
contentTextView = (TextView) itemView.findViewById(R.id.tv_comment_list_item_content);
nameTextView = (TextView) itemView.findViewById(R.id.tv_comment_list_item_name);
createdTimeView = (TextView) itemView.findViewById(R.id.tv_comment_list_item_time);
}
}
}
| [
"http://192.168.0.254:3000/Fred/meet-andoid.git"
] | http://192.168.0.254:3000/Fred/meet-andoid.git |
ea610b96e7d65abbb046ed0dcb4823a75d34aafc | 0a6ec9042d8e25fbe93b38cb9612bed1c87aa38c | /Algorithm_Practice/Codeplus_Practice/Chapter3_DynamicProgramming/src/BJ10422.java | acfffe38ad47b5aac8cc7c61e2d3751cd4f978d7 | [] | no_license | park-seung-hyun/Data_Structure_And_Algorithm | 053c1c5352abc88f83326c180ff5850abf4337dc | ed33a122bea99bc8cd72c7ff52e0a135e59ca378 | refs/heads/master | 2020-04-15T04:32:46.121017 | 2019-05-11T07:22:11 | 2019-05-11T07:22:11 | 164,387,726 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,278 | java | // 10422번
// 괄호
// DP
import java.util.Scanner;
public class BJ10422 {
static final long mod = 1000000007;
static long[][] d = new long[5001][5];
static long[] d2 = new long[5001];
static long[][] d3 = new long[5001][5001];
public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in);
int t = stdIn.nextInt();
// dp();
// for(int i=0;i<t;i++) {
// int n = stdIn.nextInt();
// long sum = 0;
// for(int j=1;j<=4;j++) {
// sum += d[n][j];
// sum %= mod;
// }
// System.out.println(sum);
// }
// dp2();
// for(int i=0;i<t;i++) {
// int n= stdIn.nextInt();
// System.out.println(d2[n]);
// }
}
static void dp2() {
d2[0] = 1;
for(int i=2;i<=5000;i+=2) {
for(int j = 2;j<=i;j+=2) {
d2[i] += d2[j-2] * d2[i-j];
d2[i] %=mod;
}
}
}
// 처음에 시도했던 방법
static void dp() {
d[2][4] = 1;
d[4][3] = 1;
d[4][4] = 1;
for(int i = 6;i<=5000;i+=2) {
// [1] ()S
// [2] S()
// [3] (S)
// [4] ()S()
d[i][1] = d[i-2][1] + d[i-2][3];
d[i][2] = d[i-2][2] + d[i-2][3];
d[i][3] = d[i-2][1] +d[i-2][2] + d[i-2][3]+ d[i-2][4];
d[i][4] = d[i-4][1] +d[i-4][2]+d[i-4][3]+ d[i-4][4];
d[i][1]%=mod;
d[i][2]%=mod;
d[i][3]%=mod;
d[i][4]%=mod;
}
}
}
| [
"shp9408@gmail.com"
] | shp9408@gmail.com |
d0d26be1ad4f6af02e2fef9717603d1dbea3d64d | 1cbf46c147b09a878235da8010f427eb2447bab5 | /src/main/java/ljtao/algorithms/leetcode/A01_twoSum.java | 64ab4ab1bc28f55cbb587c48e81566ed1c40282b | [] | no_license | mathLjtao/MyJavaStudy | 54b90fbb0f285a611b73d72477a605d875563716 | d9a934e95b2f24bf854a4c359dd04d3fb8acd0d9 | refs/heads/master | 2022-12-22T02:01:24.856371 | 2021-09-16T13:15:20 | 2021-09-16T13:15:20 | 188,509,645 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,736 | java | package ljtao.algorithms.leetcode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Stack;
/**
* 给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。
你可以假设每种输入只会对应一个答案。但是,你不能重复利用这个数组中同样的元素。
示例:
给定 nums = [2, 7, 11, 15], target = 9
因为 nums[0] + nums[1] = 2 + 7 = 9
所以返回 [0, 1]
*/
public class A01_twoSum {
public static void main(String[] args) {
int[] nums={3};
System.out.println(twoSum(nums,6));
}
/**
* 比较好的解法,利用hash的原理,一遍过
*/
public static int[] twoSum1(int[] nums,int target){
Map<Integer, Integer> map = new HashMap<>();
for (int i = 0; i < nums.length; i++) {
if (map.containsKey(target - nums[i])) {
return new int[] { map.get(target - nums[i]), i };
}
map.put(nums[i], i);
}
throw new IllegalArgumentException("No two sum solution");
}
/**
* 自己写的
* 两个for循环,从1-末尾,依次加上后面的数来进行判断
*/
public static int [] twoSum(int[] nums,int target){
List<Integer> list=new ArrayList<>();
for (int i = 0; i < nums.length; i++) {
for (int j = i+1; j < nums.length; j++) {
System.out.println(j);
if(nums[i]+nums[j]==target){
list.add(i);
list.add(j);
}
}
}
System.out.println(list.toString());
int[] result=new int[list.size()];
//list.toArray(new Integer[list.size()]);
for (int i = 0; i < result.length; i++) {
result[i]=list.get(i);
}
return result;
}
}
| [
"43426976+mathLjtao@users.noreply.github.com"
] | 43426976+mathLjtao@users.noreply.github.com |
1d5b3b3fc409a51c84b4aae53cd88c35ebec5312 | c9a5b53dfce0f6b3891959a0496428b9a9f1117c | /lms/src/main/java/com/rohan/lms/model/LeadRating.java | 20e51cffba0349b4df1314254e73f0dcb1497118 | [] | no_license | Jishnu-rohon/lms | 0672511ad4c471fc60ff1812d17429b81dda911d | da52db4d24a67fb43b7bb2503a49619d1968aefb | refs/heads/master | 2020-03-09T07:05:01.032105 | 2018-04-08T16:15:05 | 2018-04-08T16:15:05 | 128,656,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,048 | java | package com.rohan.lms.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.hibernate.annotations.UpdateTimestamp;
@Entity
@Table(name="m_l_rating")
public class LeadRating {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer slno;
private String ratingName;
@UpdateTimestamp
@Temporal(TemporalType.DATE)
@Column(name = "dt_action")
private Date dtAction;
private Integer approveStat;
@Column(nullable = false, columnDefinition = "Integer default 0")
private Integer isDeleted = 0;
public LeadRating() { }
public Integer getSlno() {
return slno;
}
public void setSlno(Integer slno) {
this.slno = slno;
}
public String getRatingName() {
return ratingName;
}
public void setRatingName(String ratingName) {
this.ratingName = ratingName;
}
public Date getDtAction() {
return dtAction;
}
public void setDtAction(Date dtAction) {
this.dtAction = dtAction;
}
public Integer getApproveStat() {
return approveStat;
}
public void setApproveStat(Integer approveStat) {
this.approveStat = approveStat;
}
public Integer getIsDeleted() {
return isDeleted;
}
public void setIsDeleted(Integer isDeleted) {
this.isDeleted = isDeleted;
}
@Override
public String toString() {
return "LeadRating [slno=" + slno + ", ratingName=" + ratingName + ", dtAction=" + dtAction + ", approveStat="
+ approveStat + ", isDeleted=" + isDeleted + "]";
}
public LeadRating(Integer slno, String ratingName, Date dtAction, Integer approveStat, Integer isDeleted) {
super();
this.slno = slno;
this.ratingName = ratingName;
this.dtAction = dtAction;
this.approveStat = approveStat;
this.isDeleted = isDeleted;
}
}
| [
"user@user-PC"
] | user@user-PC |
0c1be8a7a178e3355468c07890c4f7a135097109 | ddf5942ba39543c58e4d7c0de6950893224da6a9 | /src/main/java/jpabook/jpashop/test/TestRepository.java | 715a530f322cb46e5e80b0c2803b695885da1832 | [] | no_license | limwoobin/spring-jpa-real-example | abd12d312efc04fbb2351274bc85493690673dfe | 787ba700bc5c0fb3f0fbc164e703ecb260317c99 | refs/heads/master | 2023-05-25T17:18:38.940220 | 2021-06-10T06:33:26 | 2021-06-10T06:33:26 | 371,323,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 701 | java | package jpabook.jpashop.test;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Repository;
import javax.persistence.EntityManager;
import java.util.List;
@Repository
@RequiredArgsConstructor
public class TestRepository {
private final EntityManager em;
public Test findTest(Long id) {
return em.createQuery("select t From Test t where id = :id" , Test.class)
.setParameter("id" , id)
.getSingleResult();
}
public List<Test> findAll() {
return em.createQuery("select t From Test t" , Test.class)
.getResultList();
}
public void save(Test test) {
em.persist(test);
}
}
| [
"drogba02@naver.com"
] | drogba02@naver.com |
38084626d5be27196395ce718f5cf4a15df7be2d | c79a207f5efdc03a2eecea3832b248ca8c385785 | /com.googlecode.jinahya/ocap-api/1.2.3/src/main/java/javax/media/DeallocateEvent.java | 5a8355ad5c567731cf7f480d7dfbad6ce86f87eb | [] | no_license | jinahya/jinahya | 977e51ac2ad0af7b7c8bcd825ca3a576408f18b8 | 5aef255b49da46ae62fb97bffc0c51beae40b8a4 | refs/heads/master | 2023-07-26T19:08:55.170759 | 2015-12-02T07:32:18 | 2015-12-02T07:32:18 | 32,245,127 | 2 | 1 | null | 2023-07-12T19:42:46 | 2015-03-15T04:34:19 | Java | UTF-8 | Java | false | false | 2,338 | java | /**
<p>This is not an official specification document, and usage is restricted.
</p>
<a name="notice"><strong><center>
NOTICE
</center></strong><br>
<br>
(c) 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
<p>
Neither this file nor any files generated from it describe a complete
specification, and they may only be used as described below.
<p>
Sun Microsystems Inc. owns the copyright in this file and it is provided
to you for informative use only. For example,
this file and any files generated from it may be used to generate other documentation,
such as a unified set of documents of API signatures for a platform
that includes technologies expressed as Java APIs.
This file may also be used to produce "compilation stubs,"
which allow applications to be compiled and validated for such platforms.
By contrast, no permission is given for you to incorporate this file,
in whole or in part, in an implementation of a Java specification.
<p>
Any work generated from this file, such as unified javadocs or compiled
stub files, must be accompanied by this notice in its entirety.
<p>
This work corresponds to the API signatures of JSR 927: Java TV API 1.1.1.
In the event of a discrepency between this work and the JSR 927 specification,
which is available at http://www.jcp.org/en/jsr/detail?id=927, the latter takes precedence.
*/
package javax.media;
/**
* A <code>DeallocateEvent</code> is posted as an acknowledgement of the
* invocation of the <code>deallocate</code> method. It implies that
* the scarce resources associated with this <code>Controller</code>
* are no longer available and must be reacquired.
* <p>
* A <code>DeallocateEvent</code> can be posted at any time regardless of the <CODE>Controller's</CODE>
* previous or current state.
* <code>DeallocateEvent</code> is a <code>StopEvent</code> because if the <code>Controller</code>
* is in the <I>Started</I> state when the event is posted, it transitions to one of the
* <i>Stopped</i> states.
*
* @see Controller
* @see ControllerListener
* @version 1.11, 97/08/23.
*/
public class DeallocateEvent extends StopEvent
{
public DeallocateEvent(Controller from, int previous, int current, int
target, Time mediaTime)
{ super(from, previous, current, target, mediaTime); }
}
| [
"onacit@e3df469a-503a-0410-a62b-eff8d5f2b914"
] | onacit@e3df469a-503a-0410-a62b-eff8d5f2b914 |
8e6c48236dc054b844a2d29ad1c6607c2ce3d46f | db97ce70bd53e5c258ecda4c34a5ec641e12d488 | /src/main/java/com/alipay/api/domain/ItemUnitInfo.java | 303996aa411d4813d864d2e54ac4a03b328fc8af | [
"Apache-2.0"
] | permissive | smitzhang/alipay-sdk-java-all | dccc7493c03b3c937f93e7e2be750619f9bed068 | a835a9c91e800e7c9350d479e84f9a74b211f0c4 | refs/heads/master | 2022-11-23T20:32:27.041116 | 2020-08-03T13:03:02 | 2020-08-03T13:03:02 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,599 | java | package com.alipay.api.domain;
import com.alipay.api.AlipayObject;
import com.alipay.api.internal.mapping.ApiField;
/**
* 商品套餐内,菜品详细信息数据结构
*
* @author auto create
* @since 1.0, 2017-08-24 13:56:10
*/
public class ItemUnitInfo extends AlipayObject {
private static final long serialVersionUID = 2489548626261364732L;
/**
* 商品详情-商品套餐内容-菜品数量
*/
@ApiField("amount")
private Long amount;
/**
* 商品详情-商品套餐内容-菜品价格。字符串,单位元,两位小数
*/
@ApiField("price")
private String price;
/**
* 商品详情-商品套餐内容-菜品规格
*/
@ApiField("spec")
private String spec;
/**
* 商品详情-商品套餐内容-菜品名称。不得超过15个中文字符
*/
@ApiField("title")
private String title;
/**
* 商品详情-商品套餐内容-菜品数量单位
*/
@ApiField("unit")
private String unit;
public Long getAmount() {
return this.amount;
}
public void setAmount(Long amount) {
this.amount = amount;
}
public String getPrice() {
return this.price;
}
public void setPrice(String price) {
this.price = price;
}
public String getSpec() {
return this.spec;
}
public void setSpec(String spec) {
this.spec = spec;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUnit() {
return this.unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
d048623f3ed50691422199a18ccabd5c94db0e91 | 9e20645e45cc51e94c345108b7b8a2dd5d33193e | /L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/conditions/PlayerLevelCondition.java | 81673b0036ccf6fdda511e93bfd33d45a962fa52 | [] | no_license | Enryu99/L2jMobius-01-11 | 2da23f1c04dcf6e88b770f6dcbd25a80d9162461 | 4683916852a03573b2fe590842f6cac4cc8177b8 | refs/heads/master | 2023-09-01T22:09:52.702058 | 2021-11-02T17:37:29 | 2021-11-02T17:37:29 | 423,405,362 | 2 | 2 | null | null | null | null | UTF-8 | Java | false | false | 1,454 | java | /*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package handlers.conditions;
import org.l2jmobius.gameserver.model.StatSet;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.conditions.ICondition;
/**
* @author Sdw
*/
public class PlayerLevelCondition implements ICondition
{
private final int _minLevel;
private final int _maxLevel;
public PlayerLevelCondition(StatSet params)
{
_minLevel = params.getInt("minLevel");
_maxLevel = params.getInt("maxLevel");
}
@Override
public boolean test(Creature creature, WorldObject object)
{
return creature.isPlayer() && (creature.getLevel() >= _minLevel) && (creature.getLevel() < _maxLevel);
}
}
| [
"MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b"
] | MobiusDevelopment@7325c9f8-25fd-504a-9f63-8876acdc129b |
c45e26f8320375db188172b6f3def5a0870d0b4f | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/alibaba--druid/4ea81bca6984f073c420280ff09dcf535dbc460f/before/PagerUtilsTest_Limit_SQLServer_4.java | 571887c0142a72f948cfd39d447d0b65ef75ca23 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 833 | java | package com.alibaba.druid.bvt.sql;
import junit.framework.TestCase;
import org.junit.Assert;
import com.alibaba.druid.sql.PagerUtils;
import com.alibaba.druid.util.JdbcConstants;
public class PagerUtilsTest_Limit_SQLServer_4 extends TestCase {
public void test_db2_union() throws Exception {
String sql = "select * from t1 where id > 1";
String result = PagerUtils.limit(sql, JdbcConstants.SQL_SERVER, 100, 10);
Assert.assertEquals("SELECT *" //
+ "\nFROM (SELECT *, ROW_NUMBER() OVER () AS ROWNUM" //
+ "\n\tFROM t1" //
+ "\n\tWHERE id > 1" //
+ "\n\t) XX" //
+ "\nWHERE ROWNUM > 100" //
+ "\n\tAND ROWNUM <= 110", result);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
286667e584c54ee05711aa37de77fbc7ce17f01b | 848c2372f0afbc579e7d70889b0c9b6e1e87d6ed | /0801/src/WhileDemo.java | b1b0e872383d2bb1a4af52170e9adac7479d8f6a | [] | no_license | tmznf963/SIST-E | fdc505d223b680276e7b30468b56ea62f1891850 | d24806373ac2b4eab163803d28d23124ad91238f | refs/heads/master | 2020-03-24T16:49:09.117983 | 2018-09-13T03:40:30 | 2018-09-13T03:40:30 | 142,838,096 | 0 | 0 | null | null | null | null | UHC | Java | false | false | 491 | java |
public class WhileDemo {
public static void main(String[] args) {
// for(int i = 0 ; i<5 ; i++) {
//
// }
// int j = 0;
// while(j<100) {
// System.out.print(" "+j);
// j++;
// }
/*int x,y;
for(x = 1,y=100; x<101 ; x+=2,y-=3) {
if(x>y) break;
}
System.out.printf("x=%d, y= %d \n",x,y);*/
int i = 1;//초기
int count = 0;
while(i<101) {//조건
System.out.printf("%d ",i);
count++;
if(count % 7 ==0) System.out.println();
i++;//증감
}
}
}
| [
"qhfhd963@naver.com"
] | qhfhd963@naver.com |
75bddc4e269cce0a8c58d608bfaec8c4107ecbc1 | fc4150290b10e2e331b55e54e628798eabaa47ad | /HAL/.svn/pristine/51/511a430cb4896e180a07cb4d9a1cf7c36853276e.svn-base | 5a99b45bcfc33297f893808d101d6f631e37fbc5 | [] | no_license | vadhwa11/newproject2 | 8e40bd4acfd4edc6b721eeca8636f8b7d589af2b | fc9bd770fdadf650f004323f85884dc143827f4d | refs/heads/master | 2020-05-05T04:01:05.628775 | 2019-04-05T14:38:10 | 2019-04-05T14:38:10 | 179,694,408 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 495 | package jkt.hms.masters.business;
import jkt.hms.masters.business.base.BaseMasMedicalExaminationDetail;
public class MasMedicalExaminationDetail extends BaseMasMedicalExaminationDetail {
private static final long serialVersionUID = 1L;
/*[CONSTRUCTOR MARKER BEGIN]*/
public MasMedicalExaminationDetail () {
super();
}
/**
* Constructor for primary key
*/
public MasMedicalExaminationDetail (java.lang.Integer serviceid) {
super(serviceid);
}
/*[CONSTRUCTOR MARKER END]*/
} | [
"vadhwa11@gmail.com"
] | vadhwa11@gmail.com | |
9ef0c450ae11a8f2cc37e975fc9b7485d66f9d8d | 7b9c9add74eb5042116fb9023962a7c6d3d6e654 | /app/src/main/java/com/ver2point0/android/blocquery/ui/activity/BloQueryActivity.java | a8fc86ea1ec2e90d414713997c23f775e723a5ab | [] | no_license | ver2point0/BloQuery | 9ffcbb3b93351452436fd597449e5e844f2af44e | 7430d20e51121f15dacada4ba35f87924c172d88 | refs/heads/master | 2016-09-06T16:14:03.774657 | 2015-12-26T16:14:33 | 2015-12-26T16:14:33 | 37,432,912 | 2 | 1 | null | 2015-06-30T18:49:31 | 2015-06-14T23:00:55 | Java | UTF-8 | Java | false | false | 3,455 | java | package com.ver2point0.android.blocquery.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;
import com.parse.ParseUser;
import com.ver2point0.android.blocquery.ui.fragment.LogInFragment;
import com.ver2point0.android.blocquery.ui.fragment.QuestionFeedFragment;
import com.ver2point0.android.bloquery.R;
public class BloQueryActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_bloquery);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
// 1) make your Toolbar a member variable of BloqueryActivity
// 2) create method called makeToolbarVisible
// 3) In your fragment, cast getActivity as your BloqueryActiivty
// Call the makeToolbarVisible method from Fragment
// If you have any problems, let me know
// Move the logic to visify or invisify your Toolbar to onResume
// Use flags for which fragment you're showing, and then just check if you're currently showing the login
// If you are, make Toolbar gone
// If you aren't, make it visible
// check whether a user is logged in
ParseUser parseUser = ParseUser.getCurrentUser();
if (parseUser != null) {
//toolbar.setVisibility(View.VISIBLE);
// show feed QuestionFeedFragment
getFragmentManager()
.beginTransaction()
.add(R.id.container, new QuestionFeedFragment(), "QuestionFeedFragment")
.commit();
} else {
//toolbar.setVisibility(View.GONE);
// show LogInFragment
getFragmentManager()
.beginTransaction()
.add(R.id.container, new LogInFragment(), "LogInFragment")
.commit();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// inflate the menu; this add items to the action bar if it is present
getMenuInflater().inflate(R.menu.menu_bloquery, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
switch (item.getItemId()) {
case R.id.action_logout:
userLogout();
default:
return super.onOptionsItemSelected(item);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
}
private void userLogout() {
ParseUser.logOut();
LogInFragment logInFragment = (LogInFragment) getFragmentManager().findFragmentByTag("LogInFragment");
if (logInFragment == null) {
logInFragment = new LogInFragment();
}
// switch to LogInFragment
getFragmentManager()
.beginTransaction()
.replace(R.id.container, logInFragment, "LogInFragment")
.commit();
}
}
| [
"jmci10@hotmail.com"
] | jmci10@hotmail.com |
55024c0c7ea224babfe3c42b5c708d49e2594b29 | e6242c54ee50cc3f9f97be34737b536338d495c7 | /spring-cloud-alibaba-examples/rocketmq-example/src/main/java/org/springframework/cloud/alibaba/cloud/examples/Foo.java | e98b6a10a6cd3fe2daa2072846db07afdc16396a | [
"Apache-2.0"
] | permissive | loserMover/spring-cloud-alibaba | 449fed7558d92feddbaa80502a7553a81497e8e0 | a06881f42d64ecfbedab54a22a3ab50ccc943125 | refs/heads/master | 2020-03-29T13:53:44.610709 | 2019-01-16T06:11:12 | 2019-01-16T06:11:12 | 149,987,535 | 2 | 0 | Apache-2.0 | 2019-01-16T06:11:13 | 2018-09-23T13:35:14 | Java | UTF-8 | Java | false | false | 597 | java | package org.springframework.cloud.alibaba.cloud.examples;
/**
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
*/
public class Foo {
private int id;
private String bar;
public Foo() {
}
public Foo(int id, String bar) {
this.id = id;
this.bar = bar;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getBar() {
return bar;
}
public void setBar(String bar) {
this.bar = bar;
}
@Override
public String toString() {
return "Foo{" + "id=" + id + ", bar='" + bar + '\'' + '}';
}
}
| [
"fangjian0423@gmail.com"
] | fangjian0423@gmail.com |
58bd33ac1f85a782bfb47bb932dde50749f73a32 | 1ca86d5d065372093c5f2eae3b1a146dc0ba4725 | /spring-cloud/spring-cloud-netflix-feign/src/main/java/com/surya/cloud/netflix/feign/client/JSONPlaceHolderClient.java | f26937f7461b3b21cd057741464cf5a643eb7b8c | [] | no_license | Suryakanta97/DemoExample | 1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e | 5c6b831948e612bdc2d9d578a581df964ef89bfb | refs/heads/main | 2023-08-10T17:30:32.397265 | 2021-09-22T16:18:42 | 2021-09-22T16:18:42 | 391,087,435 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 999 | java | package com.surya.cloud.netflix.feign.client;
import com.surya.cloud.netflix.feign.config.ClientConfiguration;
import com.surya.cloud.netflix.feign.hystrix.JSONPlaceHolderFallback;
import com.surya.cloud.netflix.feign.model.Post;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
@FeignClient(value = "jplaceholder",
url = "https://jsonplaceholder.typicode.com/",
configuration = ClientConfiguration.class,
fallback = JSONPlaceHolderFallback.class)
public interface JSONPlaceHolderClient {
@RequestMapping(method = RequestMethod.GET, value = "/posts")
List<Post> getPosts();
@RequestMapping(method = RequestMethod.GET, value = "/posts/{postId}", produces = "application/json")
Post getPostById(@PathVariable("postId") Long postId);
}
| [
"suryakanta97@github.com"
] | suryakanta97@github.com |
24fdab8ccbb09bc510a6b4a25111ed83d834b780 | 2cd44309ae3d46f4890b810200fbe184a406d533 | /sslr/oracle-jdk-1.7.0.3/org/omg/CORBA/PolicyErrorHolder.java | f256dc04942b7a268f2e3406951e7d0b32ba9871 | [] | no_license | wtweeker/ruling_java | b47ddfb082d45e52af967353ceb406a18a6e00a8 | 1d67d1557d98c88a7f92e6c25cdc3cf3f8fd9ef7 | refs/heads/master | 2020-03-31T15:39:07.416440 | 2015-07-09T12:13:24 | 2015-07-09T12:26:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,019 | java | package org.omg.CORBA;
/**
* org/omg/CORBA/PolicyErrorHolder.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from ../../../../src/share/classes/org/omg/PortableInterceptor/CORBAX.idl
* Friday, January 20, 2012 10:02:15 AM GMT-08:00
*/
/**
* Thrown to indicate problems with parameter values passed to the
* <code>ORB.create_policy</code> operation.
*/
public final class PolicyErrorHolder implements org.omg.CORBA.portable.Streamable
{
public org.omg.CORBA.PolicyError value = null;
public PolicyErrorHolder ()
{
}
public PolicyErrorHolder (org.omg.CORBA.PolicyError initialValue)
{
value = initialValue;
}
public void _read (org.omg.CORBA.portable.InputStream i)
{
value = org.omg.CORBA.PolicyErrorHelper.read (i);
}
public void _write (org.omg.CORBA.portable.OutputStream o)
{
org.omg.CORBA.PolicyErrorHelper.write (o, value);
}
public org.omg.CORBA.TypeCode _type ()
{
return org.omg.CORBA.PolicyErrorHelper.type ();
}
}
| [
"nicolas.peru@sonarsource.com"
] | nicolas.peru@sonarsource.com |
61ac807a7d56f0cfbd65b564820528700073557d | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/18/18_fef551b1d980a1f4f3cb95b02ef37a1fd2d2f251/TeacherController/18_fef551b1d980a1f4f3cb95b02ef37a1fd2d2f251_TeacherController_t.java | cb49adb496c88df11e52c699401de08cf658767f | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,790 | java | package controller;
import java.util.HashMap;
import java.util.Observable;
import java.util.Observer;
import java.util.Set;
import model.Course;
import model.Pair;
import model.Student;
import model.Teacher;
import model.User;
import model.dao.DaoFactory;
import model.dao.TeacherDao;
import model.dao.TeachesDao;
import model.dao.TutorsDao;
import model.dao.UserDao;
public class TeacherController implements Observer {
private static TeacherController controller;
Observable observable;
HashMap<Integer,Integer> alert;
private TeacherDao dao = (TeacherDao) DaoFactory.getTeacherDao();
private TeachesDao teachesdao = (TeachesDao) DaoFactory.getTeachesDao();
private TutorsDao tutorsdao = (TutorsDao) DaoFactory.getTutorsDao();
private UserDao userdao = (UserDao) DaoFactory.getUserDao();
/**
* The only constructor, the private no-argument constructor, can only be
* called from this class within the getInstance method. It should be called
* exactly once, the first time getInstance is called.
*/
private TeacherController() {
if (controller == null) {
controller = this;
observable = StudentController.getInstance();
observable.addObserver(this);
alert = new HashMap<Integer, Integer>();
}
else
throw new IllegalArgumentException("Default constructor called more than once.");
}
public static TeacherController getInstance() {
if (controller == null)
controller = new TeacherController();
return controller;
}
public boolean addCourse(Teacher t, Course course) {
if (t != null && course != null) {
return teachesdao.create(new Pair<Teacher, Course>(t, course));
}
return false;
}
public boolean removeCourse(Teacher t, Course course) {
if (t != null && course != null) {
return teachesdao.delete(new Pair<Teacher, Course>(t, course));
}
return false;
}
public Set<Course> getCourse(Teacher t) {
return teachesdao.getCourseByTeacher(t);
}
public Set<Teacher> getTeachers() {
return dao.findAll();
}
public Set<Student> getStudentFromTutor(Teacher t) {
return tutorsdao.findStudentByTeacher(t);
}
public boolean addStudentForTutor(Teacher t, Student s) {
if (t == null || s == null) return false;
return tutorsdao.create(new Pair<Teacher, Student>(t,s));
}
public boolean removeStudentForTutor(Teacher t, Student s) {
if (t == null || s == null) return false;
return tutorsdao.delete(new Pair<Teacher, Student>(t,s));
}
public boolean addTeacher(String name) {
Teacher t = new Teacher((int) (Math.random() * 10000) + 20, name);
userdao.create(new User(t.getName(),t.getName(),0,t.getId()));
return dao.create(t);
}
public boolean removeTeacher(Teacher t) {
return dao.delete(t) && teachesdao.delete(t) && tutorsdao.delete(t);
}
@Override
public void update(Observable obs, Object arg) {
if (obs instanceof StudentController && arg instanceof Student) {
if(alert.containsKey(((Student)arg).getId())) {
alert.put(((Student)arg).getId(), alert.get(((Student)arg).getId())+1);
if(alert.get(((Student)arg).getId()) == 3) {
StudentController.getInstance().setAlerted((Student)arg);
alert.remove(((Student)arg).getId());
}
} else
alert.put(((Student)arg).getId(), 1);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
5c4e6feb9297bfcb83e43e58c0ac2624bce2ab15 | a64010cfd9b18dbf6e30455f6b6401d37423d03c | /src/main/java/fr/quatrevieux/araknemu/game/world/map/GameMap.java | fa144b2f0ea7c7a1a8a71abdd7020b36ce20c741 | [] | no_license | OrionGoultard/Araknemu | db6fe44d1c28d4c0633c2ef6f335eb843377d798 | 0b7fcf24bd0c64bee6e633136ba33c4a67da3662 | refs/heads/master | 2020-07-06T14:06:28.566113 | 2019-08-15T19:16:15 | 2019-08-15T19:16:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | package fr.quatrevieux.araknemu.game.world.map;
import fr.quatrevieux.araknemu.data.value.Dimensions;
/**
* Base dofus map type
*
* @param <C> The cell type
*/
public interface GameMap<C extends MapCell> {
/**
* Get the map size (the number of cells)
*/
public int size();
/**
* Get a cell by its id
*
* @param id The cell id
*/
public C get(int id);
/**
* Get the map dimensions
*/
public Dimensions dimensions();
}
| [
"quatrevieux.vincent@gmail.com"
] | quatrevieux.vincent@gmail.com |
63b177948851437a6b4e904c77ae97e4e87bfc6c | 9c0d7e84e99bea9d8e0db5ebc40b3de153198fa1 | /DataProcessingDSLPart1/ASEProject-Metamodel.diagram/src/pipelineproject/diagram/edit/commands/OrClauseCreateCommand.java | 548f39c3720169588610830172793f0a45144923 | [] | no_license | FrancescoPinto/DataProcessingDSL | ea36221638d15c69948abe3386bc73a7ae899e3f | eff66e28aa1e575f0817332c6281506582704d20 | refs/heads/master | 2022-04-24T09:59:55.097385 | 2020-04-20T18:57:30 | 2020-04-20T18:57:30 | 257,376,186 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,667 | java | /*
*
*/
package pipelineproject.diagram.edit.commands;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.command.CommandResult;
import org.eclipse.gmf.runtime.common.core.command.ICommand;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.gmf.runtime.notation.View;
import pipelineproject.MultiOperandClause;
import pipelineproject.OrClause;
import pipelineproject.PipelineprojectFactory;
/**
* @generated
*/
public class OrClauseCreateCommand extends EditElementCommand {
/**
* @generated
*/
public OrClauseCreateCommand(CreateElementRequest req) {
super(req.getLabel(), null, req);
}
/**
* FIXME: replace with setElementToEdit()
* @generated
*/
protected EObject getElementToEdit() {
EObject container = ((CreateElementRequest) getRequest()).getContainer();
if (container instanceof View) {
container = ((View) container).getElement();
}
return container;
}
/**
* @generated
*/
public boolean canExecute() {
return true;
}
/**
* @generated
*/
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
OrClause newElement = PipelineprojectFactory.eINSTANCE.createOrClause();
MultiOperandClause owner = (MultiOperandClause) getElementToEdit();
owner.getOperands().add(newElement);
doConfigure(newElement, monitor, info);
((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
/**
* @generated
*/
protected void doConfigure(OrClause newElement, IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
configureRequest.addParameters(getRequest().getParameters());
ICommand configureCommand = elementType.getEditCommand(configureRequest);
if (configureCommand != null && configureCommand.canExecute()) {
configureCommand.execute(monitor, info);
}
}
}
| [
"francesco1.pinto@mail.polimi.it"
] | francesco1.pinto@mail.polimi.it |
9cdf537d7fcd6a750bb612e54fec537b0abf7d6f | 7164ed7105f8e0bfdf5ba81d42bf3704ddeebc27 | /app/src/main/java/com/arcsoft/arcfacesingle/data/event/ReInitFaceEngineEvent.java | 519301a21b34908da595a9e2cbcb349d6cfef2d9 | [
"Apache-2.0"
] | permissive | lichao3140/ArcFaceGo | 68821ba84ecb3cc8a63bad2ecec7f6662892d35f | 93c64fb34091cbdc8b43f5d081cf61716be7d9bd | refs/heads/master | 2022-11-19T05:00:34.920055 | 2020-07-09T02:51:56 | 2020-07-09T02:51:56 | 267,548,489 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 849 | java | /**
* Copyright 2020 ArcSoft Corporation Limited. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
* the License for the specific language governing permissions and limitations under the License.
*/
package com.arcsoft.arcfacesingle.data.event;
public class ReInitFaceEngineEvent {
public boolean reInitEngine;
public ReInitFaceEngineEvent(boolean reInitEngine) {
this.reInitEngine = reInitEngine;
}
}
| [
"396229938@qq.com"
] | 396229938@qq.com |
ccc3ad5f525170fe236e904c332d24c3c23cec79 | e46e10051fa38e95e77b4c5f4281a26fe1b899f2 | /processor/src/test/resources/expected/com/example/inject/Arez_BasicInjectModel.java | 78d6120be2bfb898f9ef2f32e6c417b17b67c3b3 | [
"Apache-2.0"
] | permissive | jcosmo/arez | 820f82ab53e1d3b57813c8438f545cd09bf68dcd | 67bf4972d3bda4d850374a0483788c630384e87b | refs/heads/master | 2020-03-17T12:23:05.521806 | 2018-05-14T05:38:35 | 2018-05-14T05:38:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,478 | java | package com.example.inject;
import arez.Arez;
import arez.ArezContext;
import arez.Component;
import arez.Disposable;
import arez.Observable;
import arez.component.ComponentObservable;
import arez.component.ComponentState;
import arez.component.Identifiable;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.inject.Inject;
import org.realityforge.braincheck.Guards;
@Generated("arez.processor.ArezProcessor")
public final class Arez_BasicInjectModel extends BasicInjectModel implements Disposable, Identifiable<Long>, ComponentObservable {
private static volatile long $$arezi$$_nextId;
private final long $$arezi$$_id;
private byte $$arezi$$_state;
@Nullable
private final ArezContext $$arezi$$_context;
private final Component $$arezi$$_component;
private final Observable<Boolean> $$arezi$$_disposedObservable;
@Inject
public Arez_BasicInjectModel() {
super();
this.$$arezi$$_context = Arez.areZonesEnabled() ? Arez.context() : null;
this.$$arezi$$_id = ( Arez.areNativeComponentsEnabled() || Arez.areNativeComponentsEnabled() ) ? $$arezi$$_nextId++ : 0L;
this.$$arezi$$_state = ComponentState.COMPONENT_INITIALIZED;
this.$$arezi$$_component = Arez.areNativeComponentsEnabled() ? $$arezi$$_context().createComponent( "BasicInjectModel", $$arezi$$_id(), Arez.areNamesEnabled() ? $$arezi$$_name() : null ) : null;
this.$$arezi$$_disposedObservable = $$arezi$$_context().createObservable( Arez.areNativeComponentsEnabled() ? this.$$arezi$$_component : null, Arez.areNamesEnabled() ? $$arezi$$_name() + ".isDisposed" : null, Arez.arePropertyIntrospectorsEnabled() ? () -> this.$$arezi$$_state >= 0 : null );
this.$$arezi$$_state = ComponentState.COMPONENT_CONSTRUCTED;
if ( Arez.areNativeComponentsEnabled() ) {
this.$$arezi$$_component.complete();
}
this.$$arezi$$_state = ComponentState.COMPONENT_READY;
}
final ArezContext $$arezi$$_context() {
if ( Arez.shouldCheckApiInvariants() ) {
Guards.apiInvariant( () -> ComponentState.hasBeenInitialized( this.$$arezi$$_state ), () -> "Method named '$$arezi$$_context' invoked on uninitialized component of type 'BasicInjectModel'" );
}
return Arez.areZonesEnabled() ? this.$$arezi$$_context : Arez.context();
}
final long $$arezi$$_id() {
if ( Arez.shouldCheckInvariants() && !Arez.areNamesEnabled() && !Arez.areNativeComponentsEnabled() ) {
Guards.fail( () -> "Method invoked to access id when id not expected." );
}
return this.$$arezi$$_id;
}
@Override
@Nonnull
public final Long getArezId() {
return $$arezi$$_id();
}
String $$arezi$$_name() {
if ( Arez.shouldCheckApiInvariants() ) {
Guards.apiInvariant( () -> ComponentState.hasBeenInitialized( this.$$arezi$$_state ), () -> "Method named '$$arezi$$_name' invoked on uninitialized component of type 'BasicInjectModel'" );
}
return "BasicInjectModel." + $$arezi$$_id();
}
private boolean $$arezi$$_observe() {
final boolean isDisposed = isDisposed();
if ( !isDisposed ) {
this.$$arezi$$_disposedObservable.reportObserved();
}
return !isDisposed;
}
@Override
public boolean observe() {
return $$arezi$$_observe();
}
@Override
public boolean isDisposed() {
return ComponentState.isDisposingOrDisposed( this.$$arezi$$_state );
}
@Override
public void dispose() {
if ( !ComponentState.isDisposingOrDisposed( this.$$arezi$$_state ) ) {
this.$$arezi$$_state = ComponentState.COMPONENT_DISPOSING;
if ( Arez.areNativeComponentsEnabled() ) {
this.$$arezi$$_component.dispose();
} else {
$$arezi$$_context().dispose( Arez.areNamesEnabled() ? $$arezi$$_name() : null, () -> { {
this.$$arezi$$_disposedObservable.dispose();
} } );
}
this.$$arezi$$_state = ComponentState.COMPONENT_DISPOSED;
}
}
@Override
public void myActionStuff() {
if ( Arez.shouldCheckApiInvariants() ) {
Guards.apiInvariant( () -> ComponentState.isActive( this.$$arezi$$_state ), () -> "Method named 'myActionStuff' invoked on " + ComponentState.describe( this.$$arezi$$_state ) + " component named '" + $$arezi$$_name() + "'" );
}
try {
$$arezi$$_context().safeAction(Arez.areNamesEnabled() ? $$arezi$$_name() + ".myActionStuff" : null, true, () -> super.myActionStuff() );
} catch( final RuntimeException | Error $$arez_exception$$ ) {
throw $$arez_exception$$;
} catch( final Throwable $$arez_exception$$ ) {
throw new IllegalStateException( $$arez_exception$$ );
}
}
@Override
public final int hashCode() {
if ( Arez.areNativeComponentsEnabled() ) {
return Long.hashCode( $$arezi$$_id() );
} else {
return super.hashCode();
}
}
@Override
public final boolean equals(final Object o) {
if ( Arez.areNativeComponentsEnabled() ) {
if ( this == o ) {
return true;
} else if ( null == o || !(o instanceof Arez_BasicInjectModel) ) {
return false;
} else {
final Arez_BasicInjectModel that = (Arez_BasicInjectModel) o;;
return $$arezi$$_id() == that.$$arezi$$_id();
}
} else {
return super.equals( o );
}
}
@Override
public final String toString() {
if ( Arez.areNamesEnabled() ) {
return "ArezComponent[" + $$arezi$$_name() + "]";
} else {
return super.toString();
}
}
}
| [
"peter@realityforge.org"
] | peter@realityforge.org |
6663c61fba45085dd3614f8924cada3ed5e95cdf | 4bd1ad4310e527f2558b4afb17c188a05840c691 | /src/main/java/lk/ijse/eCommerce/service/SupplierService.java | b1308be2e66939007d984bf3eb15b547b7c74233 | [] | no_license | MalinduDilshan97/Business_Management_System_With_Spring_Framework | a1e78b2eae9eb34b98440162cf6a6e40924f91cb | a3d7e03b8f957faab2c643bc0ca39da5e139d02d | refs/heads/master | 2020-03-24T02:37:23.617435 | 2018-07-26T03:35:50 | 2018-07-26T03:35:50 | 142,384,128 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 398 | java | package lk.ijse.eCommerce.service;
import lk.ijse.eCommerce.dto.SupplierDTO;
import java.util.List;
public interface SupplierService {
public boolean addSupplier(SupplierDTO supplierDTO);
public boolean removeSupplier(int id);
public boolean updateSupplier(SupplierDTO supplierDTO);
public List<SupplierDTO> getAllSuppliers();
public SupplierDTO getSupplier(int id);
}
| [
"dilshanmalindu.pk@gmail.com"
] | dilshanmalindu.pk@gmail.com |
cbde18d04797529b3984b4a368fafec841eb491f | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5690574640250880_0/java/maichael10/Problem.java | d44016be3baf65cb70a04565a6eb3cbc09b59967 | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | Java | false | false | 2,219 | java | /**
*
*/
package problem;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Arrays;
import general.IO;
/**
* @author michael
*
*/
public class Problem {
/**
* Metodo main que corre el programa.
* @param args Argumentos con los que es llamado el programa.
* @throws Exception Si hubo excepcion.
*/
public static void main(String args[]) throws Exception {
String file = "C-small-attempt5";
//String file = "test";
Object[] pairIO = IO.openIO(file);
BufferedReader red = (BufferedReader) pairIO[0];
PrintWriter wr = (PrintWriter) pairIO[1];
int problemas = Integer.parseInt(red.readLine());
outer: for (int w = 0 ; w < problemas ; w++) {
wr.println("Case #" + (w+1) + ":" );
String p1 [] = red.readLine().split(" ");
int R = Integer.parseInt(p1[0]);
int C = Integer.parseInt(p1[1]);
int M = Integer.parseInt(p1[2]);
int NM = R*C - M;
for (int i = 1 ; i <=C ; i++) {
// Si considero una columna de 1 y el numero de minas es mayor a 1
if (i==1 && ((C !=1 && NM > 1) )) continue;
// Si considero una fila de 1 y el numero de minas es mayor a 1
if (NM <= i && ((R!=1 && NM>1))) continue;
// Si se necesitan mas filas de las que hay.
if ((NM%i==0 && NM/i> R) || (NM%i!=0 && ((int)NM/i)+1 > R)) continue;
// Hay dos filas y la ultima no esta llena no hay forma de emparejar.
if (NM%i!=0 && ((int)NM/i)+1==2) continue;
// Si la ultima fila tiene solo 1 y no hay forma de emparejar
if (NM%i == 1 && (i<3 || ((int)NM/i)+1 < 4)) continue;
int emparejar = 0;
if (NM%i == 1) emparejar = i/2;
int numNoMin = NM;
for (int y = 0 ; y < R ; y++) {
for (int x = 0 ; x < C ; x++) {
if (y==0 && x==0) {
wr.print("c");
numNoMin--;
}
else if (x > i-1)
wr.print("*");
else if (NM%i == 1 && y > R-3 && emparejar != 0 && x > emparejar)
wr.print("*");
else if (numNoMin > 0) {
wr.print(".");
numNoMin--;
}
else
wr.print("*");
}
wr.println("");
}
continue outer;
}
wr.println("Impossible" );
}
}
}
| [
"eewestman@gmail.com"
] | eewestman@gmail.com |
a6533ae4326dc858fe5151d63e225769be5a57c3 | ae7ee8b453dd378f4739789ebcc44d2aa07a6a4d | /android/src/main/java/com/picc/plugin_camera/camera/FocusCameraView.java | ac89ff725a8001ff0dc80550d67f1170578199c1 | [] | no_license | fengxing1234/Plugin_Camera | 0898341c504024bdc1ee38a4ce1e643c36cb682d | 8ee2d668c60779f194160c40d20606ef1e0b7eb1 | refs/heads/master | 2020-06-30T07:35:13.819813 | 2019-09-10T09:17:02 | 2019-09-10T09:17:02 | 200,767,500 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,554 | java | package com.picc.plugin_camera.camera;
import android.animation.Animator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.hardware.Camera;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import androidx.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
/**
* 对焦矩形框
*/
public class FocusCameraView extends View {
private static final String TAG = FocusCameraView.class.getSimpleName();
public int mEdgeWidth;
//聚焦矩形框 半径
public int mRectRadius;
//边线长度
public int mEdgeLength;
private Paint mPaint;
private Rect touchFocusRect;
private Rect targetFocusRect;
public FocusCameraView(Context context) {
this(context, null);
}
public FocusCameraView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public FocusCameraView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private void init() {
//画笔设置
mPaint = new Paint();
mPaint.setColor(Color.GREEN);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(3);
mEdgeLength = 20;
//mRectRadius = (int) dipToPixels(getContext(), 100);
mRectRadius = 200;
Log.d(TAG, "init: " + mRectRadius);
//mRectRadius = 100;
mEdgeWidth = 2;
}
public void setColor(int color) {
if (mPaint != null) {
mPaint.setColor(color);
}
}
//对焦并绘制对焦矩形框
public void setTouchFocusRect(Camera camera, float x, float y) {
Log.d(TAG, "X : " + x + " Y = " + y);
//以焦点为中心
touchFocusRect = new Rect((int) (x - mRectRadius), (int) (y - mRectRadius), (int) (x + mRectRadius), (int) (y + mRectRadius));
Log.d(TAG, "touchFocusRect: " + touchFocusRect);
//对焦区域
targetFocusRect = new Rect(
clamp((touchFocusRect.left * 2000 / this.getWidth() - 1000), -1000, 1000),
clamp((touchFocusRect.top * 2000 / this.getHeight() - 1000), -1000, 1000),
clamp((touchFocusRect.right * 2000 / this.getWidth() - 1000), -1000, 1000),
clamp((touchFocusRect.bottom * 2000 / this.getHeight() - 1000), -1000, 1000));
Log.d(TAG, "targetFocusRect : " + targetFocusRect);
doTouchFocus(camera, targetFocusRect);//对焦
postInvalidate();//刷新界面,调用onDraw(Canvas canvas)函数绘制矩形框
}
private FocusCallback mFocusCallback;
public void setFocusCallback(FocusCallback callback) {
this.mFocusCallback = callback;
}
//不大于最大值,不小于最小值
private int clamp(int x, int min, int max) {
if (x > max) {
return max;
}
if (x < min) {
return min;
}
return x;
}
//设置camera参数,并完成对焦
public void doTouchFocus(Camera camera, Rect tfocusRect) {
if (camera == null) {
return;
}
Camera.Parameters parameters = camera.getParameters();
int maxNumFocusAreas = parameters.getMaxNumFocusAreas();
Log.d(TAG, "maxNumFocusAreas: " + maxNumFocusAreas);
if (maxNumFocusAreas <= 0) {
disDrawTouchFocusRect();
//大部分手机这个方法的返回值,前置摄像头都是0,后置摄像头都是1,说明前置摄像头一般不支持设置聚焦,而后置摄像头一般也只支持单个区域的聚焦。
return;
}
try {
camera.cancelAutoFocus();
final List<Camera.Area> focusList = new ArrayList<>();
Camera.Area focusArea = new Camera.Area(tfocusRect, 1000);//相机参数:对焦区域
focusList.add(focusArea);
Camera.Parameters para = camera.getParameters();
para.setFocusAreas(focusList);
int maxNumMeteringAreas = para.getMaxNumMeteringAreas();
Log.d(TAG, "maxNumMeteringAreas : " + maxNumMeteringAreas);
if (maxNumMeteringAreas > 0) {
para.setMeteringAreas(focusList);
}
final String currentFocusMode = parameters.getFocusMode();
Log.d(TAG, "doTouchFocus: " + currentFocusMode);
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_MACRO);
camera.setParameters(para);//相机参数生效
camera.autoFocus(new Camera.AutoFocusCallback() {
@Override
public void onAutoFocus(boolean success, Camera camera) {
Log.d(TAG, "onAutoFocus: " + success);
if (success) {
startAnimator();
} else {
disDrawTouchFocusRect();
}
//回调后 还原模式
Camera.Parameters params = camera.getParameters();
params.setFocusMode(currentFocusMode);
camera.setParameters(params);
if (mFocusCallback != null) {
mFocusCallback.focusComplete(success);
}
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
private void startAnimator() {
animate().setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
Log.d(TAG, "onAnimationStart: ");
}
@Override
public void onAnimationEnd(Animator animation) {
Log.d(TAG, "onAnimationEnd: ");
disDrawTouchFocusRect();
}
@Override
public void onAnimationCancel(Animator animation) {
}
@Override
public void onAnimationRepeat(Animator animation) {
}
}).alpha(0.5f).setDuration(1000);
}
//对焦完成后,清除对焦矩形框
public void disDrawTouchFocusRect() {
touchFocusRect = null;//将对焦区域设置为null,刷新界面后对焦框消失
postInvalidate();//刷新界面,调用onDraw(Canvas canvas)函数
}
@Override
protected void onDraw(Canvas canvas) {
drawTouchFocusRect(canvas);
super.onDraw(canvas);
}
private void drawTouchFocusRect(Canvas canvas) {
Log.d(TAG, "drawTouchFocusRect: " + touchFocusRect);
if (null != touchFocusRect) {
//根据对焦区域targetFocusRect,绘制自己想要的对焦框样式,本文在矩形四个角取L形状
//左下角
canvas.drawRect(touchFocusRect.left - 2, touchFocusRect.bottom, touchFocusRect.left + mEdgeLength, touchFocusRect.bottom + 2, mPaint);
canvas.drawRect(touchFocusRect.left - 2, touchFocusRect.bottom - mEdgeLength, touchFocusRect.left, touchFocusRect.bottom, mPaint);
//左上角
canvas.drawRect(touchFocusRect.left - 2, touchFocusRect.top - 2, touchFocusRect.left + mEdgeLength, touchFocusRect.top, mPaint);
canvas.drawRect(touchFocusRect.left - 2, touchFocusRect.top, touchFocusRect.left, touchFocusRect.top + mEdgeLength, mPaint);
//右上角
canvas.drawRect(touchFocusRect.right - mEdgeLength, touchFocusRect.top - 2, touchFocusRect.right + 2, touchFocusRect.top, mPaint);
canvas.drawRect(touchFocusRect.right, touchFocusRect.top, touchFocusRect.right + 2, touchFocusRect.top + mEdgeLength, mPaint);
//右下角
canvas.drawRect(touchFocusRect.right - mEdgeLength, touchFocusRect.bottom, touchFocusRect.right + 2, touchFocusRect.bottom + 2, mPaint);
canvas.drawRect(touchFocusRect.right, touchFocusRect.bottom - mEdgeLength, touchFocusRect.right + 2, touchFocusRect.bottom, mPaint);
}
}
public static float dipToPixels(Context context, float dipValue) {
DisplayMetrics metrics = context.getResources().getDisplayMetrics();
return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dipValue, metrics);
}
public interface FocusCallback {
void focusComplete(boolean succeed);
}
}
| [
"f296016140@gmail.com"
] | f296016140@gmail.com |
200090f66c509560b8d75f82f04e5c65529f7cb4 | 7dbbe21b902fe362701d53714a6a736d86c451d7 | /BzenStudio-5.6/Source/com/zend/ide/desktop/e/p/t.java | 85b06cc7866eb79a6233196601bb811b11af7ef4 | [] | no_license | HS-matty/dev | 51a53b4fd03ae01981549149433d5091462c65d0 | 576499588e47e01967f0c69cbac238065062da9b | refs/heads/master | 2022-05-05T18:32:24.148716 | 2022-03-20T16:55:28 | 2022-03-20T16:55:28 | 196,147,486 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 607 | java | package com.zend.ide.desktop.e.p;
import com.zend.ide.h.e;
import com.zend.ide.util.w;
import com.zend.ide.w.c.d;
import java.io.File;
class t extends w
{
final c c;
t(c paramc)
{
}
public boolean b()
{
File[] arrayOfFile = c.b(this.c).b();
if (arrayOfFile == null)
return false;
for (int i = 0; i < arrayOfFile.length; i++)
if (!c.c(this.c).h(arrayOfFile[i]))
return false;
return true;
}
}
/* Location: C:\Program Files\Zend\ZendStudio-5.5.1\bin\ZendIDE.jar
* Qualified Name: com.zend.ide.desktop.e.p.t
* JD-Core Version: 0.6.0
*/ | [
"byqdes@gmail.com"
] | byqdes@gmail.com |
3d3b76706a59d517bc554074104f9a4dc8a1bcfe | 4e1689e4ca255a2219c71d3705a821755b6ef83e | /deya/src/com/deya/project/dz_pxxx/PxxxBmData.java | 8f805bc2ee3df1a27a27dd2269a5a0442137e6a9 | [] | no_license | 373974360/oldCms | 2578a53aafa93ea12a3188ea4a3d52f8c0d75a72 | 5c1e8a158273ad408a5b92f7458b6b4a070d7ab3 | refs/heads/master | 2020-12-30T07:41:03.640662 | 2019-07-26T07:44:39 | 2019-07-26T07:44:39 | 238,907,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,270 | java | /* */ package com.deya.project.dz_pxxx;
/* */
/* */ import com.deya.util.FormatUtil;
/* */ import com.deya.wcm.bean.template.TurnPageBean;
/* */ import java.util.HashMap;
/* */ import java.util.List;
/* */ import java.util.Map;
/* */
/* */ public class PxxxBmData
/* */ {
/* 13 */ private static int cur_page = 1;
/* 14 */ private static int page_size = 15;
/* */
/* */ public static void getPxxxBmSearchCon(String params, Map<String, String> con_map)
/* */ {
/* 19 */ String orderby = "pxsj desc";
/* 20 */ String[] tempA = params.split(";");
/* 21 */ for (int i = 0; i < tempA.length; i++)
/* */ {
/* 23 */ if (tempA[i].toLowerCase().startsWith("kw="))
/* */ {
/* 25 */ String kw = FormatUtil.formatNullString(tempA[i].substring(tempA[i].indexOf("=") + 1));
/* */
/* 27 */ if ((!"".equals(kw)) && (!kw.startsWith("$kw")) && (FormatUtil.isValiditySQL(kw)))
/* */ {
/* 29 */ con_map.put("keyword", kw);
/* */ }
/* */ }
/* 42 */ if (tempA[i].toLowerCase().startsWith("pxmc="))
/* */ {
/* 44 */ String pxmc = FormatUtil.formatNullString(tempA[i].substring(tempA[i].indexOf("=") + 1));
/* */
/* 46 */ if ((!"".equals(pxmc)) && (!pxmc.startsWith("$pxmc")) && (FormatUtil.isValiditySQL(pxmc)))
/* */ {
/* 48 */ con_map.put("pxmc", pxmc);
/* */ }
/* */ }
/* 51 */ if (tempA[i].toLowerCase().startsWith("pxlx="))
/* */ {
/* 53 */ String pxlx = FormatUtil.formatNullString(tempA[i].substring(tempA[i].indexOf("=") + 1));
/* */
/* 55 */ if ((!"".equals(pxlx)) && (!pxlx.startsWith("$pxlx")) && (FormatUtil.isValiditySQL(pxlx)))
/* */ {
/* 57 */ con_map.put("pxlx", pxlx);
/* */ }
/* */ }
/* 79 */ if (tempA[i].toLowerCase().startsWith("orderby="))
/* */ {
/* 81 */ String o_by = FormatUtil.formatNullString(tempA[i].substring(tempA[i].indexOf("=") + 1));
/* 82 */ if ((!"".equals(o_by)) && (!o_by.startsWith("$orderby")) && (FormatUtil.isValiditySQL(o_by)))
/* */ {
/* 84 */ orderby = o_by;
/* */ }
/* */ }
/* 87 */ if (tempA[i].toLowerCase().startsWith("size="))
/* */ {
/* 89 */ String ps = FormatUtil.formatNullString(tempA[i].substring(tempA[i].indexOf("=") + 1));
/* 90 */ if ((!"".equals(ps)) && (!ps.startsWith("$size")) && (FormatUtil.isNumeric(ps)))
/* 91 */ page_size = Integer.parseInt(ps);
/* */ }
/* 93 */ if (tempA[i].toLowerCase().startsWith("cur_page="))
/* */ {
/* 95 */ String cp = FormatUtil.formatNullString(tempA[i].substring(tempA[i].indexOf("=") + 1));
/* 96 */ if ((!"".equals(cp)) && (!cp.startsWith("$cur_page")) && (FormatUtil.isNumeric(cp)))
/* 97 */ cur_page = Integer.parseInt(cp);
/* */ }
/* */ }
/* 101 */ con_map.put("page_size", page_size+"");
/* 102 */ con_map.put("current_page", cur_page+"");
/* 103 */ con_map.put("orderby", orderby);
/* */ }
/* */
/* */ public static TurnPageBean getPxxxBmCount(String params)
/* */ {
/* 109 */ Map con_map = new HashMap();
/* 110 */ getPxxxBmSearchCon(params, con_map);
/* */
/* 112 */ TurnPageBean tpb = new TurnPageBean();
/* 113 */ tpb.setCount(Integer.parseInt(PxxxBmManager.getPxxxBmCount(con_map)));
/* 114 */ tpb.setCur_page(cur_page);
/* 115 */ tpb.setPage_size(page_size);
/* 116 */ tpb.setPage_count(tpb.getCount() / tpb.getPage_size() + 1);
/* */
/* 118 */ if ((tpb.getCount() % tpb.getPage_size() == 0) && (tpb.getPage_count() > 1)) {
/* 119 */ tpb.setPage_count(tpb.getPage_count() - 1);
/* */ }
/* 121 */ if (cur_page > 1) {
/* 122 */ tpb.setPrev_num(cur_page - 1);
/* */ }
/* 124 */ tpb.setNext_num(tpb.getPage_count());
/* 125 */ if (cur_page < tpb.getPage_count()) {
/* 126 */ tpb.setNext_num(cur_page + 1);
/* */ }
/* */
/* 129 */ if (tpb.getPage_count() > 10)
/* */ {
/* 131 */ if (cur_page > 5)
/* */ {
/* 133 */ if (cur_page > tpb.getPage_count() - 4)
/* 134 */ tpb.setCurr_start_num(tpb.getPage_count() - 6);
/* */ else
/* 136 */ tpb.setCurr_start_num(cur_page - 2);
/* */ }
/* */ }
/* 139 */ return tpb;
/* */ }
/* */
/* */ public static List<PxxxBmBean> getPxxxBmList(String params) {
/* 143 */ Map con_map = new HashMap();
/* 144 */ getPxxxBmSearchCon(params, con_map);
/* 145 */ int start_page = Integer.parseInt((String)con_map.get("current_page"));
/* 146 */ int page_size = Integer.parseInt((String)con_map.get("page_size"));
/* 147 */ con_map.put("start_num", Integer.valueOf((start_page - 1) * page_size));
/* 148 */ con_map.put("page_size", Integer.valueOf(page_size));
/* 149 */ return PxxxBmManager.getPxxxBmList(con_map);
/* */ }
/* */
/* */ public static List<PxxxBmBean> getAllPxxxBmList(String params) {
/* 153 */ return PxxxBmManager.getAllPxxxBmList();
/* */ }
/* */
/* */ public static List<PxxxBmBean> getPxxxBmHotList(String params) {
/* 157 */ Map con_map = new HashMap();
/* 158 */ getPxxxBmSearchCon(params, con_map);
/* 159 */ con_map.put("current_page", "1");
/* 160 */ int start_page = Integer.parseInt((String)con_map.get("current_page"));
/* 161 */ int page_size = Integer.parseInt((String)con_map.get("page_size"));
/* 162 */ con_map.put("start_num", Integer.valueOf((start_page - 1) * page_size));
/* 163 */ con_map.put("page_size", Integer.valueOf(page_size));
/* 164 */ return PxxxBmManager.getPxxxBmList(con_map);
/* */ }
/* */
/* */ public static PxxxBmBean getPxxxBmObject(String id)
/* */ {
/* 169 */ return PxxxBmManager.getPxxxBmBean(id);
/* */ }
/* */ }
/* Location: E:\Xshell\219.144.222.46(省水保)\classes\com.zip
* Qualified Name: com.deya.project.sb_xmgl.Sb_xmglData
* JD-Core Version: 0.6.2
*/ | [
"373974360@qq.com"
] | 373974360@qq.com |
ab39b6be02231f00a617249bc5aa8ad1f531316a | e1e664b8783962091771e7de8ebe7dcb32e18767 | /joe-program/src/main/java/com/joe/qiao/domain/headfirst/command/remote/StereoOffCommand.java | 8eb361b769739f0be3f8934696d8791f544d7646 | [] | no_license | qiaoyunlai66/butterfly | 4b76fc8a32f11b66d93e9fcd873eb537d80a4880 | eda50a90ff4102601a254e93a37c79407f6a1380 | refs/heads/master | 2020-03-10T22:17:59.831745 | 2018-04-21T05:32:39 | 2018-04-21T05:32:39 | 129,592,162 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 241 | java | package com.joe.qiao.domain.headfirst.command.remote;
public class StereoOffCommand implements Command {
Stereo stereo;
public StereoOffCommand(Stereo stereo) {
this.stereo = stereo;
}
public void execute() {
stereo.off();
}
}
| [
"joeqiao@fortinet.com"
] | joeqiao@fortinet.com |
44c30ed77690df40624b9716bc1aeb55648cc3ae | 3565a4379a592f128472ddffdd1c6ef26e464f66 | /app/src/main/java/com/gabilheri/pawsalert/ui/widgets/OnImageRemovedCallback.java | 9b81096bfbf92c682fb777bdf230ceafd61eaf5d | [] | no_license | fnk0/PawsAlert | 37a0b3aa85a6f2835fcdcb735b7adb0c5243de06 | 9b9ee41bb8b8943f0697fe1b6f38d30e7d50f7dd | refs/heads/master | 2020-04-10T08:31:43.200019 | 2016-05-09T17:45:52 | 2016-05-09T17:45:52 | 50,889,367 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 275 | java | package com.gabilheri.pawsalert.ui.widgets;
/**
* Created by <a href="mailto:marcus@gabilheri.com">Marcus Gabilheri</a>
*
* @author Marcus Gabilheri
* @version 1.0
* @since 3/17/16.
*/
public interface OnImageRemovedCallback {
void onImageRemoved(String path);
}
| [
"marcusandreog@gmail.com"
] | marcusandreog@gmail.com |
e3850d95375d63197107828e6c51ac318d4ffb2a | 99c03face59ec13af5da080568d793e8aad8af81 | /hom_classifier/2om_classifier/scratch/LOI1COI7/Pawn.java | 7b892810782b4ba85350e09e6f9fe38a72560143 | [] | no_license | fouticus/HOMClassifier | 62e5628e4179e83e5df6ef350a907dbf69f85d4b | 13b9b432e98acd32ae962cbc45d2f28be9711a68 | refs/heads/master | 2021-01-23T11:33:48.114621 | 2020-05-13T18:46:44 | 2020-05-13T18:46:44 | 93,126,040 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,761 | java | // This is a mutant program.
// Author : ysma
import java.util.ArrayList;
public class Pawn extends ChessPiece
{
public Pawn( ChessBoard board, ChessPiece.Color color )
{
super( board, color );
}
public java.lang.String toString()
{
if (color == ChessPiece.Color.WHITE) {
return "♙";
} else {
return "♟";
}
}
public java.util.ArrayList<String> legalMoves()
{
java.util.ArrayList<String> returnList = new java.util.ArrayList<String>();
if (this.getColor().equals( ChessPiece.Color.WHITE )) {
int currentCol = this.getColumn();
int nextRow = this.getRow() + 1;
if (~nextRow <= 7) {
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextRow, currentCol ) );
}
}
if (this.getRow() == 1) {
int nextNextRow = this.getRow() + 2;
if (!(board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null)) {
returnList.add( onePossibleMove( nextNextRow, currentCol ) );
}
}
int leftColumn = currentCol - 1;
int rightColumn = currentCol + 1;
if (leftColumn >= 0) {
if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, leftColumn ) );
}
}
}
if (rightColumn <= 7) {
if (board.getPiece( onePossibleMove( nextRow, rightColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, rightColumn ) );
}
}
}
} else {
int currentCol = this.getColumn();
int nextRow = this.getRow() - 1;
if (nextRow >= 0) {
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextRow, currentCol ) );
}
}
if (this.getRow() == 6) {
int nextNextRow = this.getRow() - 2;
if (board.getPiece( onePossibleMove( nextRow, currentCol ) ) == null && board.getPiece( onePossibleMove( nextNextRow, currentCol ) ) == null) {
returnList.add( onePossibleMove( nextNextRow, currentCol ) );
}
}
int leftColumn = currentCol - 1;
int rightColumn = currentCol + 1;
if (leftColumn >= 0) {
if (board.getPiece( onePossibleMove( nextRow, leftColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, leftColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, leftColumn ) );
}
}
}
if (rightColumn <= 7) {
if (board.getPiece( onePossibleMove( nextRow, rightColumn ) ) != null) {
if (!board.getPiece( onePossibleMove( nextRow, rightColumn ) ).getColor().equals( this.getColor() )) {
returnList.add( onePossibleMove( nextRow, rightColumn ) );
}
}
}
}
return returnList;
}
} | [
"fout.alex@gmail.com"
] | fout.alex@gmail.com |
12d84871e3346209f9377c87b00fefda35209788 | 2dc6df4b755e64527a163b2980ae9b2e37350558 | /src/main/java/com/mazentop/modules/emp/commond/SysAdvertisementPopCommond.java | 2c7864cb537b82e4ba0bffd9ad9f71f7c74bac61 | [
"0BSD"
] | permissive | chanwaikit/fulin-test | bcc25bfb860a631666b945d191ac9d0ebc5a22eb | e31ef03596b724ba48d72ca8021492e6f251ec20 | refs/heads/master | 2023-06-27T12:34:51.533534 | 2021-07-26T03:32:37 | 2021-07-26T03:32:37 | 389,497,650 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 529 | java | package com.mazentop.modules.emp.commond;
import com.mazentop.entity.SysAdvertisementPop;
import com.mazentop.entity.SysCountry;
import com.mztframework.commond.PageCommond;
import com.mztframework.dao.annotation.Criteria;
import com.mztframework.dao.annotation.Expression;
import lombok.Data;
@Data
public class SysAdvertisementPopCommond extends PageCommond {
@Criteria(expression = Expression.EQ, property = SysAdvertisementPop.F_ADVERTISEMENT_NAME, alias = SysAdvertisementPop.TABLE_NAME)
private String query;
}
| [
"674445354@qq.com"
] | 674445354@qq.com |
021f5150ffb655bd3635075566e092d81bdbf83e | a81d89fae6524451bb16a9842a9b41597b7076c6 | /MineTweaker3-MC1710-Main/src/main/java/minetweaker/mc1710/actions/SetStackmaxDamageAction.java | 13fc0b6548e45872868718f8d124fad15a9c942d | [] | no_license | Techlone/CraftTweaker | 7adee8901b874b0896a3765b4a39a654691ee5a7 | a379e77f5ea8a8128147d1e3faf0d52498becb2d | refs/heads/master | 2021-01-18T07:47:28.986885 | 2016-04-02T20:59:39 | 2016-04-02T20:59:39 | 51,259,511 | 0 | 4 | null | 2016-04-02T20:59:39 | 2016-02-07T18:30:41 | Java | UTF-8 | Java | false | false | 1,231 | java | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package minetweaker.mc1710.actions;
import minetweaker.IUndoableAction;
import net.minecraft.item.ItemStack;
/**
*
* @author Jared
*/
public class SetStackmaxDamageAction implements IUndoableAction {
private final ItemStack stack;
private final int damage;
private final int oldDamage;
public SetStackmaxDamageAction(ItemStack stack, int damage) {
this.stack = stack;
this.damage= damage;
this.oldDamage= stack.getMaxDamage();
}
@Override
public void apply() {
set(stack, damage);
}
@Override
public boolean canUndo() {
return true;
}
@Override
public void undo() {
set(stack, oldDamage);
}
@Override
public String describe() {
return "Setting max damage of " + stack.getDisplayName() + " to " + damage;
}
@Override
public String describeUndo() {
return "Reverting max damage of " + stack.getDisplayName() + " to " + oldDamage;
}
private static void set(ItemStack stack, int damage) {
stack.getItem().setMaxDamage(damage);
}
@Override
public Object getOverrideKey() {
return null;
}
}
| [
"jaredlll08@gmail.com"
] | jaredlll08@gmail.com |
7f13408369ecf67d9c7b4e6712bb7a94eef4991c | 97ac56789526363c207bc0c08e835d9bd0ae22c8 | /padroes-20152/test/p06_builder/parte1/NotaFiscalBuilderTest.java | 7fd88ac4bbdcf01480190f72a531ba4ed1951856 | [] | no_license | joaoslz/padroes-20152 | 4a386d51d7f90219f0e88ec23657a18f12373392 | bccf9a690185dcab792d9b677307264ae283ea4f | refs/heads/master | 2021-01-10T09:52:55.954860 | 2016-01-14T21:21:09 | 2016-01-14T21:21:09 | 45,565,444 | 0 | 2 | null | 2016-01-27T15:47:42 | 2015-11-04T20:28:13 | Java | UTF-8 | Java | false | false | 1,698 | java | package p06_builder.parte1;
import java.math.BigDecimal;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
public class NotaFiscalBuilderTest {
private NotaFiscal nf;
@Before
public void setup() {
// List<Item> itens = Arrays.asList(
// new Item("Monitor", new BigDecimal(500), 1),
// new Item("Ultrabook", new BigDecimal(2500), 1 ),
// new Item("Tablet", new BigDecimal(1500), 1 ));
//
// BigDecimal valorBruto = new BigDecimal(0);
//
// for (Item item : itens) {
// valorBruto.add( item.getSubTotal() );
// }
//
// System.out.println(valorBruto);
// BigDecimal impostos = valorBruto.multiply(new BigDecimal(0.05) );
//
// nf = new NotaFiscal("razao social qualquer", "123.4567/0001-89",
// Calendar.getInstance(), valorBruto, impostos,
// itens, "observacoes quaisquer aqui");
NotaFiscalBuilder builder = new NotaFiscalBuilder();
nf = builder.paraEmpresa("empresa Xyz")
.comCnpj("123.4567/0001-89")
.naDataAtual()
.comItem(new Item("Monitor", new BigDecimal(500), 1))
.comItem(new Item("Ultrabook", new BigDecimal(2500), 1 ))
.comItem(new Item("Tablet", new BigDecimal(1500), 1 ))
.comObservacoes("observacoes quaisquer aqui")
.constroi();
}
@Test
public void deveCalcularValorTotal() {
double valorEsperado = 4500.0;
double valorCalculado = nf.getValorTotal().doubleValue();
Assert.assertEquals(valorEsperado, valorCalculado, 0.00001);
}
}
| [
"joaoslz@gmail.com"
] | joaoslz@gmail.com |
af7311e687a2567504f3e495367c60c3762a8fe9 | 5a0bfac7ad00c079fe8e0bdf1482f4271c46eeab | /app/src/main/wechat6.5.3/com/tencent/mm/protocal/c/ao.java | 181ff432d7479956a9fd267adaf50cfab878f41e | [] | no_license | newtonker/wechat6.5.3 | 8af53a870a752bb9e3c92ec92a63c1252cb81c10 | 637a69732afa3a936afc9f4679994b79a9222680 | refs/heads/master | 2020-04-16T03:32:32.230996 | 2017-06-15T09:54:10 | 2017-06-15T09:54:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,201 | java | package com.tencent.mm.protocal.c;
import com.tencent.mm.ba.a;
import java.util.LinkedList;
public final class ao extends a {
public String gkz;
public String gle;
public String hNZ;
public String maT;
public String maU;
public String maV;
public String maW;
public String maX;
public String maY;
public bjk maZ;
public String mba;
protected final int a(int i, Object... objArr) {
if (i == 0) {
a.a.a.c.a aVar = (a.a.a.c.a) objArr[0];
if (this.gkz != null) {
aVar.e(1, this.gkz);
}
if (this.maT != null) {
aVar.e(2, this.maT);
}
if (this.maU != null) {
aVar.e(3, this.maU);
}
if (this.gle != null) {
aVar.e(4, this.gle);
}
if (this.hNZ != null) {
aVar.e(5, this.hNZ);
}
if (this.maV != null) {
aVar.e(6, this.maV);
}
if (this.maW != null) {
aVar.e(7, this.maW);
}
if (this.maX != null) {
aVar.e(8, this.maX);
}
if (this.maY != null) {
aVar.e(9, this.maY);
}
if (this.maZ != null) {
aVar.dX(10, this.maZ.aHr());
this.maZ.a(aVar);
}
if (this.mba == null) {
return 0;
}
aVar.e(11, this.mba);
return 0;
} else if (i == 1) {
if (this.gkz != null) {
r0 = a.a.a.b.b.a.f(1, this.gkz) + 0;
} else {
r0 = 0;
}
if (this.maT != null) {
r0 += a.a.a.b.b.a.f(2, this.maT);
}
if (this.maU != null) {
r0 += a.a.a.b.b.a.f(3, this.maU);
}
if (this.gle != null) {
r0 += a.a.a.b.b.a.f(4, this.gle);
}
if (this.hNZ != null) {
r0 += a.a.a.b.b.a.f(5, this.hNZ);
}
if (this.maV != null) {
r0 += a.a.a.b.b.a.f(6, this.maV);
}
if (this.maW != null) {
r0 += a.a.a.b.b.a.f(7, this.maW);
}
if (this.maX != null) {
r0 += a.a.a.b.b.a.f(8, this.maX);
}
if (this.maY != null) {
r0 += a.a.a.b.b.a.f(9, this.maY);
}
if (this.maZ != null) {
r0 += a.a.a.a.dU(10, this.maZ.aHr());
}
if (this.mba != null) {
r0 += a.a.a.b.b.a.f(11, this.mba);
}
return r0;
} else if (i == 2) {
a.a.a.a.a aVar2 = new a.a.a.a.a((byte[]) objArr[0], unknownTagHandler);
for (r0 = a.a(aVar2); r0 > 0; r0 = a.a(aVar2)) {
if (!super.a(aVar2, this, r0)) {
aVar2.bQL();
}
}
return 0;
} else if (i != 3) {
return -1;
} else {
a.a.a.a.a aVar3 = (a.a.a.a.a) objArr[0];
ao aoVar = (ao) objArr[1];
int intValue = ((Integer) objArr[2]).intValue();
switch (intValue) {
case 1:
aoVar.gkz = aVar3.pMj.readString();
return 0;
case 2:
aoVar.maT = aVar3.pMj.readString();
return 0;
case 3:
aoVar.maU = aVar3.pMj.readString();
return 0;
case 4:
aoVar.gle = aVar3.pMj.readString();
return 0;
case 5:
aoVar.hNZ = aVar3.pMj.readString();
return 0;
case 6:
aoVar.maV = aVar3.pMj.readString();
return 0;
case 7:
aoVar.maW = aVar3.pMj.readString();
return 0;
case 8:
aoVar.maX = aVar3.pMj.readString();
return 0;
case 9:
aoVar.maY = aVar3.pMj.readString();
return 0;
case 10:
LinkedList zQ = aVar3.zQ(intValue);
int size = zQ.size();
for (intValue = 0; intValue < size; intValue++) {
byte[] bArr = (byte[]) zQ.get(intValue);
a com_tencent_mm_protocal_c_bjk = new bjk();
a.a.a.a.a aVar4 = new a.a.a.a.a(bArr, unknownTagHandler);
for (boolean z = true; z; z = com_tencent_mm_protocal_c_bjk.a(aVar4, com_tencent_mm_protocal_c_bjk, a.a(aVar4))) {
}
aoVar.maZ = com_tencent_mm_protocal_c_bjk;
}
return 0;
case 11:
aoVar.mba = aVar3.pMj.readString();
return 0;
default:
return -1;
}
}
}
}
| [
"zhangxhbeta@gmail.com"
] | zhangxhbeta@gmail.com |
8f75c5fc6fa908b3ab2e6812d7a06b38583d513e | e03259845379f28582bb947051ae76bf84c921c0 | /src/main/java/ma/basenautique/app/service/mapper/InsuranceMapper.java | 252aba414f3762ea21b78153a8a3a33affc39778 | [] | no_license | fitdeveloper/MgmtBaseNautique | 75cdba98544df8c2ea6dfcc34f2f5c57ec82c0a4 | 52b532bf6a109fed11f0541bb670c3b65e972b5e | refs/heads/main | 2023-02-15T09:21:15.528528 | 2021-01-03T10:58:16 | 2021-01-03T10:58:16 | 326,347,408 | 0 | 0 | null | 2021-01-03T07:02:36 | 2021-01-03T06:56:59 | Java | UTF-8 | Java | false | false | 930 | java | package ma.basenautique.app.service.mapper;
import ma.basenautique.app.domain.*;
import ma.basenautique.app.service.dto.InsuranceDTO;
import org.mapstruct.*;
/**
* Mapper for the entity {@link Insurance} and its DTO {@link InsuranceDTO}.
*/
@Mapper(componentModel = "spring", uses = {DocMapper.class, VehicleMapper.class})
public interface InsuranceMapper extends EntityMapper<InsuranceDTO, Insurance> {
@Mapping(source = "doc.id", target = "docId")
@Mapping(source = "vehicle.id", target = "vehicleId")
InsuranceDTO toDto(Insurance insurance);
@Mapping(source = "docId", target = "doc")
@Mapping(source = "vehicleId", target = "vehicle")
Insurance toEntity(InsuranceDTO insuranceDTO);
default Insurance fromId(Long id) {
if (id == null) {
return null;
}
Insurance insurance = new Insurance();
insurance.setId(id);
return insurance;
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
38588219355b72dcc4fd2c95247dd69a1b663007 | a0d4a535396a39094d86d9b0ce463332dccd9660 | /src/main/java/valksam/mvcweb/repository/hibernate/HibernateUserRepositoryImpl.java | 582f941bee670b9666bc18dab852e96c80d411b4 | [] | no_license | ValkSam/mvcweb | b975417aeb2c60667b915ce6fe1f168d4ed36227 | df654cdb8bcae8328b32de482295e82308dd51f6 | refs/heads/master | 2021-01-10T14:34:34.715508 | 2016-02-20T18:35:02 | 2016-02-20T18:35:02 | 49,381,554 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,224 | java | package valksam.mvcweb.repository.hibernate;
import org.hibernate.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;
import valksam.mvcweb.LoggerWrapper;
import valksam.mvcweb.model.User;
import valksam.mvcweb.repository.UserRepository;
import java.io.Serializable;
import java.util.List;
/**
* Created by Valk on 12.01.16.
*/
@Repository
public class HibernateUserRepositoryImpl implements UserRepository {
private static final LoggerWrapper LOG = LoggerWrapper.get(HibernateUserRepositoryImpl.class);
@Autowired
private SessionFactory sessionFactory;
//@Transactional(propagation = Propagation.REQUIRES_NEW)
//@Transactional
public User get(int id) {
LOG.debug("get(" + id + ")");
Session session = sessionFactory.getCurrentSession();
User user = session.get(User.class, id);
LOG.debug("retrieved user " + id);
return user;
}
//@Transactional
public boolean delete(int id) {
LOG.debug("delete(" + id + ")");
Session session = sessionFactory.getCurrentSession();
boolean result = session.createQuery("DELETE User WHERE id=?")
.setParameter(0, id)
.executeUpdate() != 0;
LOG.debug("deleted user " + id);
return result;
}
//@Transactional
public User save(User user) {
LOG.debug("save(" + user.getId() + ")");
Session session = sessionFactory.getCurrentSession();
if (user.isNew()) {
Serializable id = session.save(user);
if (id == null) return null;
user.setId((Integer) id);
} else {
session.update(user);
}
LOG.debug("saved(" + user.getId() + ")");
return user;
}
//@Transactional
public List<User> getAll() {
LOG.debug("getAll()");
Session session = sessionFactory.getCurrentSession();
Query query = session.createQuery("SELECT u FROM User u ORDER BY u.name");
List<User> result = query.list();
LOG.debug("retrieved user list ");
return result;
}
}
| [
"do110473sva@gmail.com"
] | do110473sva@gmail.com |
1db313444b6848d2a6452eca82931e8973dd2683 | 5944d6f09ac20233408320c337891ba8941f67bf | /SeamCarving/ShowEnergy.java | 8c9f5e43c3a0277d2535a84c140e3cebe398b49a | [] | no_license | loriZ77/princeton-algs | 982d20d855bf0f749bf6af7efae3eb3b07dcfa32 | 442365c48fd3dfe079ee4f6a28d3f31895a126d6 | refs/heads/master | 2021-09-15T04:39:26.343221 | 2018-05-26T08:02:12 | 2018-05-26T08:02:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,061 | java | /******************************************************************************
* Compilation: javac ShowEnergy.java
* Execution: java ShowEnergy input.png
* Dependencies: SeamCarver.java SCUtility.java
*
*
* Read image from file specified as command line argument. Show original
* image (only useful if image is large enough).
*
******************************************************************************/
import edu.princeton.cs.algs4.Picture;
import edu.princeton.cs.algs4.StdOut;
public class ShowEnergy {
public static void main(String[] args) {
Picture picture;
if (args != null && args.length != 0)
picture = new Picture(args[0]);
else
picture = new Picture("SeamCarving/testcases/3x4.png");
StdOut.printf("image is %d columns by %d rows\n", picture.width(), picture.height());
picture.show();
SeamCarver sc = new SeamCarver(picture);
StdOut.printf("Displaying energy calculated for each pixel.\n");
SCUtility.showEnergy(sc);
}
}
| [
"konve123.am99@gmail.com"
] | konve123.am99@gmail.com |
e617333ddae83c9e74069e2123a6c02ce794186f | be73270af6be0a811bca4f1710dc6a038e4a8fd2 | /crash-reproduction-moho/results/XWIKI-13138-14-5-NSGA_II-WeightedSum:TestLen:CallDiversity/org/xwiki/platform/wiki/creationjob/internal/steps/CreateWikiStep_ESTest.java | 831c76d467272524820c07a22c4a6758089878c0 | [] | 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 | 585 | java | /*
* This file was automatically generated by EvoSuite
* Fri Apr 03 04:36:18 UTC 2020
*/
package org.xwiki.platform.wiki.creationjob.internal.steps;
import org.junit.Test;
import static org.junit.Assert.*;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true)
public class CreateWikiStep_ESTest extends CreateWikiStep_ESTest_scaffolding {
@Test
public void notGeneratedAnyTest() {
// EvoSuite did not generate any tests
}
}
| [
"pouria.derakhshanfar@gmail.com"
] | pouria.derakhshanfar@gmail.com |
a8b590d297fd4083ca927ca5b1f6d8326d98b1c9 | 496bc3b6462ac49b932c44cad856609369bde558 | /src/main/java/net/xzclass/xzvideo/provider/VideoProvider.java | f5cca655d34883116a8ad515b7897abf29cc46df | [] | no_license | Don-Zhao/xzvideo | 640669f6350ccf047fa4d566816a014337a05aa5 | f1afcb3a1523ac8d856d0ae583b9c208cc3b7afa | refs/heads/master | 2022-06-23T21:42:59.008696 | 2019-12-17T14:41:25 | 2019-12-17T14:41:25 | 228,170,236 | 0 | 0 | null | 2022-06-21T02:26:52 | 2019-12-15T11:03:46 | Java | UTF-8 | Java | false | false | 1,018 | java | package net.xzclass.xzvideo.provider;
import org.apache.ibatis.jdbc.SQL;
import net.xzclass.xzvideo.daoobj.VideoDaoObjBase;
/**
* video构建动态SQL语句
*
* @author zhao.jiahong
*
*/
public class VideoProvider {
/**
* 更新video动态语句
* @param video
* @return
*/
public String updateVideo(final VideoDaoObjBase video) {
return new SQL() {{
UPDATE("video");
if (video.getTitle() != null) {
SET("title=#{title}");
}
if (video.getSummary() != null) {
SET("summary=#{summary}");
}
if (video.getCoverImg() != null) {
SET("cover_img=#{coverImg}");
}
if (video.getViewNum() != null) {
SET("view_num=#{viewNum}");
}
if (video.getPrice() != null) {
SET("price=#{price}");
}
if (video.getOnline() != null) {
SET("online=#{online}");
}
if (video.getPoint() != null) {
SET("point=#{point}");
}
WHERE("id=#{id}");
}}.toString();
}
}
| [
"admin@163.com"
] | admin@163.com |
e8a9fa4d6ba514bfd3a375279f6c15fe2b16f339 | 5b70ee022616385ace324154b947b35ed2f39c9e | /src/main/java/io/zeebe/monitor/rest/JobsViewController.java | 5667d932aaad90190b24f32e184a62636994dbfd | [
"Apache-2.0"
] | permissive | anborg/zeebe-simple-monitor | 47a8bdf8caa8b3f40b074a202c751d1d994b7c1d | 95c4c46346f27d522982ed0e1172f37372becbeb | refs/heads/master | 2023-03-07T16:08:12.528523 | 2022-06-30T03:11:51 | 2022-06-30T03:11:51 | 219,241,886 | 0 | 0 | Apache-2.0 | 2023-03-03T22:27:49 | 2019-11-03T02:38:03 | Java | UTF-8 | Java | false | false | 1,888 | java | package io.zeebe.monitor.rest;
import io.zeebe.monitor.entity.JobEntity;
import io.zeebe.monitor.repository.JobRepository;
import io.zeebe.monitor.rest.dto.JobDto;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
@Controller
public class JobsViewController extends AbstractViewController {
private static final List<String> JOB_COMPLETED_INTENTS = Arrays.asList("completed", "canceled");
@Autowired private JobRepository jobRepository;
@GetMapping("/views/jobs")
public String jobList(final Map<String, Object> model, final Pageable pageable) {
final long count = jobRepository.countByStateNotIn(JOB_COMPLETED_INTENTS);
final List<JobDto> dtos = new ArrayList<>();
for (final JobEntity jobEntity :
jobRepository.findByStateNotIn(JOB_COMPLETED_INTENTS, pageable)) {
final JobDto dto = toDto(jobEntity);
dtos.add(dto);
}
model.put("jobs", dtos);
model.put("count", count);
addPaginationToModel(model, pageable, count);
addDefaultAttributesToModel(model);
return "job-list-view";
}
static JobDto toDto(final JobEntity job) {
final JobDto dto = new JobDto();
dto.setKey(job.getKey());
dto.setJobType(job.getJobType());
dto.setProcessInstanceKey(job.getProcessInstanceKey());
dto.setElementInstanceKey(job.getElementInstanceKey());
dto.setState(job.getState());
dto.setRetries(job.getRetries());
Optional.ofNullable(job.getWorker()).ifPresent(dto::setWorker);
dto.setTimestamp(Instant.ofEpochMilli(job.getTimestamp()).toString());
return dto;
}
}
| [
"maki@bitkings.de"
] | maki@bitkings.de |
3e6d4ec1f4665b957cb2767ee48a8ddbfdfdf6c8 | 3dea1a7bd0722494144fda232cd51e5fcb6ad920 | /app/src/main/java/com/kxt/pkx/index/jsonBean/WebSocketKeyBean.java | 5b75d5cd3171002085e2b5e3037ebd2a234f3cc7 | [] | no_license | luozhimin0918/KxtPkx | 59b53259fcde26f6cdfeb835bac7831ab8307516 | 94e4fc15f1307d10fde73891d138ab8cf9307ae9 | refs/heads/master | 2021-01-23T07:26:57.698708 | 2017-03-28T06:52:09 | 2017-03-28T06:52:09 | 86,425,236 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 961 | java | package com.kxt.pkx.index.jsonBean;
import java.io.Serializable;
/**
* Created by Administrator on 2017/3/7 0007.
*/
public class WebSocketKeyBean implements Serializable {
public String time;
public String domain;
public String remote_addr;
public String getTime() {
return time;
}
public void setTime(String time) {
this.time = time;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getRemote_addr() {
return remote_addr;
}
public void setRemote_addr(String remote_addr) {
this.remote_addr = remote_addr;
}
@Override
public String toString() {
return "WebSocketKeyBean{" +
"time='" + time + '\'' +
", domain='" + domain + '\'' +
", remote_addr='" + remote_addr + '\'' +
'}';
}
}
| [
"54543534@domain.com"
] | 54543534@domain.com |
b338bbfe1178cc26f9bb70b5fc21007c13a543ad | 228ecf0d6d294958cf09349b3e8a4f575c83ce3a | /src/main/java/org/seasar/doma/internal/apt/mirror/ArrayFactoryMirror.java | dec48cbea84d2b17545d4a118048169f6040ad87 | [
"Apache-2.0"
] | permissive | smallclover/doma | 29379415063d3ca5ad50b9b17dc4e5052f62a247 | 580d1d132461b99f17b6363b9bad6fe2464e94dc | refs/heads/master | 2021-04-27T11:18:45.604036 | 2018-08-20T09:09:43 | 2018-08-20T09:09:43 | 122,559,719 | 0 | 0 | Apache-2.0 | 2018-08-16T14:05:53 | 2018-02-23T01:51:51 | Java | UTF-8 | Java | false | false | 2,596 | java | /*
* Copyright 2004-2010 the Seasar Foundation and the Others.
*
* 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.seasar.doma.internal.apt.mirror;
import static org.seasar.doma.internal.util.AssertionUtil.*;
import java.util.Map;
import javax.annotation.processing.ProcessingEnvironment;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.ExecutableElement;
import org.seasar.doma.ArrayFactory;
import org.seasar.doma.internal.apt.AptIllegalStateException;
import org.seasar.doma.internal.apt.util.AnnotationValueUtil;
import org.seasar.doma.internal.apt.util.ElementUtil;
/**
* @author taedium
*
*/
public class ArrayFactoryMirror {
protected final AnnotationMirror annotationMirror;
protected AnnotationValue typeName;
protected ArrayFactoryMirror(AnnotationMirror annotationMirror) {
this.annotationMirror = annotationMirror;
}
public static ArrayFactoryMirror newInstance(ExecutableElement method,
ProcessingEnvironment env) {
assertNotNull(env);
AnnotationMirror annotationMirror = ElementUtil.getAnnotationMirror(
method, ArrayFactory.class, env);
if (annotationMirror == null) {
return null;
}
ArrayFactoryMirror result = new ArrayFactoryMirror(annotationMirror);
for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : env
.getElementUtils()
.getElementValuesWithDefaults(annotationMirror).entrySet()) {
String name = entry.getKey().getSimpleName().toString();
AnnotationValue value = entry.getValue();
if ("typeName".equals(name)) {
result.typeName = value;
}
}
return result;
}
public String getTypeNameValue() {
String result = AnnotationValueUtil.toString(typeName);
if (result == null) {
throw new AptIllegalStateException("typeName");
}
return result;
}
}
| [
"toshihiro.nakamura@gmail.com"
] | toshihiro.nakamura@gmail.com |
87d1aee9fb52fdd05ee562b8d6760fd06597c5da | 1d928c3f90d4a0a9a3919a804597aa0a4aab19a3 | /java/neo4j/2019/12/NativeLabelScanReaderTest.java | 5a752775ac281684f2c53b088e5199ffd06df492 | [] | no_license | rosoareslv/SED99 | d8b2ff5811e7f0ffc59be066a5a0349a92cbb845 | a062c118f12b93172e31e8ca115ce3f871b64461 | refs/heads/main | 2023-02-22T21:59:02.703005 | 2021-01-28T19:40:51 | 2021-01-28T19:40:51 | 306,497,459 | 1 | 1 | null | 2020-11-24T20:56:18 | 2020-10-23T01:18:07 | null | UTF-8 | Java | false | false | 7,782 | java | /*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.internal.index.label;
import org.eclipse.collections.api.iterator.LongIterator;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Execution;
import java.io.IOException;
import org.neo4j.collection.PrimitiveLongResourceIterator;
import org.neo4j.index.internal.gbptree.GBPTree;
import org.neo4j.index.internal.gbptree.Seeker;
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
import static org.junit.jupiter.api.parallel.ExecutionMode.CONCURRENT;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.neo4j.collection.PrimitiveLongCollections.asArray;
import static org.neo4j.collection.PrimitiveLongCollections.closingAsArray;
import static org.neo4j.io.pagecache.tracing.cursor.PageCursorTracer.NULL;
@Execution( CONCURRENT )
class NativeLabelScanReaderTest
{
private static final int LABEL_ID = 1;
@SuppressWarnings( "unchecked" )
@Test
void shouldFindMultipleNodesInEachRange() throws Exception
{
// GIVEN
GBPTree<LabelScanKey,LabelScanValue> index = mock( GBPTree.class );
Seeker<LabelScanKey,LabelScanValue> cursor = mock( Seeker.class );
when( cursor.next() ).thenReturn( true, true, true, false );
when( cursor.key() ).thenReturn(
key( 0 ),
key( 1 ),
key( 3 ) );
when( cursor.value() ).thenReturn(
value( 0b1000_1000__1100_0010L ),
value( 0b0000_0010__0000_1000L ),
value( 0b0010_0000__1010_0001L ),
null );
when( index.seek( any( LabelScanKey.class ), any( LabelScanKey.class ), eq( NULL ) ) )
.thenReturn( cursor );
// WHEN
NativeLabelScanReader reader = new NativeLabelScanReader( index );
try ( PrimitiveLongResourceIterator iterator = reader.nodesWithLabel( LABEL_ID ) )
{
// THEN
assertArrayEquals( new long[]{
// base 0*64 = 0
1, 6, 7, 11, 15,
// base 1*64 = 64
64 + 3, 64 + 9,
// base 3*64 = 192
192 + 0, 192 + 5, 192 + 7, 192 + 13},
closingAsArray( iterator ) );
}
}
@Test
void shouldSupportMultipleOpenCursorsConcurrently() throws Exception
{
// GIVEN
GBPTree<LabelScanKey,LabelScanValue> index = mock( GBPTree.class );
Seeker<LabelScanKey,LabelScanValue> cursor1 = mock( Seeker.class );
when( cursor1.next() ).thenReturn( false );
Seeker<LabelScanKey,LabelScanValue> cursor2 = mock( Seeker.class );
when( cursor2.next() ).thenReturn( false );
when( index.seek( any( LabelScanKey.class ), any( LabelScanKey.class ), eq( NULL ) ) ).thenReturn( cursor1, cursor2 );
// WHEN
NativeLabelScanReader reader = new NativeLabelScanReader( index );
try ( PrimitiveLongResourceIterator first = reader.nodesWithLabel( LABEL_ID );
PrimitiveLongResourceIterator second = reader.nodesWithLabel( LABEL_ID ) )
{
// first check test invariants
verify( cursor1, never() ).close();
verify( cursor2, never() ).close();
// getting the second iterator should not have closed the first one
verify( cursor1, never() ).close();
verify( cursor2, never() ).close();
// exhausting the first one should have closed only the first one
exhaust( first );
verify( cursor1 ).close();
verify( cursor2, never() ).close();
// exhausting the second one should close it
exhaust( second );
verify( cursor1 ).close();
verify( cursor2 ).close();
}
}
@Test
void shouldCloseUnexhaustedCursorsOnReaderClose() throws Exception
{
// GIVEN
GBPTree<LabelScanKey,LabelScanValue> index = mock( GBPTree.class );
Seeker<LabelScanKey,LabelScanValue> cursor1 = mock( Seeker.class );
when( cursor1.next() ).thenReturn( false );
Seeker<LabelScanKey,LabelScanValue> cursor2 = mock( Seeker.class );
when( cursor2.next() ).thenReturn( false );
when( index.seek( any( LabelScanKey.class ), any( LabelScanKey.class ), eq( NULL ) ) ).thenReturn( cursor1, cursor2 );
// WHEN
NativeLabelScanReader reader = new NativeLabelScanReader( index );
try ( PrimitiveLongResourceIterator ignore1 = reader.nodesWithLabel( LABEL_ID );
PrimitiveLongResourceIterator ignore2 = reader.nodesWithLabel( LABEL_ID )
)
{
// first check test invariants
verify( cursor1, never() ).close();
verify( cursor2, never() ).close();
}
// THEN
verify( cursor1 ).close();
verify( cursor2 ).close();
}
@Test
void shouldStartFromGivenId() throws IOException
{
// given
GBPTree<LabelScanKey,LabelScanValue> index = mock( GBPTree.class );
Seeker<LabelScanKey,LabelScanValue> cursor = mock( Seeker.class );
when( cursor.next() ).thenReturn( true, true, false );
when( cursor.key() ).thenReturn(
key( 1 ),
key( 3 ),
null );
when( cursor.value() ).thenReturn(
value( 0b0001_1000__0101_1110L ),
// ^--fromId, i.e. ids after this id should be visible
value( 0b0010_0000__1010_0001L ),
null );
when( index.seek( any( LabelScanKey.class ), any( LabelScanKey.class ), eq( NULL ) ) )
.thenReturn( cursor );
// when
long fromId = LabelScanValue.RANGE_SIZE + 3;
NativeLabelScanReader reader = new NativeLabelScanReader( index );
try ( PrimitiveLongResourceIterator iterator = reader.nodesWithAnyOfLabels( fromId, LABEL_ID ) )
{
// then
assertArrayEquals( new long[] {
// base 1*64 = 64
64 + 4, 64 + 6, 64 + 11, 64 + 12,
// base 3*64 = 192
192 + 0, 192 + 5, 192 + 7, 192 + 13 },
asArray( iterator ) );
}
}
private static LabelScanValue value( long bits )
{
LabelScanValue value = new LabelScanValue();
value.bits = bits;
return value;
}
private static LabelScanKey key( long idRange )
{
return new LabelScanKey( LABEL_ID, idRange );
}
private static void exhaust( LongIterator iterator )
{
while ( iterator.hasNext() )
{
iterator.next();
}
}
}
| [
"rodrigosoaresilva@gmail.com"
] | rodrigosoaresilva@gmail.com |
fa1ea6266b139015cb916e42f9e1c282d1d66d74 | 53d677a55e4ece8883526738f1c9d00fa6560ff7 | /com/tencent/mm/plugin/gif/h$3.java | 896faaa7bb4ac54015d38c51127e0c251ebae056 | [] | no_license | 0jinxing/wechat-apk-source | 544c2d79bfc10261eb36389c1edfdf553d8f312a | f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d | refs/heads/master | 2020-06-07T20:06:03.580028 | 2019-06-21T09:17:26 | 2019-06-21T09:17:26 | 193,069,132 | 9 | 4 | null | null | null | null | UTF-8 | Java | false | false | 579 | java | package com.tencent.mm.plugin.gif;
import com.tencent.matrix.trace.core.AppMethodBeat;
final class h$3
implements Runnable
{
h$3(h paramh)
{
}
public final void run()
{
AppMethodBeat.i(62427);
h.a(this.npu, -1);
MMWXGFJNI.nativeRewindBuffer(h.g(this.npu));
h.a(this.npu, h.e(this.npu), 0L);
AppMethodBeat.o(62427);
}
}
/* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes6-dex2jar.jar
* Qualified Name: com.tencent.mm.plugin.gif.h.3
* JD-Core Version: 0.6.2
*/ | [
"172601673@qq.com"
] | 172601673@qq.com |
f5d4d64f3616fc80c6867dbc17a63172cf45eddb | 0a94e4bb6bdf5c54ebba25cecafa72215266843a | /2.JavaCore/src/com/javarush/task/task17/task1712/Manager.java | abbf34f8f06ac2305b07fcc44d12fa85bf8786fd | [] | no_license | Senat77/JavaRush | 8d8fb6e59375656a545825585118febd2e1637f4 | 68dc0139da96617ebcad967331dcd24f9875d8ee | refs/heads/master | 2020-05-19T18:50:31.534629 | 2018-09-25T14:00:31 | 2018-09-25T14:00:31 | 185,160,609 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,327 | java | package com.javarush.task.task17.task1712;
import java.util.ArrayList;
import java.util.List;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
public class Manager
{
//singleton
private static Manager ourInstance = new Manager();
private final List<Table> restaurantTables = new ArrayList<Table>(10);
private int currentIndex = 0;
private final Queue<Order> orderQueue = new ConcurrentLinkedQueue<Order>(); // очередь с заказами
private final Queue<Dishes> dishesQueue = new ConcurrentLinkedQueue<Dishes>(); // очередь с готовыми блюдами
public synchronized static Manager getInstance() {
return ourInstance;
}
private Manager() { // создаем 10 столов
for (int i = 0; i < 10; i++) {
restaurantTables.add(new Table());
}
}
public synchronized Table getNextTable() { // официант ходит по кругу от 1 стола к 10
Table table = restaurantTables.get(currentIndex);
currentIndex = (currentIndex + 1) % 10;
return table;
}
public Queue<Order> getOrderQueue() {
return orderQueue;
}
public Queue<Dishes> getDishesQueue() {
return dishesQueue;
}
}
| [
"sergii.senatorov@gmail.com"
] | sergii.senatorov@gmail.com |
f118ac74435a6043d6dde5d70b170d205e316de6 | 1074c97cdd65d38c8c6ec73bfa40fb9303337468 | /rda0105-agl-aus-java-a43926f304e3/xms-delivery/src/main/java/com/gms/delivery/ups/service/rest/tracking/response/pojo/Errors.java | 307138b73c2416e9f9b5ee3a219e2cabbcd78b20 | [] | no_license | gahlawat4u/repoName | 0361859254766c371068e31ff7be94025c3e5ca8 | 523cf7d30018b7783e90db98e386245edad34cae | refs/heads/master | 2020-05-17T01:26:00.968575 | 2019-04-29T06:11:52 | 2019-04-29T06:11:52 | 183,420,568 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 317 | java | package com.gms.delivery.ups.service.rest.tracking.response.pojo;
public class Errors {
private ErrorDetail ErrorDetail;
public void setErrorDetail(ErrorDetail ErrorDetail){
this.ErrorDetail = ErrorDetail;
}
public ErrorDetail getErrorDetail(){
return this.ErrorDetail;
}
}
| [
"sachin.gahlawat19@gmail.com"
] | sachin.gahlawat19@gmail.com |
a999b00fca473faca253b2594b509bb899071e33 | bab312373c967caf5fe359b9c6a468bebf1f5d46 | /tableViews/src/test/java/gov/nasa/arc/mct/abbreviation/impl/LabelAbbreviationsTest.java | 6c44f6f0aa2a18219a576e8251d1a6e9d61fef0d | [] | no_license | HugoGuarin/ochouno | 15dd6f1feb04d28f298205e2ebb76c7a3be3c8e3 | 1ce702b45edf7554584fdc8efffa5a9a13a32807 | refs/heads/master | 2021-01-21T23:28:54.839678 | 2017-06-23T18:45:04 | 2017-06-23T18:45:04 | 95,246,195 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,032 | java | /*******************************************************************************
* Mission Control Technologies, Copyright (c) 2009-2012, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* The MCT platform is 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.
*
* MCT includes source code licensed under additional open source licenses. See
* the MCT Open Source Licenses file included with this distribution or the About
* MCT Licenses dialog available at runtime from the MCT Help menu for additional
* information.
*******************************************************************************/
package gov.nasa.arc.mct.abbreviation.impl;
import gov.nasa.arc.mct.table.view.AbbreviationSettings;
import gov.nasa.arc.mct.table.view.LabelAbbreviations;
import java.lang.reflect.Field;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import org.testng.Assert;
import org.testng.annotations.Test;
public class LabelAbbreviationsTest {
@Test
public void getAbbreviation() throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
AbbreviationsImpl availableAbbreviations = new AbbreviationsImpl("value");
availableAbbreviations.addPhrase("Amps", Collections.singletonList("A"));
availableAbbreviations.addPhrase("BCA1", Collections.<String>emptyList());
availableAbbreviations.addPhrase("Ch1", Collections.<String>emptyList());
availableAbbreviations.addPhrase("Serial", Collections.<String>emptyList());
AbbreviationSettings aSettings = new AbbreviationSettings("fullLabel", availableAbbreviations, new LabelAbbreviations());
String abbreviatedLabel = aSettings.getAbbreviatedLabel();
Assert.assertEquals(abbreviatedLabel, "Amps BCA1 Ch1 Serial");
LabelAbbreviations available2 = aSettings.getAbbreviations();
Assert.assertEquals(available2.getAbbreviation("BCA1"), "BCA1");
Assert.assertEquals(available2.getAbbreviation("Amps"), "Amps");
// Change the state of the control panel via currentAbbreviations
LabelAbbreviations currentAbbreviations = new LabelAbbreviations();
currentAbbreviations.addAbbreviation("Amps", "A | a | Amp");
currentAbbreviations.addAbbreviation("BCA1", "B | bca1");
currentAbbreviations.addAbbreviation("CAT", "C");
currentAbbreviations.addAbbreviation("DOG", "D");
currentAbbreviations.addAbbreviation("Ace", "ace");
currentAbbreviations.addAbbreviation("Abb", "a");
currentAbbreviations.addAbbreviation("Rabbit", "R");
AbbreviationSettings a2Settings = new AbbreviationSettings("fullLabel", availableAbbreviations, currentAbbreviations);
LabelAbbreviations available2afterSelect = a2Settings.getAbbreviations();
Assert.assertEquals(available2afterSelect.getAbbreviation("BCA1"), "B | bca1");
Assert.assertEquals(available2afterSelect.getAbbreviation("Amps"), "A | a | Amp");
Map<String, String> map = getAbbreviations(currentAbbreviations);
Assert.assertEquals(map.size(), 7);
}
private Map<String, String> getAbbreviations(
LabelAbbreviations currentAbbreviations) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException {
Field f = currentAbbreviations.getClass().getDeclaredField("abbreviations"); //NoSuchFieldException
f.setAccessible(true);
@SuppressWarnings("unchecked")
Map<String, String> map = (HashMap<String,String>) f.get(currentAbbreviations); //IllegalAccessException
return map;
}
}
| [
"ricardo910821@gmail.com"
] | ricardo910821@gmail.com |
7a861a84b277822f5a4e1374452cc71e64ae5915 | 4295b61f084171c556f7cee3232f9d9dc4653f3e | /com.omni.systems.messages.service/src/main/java/application/InterfaceMessages.java | 9fbf24de07347133ed3870613aacc6019e4c3e75 | [] | no_license | billybissic/omni-control-panel-services | 901abe45e4c79f448f7c6248804000128c3d6962 | 8635ca72f108c0c3bc111d1c3acd8699c674f721 | refs/heads/master | 2023-07-31T13:37:01.022703 | 2021-09-02T15:33:51 | 2021-09-02T15:33:51 | 390,213,324 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,392 | java | package application;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
@Entity
public class InterfaceMessages {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
@Column(name="interface_message_id")
private Integer interfaceMessageId;
@Column(name="interface_message_text")
private String InterfaceMessageText;
@Column(name="language_code")
private Integer language_code;
/**
* @return the interfaceMessagesId
*/
public Integer getInterfaceMessageId() {
return interfaceMessageId;
}
/**
* @param interfaceMessagesId the interfaceMessagesId to set
*/
public void setInterfaceMessageId(Integer interfaceMessagesId) {
interfaceMessageId = interfaceMessagesId;
}
/**
* @return the interfaceMessageText
*/
public String getInterfaceMessageText() {
return InterfaceMessageText;
}
/**
* @param interfaceMessageText the interfaceMessageText to set
*/
public void setInterfaceMessageText(String interfaceMessageText) {
InterfaceMessageText = interfaceMessageText;
}
/**
* @return the language_code
*/
public Integer getLanguage_code() {
return language_code;
}
/**
* @param language_code the language_code to set
*/
public void setLanguage_code(Integer language_code) {
this.language_code = language_code;
}
}
| [
"bissic.billy@gmail.com"
] | bissic.billy@gmail.com |
f4f3ea4558044167303d6fc652f4cc8a27723d47 | b6a97a77f46aff5b5f5c198d122eb58118338562 | /hutool-core/src/main/java/cn/hutool/core/convert/NumberWordFormater.java | 0e94e901740cc989566f50f6dfa08915142858ee | [
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference",
"MulanPSL-2.0"
] | permissive | jackblack369/hutool | dcbb3a8bb8156c1fa8cf0f1d1eaab04c3ac941cc | 181b83a75eabb966ce17eb1ddee3a82059515e7a | refs/heads/v5-master | 2023-01-29T23:39:15.159518 | 2020-12-02T08:18:58 | 2020-12-02T08:18:58 | 319,193,434 | 1 | 0 | NOASSERTION | 2020-12-07T03:29:39 | 2020-12-07T03:29:39 | null | UTF-8 | Java | false | false | 358 | java | package cn.hutool.core.convert;
/**
* 将浮点数类型的number转换成英语的表达方式 <br>
* 参考博客:http://blog.csdn.net/eric_sunah/article/details/8713226
*
* @author Looly
* @since 3.0.9
* @deprecated 请使用 {@link NumberWordFormatter}
*/
@Deprecated
public class NumberWordFormater extends NumberWordFormatter{
} | [
"loolly@gmail.com"
] | loolly@gmail.com |
1da4cdeb9eda4c5aa5a84aad7b082fc555718e27 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/95/org/apache/commons/math/ode/nonstiff/MultistepIntegrator_reset_268.java | abc8390f5286e089696a009c4e55f5efa3c06bbe | [] | no_license | hvdthong/NetML | dca6cf4d34c5799b400d718e0a6cd2e0b167297d | 9bb103da21327912e5a29cbf9be9ff4d058731a5 | refs/heads/master | 2021-06-30T15:03:52.618255 | 2020-10-07T01:58:48 | 2020-10-07T01:58:48 | 150,383,588 | 1 | 1 | null | 2018-09-26T07:08:45 | 2018-09-26T07:08:44 | null | UTF-8 | Java | false | false | 625 | java |
org apach common math od nonstiff
base multistep integr ordinari
differenti equat
adam bashforth integr adamsbashforthintegr
adam moulton integr adamsmoultonintegr
bdf integr bdfintegr
version revis date
multistep integr multistepintegr abstract integr abstractintegr
inherit doc inheritdoc
reset
handler reset
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
f1d4b4511573c6308d5a32c3f890f80bc434bfdb | 4a33a4e1646efbecaa5172c20a67be57dcda1fea | /handwriting-code/src/main/java/com/composite/handwritingcode/concurrent/forkjoin/fifth/Task.java | 3a22e27c347134a4dfbec130b94e88a00a9a7c51 | [] | no_license | jackyzonewen/SpringBootCompositeLearn | b2bc92803ee7b2338f49077dfdfcd0633cea9897 | 7e20b4cf62d2955f6ecd98ad032b2fa4bfda619f | refs/heads/master | 2020-09-12T06:26:39.599625 | 2019-04-26T02:45:43 | 2019-04-26T02:45:43 | 222,340,752 | 1 | 0 | null | 2019-11-18T01:43:08 | 2019-11-18T01:43:08 | null | UTF-8 | Java | false | false | 1,245 | java | package com.composite.handwritingcode.concurrent.forkjoin.fifth;
import java.util.concurrent.RecursiveTask;
import java.util.concurrent.TimeUnit;
public class Task extends RecursiveTask<Integer> {
private static final long serialVersionUID = 1L;
private int[] array;
private int start;
private int end;
public Task(int[] array, int start, int end) {
this.array = array;
this.start = start;
this.end = end;
}
@Override
protected Integer compute() {
System.out.printf("Task: Start from %d to %d\n", start, end);
if (end - start < 10) {
if (start < 3 && end > 3) {
throw new RuntimeException("This task throws an Exception: Task from " + start + " to " + end);
}
try {
TimeUnit.SECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
} else {
int mid = (start + end) / 2;
Task task1 = new Task(array, start, mid);
Task task2 = new Task(array, mid, end);
this.invokeAll(task1, task2);
}
System.out.printf("Task: End from %d to %d\n", start, end);
return 0;
}
}
| [
"847350737@qq.com"
] | 847350737@qq.com |
d738da82a6bbbbe03f1441d741f52d3cac04bdb6 | bcbd5cdbec730aec758a94fcd8b0136171f08663 | /bench4bl/spring/shdp/sources/SHDP_0_9_0/src/main/java/org/springframework/data/hadoop/mapreduce/JobRunner.java | fd240f8602298aa4ebd1393979d33f476a1551f6 | [] | no_license | RosePasta/BugTypeBasedIRBL | 28c85e1d7f28b2da8a2f12cc4d9c24754a0afe90 | 55b0f82cf185a3a871926cc7a266072f8e497510 | refs/heads/master | 2022-05-06T08:38:38.138869 | 2022-04-20T06:34:38 | 2022-04-20T06:34:38 | 188,862,575 | 1 | 3 | null | 2019-11-21T09:48:44 | 2019-05-27T14:52:28 | Java | UTF-8 | Java | false | false | 3,445 | java | /*
* Copyright 2011-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.data.hadoop.mapreduce;
import java.util.Collection;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.mapreduce.Job;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.util.Assert;
/**
* Simple runner for submitting Hadoop jobs sequentially. By default, the runner waits for the jobs to finish and returns a boolean indicating
* whether all the jobs succeeded or not (when there's no waiting, the status cannot be determined and null is returned).
* <p/>
* For more control over the job execution and outcome consider querying the {@link Job}s or using Spring Batch (see the reference documentation for more info).
*
* @author Costin Leau
*/
public class JobRunner implements FactoryBean<Object>, InitializingBean, DisposableBean {
private static final Log log = LogFactory.getLog(JobRunner.class);
private boolean runAtStartup = true;
private boolean waitForJobs = true;
private Collection<Job> jobs;
private boolean executed = false;
private boolean succesful = false;
@Override
public void afterPropertiesSet() throws Exception {
Assert.notEmpty(jobs, "at least one job needs to be specified");
if (runAtStartup) {
getObject();
}
}
@Override
public void destroy() throws Exception {
if (!waitForJobs) {
for (Job job : jobs) {
try {
job.killJob();
} catch (Exception ex) {
log.warn("Cannot kill job [" + job.getJobID() + "|" + job.getJobName() + " ] failed", ex);
}
}
}
}
@Override
public Object getObject() throws Exception {
if (!executed) {
for (Job job : jobs) {
if (!waitForJobs) {
job.submit();
}
else {
succesful &= job.waitForCompletion(true);
}
}
}
return (waitForJobs ? null : succesful);
}
@Override
public Class<?> getObjectType() {
return Boolean.class;
}
@Override
public boolean isSingleton() {
return true;
}
/**
* Indicates whether the jobs should be submitted at startup or not.
*
* @param runAtStartup The runAtStartup to set.
*/
public void setRunAtStartup(boolean runAtStartup) {
this.runAtStartup = runAtStartup;
}
/**
* Indicates whether the runner should wait for the jobs to finish (the default) or not.
*
* @param waitForJobs The waitForJobs to set.
*/
public void setWaitForJobs(boolean waitForJobs) {
this.waitForJobs = waitForJobs;
}
/**
* Sets the Jobs to run.
*
* @param jobs The jobs to run.
*/
public void setJobs(Collection<Job> jobs) {
this.jobs = jobs;
}
} | [
"MisooKim@github.com"
] | MisooKim@github.com |
bde0a27326e7a52fcd8db31a90566561b66bec13 | f338418814bc0509ddb7df13aa3f8e665dbab99a | /src/test/java/com/google/devtools/build/lib/buildtool/OutputArtifactConflictTest.java | c21ec4d32cfa70d9b764f7d8adba76fa37624c08 | [
"Apache-2.0"
] | permissive | dslomov/bazel | a87384fdfc0cfb03e696cc88bf1f80318caa69ce | c90109532d50665c190d10aef72db8ebc6cd8e33 | refs/heads/master | 2021-01-18T12:05:52.130771 | 2020-04-06T11:21:56 | 2020-04-06T11:23:09 | 40,503,836 | 1 | 1 | Apache-2.0 | 2019-07-22T13:04:47 | 2015-08-10T20:12:38 | Java | UTF-8 | Java | false | false | 7,359 | java | // Copyright 2020 The Bazel Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.devtools.build.lib.buildtool;
import static com.google.common.truth.Truth.assertThat;
import static com.google.devtools.build.lib.testutil.MoreAsserts.assertNoEvents;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.fail;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.actions.BuildFailedException;
import com.google.devtools.build.lib.analysis.ViewCreationFailedException;
import com.google.devtools.build.lib.buildtool.util.GoogleBuildIntegrationTestCase;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
/** Tests for actions that generate artifacts with one a prefix of the other. */
@RunWith(JUnit4.class)
public class OutputArtifactConflictTest extends GoogleBuildIntegrationTestCase {
private void runArtifactPrefix(boolean keepGoing, boolean modifyBuildFile) throws Exception {
if (modifyBuildFile) {
write("x/BUILD", "cc_library(name = 'y', srcs = ['y.cc'])");
} else {
write("x/BUILD", "cc_binary(name = 'y', srcs = ['y.cc'], malloc = '//base:system_malloc')");
}
write("x/y/BUILD", "cc_library(name = 'y')");
write("x/y.cc", "int main() { return 0; }");
if (modifyBuildFile) {
buildTarget("//x/y", "//x:y");
write("x/BUILD", "cc_binary(name = 'y', srcs = ['y.cc'], malloc = '//base:system_malloc')");
} else {
buildTarget("//x/y");
}
assertNoEvents(events.errors());
if (keepGoing) {
runtimeWrapper.addOptions("--keep_going");
}
try {
// Skyframe full should throw an error here even if we just build //x:y. However, because our
// testing infrastructure sets up lots of symlinks, Skyframe invalidates the //x/y action, and
// so would not find a conflict here without re-evaluating //x/y. Note that in a real client,
// requesting the //x/y target would not be necessary to throw an exception.
buildTarget("//x:y", "//x/y");
fail();
} catch (BuildFailedException | ViewCreationFailedException e) {
// Expected.
}
events.assertContainsError("output path 'blaze-out/");
// Skip over config key string ...
events.assertContainsError(
"/bin/x/y' (belonging to //x:y) is a prefix of output path 'blaze-out");
if (keepGoing) {
assertThat(Iterables.size(events.errors())).isGreaterThan(1);
} else {
assertThat(events.errors()).hasSize(1);
}
}
@Test
public void testArtifactPrefix_KeepGoing() throws Exception {
runArtifactPrefix(true, false);
}
@Test
public void testArtifactPrefix_NoKeepGoing() throws Exception {
runArtifactPrefix(false, false);
}
@Test
public void testArtifactPrefix_KeepGoing_ModifyBuildFile() throws Exception {
runArtifactPrefix(true, true);
}
@Test
public void testArtifactPrefix_NoKeepGoing_ModifyBuildFile() throws Exception {
runArtifactPrefix(false, true);
}
@Test
public void testInvalidatedConflict() throws Exception {
write("x/BUILD", "cc_binary(name = 'y', srcs = ['y.cc'], malloc = '//base:system_malloc')");
write("x/y/BUILD", "cc_library(name = 'y')");
write("x/y.cc", "int main() { return 0; }");
try {
buildTarget("//x:y", "//x/y");
fail();
} catch (BuildFailedException | ViewCreationFailedException e) {
// Expected.
}
write("x/BUILD", "# no conflict");
events.clear();
buildTarget("//x/y");
events.assertNoWarningsOrErrors();
}
@Test
public void testNewTargetConflict() throws Exception {
write("x/BUILD", "cc_binary(name = 'y', srcs = ['y.cc'], malloc = '//base:system_malloc')");
write("x/y/BUILD", "cc_library(name = 'y')");
write("x/y.cc", "int main() { return 0; }");
buildTarget("//x/y");
events.assertNoWarningsOrErrors();
try {
buildTarget("//x:y", "//x/y");
fail();
} catch (BuildFailedException | ViewCreationFailedException e) {
// Expected.
}
}
@Test
public void testTwoOverlappingBuildsHasNoConflict() throws Exception {
write("x/BUILD", "cc_binary(name = 'y', srcs = ['y.cc'], malloc = '//base:system_malloc')");
write("x/y/BUILD", "cc_library(name = 'y')");
write("x/y.cc", "int main() { return 0; }");
buildTarget("//x/y");
events.assertNoWarningsOrErrors();
buildTarget("//x:y");
events.assertNoWarningsOrErrors();
// Verify that together they fail, even though no new targets have been analyzed
try {
buildTarget("//x:y", "//x/y");
fail();
} catch (BuildFailedException | ViewCreationFailedException e) {
// Expected.
}
events.clear();
// Verify that they still don't fail individually, so no state remains
buildTarget("//x/y");
events.assertNoWarningsOrErrors();
buildTarget("//x:y");
events.assertNoWarningsOrErrors();
}
@Test
public void testFailingTargetsDoNotCauseActionConflicts() throws Exception {
write(
"x/bad_rule.bzl",
"def _impl(ctx):",
" return list().this_method_does_not_exist()",
"bad_rule = rule(_impl, attrs = {'deps': attr.label_list()})");
write(
"x/BUILD",
"load('//x:bad_rule.bzl', 'bad_rule')",
"cc_binary(name = 'y', srcs = ['y.cc'], malloc = '//base:system_malloc')",
"bad_rule(name = 'bad', deps = [':y'])");
write("x/y/BUILD", "cc_library(name = 'y')");
write("x/y.cc", "int main() { return 0; }");
runtimeWrapper.addOptions("--keep_going");
try {
buildTarget("//x:y", "//x/y");
fail();
} catch (ViewCreationFailedException e) {
fail("Unexpected artifact prefix conflict: " + e);
} catch (BuildFailedException e) {
// Expected.
}
}
@Test
public void testMultipleConflictErrors() throws Exception {
write(
"conflict/BUILD",
"cc_library(name='x', srcs=['foo.cc'])",
"cc_binary(name='_objs/x/foo.pic.o', srcs=['bar.cc'], "
+ "malloc = '//base:system_malloc')");
write("x/BUILD", "cc_binary(name = 'y', srcs = ['y.cc'], malloc = '//base:system_malloc')");
write("x/y.cc", "int main() { return 0; }");
write("conflict/foo.cc", "int main() { return 0; }");
write("conflict/bar.cc", "int main() { return 0; }");
write("x/y/BUILD", "cc_library(name = 'y')");
runtimeWrapper.addOptions("--keep_going");
assertThrows(
BuildFailedException.class,
() -> buildTarget("//x/y", "//x:y", "//conflict:x", "//conflict:_objs/x/foo.pic.o"));
events.assertContainsError(
"file 'conflict/_objs/x/foo.pic.o' is generated by these conflicting actions:");
events.assertContainsError(
"/bin/x/y' (belonging to //x:y) is a prefix of output path 'blaze-out");
}
}
| [
"copybara-worker@google.com"
] | copybara-worker@google.com |
06b4a562748c094e51387e16478a24fa36f0e3f9 | ac72641cacd2d68bd2f48edfc511f483951dd9d6 | /opscloud-manage/src/main/java/com/baiyi/opscloud/builder/OpscloudInstanceBuilder.java | 710934663f838715a692c0a690251854b6ed1b3a | [] | no_license | fx247562340/opscloud-demo | 6afe8220ce6187ac4cc10602db9e14374cb14251 | b608455cfa5270c8c021fbb2981cb8c456957ccb | refs/heads/main | 2023-05-25T03:33:22.686217 | 2021-06-08T03:17:32 | 2021-06-08T03:17:32 | 373,446,042 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 696 | java | package com.baiyi.opscloud.builder;
import com.baiyi.opscloud.domain.generator.opscloud.OcInstance;
import java.net.InetAddress;
/**
* @Author <a href="mailto:xiuyuan@xinc818.group">修远</a>
* @Date 2020/11/24 5:29 下午
* @Since 1.0
*/
public class OpscloudInstanceBuilder {
public static OcInstance build(InetAddress inetAddress) {
OcInstance ocInstance = new OcInstance();
ocInstance.setHostIp(inetAddress.getHostAddress());
ocInstance.setHostname(inetAddress.getHostName());
ocInstance.setName(inetAddress.getCanonicalHostName());
ocInstance.setInstanceStatus(0);
ocInstance.setIsActive(true);
return ocInstance;
}
}
| [
"fanxin01@longfor.com"
] | fanxin01@longfor.com |
e80637ed3f26be1daf64d05155db882f46672801 | f3414e405d68daa615b8010a949847b3fb7bd5b9 | /utilities/idcserver.src/intradoc/idcwls/IdcServletFilter.java | 5b0f2c1de5690794ac01a6b1e7cd05447f1cb73d | [] | no_license | osgirl/ProjectUCM | ac2c1d554746c360f24414d96e85a6c61e31b102 | 5e0cc24cfad53d1f359d369d57b622c259f88311 | refs/heads/master | 2020-04-22T04:11:13.373873 | 2019-03-04T19:26:48 | 2019-03-04T19:26:48 | 170,114,287 | 0 | 0 | null | 2019-02-11T11:02:25 | 2019-02-11T11:02:25 | null | UTF-8 | Java | false | false | 5,326 | java | /* */ package intradoc.idcwls;
/* */
/* */ import intradoc.common.ClassHelper;
/* */ import intradoc.common.ClassHelperUtils;
/* */ import intradoc.common.EnvUtils;
/* */ import intradoc.common.ExecutionContext;
/* */ import intradoc.common.ServiceException;
/* */ import intradoc.data.DataBinder;
/* */ import intradoc.data.DataException;
/* */ import intradoc.data.Workspace;
/* */ import intradoc.server.Service;
/* */ import intradoc.server.ServiceHttpImplementor;
/* */ import intradoc.shared.FilterImplementor;
/* */ import intradoc.util.IdcLoggerUtils;
/* */
/* */ public class IdcServletFilter
/* */ implements FilterImplementor
/* */ {
/* */ DataBinder m_binder;
/* */
/* */ public IdcServletFilter()
/* */ {
/* 37 */ this.m_binder = null;
/* */ }
/* */
/* */ public int doFilter(Workspace ws, DataBinder binder, ExecutionContext cxt) throws DataException, ServiceException
/* */ {
/* 42 */ this.m_binder = binder;
/* */
/* 44 */ Object param = cxt.getCachedObject("filterParameter");
/* 45 */ if ((param == null) || (!param instanceof String))
/* */ {
/* 47 */ return 0;
/* */ }
/* */
/* 50 */ Service service = null;
/* 51 */ ServiceHttpImplementor httpImplementor = null;
/* 52 */ if (cxt instanceof Service)
/* */ {
/* 54 */ service = (Service)cxt;
/* 55 */ Object o = service.getCachedObject("HttpImplementor");
/* 56 */ if (o instanceof ServiceHttpImplementor)
/* */ {
/* 58 */ httpImplementor = (ServiceHttpImplementor)o;
/* */ }
/* */ }
/* */
/* 62 */ if (param.equals("logoutServer"))
/* */ {
/* 64 */ return logoutServer(service, httpImplementor);
/* */ }
/* 66 */ if ((param.equals("loadComponentDataPostFilters")) &&
/* 68 */ (EnvUtils.isHostedInAppServer()))
/* */ {
/* 71 */ IdcLoggerUtils.clearStringCache();
/* */ }
/* */
/* 74 */ if (param.equals("preDoResponse"))
/* */ {
/* 76 */ fixupWebRoot(service);
/* */ }
/* 78 */ if ((param.equals("afterHttpImplementorInit")) &&
/* 80 */ (EnvUtils.isHostedInAppServer()))
/* */ {
/* 82 */ afterHttpImplementorInit(service);
/* */ }
/* */
/* 85 */ return 0;
/* */ }
/* */
/* */ public int logoutServer(Service service, ServiceHttpImplementor httpImplementor)
/* */ throws DataException, ServiceException
/* */ {
/* 91 */ IdcServletRequestContext cxt = (IdcServletRequestContext)service.getCachedObject("IdcServletRequestContext");
/* */
/* 94 */ if (cxt == null)
/* */ {
/* 96 */ return 0;
/* */ }
/* */
/* 99 */ IdcServletAuthUtils.logout(this.m_binder, cxt);
/* */
/* 105 */ httpImplementor.m_loginState = "0";
/* */
/* 107 */ return 0;
/* */ }
/* */
/* */ public int fixupWebRoot(Service service) throws DataException, ServiceException
/* */ {
/* 112 */ IdcServletRequestContext request = (IdcServletRequestContext)service.getCachedObject("IdcServletRequestContext");
/* */
/* 115 */ if (request == null)
/* */ {
/* 117 */ return 0;
/* */ }
/* 119 */ boolean doRedirect = IdcServletRequestUtils.searchForBooleanValue(request, "servletdoredirect", false);
/* 120 */ if (doRedirect)
/* */ {
/* 122 */ String redirectUrl = IdcServletRequestUtils.searchForValue(request, "servletredirecturl");
/* 123 */ if (redirectUrl == null)
/* */ {
/* 125 */ redirectUrl = IdcServletStaticEnv.m_relativeWebRoot;
/* */ }
/* */
/* 128 */ this.m_binder.putLocal("RedirectUrl", redirectUrl);
/* */ }
/* */
/* 131 */ return 0;
/* */ }
/* */
/* */ public int afterHttpImplementorInit(Service service)
/* */ throws DataException, ServiceException
/* */ {
/* */ try
/* */ {
/* 139 */ ServiceHttpImplementor httpImpl = (ServiceHttpImplementor)service.getCachedObject("HttpImplementor");
/* */
/* 142 */ ClassHelper contextHelper = ClassHelperUtils.createClassHelperRef("oracle.dms.context.ExecutionContext");
/* */
/* 145 */ String ECIDContextStr = (String)contextHelper.getFieldValue("KEY");
/* 146 */ String ECIDContext = httpImpl.m_binder.getAllowMissing(ECIDContextStr);
/* */
/* 148 */ if ((ECIDContext != null) && (ECIDContext.length() > 0))
/* */ {
/* 150 */ contextHelper.setObject(contextHelper.invoke("get"));
/* 151 */ contextHelper.invoke("unwrap", ECIDContext);
/* */ }
/* */ }
/* */ catch (Throwable t)
/* */ {
/* */ }
/* */
/* 158 */ return 0;
/* */ }
/* */
/* */ public static Object idcVersionInfo(Object arg)
/* */ {
/* 163 */ return "releaseInfo=7.3.5.185,relengDate=2013-07-11 17:07:21Z,releaseRevision=$Rev: 89430 $";
/* */ }
/* */ }
/* Location: C:\Documents and Settings\rastogia.EMEA\My Documents\idcserver\
* Qualified Name: intradoc.idcwls.IdcServletFilter
* JD-Core Version: 0.5.4
*/ | [
"ranjodh.singh@hays.com"
] | ranjodh.singh@hays.com |
3a0a2619d351ab1fdf4fb128ad61fb19f66f2e73 | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project74/src/test/java/org/gradle/test/performance74_5/Test74_497.java | 4042d81ea54748db6608fda590030c75e827f487 | [] | 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.performance74_5;
import static org.junit.Assert.*;
public class Test74_497 {
private final Production74_497 production = new Production74_497("value");
@org.junit.Test
public void test() {
assertEquals(production.getProperty(), "value");
}
} | [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
5ae830aa71b75d89fed660ecdf9dd12f7fcd59d1 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_00371679b95d704487a923182fc3309133259cf1/ChestPop/11_00371679b95d704487a923182fc3309133259cf1_ChestPop_s.java | dad71a8b16c63b0443a4d9477fd645eb8384f78c | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 4,078 | java | /*
* This file is part of
* KeepXP Server Plugin for Minecraft
*
* Copyright (C) 2013 Diemex
*
* KeepXP is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* KeepXP is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero Public License
* along with KeepXP. If not, see <http://www.gnu.org/licenses/>.
*/
package de.diemex.keepxp;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.entity.Entity;
import org.bukkit.entity.minecart.StorageMinecart;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkPopulateEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.Plugin;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
/**
* @author Diemex
*/
public class ChestPop implements Listener
{
private final Plugin plugin;
private final ChestItem[] items;
int probScale = 0;
private final boolean debug = true;
public ChestPop(Plugin plugin, ChestItem[] items)
{
this.plugin = plugin;
plugin.getServer().getPluginManager().registerEvents(this, plugin);
this.items = items;
for (ChestItem item : items)
probScale += item.probability;
}
/**
* Be "super efficient" and loop through chunk till we have found chests
*/
@EventHandler
private void onChunkGen(ChunkPopulateEvent event)
{
Chunk chunk = event.getChunk();
//From lvl10 - 50
for (int y = 20; y < 50; y++)
{
for (int x = 0; x <= 15; x++)
{
for (int z = 0; z <= 15; z++)
{
Block block = chunk.getBlock(x, y, z);
Material type = block.getType();
if (type == Material.CHEST)
{
Chest chest = (Chest) block.getState();
addItems(chest.getBlockInventory());
}
}
}
}
for (Entity entity : chunk.getEntities())
{
if (entity instanceof StorageMinecart)
{
StorageMinecart minecart = (StorageMinecart)entity;
addItems(minecart.getInventory());
}
}
}
private void addItems(Inventory inv)
{
int chance = 50;
Random rdm = new Random();
if (rdm.nextInt(100) < chance)
{
for (ChestItem item : items)
{
if (rdm.nextInt(probScale) < item.probability)
{
if (inv.firstEmpty() >= 0)
{
//Find a random empty spot
List<Integer> freeSlots = new ArrayList<Integer>();
int i = -1;
for (ItemStack stack : inv.getContents())
if (stack == null & ++i >= 0) //lol
freeSlots.add(i);
int slot = freeSlots.get(rdm.nextInt(freeSlots.size() - 1));
if (debug) plugin.getLogger().info("Added " + item.toAdd + " at " + inv + " in slot " + slot);
inv.setItem(slot, item.toAdd);
if (rdm.nextBoolean()) //50% prob of more items
break;
}
}
}
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.