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
c9f887a0b92afeaed081434a11fe793c32e4b449
2610e3bccddf5a695cf58adc28f56e1858b94c3c
/microservice-loverent-liquidation-service-v1/src/main/java/org/gz/liquidation/web/controller/account/AccountRecordController.java
e1ae67fb79aae346bff19088f58b7dffbfb704a5
[]
no_license
song121382/aizuji
812958c3020e37c052d913cfdd3807b1a55b2115
5ec44cf60945d6ff017434d5f321c0bcf3f111f1
refs/heads/master
2020-04-08T07:34:00.885177
2018-07-17T08:37:26
2018-07-17T08:37:26
159,143,253
1
4
null
null
null
null
UTF-8
Java
false
false
4,141
java
package org.gz.liquidation.web.controller.account; import java.math.BigDecimal; import java.util.List; import javax.annotation.Resource; import org.gz.common.entity.ResultPager; import org.gz.common.resp.ResponseResult; import org.gz.common.resp.ResponseStatus; import org.gz.common.utils.JsonUtils; import org.gz.common.web.controller.BaseController; import org.gz.liquidation.common.Page; import org.gz.liquidation.common.Enum.AccountEnum; import org.gz.liquidation.common.dto.AccountRecordReq; import org.gz.liquidation.common.dto.AccountRecordResp; import org.gz.liquidation.common.dto.QueryDto; import org.gz.liquidation.common.dto.SaleOrderRepaymentInfoResp; import org.gz.liquidation.common.utils.LiquidationConstant; import org.gz.liquidation.entity.AccountRecord; import org.gz.liquidation.service.account.AccountRecordService; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; /** * * @Description:科目流水控制器 * Author Version Date Changes * liaoqingji 1.0 2018年3月6日 Created */ @RestController @RequestMapping("/accountRecord") @Slf4j public class AccountRecordController extends BaseController{ @Resource private AccountRecordService accountRecordService; @ApiOperation(value = "分页查询科目流水记录", httpMethod = "POST", notes = "操作成功返回 errorCode=0 ", response = ResponseResult.class) @PostMapping(value = "/queryPage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseResult<?> queryPage(@RequestBody AccountRecordReq accountRecordReq){ log.info(">>>>>>>>>>>>>>>> queryPage:{}",JsonUtils.toJsonString(accountRecordReq)); try { QueryDto queryDto = new QueryDto(); Page page = new Page(); page.setStart(accountRecordReq.getCurrPage()); page.setPageSize(accountRecordReq.getPageSize()); queryDto.setPage(page); queryDto.setQueryConditions(accountRecordReq); ResultPager<AccountRecordResp> resultPager = accountRecordService.selectPage(queryDto); return ResponseResult.buildSuccessResponse(resultPager); } catch (Exception e) { log.error(e.getLocalizedMessage()); return ResponseResult.build(ResponseStatus.DATA_REQUERY_ERROR.getCode(), ResponseStatus.DATA_REQUERY_ERROR.getMessage(), null); } } @ApiOperation(value = "查询售卖订单销售金和保障金(订单服务调用)", httpMethod = "POST", notes = "操作成功返回 errorCode=0 ", response = ResponseResult.class) @PostMapping(value = "/querySaleOrderInfo/{orderSN}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseResult<?> querySaleOrderInfo(@PathVariable("orderSN") String orderSN){ log.info(">>>>>>>>>>>>>>>> querySaleOrderInfo orderSN:{}",orderSN); BigDecimal salePrice = new BigDecimal(0); BigDecimal insurance = new BigDecimal(0); AccountRecord accountRecord = new AccountRecord(); accountRecord.setOrderSN(orderSN); accountRecord.setAccountCode(AccountEnum.XSJ.getAccountCode()); accountRecord.setFlowType(LiquidationConstant.IN); List<AccountRecord> list = accountRecordService.selectList(accountRecord); if(!list.isEmpty()){ AccountRecord ar = list.get(0); salePrice = ar.getAmount(); } accountRecord.setAccountCode(AccountEnum.BZJ.getAccountCode()); List<AccountRecord> resultList = accountRecordService.selectList(accountRecord); if(!resultList.isEmpty()){ AccountRecord ar = resultList.get(0); insurance = ar.getAmount(); } SaleOrderRepaymentInfoResp resp = new SaleOrderRepaymentInfoResp(); resp.setInsurance(insurance); resp.setSalePrice(salePrice); return ResponseResult.buildSuccessResponse(resp); } }
[ "daiqw713@outlook.com" ]
daiqw713@outlook.com
2e40301a7d68dd8cb86f0ff7ad07509d91ea3bb7
6cc6833c28d99b8f235e6b45240e0a09bed6d37e
/clouddriver-aws/src/main/groovy/com/netflix/spinnaker/clouddriver/aws/lifecycle/InstanceTerminationLifecycleWorkerProvider.java
20e06b7410519eb8310ff307245ecb1d40357215
[ "Apache-2.0" ]
permissive
spinnaker-cn/clouddriver
e2365b9bfc0f586bd997780dc0ca0b2537229147
8eba147608d4137fb4554728309dd2b11087bac2
refs/heads/master
2023-09-01T01:01:49.563208
2023-08-24T08:24:34
2023-08-24T08:24:34
196,503,143
4
9
Apache-2.0
2021-08-13T12:06:56
2019-07-12T03:34:48
Groovy
UTF-8
Java
false
false
5,246
java
/* * Copyright 2017 Netflix, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.netflix.spinnaker.clouddriver.aws.lifecycle; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.netflix.spectator.api.Registry; import com.netflix.spinnaker.clouddriver.aws.deploy.ops.discovery.AwsEurekaSupport; import com.netflix.spinnaker.clouddriver.aws.security.AmazonClientProvider; import com.netflix.spinnaker.clouddriver.aws.security.NetflixAmazonCredentials; import com.netflix.spinnaker.clouddriver.security.AccountCredentialsProvider; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.RejectedExecutionException; import java.util.regex.Pattern; import javax.annotation.PostConstruct; import javax.inject.Provider; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.stereotype.Component; @Component @ConditionalOnExpression( "${aws.lifecycle-subscribers.instance-termination.enabled:false} && ${caching.write-enabled:true}") public class InstanceTerminationLifecycleWorkerProvider { private static final String REGION_TEMPLATE_PATTERN = Pattern.quote("{{region}}"); private static final String ACCOUNT_ID_TEMPLATE_PATTERN = Pattern.quote("{{accountId}}"); private static final Logger log = LoggerFactory.getLogger(InstanceTerminationLifecycleWorkerProvider.class); private final ObjectMapper objectMapper; private final AmazonClientProvider amazonClientProvider; private final AccountCredentialsProvider accountCredentialsProvider; private final InstanceTerminationConfigurationProperties properties; private final Provider<AwsEurekaSupport> discoverySupport; private final Registry registry; @Autowired InstanceTerminationLifecycleWorkerProvider( @Qualifier("amazonObjectMapper") ObjectMapper objectMapper, AmazonClientProvider amazonClientProvider, AccountCredentialsProvider accountCredentialsProvider, InstanceTerminationConfigurationProperties properties, Provider<AwsEurekaSupport> discoverySupport, Registry registry) { this.objectMapper = objectMapper; this.amazonClientProvider = amazonClientProvider; this.accountCredentialsProvider = accountCredentialsProvider; this.properties = properties; this.discoverySupport = discoverySupport; this.registry = registry; } @PostConstruct public void start() { NetflixAmazonCredentials credentials = (NetflixAmazonCredentials) accountCredentialsProvider.getCredentials(properties.getAccountName()); ExecutorService executorService = Executors.newFixedThreadPool( credentials.getRegions().size(), new ThreadFactoryBuilder() .setNameFormat( InstanceTerminationLifecycleWorkerProvider.class.getSimpleName() + "-%d") .build()); credentials .getRegions() .forEach( region -> { InstanceTerminationLifecycleWorker worker = new InstanceTerminationLifecycleWorker( objectMapper, amazonClientProvider, accountCredentialsProvider, new InstanceTerminationConfigurationProperties( properties.getAccountName(), properties .getQueueARN() .replaceAll(REGION_TEMPLATE_PATTERN, region.getName()) .replaceAll(ACCOUNT_ID_TEMPLATE_PATTERN, credentials.getAccountId()), properties .getTopicARN() .replaceAll(REGION_TEMPLATE_PATTERN, region.getName()) .replaceAll(ACCOUNT_ID_TEMPLATE_PATTERN, credentials.getAccountId()), properties.getVisibilityTimeout(), properties.getWaitTimeSeconds(), properties.getSqsMessageRetentionPeriodSeconds(), properties.getEurekaUpdateStatusRetryMax()), discoverySupport, registry); try { executorService.submit(worker); } catch (RejectedExecutionException e) { log.error("Could not start " + worker.getWorkerName(), e); } }); } }
[ "250234464@qq.com" ]
250234464@qq.com
318fcc762320a4a7c8f9db0366954321e261acf9
400dde102059dd3e6d807674ba2f9d3e0d881f8d
/nuxeo-functional-tests/src/main/java/org/nuxeo/functionaltests/pages/admincenter/PackageListingPage.java
4c854897682366e8864516521a6f3a081183adac
[]
no_license
alienwang2012/nuxeo-distribution
d5589368f639516e098b6ee47abbfb0cc7cec3a9
f056029d1ab23521f3c6c99fe8e19f9561203165
refs/heads/master
2021-01-22T01:51:23.848626
2013-12-14T12:32:45
2013-12-14T12:32:45
15,217,166
1
0
null
null
null
null
UTF-8
Java
false
false
2,597
java
/* * (C) Copyright 2011 Nuxeo SA (http://nuxeo.com/) and contributors. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the GNU Lesser General Public License * (LGPL) version 2.1 which accompanies this distribution, and is available at * http://www.gnu.org/licenses/lgpl.html * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * Contributors: * Thierry Delprat */ package org.nuxeo.functionaltests.pages.admincenter; import org.nuxeo.functionaltests.pages.AbstractPage; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; public class PackageListingPage extends AbstractPage { public PackageListingPage(WebDriver driver) { super(driver); } public WebElement getPackageLink(String packageId) { String xpath = "id('row_" + packageId + "')//a[contains(@class ,'button')]"; return findElementWithTimeout(By.xpath(xpath), 20 * 1000); } public WebElement getPackageDownloadLink(String packageId) { WebElement link = getPackageLink(packageId); if (link!=null) { if (link.getText().trim().toLowerCase().startsWith("download")) { return link; } } return null; } public WebElement getPackageInstallLink(String packageId) { WebElement link = getPackageLink(packageId); if (link!=null) { if (link.getText().trim().toLowerCase().startsWith("install")) { return link; } } return null; } public WebElement download(String packageId) { System.out.println(driver.getCurrentUrl()); WebElement downloadLink = getPackageDownloadLink(packageId); if (downloadLink != null) { downloadLink.click(); return getPackageInstallLink(packageId); } return null; } public PackageInstallationScreen getInstallationScreen(String packageId) { WebElement installLink = getPackageInstallLink(packageId); if (installLink == null) { return null; } installLink.click(); return asPage(PackageInstallationScreen.class); } public UpdateCenterPage exit() { driver.switchTo().defaultContent(); return asPage(UpdateCenterPage.class); } }
[ "tdelprat@nuxeo.com" ]
tdelprat@nuxeo.com
c366ce763f1773c382234d82c6df63b4b249381f
365267d7941f76c97fac8af31a788d8c0fb2d384
/src/main/java/net/minecraft/world/gen/structure/MapGenNetherBridge.java
d83a42a694ff4bd2ee0d23961f3f7ba637aeffd0
[ "MIT" ]
permissive
potomy/client
26d8c31657485f216639efd13b2fdda67570d9b5
c01d23eb05ed83abb4fee00f9bf603b6bc3e2e27
refs/heads/master
2021-06-21T16:02:26.920860
2017-08-02T02:03:49
2017-08-02T02:03:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,645
java
package net.minecraft.world.gen.structure; import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityMagmaCube; import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import java.util.ArrayList; import java.util.List; import java.util.Random; public class MapGenNetherBridge extends MapGenStructure { private List spawnList = new ArrayList(); public MapGenNetherBridge() { this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityBlaze.class, 10, 2, 3)); this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityPigZombie.class, 5, 4, 4)); this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntitySkeleton.class, 10, 4, 4)); this.spawnList.add(new BiomeGenBase.SpawnListEntry(EntityMagmaCube.class, 3, 4, 4)); } public String func_143025_a() { return "Fortress"; } public List getSpawnList() { return this.spawnList; } protected boolean canSpawnStructureAtCoords(int p_75047_1_, int p_75047_2_) { int var3 = p_75047_1_ >> 4; int var4 = p_75047_2_ >> 4; this.rand.setSeed((long)(var3 ^ var4 << 4) ^ this.worldObj.getSeed()); this.rand.nextInt(); return this.rand.nextInt(3) != 0 ? false : (p_75047_1_ != (var3 << 4) + 4 + this.rand.nextInt(8) ? false : p_75047_2_ == (var4 << 4) + 4 + this.rand.nextInt(8)); } protected StructureStart getStructureStart(int p_75049_1_, int p_75049_2_) { return new MapGenNetherBridge.Start(this.worldObj, this.rand, p_75049_1_, p_75049_2_); } public static class Start extends StructureStart { public Start() {} public Start(World p_i2040_1_, Random p_i2040_2_, int p_i2040_3_, int p_i2040_4_) { super(p_i2040_3_, p_i2040_4_); StructureNetherBridgePieces.Start var5 = new StructureNetherBridgePieces.Start(p_i2040_2_, (p_i2040_3_ << 4) + 2, (p_i2040_4_ << 4) + 2); this.components.add(var5); var5.buildComponent(var5, this.components, p_i2040_2_); ArrayList var6 = var5.field_74967_d; while (!var6.isEmpty()) { int var7 = p_i2040_2_.nextInt(var6.size()); StructureComponent var8 = (StructureComponent)var6.remove(var7); var8.buildComponent(var5, this.components, p_i2040_2_); } this.updateBoundingBox(); this.setRandomHeight(p_i2040_1_, p_i2040_2_, 48, 70); } } }
[ "dav.nico@orange.fr" ]
dav.nico@orange.fr
f08e63d46afc674567675a2a66e5863f4fc9ac93
906a5b225265c770047b530f5f7b29a2776aa019
/org.summer.sdt.core/compiler/org/summer/sdt/internal/compiler/ast/EmptyStatement.java
fdc8564da2f2b6954611a4dc5c54a70c233b048a
[]
no_license
zwgirl/summer-j
d29d7e8e5b0b6c5e2866302ea77e0956cc94cc86
4f63019ded38bb2043b408103906b16d09e782d6
refs/heads/master
2020-05-23T13:46:42.239171
2015-05-16T10:31:37
2015-05-16T10:31:37
24,453,440
0
0
null
null
null
null
UTF-8
Java
false
false
2,611
java
/******************************************************************************* * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Stephan Herrmann - Contribution for bug 349326 - [1.7] new warning for missing try-with-resources *******************************************************************************/ package org.summer.sdt.internal.compiler.ast; import org.summer.sdt.internal.compiler.ASTVisitor; import org.summer.sdt.internal.compiler.classfmt.ClassFileConstants; import org.summer.sdt.internal.compiler.codegen.CodeStream; import org.summer.sdt.internal.compiler.flow.FlowContext; import org.summer.sdt.internal.compiler.flow.FlowInfo; import org.summer.sdt.internal.compiler.lookup.BlockScope; import org.summer.sdt.internal.compiler.lookup.Scope; public class EmptyStatement extends Statement { public EmptyStatement(int startPosition, int endPosition) { this.sourceStart = startPosition; this.sourceEnd = endPosition; } public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) { return flowInfo; } // Report an error if necessary public int complainIfUnreachable(FlowInfo flowInfo, BlockScope scope, int complaintLevel, boolean endOfBlock) { // before 1.4, empty statements are tolerated anywhere if (scope.compilerOptions().complianceLevel < ClassFileConstants.JDK1_4) { return complaintLevel; } return super.complainIfUnreachable(flowInfo, scope, complaintLevel, endOfBlock); } public void generateCode(BlockScope currentScope, CodeStream codeStream){ // no bytecode, no need to check for reachability or recording source positions } public StringBuffer printStatement(int tab, StringBuffer output) { return printIndent(tab, output).append(';'); } public void resolve(BlockScope scope) { if ((this.bits & IsUsefulEmptyStatement) == 0) { scope.problemReporter().superfluousSemicolon(this.sourceStart, this.sourceEnd); } else { scope.problemReporter().emptyControlFlowStatement(this.sourceStart, this.sourceEnd); } } public void traverse(ASTVisitor visitor, BlockScope scope) { visitor.visit(this, scope); visitor.endVisit(this, scope); } protected StringBuffer doGenerateExpression(Scope scope, int indent, StringBuffer output) { return output; } }
[ "1141196380@qq.com" ]
1141196380@qq.com
801744920cc14c9831b8262b7acf160f9043609d
86ccb87786458a8807fe9eff9b7200f2626c01a2
/src/main/java/p653/Solution.java
704097edd43b40eb436593ef1bad258bcc86fe4f
[]
no_license
fisher310/leetcoderevolver
d919e566271730b3df26fe28b85c387a3f48faa3
83263b69728f94b51e7188cd79fcdac1f261c339
refs/heads/master
2023-03-07T19:05:58.119634
2022-03-23T12:40:13
2022-03-23T12:40:13
251,488,466
0
0
null
2021-03-24T01:50:58
2020-03-31T03:14:04
Java
UTF-8
Java
false
false
761
java
package p653; import util.TreeNode; import java.util.HashMap; import java.util.Map; /** 两数之和 IV - 输入BST */ class Solution { public boolean findTarget(TreeNode root, int k) { Map<Integer, Integer> map = new HashMap<>(); return dfs(root, k, map); } boolean dfs(TreeNode root, int k, Map<Integer, Integer> map) { if (root == null) return false; int v = k - root.val; if (map.containsKey(v)) { return true; } map.put(root.val, 1); return dfs(root.left, k, map) || dfs(root.right, k, map); } public static void main(String[] args) { Solution s = new Solution(); boolean ans = s.findTarget(TreeNode.createTreeNode(new Integer[] {5, 3, 6, 2, 4, null, 7}), 9); System.out.println(ans); } }
[ "316049914@qq.com" ]
316049914@qq.com
0f457431174784505470c5f6211170228273594f
b346326664f3c39a00c1307a1b00755cff6e046d
/src/com/zohn/socket/useStr/PetClient.java
65fd7c21b9ed9f6449c45339f1b5ffb576020676
[]
no_license
handsomZohn/J2SESocket
416ca257a843be87817531534d6ff92ef06b99d8
be312a8b1eeb204c6f9db297900d9216bf4ad860
refs/heads/master
2020-03-15T16:32:31.555177
2018-07-14T15:33:13
2018-07-14T15:33:13
132,236,982
0
0
null
null
null
null
UTF-8
Java
false
false
1,691
java
package com.zohn.socket.useStr; import java.io.*; import java.net.Socket; import java.net.UnknownHostException; /** * 宠物店用户咨询[字符串方式实现] * 客户端 * Created by zhang on 2018/5/5. */ public class PetClient { public static void main(String[] args) { try{ // 1.建立客户端Socket连接,指定服务器的位置以及端口 Socket socket = new Socket("localhost", 8800 ); // 2.得到socket的读写流 OutputStream outputStream = socket.getOutputStream(); PrintWriter printWriter = new PrintWriter(outputStream); // 输入流 InputStream inputStream = socket.getInputStream(); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); // 3.利用流按照一定的协议对Socket进行读、写操作 String info = "宋明潞是我家最可爱的虎妹子,咦嘻嘻;猪哥你说是不是啊??咦嘻嘻"; printWriter.write(info); printWriter.flush(); socket.shutdownOutput(); // 接受服务器的响应,并打印显示信息 String reply = null; while (!((reply = bufferedReader.readLine()) == null)) { System.out.println("胖虎威武!!" + reply); } // 4.关闭资源 bufferedReader.close(); inputStream.close(); printWriter.close(); outputStream.close(); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
[ "1457579742@qq.com" ]
1457579742@qq.com
96720577868e98b69f5ed145097b26bce2c5ba0c
2977d049607c093471f48b7089b741590f7a7399
/LanqiaoOJ/2014lanqiaoOJ/src/Test递归三角螺旋.java
b7ae640664f611644fe6b2758da28fad81204690
[]
no_license
Silocean/JustForFun
dfc78f815e1ceeef0c2d485bd1718ae9b53c9e2b
185b6dd815ebeba786c479fd9e40a3c9e5d3ef74
refs/heads/master
2021-01-11T06:06:02.830713
2019-01-21T13:13:08
2019-01-21T13:13:08
71,687,465
1
1
null
null
null
null
GB18030
Java
false
false
1,842
java
import java.util.Scanner; /** 方阵的主对角线之上称为“上三角”。 请你设计一个用于填充n阶方阵的上三角区域的程序。填充的规则是:使用1,2,3….的自然数列,从左上角开始,按照顺时针方向螺旋填充。 例如:当n=3时,输出: 1 2 3 6 4 5 当n=4时,输出: 1 2 3 4 9 10 5 8 6 7 当n=5时,输出: 1 2 3 4 5 12 13 14 6 11 15 7 10 8 9 程序运行时,从标准输入获得整数n(3~20) 程序输出:方阵的上三角部分。 要求格式:每个数据宽度为4,右对齐。 */ public class Test递归三角螺旋 { // 定义个一存放数字的数组 public static int[][] arr; public static void main(String[] args) { // 计数器 int index = 1; // 行数 int row = 0; // 用户输入的数值,表示矩阵的边长 int n = Integer.parseInt(new Scanner(System.in).nextLine()); // 初始化数组 arr = new int[n][n]; // 递归调用,以螺旋递进的方式给矩阵复制 find(index, row, n); // 打印出二维数组重的每一个元素 print(arr); } /* * 打印数组的方法 */ public static void print(int[][] arr) { for(int i=0; i<arr.length; i++) { for(int j=0; j<arr[i].length; j++) { if(arr[i][j] == 0) { System.out.print(" " + "\t"); } else { System.out.print(arr[i][j] + "\t"); } } System.out.println(); } } /* * 递归方法 */ public static void find(int index, int row, int n) { for(int i=0; i<n; i++) { arr[row][row+i] = index; index ++; } for(int i=0; i<n-1; i++) { arr[row+i+1][row+n-i-2] = index; index ++; } for(int i=0; i<n-2; i++) { arr[row+n-i-2][row] = index; index ++; } if(n<=2) { return; } find(index, row+1, n-3); } }
[ "silenceocean@live.com" ]
silenceocean@live.com
73584da9f5e38e5e850c1e410d3aa925fcf6fb73
2d2ae94d33cbdf471ee277f37fbb284039dd210b
/pBeans/pbeans-2.0.2/pbeans-2.0.2/examples/simple/User.java
b491a68ddf04068e34a6795c0d6b6d77d90f66af
[ "Apache-1.1", "BSD-2-Clause" ]
permissive
MykolaBova/Hib
c7c8d4b8a41a4026d69a21df077c0adc32c623a4
412a771187ef38d09115b3425964b3fb7817a8b2
refs/heads/master
2016-09-06T16:56:43.848980
2014-07-08T12:05:21
2014-07-08T12:05:21
21,611,207
1
0
null
null
null
null
UTF-8
Java
false
false
2,001
java
import net.sourceforge.pbeans.*; import net.sourceforge.pbeans.annotations.*; import java.util.*; /** * A user. */ @PersistentClass( table="User", // Use this one instead of an automatically generated name idField="InternalUID", // Use this field name for implicit primary key userManaged=false, // Let pBeans manage schema evolution deleteFields=true, // If a field becomes unused, remove it. indexes={ //Unique index for field userID @PropertyIndex(unique=true,propertyNames={"userID"}) } ) public class User { private String userName; private String passwordHash; //------------- PERSISTENT PROPERTIES --------------- public String getUserID() { return this.userName; } public void setUserID (String value) { this.userName = value; } public String getPasswordHash() { return this.passwordHash; } public void setPasswordHash (String value) { this.passwordHash = value; } //------------- TRANSIENT PROPERTIES---------- @TransientProperty public void setPassword(String password) { setPasswordHash (createPasswordHash (password)); } //------------- HELPER METHODS --------------- private String createPasswordHash (String password) { return String.valueOf(password.hashCode()); } public boolean matchPassword (String password) { return createPasswordHash(password).equals(getPasswordHash()); } /** * This is a good way to get a collection of Accounts * belonging to this User. We are asking for all instances * of Account whose "ownerID" property value is equal to * the ID of this User instance. */ public Iterator fetchAccounts (Store store) throws Exception { return store.selectParts (store.getPersistentID(this), Account.class, "ownerID"); } /** * To add an Account to this User, we simply set * the "ownerID" property of the Account instance. */ public void addAccount (Account account, Store store) throws Exception { account.setOwnerID(store.getPersistentID(this)); store.save(account); } }
[ "bova.mykola@gmail.com" ]
bova.mykola@gmail.com
edc1b73d5d04f9aab449525a7e5331ab4f37c8e0
89d0ba81bb48b6d9bc868decd902965345435348
/src/test/resources/CsvElementConvertTest/from/CsvElementSample.java
48329669351273eea8bf79cf7b4a05cdbee2cef3
[ "Apache-2.0" ]
permissive
oscana/oscana-s2n-javaconverter
75cd6ad8c4e2eec9c9bd59259789dcf357a7df64
7aa672cbfb4fefa973632dabca1d43d011bc60ab
refs/heads/master
2023-03-31T15:37:00.802181
2021-03-30T10:32:25
2021-03-30T10:32:25
291,641,914
0
0
Apache-2.0
2021-03-30T10:32:25
2020-08-31T07:10:12
Java
UTF-8
Java
false
false
1,209
java
package jp.co.tis.dto.project; import jp.co.tis.xenlon.seasar.util.csvutil.annotation.CsvElement; import java.io.Serializable; /** * 変換用テストデータファイル * * @author Ko Ho */ public class CsvElementSample implements Serializable { /** シリアル・バージョンID */ private static final long serialVersionUID = 1L; /** プロジェクトID */ @CsvElement(name = "プロジェクトID", priority = 1) public String projectId; /** プロジェクト名 */ @CsvElement(name = "プロジェクト名", priority = 2) public String projectNm; /** プロジェクト種別 */ @CsvElement(name = "プロジェクト種別", priority = 3) public String projectType; /** プロジェクト開始日付 */ @CsvElement(name = "プロジェクト開始日付", priority = 4) public String projectStartDate; /** プロジェクト終了日付 */ @CsvElement(name = "プロジェクト終了日付", priority = 5) public String projectEndDate; /** プロジェクト終了日付 */ @CsvElement(property = "テスト", priority = 5) public String test; }
[ "ko.i@tis.co.jp" ]
ko.i@tis.co.jp
00a9005bbee759c98dc478f541208442b5ae59b4
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/ext-commerce/marketplaceservices/testsrc/de/hybris/platform/marketplaceservices/dataimport/batch/task/MarketplaceImpexRunnerTaskTest.java
b485d1d4a0d2d5b48b4a3c7c3391b669e14486da
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
3,768
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.marketplaceservices.dataimport.batch.task; import static org.junit.Assert.assertEquals; import java.io.IOException; import java.util.Arrays; import java.util.List; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import de.hybris.bootstrap.annotations.UnitTest; import de.hybris.platform.impex.model.ImpExMediaModel; import de.hybris.platform.impex.model.cronjob.ImpExImportCronJobModel; import de.hybris.platform.servicelayer.impex.ImportConfig; import de.hybris.platform.servicelayer.impex.ImportResult; import de.hybris.platform.servicelayer.impex.ImportService; import de.hybris.platform.servicelayer.session.SessionService; @UnitTest public class MarketplaceImpexRunnerTaskTest { private static final String ERROR_PREVIEW = "error"; private AbstractMarketplaceImpexRunnerTask task; @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Mock private ImpExMediaModel imm; private final ImportResult failedImportResult = new ImportResult() { @Override public boolean isSuccessful() { return false; } @Override public boolean isError() { return true; } @Override public boolean isRunning() { return false; } @Override public boolean isFinished() { return true; } @Override public boolean hasUnresolvedLines() { return true; } @Override public ImpExMediaModel getUnresolvedLines() { return imm; } @Override public ImpExImportCronJobModel getCronJob() { return null; } }; private final ImportResult successImportResult = new ImportResult() { @Override public boolean isSuccessful() { return true; } @Override public boolean isError() { return false; } @Override public boolean isRunning() { return false; } @Override public boolean isFinished() { return true; } @Override public boolean hasUnresolvedLines() { return false; } @Override public ImpExMediaModel getUnresolvedLines() { return null; } @Override public ImpExImportCronJobModel getCronJob() { return null; } }; @Before public void prepare() throws IOException { MockitoAnnotations.initMocks(this); task = new AbstractMarketplaceImpexRunnerTask() { @Override public SessionService getSessionService() { return null; } @Override public ImportService getImportService() { return null; } @Override public ImportConfig getImportConfig() { return null; } }; } @Test public void testFailedResult() throws Exception { Mockito.when(imm.getPreview()).thenReturn(ERROR_PREVIEW); final List<ImportResult> results = Arrays.asList(new ImportResult[] { failedImportResult, successImportResult, failedImportResult }); final String msg = task.createLogMsg(results); assertEquals(ERROR_PREVIEW + System.lineSeparator() + ERROR_PREVIEW, msg); } @Test public void testSuccessResult() throws Exception { final List<ImportResult> results = Arrays.asList(new ImportResult[] { successImportResult, successImportResult, successImportResult }); final String msg = task.createLogMsg(results); assertEquals(AbstractMarketplaceImpexRunnerTask.LOG_DEFAULT_SUCCESS_MSG, msg); } }
[ "travis.d.crawford@accenture.com" ]
travis.d.crawford@accenture.com
7b54f12f025c16c6b37c3354e6fc9d347822175a
c48733807b6e920b974644ff369f73f68b606a9d
/maven_project/src/main/java/cn/javass/dp/iterator/example1/Client.java
b59156a1245e05f8383e867ab2e0f76da59fcda6
[]
no_license
sworderHB/maven_project
c4d45cf646f94b8e1c4eb0a9f602f40e43f2b376
29e1a81086f572b5128c826535a28010b8da48a3
refs/heads/master
2020-03-22T01:19:09.641233
2018-07-01T04:35:34
2018-07-01T04:35:34
139,297,569
0
0
null
null
null
null
UTF-8
Java
false
false
821
java
package cn.javass.dp.iterator.example1; public class Client { /** * 示意方法,使用迭代器的功能。 * 这里示意使用迭代器来迭代聚合对象 */ public void someOperation(){ String[] names = {"张三","李四","王五"}; //创建聚合对象 Aggregate aggregate = new ConcreteAggregate(names); //循环输出聚合对象中的值 Iterator it = aggregate.createIterator(); //首先设置迭代器到第一个元素 it.first(); while(!it.isDone()){ //取出当前的元素来 Object obj = it.currentItem(); System.out.println("the obj=="+obj); //如果还没有迭代到最后,那么就向下迭代一个 it.next(); } } public static void main(String[] args) { //可以简单的测试一下 Client client = new Client(); client.someOperation(); } }
[ "sworder2018@gmail.com" ]
sworder2018@gmail.com
60856b2db0c51773b6e22cb7aaa7f633c9b052d2
2c275b68784d891dfa611e455633c2ddb2cee395
/driver-service/src/main/java/com/example/demo/controllers/TripController.java
c20bdb648c4ca5e3381dec2950cb0b58015b39e3
[]
no_license
vatsank/livetraining
ca6e21f32646968cbbc964dc9bc669f1c2e18711
6e6011f9f2af0f9dcbf85233516734b3116e61c0
refs/heads/master
2022-12-15T02:12:02.248287
2020-09-20T17:07:05
2020-09-20T17:07:05
281,052,807
0
12
null
null
null
null
UTF-8
Java
false
false
1,323
java
package com.example.demo.controllers; import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.hateoas.CollectionModel; import org.springframework.hateoas.Link; import org.springframework.hateoas.server.mvc.WebMvcLinkBuilder; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import com.example.demo.model.Trip; import com.example.demo.repos.TripRepository; @RestController @CrossOrigin(origins = "*") public class TripController { @Autowired private TripRepository repo; @GetMapping(path = "/api/v1/trips") public CollectionModel<Trip> getTrips(){ List<Trip> list = repo.findAll(); for(Trip eachTrip: list) { int id = eachTrip.getDriverId(); Link selfLink = WebMvcLinkBuilder.linkTo(CabDriverController.class) .slash("api/v1/drivers/"+id).withSelfRel(); eachTrip.add(selfLink); } Link link = WebMvcLinkBuilder.linkTo(TripController.class) .withSelfRel(); CollectionModel<Trip> result = CollectionModel.of(list, link); return result; } }
[ "'vatsank@gmail.com'" ]
'vatsank@gmail.com'
a4d8f0d720d9cfe706883d1f9680997bf7cbe163
792f9a4b222e8ec6ee32fb819b840cdf4625d7d3
/datarouter-opencensus/src/main/java/io/datarouter/opencensus/adapter/DatarouterOpencensusTraceExporter.java
5b5ab4a800eddba81990400ad70e64ffbcfb31d7
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
hotpads/datarouter
83385f668f5b35342b59d147a099454ed5cc23e3
0b1f8caad6adb95847611ee0539e60f756fdfd5d
refs/heads/master
2023-08-08T22:06:19.787666
2023-07-21T20:48:19
2023-07-21T20:48:19
93,588,679
40
10
Apache-2.0
2019-10-24T22:40:23
2017-06-07T03:29:55
Java
UTF-8
Java
false
false
5,521
java
/* * Copyright © 2009 HotPads (admin@hotpads.com) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.datarouter.opencensus.adapter; import java.time.Instant; import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.function.Function; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import io.datarouter.instrumentation.trace.Trace2BundleAndHttpRequestRecordDto; import io.datarouter.instrumentation.trace.Trace2BundleDto; import io.datarouter.instrumentation.trace.Trace2SpanDto; import io.datarouter.instrumentation.trace.TraceSpanGroupType; import io.datarouter.instrumentation.trace.Traceparent; import io.datarouter.scanner.Scanner; import io.datarouter.trace.conveyor.TraceBuffers; import io.opencensus.common.Timestamp; import io.opencensus.trace.AttributeValue; import io.opencensus.trace.SpanId; import io.opencensus.trace.export.SpanData; import io.opencensus.trace.export.SpanExporter.Handler; import jakarta.inject.Inject; import jakarta.inject.Singleton; @Singleton public class DatarouterOpencensusTraceExporter extends Handler{ private static final Logger logger = LoggerFactory.getLogger(DatarouterOpencensusTraceExporter.class); @Inject private TraceBuffers traceBuffers; @Override public void export(Collection<SpanData> spanDataList){ logger.info("DatarouterOpencensusTraceExporter starts exporting spanData from opencensus"); Map<SpanId,SpanData> bindingSpans = Scanner.of(spanDataList) .include(spanData -> spanData.getAttributes().getAttributeMap() .containsKey(DatarouterOpencensusTool.TRACEPARENT_ATTRIBUTE_KEY)) .toMap(spanData -> spanData.getContext().getSpanId()); if(bindingSpans.isEmpty()){ logger.info("no binding spans found."); return; } Map<SpanId,SpanId> parents = Scanner.of(spanDataList) .exclude(span -> span.getParentSpanId() == null) .toMap(span -> span.getContext().getSpanId(), SpanData::getParentSpanId); Map<Traceparent,Map<Long,Integer>> sequenceByThreadIdByTraceparent = new HashMap<>(); Map<SpanId,Integer> sequenceBySpanId = new HashMap<>(); Scanner.of(spanDataList) .exclude(spanData -> bindingSpans.containsKey(spanData.getContext().getSpanId())) .map(spanData -> { SpanData bindingSpan = bindingSpans.get(findBindingSpan(spanData.getContext().getSpanId(), parents)); if(bindingSpan == null){ logger.info("No binding span for: " + spanData); return null; } Map<String,AttributeValue> attributes = bindingSpan.getAttributes().getAttributeMap(); Traceparent traceparent = Traceparent.parse(getInnerValue(attributes.get( DatarouterOpencensusTool.TRACEPARENT_ATTRIBUTE_KEY))).get(); Long threadId = getInnerValue(attributes.get(DatarouterOpencensusTool.THREAD_ID_ATTRIBUTE_KEY)); Function<SpanId,Integer> nextSequenceGenerator = $ -> sequenceByThreadIdByTraceparent .computeIfAbsent(traceparent, $$ -> new HashMap<>()) .compute(threadId, ($$, old) -> old == null ? 10000 : old + 1); Integer sequenceParent; if(bindingSpan.getContext().getSpanId().equals(spanData.getParentSpanId())){ sequenceParent = getIntegerValue(attributes.get( DatarouterOpencensusTool.SEQUENCE_PARENT_ATTRIBUTE_KEY)); }else{ sequenceParent = sequenceBySpanId.computeIfAbsent(spanData.getParentSpanId(), nextSequenceGenerator); } Integer sequence = sequenceBySpanId.computeIfAbsent(spanData.getContext().getSpanId(), nextSequenceGenerator); return new Trace2SpanDto( traceparent, threadId, sequence, sequenceParent, spanData.getName(), TraceSpanGroupType.DATABASE, null, toNanoTimestamp(toInstant(spanData.getStartTimestamp())), toNanoTimestamp(toInstant(spanData.getEndTimestamp()))); }) .include(Objects::nonNull) .groupBy(Trace2SpanDto::getTraceparent) .values() .stream() .map(spans -> new Trace2BundleDto(null, List.of(), spans)) .map(bundleDto -> new Trace2BundleAndHttpRequestRecordDto(bundleDto, null)) .forEach(traceBuffers::offer); } private static int getIntegerValue(AttributeValue attributeValue){ return DatarouterOpencensusTraceExporter.<Long>getInnerValue(attributeValue).intValue(); } @SuppressWarnings("unchecked") private static <T> T getInnerValue(AttributeValue attributeValue){ return (T) attributeValue.match(x -> x, x -> x, x -> x, x -> x, x -> x); } private static Instant toInstant(Timestamp timestamp){ return Instant.ofEpochSecond(timestamp.getSeconds(), timestamp.getNanos()); } private static SpanId findBindingSpan(SpanId spanId, Map<SpanId,SpanId> parents){ SpanId bindingSpan = spanId; while(parents.containsKey(bindingSpan)){ bindingSpan = parents.get(bindingSpan); } return bindingSpan; } private static Long toNanoTimestamp(Instant instant){ return instant.getEpochSecond() * 1_000_000_000 + instant.getNano(); } }
[ "pranavb@zillowgroup.com" ]
pranavb@zillowgroup.com
50d4492ab97253fb89d1c69f283360ceeca2446b
c9f2bd34255a1f7822fe0fbf4c7e51fa26eede14
/daikon-5.5.14/java/daikon/simplify/SessionManager.java
245519ae6d9cef2ffa7ab0645fc95e4e10ac9ee7
[]
no_license
billy-mosse/jconsume
eca93b696eaf8edcb8af5730eebd95f49e736fd4
b782a55f20c416a73c967b2225786677af5f52ba
refs/heads/master
2022-09-22T18:10:43.784966
2020-03-09T01:00:38
2020-03-09T01:00:38
97,016,318
4
0
null
2022-09-01T22:58:04
2017-07-12T14:18:01
C
UTF-8
Java
false
false
7,809
java
package daikon.simplify; import static java.nio.charset.StandardCharsets.UTF_8; import java.io.*; import java.util.logging.Level; import java.util.logging.Logger; /*>>> import org.checkerframework.checker.lock.qual.*; import org.checkerframework.checker.nullness.qual.*; */ /** A SessionManager is a component which handles the threading interaction with the Session. */ public class SessionManager { /** The command to be performed (point of communication with worker thread). */ private /*@Nullable*/ Cmd pending; /** Our worker thread; hold onto it so that we can stop it. */ private Worker worker; // The error message returned by the worked thread, or null private /*@Nullable*/ String error = null; /** Debug tracer common to all Simplify classes. */ public static final Logger debug = Logger.getLogger("daikon.simplify"); // Deprecated method for setting the debug flag. // // Enable to dump input and output to the console // // Use "java -DDEBUG_SIMPLIFY=1 daikon.Daikon ..." or // // "make USER_JAVA_FLAGS=-DDEBUG_SIMPLIFY=1 ..." private static final boolean debug_mgr = debug.isLoggable(Level.FINE); public static void debugln(String s) { if (!debug_mgr) return; debug.fine(s); } public SessionManager() { debugln("Creating SessionManager"); worker = new Worker(); worker.setDaemon(true); debugln("Manager: starting worker"); synchronized (this) { worker.start(); // We won't wake up from this until the worker thread is ready // and wait()ing to accept requests. try { this.wait(); } catch (InterruptedException e) { } } debugln("SessionManager created"); } /** Performs the given command, or times out if too much time elapses. */ public void request(Cmd command) throws TimeoutException { assert worker != null : "Cannot use closed SessionManager"; assert pending == null : "Cannot queue requests"; if (debug.isLoggable(Level.FINE)) { System.err.println("Running command " + command); System.err.println(" called from"); Throwable t = new Throwable(); t.printStackTrace(); System.err.flush(); } synchronized (this) { // place the command in the slot assert pending == null; pending = command; // tell the worker to wake up this.notifyAll(); // wait for worker to finish try { this.wait(); } catch (InterruptedException e) { } // command finished iff the command was nulled out if (pending != null) { session_done(); throw new TimeoutException(); } // check for error if (error != null) { throw new SimplifyError(error); } } } /** Shutdown this session. No further commands may be executed. */ @SuppressWarnings("nullness") // nulling worker for fast failure (& for GC) public void session_done() { worker.session_done(); worker = null; } private static /*@MonotonicNonNull*/ String prover_background = null; private static String proverBackground() { if (prover_background == null) { try { StringBuffer result = new StringBuffer(""); String fileName; if (daikon.inv.Invariant.dkconfig_simplify_define_predicates) { fileName = "daikon-background-defined.txt"; } else { fileName = "daikon-background.txt"; } InputStream bg_stream = SessionManager.class.getResourceAsStream(fileName); if (bg_stream == null) { throw new RuntimeException( "Could not find resource daikon/simplify/" + fileName + " on the classpath"); } BufferedReader lines = new BufferedReader(new InputStreamReader(bg_stream, UTF_8)); String line; while ((line = lines.readLine()) != null) { line = line.trim(); if ((line.length() == 0) || line.startsWith(";")) { continue; } result.append(" "); result.append(line); result.append(daikon.Global.lineSep); } lines.close(); prover_background = result.toString(); } catch (IOException e) { throw new RuntimeException("Could not load prover background"); } } return prover_background; } public static int prover_instantiate_count = 0; // Start up simplify, and send the universal backgound. // Is successful exactly when return != null. public static /*@Nullable*/ SessionManager attemptProverStartup() { SessionManager prover; // Limit ourselves to a few tries if (prover_instantiate_count > 5) { return null; } // Start the prover try { prover_instantiate_count++; prover = new SessionManager(); if (daikon.Daikon.no_text_output) { System.out.print("..."); } } catch (SimplifyError e) { System.err.println("Could not utilize Simplify: " + e); return null; } try { prover.request(new CmdRaw(proverBackground())); } catch (TimeoutException e) { throw new RuntimeException("Timeout on universal background", e); } return prover; } /** Helper thread which interacts with a Session, according to the enclosing manager. */ private class Worker extends Thread { private final SessionManager mgr = SessionManager.this; // just sugar /** The associated session, or null if the thread should shutdown. */ private /*@Nullable*/ /*@GuardedBy("<self>")*/ Session session = new Session(); private boolean finished = false; @SuppressWarnings("nullness") // tricky, but I think it's OK public void run() { debugln("Worker: run"); while (session != null) { synchronized (mgr) { mgr.pending = null; mgr.notifyAll(); try { mgr.wait(0); } catch (InterruptedException e) { } assert mgr.pending != null : "@AssumeAssertion(nullness)"; // session != null && mgr.pending != null; } error = null; try { // session could also be null at this point, I presume. // That's probably what the catch block is for. mgr.pending.apply(session); } catch (Throwable e) { if (finished) return; error = e.toString(); e.printStackTrace(); } } } /*@RequiresNonNull("session")*/ private void session_done() { finished = true; final /*@GuardedBy("<self>")*/ Session tmp = session; session = null; synchronized (tmp) { tmp.kill(); } } } public static void main(String[] args) throws Exception { daikon.LogHelper.setupLogs(daikon.LogHelper.INFO); SessionManager m = new SessionManager(); CmdCheck cc; cc = new CmdCheck("(EQ 1 1)"); m.request(cc); assert cc.valid; cc = new CmdCheck("(EQ 1 2)"); m.request(cc); assert !cc.valid; cc = new CmdCheck("(EQ x z)"); m.request(cc); assert !cc.valid; CmdAssume a = new CmdAssume("(AND (EQ x y) (EQ y z))"); m.request(a); m.request(cc); assert cc.valid; m.request(CmdUndoAssume.single); m.request(cc); assert !cc.valid; StringBuffer buf = new StringBuffer(); for (int i = 0; i < 20000; i++) { buf.append("(EQ (select a " + i + ") " + (int) (200000 * Math.random()) + ")"); } m.request(new CmdAssume(buf.toString())); for (int i = 0; i < 10; i++) { try { m.request(new CmdCheck("(NOT (EXISTS (x) (EQ (select a x) (+ x " + i + "))))")); } catch (TimeoutException e) { System.out.println("Timeout, retrying"); m = new SessionManager(); m.request(new CmdAssume(buf.toString())); } } } }
[ "billy.mosse@gmail.com" ]
billy.mosse@gmail.com
409d4caaa7982289e1661ebeda5be17c4cb7e5e3
9bfa71d23e70e514dd9be5f47781b1178833130d
/SQLPlugin/gen/com/sqlplugin/psi/SqlGenerationClause.java
4325de32f60cbec5feb03e9f3b490e1f03ad6c2a
[ "MIT" ]
permissive
smoothwind/SQL-IDEAplugin
de341884b77c2c61e0b4d6ceefd7c16ff3b7b469
3efa434095b4cac4772a0a7df18b34042a4c7557
refs/heads/master
2020-04-16T22:37:44.776363
2019-01-28T09:43:25
2019-01-28T09:43:25
165,976,439
0
0
null
null
null
null
UTF-8
Java
false
true
365
java
// This is a generated file. Not intended for manual editing. package com.sqlplugin.psi; import java.util.List; import org.jetbrains.annotations.*; import com.intellij.psi.PsiElement; public interface SqlGenerationClause extends PsiElement { @NotNull SqlGenerationExpression getGenerationExpression(); @NotNull SqlGenerationRule getGenerationRule(); }
[ "stephen.idle@qq.com" ]
stephen.idle@qq.com
57161d9ae46a6ba01bfea4bef996e362e01fb689
75f0d81197655407fd59ec1dca79243d2aa70be9
/nd4j-jcublas-parent/nd4j-jcublas-common/src/main/java/jcuda/jcusparse/bsrsv2Info.java
2dc324ad5e9d695c2961c93f90d7930e77681a05
[ "Apache-2.0" ]
permissive
noelnamai/nd4j
1a547e9ee5ad08f26d8a84f10af85c6c4278558f
f31d63d95e926c5d8cc93c5d0613f3b3c92e521c
refs/heads/master
2021-01-22T09:04:35.467401
2015-06-05T02:49:29
2015-06-05T02:49:29
36,916,394
2
0
null
2015-06-05T06:37:09
2015-06-05T06:37:09
null
UTF-8
Java
false
false
1,219
java
/* * * * Copyright 2015 Skymind,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 jcuda.jcusparse; import jcuda.NativePointerObject; /** * Java port of a bsrsv2Info */ public class bsrsv2Info extends NativePointerObject { /** * Creates a new, uninitialized bsrsv2Info */ public bsrsv2Info() { } /** * Returns a String representation of this object. * * @return A String representation of this object. */ @Override public String toString() { return "bsrsv2Info["+ "nativePointer=0x"+Long.toHexString(getNativePointer())+"]"; } }
[ "adam@skymind.io" ]
adam@skymind.io
816985fd387381bae24796db959991b7267a0a5e
bfaac45f23000c1e76eeaf04215e48c1646350e6
/AspectualAcmeStudio/src/aspectualacme/ArmaniVariable.java
834aba379485c47879e5c681028962483e896e42
[]
no_license
eduardoafs/aspectualacme
0353e70623e51575fb957ebd92d84aa653068f1f
5a36060e91b314348254c7d2ff0117f5bbd37260
refs/heads/master
2020-09-11T03:02:42.996115
2019-11-15T12:39:45
2019-11-15T12:39:45
221,919,211
0
0
null
null
null
null
UTF-8
Java
false
false
3,256
java
/** * <copyright> * </copyright> * * $Id$ */ package aspectualacme; /** * <!-- begin-user-doc --> * A representation of the model object '<em><b>Armani Variable</b></em>'. * <!-- end-user-doc --> * * <p> * The following features are supported: * <ul> * <li>{@link aspectualacme.ArmaniVariable#getId <em>Id</em>}</li> * <li>{@link aspectualacme.ArmaniVariable#getUserType <em>User Type</em>}</li> * <li>{@link aspectualacme.ArmaniVariable#getBasicType <em>Basic Type</em>}</li> * </ul> * </p> * * @see aspectualacme.AspectualacmePackage#getArmaniVariable() * @model * @generated */ public interface ArmaniVariable extends ArmaniExpression { /** * Returns the value of the '<em><b>Id</b></em>' attribute. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Id</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Id</em>' attribute. * @see #setId(String) * @see aspectualacme.AspectualacmePackage#getArmaniVariable_Id() * @model required="true" * @generated */ String getId(); /** * Sets the value of the '{@link aspectualacme.ArmaniVariable#getId <em>Id</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Id</em>' attribute. * @see #getId() * @generated */ void setId(String value); /** * Returns the value of the '<em><b>User Type</b></em>' reference. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>User Type</em>' reference isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>User Type</em>' reference. * @see #setUserType(TypeDefinition) * @see aspectualacme.AspectualacmePackage#getArmaniVariable_UserType() * @model keys="name" * @generated */ TypeDefinition getUserType(); /** * Sets the value of the '{@link aspectualacme.ArmaniVariable#getUserType <em>User Type</em>}' reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>User Type</em>' reference. * @see #getUserType() * @generated */ void setUserType(TypeDefinition value); /** * Returns the value of the '<em><b>Basic Type</b></em>' attribute. * The literals are from the enumeration {@link aspectualacme.ArmaniTypes}. * <!-- begin-user-doc --> * <p> * If the meaning of the '<em>Basic Type</em>' attribute isn't clear, * there really should be more of a description here... * </p> * <!-- end-user-doc --> * @return the value of the '<em>Basic Type</em>' attribute. * @see aspectualacme.ArmaniTypes * @see #setBasicType(ArmaniTypes) * @see aspectualacme.AspectualacmePackage#getArmaniVariable_BasicType() * @model * @generated */ ArmaniTypes getBasicType(); /** * Sets the value of the '{@link aspectualacme.ArmaniVariable#getBasicType <em>Basic Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @param value the new value of the '<em>Basic Type</em>' attribute. * @see aspectualacme.ArmaniTypes * @see #getBasicType() * @generated */ void setBasicType(ArmaniTypes value); } // ArmaniVariable
[ "eduafsilva@gmail.com" ]
eduafsilva@gmail.com
fe9038b45548d4a613d797ae0859726445a67fcb
84140ab51a802102309991921d2163d48bb12467
/src/main/java/ac/za/cput/service/BellvilleService/Impl/BellvilleStaffServiceImpl.java
b06be6d291c9a15257cecc81579a57306cb8010d
[]
no_license
MugammadRihaad/Assignment8
e4e14a3b8af4773e67e9c6127410812213e21b7a
db058c961afc83844dbff9d9b87454931bc569b2
refs/heads/master
2020-05-25T13:06:14.467937
2019-05-21T11:09:35
2019-05-21T11:09:35
187,813,341
0
1
null
null
null
null
UTF-8
Java
false
false
1,933
java
package ac.za.cput.service.BellvilleService.Impl; import ac.za.cput.domain.Bellville.BellvilleStaff; import ac.za.cput.service.BellvilleService.BellvilleStaffService; import java.util.HashSet; import java.util.Set; public class BellvilleStaffServiceImpl implements BellvilleStaffService { private static BellvilleStaffServiceImpl service = null; private Set<BellvilleStaff> bellStaff; private BellvilleStaffServiceImpl(){ this.bellStaff = new HashSet<>(); } public static BellvilleStaffServiceImpl getRepository(){ if (service == null) service = new BellvilleStaffServiceImpl(); return service; } private BellvilleStaff findStaff(String staff) { return this.bellStaff.stream() .filter(bellvilleStaff -> bellvilleStaff.getBellStaffId().trim().equals(staff)) .findAny() .orElse(null); } public BellvilleStaff create(BellvilleStaff staff){ this.bellStaff.add(staff); return staff; } public BellvilleStaff read(String staffId){ // find the course that matches the id and return it if exist BellvilleStaff bellStaff = findStaff(staffId); return bellStaff; } public void delete(String staffId) { // find the course, delete it if it exist BellvilleStaff accountings = findStaff(staffId); if (bellStaff != null) this.bellStaff.remove(bellStaff); } public BellvilleStaff update(BellvilleStaff staff){ // find the course, update it and delete it if it exists BellvilleStaff toDelete = findStaff(staff.getBellAccountId()); if(toDelete != null) { this.bellStaff.remove(toDelete); return create(staff); } return null; } public Set<BellvilleStaff> getAll(){ return this.bellStaff; } }
[ "mugammadrihaadvanblerck@gmail.com" ]
mugammadrihaadvanblerck@gmail.com
d22683542b8550b79fa61f5dad9c92201445623e
706dae6cc6526064622d4f5557471427441e5c5e
/src/test/java/com/anbo/juja/patterns/Adapter_01/adapter3/AdapterTest.java
264b64c20d8d4e961d9b27fc908f5753bd15acdc
[]
no_license
Anton-Bondar/Design-patterns-JUJA-examples-
414edabfd8c4148640de7de8d01f809b01c3c17c
9e3d628f7e45c0106514f8f459ea30fffed702d5
refs/heads/master
2021-10-09T04:45:42.372993
2018-12-21T12:09:00
2018-12-21T12:11:14
121,509,668
0
0
null
null
null
null
UTF-8
Java
false
false
781
java
package com.anbo.juja.patterns.adapter_01.adapter3; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; /** * Created by indigo on 19.08.2015. */ public class AdapterTest { @Test public void test() { // given Adaptee adaptee = mock(Adaptee.class); when(adaptee.specificRequest(anyObject())).thenReturn("data from adaptee"); Target target = new Adapter(adaptee); // when Object actual = target.request("data"); // then assertEquals("data from adaptee", actual); verify(adaptee).specificRequest("data"); } }
[ "AntonBondar2013@gmail.com" ]
AntonBondar2013@gmail.com
03c0097a17a3838ecd21e0486a7d41ba616ccfac
bc639d15bcc35b6e58f97ca02bee2dc66eba894b
/src/com/vmware/vim25/StorageMigrationAction.java
8cb24296838b4ff5e3accaf6c3c4515b5d861734
[ "BSD-3-Clause" ]
permissive
benn-cs/vijava
db473c46f1a4f449e52611055781f9cfa921c647
14fd6b5d2f1407bc981b3c56433c30a33e8d74ab
refs/heads/master
2021-01-19T08:15:17.194988
2013-07-11T05:17:08
2013-07-11T05:17:08
7,495,841
1
0
null
null
null
null
UTF-8
Java
false
false
4,292
java
/*================================================================================ Copyright (c) 2012 Steve Jin. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of VMware, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ================================================================================*/ package com.vmware.vim25; /** * @author Steve Jin (http://www.doublecloud.org) * @version 5.1 */ @SuppressWarnings("all") public class StorageMigrationAction extends ClusterAction { public ManagedObjectReference vm; public VirtualMachineRelocateSpec relocateSpec; public ManagedObjectReference source; public ManagedObjectReference destination; public long sizeTransferred; public Float spaceUtilSrcBefore; public Float spaceUtilDstBefore; public Float spaceUtilSrcAfter; public Float spaceUtilDstAfter; public Float ioLatencySrcBefore; public Float ioLatencyDstBefore; public ManagedObjectReference getVm() { return this.vm; } public VirtualMachineRelocateSpec getRelocateSpec() { return this.relocateSpec; } public ManagedObjectReference getSource() { return this.source; } public ManagedObjectReference getDestination() { return this.destination; } public long getSizeTransferred() { return this.sizeTransferred; } public Float getSpaceUtilSrcBefore() { return this.spaceUtilSrcBefore; } public Float getSpaceUtilDstBefore() { return this.spaceUtilDstBefore; } public Float getSpaceUtilSrcAfter() { return this.spaceUtilSrcAfter; } public Float getSpaceUtilDstAfter() { return this.spaceUtilDstAfter; } public Float getIoLatencySrcBefore() { return this.ioLatencySrcBefore; } public Float getIoLatencyDstBefore() { return this.ioLatencyDstBefore; } public void setVm(ManagedObjectReference vm) { this.vm=vm; } public void setRelocateSpec(VirtualMachineRelocateSpec relocateSpec) { this.relocateSpec=relocateSpec; } public void setSource(ManagedObjectReference source) { this.source=source; } public void setDestination(ManagedObjectReference destination) { this.destination=destination; } public void setSizeTransferred(long sizeTransferred) { this.sizeTransferred=sizeTransferred; } public void setSpaceUtilSrcBefore(Float spaceUtilSrcBefore) { this.spaceUtilSrcBefore=spaceUtilSrcBefore; } public void setSpaceUtilDstBefore(Float spaceUtilDstBefore) { this.spaceUtilDstBefore=spaceUtilDstBefore; } public void setSpaceUtilSrcAfter(Float spaceUtilSrcAfter) { this.spaceUtilSrcAfter=spaceUtilSrcAfter; } public void setSpaceUtilDstAfter(Float spaceUtilDstAfter) { this.spaceUtilDstAfter=spaceUtilDstAfter; } public void setIoLatencySrcBefore(Float ioLatencySrcBefore) { this.ioLatencySrcBefore=ioLatencySrcBefore; } public void setIoLatencyDstBefore(Float ioLatencyDstBefore) { this.ioLatencyDstBefore=ioLatencyDstBefore; } }
[ "sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1" ]
sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1
f75067574b6e558e61b400dc168aee24af69d9de
507fe5eebbc9da8733a9e5c12e32c04501e5a82b
/baksmali/src/main/java/com/virjar/baksmalisrc/dexlib2/dexbacked/instruction/DexBackedInstruction20bc.java
eea84bcf2b089dd1737d8559c014d540277b2561
[]
no_license
axhlzy/DVMUnpacker
4ce1fe8b3b75b72ef9f2df90f30e64f5ff5a045e
38d9ada65d1cc850ce96dfdebc6d99facb7a51eb
refs/heads/master
2022-12-14T19:41:43.217094
2020-09-16T08:45:33
2020-09-16T08:45:33
295,996,703
0
1
null
2020-09-16T10:13:49
2020-09-16T10:13:47
null
UTF-8
Java
false
false
2,962
java
/* * Copyright 2013, Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.virjar.baksmalisrc.dexlib2.dexbacked.instruction; import com.virjar.baksmalisrc.dexlib2.Opcode; import com.virjar.baksmalisrc.dexlib2.ReferenceType; import com.virjar.baksmalisrc.dexlib2.dexbacked.DexBackedDexFile; import com.virjar.baksmalisrc.dexlib2.dexbacked.reference.DexBackedReference; import com.virjar.baksmalisrc.dexlib2.iface.instruction.formats.Instruction20bc; import com.virjar.baksmalisrc.dexlib2.iface.reference.Reference; import javax.annotation.Nonnull; public class DexBackedInstruction20bc extends DexBackedInstruction implements Instruction20bc { public DexBackedInstruction20bc(@Nonnull DexBackedDexFile dexFile, @Nonnull Opcode opcode, int instructionStart) { super(dexFile, opcode, instructionStart); } @Override public int getVerificationError() { return dexFile.readUbyte(instructionStart + 1) & 0x3f; } @Nonnull @Override public Reference getReference() { int referenceType = getReferenceType(); return DexBackedReference.makeReference(dexFile, referenceType, dexFile.readUshort(instructionStart + 2)); } @Override public int getReferenceType() { int referenceType = (dexFile.readUbyte(instructionStart + 1) >>> 6) + 1; ReferenceType.validateReferenceType(referenceType); return referenceType; } }
[ "virjar@virjar.com" ]
virjar@virjar.com
df4713007f95729e83ec963a196dce53a9e173ed
ae78bc61d63aacaa734e279b34d072c2a82eca65
/src/main/java/com/danang/config/ElasticsearchConfiguration.java
ad91b070664136ac20eed4855e22b51ac522ecfa
[]
no_license
alfikr/MyOwn
371fa0599b5a981ca6b3bcc9b5ae8376dd7caf1b
28c90ea51cf09402ec3c41f336e0bd67b0a6e931
refs/heads/master
2021-05-26T05:06:36.409178
2018-03-31T08:52:41
2018-03-31T08:52:41
127,515,709
0
1
null
2020-09-18T05:37:44
2018-03-31T08:52:38
Java
UTF-8
Java
false
false
1,633
java
package com.danang.config; import java.io.IOException; import org.elasticsearch.client.Client; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.elasticsearch.core.ElasticsearchTemplate; import org.springframework.data.elasticsearch.core.EntityMapper; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; @Configuration public class ElasticsearchConfiguration { @Bean public ElasticsearchTemplate elasticsearchTemplate(Client client, Jackson2ObjectMapperBuilder jackson2ObjectMapperBuilder) { return new ElasticsearchTemplate(client, new CustomEntityMapper(jackson2ObjectMapperBuilder.createXmlMapper(false).build())); } public class CustomEntityMapper implements EntityMapper { private ObjectMapper objectMapper; public CustomEntityMapper(ObjectMapper objectMapper) { this.objectMapper = objectMapper; objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true); } @Override public String mapToString(Object object) throws IOException { return objectMapper.writeValueAsString(object); } @Override public <T> T mapToObject(String source, Class<T> clazz) throws IOException { return objectMapper.readValue(source, clazz); } } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
6d8b543de9df02d9b733eeeea8263501e99759cb
1bbbc069c709e37382959c554e434d58c23b56f6
/index-server/src/main/java/com/pl/indexserver/service/ACommonCraftService.java
df92fde03d0d3bea8eebc2c166a5c19e4af17d12
[]
no_license
HuangGuangLei666/index-server
05d9738fb46482c6f4bc123c9c050797ec97374b
d6d932a3426e79aaff2253dcaaee7dac5db4965a
refs/heads/master
2022-12-21T00:15:20.409144
2020-02-25T11:22:17
2020-02-25T11:22:17
239,097,671
0
0
null
2022-12-06T00:44:57
2020-02-08T09:04:34
Java
UTF-8
Java
false
false
1,583
java
package com.pl.indexserver.service; import com.pl.indexserver.model.ACommonCraftDto; import com.pl.model.ACommonCraft; import com.pl.model.TmUser; import java.util.List; public interface ACommonCraftService { ACommonCraft selectByPrimaryKey(Long id); /** * 将传入的数据转换成内部对象并修改数据 * @param aCommonCraftDtos * @throws Exception */ void updateByPrimaryKeySelective(List<ACommonCraftDto> aCommonCraftDtos) throws Exception; /** * 根据公司id统计其通用话术录音文件所占用的空间大小 * @param companyId 公司id * @return 返回统计结果 * @throws Exception */ long countFileSizeByCompanyId(Long companyId) throws Exception; /** * 新增一条通用话术回答数据 * @param aCommonCraftDto 数据模型 * @return 返回操作结果 * @throws Exception */ boolean insertAndRecardLog(ACommonCraftDto aCommonCraftDto,TmUser user)throws Exception; /** * 修改一条通用话术回答数据 * @param aCommonCraftDto 数据模型 * @return 返回操作结果 * @throws Exception */ boolean updateAndRecardLogByPrimaryKey(ACommonCraftDto aCommonCraftDto,TmUser user)throws Exception; /** * 删除一条通用话术回答数据 * @param id 主键id * @param companyId 公司id * @return 返回操作结果 * @throws Exception */ boolean deleteByPrimaryKey(Long id,Long companyId)throws Exception; }
[ "1144716956@qq.com" ]
1144716956@qq.com
23f78c8889a43b6b8441fba550b29a55e5ed0950
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/java/ExoPlayer/2019/12/Requirements.java
87ea60bf730762867abbc4a274825e8d66526d36
[]
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,326
java
/* * Copyright (C) 2017 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.android.exoplayer2.scheduler; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.net.ConnectivityManager; import android.net.Network; import android.net.NetworkCapabilities; import android.net.NetworkInfo; import android.os.BatteryManager; import android.os.Parcel; import android.os.Parcelable; import android.os.PowerManager; import androidx.annotation.IntDef; import androidx.annotation.Nullable; import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.Util; import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** Defines a set of device state requirements. */ public final class Requirements implements Parcelable { /** * Requirement flags. Possible flag values are {@link #NETWORK}, {@link #NETWORK_UNMETERED}, * {@link #DEVICE_IDLE} and {@link #DEVICE_CHARGING}. */ @Documented @Retention(RetentionPolicy.SOURCE) @IntDef( flag = true, value = {NETWORK, NETWORK_UNMETERED, DEVICE_IDLE, DEVICE_CHARGING}) public @interface RequirementFlags {} /** Requirement that the device has network connectivity. */ public static final int NETWORK = 1; /** Requirement that the device has a network connection that is unmetered. */ public static final int NETWORK_UNMETERED = 1 << 1; /** Requirement that the device is idle. */ public static final int DEVICE_IDLE = 1 << 2; /** Requirement that the device is charging. */ public static final int DEVICE_CHARGING = 1 << 3; @RequirementFlags private final int requirements; /** @param requirements A combination of requirement flags. */ public Requirements(@RequirementFlags int requirements) { if ((requirements & NETWORK_UNMETERED) != 0) { // Make sure network requirement flags are consistent. requirements |= NETWORK; } this.requirements = requirements; } /** Returns the requirements. */ @RequirementFlags public int getRequirements() { return requirements; } /** Returns whether network connectivity is required. */ public boolean isNetworkRequired() { return (requirements & NETWORK) != 0; } /** Returns whether un-metered network connectivity is required. */ public boolean isUnmeteredNetworkRequired() { return (requirements & NETWORK_UNMETERED) != 0; } /** Returns whether the device is required to be charging. */ public boolean isChargingRequired() { return (requirements & DEVICE_CHARGING) != 0; } /** Returns whether the device is required to be idle. */ public boolean isIdleRequired() { return (requirements & DEVICE_IDLE) != 0; } /** * Returns whether the requirements are met. * * @param context Any context. * @return Whether the requirements are met. */ public boolean checkRequirements(Context context) { return getNotMetRequirements(context) == 0; } /** * Returns requirements that are not met, or 0. * * @param context Any context. * @return The requirements that are not met, or 0. */ @RequirementFlags public int getNotMetRequirements(Context context) { @RequirementFlags int notMetRequirements = getNotMetNetworkRequirements(context); if (isChargingRequired() && !isDeviceCharging(context)) { notMetRequirements |= DEVICE_CHARGING; } if (isIdleRequired() && !isDeviceIdle(context)) { notMetRequirements |= DEVICE_IDLE; } return notMetRequirements; } @RequirementFlags private int getNotMetNetworkRequirements(Context context) { if (!isNetworkRequired()) { return 0; } ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = Assertions.checkNotNull(connectivityManager).getActiveNetworkInfo(); if (networkInfo == null || !networkInfo.isConnected() || !isInternetConnectivityValidated(connectivityManager)) { return requirements & (NETWORK | NETWORK_UNMETERED); } if (isUnmeteredNetworkRequired() && connectivityManager.isActiveNetworkMetered()) { return NETWORK_UNMETERED; } return 0; } private boolean isDeviceCharging(Context context) { Intent batteryStatus = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); if (batteryStatus == null) { return false; } int status = batteryStatus.getIntExtra(BatteryManager.EXTRA_STATUS, -1); return status == BatteryManager.BATTERY_STATUS_CHARGING || status == BatteryManager.BATTERY_STATUS_FULL; } private boolean isDeviceIdle(Context context) { PowerManager powerManager = (PowerManager) context.getSystemService(Context.POWER_SERVICE); return Util.SDK_INT >= 23 ? powerManager.isDeviceIdleMode() : Util.SDK_INT >= 20 ? !powerManager.isInteractive() : !powerManager.isScreenOn(); } private static boolean isInternetConnectivityValidated(ConnectivityManager connectivityManager) { // It's possible to query NetworkCapabilities from API level 23, but RequirementsWatcher only // fires an event to update its Requirements when NetworkCapabilities change from API level 24. // Since Requirements wont be updated, we assume connectivity is validated on API level 23. if (Util.SDK_INT < 24) { return true; } Network activeNetwork = connectivityManager.getActiveNetwork(); if (activeNetwork == null) { return false; } NetworkCapabilities networkCapabilities = connectivityManager.getNetworkCapabilities(activeNetwork); return networkCapabilities != null && networkCapabilities.hasCapability(NetworkCapabilities.NET_CAPABILITY_VALIDATED); } @Override public boolean equals(@Nullable Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } return requirements == ((Requirements) o).requirements; } @Override public int hashCode() { return requirements; } // Parcelable implementation. @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(requirements); } public static final Parcelable.Creator<Requirements> CREATOR = new Creator<Requirements>() { @Override public Requirements createFromParcel(Parcel in) { return new Requirements(in.readInt()); } @Override public Requirements[] newArray(int size) { return new Requirements[size]; } }; }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
10cfd03fcde20bded957325bca65956d30570955
81382551cea049fa53136a38df6f376d8e62449e
/lottery-manager-system/src/main/java/com/manager/main/fragments/MeFragment.java
3bc5cf453ad1fc0efa59fc93e5254fe4ebff6b8e
[]
no_license
yangdonghui/LotteryManagerSystemPro
caf07d60b00199e3329498b16cf0746a71c353f0
c527fcda2b72b741b30e3a5a1f66fbd0f684add5
refs/heads/master
2021-01-11T04:21:55.492005
2016-10-18T02:25:44
2016-10-18T02:25:44
71,200,515
4
3
null
null
null
null
UTF-8
Java
false
false
7,409
java
package com.manager.main.fragments; import android.content.Context; import android.content.Intent; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v4.app.Fragment; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.AdapterView; import android.widget.GridView; import android.widget.ImageView; import android.widget.TextView; import com.manager.adapter.CommonAdapter; import com.manager.adapter.ViewHolder; import com.manager.bean.UserBean; import com.manager.bean.WidgetBean1; import com.manager.common.Constants; import com.manager.helper.UserHelper; import com.manager.lotterypro.SysApplication; import com.manager.lotterypro.R; import com.manager.user.ModifyHeadSelectPhotoAct; import com.manager.user.MyLotteryNumberRecordAct; import com.manager.user.SettingAct; import com.manager.user.manager.ManagerAreaListsAct; import com.manager.user.site.SiteManagerEmployeeAct; import com.manager.wallet.MyWalletAct; import java.util.ArrayList; /** * 我的界面 * @author donghuiyang * @create time 2016/4/20 0020. */ public class MeFragment extends Fragment implements AdapterView.OnItemClickListener, View.OnClickListener{ //用户 public UserBean mUserBean = SysApplication.userBean; //上下文对象 private Context mContext = null; private TextView userNameTextView; private GridView gridView; private CommonAdapter<WidgetBean1> gridViewAdapter; //头像 private ImageView iconImg; private View rootView = null; Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { String path = (String)msg.obj; switch (msg.what) { case 0: updateIcon(path); break; default: break; } } }; private static MeFragment mMeFragment = null; /** * 静态工厂方法需要一个int型的值来初始化fragment的参数, * 然后返回新的fragment到调用者 */ public static MeFragment newInstance() { if (mMeFragment == null) { mMeFragment = new MeFragment(); } return mMeFragment; } /** * 使用静态工厂方法,将外部传入的参数可以通过Fragment.setArgument保存在它自己身上, * 这样我们可以在Fragment.onCreate(...)调用的时候将这些参数取出来 * * @param savedInstanceState */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.e("", "aaaaaaaaaaaaa"); mContext = getActivity(); } @Override public void onResume() { super.onResume(); Intent intent = getActivity().getIntent(); String path = intent.getStringExtra("path"); if (path != null){ Message msg = new Message(); msg.what = 0; msg.obj = path; mHandler.handleMessage(msg); } Log.e("", ""); } @Override public void onDestroy() { super.onDestroy(); mMeFragment = null; } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { if (null != rootView) { //缓存view ViewGroup parent = (ViewGroup) rootView.getParent(); if (null != parent) { parent.removeView(rootView); } } else { rootView = inflater.inflate(R.layout.me_fragment_layout, container, false); initView(); } return rootView; } /** * 初始化view */ private void initView() { if (mUserBean == null) return; ArrayList<WidgetBean1> lists = null; //头像 iconImg = (ImageView) rootView.findViewById(R.id.me_headicon_img); iconImg.setOnClickListener(this); //用户id userNameTextView = (TextView) rootView.findViewById(R.id.me__username_tv); //功能列表 gridView = (GridView) rootView.findViewById(R.id.me_gridview); switch (mUserBean.getUserType()){ case UserHelper.LotteryUser:{ lists = Constants.MeGridViewLists1; userNameTextView.setText(mUserBean.getUserIdentity() + " : " + mUserBean.getUserName()); } break; case UserHelper.BettingShopUser:{ lists = Constants.MeGridViewLists2; userNameTextView.setText(mUserBean.getUserIdentity() + " : " + mUserBean.getUserName()); } break; case UserHelper.ManagerUser:{ lists = Constants.MeGridViewLists3; userNameTextView.setText(mUserBean.getUserIdentity() + " : " + mUserBean.getUserName()); } break; } gridViewAdapter = new CommonAdapter<WidgetBean1>(mContext, lists, R.layout.grid_item_5) { @Override public void convert(ViewHolder helper, WidgetBean1 item) { helper.setImageResource(R.id.grid_view_5_img, item.getIcon()); helper.setText(R.id.grid_view_5_tv, item.getText()); } }; gridView.setAdapter(gridViewAdapter); //单击事件 gridView.setOnItemClickListener(this); } /** * 更新头像 * @param path */ public void updateIcon(String path){ //mUserBean.setIconUrl(path); Bitmap bmp = BitmapFactory.decodeFile(path); if (bmp != null){ iconImg.setImageBitmap(bmp); } } /** * gridview 单项点击事件 * @param parent * @param view * @param position * @param id */ @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (mUserBean == null) return; Class next = null; int type = mUserBean.getUserType(); switch (position){ case 0:{ //我的钱包 next = MyWalletAct.class; } break; case 1:{ if (mUserBean.getUserType() == UserHelper.LotteryUser){ //彩民 我的彩票 next = MyLotteryNumberRecordAct.class; }else if (type == UserHelper.BettingShopUser){ //站点 雇员管理 SysApplication.enterNext1(mContext, SiteManagerEmployeeAct.class); }else if (type == UserHelper.ManagerUser){ //自辖站列表 next = ManagerAreaListsAct.class; } } break; case 2:{ //设置 next = SettingAct.class; } break; default: break; } if (next != null){ SysApplication.enterNext1(mContext, next); } } @Override public void onClick(View v) { if(iconImg == v){ //修改头像 SysApplication.enterNext1(mContext, ModifyHeadSelectPhotoAct.class); } } }
[ "123456" ]
123456
a9dab98dc02dba3290b20ce7791dbb11fe77a6d1
cf6531e26372d6b35b97a58a861985e38321414a
/src/util/async/DataInputBuffer.java
bdb0b1833efa37c3cc3aa310af72a85655071340
[ "Apache-2.0" ]
permissive
yongquanf/RDA
9ce34f98ab71da5edb637b5cfc4c15b9ee70d523
759ff19d37c3a196b798c55b18819fb06e222a3d
refs/heads/master
2020-12-01T18:27:22.579473
2019-12-29T09:50:18
2019-12-29T09:50:18
230,726,676
3
0
Apache-2.0
2020-10-13T18:31:02
2019-12-29T09:01:15
HTML
UTF-8
Java
false
false
2,745
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package util.async; import java.io.ByteArrayInputStream; import java.io.DataInput; import java.io.DataInputStream; /** A reusable {@link DataInput} implementation that reads from an in-memory * buffer. * * <p>This saves memory over creating a new DataInputStream and * ByteArrayInputStream each time data is read. * * <p>Typical usage is something like the following:<pre> * * DataInputBuffer buffer = new DataInputBuffer(); * while (... loop condition ...) { * byte[] data = ... get data ...; * int dataLength = ... get data length ...; * buffer.reset(data, dataLength); * ... read buffer using DataInput methods ... * } * </pre> * */ public class DataInputBuffer extends DataInputStream { private static class Buffer extends ByteArrayInputStream { public Buffer() { super(new byte[] {}); } public void reset(byte[] input, int start, int length) { this.buf = input; this.count = start+length; this.mark = start; this.pos = start; } public byte[] getData() { return buf; } public int getPosition() { return pos; } public int getLength() { return count; } } private Buffer buffer; /** Constructs a new empty buffer. */ public DataInputBuffer() { this(new Buffer()); } private DataInputBuffer(Buffer buffer) { super(buffer); this.buffer = buffer; } /** Resets the data that the buffer reads. */ public void reset(byte[] input, int length) { buffer.reset(input, 0, length); } /** Resets the data that the buffer reads. */ public void reset(byte[] input, int start, int length) { buffer.reset(input, start, length); } public byte[] getData() { return buffer.getData(); } /** Returns the current position in the input. */ public int getPosition() { return buffer.getPosition(); } /** Returns the length of the input. */ public int getLength() { return buffer.getLength(); } }
[ "quanyongf@126.com" ]
quanyongf@126.com
80270fec91a753626b5930d62a8218144133ffff
32531fabc6474f5b9eee40aebf76cf15c84be9ff
/src/main/java/utils/Database.java
7a2c0c5602f26de57527b408ceb74f167a0c9160
[]
no_license
Git-Leon/CheckersGame
5fa64ef63ba882629fa2dbbd9de3219f346ed663
16ab3c6e633a793f640a0ca0466b1801e3c8e004
refs/heads/master
2020-05-23T06:58:01.719226
2017-03-12T20:49:48
2017-03-12T20:49:48
84,754,531
0
1
null
null
null
null
UTF-8
Java
false
false
804
java
package utils; import checkers.checkergame.Player; import java.util.ArrayList; @Deprecated // TODO : Replace this class with actual database public final class Database { private static ArrayList<Player> players = new ArrayList<Player>(); public static Player searchById(long playerId) { for(Player player : players) { if(player.getId() == playerId) { return player; } } FrontEnd.println("Failed to find a player-record that matched the id [ %s ]", playerId); return null; } public static void registerPlayer(Player player) { FrontEnd.println("Adding a record to the database..."); players.add(player); } public static long createUniqueId() { return System.nanoTime(); } }
[ "xleonhunter@gmail.com" ]
xleonhunter@gmail.com
2224ea12266a6b548b4c0c6a917494591e69daac
d9477e8e6e0d823cf2dec9823d7424732a7563c4
/plugins/PHPParser/tags/v1_2_1/src/net/sourceforge/phpdt/internal/compiler/ast/BinaryExpression.java
cf4557d502e5f81cce04cdfbad6d8a3dc2b753c6
[]
no_license
RobertHSchmidt/jedit
48fd8e1e9527e6f680de334d1903a0113f9e8380
2fbb392d6b569aefead29975b9be12e257fbe4eb
refs/heads/master
2023-08-30T02:52:55.676638
2018-07-11T13:28:01
2018-07-11T13:28:01
140,587,948
1
0
null
null
null
null
UTF-8
Java
false
false
3,631
java
package net.sourceforge.phpdt.internal.compiler.ast; import gatchan.phpparser.parser.PHPParserConstants; import gatchan.phpparser.parser.PHPParser; import java.util.List; /** * a binary expression is a combination of two expressions with an operator. * * @author Matthieu Casanova */ public final class BinaryExpression extends OperatorExpression { /** The left expression. */ private final Expression left; /** The right expression. */ private final Expression right; public BinaryExpression(Expression left, Expression right, int operator, int sourceStart, int sourceEnd, int beginLine, int endLine, int beginColumn, int endColumn) { super(Type.UNKNOWN, operator, sourceStart, sourceEnd, beginLine, endLine, beginColumn, endColumn); this.left = left; this.right = right; switch (operator) { case PHPParserConstants.OR_OR : case PHPParserConstants.AND_AND : case PHPParserConstants._ORL : case PHPParserConstants.XOR : case PHPParserConstants._ANDL: case PHPParserConstants.EQUAL_EQUAL: case PHPParserConstants.GT: case PHPParserConstants.LT: case PHPParserConstants.LE: case PHPParserConstants.GE: case PHPParserConstants.NOT_EQUAL: case PHPParserConstants.DIF: case PHPParserConstants.BANGDOUBLEEQUAL: case PHPParserConstants.TRIPLEEQUAL: type = Type.BOOLEAN; break; case PHPParserConstants.DOT: type = Type.STRING; break; case PHPParserConstants.BIT_AND: case PHPParserConstants.BIT_OR: case PHPParserConstants.BIT_XOR: case PHPParserConstants.LSHIFT: case PHPParserConstants.RSIGNEDSHIFT: case PHPParserConstants.RUNSIGNEDSHIFT: case PHPParserConstants.PLUS: case PHPParserConstants.MINUS: case PHPParserConstants.STAR: case PHPParserConstants.SLASH: case PHPParserConstants.REMAINDER: type = Type.INTEGER; break; } } public String toStringExpression() { String leftString = left.toStringExpression(); String operatorString = operatorToString(); String rightString = right.toStringExpression(); StringBuffer buff = new StringBuffer(leftString.length() + operatorString.length() + rightString.length()); buff.append(leftString); buff.append(operatorString); buff.append(rightString); return buff.toString(); } /** * Get the variables from outside (parameters, globals ...) * * @param list the list where we will put variables */ public void getOutsideVariable(List list) { } /** * get the modified variables. * * @param list the list where we will put variables */ public void getModifiedVariable(List list) { left.getModifiedVariable(list); if (right != null) { right.getModifiedVariable(list); } } /** * Get the variables used. * * @param list the list where we will put variables */ public void getUsedVariable(List list) { left.getUsedVariable(list); if (right != null) { right.getUsedVariable(list); } } public Expression expressionAt(int line, int column) { if (left.isAt(line, column)) return left; if (right != null && right.isAt(line, column)) return right; return null; } public void analyzeCode(PHPParser parser) { left.analyzeCode(parser); right.analyzeCode(parser); // todo analyze binary expression } }
[ "nobody@6b1eeb88-9816-0410-afa2-b43733a0f04e" ]
nobody@6b1eeb88-9816-0410-afa2-b43733a0f04e
b5e945496936958cea5157339496db1476792a54
2578930c10a047156ccc0f7e7d654cca590245fb
/LessonHibernateAnnotations/src/lv/lgs/hibernate/domain/Subject.java
b9088fa32639caac78c2307b64da0f06fcadf88e
[]
no_license
SlavikTymchyshyn/Logos
5e6519f91f9ce44b44d637d746ea2e9b4b261440
71d084c397fb1a9ae4d94380e9a0f30e2e26df21
refs/heads/master
2020-06-17T23:26:55.790776
2015-09-14T13:36:36
2015-09-14T13:36:36
53,162,770
1
0
null
2016-03-04T20:14:56
2016-03-04T20:14:56
null
UTF-8
Java
false
false
1,228
java
package lv.lgs.hibernate.domain; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; @Entity public class Subject { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private int id; @Column(name = "name") private String name; @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinTable(name = "student_subject", joinColumns = @JoinColumn(name = "fk_subject"), inverseJoinColumns = @JoinColumn(name = "fk_student")) private Set<Student> students; public Subject() { } public Subject(String name) { this.name = name; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Set<Student> getStudents() { return students; } public void setStudents(Set<Student> students) { this.students = students; } }
[ "sokol.serhij@gmail.com" ]
sokol.serhij@gmail.com
b9c072ecf6266e5d67a222027b9184e8aad1dbf8
6d109557600329b936efe538957dfd0a707eeafb
/src/com/google/api/ads/dfp/v201311/UserTeamAssociationService.java
402a7c826c6a571a99994f3bdd4f1cc41c8e4db8
[ "Apache-2.0" ]
permissive
google-code-export/google-api-dfp-java
51b0142c19a34cd822a90e0350eb15ec4347790a
b852c716ef6e5d300363ed61e15cbd6242fbac85
refs/heads/master
2020-05-20T03:52:00.420915
2013-12-19T23:08:40
2013-12-19T23:08:40
32,133,590
0
0
null
null
null
null
UTF-8
Java
false
false
712
java
/** * UserTeamAssociationService.java * * This file was auto-generated from WSDL * by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter. */ package com.google.api.ads.dfp.v201311; public interface UserTeamAssociationService extends javax.xml.rpc.Service { public java.lang.String getUserTeamAssociationServiceInterfacePortAddress(); public com.google.api.ads.dfp.v201311.UserTeamAssociationServiceInterface getUserTeamAssociationServiceInterfacePort() throws javax.xml.rpc.ServiceException; public com.google.api.ads.dfp.v201311.UserTeamAssociationServiceInterface getUserTeamAssociationServiceInterfacePort(java.net.URL portAddress) throws javax.xml.rpc.ServiceException; }
[ "api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098" ]
api.arogal@gmail.com@e5600b00-1bfd-11df-acd4-e1cde50d4098
736378135c5df2905954a201a4cee06164a138dc
8d5ed637e90d24c806c5ea091cb2b877aa2a5103
/src/main/java/yyl/leetcode/lcci/L0803_MagicIndexLcci.java
6b5348563521e96307785de0e76fabaf366d6664
[ "Apache-2.0" ]
permissive
Relucent/yyl_leetcode
7cc087ca22f01fdec4189c6336fb9581c73ac3e3
ce5e713b8ab07d08502ce048a3c493cde84f6e5a
refs/heads/master
2023-03-09T12:49:28.699718
2023-03-02T07:00:46
2023-03-02T07:00:46
101,182,096
3
0
null
null
null
null
UTF-8
Java
false
false
2,247
java
package yyl.leetcode.lcci; import yyl.leetcode.util.Assert; /** * <h3>面试题 08.03. 魔术索引</h3><br> * 魔术索引。 在数组A[0...n-1]中,有所谓的魔术索引,满足条件A[i] = i。<br> * 给定一个有序整数数组,编写一种方法找出魔术索引,若有的话,在数组A中找出一个魔术索引,如果没有,则返回-1。若有多个魔术索引,返回索引值最小的一个。<br> * * <pre> * 示例1: * 输入:nums = [0, 2, 3, 4, 5] * 输出:0 * 说明: 0下标的元素为0 * * 示例2: * 输入:nums = [1, 1, 1] * 输出:1 * 提示: * nums长度在[1, 1000000]之间 * </pre> */ public class L0803_MagicIndexLcci { public static void main(String[] args) { Solution solution = new Solution(); Assert.assertEquals(0, solution.findMagicIndex(new int[] { 0, 2, 3, 4, 5 })); Assert.assertEquals(1, solution.findMagicIndex(new int[] { 1, 1, 1 })); } // 迭代 // 从头遍历到尾,如果 nums[i]==i,返回i;如果遍历到末尾,返回-1 // 时间复杂度:O(N) // 空间复杂度:O(1) static class Solution { public int findMagicIndex(int[] nums) { for (int i = 0; i < nums.length; i++) { if (nums[i] == i) { return i; } } return -1; } } // 跳跃 // 如果第一个魔术索引是i, 那么 :mums[i-1] < i-1; // 于是可以根据位置元素的特点对下标进行切换 // 时间复杂度:O(N),虽然最差时间复杂度和迭代相同,但是一般情况可以节省中间比较。所以实际比迭代要快一些。 // 空间复杂度:O(1) static class Solution1 { public int findMagicIndex(int[] nums) { for (int i = 0; i < nums.length;) { if (nums[i] == i) { return i; } if (nums[i] > i) { i = nums[i]; } // nums[i] < i else { i++; } } return -1; } } }
[ "relucent@163.com" ]
relucent@163.com
a988272b4743ff72ce7b62e3365def2aa3702c0c
740438e03aeec1cc5dbeac7f30ac37c525a1d7eb
/weixin4j-qy/weixin4j-qy-server/src/main/java/com/foxinmy/weixin4j/qy/server/WeixinMessageDecoder.java
b36beeeb363c9b7555d16fe75f5427530cbb4ea5
[ "Apache-2.0" ]
permissive
fengdongdong/weixin4j
e3c5b1d1da1e1db8a482fe318ac099686d4514ea
e89e988c627c705a0d36c3183db84d377dd43fc0
refs/heads/master
2021-01-12T22:33:43.792262
2015-04-18T13:29:50
2015-04-18T13:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,037
java
package com.foxinmy.weixin4j.qy.server; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToMessageDecoder; import io.netty.handler.codec.http.FullHttpRequest; import io.netty.handler.codec.http.HttpMethod; import io.netty.handler.codec.http.QueryStringDecoder; import java.util.List; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.apache.http.Consts; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.foxinmy.weixin4j.model.WeixinQyAccount; import com.foxinmy.weixin4j.response.HttpWeixinMessage; import com.foxinmy.weixin4j.type.EncryptType; import com.foxinmy.weixin4j.util.ConfigUtil; import com.foxinmy.weixin4j.util.MessageUtil; import com.foxinmy.weixin4j.xml.XmlStream; /** * 微信消息解码类 * * @className WeixinMessageDecoder * @author jy * @date 2014年11月13日 * @since JDK 1.7 * @see <a * href="http://qydev.weixin.qq.com/wiki/index.php?title=%E5%9B%9E%E8%B0%83%E6%A8%A1%E5%BC%8F">回调模式</a> */ public class WeixinMessageDecoder extends MessageToMessageDecoder<FullHttpRequest> { private final Logger log = LoggerFactory.getLogger(getClass()); @Override protected void decode(ChannelHandlerContext ctx, FullHttpRequest req, List<Object> out) throws Exception { WeixinQyAccount qyAccount = ConfigUtil.getWeixinQyAccount(); String content = req.content().toString(Consts.UTF_8); HttpWeixinMessage message = new HttpWeixinMessage(); message.setOriginalContent(content); if (StringUtils.isNotBlank(content)) { message = XmlStream.get(content, HttpWeixinMessage.class); message.setOriginalContent(MessageUtil.aesDecrypt( qyAccount.getId(), qyAccount.getEncodingAesKey(), message.getEncryptContent())); } message.setMethod(req.getMethod().name()); QueryStringDecoder queryDecoder = new QueryStringDecoder(req.getUri(), true); log.info("\n=================receive request================="); log.info("{}", req.getMethod()); log.info("{}", req.getUri()); log.info("{}", content); Map<String, List<String>> parameters = queryDecoder.parameters(); String msgSignature = parameters.containsKey("msg_signature") ? parameters .get("msg_signature").get(0) : ""; message.setSignature(msgSignature); String echoStr = parameters.containsKey("echostr") ? parameters.get( "echostr").get(0) : ""; message.setEchoStr(echoStr); String timeStamp = parameters.containsKey("timestamp") ? parameters .get("timestamp").get(0) : ""; message.setTimeStamp(timeStamp); String nonce = parameters.containsKey("nonce") ? parameters .get("nonce").get(0) : ""; message.setNonce(nonce); message.setToken(qyAccount.getToken()); message.setEncryptType(EncryptType.AES); // 解密 echostr 20141228 added if (message.getMethod().equals(HttpMethod.GET.name()) && StringUtils.isNotBlank(echoStr)) { message.setOriginalContent(MessageUtil.aesDecrypt( qyAccount.getId(), qyAccount.getEncodingAesKey(), echoStr)); } out.add(message); } }
[ "foxinmy@gmail.com" ]
foxinmy@gmail.com
4db9e99b318bf5dd91e1081bf5ddaddb0e8e18d5
d0e74ff6e8d37984cea892dfe8508e2b44de5446
/logistics-wms-city-1.1.3.44.5/logistics-wms-city-manager/src/main/java/com/yougou/logistics/city/manager/ItemBarcodeManager.java
953670a2c8a6f8393f86a3cee16ee9d956567715
[]
no_license
heaven6059/wms
fb39f31968045ba7e0635a4416a405a226448b5a
5885711e188e8e5c136956956b794f2a2d2e2e81
refs/heads/master
2021-01-14T11:20:10.574341
2015-04-11T08:11:59
2015-04-11T08:11:59
29,462,213
1
4
null
null
null
null
UTF-8
Java
false
false
301
java
package com.yougou.logistics.city.manager; import com.yougou.logistics.base.manager.BaseCrudManager; /** * TODO: 增加描述 * * @author jiang.ys * @date 2013-11-21 下午3:31:58 * @version 0.1.0 * @copyright yougou.com */ public interface ItemBarcodeManager extends BaseCrudManager { }
[ "heaven6059@126.com" ]
heaven6059@126.com
74031a0adf39cf80a3fc9732033886d3a743ce1d
0ad5458bf9edd95d4c03d4b10d7f644022a59cd7
/src/main/java/ch/ethz/idsc/owl/bot/se2/rrts/Se2ExpandDemo.java
4f5caaebfc3f1a6d70da15d6fa7078a103119f4d
[]
no_license
yangshuo11/owl
596e2e15ab7463944df0daecf34f1c74cb2806cc
9e8a917ab34d7283dc0cc3514689a6e7683d5e98
refs/heads/master
2020-04-05T08:44:51.622349
2018-10-29T05:56:00
2018-10-29T05:56:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,300
java
// code by jph package ch.ethz.idsc.owl.bot.se2.rrts; import ch.ethz.idsc.owl.bot.util.UserHome; import ch.ethz.idsc.owl.gui.win.OwlyFrame; import ch.ethz.idsc.owl.gui.win.OwlyGui; import ch.ethz.idsc.owl.math.sample.BoxRandomSample; import ch.ethz.idsc.owl.rrts.adapter.EmptyTransitionRegionQuery; import ch.ethz.idsc.owl.rrts.adapter.LengthCostFunction; import ch.ethz.idsc.owl.rrts.adapter.RrtsNodes; import ch.ethz.idsc.owl.rrts.core.DefaultRrts; import ch.ethz.idsc.owl.rrts.core.Rrts; import ch.ethz.idsc.owl.rrts.core.RrtsNode; import ch.ethz.idsc.owl.rrts.core.RrtsNodeCollection; import ch.ethz.idsc.owl.rrts.core.TransitionRegionQuery; import ch.ethz.idsc.owl.rrts.core.TransitionSpace; import ch.ethz.idsc.tensor.RealScalar; import ch.ethz.idsc.tensor.Tensor; import ch.ethz.idsc.tensor.Tensors; import ch.ethz.idsc.tensor.io.AnimationWriter; /* package */ enum Se2ExpandDemo { ; public static void main(String[] args) throws Exception { int wid = 7; Tensor min = Tensors.vector(0, 0, 0); Tensor max = Tensors.vector(wid, wid, 2 * Math.PI); RrtsNodeCollection nc = new Se2NodeCollection(min, max); TransitionRegionQuery trq = EmptyTransitionRegionQuery.INSTANCE; // --- TransitionSpace transitionSpace = new Se2TransitionSpace(RealScalar.ONE); Rrts rrts = new DefaultRrts(transitionSpace, nc, trq, LengthCostFunction.IDENTITY); RrtsNode root = rrts.insertAsNode(Tensors.vector(0, 0, 0), 5).get(); BoxRandomSample rnUniformSampler = new BoxRandomSample(min, max); try (AnimationWriter gsw = AnimationWriter.of(UserHome.Pictures("se2rrts.gif"), 250)) { OwlyFrame owlyFrame = OwlyGui.start(); owlyFrame.configCoordinateOffset(42, 456); owlyFrame.jFrame.setBounds(100, 100, 500, 500); int frame = 0; while (frame++ < 40 && owlyFrame.jFrame.isVisible()) { for (int c = 0; c < 10; ++c) rrts.insertAsNode(rnUniformSampler.randomSample(), 20); owlyFrame.setRrts(root, trq); gsw.append(owlyFrame.offscreen()); Thread.sleep(100); } int repeatLast = 3; while (0 < repeatLast--) gsw.append(owlyFrame.offscreen()); } System.out.println(rrts.rewireCount()); RrtsNodes.costConsistency(root, transitionSpace, LengthCostFunction.IDENTITY); } }
[ "jan.hakenberg@gmail.com" ]
jan.hakenberg@gmail.com
138a5a4197d25caec6e4409c1b1c8809b79cbedb
510ba8024a7ea790a5b0176ebece0e34a5f86e4b
/src/main/java/com/cdkj/service/proxy/ReturnMessage.java
b95e548938dae478818c6c9d2b73c1303bf1b441
[]
no_license
yiwocao2017/cswforwardservice
50dc55275ca7a92a0a7ece1a9dffd1cb42b2a69c
c39ab9693e4123daea8becc9ffc28a71f64a6c5c
refs/heads/master
2022-07-23T15:04:17.032547
2019-07-01T06:09:51
2019-07-01T06:09:51
194,610,302
0
0
null
2022-07-06T20:00:30
2019-07-01T06:09:51
Java
UTF-8
Java
false
false
635
java
package com.cdkj.service.proxy; public class ReturnMessage { private String errorCode; private String errorInfo; // 方法调用返回结果 private Object data; public String getErrorCode() { return errorCode; } public void setErrorCode(String errorCode) { this.errorCode = errorCode; } public String getErrorInfo() { return errorInfo; } public void setErrorInfo(String errorInfo) { this.errorInfo = errorInfo; } public Object getData() { return data; } public void setData(Object data) { this.data = data; } }
[ "admin@yiwocao.com" ]
admin@yiwocao.com
ed7dd3c8a7230ce43bb332e6a41d38325f6a8c9a
47798511441d7b091a394986afd1f72e8f9ff7ab
/src/main/java/com/alipay/api/domain/AlipayEbppInvoiceTaxnoBatchqueryModel.java
6319ac0e0bf9784a5cf6f588011fc41f69725eaa
[ "Apache-2.0" ]
permissive
yihukurama/alipay-sdk-java-all
c53d898371032ed5f296b679fd62335511e4a310
0bf19c486251505b559863998b41636d53c13d41
refs/heads/master
2022-07-01T09:33:14.557065
2020-05-07T11:20:51
2020-05-07T11:20:51
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,430
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 获取指定企业税号的用户发票要素列表 * * @author auto create * @since 1.0, 2020-04-15 09:30:14 */ public class AlipayEbppInvoiceTaxnoBatchqueryModel extends AlipayObject { private static final long serialVersionUID = 5437134793319911453L; /** * 默认值为false。true为输出交易信息,false为不输出交易信息。 */ @ApiField("enable_trade_out") private String enableTradeOut; /** * 查询结束时间,精确到天(按开票日期查询) start_invoice_date和end_invoice_date传值要求 1.同时为空时,返回最近半年200条数据 2.其中一个值不能为空 3.结束日期不能大于当前日期 4.开始时间和结束时间跨度不能超过6个月 */ @ApiField("end_invoice_date") private String endInvoiceDate; /** * 查询票种列表 可选值 PLAIN:增值税电子普通发票 SPECIAL:增值税专用发票 PLAIN_INVOICE:增值税普通发票 PAPER_INVOICE:增值税普通发票(卷式) SALSE_INVOICE:机动车销售统一发票 */ @ApiListField("invoice_kind_list") @ApiField("string") private List<String> invoiceKindList; /** * 查询结果上限笔数,最大值20 */ @ApiField("limit_size") private Long limitSize; /** * 当前页码,为空时默认第一页 */ @ApiField("page_num") private Long pageNum; /** * 发票要素获取应用场景 INVOICE_EXPENSE-发票报销 */ @ApiField("scene") private String scene; /** * 查询起始时间,精确到天(按开票日期查询) start_invoice_date和end_invoice_date传值要求 1.同时为空时,返回最近半年200条数据 2.其中一个值不能为空 3.结束日期不能大于当前日期 4.开始时间和结束时间跨度不能超过6个月 */ @ApiField("start_invoice_date") private String startInvoiceDate; /** * 企业税号 */ @ApiField("tax_no") private String taxNo; public String getEnableTradeOut() { return this.enableTradeOut; } public void setEnableTradeOut(String enableTradeOut) { this.enableTradeOut = enableTradeOut; } public String getEndInvoiceDate() { return this.endInvoiceDate; } public void setEndInvoiceDate(String endInvoiceDate) { this.endInvoiceDate = endInvoiceDate; } public List<String> getInvoiceKindList() { return this.invoiceKindList; } public void setInvoiceKindList(List<String> invoiceKindList) { this.invoiceKindList = invoiceKindList; } public Long getLimitSize() { return this.limitSize; } public void setLimitSize(Long limitSize) { this.limitSize = limitSize; } public Long getPageNum() { return this.pageNum; } public void setPageNum(Long pageNum) { this.pageNum = pageNum; } public String getScene() { return this.scene; } public void setScene(String scene) { this.scene = scene; } public String getStartInvoiceDate() { return this.startInvoiceDate; } public void setStartInvoiceDate(String startInvoiceDate) { this.startInvoiceDate = startInvoiceDate; } public String getTaxNo() { return this.taxNo; } public void setTaxNo(String taxNo) { this.taxNo = taxNo; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
dcec3b5efb3bfa5a386a23a05b72130ea2e0fe67
147cc0aa27f4113718836474f82ffdf98f115a38
/src/main/java/by/danceform/app/domain/config/Trainer.java
5bb75dd9e8d665b553cda8f547bd7b04910448ed
[]
no_license
dmitry-shanko/DanceForm
11651963aed5cf8c001652fecfe58dca516cb4ce
068cf6612f5fe659fb908f04ab854c08c0f0a3e7
refs/heads/master
2022-12-11T01:44:01.911936
2018-03-12T21:45:04
2018-03-12T21:45:04
70,248,495
0
1
null
2020-09-18T07:43:01
2016-10-07T13:21:26
Java
UTF-8
Java
false
false
1,800
java
package by.danceform.app.domain.config; import by.danceform.app.domain.AbstractEntity; import by.danceform.app.domain.INamedEntity; 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.validation.constraints.NotNull; import javax.validation.constraints.Size; /** * A Trainer. */ @Entity @Table(name = "trainer") public class Trainer extends AbstractEntity<Long> implements INamedEntity { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; @NotNull @Size(min = 1, max = 32) @Column(name = "name", length = 32, nullable = false) private String name; @Size(max = 32) @Column(name = "surname", length = 32, nullable = true) private String surname; @Column(name = "visible") private Boolean visible; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getSurname() { return surname; } public void setSurname(String surname) { this.surname = surname; } public Boolean isVisible() { return visible; } public void setVisible(Boolean visible) { this.visible = visible; } @Override public String toString() { return "Trainer{" + "id=" + id + ", name='" + name + "'" + ", surname='" + surname + "'" + ", visible='" + visible + "'" + '}'; } }
[ "dimonn12@hotmail.com" ]
dimonn12@hotmail.com
e6cda3714ead399ed45299899f8ef8fe9f97c2b5
9459ce9d1ceb8d3bddcd54530f0f99f29dd4c5ba
/bakery-logic/src/main/java/co/edu/uniandes/csw/bakery/entities/CategoryEntity.java
785fbdb1325c0d6e868e321545e6f545c9484a04
[ "MIT" ]
permissive
alejan/bakery
8815b9d11f61127475b519924e1fb8669b0a81fc
c8041ad0bc6dc2d838bfa10f8c0c819e54b83deb
refs/heads/master
2020-12-24T20:10:29.127851
2017-08-27T15:06:55
2017-08-27T15:06:55
86,241,747
0
0
null
null
null
null
UTF-8
Java
false
false
2,058
java
/* The MIT License (MIT) Copyright (c) 2015 Los Andes University Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ package co.edu.uniandes.csw.bakery.entities; import java.io.Serializable; import javax.persistence.Entity; import co.edu.uniandes.csw.crud.spi.entity.BaseEntity; import uk.co.jemos.podam.common.PodamExclude; import javax.persistence.OneToOne; import javax.persistence.FetchType; /** * @generated */ @Entity public class CategoryEntity extends BaseEntity implements Serializable { @PodamExclude @OneToOne(fetch=FetchType.LAZY) private CategoryEntity parentCategory; /** * Obtiene el atributo parentCategory. * * @return atributo parentCategory. * @generated */ public CategoryEntity getParentCategory() { return parentCategory; } /** * Establece el valor del atributo parentCategory. * * @param parentCategory nuevo valor del atributo * @generated */ public void setParentCategory(CategoryEntity parentcategory) { this.parentCategory = parentcategory; } }
[ "help@genmymodel.com" ]
help@genmymodel.com
94216b8298ab744c5e71bc1f4c6978c913c9a363
eff9b41c3727cfbe5750245c8f05e94720d64c33
/code/engine/src/main/java/org/vanguardmatrix/engine/android/data/OnMigrationListener.java
22230148c01fc02dc985b15f9cc83b2bd8682119
[]
no_license
uzairsabir/consumer
15a132d3fb7a70a05d3f2cb96ee981dce561b328
b1f53caf9834223bcb5cf6173d0f185feb230d47
refs/heads/master
2020-01-24T20:53:28.584999
2017-03-08T19:23:54
2017-03-08T19:23:54
73,853,361
0
0
null
null
null
null
UTF-8
Java
false
false
964
java
/** * Copyright (c) 2013, Redsolution LTD. All rights reserved. * <p/> * This file is part of Xabber project; you can redistribute it and/or * modify it under the terms of the GNU General Public License, Version 3. * <p/> * Xabber 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. * <p/> * 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.vanguardmatrix.engine.android.data; /** * Listener for database migration. * * @author alexander.ivanov */ public interface OnMigrationListener extends BaseManagerInterface { /** * Called on database migration for each intermediate versions. * * @param toVersion */ void onMigrate(int toVersion); }
[ "uzair92ssuet92@gmail.com" ]
uzair92ssuet92@gmail.com
c9a9c4065eb5b237b35a99c5ad6f1c6c100e15bb
3a517f7cf8e9183cde34f345459a6828c15c3317
/src/test/java/ch/alpine/tensor/qty/QuantityMagnitudeTest.java
c300b8b7f61ac26697025ad871ddda28e0b4325d
[]
no_license
datahaki/tensor
766b3f8ad6bc0756edfd2e0f10ecbc27fa7cefa2
8b29f8c43ed8305accf0a6a5378213f38adb0a61
refs/heads/master
2023-09-03T05:51:04.681055
2023-08-24T11:04:53
2023-08-24T11:04:53
294,003,258
23
1
null
2022-09-15T00:43:39
2020-09-09T04:34:22
Java
UTF-8
Java
false
false
6,744
java
// code by jph package ch.alpine.tensor.qty; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.IOException; import org.junit.jupiter.api.Test; import ch.alpine.tensor.DoubleScalar; import ch.alpine.tensor.RationalScalar; import ch.alpine.tensor.RealScalar; import ch.alpine.tensor.Scalar; import ch.alpine.tensor.Throw; import ch.alpine.tensor.api.ScalarUnaryOperator; import ch.alpine.tensor.chq.ExactScalarQ; import ch.alpine.tensor.ext.Serialization; import ch.alpine.tensor.mat.Tolerance; import ch.alpine.tensor.sca.Chop; import ch.alpine.tensor.sca.N; class QuantityMagnitudeTest { @Test void testMagnitudeKgf() { Scalar scalar = QuantityMagnitude.SI().in("N").apply(Quantity.of(1, "kgf")); assertEquals(N.DOUBLE.apply(scalar).number().doubleValue(), 9.80665); } @Test void testInUnit() { Scalar scalar = QuantityMagnitude.SI().in(Unit.of("K*m^2")).apply(Quantity.of(2, "K*km^2")); assertEquals(scalar, RealScalar.of(2_000_000)); } @Test void testInString() { Scalar scalar = QuantityMagnitude.SI().in("K*m^2*s").apply(Quantity.of(2, "K*km^2*s")); assertEquals(scalar, RealScalar.of(2_000_000)); } @Test void testRad() throws ClassNotFoundException, IOException { QuantityMagnitude quantityMagnitude = Serialization.copy(QuantityMagnitude.SI()); ScalarUnaryOperator scalarUnaryOperator = quantityMagnitude.in(Unit.of("rad")); Chop._12.requireClose(scalarUnaryOperator.apply(Quantity.of(360, "deg")), RealScalar.of(Math.PI * 2)); Scalar scalar = scalarUnaryOperator.apply(RealScalar.of(2)); assertEquals(scalar, RealScalar.of(2)); ExactScalarQ.require(scalar); } @Test void testSingleton() { Scalar scalar = Quantity.of(3, "m^2*s"); ScalarUnaryOperator suo = QuantityMagnitude.singleton("s*m^2"); assertEquals(suo.apply(scalar), RealScalar.of(3)); } @Test void testSingleton2() { Scalar scalar = RealScalar.of(3); ScalarUnaryOperator suo = QuantityMagnitude.singleton(Unit.ONE); assertEquals(suo.apply(scalar), RealScalar.of(3)); } @Test void testConversionJ() { Scalar scalar = Quantity.of(6.241509125883258E9, "GeV"); QuantityMagnitude quantityMagnitude = QuantityMagnitude.SI(); ScalarUnaryOperator suo = quantityMagnitude.in("J"); Scalar result = suo.apply(scalar); Tolerance.CHOP.requireClose(result, RealScalar.ONE); } @Test void testConversionPa() { Scalar scalar = Quantity.of(RationalScalar.of(8896443230521L, 1290320000).reciprocal(), "psi"); QuantityMagnitude quantityMagnitude = QuantityMagnitude.SI(); ScalarUnaryOperator suo = quantityMagnitude.in("Pa"); Scalar result = suo.apply(scalar); assertEquals(result, RealScalar.ONE); ExactScalarQ.require(result); } @Test void testConversionN() { Scalar scalar = Quantity.of(RationalScalar.of(8896443230521L, 2000000000000L).reciprocal(), "lbf"); QuantityMagnitude quantityMagnitude = QuantityMagnitude.SI(); ScalarUnaryOperator scalarUnaryOperator = quantityMagnitude.in("N"); Scalar result = scalarUnaryOperator.apply(scalar); assertEquals(result, RealScalar.ONE); ExactScalarQ.require(result); } @Test void testConversionMoWk() { Scalar scalar = Quantity.of(1, "mo"); QuantityMagnitude quantityMagnitude = QuantityMagnitude.SI(); ScalarUnaryOperator scalarUnaryOperator = quantityMagnitude.in("wk"); Scalar result = scalarUnaryOperator.apply(scalar); assertEquals(result, RationalScalar.of(365, 84)); } @Test void testHorsepower() { ScalarUnaryOperator scalarUnaryOperator = QuantityMagnitude.SI().in("W"); Scalar ps = scalarUnaryOperator.apply(Quantity.of(1.0, "PS")); Scalar hp = scalarUnaryOperator.apply(Quantity.of(1.0, "hp")); assertEquals(ps, RealScalar.of(735.49875)); Chop._12.requireClose(hp, RealScalar.of(745.6998715822702)); } @Test void testHorsepowerKiloWatts() { ScalarUnaryOperator scalarUnaryOperator = QuantityMagnitude.SI().in("kW"); Scalar ps = scalarUnaryOperator.apply(Quantity.of(1.0, "PS")); Scalar hp = scalarUnaryOperator.apply(Quantity.of(1.0, "hp")); Chop._14.requireClose(ps, RealScalar.of(0.73549875)); Chop._14.requireClose(hp, RealScalar.of(0.7456998715822702)); } @Test void testKiloponds() { ScalarUnaryOperator scalarUnaryOperator = QuantityMagnitude.SI().in("N"); Scalar kp = scalarUnaryOperator.apply(Quantity.of(1.0, "kp")); assertEquals(kp, RealScalar.of(9.80665)); } @Test void testMetricTons() { ScalarUnaryOperator scalarUnaryOperator = QuantityMagnitude.SI().in("t"); Scalar _1kg_in_tons = scalarUnaryOperator.apply(Quantity.of(1000, "g")); ExactScalarQ.require(_1kg_in_tons); assertEquals(_1kg_in_tons, RationalScalar.of(1, 1000)); } @Test void testPercent() { ScalarUnaryOperator scalarUnaryOperator = QuantityMagnitude.SI().in("%"); Scalar scalar = scalarUnaryOperator.apply(RealScalar.of(2)); assertEquals(scalar, RealScalar.of(200)); String string = scalarUnaryOperator.toString(); assertTrue(string.startsWith("QuantityMagnitude")); assertTrue(string.contains("%")); } @Test void testKilo() { ScalarUnaryOperator scalarUnaryOperator = QuantityMagnitude.SI().in("k"); Scalar scalar = scalarUnaryOperator.apply(RealScalar.of(2000)); ExactScalarQ.require(scalar); assertEquals(scalar, RealScalar.of(2)); } @Test void testVolume() { Tolerance.CHOP.requireClose( // QuantityMagnitude.SI().in("L").apply(Quantity.of(1.0, "cup")), // DoubleScalar.of(0.2365882365)); Tolerance.CHOP.requireClose( // QuantityMagnitude.SI().in("L").apply(Quantity.of(1.0, "gal")), // DoubleScalar.of(3.785411784)); Tolerance.CHOP.requireClose( // QuantityMagnitude.SI().in("L").apply(Quantity.of(1.0, "tsp")), // DoubleScalar.of(0.00492892159375)); // Tolerance.CHOP.requireClose( // // QuantityMagnitude.SI().in("L").apply(Quantity.of(1.0, "sticks")), // // DoubleScalar.of(0.11829411825)); } @Test void testFailConversion() { QuantityMagnitude quantityMagnitude = QuantityMagnitude.SI(); Scalar quantity = Quantity.of(360, "kg"); ScalarUnaryOperator scalarUnaryOperator = quantityMagnitude.in("m"); assertThrows(Throw.class, () -> scalarUnaryOperator.apply(quantity)); } @Test void testFailInNull() { assertThrows(NullPointerException.class, () -> QuantityMagnitude.SI().in((Unit) null)); } @Test void testFailNull() { assertThrows(NullPointerException.class, () -> QuantityMagnitude.of(null)); } }
[ "jan.hakenberg@gmail.com" ]
jan.hakenberg@gmail.com
904385c8ed25517cfc916f5d6ceb7036eeaa111b
bbee6724df0c01ac00e309fb8ec28184140f370e
/src/main/java/uz/itcenter/web/rest/RegionsResource.java
d3784abadd1875eb43c918075fac5c43f76d53fb
[]
no_license
Muminniyoz/bazaitc
a786b6b9c5795dc347f0bf4738c62aa705dc3fc6
214931f645ac32664ed9dfbafb8cebfc3556b5ff
refs/heads/main
2023-03-22T15:31:24.918387
2021-02-27T10:16:49
2021-02-27T10:16:49
342,826,967
0
0
null
2021-02-27T10:16:49
2021-02-27T10:15:18
Java
UTF-8
Java
false
false
6,412
java
package uz.itcenter.web.rest; import uz.itcenter.service.RegionsService; import uz.itcenter.web.rest.errors.BadRequestAlertException; import uz.itcenter.service.dto.RegionsDTO; import uz.itcenter.service.dto.RegionsCriteria; import uz.itcenter.service.RegionsQueryService; import io.github.jhipster.web.util.HeaderUtil; import io.github.jhipster.web.util.PaginationUtil; import io.github.jhipster.web.util.ResponseUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; import java.net.URI; import java.net.URISyntaxException; import java.util.List; import java.util.Optional; /** * REST controller for managing {@link uz.itcenter.domain.Regions}. */ @RestController @RequestMapping("/api") public class RegionsResource { private final Logger log = LoggerFactory.getLogger(RegionsResource.class); private static final String ENTITY_NAME = "regions"; @Value("${jhipster.clientApp.name}") private String applicationName; private final RegionsService regionsService; private final RegionsQueryService regionsQueryService; public RegionsResource(RegionsService regionsService, RegionsQueryService regionsQueryService) { this.regionsService = regionsService; this.regionsQueryService = regionsQueryService; } /** * {@code POST /regions} : Create a new regions. * * @param regionsDTO the regionsDTO to create. * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new regionsDTO, or with status {@code 400 (Bad Request)} if the regions has already an ID. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PostMapping("/regions") public ResponseEntity<RegionsDTO> createRegions(@Valid @RequestBody RegionsDTO regionsDTO) throws URISyntaxException { log.debug("REST request to save Regions : {}", regionsDTO); if (regionsDTO.getId() != null) { throw new BadRequestAlertException("A new regions cannot already have an ID", ENTITY_NAME, "idexists"); } RegionsDTO result = regionsService.save(regionsDTO); return ResponseEntity.created(new URI("/api/regions/" + result.getId())) .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString())) .body(result); } /** * {@code PUT /regions} : Updates an existing regions. * * @param regionsDTO the regionsDTO to update. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the updated regionsDTO, * or with status {@code 400 (Bad Request)} if the regionsDTO is not valid, * or with status {@code 500 (Internal Server Error)} if the regionsDTO couldn't be updated. * @throws URISyntaxException if the Location URI syntax is incorrect. */ @PutMapping("/regions") public ResponseEntity<RegionsDTO> updateRegions(@Valid @RequestBody RegionsDTO regionsDTO) throws URISyntaxException { log.debug("REST request to update Regions : {}", regionsDTO); if (regionsDTO.getId() == null) { throw new BadRequestAlertException("Invalid id", ENTITY_NAME, "idnull"); } RegionsDTO result = regionsService.save(regionsDTO); return ResponseEntity.ok() .headers(HeaderUtil.createEntityUpdateAlert(applicationName, true, ENTITY_NAME, regionsDTO.getId().toString())) .body(result); } /** * {@code GET /regions} : get all the regions. * * @param pageable the pagination information. * @param criteria the criteria which the requested entities should match. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of regions in body. */ @GetMapping("/regions") public ResponseEntity<List<RegionsDTO>> getAllRegions(RegionsCriteria criteria, Pageable pageable) { log.debug("REST request to get Regions by criteria: {}", criteria); Page<RegionsDTO> page = regionsQueryService.findByCriteria(criteria, pageable); HttpHeaders headers = PaginationUtil.generatePaginationHttpHeaders(ServletUriComponentsBuilder.fromCurrentRequest(), page); return ResponseEntity.ok().headers(headers).body(page.getContent()); } /** * {@code GET /regions/count} : count all the regions. * * @param criteria the criteria which the requested entities should match. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body. */ @GetMapping("/regions/count") public ResponseEntity<Long> countRegions(RegionsCriteria criteria) { log.debug("REST request to count Regions by criteria: {}", criteria); return ResponseEntity.ok().body(regionsQueryService.countByCriteria(criteria)); } /** * {@code GET /regions/:id} : get the "id" regions. * * @param id the id of the regionsDTO to retrieve. * @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the regionsDTO, or with status {@code 404 (Not Found)}. */ @GetMapping("/regions/{id}") public ResponseEntity<RegionsDTO> getRegions(@PathVariable Long id) { log.debug("REST request to get Regions : {}", id); Optional<RegionsDTO> regionsDTO = regionsService.findOne(id); return ResponseUtil.wrapOrNotFound(regionsDTO); } /** * {@code DELETE /regions/:id} : delete the "id" regions. * * @param id the id of the regionsDTO to delete. * @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}. */ @DeleteMapping("/regions/{id}") public ResponseEntity<Void> deleteRegions(@PathVariable Long id) { log.debug("REST request to delete Regions : {}", id); regionsService.delete(id); return ResponseEntity.noContent().headers(HeaderUtil.createEntityDeletionAlert(applicationName, true, ENTITY_NAME, id.toString())).build(); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
9db355cd7987071e2ab184cd6192d4ec0da7da02
288151cf821acf7fe9430c2b6aeb19e074a791d4
/mfoyou-agent-server/mfoyou-agent-taobao/src/main/java/com/alipay/api/domain/InsMktFactorDTO.java
d1d7f36036519f4c65930fab8f47799f49038d72
[]
no_license
jiningeast/distribution
60022e45d3a401252a9c970de14a599a548a1a99
c35bfc5923eaecf2256ce142955ecedcb3c64ae5
refs/heads/master
2020-06-24T11:27:51.899760
2019-06-06T12:52:59
2019-06-06T12:52:59
null
0
0
null
null
null
null
UTF-8
Java
false
false
700
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 保险营销规则因子 * * @author auto create * @since 1.0, 2016-10-26 17:43:42 */ public class InsMktFactorDTO extends AlipayObject { private static final long serialVersionUID = 3814824912549375969L; /** * 规则因子 */ @ApiField("key") private String key; /** * 规则因子值 */ @ApiField("value") private String value; public String getKey() { return this.key; } public void setKey(String key) { this.key = key; } public String getValue() { return this.value; } public void setValue(String value) { this.value = value; } }
[ "15732677882@163.com" ]
15732677882@163.com
67ce80e60cf3e3ab9a1ad08f83b9b5de1c9af50f
dba87418d2286ce141d81deb947305a0eaf9824f
/sources/com/iaai/android/bdt/feature/account/MyAccountViewModel$getBuyNowOfferCount$1.java
ace92541258e27d79705f63cc1fc225da57a5cab
[]
no_license
Sluckson/copyOavct
1f73f47ce94bb08df44f2ba9f698f2e8589b5cf6
d20597e14411e8607d1d6e93b632d0cd2e8af8cb
refs/heads/main
2023-03-09T12:14:38.824373
2021-02-26T01:38:16
2021-02-26T01:38:16
341,292,450
0
1
null
null
null
null
UTF-8
Java
false
false
1,772
java
package com.iaai.android.bdt.feature.account; import kotlin.Metadata; import kotlin.jvm.internal.Intrinsics; import org.jetbrains.annotations.NotNull; import p011io.reactivex.observers.DisposableObserver; @Metadata(mo66931bv = {1, 0, 3}, mo66932d1 = {"\u0000\u001f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0003\n\u0002\b\u0003*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\b\u0010\u0003\u001a\u00020\u0004H\u0016J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u0007H\u0016J\u0010\u0010\b\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\u0002H\u0016¨\u0006\n"}, mo66933d2 = {"com/iaai/android/bdt/feature/account/MyAccountViewModel$getBuyNowOfferCount$1", "Lio/reactivex/observers/DisposableObserver;", "", "onComplete", "", "onError", "e", "", "onNext", "response", "app_productionRelease"}, mo66934k = 1, mo66935mv = {1, 1, 13}) /* compiled from: MyAccountViewModel.kt */ public final class MyAccountViewModel$getBuyNowOfferCount$1 extends DisposableObserver<String> { final /* synthetic */ MyAccountViewModel this$0; public void onComplete() { } MyAccountViewModel$getBuyNowOfferCount$1(MyAccountViewModel myAccountViewModel) { this.this$0 = myAccountViewModel; } public void onNext(@NotNull String str) { Intrinsics.checkParameterIsNotNull(str, "response"); this.this$0.getShowLoading().postValue(false); this.this$0.getBuyNowOfferResponse().postValue(str); } public void onError(@NotNull Throwable th) { Intrinsics.checkParameterIsNotNull(th, "e"); this.this$0.getShowLoading().postValue(false); this.this$0.getOfferError().postValue(th.getMessage()); } }
[ "lucksonsurprice94@gmail.com" ]
lucksonsurprice94@gmail.com
d33588ae30760523f8c1b49929a83430574f0787
2c5439b2e87d498037dad9f098801482eda65f3e
/src/main/java/org/datanucleus/store/objectvaluegenerator/ObjectValueGenerator.java
4eb9dab2ac2e7679ed8792b302a2771fe1f34d04
[ "Apache-2.0" ]
permissive
m-creations/datanucleus-core
3b69a4b48d41f49ff4963998a5a22269c308a1d4
185030a79a489fd5b70941ea6e2eac38908753bf
refs/heads/master
2021-01-18T15:47:54.064755
2016-03-14T13:44:12
2016-03-14T13:44:12
53,931,854
0
0
null
2016-04-29T11:22:00
2016-03-15T09:34:49
Java
UTF-8
Java
false
false
1,589
java
/********************************************************************** Copyright (c) 2009 Andy Jefferson and others. 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. Contributors: ... **********************************************************************/ package org.datanucleus.store.objectvaluegenerator; import org.datanucleus.ExecutionContext; import org.datanucleus.metadata.ExtensionMetaData; /** * Interface providing value generation based on an input (persistable) object. */ public interface ObjectValueGenerator { /** * Method that takes the object being persisted by the specified ExecutionContext * and generates a value (based on the contents of the object). This could be used, for example, * to generate a unique value for the object based on some of its fields. * @param ec execution context * @param obj The object (persistent, or being persisted) * @param extensions Extensions on the field being generated * @return The value */ Object generate(ExecutionContext ec, Object obj, ExtensionMetaData[] extensions); }
[ "andy@datanucleus.org" ]
andy@datanucleus.org
46d29716d17f243f89fa3ff330018107def0d27b
6f01176ce2267ef1e1fed9437f0ebfa4a2832a57
/day19_filter&listener/src/cn/itcast/proxy/ProxyTest.java
9df363ced35ea0817f704db7e4d18371cfcc1d8b
[]
no_license
Dxuan-chen/itcast
170daea89bafaa5a6b14030151f98e3ea548dcae
2271c285a21e891590d70ca20ba7fe135ebdeabc
refs/heads/master
2023-07-03T07:36:37.980321
2021-08-03T02:17:59
2021-08-03T02:17:59
392,157,278
0
0
null
null
null
null
UTF-8
Java
false
false
2,307
java
package cn.itcast.proxy; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; public class ProxyTest { public static void main(String[] args) { //1.创建真实对象 Lenovo lenovo = new Lenovo(); //2.动态代理增强lenovo对象 /* 三个参数: 1. 类加载器:真实对象.getClass().getClassLoader() 2. 接口数组:真实对象.getClass().getInterfaces() 3. 处理器:new InvocationHandler() */ SaleComputer proxy_lenovo = (SaleComputer) Proxy.newProxyInstance(lenovo.getClass().getClassLoader(), lenovo.getClass().getInterfaces(), new InvocationHandler() { /* 代理逻辑编写的方法:代理对象调用的所有方法都会触发该方法执行 参数: 1. proxy:代理对象 2. method:代理对象调用的方法,被封装为的对象 3. args:代理对象调用的方法时,传递的实际参数 */ @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { /*System.out.println("该方法执行了...."); System.out.println(method.getName()); System.out.println(args[0]); */ //判断是否是sale方法 if(method.getName().equals("sale")){ //1.增强参数 double money = (double) args[0]; money = money * 0.85; System.out.println("专车接你...."); //使用真实对象调用该方法 String obj = (String) method.invoke(lenovo, money); System.out.println("免费送货..."); //2.增强返回值 return obj+"_鼠标垫"; }else{ Object obj = method.invoke(lenovo, args); return obj; } } }); //3.调用方法 /* String computer = proxy_lenovo.sale(8000); System.out.println(computer);*/ proxy_lenovo.show(); } }
[ "xuanfeng_chen@163.com" ]
xuanfeng_chen@163.com
54c590aa62aeae61b495c22f5fbbe9056e46099b
f08256664e46e5ac1466f5c67dadce9e19b4e173
/sources/com/bumptech/glide/load/p339o/C8264a.java
9a7bf5613d4c0f1f7448399e4ec0feb2914ea7ad
[]
no_license
IOIIIO/DisneyPlusSource
5f981420df36bfbc3313756ffc7872d84246488d
658947960bd71c0582324f045a400ae6c3147cc3
refs/heads/master
2020-09-30T22:33:43.011489
2019-12-11T22:27:58
2019-12-11T22:27:58
227,382,471
6
3
null
null
null
null
UTF-8
Java
false
false
3,288
java
package com.bumptech.glide.load.p339o; import android.content.res.AssetManager; import android.net.Uri; import android.os.ParcelFileDescriptor; import com.bumptech.glide.load.C8115i; import com.bumptech.glide.load.p332m.C8122d; import com.bumptech.glide.load.p332m.C8130h; import com.bumptech.glide.load.p332m.C8138m; import com.bumptech.glide.load.p339o.C8306n.C8307a; import java.io.InputStream; import p163g.p413f.p414a.p423v.C10760b; /* renamed from: com.bumptech.glide.load.o.a */ /* compiled from: AssetUriLoader */ public class C8264a<Data> implements C8306n<Uri, Data> { /* renamed from: c */ private static final int f17729c = 22; /* renamed from: a */ private final AssetManager f17730a; /* renamed from: b */ private final C8265a<Data> f17731b; /* renamed from: com.bumptech.glide.load.o.a$a */ /* compiled from: AssetUriLoader */ public interface C8265a<Data> { /* renamed from: a */ C8122d<Data> mo21443a(AssetManager assetManager, String str); } /* renamed from: com.bumptech.glide.load.o.a$b */ /* compiled from: AssetUriLoader */ public static class C8266b implements C8308o<Uri, ParcelFileDescriptor>, C8265a<ParcelFileDescriptor> { /* renamed from: a */ private final AssetManager f17732a; public C8266b(AssetManager assetManager) { this.f17732a = assetManager; } /* renamed from: a */ public C8306n<Uri, ParcelFileDescriptor> mo19954a(C8314r rVar) { return new C8264a(this.f17732a, this); } /* renamed from: a */ public void mo19955a() { } /* renamed from: a */ public C8122d<ParcelFileDescriptor> mo21443a(AssetManager assetManager, String str) { return new C8130h(assetManager, str); } } /* renamed from: com.bumptech.glide.load.o.a$c */ /* compiled from: AssetUriLoader */ public static class C8267c implements C8308o<Uri, InputStream>, C8265a<InputStream> { /* renamed from: a */ private final AssetManager f17733a; public C8267c(AssetManager assetManager) { this.f17733a = assetManager; } /* renamed from: a */ public C8306n<Uri, InputStream> mo19954a(C8314r rVar) { return new C8264a(this.f17733a, this); } /* renamed from: a */ public void mo19955a() { } /* renamed from: a */ public C8122d<InputStream> mo21443a(AssetManager assetManager, String str) { return new C8138m(assetManager, str); } } public C8264a(AssetManager assetManager, C8265a<Data> aVar) { this.f17730a = assetManager; this.f17731b = aVar; } /* renamed from: a */ public C8307a<Data> mo19951a(Uri uri, int i, int i2, C8115i iVar) { return new C8307a<>(new C10760b(uri), this.f17731b.mo21443a(this.f17730a, uri.toString().substring(f17729c))); } /* renamed from: a */ public boolean mo19953a(Uri uri) { if (!"file".equals(uri.getScheme()) || uri.getPathSegments().isEmpty()) { return false; } if ("android_asset".equals(uri.getPathSegments().get(0))) { return true; } return false; } }
[ "101110@vivaldi.net" ]
101110@vivaldi.net
5028f0cf71ba687e669668f6269bbc407b49eb08
a0983167deeca063755c2af7b8c907dbe2fd2df6
/app/src/main/java/com/tutorials/hp/masterdetailrvdialogfrag/MainActivity.java
d57739027a008418ce283a7dce30c75332838341
[]
no_license
Oclemy/MasterDetailRVDialogFrag
6b922844634d302f5f2ea4f15d49db4552f01eba
5026b5a97a18ac0dbece92005f816d2acd934d41
refs/heads/master
2020-12-24T18:42:34.453317
2016-05-13T00:09:29
2016-05-13T00:09:29
58,685,724
0
0
null
null
null
null
UTF-8
Java
false
false
1,351
java
package com.tutorials.hp.masterdetailrvdialogfrag; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.design.widget.Snackbar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.DefaultItemAnimator; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.View; import com.tutorials.hp.masterdetailrvdialogfrag.mData.SpacecraftsCollection; import com.tutorials.hp.masterdetailrvdialogfrag.mRecycler.MyAdapter; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); RecyclerView rv= (RecyclerView) findViewById(R.id.rv); rv.setLayoutManager(new LinearLayoutManager(this)); rv.setItemAnimator(new DefaultItemAnimator()); MyAdapter adapter=new MyAdapter(this, SpacecraftsCollection.getSpaceCrafts(),this.getSupportFragmentManager()); rv.setAdapter(adapter); } }
[ "oclemmi@gmail.com" ]
oclemmi@gmail.com
df43f1ea4cbfd50764317932c2e734d28e132210
f08256664e46e5ac1466f5c67dadce9e19b4e173
/sources/p163g/p201e/p203b/p204d/C5437v.java
46f74897cb8c1a8256337311acf5002a8efca463
[]
no_license
IOIIIO/DisneyPlusSource
5f981420df36bfbc3313756ffc7872d84246488d
658947960bd71c0582324f045a400ae6c3147cc3
refs/heads/master
2020-09-30T22:33:43.011489
2019-12-11T22:27:58
2019-12-11T22:27:58
227,382,471
6
3
null
null
null
null
UTF-8
Java
false
false
2,007
java
package p163g.p201e.p203b.p204d; import android.content.SharedPreferences; import kotlin.Metadata; @Metadata(mo31005bv = {1, 0, 3}, mo31006d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0007\u0018\u0000 \f2\u00020\u0001:\u0001\fB\u0011\b\u0007\u0012\b\b\u0001\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004R$\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u00068V@VX–\u000e¢\u0006\f\u001a\u0004\b\b\u0010\t\"\u0004\b\n\u0010\u000bR\u000e\u0010\u0002\u001a\u00020\u0003X‚\u0004¢\u0006\u0002\n\u0000¨\u0006\r"}, mo31007d2 = {"Lcom/bamtechmedia/dominguez/account/AccountSettingsViewedCheckerImpl;", "Lcom/bamtechmedia/dominguez/account/AccountSettingsViewedChecker;", "sharedPrefs", "Landroid/content/SharedPreferences;", "(Landroid/content/SharedPreferences;)V", "value", "", "accountSettingsViewed", "getAccountSettingsViewed", "()Z", "setAccountSettingsViewed", "(Z)V", "Companion", "account_release"}, mo31008k = 1, mo31009mv = {1, 1, 15}) /* renamed from: g.e.b.d.v */ /* compiled from: AccountSettingsViewedCheckerImpl.kt */ public final class C5437v implements C5434u { /* renamed from: a */ private final SharedPreferences f12946a; /* renamed from: g.e.b.d.v$a */ /* compiled from: AccountSettingsViewedCheckerImpl.kt */ public static final class C5438a { private C5438a() { } public /* synthetic */ C5438a(DefaultConstructorMarker defaultConstructorMarker) { this(); } } static { new C5438a(null); } public C5437v(SharedPreferences sharedPreferences) { this.f12946a = sharedPreferences; } /* renamed from: a */ public boolean mo17168a() { return this.f12946a.getBoolean("accountSettingsViewed", false); } /* renamed from: a */ public void mo17167a(boolean z) { this.f12946a.edit().putBoolean("accountSettingsViewed", z).apply(); } }
[ "101110@vivaldi.net" ]
101110@vivaldi.net
9b9e4ee35d92dde85401c8418611254ac6663351
ef1d87b64da817da712227fb869b2fd23b32e8a7
/bus-notify/src/main/java/org/aoju/bus/notify/Builder.java
02a698a90b98091dc0a023b163f6df9be612266b
[ "MIT" ]
permissive
Touhousupports/bus
b4a91563df2118d4b52a7c1345a8eb9c21380fd9
e2e3951b9921d7a92c7e0fdce24781e08b588f00
refs/heads/master
2022-11-22T09:26:18.088266
2020-07-17T02:17:43
2020-07-17T02:17:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,841
java
/********************************************************************************* * * * The MIT License (MIT) * * * * Copyright (c) 2015-2020 aoju.org and other contributors. * * * * Permission is hereby granted, free of charge, to any person obtaining a copy * * of this software and associated documentation files (the "Software"), to deal * * in the Software without restriction, including without limitation the rights * * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included in * * all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * * THE SOFTWARE. * ********************************************************************************/ package org.aoju.bus.notify; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.Setter; import lombok.ToString; import org.aoju.bus.core.lang.Symbol; /** * 构造信息 * * @author Kimi Liu * @version 6.0.3 * @since JDK 1.8+ */ @Setter public class Builder { @Getter @AllArgsConstructor public enum ErrorCode { SUCCESS(Symbol.ZERO, "Success"), FAILURE("-1", "Failure"), UNSUPPORTED("5003", "Unsupported operation"); private String code; private String msg; } /** * 缓存类型 */ @Getter @ToString public enum Type { /** * 使用内置的缓存 */ DEFAULT, /** * 使用Redis缓存 */ REDIS, /** * 自定义缓存 */ CUSTOM } }
[ "839536@qq.com" ]
839536@qq.com
5a4575e6bcac8a8defcf3e2bd3dfc6be8df506d3
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/training/com/google/security/zynamics/binnavi/REIL/CPostgreSQLDatabaseTest.java
26b6cb38b5faa31a38701d9fd47baab07721fbc5
[]
no_license
STAMP-project/dspot-experiments
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
121487e65cdce6988081b67f21bbc6731354a47f
refs/heads/master
2023-02-07T14:40:12.919811
2019-11-06T07:17:09
2019-11-06T07:17:09
75,710,758
14
19
null
2023-01-26T23:57:41
2016-12-06T08:27:42
null
UTF-8
Java
false
false
2,642
java
/** * Copyright 2014 Google Inc. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.google.security.zynamics.binnavi.REIL; import com.google.security.zynamics.binnavi.Database.CDatabase; import com.google.security.zynamics.binnavi.Database.Exceptions.CouldntLoadDataException; import com.google.security.zynamics.binnavi.Database.Exceptions.LoadCancelledException; import com.google.security.zynamics.binnavi.disassembly.INaviFunction; import com.google.security.zynamics.binnavi.disassembly.INaviInstruction; import com.google.security.zynamics.binnavi.disassembly.INaviModule; import com.google.security.zynamics.reil.translators.InternalTranslationException; import com.google.security.zynamics.reil.translators.ReilTranslator; import com.google.security.zynamics.reil.translators.StandardEnvironment; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; @RunWith(JUnit4.class) public class CPostgreSQLDatabaseTest { private CDatabase m_database; private final ReilTranslator<INaviInstruction> m_translator = new ReilTranslator<INaviInstruction>(); @Test public void testCalc() throws CouldntLoadDataException, LoadCancelledException, InternalTranslationException { final INaviModule calc = m_database.getContent().getModule(2); calc.load(); for (final INaviFunction function : calc.getContent().getFunctionContainer().getFunctions()) { function.load(); m_translator.translate(new StandardEnvironment(), function); function.close(); } calc.close(); } @Test public void testNotepad() throws CouldntLoadDataException, LoadCancelledException, InternalTranslationException { final INaviModule notepad = m_database.getContent().getModule(1); notepad.load(); for (final INaviFunction function : notepad.getContent().getFunctionContainer().getFunctions()) { function.load(); m_translator.translate(new StandardEnvironment(), function); function.close(); } notepad.close(); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
58ba867ac7c885d622f5bb01f43402f1c1f6bfe7
cc50ae35482a539c0e7b5350c48d356cb2eda059
/pattern/src/main/java/com/github/kuangcp/abstractfactory/ShapeFactory.java
c3bc3fd52d00c955d5d28c3227515e7770f3be99
[ "MIT" ]
permissive
Kuangcp/JavaBase
94fafa8d4bde1e62424cf6abd6ee0a1ceacb6b18
2c1fcf93d8365498ddea5242ef036bd3a01c7d39
refs/heads/master
2023-09-01T08:35:59.248694
2023-08-26T05:48:48
2023-08-26T05:48:48
86,205,415
17
14
MIT
2023-09-04T14:07:40
2017-03-26T03:43:55
Java
UTF-8
Java
false
false
878
java
package com.github.kuangcp.abstractfactory; import com.github.kuangcp.abstractfactory.base.Color; import com.github.kuangcp.abstractfactory.base.Shape; import com.github.kuangcp.abstractfactory.domain.Rectangle; import com.github.kuangcp.abstractfactory.domain.Square; import java.util.Objects; import java.util.Optional; /** * @author kuangcp on 2019-04-07 12:35 AM */ public class ShapeFactory extends AbstractFactory { @Override public Optional<Color> getColor(String color) { return Optional.empty(); } @Override public Optional<Shape> getShape(String shape) { if (Objects.isNull(shape)) { return Optional.empty(); } if (shape.equalsIgnoreCase("RECTANGLE")) { return Optional.of(new Rectangle()); } else if (shape.equalsIgnoreCase("SQUARE")) { return Optional.of(new Square()); } return Optional.empty(); } }
[ "kuangcp@aliyun.com" ]
kuangcp@aliyun.com
a9e8d4c3acd4e0c1b40a5598446e8bfe16144d11
5cbd61c34f79b99724b886d6c140cdfc2235d6e9
/schemacrawler-oracle/src/test/java/schemacrawler/integration/test/TestOracleDistribution.java
54ff9d0683277463865556fd9ae97e3928009c39
[]
no_license
WolfyD/SchemaCrawler
c6be5b3d64720355f5d4bd6dce8da540e16175c7
bd18a81c91f41d989c58442ce067d5b99f0aebf1
refs/heads/master
2020-04-15T14:20:07.540430
2019-01-08T05:10:43
2019-01-08T05:10:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,964
java
/* ======================================================================== SchemaCrawler http://www.schemacrawler.com Copyright (c) 2000-2019, Sualeh Fatehi <sualeh@hotmail.com>. All rights reserved. ------------------------------------------------------------------------ SchemaCrawler 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. SchemaCrawler and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, GNU General Public License v3 or GNU Lesser General Public License v3. You may elect to redistribute this code under any of these licenses. The Eclipse Public License is available at: http://www.eclipse.org/legal/epl-v10.html The GNU General Public License v3 and the GNU Lesser General Public License v3 are available at: http://www.gnu.org/licenses/ ======================================================================== */ package schemacrawler.integration.test; import static org.junit.Assert.assertEquals; import java.sql.Connection; import org.junit.Before; import org.junit.Test; import schemacrawler.schemacrawler.SchemaCrawlerException; import schemacrawler.tools.databaseconnector.DatabaseConnector; import schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry; public class TestOracleDistribution { private DatabaseConnector dbConnector; @Before public void setup() throws SchemaCrawlerException { final DatabaseConnectorRegistry registry = new DatabaseConnectorRegistry(); dbConnector = registry.lookupDatabaseConnector("oracle"); } @Test public void testIdentifierQuoteString() throws Exception { final Connection connection = null; assertEquals("", dbConnector .getSchemaRetrievalOptionsBuilder(connection) .toOptions().getIdentifierQuoteString()); } }
[ "sualeh@hotmail.com" ]
sualeh@hotmail.com
8787e1dbf63318e7876a50269462af3ba3e4f7da
93249ac332c0f24bf7642caa21f27058ba99189b
/applications/plugins/org.csstudio.scan.ui.scantree/src/org/csstudio/scan/ui/scantree/gui/Perspective.java
36b21542cdbb585b74d0e63f502c78856a3a5812
[]
no_license
crispd/cs-studio
0678abd0db40f024fbae4420eeda87983f109382
32dd49d1eb744329dc1083b4ba30b65155000ffd
refs/heads/master
2021-01-17T23:59:55.878433
2014-06-20T17:55:02
2014-06-20T17:55:02
21,135,201
1
0
null
null
null
null
UTF-8
Java
false
false
3,522
java
/******************************************************************************* * Copyright (c) 2011 Oak Ridge National Laboratory. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html ******************************************************************************/ package org.csstudio.scan.ui.scantree.gui; import org.csstudio.scan.ui.ScanUIActivator; import org.eclipse.ui.IFolderLayout; import org.eclipse.ui.IPageLayout; import org.eclipse.ui.IPerspectiveFactory; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.WorkbenchException; /** Scan Tree editor perspective * @author Kay Kasemir */ @SuppressWarnings("nls") public class Perspective implements IPerspectiveFactory { /** Perspective ID defined in plugin.xml */ final public static String ID = "org.csstudio.scan.ui.scantree.perspective"; /** ID of console view */ final private static String ID_CONSOLE = "org.eclipse.ui.console.ConsoleView"; /** Try to switch to the DataBrowser perspective * @throws WorkbenchException on error */ public static void showPerspective() throws WorkbenchException { final IWorkbench workbench = PlatformUI.getWorkbench(); final IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); workbench.showPerspective(ID, window); } @SuppressWarnings("deprecation") @Override public void createInitialLayout(final IPageLayout layout) { // left | editor | right // | | top // | +------ // +-------------+ right // | bottom | bottom final String editor = layout.getEditorArea(); final IFolderLayout left = layout.createFolder("left", IPageLayout.LEFT, 0.20f, editor); final IFolderLayout right = layout.createFolder("right", IPageLayout.RIGHT, 0.70f, editor); final IFolderLayout bottom = layout.createFolder("bottom", IPageLayout.BOTTOM, 0.75f, editor); final IFolderLayout right_top = layout.createFolder("right_top", IPageLayout.TOP, 0.33f, "right"); // Stuff for 'left' left.addView(IPageLayout.ID_RES_NAV); // Stuff for 'bottom' bottom.addView(ScanUIActivator.ID_SCAN_MONITOR_VIEW); bottom.addView(ID_CONSOLE); bottom.addPlaceholder(ScanUIActivator.ID_SCAN_PLOT_VIEW); bottom.addPlaceholder(ScanUIActivator.ID_SCAN_PLOT_VIEW + ":*"); bottom.addPlaceholder(IPageLayout.ID_PROGRESS_VIEW); // Stuff for 'right_top' right_top.addView(CommandListView.ID); // Stuff for 'right' (bottom) right.addView(IPageLayout.ID_PROP_SHEET); // Populate the "Window/Views..." menu with suggested views layout.addShowViewShortcut(IPageLayout.ID_RES_NAV); layout.addShowViewShortcut(CommandListView.ID); layout.addShowViewShortcut(ScanUIActivator.ID_SCAN_MONITOR_VIEW); layout.addShowViewShortcut(ScanUIActivator.ID_SCAN_PLOT_VIEW); layout.addShowViewShortcut(IPageLayout.ID_PROP_SHEET); layout.addShowViewShortcut(IPageLayout.ID_PROGRESS_VIEW); layout.addShowViewShortcut(ID_CONSOLE); } }
[ "kasemirk@ornl.gov" ]
kasemirk@ornl.gov
0336895c254d9204d1b7b5fb0ac01a8775c93ba7
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_380f14e229e53866a9bc3b7eba4babf00ff74872/SignInteractListener/16_380f14e229e53866a9bc3b7eba4babf00ff74872_SignInteractListener_t.java
a9217fa5035a4e32da88c14050851e0db88bc760
[]
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
5,278
java
package net.croxis.plugins.civilmineation; import net.croxis.plugins.civilmineation.components.PlotComponent; import net.croxis.plugins.civilmineation.components.ResidentComponent; import net.croxis.plugins.civilmineation.components.SignComponent; import net.croxis.plugins.research.TechManager; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.Sign; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; public class SignInteractListener implements Listener{ @EventHandler public void onBlockInteract(PlayerInteractEvent event){ //Left click is click, Right click is cycle //Debug lines to see what the null error is from //error is right clicking bottom block if (event.getClickedBlock() == null){ return; } event.getClickedBlock(); event.getClickedBlock().getType(); if (event.getClickedBlock().getType().equals(Material.WALL_SIGN) || event.getClickedBlock().getType().equals(Material.SIGN) || event.getClickedBlock().getType().equals(Material.SIGN_POST)){ if (event.getAction().equals(Action.LEFT_CLICK_BLOCK)){ Sign sign = (Sign) event.getClickedBlock().getState(); PlotComponent plot = CivAPI.getPlot(event.getClickedBlock().getChunk()); SignComponent signComp = CivAPI.getSign(event.getClickedBlock()); Civilmineation.logDebug("a"); if (plot.getCity() == null || signComp == null) return; Civilmineation.logDebug("b"); if(signComp.getType() == SignType.PLOT_INFO){ Civilmineation.logDebug("c"); if(sign.getLine(2).equalsIgnoreCase("=For Sale=")){ Civilmineation.logDebug("d"); ResidentComponent resident = CivAPI.getResident(event.getPlayer()); double price = 0; try{ price = Double.parseDouble(sign.getLine(3)); } catch (NumberFormatException e) { event.getPlayer().sendMessage("Bad price value. Try a new [sell] sign."); event.setCancelled(true); return; } if (!TechManager.hasTech(event.getPlayer().getName(), "Currency")){ event.getPlayer().sendMessage("You need to learn currency before being able to buy."); event.setCancelled(true); return; } //TODO: Add exception for embasee plots if (!plot.getCity().getName().equalsIgnoreCase(resident.getCity().getName())){ event.getPlayer().sendMessage("Not member of city."); event.setCancelled(true); return; } if (CivAPI.econ.getBalance(event.getPlayer().getName()) < price){ event.getPlayer().sendMessage("Not enough money."); event.setCancelled(true); return; } CivAPI.econ.withdrawPlayer(event.getPlayer().getName(), price); if(plot.getResident() == null){ CivAPI.econ.depositPlayer(plot.getCity().getName(), price); } else { CivAPI.econ.depositPlayer(plot.getResident().getName(), price); } plot.setResident(resident); plot.setName(resident.getName()); CivAPI.plugin.getDatabase().save(plot); sign.setLine(2, ""); sign.setLine(3, ""); sign.update(); CivAPI.updatePlotSign(plot); return; } } else if (signComp.getType() == SignType.DEMOGRAPHICS){ if (sign.getLine(3).contains("Open")){ ResidentComponent resident = CivAPI.getResident(event.getPlayer()); if (CivAPI.addResident(resident, plot.getCity())) CivAPI.broadcastToCity("Welcome " + resident.getName() + " to our city!", plot.getCity()); } } } else if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK)){ if (event.getClickedBlock().getType().equals(Material.WALL_SIGN)){ Sign sign = (Sign) event.getClickedBlock().getState(); ResidentComponent resident = CivAPI.getResident(event.getPlayer()); SignComponent signComp = CivAPI.getSign(event.getClickedBlock()); if (signComp == null) return; if (signComp.getType() == SignType.DEMOGRAPHICS){ Civilmineation.logDebug("Demographics update click"); PlotComponent plot = CivAPI.getPlot(event.getClickedBlock().getChunk()); if (plot.getCity() == null){ Civilmineation.logDebug("b"); return; } if (resident.getCity() == null){ Civilmineation.logDebug("c"); return; } if (!plot.getCity().getName().equalsIgnoreCase(resident.getCity().getName())){ Civilmineation.logDebug("d"); Civilmineation.log(plot.getCity().getName()); Civilmineation.log(resident.getCity().getName()); return; } if (resident.isMayor() || resident.isCityAssistant()){ if (sign.getLine(3).contains("Open")) { sign.setLine(3, ChatColor.RED + "Closed"); sign.update(); } else { sign.setLine(3, ChatColor.GREEN + "Open"); sign.update(); } } } else if (signComp.getType() == SignType.CITY_CHARTER && (resident.isMayor() || resident.isCityAssistant())){ CivAPI.updateCityCharter(CivAPI.getCity(signComp.getEntityID())); } } } } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
c2c11afe1b3a685ace8f1c37590bfa091a6c93d0
0609f8042394cdbeed3c28640fd1497a37b70da8
/app/src/main/java/com/fanyafeng/recreation/refreshview/XWebView.java
297b416c7527037794f1ee4403dc40f60a0fc1f8
[]
no_license
mrscolove/Recreation
70d3654b2b883f43e5a5cb730cb3b4321f54b927
23c8fa3d3dd4b3ab397968375dbce9ffc6365777
refs/heads/master
2021-06-14T22:16:40.867664
2017-03-29T09:57:33
2017-03-29T09:57:33
null
0
0
null
null
null
null
UTF-8
Java
false
false
855
java
package com.fanyafeng.recreation.refreshview; import android.content.Context; import android.util.AttributeSet; import android.webkit.WebView; public class XWebView extends WebView { private OnScrollBottomListener _listener; private int _calCount; public interface OnScrollBottomListener { void srollToBottom(); } public void registerOnBottomListener(OnScrollBottomListener l) { _listener = l; } public void unRegisterOnBottomListener() { _listener = null; } public XWebView(Context context, AttributeSet attrs) { super(context, attrs); } @Override protected void onScrollChanged(int l, int t, int oldl, int oldt) { if (this.getHeight() + this.getScrollY() == getHeight()) { _calCount++; if (_calCount == 1) { if (_listener != null) { _listener.srollToBottom(); } } } else { _calCount = 0; } } }
[ "fanyafeng@365rili.com" ]
fanyafeng@365rili.com
da390b461ee51f8d4a02b1c0cfb3ddba8c26a7f1
7f298c2bf9ff5a61eeb87e3929e072c9a04c8832
/spring-test/src/main/java/org/springframework/test/web/servlet/result/HeaderResultMatchers.java
a19933de3477441fa94bd982d0f9ad800bac3807
[ "Apache-2.0" ]
permissive
stwen/my-spring5
1ca1e85786ba1b5fdb90a583444a9c030fe429dd
d44be68874b8152d32403fe87c39ae2a8bebac18
refs/heads/master
2023-02-17T19:51:32.686701
2021-01-15T05:39:14
2021-01-15T05:39:14
322,756,105
0
0
null
null
null
null
UTF-8
Java
false
false
5,137
java
/* * Copyright 2002-2018 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.test.web.servlet.result; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Locale; import java.util.TimeZone; import org.hamcrest.Matcher; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.test.web.servlet.ResultMatcher; import static org.hamcrest.MatcherAssert.*; import static org.springframework.test.util.AssertionErrors.*; /** * Factory for response header assertions. * * <p>An instance of this class is available via * {@link MockMvcResultMatchers#header}. * * @author Rossen Stoyanchev * @author Sam Brannen * @author Brian Clozel * @since 3.2 */ public class HeaderResultMatchers { /** * Protected constructor. * See {@link MockMvcResultMatchers#header()}. */ protected HeaderResultMatchers() { } /** * Assert the primary value of the response header with the given Hamcrest * String {@code Matcher}. */ public ResultMatcher string(final String name, final Matcher<? super String> matcher) { return result -> assertThat("Response header '" + name + "'", result.getResponse().getHeader(name), matcher); } /** * Assert the values of the response header with the given Hamcrest * Iterable {@link Matcher}. * * @since 4.3 */ public <T> ResultMatcher stringValues(final String name, final Matcher<Iterable<String>> matcher) { return result -> { List<String> values = result.getResponse().getHeaders(name); assertThat("Response header '" + name + "'", values, matcher); }; } /** * Assert the primary value of the response header as a String value. */ public ResultMatcher string(final String name, final String value) { return result -> assertEquals("Response header '" + name + "'", value, result.getResponse().getHeader(name)); } /** * Assert the values of the response header as String values. * * @since 4.3 */ public ResultMatcher stringValues(final String name, final String... values) { return result -> { List<Object> actual = result.getResponse().getHeaderValues(name); assertEquals("Response header '" + name + "'", Arrays.asList(values), actual); }; } /** * Assert that the named response header exists. * * @since 5.0.3 */ public ResultMatcher exists(final String name) { return result -> assertTrue("Response should contain header '" + name + "'", result.getResponse().containsHeader(name)); } /** * Assert that the named response header does not exist. * * @since 4.0 */ public ResultMatcher doesNotExist(final String name) { return result -> assertTrue("Response should not contain header '" + name + "'", !result.getResponse().containsHeader(name)); } /** * Assert the primary value of the named response header as a {@code long}. * <p>The {@link ResultMatcher} returned by this method throws an * {@link AssertionError} if the response does not contain the specified * header, or if the supplied {@code value} does not match the primary value. */ public ResultMatcher longValue(final String name, final long value) { return result -> { MockHttpServletResponse response = result.getResponse(); assertTrue("Response does not contain header '" + name + "'", response.containsHeader(name)); String headerValue = response.getHeader(name); if (headerValue != null) { assertEquals("Response header '" + name + "'", value, Long.parseLong(headerValue)); } }; } /** * Assert the primary value of the named response header as a date String, * using the preferred date format described in RFC 7231. * <p>The {@link ResultMatcher} returned by this method throws an * {@link AssertionError} if the response does not contain the specified * header, or if the supplied {@code value} does not match the primary value. * * @see <a href="https://tools.ietf.org/html/rfc7231#section-7.1.1.1">Section 7.1.1.1 of RFC 7231</a> * @since 4.2 */ public ResultMatcher dateValue(final String name, final long value) { return result -> { SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US); format.setTimeZone(TimeZone.getTimeZone("GMT")); String formatted = format.format(new Date(value)); MockHttpServletResponse response = result.getResponse(); assertTrue("Response does not contain header '" + name + "'", response.containsHeader(name)); assertEquals("Response header '" + name + "'", formatted, response.getHeader(name)); }; } }
[ "xianhao_gan@qq.com" ]
xianhao_gan@qq.com
17d04180beb6a555bc5114972873b7956e47b645
5b82e2f7c720c49dff236970aacd610e7c41a077
/QueryReformulation-master 2/data/processed/ParseException.java
62c9d2e1a2949cb90350c315c4dac6ecbcf9e312
[]
no_license
shy942/EGITrepoOnlineVersion
4b157da0f76dc5bbf179437242d2224d782dd267
f88fb20497dcc30ff1add5fe359cbca772142b09
refs/heads/master
2021-01-20T16:04:23.509863
2016-07-21T20:43:22
2016-07-21T20:43:22
63,737,385
0
0
null
null
null
null
UTF-8
Java
false
false
828
java
/***/ package org.eclipse.ui.keys; /** * <p> * An exception indicating problems while parsing formal string representations * of either <code>KeyStroke</code> or <code>KeySequence</code> objects. * </p> * <p> * <code>ParseException</code> objects are immutable. Clients are not * permitted to extend this class. * </p> * * @deprecated Please use org.eclipse.jface.bindings.keys.ParseException * @since 3.0 */ @Deprecated public final class ParseException extends Exception { /** * Generated serial version UID for this class. * @since 3.1 */ private static final long serialVersionUID = 3257009864814376241L; /** * Constructs a <code>ParseException</code> with the specified detail * message. * * @param s * the detail message. */ public ParseException(final String s) { super(s); } }
[ "muktacseku@gmail.com" ]
muktacseku@gmail.com
fe893dc2c6fc933560c7138ac28995163f90b2ae
3a5985651d77a31437cfdac25e594087c27e93d6
/ojc-core/component-common/component/src/com/sun/jbi/management/message/JBITaskMessageBuilder.java
a823eddbbdc0423a8d54d4d25ca0b7076b7b2655
[]
no_license
vitalif/openesb-components
a37d62133d81edb3fdc091abd5c1d72dbe2fc736
560910d2a1fdf31879e3d76825edf079f76812c7
refs/heads/master
2023-09-04T14:40:55.665415
2016-01-25T13:12:22
2016-01-25T13:12:33
48,222,841
0
5
null
null
null
null
UTF-8
Java
false
false
5,246
java
/* * BEGIN_HEADER - DO NOT EDIT * * The contents of this file are subject to the terms * of the Common Development and Distribution License * (the "License"). You may not use this file except * in compliance with the License. * * You can obtain a copy of the license at * https://open-jbi-components.dev.java.net/public/CDDLv1.0.html. * See the License for the specific language governing * permissions and limitations under the License. * * When distributing Covered Code, include this CDDL * HEADER in each file and include the License file at * https://open-jbi-components.dev.java.net/public/CDDLv1.0.html. * If applicable add the following below this CDDL HEADER, * with the fields enclosed by brackets "[]" replaced with * your own identifying information: Portions Copyright * [year] [name of copyright owner] */ /* * @(#)JBITaskMessageBuilder.java * * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved. * * END_HEADER - DO NOT EDIT */ package com.sun.jbi.management.message; import javax.jbi.management.DeploymentException; public interface JBITaskMessageBuilder { // Message types /* * Task status message type: <code>NONE</code> */ public static final int NONE = 0; /* * Task status message type: <code>INFO</code> */ public static final int INFO = 1; /* * Task status message type: <code>WARNING</code> */ public static final int WARNING = 2; /* * Task status message type: <code>ERROR</code> */ public static final int ERROR = 3; /** * Set the component name to be used by this message builder for * <component-task-result> elements. * * @param componentName The component name to be used * * @throws NullPointerException If the given component name is null */ public void setComponentName(String componentName); public String createSuccessMessage(String taskId); public String createSuccessMessage(String taskId, String locToken, String locMessage, Object locParam); public String createSuccessMessage(String taskId, String locToken, String locMessage, Object[] locParam); public String createExceptionMessage(String taskId, String locToken, String locMessage, Object locParam, Throwable throwable); public String createExceptionMessage(String taskId, String locToken, String locMessage, Object locParam); public String createExceptionMessage(String taskId, String locToken, String locMessage, Object[] locParam, Throwable throwable); public String createExceptionMessage(String taskId, String locToken, String locMessage, Object[] locParam); public void throwException(String taskId, String locToken, String locMessage, Object locParam, Throwable throwable) throws DeploymentException; public void throwException(String taskId, String locToken, String locMessage, Object locParam) throws DeploymentException; public void throwException(String taskId, String locToken, String locMessage, Object[] locParam, Throwable throwable) throws DeploymentException; public void throwException(String taskId, String locToken, String locMessage, Object[] locParam) throws DeploymentException; public String createComponentMessage( String taskId, boolean success, int messageType, String locToken, String locMessage, Object[] locParam, Throwable throwable) throws JBIMessageException; public ComponentTaskResult createComponentTaskResult( String taskId, boolean success, int messageType, String locToken, String locMessage, Object[] locParam, Throwable throwable) throws JBIMessageException; }
[ "bitbucket@bitbucket02.private.bitbucket.org" ]
bitbucket@bitbucket02.private.bitbucket.org
b99249a1fba1d405ecb228e5539e2a4c37962bfe
c20c3cb1699f726fc285a6917d0ee673915f5b06
/RSFallingSnow/src/com/aaron/fallsnow/FallingSnow.java
9121c6c9b108a2d4a4dbe9c57a60a8b18eeee2b3
[ "Apache-2.0" ]
permissive
zoozooll/MyExercise
35a18c0ead552d5be45f627066a5066f6cc8c99b
1be14e0252babb28e32951fa1e35fc867a6ac070
refs/heads/master
2023-04-04T04:24:14.275531
2021-04-18T15:01:03
2021-04-18T15:01:03
108,665,215
2
0
null
null
null
null
UTF-8
Java
false
false
1,000
java
package com.aaron.fallsnow; import android.app.Activity; import android.os.Bundle; import android.renderscript.RSSurfaceView; import android.util.Log; import android.view.View; public class FallingSnow extends Activity { private RSSurfaceView mRootView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.grid_outside); mRootView = (RSSurfaceView) findViewById(R.id.view_fallingsnow); } @Override protected void onResume() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus super.onResume(); mRootView.resume(); } @Override protected void onPause() { // Ideally a game should implement onResume() and onPause() // to take appropriate action when the activity looses focus super.onPause(); mRootView.pause(); Runtime.getRuntime().exit(0); } }
[ "kangkang365@gmail.com" ]
kangkang365@gmail.com
2c28f5ea3234c4e58540b78d8b8c31acd3f1f01a
8ccd1c071b19388f1f2e92c5e5dbedc78fead327
/src/main/java/ohos/agp/render/PathEffect.java
8091bed904905f043d7561d0d2e7cda7f990d7bc
[]
no_license
yearsyan/Harmony-OS-Java-class-library
d6c135b6a672c4c9eebf9d3857016995edeb38c9
902adac4d7dca6fd82bb133c75c64f331b58b390
refs/heads/main
2023-06-11T21:41:32.097483
2021-06-24T05:35:32
2021-06-24T05:35:32
379,816,304
6
3
null
null
null
null
UTF-8
Java
false
false
3,435
java
package ohos.agp.render; import ohos.agp.utils.MemoryCleanerRegistry; import ohos.agp.utils.NativeMemoryCleanerHelper; public class PathEffect { private PathEffect mInnerPathEffect; private long mNativePathEffectHandle = 0; private PathEffect mOuterPathEffect; private Path mShape; private native long nativeGet1DPathEffectHandle(long j, float f, float f2, int i); private native long nativeGetComposePathEffectHandle(long j, long j2); private native long nativeGetCornerPathEffectHandle(float f); private native long nativeGetDashPathEffectHandle(float[] fArr, int i, float f); private native long nativeGetDiscretePathEffectHandle(float f, float f2); public enum Style { TRANSLATE_STYLE(0), ROTATE_STYLE(1), MORPH_STYLE(2); final int enumInt; private Style(int i) { this.enumInt = i; } public int value() { return this.enumInt; } } public PathEffect(float[] fArr, float f) { if (fArr.length % 2 == 0 && fArr.length >= 2) { this.mNativePathEffectHandle = nativeGetDashPathEffectHandle(fArr, fArr.length, f); MemoryCleanerRegistry.getInstance().register(this, new PathEffectCleaner(this.mNativePathEffectHandle)); } } public PathEffect(float f) { this.mNativePathEffectHandle = nativeGetCornerPathEffectHandle(f); MemoryCleanerRegistry.getInstance().register(this, new PathEffectCleaner(this.mNativePathEffectHandle)); } public PathEffect(Path path, float f, float f2, Style style) { if (this.mShape != path) { this.mShape = path; } this.mNativePathEffectHandle = nativeGet1DPathEffectHandle(path.getNativeHandle(), f, f2, style.value()); MemoryCleanerRegistry.getInstance().register(this, new PathEffectCleaner(this.mNativePathEffectHandle)); } public PathEffect(float f, float f2) { this.mNativePathEffectHandle = nativeGetDiscretePathEffectHandle(f, f2); MemoryCleanerRegistry.getInstance().register(this, new PathEffectCleaner(this.mNativePathEffectHandle)); } public PathEffect(PathEffect pathEffect, PathEffect pathEffect2) { if (this.mInnerPathEffect != pathEffect2) { this.mInnerPathEffect = pathEffect2; } if (this.mOuterPathEffect != pathEffect) { this.mOuterPathEffect = pathEffect; } this.mNativePathEffectHandle = nativeGetComposePathEffectHandle(pathEffect.getNativeHandle(), pathEffect2.getNativeHandle()); MemoryCleanerRegistry.getInstance().register(this, new PathEffectCleaner(this.mNativePathEffectHandle)); } protected static class PathEffectCleaner extends NativeMemoryCleanerHelper { private native void nativePathEffectRelease(long j); public PathEffectCleaner(long j) { super(j); } /* access modifiers changed from: protected */ @Override // ohos.agp.utils.NativeMemoryCleanerHelper public void releaseNativeMemory(long j) { if (j != 0) { nativePathEffectRelease(j); } } } /* access modifiers changed from: protected */ public long getNativeHandle() { return this.mNativePathEffectHandle; } }
[ "yearsyan@gmail.com" ]
yearsyan@gmail.com
856f675a4c8d6804709e8fc9e75125f68c1ac90a
082e26b011e30dc62a62fae95f375e4f87d9e99c
/docs/weixin_7.0.4_source/反编译源码/反混淆后/src/main/java/com/tencent/p177mm/p230g/p231a/C9391jm.java
be3c703adb91f45223e7302546c719ed505b84cf
[]
no_license
xsren/AndroidReverseNotes
9631a5aabc031006e795a112b7ac756a8edd4385
9202c276fe9f04a978e4e08b08e42645d97ca94b
refs/heads/master
2021-04-07T22:50:51.072197
2019-07-16T02:24:43
2019-07-16T02:24:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
320
java
package com.tencent.p177mm.p230g.p231a; import com.tencent.p177mm.sdk.p600b.C4883b; /* renamed from: com.tencent.mm.g.a.jm */ public final class C9391jm extends C4883b { public C9391jm() { this((byte) 0); } private C9391jm(byte b) { this.xxG = false; this.callback = null; } }
[ "alwangsisi@163.com" ]
alwangsisi@163.com
74a226297ef2aec3de6c269d4ae828e543bdf15f
aca457909ef8c4eb989ba23919de508c490b074a
/DialerJADXDecompile/djp.java
d062e1f131215e135915142fd7dccb12206f3080
[]
no_license
KHikami/ProjectFiCallingDeciphered
bfccc1e1ba5680d32a4337746de4b525f1911969
cc92bf6d4cad16559a2ecbc592503d37a182dee3
refs/heads/master
2021-01-12T17:50:59.643861
2016-12-08T01:20:34
2016-12-08T01:23:04
71,650,754
1
0
null
null
null
null
UTF-8
Java
false
false
959
java
import java.lang.reflect.Array; import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; /* compiled from: PG */ public final class djp { public static final String[] a; public static final Charset b; static { a = new String[0]; b = Charset.forName("UTF-8"); } public static List a(Object... objArr) { return Collections.unmodifiableList(Arrays.asList((Object[]) objArr.clone())); } public static Object[] a(Class cls, Object[] objArr, Object[] objArr2) { List arrayList = new ArrayList(); for (Object obj : objArr) { for (Object obj2 : objArr2) { if (obj.equals(obj2)) { arrayList.add(obj2); break; } } } return arrayList.toArray((Object[]) Array.newInstance(cls, arrayList.size())); } }
[ "chu.rachelh@gmail.com" ]
chu.rachelh@gmail.com
cf1e9d99e5622c2aa2423db84aa16c3dcc52a96d
28c36a3c2e9cc92a93de9e90013ecc4113317ec1
/app/src/main/java/com/aasaanjobs/lightsaber/data/db/realmadapters/RealmStringListAdapter.java
f52c958f8ca8f51ee7a8e76a43e06f65faa28e99
[]
no_license
aasaanjobs/LightSaber
5f985172e01580bdd40c22ffcdd6e0be141a5c81
43b44fe76d2e82c1104f77c64653bc8807da6e8c
refs/heads/master
2021-01-17T20:38:42.096087
2016-07-13T10:50:38
2016-07-13T10:50:38
63,236,761
0
0
null
null
null
null
UTF-8
Java
false
false
1,388
java
package com.aasaanjobs.lightsaber.data.db.realmadapters; import com.aasaanjobs.lightsaber.data.db.tables.RealmString; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import java.io.IOException; import io.realm.RealmList; /** * Created by nazmuddinmavliwala on 21/05/16. */ public class RealmStringListAdapter extends TypeAdapter<RealmList<RealmString>> { @Override public void write(JsonWriter out, RealmList<RealmString> value) throws IOException { try { out.beginArray(); for(RealmString realmString : value) { out.value(realmString.getValue()); } out.endArray(); } catch (Exception e) { e.printStackTrace(); } } @Override public RealmList<RealmString> read(JsonReader in) throws IOException { try { in.beginArray(); RealmList<RealmString> realmStrings = new RealmList<>(); while (in.hasNext()) { RealmString realmString = new RealmString(); realmString.setValue(in.nextString()); realmStrings.add(realmString); } in.endArray(); return realmStrings; } catch (Exception e) { e.printStackTrace(); } return new RealmList<>(); } }
[ "nazmuddinmavliwala@gmail.com" ]
nazmuddinmavliwala@gmail.com
596f34ccb4f806abc40100f453ca7852cca87bfa
8fbffb4dd0adb309c8c1f005b0f64d37451c9d60
/web/src/main/java/com/athleticspot/training/domain/trainingsurvey/TrainingSurveyQueryRepository.java
d01a3ce14450357af0c4f5b1bc6eaf4c6c047953
[]
no_license
athleticspot/athleticspot
1465237f345c9fb4d847f0b10cd2a8b0242de959
d533e6061e1a6b9dbbfa2657db68b94978bfee45
refs/heads/master
2023-01-05T06:14:56.042775
2020-03-13T15:27:42
2020-03-13T15:27:42
97,162,460
0
2
null
2022-12-10T06:35:26
2017-07-13T20:30:45
JavaScript
UTF-8
Java
false
false
259
java
package com.athleticspot.training.domain.trainingsurvey; import org.springframework.data.jpa.repository.JpaRepository; /** * @author Tomasz Kasprzycki */ public interface TrainingSurveyQueryRepository extends JpaRepository<TrainingSurvey, Long> { }
[ "tomkasp@gmail.com" ]
tomkasp@gmail.com
da0ff3e90848270721b285234ea670ed601162d5
e21f10facb5db78e142da6be0e2e3299ef829431
/IDEA_JAVASE/javase/Collection/MapTest01.java
3703b5834d02c1b7cbd4f150d820842e184b65d4
[]
no_license
so1esou1/Learn
5b98cd5285e9bc93fdc70b0542e4aa027e1bd0bf
02405826a973f9a56f0c234cfbf8c59be007be35
refs/heads/master
2023-05-04T02:38:58.810083
2021-05-17T14:29:24
2021-05-17T14:29:24
326,638,883
1
0
null
null
null
null
UTF-8
Java
false
false
2,778
java
package com.bjpowernode.javase.Collection; import java.util.Collection; import java.util.HashMap; import java.util.Map; /* java.util.Map这个接口中常用的方法: 1、Map和Collection没有继承关系 2、Map集合以key和value的方式存储数据:键值对 Key和Value都是引用数据类型 Key和Value都是存储对象的内存地址 Key起到主导的地位,Value是Key的附属品 3、Map接口中常用方法: V put(K key,V value) 向Map集合中添加键值对 V get(Object key) 通过key获取value void clear(); 清空Map集合 boolean containsKey(Object key) 判断Map中是否包含某个Key boolean containsValue(Object value) 判断Map中是否包含某个value boolean isEmpty() 判断Map集合中元素是否为0 Set<K> keySet() 获取Map结合所有的key(所有的键是一个Set集合) V remove(Object key) 通过key删除键值对 int size() 获取Map集合中键值对的个数 Collection<v> values() 获取键值对中所有的value,返回一个Collection Set<Map.Entry<K,V>> entrySet() 将Map集合转换成Set集合(Map集合通过entrySet()转换成的这个Set集合中的元素的类型是Map.Entry<K,V>,Map.Entry类型和String类型一样都是一种类型的名字,只不过Map.Entry是静态内部类,是Map中的静态内部类) */ public class MapTest01 { public static void main(String[] args) { //创建Map集合对象 Map<Integer,String> map = new HashMap<>(); //向Map集合中添加键值对 map.put(1,"zhangsan"); //1在这里进行了自动装箱 map.put(2,"lisi"); map.put(3,"wangwu"); map.put(4,"zhaoliu"); //通过key获取value String value = map.get(2); System.out.println(value); //获取键值对的数量 System.out.println("键值对数量:" + map.size()); //通过key删除键值对value map.remove(2); System.out.println("键值对数量:" + map.size()); //判断是否包含某个key //contains方法底层调用的都是equals方法进行比对的,所以自定义的类型需要重写equals方法 System.out.println(map.containsKey(4)); //判断是否包含某个value System.out.println(map.containsValue("wangwu")); //获取所有的value Collection<String> values = map.values(); for (String s : values){ System.out.println(s); } //清空Map集合 map.clear(); System.out.println("键值对数量:" + map.size()); //判断是否为空 System.out.println(map.isEmpty()); } }
[ "1402916604@qq.com" ]
1402916604@qq.com
8f8ad75d71781cf1387a846ed08d6de1cd601c76
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/DrJava/rev3734-3788/base-trunk-3734/src/edu/rice/cs/drjava/model/repl/DebugEvaluationVisitor.java
617b05fd3797921189e7c2f119c06c9ff7426d64
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
513
java
package edu.rice.cs.drjava.model.repl; import koala.dynamicjava.interpreter.context.*; public class DebugEvaluationVisitor extends EvaluationVisitorExtension { protected Context _context; protected final String _name; public DebugEvaluationVisitor(Context ctx, String name) { super(ctx); _context = ctx; _name = name; } }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
ae623beb46dda1c06ce96d712b66f4eb705e8b11
1cf008cb24753757601e4ca72bf7bfbe75f1f073
/src/com/jsjf/service/member/impl/JsThreeFundSituationServiceImpl.java
9d97fa5bdcd038468f74a3f7ba953fd1973be9af
[]
no_license
lslnx0307/system
22c8d919cf3be1ed40512d297b760663ec45d9cb
85907d6662d405912ca48678dc4c13447120cd21
refs/heads/master
2020-04-08T21:30:18.323733
2018-11-30T00:56:11
2018-11-30T00:56:11
159,746,917
0
0
null
null
null
null
UTF-8
Java
false
false
1,151
java
package com.jsjf.service.member.impl; import java.util.List; import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import com.jsjf.dao.member.JsThreeFundSituationDAO; import com.jsjf.service.member.JsThreeFundSituationService; @Service @Transactional public class JsThreeFundSituationServiceImpl implements JsThreeFundSituationService{ @Autowired JsThreeFundSituationDAO jsThreeFundSituationDAO; @Override public List<Map<String, Object>> getThreeFundSituation(Map<String, Object> map) { return jsThreeFundSituationDAO.getThreeFundSituation(map); } @Override public int getThreeFundSituationCount(Map<String, Object> map) { return jsThreeFundSituationDAO.getThreeFundSituationCount(map); } @Override public Map<String, Object> getThreeFundSituationSum(Map<String, Object> map) { return jsThreeFundSituationDAO.getThreeFundSituationSum(map); } @Override public void updateThreeFundSituation(Map<String, Object> map) { jsThreeFundSituationDAO.updateThreeFundSituation(map); } }
[ "184576454@qq.com" ]
184576454@qq.com
e2f4efb1fb2a73c1b8bd620a870d8cbf284d0ec2
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a014/A014761Test.java
e9262bc3f42f8d0ee01fafe2203d7f67e513c5cd
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a014; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A014761Test extends AbstractSequenceTest { }
[ "sairvin@gmail.com" ]
sairvin@gmail.com
4c9e1c1544ce33d83fd0489330d44893d9fcb63a
0444b9e1ccafb89e2133a90e1cbf5b5ce7691e83
/src/main/java/kfs/mailingservice/tools/MailFooterAttachList.java
32c3a55872d7a80e665a12e2babe37f506afabb1
[]
no_license
k0fis/KfsMailingService
318a3f83bebb953b30ebe5fcb93cc0998b548754
d28cb6977465098e93a6fdd5bd1f034a9aa391ca
refs/heads/master
2021-01-10T20:49:19.542984
2015-10-01T07:26:16
2015-10-01T07:26:16
42,913,980
0
0
null
null
null
null
UTF-8
Java
false
false
4,643
java
package kfs.mailingservice.tools; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; import com.vaadin.ui.Table; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; import java.lang.reflect.Field; import java.util.List; import kfs.kfsvaalib.comps.KfsButton; import kfs.kfsvaalib.comps.KfsButtonConfirm; import kfs.kfsvaalib.kfsTable.KfsTable; import kfs.kfsvaalib.kfsTable.Pos; import kfs.kfsvaalib.listener.KfsButtonClickListener; import kfs.kfsvaalib.listener.KfsButtonConfirmCallback; import kfs.kfsvaalib.utils.KfsI18n; import kfs.kfsvaalib.utils.KfsRefresh; import kfs.mailingservice.domain.MailAttach; import kfs.mailingservice.domain.MailFooterAttach; /** * * @author pavedrim */ public class MailFooterAttachList extends VerticalLayout implements KfsRefresh, KfsTable.TableGeneratorFactory, Table.ColumnGenerator { private final KfsTable<MailFooterAttach> table; private final MailFooterAttachDlg editDlg; private final BeanItemContainer<MailFooterAttach> cont; private final String editLabel; private final String delLabel; private final String delTitleLabel; private final String delQuestionLabel; private final String delYesLabel; private final String delNoLabel; private final UI ui; public MailFooterAttachList(UI ui, KfsI18n i18n) { this(ui, i18n, new MailFooterAttachDlg(ui, i18n), "MailAttachList", "MailAttachList"); } public MailFooterAttachList(UI ui, KfsI18n i18n, MailFooterAttachDlg edit, String tableName, String i18nPrefix) { this.ui = ui; this.editDlg = edit; this.editLabel = i18n.getMsg(i18nPrefix + ".edit"); this.delLabel = i18n.getMsg(i18nPrefix + ".del"); this.delTitleLabel = i18n.getMsg(i18nPrefix + ".delTitle"); this.delQuestionLabel = i18n.getMsg(i18nPrefix + ".delQuestion"); this.delYesLabel = i18n.getMsg(i18nPrefix + ".delYes"); this.delNoLabel = i18n.getMsg(i18nPrefix + ".delNo"); this.cont = new BeanItemContainer<>(MailFooterAttach.class); addComponents( new Button(i18n.getMsg(i18nPrefix + ".add"), new KfsButtonClickListener(this, "newClick")), (table = new KfsTable<>(tableName, i18n, MailFooterAttach.class, i18n.getMsg(i18nPrefix + ".title"), cont, null, this)) ); table.setWidth("100%"); table.setHeight("250px"); setSpacing(true); setMargin(true); } public void show(List<MailFooterAttach> lst) { cont.removeAllItems(); cont.addAll(lst); } @Override public Table.ColumnGenerator getColumnGenerator(Class type, Field field, Pos pos) { if ((type == MailFooterAttach.class) && ((field.getName().equals("id")) || (field.getName().equals("attach")))) { return this; } return null; } @Override public Object generateCell(Table source, Object itemId, Object columnId) { MailFooterAttach ku = (MailFooterAttach) itemId; if ("name".equals(columnId)) { return new Label(ku.getAttach().getAttachName() + " " + ku.getAttach().getContentId()); } else if ("id0".equals(columnId)) { Button edit = new KfsButton<>(editLabel, ku, new KfsButtonClickListener(this, "editClick")); edit.addStyleName("small"); Button del = new KfsButtonConfirm(delLabel, ui, delTitleLabel, delQuestionLabel, delYesLabel, delNoLabel, new KfsButtonConfirmCallback(this, "delClick"), null, null, null, ku); del.addStyleName("small"); HorizontalLayout hl = new HorizontalLayout(edit, del); return hl; } return null; } public void newClick(Button.ClickEvent event) { if (editDlg != null) { MailFooterAttach ma = new MailFooterAttach(); ma.setAttach(new MailAttach()); cont.addItem(ma); editDlg.show(ma, this); } } public List<MailFooterAttach> getMailFooterAttach() { return cont.getItemIds(); } public void editClick(Button.ClickEvent event) { if (editDlg != null) { editDlg.show(((KfsButton<MailFooterAttach>) event.getButton()).getButtonData(), this); } } public void delClick(MailFooterAttach ma) { if (ma != null) { cont.removeItem(ma); } } @Override public void kfsRefresh() { table.refreshRowCache(); } }
[ "k0fis@me.com" ]
k0fis@me.com
64e3fc44a99051273887b22e335bf1645053a5b3
b4a5fd9d902b7591c063cbf0c99e89911d2b1dda
/entirej-tabris/src/org/entirej/applicationframework/tmt/renderers/item/EJTMTTextAreaRenderer.java
8243817bf272890fc9632e49a451dce8a4f97365
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
entirej/tabris
71617c08394f38651a3be4ccfe29d74609ce8e71
326c559a0a99ce3b7b93cd85aeb23b2fa7c072b5
refs/heads/master
2021-01-17T01:24:56.479201
2014-09-04T08:17:45
2014-09-04T08:17:45
18,593,578
0
0
null
null
null
null
UTF-8
Java
false
false
1,637
java
/******************************************************************************* * Copyright 2013 Mojave Innovations GmbH * * 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. * * Contributors: * Mojave Innovations GmbH - initial API and implementation ******************************************************************************/ package org.entirej.applicationframework.tmt.renderers.item; import org.eclipse.swt.SWT; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Text; import org.entirej.applicationframework.tmt.renderers.item.definition.interfaces.EJTMTTextItemRendererDefinitionProperties; public class EJTMTTextAreaRenderer extends EJTMTTextItemRenderer { @Override protected Text newTextField(Composite composite, int style) { if (_rendererProps.getBooleanProperty(EJTMTTextItemRendererDefinitionProperties.PROPERTY_WRAP, false)) { style = style | SWT.MULTI | SWT.WRAP; } else { style = style | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL; } return super.newTextField(composite, style); } }
[ "theanuradha@gmail.com" ]
theanuradha@gmail.com
9512901d9f71faeb856eaedb30fdb5b57ae7a1f4
7e43011c818cd95460e02930bec0981b65d032c7
/src/main/java/com/github/badoualy/telegram/tl/api/request/TLRequestMessagesSendInlineBotResult.java
4beafd050161aed0cc8d776fdcfc13081eb980c9
[ "MIT" ]
permissive
shahrivari/kotlogram
48faef9ff5cf1695c18cf02fb4fb3ed8edcc571e
2281523c2a99692087bdcf6b2034bca6b2dc645c
refs/heads/master
2020-09-07T11:37:15.597377
2019-11-10T12:18:56
2019-11-10T12:18:56
220,767,354
0
2
MIT
2019-11-10T09:20:24
2019-11-10T09:20:23
null
UTF-8
Java
false
false
6,379
java
package com.github.badoualy.telegram.tl.api.request; import com.github.badoualy.telegram.tl.TLContext; import com.github.badoualy.telegram.tl.api.TLAbsInputPeer; import com.github.badoualy.telegram.tl.api.TLAbsUpdates; import com.github.badoualy.telegram.tl.core.TLMethod; import com.github.badoualy.telegram.tl.core.TLObject; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import static com.github.badoualy.telegram.tl.StreamUtils.readInt; import static com.github.badoualy.telegram.tl.StreamUtils.readLong; import static com.github.badoualy.telegram.tl.StreamUtils.readTLObject; import static com.github.badoualy.telegram.tl.StreamUtils.readTLString; import static com.github.badoualy.telegram.tl.StreamUtils.writeInt; import static com.github.badoualy.telegram.tl.StreamUtils.writeLong; import static com.github.badoualy.telegram.tl.StreamUtils.writeString; import static com.github.badoualy.telegram.tl.StreamUtils.writeTLObject; import static com.github.badoualy.telegram.tl.TLObjectUtils.SIZE_CONSTRUCTOR_ID; import static com.github.badoualy.telegram.tl.TLObjectUtils.SIZE_INT32; import static com.github.badoualy.telegram.tl.TLObjectUtils.SIZE_INT64; import static com.github.badoualy.telegram.tl.TLObjectUtils.computeTLStringSerializedSize; /** * @author Yannick Badoual yann.badoual@gmail.com * @see <a href="http://github.com/badoualy/kotlogram">http://github.com/badoualy/kotlogram</a> */ public class TLRequestMessagesSendInlineBotResult extends TLMethod<TLAbsUpdates> { public static final int CONSTRUCTOR_ID = 0xb16e06fe; protected int flags; protected boolean silent; protected boolean background; protected boolean clearDraft; protected TLAbsInputPeer peer; protected Integer replyToMsgId; protected long randomId; protected long queryId; protected String id; private final String _constructor = "messages.sendInlineBotResult#b16e06fe"; public TLRequestMessagesSendInlineBotResult() { } public TLRequestMessagesSendInlineBotResult(boolean silent, boolean background, boolean clearDraft, TLAbsInputPeer peer, Integer replyToMsgId, long randomId, long queryId, String id) { this.silent = silent; this.background = background; this.clearDraft = clearDraft; this.peer = peer; this.replyToMsgId = replyToMsgId; this.randomId = randomId; this.queryId = queryId; this.id = id; } @Override @SuppressWarnings({"unchecked", "SimplifiableConditionalExpression"}) public TLAbsUpdates deserializeResponse(InputStream stream, TLContext context) throws IOException { final TLObject response = readTLObject(stream, context); if (response == null) { throw new IOException("Unable to parse response"); } if (!(response instanceof TLAbsUpdates)) { throw new IOException( "Incorrect response type, expected " + getClass().getCanonicalName() + ", found " + response .getClass().getCanonicalName()); } return (TLAbsUpdates) response; } private void computeFlags() { flags = 0; flags = silent ? (flags | 32) : (flags & ~32); flags = background ? (flags | 64) : (flags & ~64); flags = clearDraft ? (flags | 128) : (flags & ~128); flags = replyToMsgId != null ? (flags | 1) : (flags & ~1); } @Override public void serializeBody(OutputStream stream) throws IOException { computeFlags(); writeInt(flags, stream); writeTLObject(peer, stream); if ((flags & 1) != 0) { if (replyToMsgId == null) throwNullFieldException("replyToMsgId", flags); writeInt(replyToMsgId, stream); } writeLong(randomId, stream); writeLong(queryId, stream); writeString(id, stream); } @Override @SuppressWarnings({"unchecked", "SimplifiableConditionalExpression"}) public void deserializeBody(InputStream stream, TLContext context) throws IOException { flags = readInt(stream); silent = (flags & 32) != 0; background = (flags & 64) != 0; clearDraft = (flags & 128) != 0; peer = readTLObject(stream, context, TLAbsInputPeer.class, -1); replyToMsgId = (flags & 1) != 0 ? readInt(stream) : null; randomId = readLong(stream); queryId = readLong(stream); id = readTLString(stream); } @Override public int computeSerializedSize() { computeFlags(); int size = SIZE_CONSTRUCTOR_ID; size += SIZE_INT32; size += peer.computeSerializedSize(); if ((flags & 1) != 0) { if (replyToMsgId == null) throwNullFieldException("replyToMsgId", flags); size += SIZE_INT32; } size += SIZE_INT64; size += SIZE_INT64; size += computeTLStringSerializedSize(id); return size; } @Override public String toString() { return _constructor; } @Override public int getConstructorId() { return CONSTRUCTOR_ID; } public boolean getSilent() { return silent; } public void setSilent(boolean silent) { this.silent = silent; } public boolean getBackground() { return background; } public void setBackground(boolean background) { this.background = background; } public boolean getClearDraft() { return clearDraft; } public void setClearDraft(boolean clearDraft) { this.clearDraft = clearDraft; } public TLAbsInputPeer getPeer() { return peer; } public void setPeer(TLAbsInputPeer peer) { this.peer = peer; } public Integer getReplyToMsgId() { return replyToMsgId; } public void setReplyToMsgId(Integer replyToMsgId) { this.replyToMsgId = replyToMsgId; } public long getRandomId() { return randomId; } public void setRandomId(long randomId) { this.randomId = randomId; } public long getQueryId() { return queryId; } public void setQueryId(long queryId) { this.queryId = queryId; } public String getId() { return id; } public void setId(String id) { this.id = id; } }
[ "yann.badoual@gmail.com" ]
yann.badoual@gmail.com
37f5831d40f126adfb31c29eb47fd795f37b9e16
831bd2b13e62678b4057d98c0083e96eab90c69d
/src/main/java/com/cloudmersive/client/model/RemoveDocxHeadersAndFootersResponse.java
4543e7fb60fd4fccdee567d1e4c98ebb71e7fcaf
[ "Apache-2.0" ]
permissive
Cloudmersive/Cloudmersive.APIClient.Java
af52d5db6484f2bbe6f1ea89952023307c436ccf
3e8a2705bb77c641fce1f7afe782a583c4956411
refs/heads/master
2023-06-16T04:56:47.149667
2023-06-03T22:52:39
2023-06-03T22:52:39
116,770,125
14
5
Apache-2.0
2022-05-20T20:51:05
2018-01-09T05:28:25
Java
UTF-8
Java
false
false
3,831
java
/* * convertapi * Convert API lets you effortlessly convert file formats and types. * * OpenAPI spec version: v1 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.cloudmersive.client.model; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; /** * Result of running a Remove Headers and Footers command */ @ApiModel(description = "Result of running a Remove Headers and Footers command") @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2023-06-03T15:49:38.314-07:00") public class RemoveDocxHeadersAndFootersResponse { @SerializedName("Successful") private Boolean successful = null; @SerializedName("EditedDocumentURL") private String editedDocumentURL = null; public RemoveDocxHeadersAndFootersResponse successful(Boolean successful) { this.successful = successful; return this; } /** * True if successful, false otherwise * @return successful **/ @ApiModelProperty(value = "True if successful, false otherwise") public Boolean isSuccessful() { return successful; } public void setSuccessful(Boolean successful) { this.successful = successful; } public RemoveDocxHeadersAndFootersResponse editedDocumentURL(String editedDocumentURL) { this.editedDocumentURL = editedDocumentURL; return this; } /** * URL of the resulting edited document; this is a secure URL and cannot be downloaded without adding the Apikey header; it is also temporary, stored in an in-memory cache and will be deleted. Call Finish-Editing to get the result document contents. * @return editedDocumentURL **/ @ApiModelProperty(value = "URL of the resulting edited document; this is a secure URL and cannot be downloaded without adding the Apikey header; it is also temporary, stored in an in-memory cache and will be deleted. Call Finish-Editing to get the result document contents.") public String getEditedDocumentURL() { return editedDocumentURL; } public void setEditedDocumentURL(String editedDocumentURL) { this.editedDocumentURL = editedDocumentURL; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } RemoveDocxHeadersAndFootersResponse removeDocxHeadersAndFootersResponse = (RemoveDocxHeadersAndFootersResponse) o; return Objects.equals(this.successful, removeDocxHeadersAndFootersResponse.successful) && Objects.equals(this.editedDocumentURL, removeDocxHeadersAndFootersResponse.editedDocumentURL); } @Override public int hashCode() { return Objects.hash(successful, editedDocumentURL); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class RemoveDocxHeadersAndFootersResponse {\n"); sb.append(" successful: ").append(toIndentedString(successful)).append("\n"); sb.append(" editedDocumentURL: ").append(toIndentedString(editedDocumentURL)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "35204726+Cloudmersive@users.noreply.github.com" ]
35204726+Cloudmersive@users.noreply.github.com
cc48a57dbe97895d31c11b4e47a72fd8d6f760ff
f893f5ca60ac459e01cd0c004409a803b55ffb59
/eps-engine-ri/src/main/java/org/socraticgrid/hl7/services/eps/functional/HelloKafkaProducer.java
c3f496193e99945afb37ac9db9b41c6a69cafd0a
[ "Apache-2.0" ]
permissive
SocraticGrid/EPS-Implementation
5dda1323f2f55297d7dc56e3c3782bc7579ef1ff
0af35c694759ea234c8e1e034b99d2752d21c49a
refs/heads/master
2021-01-10T15:43:07.031167
2015-10-27T14:54:27
2015-10-27T14:54:27
43,059,619
0
1
null
null
null
null
UTF-8
Java
false
false
2,205
java
/* * Copyright 2015 Cognitive Medical Systems, Inc (http://www.cognitivemedciine.com). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.socraticgrid.hl7.services.eps.functional; import java.util.Date; import java.util.Properties; import java.util.UUID; import kafka.producer.KeyedMessage; import kafka.producer.ProducerConfig; import org.socraticgrid.hl7.services.eps.exceptions.MessageSerializationException; import org.socraticgrid.hl7.services.eps.internal.model.MessageMarshall; import org.socraticgrid.hl7.services.eps.model.Message; import org.socraticgrid.hl7.services.eps.model.MessageBody; /** * Created by user on 8/4/14. */ public class HelloKafkaProducer { final static String TOPIC = "kafkatopic"; public static void main(String[] argv) throws MessageSerializationException { Properties properties = new Properties(); properties.put("metadata.broker.list", "localhost:9092"); properties.put("serializer.class", "kafka.serializer.StringEncoder"); ProducerConfig producerConfig = new ProducerConfig(properties); kafka.javaapi.producer.Producer<String, String> producer = new kafka.javaapi.producer.Producer<String, String>( producerConfig); Message event = new Message(); event.getHeader().setMessageId(UUID.randomUUID().toString()); event.getHeader().setMessagePublicationTime(new Date()); event.getTopics().add(TOPIC); MessageBody body = new MessageBody(); body.setType("text/plain"); body.setBody("Message Body 3"); event.getMessageBodies().add(body); KeyedMessage<String, String> message = new KeyedMessage<String, String>( TOPIC, MessageMarshall.toString(event)); producer.send(message); producer.close(); } }
[ "esteban.aliverti@gmail.com" ]
esteban.aliverti@gmail.com
75e4ecb3ed965b2d9b40b63e91bf29cc26f5b98f
0291c0b3fb1a5444126ae9f8d334a48cadbf2b35
/src/main/java/com/zizhi/utils/ValidateCodeUtils.java
c797ad79d9fdd6ea379802120a05c63439958f7f
[]
no_license
ligq84/zizhi
dc5226da00c4274d7495f8fe2316d06a3d5e9379
6d431382f3d22d79354fd10f7fcc52264642d1ee
refs/heads/master
2021-01-01T04:13:50.195446
2017-07-25T00:00:52
2017-07-25T00:00:52
97,143,295
0
0
null
null
null
null
UTF-8
Java
false
false
5,013
java
package com.zizhi.utils; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Date; import java.util.Random; /** * @Auth liguoqiang * @Date 2017-7-16 * @Update * @UDate */ public class ValidateCodeUtils { // 图片的宽度。 private int width = 160; // 图片的高度。 private int height = 40; // 验证码字符个数 private int codeCount = 5; // 验证码干扰线数 private int lineCount = 150; // 验证码 private String code = null; // 验证码图片Buffer private BufferedImage buffImg = null; // 验证码范围,去掉0(数字)和O(拼音)容易混淆的(小写的1和L也可以去掉,大写不用了) private char[] codeSequence = {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '1', '2', '3', '4', '5', '6', '7', '8', '9'}; /** * 默认构造函数,设置默认参数 */ public ValidateCodeUtils() { this.createCode(); } /** * @param width 图片宽 * @param height 图片高 */ public ValidateCodeUtils(int width, int height) { this.width = width; this.height = height; this.createCode(); } /** * @param width 图片宽 * @param height 图片高 * @param codeCount 字符个数 * @param lineCount 干扰线条数 */ public ValidateCodeUtils(int width, int height, int codeCount, int lineCount) { this.width = width; this.height = height; this.codeCount = codeCount; this.lineCount = lineCount; this.createCode(); } public void createCode() { int x = 0, fontHeight = 0, codeY = 0; int red = 0, green = 0, blue = 0; x = width / (codeCount + 2);//每个字符的宽度(左右各空出一个字符) fontHeight = height - 2;//字体的高度 codeY = height - 4; // 图像buffer buffImg = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics2D g = buffImg.createGraphics(); // 生成随机数 Random random = new Random(); // 将图像填充为白色 g.setColor(Color.WHITE); g.fillRect(0, 0, width, height); // 创建字体,可以修改为其它的 Font font = new Font("Fixedsys", Font.PLAIN, fontHeight); // Font font = new Font("Times New Roman", Font.ROMAN_BASELINE, fontHeight); g.setFont(font); for (int i = 0; i < lineCount; i++) { // 设置随机开始和结束坐标 int xs = random.nextInt(width);//x坐标开始 int ys = random.nextInt(height);//y坐标开始 int xe = xs + random.nextInt(width / 8);//x坐标结束 int ye = ys + random.nextInt(height / 8);//y坐标结束 // 产生随机的颜色值,让输出的每个干扰线的颜色值都将不同。 red = random.nextInt(255); green = random.nextInt(255); blue = random.nextInt(255); g.setColor(new Color(red, green, blue)); g.drawLine(xs, ys, xe, ye); } // randomCode记录随机产生的验证码 StringBuffer randomCode = new StringBuffer(); // 随机产生codeCount个字符的验证码。 for (int i = 0; i < codeCount; i++) { String strRand = String.valueOf(codeSequence[random.nextInt(codeSequence.length)]); // 产生随机的颜色值,让输出的每个字符的颜色值都将不同。 red = random.nextInt(255); green = random.nextInt(255); blue = random.nextInt(255); g.setColor(new Color(red, green, blue)); g.drawString(strRand, (i + 1) * x, codeY); // 将产生的四个随机数组合在一起。 randomCode.append(strRand); } // 将四位数字的验证码保存到Session中。 code = randomCode.toString(); } public void write(String path) throws IOException { OutputStream sos = new FileOutputStream(path); this.write(sos); } public void write(OutputStream sos) throws IOException { ImageIO.write(buffImg, "png", sos); sos.close(); } public BufferedImage getBuffImg() { return buffImg; } public String getCode() { return code; } /** * 测试函数,默认生成到d盘 * @param args */ public static void main(String[] args) { ValidateCodeUtils vCode = new ValidateCodeUtils(160,40,5,150); try { String path="D:/"+new Date().getTime()+".png"; System.out.println(vCode.getCode()+" >"+path); vCode.write(path); } catch (IOException e) { e.printStackTrace(); } } }
[ "l" ]
l
78be9878e11718bf4858e4ec8b3bbb2ad84b143d
40a6cb7ff916e2187c96e1b9787ff41ff4277acc
/subprojects/groovy-contracts/src/main/java/org/apache/groovy/contracts/generation/TryCatchBlockGenerator.java
b7685572674f49b11a8d715eb45cb81b1065b7be
[ "BSD-3-Clause", "Apache-2.0", "MIT", "CC-BY-2.5" ]
permissive
apache/groovy
60b86695ffc7935423161e114fd7e2978a893621
6d84e245fd9bf78a45ebf323aef939eded5a4e7b
refs/heads/master
2023-08-24T12:20:20.676445
2023-08-23T16:51:50
2023-08-24T05:15:12
34,039,690
4,833
2,115
Apache-2.0
2023-09-14T04:36:41
2015-04-16T07:00:05
Java
UTF-8
Java
false
false
6,571
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.groovy.contracts.generation; import org.codehaus.groovy.GroovyBugError; import org.codehaus.groovy.ast.ClassHelper; import org.codehaus.groovy.ast.ClassNode; import org.codehaus.groovy.ast.expr.ConstantExpression; import org.codehaus.groovy.ast.expr.VariableExpression; import org.codehaus.groovy.ast.stmt.BlockStatement; import org.codehaus.groovy.ast.stmt.CatchStatement; import org.codehaus.groovy.ast.stmt.EmptyStatement; import org.codehaus.groovy.ast.stmt.Statement; import org.codehaus.groovy.ast.stmt.TryCatchStatement; import static org.codehaus.groovy.ast.tools.GeneralUtils.PLUS; import static org.codehaus.groovy.ast.tools.GeneralUtils.args; import static org.codehaus.groovy.ast.tools.GeneralUtils.assignS; import static org.codehaus.groovy.ast.tools.GeneralUtils.binX; import static org.codehaus.groovy.ast.tools.GeneralUtils.block; import static org.codehaus.groovy.ast.tools.GeneralUtils.callX; import static org.codehaus.groovy.ast.tools.GeneralUtils.catchS; import static org.codehaus.groovy.ast.tools.GeneralUtils.constX; import static org.codehaus.groovy.ast.tools.GeneralUtils.ctorX; import static org.codehaus.groovy.ast.tools.GeneralUtils.declS; import static org.codehaus.groovy.ast.tools.GeneralUtils.localVarX; import static org.codehaus.groovy.ast.tools.GeneralUtils.param; import static org.codehaus.groovy.ast.tools.GeneralUtils.returnS; import static org.codehaus.groovy.ast.tools.GeneralUtils.stmt; import static org.codehaus.groovy.ast.tools.GeneralUtils.throwS; import static org.codehaus.groovy.ast.tools.GeneralUtils.tryCatchS; import static org.codehaus.groovy.ast.tools.GeneralUtils.varX; /** * Creates a try-catch block around a given {@link org.codehaus.groovy.ast.stmt.AssertStatement} and catches * a PowerAssertionError to reuse the generated visual output. */ public class TryCatchBlockGenerator { public static BlockStatement generateTryCatchBlockForInlineMode(final ClassNode assertionErrorClass, final String message, final Statement assertStatement) { final Class powerAssertionErrorClass = loadPowerAssertionErrorClass(); if (powerAssertionErrorClass == null) throw new GroovyBugError("groovy-contracts needs Groovy 1.7 or above!"); VariableExpression newError = localVarX("newError", assertionErrorClass); Statement block = block( // newError = message + error.message declS(newError, ctorX(assertionErrorClass, args(binX(constX(message), PLUS, callX(varX(param(ClassHelper.makeWithoutCaching(powerAssertionErrorClass), "error")), "getMessage"))))), // newError.stackTrace = error.stackTrace stmt(callX(newError, "setStackTrace", args( callX(varX(param(ClassHelper.makeWithoutCaching(powerAssertionErrorClass), "error")), "getStackTrace") ))), throwS(newError)); CatchStatement catchStatement = catchS(param(ClassHelper.makeWithoutCaching(powerAssertionErrorClass), "error"), block); return block(tryCatchS( assertStatement, EmptyStatement.INSTANCE, catchStatement)); } public static BlockStatement generateTryCatchBlock(final ClassNode assertionErrorClass, final String message, final Statement assertStatement) { final String $_gc_closure_result = "$_gc_closure_result"; final VariableExpression variableExpression = localVarX($_gc_closure_result, ClassHelper.Boolean_TYPE); // if the assert statement is successful the return variable will be true else false final BlockStatement overallBlock = new BlockStatement(); overallBlock.addStatement(declS(variableExpression, ConstantExpression.FALSE)); final BlockStatement assertBlockStatement = block( assertStatement, assignS(variableExpression, ConstantExpression.TRUE) ); final Class powerAssertionErrorClass = loadPowerAssertionErrorClass(); if (powerAssertionErrorClass == null) throw new GroovyBugError("groovy-contracts needs Groovy 1.7 or above!"); VariableExpression newErrorVariableExpression = localVarX("newError", assertionErrorClass); Statement expr = declS(newErrorVariableExpression, ctorX(assertionErrorClass, args(binX(constX(message), PLUS, callX(varX(param(ClassHelper.makeWithoutCaching(powerAssertionErrorClass), "error")), "getMessage"))))); Statement exp2 = stmt(callX(newErrorVariableExpression, "setStackTrace", args( callX(varX(param(ClassHelper.makeWithoutCaching(powerAssertionErrorClass), "error")), "getStackTrace") ))); final TryCatchStatement tryCatchStatement = tryCatchS( assertBlockStatement, EmptyStatement.INSTANCE, catchS(param(ClassHelper.makeWithoutCaching(powerAssertionErrorClass), "error"), block(expr, exp2))); overallBlock.addStatement(tryCatchStatement); overallBlock.addStatement(returnS(variableExpression)); return overallBlock; } private static Class loadPowerAssertionErrorClass() { Class result = null; try { result = TryCatchBlockGenerator.class.getClassLoader().loadClass("org.codehaus.groovy.transform.powerassert.PowerAssertionError"); } catch (ClassNotFoundException e) { try { result = TryCatchBlockGenerator.class.getClassLoader().loadClass("org.codehaus.groovy.runtime.powerassert.PowerAssertionError"); } catch (ClassNotFoundException ignore) { } } return result; } }
[ "paulk@asert.com.au" ]
paulk@asert.com.au
fd13bc1498e34fd40c9f402f59cbaf0dde0d2533
a74bcf1c0f9e047afd46d4a7b9ad264e27946081
/Java/JavaSE/OpenGL/source/core/src/loon/action/sprite/effect/ArcEffect.java
e574d0e669179d43e89df41e0f4cb6de2ca3f075
[ "Apache-2.0" ]
permissive
windows10207/LGame
7a260b64dcdac5e1bbde415e5f801691d3bfb9fd
4599507d737a79b27d8f685f7aa542fd9f936cf7
refs/heads/master
2021-01-12T20:15:38.080295
2014-09-22T17:12:08
2014-09-22T17:12:08
24,441,072
1
0
null
null
null
null
UTF-8
Java
false
false
3,559
java
package loon.action.sprite.effect; import loon.action.sprite.ISprite; import loon.core.LObject; import loon.core.LSystem; import loon.core.geom.RectBox; import loon.core.graphics.LColor; import loon.core.graphics.opengl.GLEx; import loon.core.graphics.opengl.LTexture; import loon.core.timer.LTimer; import loon.utils.MathUtils; /** * Copyright 2008 - 2011 * * 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. * * @project loon * @author cping * @email:javachenpeng@yahoo.com * @version 0.1 */ /** * 0.3.2版新增类,单一色彩的圆弧渐变特效 */ public class ArcEffect extends LObject implements ISprite { /** * */ private static final long serialVersionUID = 1L; private int count; private int div = 10; private int turn = 1; private int[] sign = { 1, -1 }; private int width, height; private LColor color; private boolean visible, complete; private LTimer timer; public ArcEffect(LColor c) { this(c, 0, 0, LSystem.screenRect.width, LSystem.screenRect.height); } public ArcEffect(LColor c, int x, int y, int width, int height) { this.setLocation(x, y); this.width = width; this.height = height; this.timer = new LTimer(200); this.color = c == null ? LColor.black : c; this.visible = true; } public void setDelay(long delay) { timer.setDelay(delay); } public long getDelay() { return timer.getDelay(); } public boolean isComplete() { return complete; } public LColor getColor() { return color; } public void setColor(LColor color) { this.color = color; } public int getHeight() { return height; } public int getWidth() { return width; } public void update(long elapsedTime) { if (complete) { return; } if (this.count >= this.div) { this.complete = true; } if (timer.action(elapsedTime)) { count++; } } public void createUI(GLEx g) { if (!visible) { return; } if (complete) { return; } if (alpha > 0 && alpha < 1) { g.setAlpha(alpha); } if (count <= 1) { g.setColor(color); g.fillRect(x(), y(), width, height); g.resetColor(); } else { g.setColor(color); float length = MathUtils.sqrt(MathUtils.pow(width / 2, 2.0f) + MathUtils.pow(height / 2, 2.0f)); float x = getX() + (width / 2 - length); float y = getY() + (height / 2 - length); float w = width / 2 + length - x; float h = height / 2 + length - y; float deg = 360f / this.div * this.count; g.fillArc(x, y, w, h, 20, 0, this.sign[this.turn] * deg); g.resetColor(); } if (alpha > 0 && alpha < 1) { g.setAlpha(1f); } } public void reset() { this.complete = false; this.count = 0; this.turn = 1; } public int getTurn() { return turn; } public void setTurn(int turn) { this.turn = turn; } public LTexture getBitmap() { return null; } public RectBox getCollisionBox() { return getRect(x(), y(), width, height); } public boolean isVisible() { return visible; } public void setVisible(boolean visible) { this.visible = visible; } public void dispose() { } }
[ "longwind2012@hotmail.com" ]
longwind2012@hotmail.com
f7a45ed471f41203d448ddfc0f5fd914e136dd0c
24d282171fc5f682136e13515fb4ec980f7ee5ca
/java/src/homework/day11/part1/Test5.java
24fd4f5120f83a4881158ed17f2bd0c044191f08
[]
no_license
yexiu728/mingwan
0c0075ff2479a95830da083c51e547935e98d3b6
85eebcb28dbf5fbad7cd81f2e1bb42afea3f19fc
refs/heads/master
2021-01-07T19:40:10.245612
2020-02-20T05:24:35
2020-02-20T05:24:35
241,800,503
0
0
null
null
null
null
UTF-8
Java
false
false
385
java
package homework.day11.part1; import java.util.ArrayList; public class Test5 { public static void main(String[] args) { ArrayList<String> list = new ArrayList<>(); list.add("xiaomi"); list.add("xiaomi2"); list.add("xiaomi3"); list.add("xiaomi4"); for (String str : list) { System.out.println(str); } } }
[ "728550528@qq.com" ]
728550528@qq.com
1c8805062fbd63f8713a353fc8eba0a11ad40279
6e6db7db5aa823c77d9858d2182d901684faaa24
/sample/webservice/HelloeBayShopping/src/ebay/apis/eblbasecomponents/FeedbackHistoryType.java
1dbb7740465862650baa05e832d4da829c2e99e3
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
4everalone/nano
68a480d07d80f0f50d73ec593443bfb362d646aa
71779b1ad546663ee90a29f1c2d4236a6948a621
refs/heads/master
2020-12-25T14:08:08.303942
2013-07-25T13:28:41
2013-07-25T13:28:41
10,792,684
0
1
Apache-2.0
2019-04-24T20:12:27
2013-06-19T13:14:26
Java
UTF-8
Java
false
false
1,871
java
// Generated by xsd compiler for android/java // DO NOT CHANGE! package ebay.apis.eblbasecomponents; import java.io.Serializable; import com.leansoft.nano.annotation.*; import java.util.List; /** * * Specifies all feedback summary information (except Score). Contains * objects that each convey feedback counts for * positive, negative, neutral, and total feedback counts - for various * time periods each. Also conveys counts of bid retractions for the * predefined time periods. * */ public class FeedbackHistoryType implements Serializable { private static final long serialVersionUID = -1L; @Element(name = "BidRetractionFeedbackPeriods") @Order(value=0) public List<FeedbackPeriodType> bidRetractionFeedbackPeriods; @Element(name = "NegativeFeedbackPeriods") @Order(value=1) public List<FeedbackPeriodType> negativeFeedbackPeriods; @Element(name = "NeutralFeedbackPeriods") @Order(value=2) public List<FeedbackPeriodType> neutralFeedbackPeriods; @Element(name = "PositiveFeedbackPeriods") @Order(value=3) public List<FeedbackPeriodType> positiveFeedbackPeriods; @Element(name = "TotalFeedbackPeriods") @Order(value=4) public List<FeedbackPeriodType> totalFeedbackPeriods; @Element(name = "UniqueNegativeFeedbackCount") @Order(value=5) public Long uniqueNegativeFeedbackCount; @Element(name = "UniquePositiveFeedbackCount") @Order(value=6) public Long uniquePositiveFeedbackCount; @Element(name = "AverageRatingDetails") @Order(value=7) public List<AverageRatingDetailsType> averageRatingDetails; @Element(name = "NeutralCommentCountFromSuspendedUsers") @Order(value=8) public Long neutralCommentCountFromSuspendedUsers; @Element(name = "UniqueNeutralFeedbackCount") @Order(value=9) public Long uniqueNeutralFeedbackCount; @AnyElement @Order(value=10) public List<Object> any; }
[ "51startup@sina.com" ]
51startup@sina.com
a55774008b7c89c1686c0a037c980a0e611e0397
0838d33f50f701e66d26cbcf9541e3be6510787e
/app/src/main/java/com/jiepier/filemanager/ui/actionmode/ActionModeContact.java
3ca89814871c55a3d001f7d507c5ef91406e792f
[]
no_license
YAppList/FileManager-1
d69a8495ac3f1651ec965ee912d50f3725d41194
060a3ae3e83cce27830df1ee1d829497cc4f3ba5
refs/heads/master
2021-01-19T04:30:15.649498
2017-02-06T13:23:36
2017-02-06T13:23:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,367
java
package com.jiepier.filemanager.ui.actionmode; import android.app.DialogFragment; import android.content.Intent; import android.support.annotation.NonNull; import com.afollestad.materialdialogs.folderselector.FolderChooserDialog; import com.jiepier.filemanager.base.BasePresenter; import com.jiepier.filemanager.base.BaseView; import java.io.File; import java.util.ArrayList; /** * Created by panruijie on 17/1/3. * Email : zquprj@gmail.com */ public class ActionModeContact { interface View extends BaseView{ void cretaeActionMode(); void finishActionMode(); void refreshMenu(); void executePaste(String path); void setActionModeTitle(String title); void showDialog(DialogFragment dialog); void showFolderDialog(String TAG); void startShareActivity(Intent intent); void startZipTask(String fileName,String[] files); void startUnZipTask(File unZipFile, File folder); } interface Presenter extends BasePresenter<View>{ void clickMove(); void clickCopy(); void clickDelete(); void clickShare(); void clickZip(String currentPath); void clickRename(); void clickSetlectAll(); void folderSelect(FolderChooserDialog dialog, @NonNull File folder); int getSlectItemCount(); } }
[ "zquprj@gmail.com" ]
zquprj@gmail.com
f228a4452a103289a96df424de847022e87a4a32
9414f42007592bef00e1b11486b1fa835773e2b8
/src/main/java/com/teammu/giftrandompicker/web/rest/errors/EmailNotFoundException.java
66a685cadbe57c098fe0603cc55531be1e857c56
[]
no_license
gregnebu/GiftRandomPicker
e8881d49f6e5393be26146b1d170e3ca48187067
ed9d0bd6e35d095b88f0fb8581eac8afb7dae94c
refs/heads/master
2022-12-22T10:29:52.202764
2019-12-14T10:26:51
2019-12-14T10:26:51
228,000,649
0
0
null
2022-12-16T04:42:18
2019-12-14T09:55:56
Java
UTF-8
Java
false
false
419
java
package com.teammu.giftrandompicker.web.rest.errors; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; public class EmailNotFoundException extends AbstractThrowableProblem { private static final long serialVersionUID = 1L; public EmailNotFoundException() { super(ErrorConstants.EMAIL_NOT_FOUND_TYPE, "Email address not registered", Status.BAD_REQUEST); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
e9504ead0c1937ee84ca6f996295e47acb50c078
2afdc434064510869b75fe157b82b3440ddbb748
/presto-hive/src/main/java/io/prestosql/plugin/hive/HdfsConfig.java
cb243bfcb97f731e42db41886e891b56fa205ea1
[]
no_license
openlookeng/hetu-core
6dd74c62303f91d70e5eb6043b320054d1b4b550
73989707b733c11c74147d9228a0600e16fe5193
refs/heads/master
2023-09-03T20:27:49.706678
2023-06-26T09:51:37
2023-06-26T09:51:37
276,025,804
553
398
null
2023-09-14T17:07:01
2020-06-30T07:14:20
Java
UTF-8
Java
false
false
7,758
java
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.prestosql.plugin.hive; import com.google.common.base.Splitter; import com.google.common.collect.ImmutableList; import com.google.common.net.HostAndPort; import com.google.common.primitives.Shorts; import io.airlift.configuration.Config; import io.airlift.configuration.ConfigDescription; import io.airlift.units.Duration; import io.airlift.units.MinDuration; import io.prestosql.plugin.hive.util.validation.FileExistsUtil; import org.apache.hadoop.fs.permission.FsPermission; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import java.io.File; import java.util.List; import java.util.Optional; import java.util.concurrent.TimeUnit; import static com.google.common.collect.ImmutableList.toImmutableList; import static java.lang.Integer.parseUnsignedInt; import static java.util.Objects.requireNonNull; public class HdfsConfig { public static final String SKIP_DIR_PERMISSIONS = "skip"; private static final Splitter SPLITTER = Splitter.on(',').trimResults().omitEmptyStrings(); private List<File> resourceConfigFiles = ImmutableList.of(); private String newDirectoryPermissions = "0777"; private boolean newFileInheritOwnership; private boolean verifyChecksum = true; private Duration ipcPingInterval = new Duration(10, TimeUnit.SECONDS); private Duration dfsTimeout = new Duration(60, TimeUnit.SECONDS); private Duration dfsConnectTimeout = new Duration(500, TimeUnit.MILLISECONDS); private int dfsConnectMaxRetries = 5; private Duration dfsKeyProviderCacheTtl = new Duration(30, TimeUnit.MINUTES); private String domainSocketPath; private HostAndPort socksProxy; private boolean wireEncryptionEnabled; private int fileSystemMaxCacheSize = 1000; private Integer dfsReplication; @NotNull public List<@FileExistsUtil File> getResourceConfigFiles() { return resourceConfigFiles; } @Config("hive.config.resources") public HdfsConfig setResourceConfigFiles(String files) { this.resourceConfigFiles = SPLITTER.splitToList(files).stream() .map(File::new) .collect(toImmutableList()); return this; } public HdfsConfig setResourceConfigFiles(List<File> files) { this.resourceConfigFiles = ImmutableList.copyOf(files); return this; } public Optional<FsPermission> getNewDirectoryFsPermissions() { if (newDirectoryPermissions.equalsIgnoreCase(HdfsConfig.SKIP_DIR_PERMISSIONS)) { return Optional.empty(); } return Optional.of(FsPermission.createImmutable(Shorts.checkedCast(parseUnsignedInt(newDirectoryPermissions, 8)))); } @Pattern(regexp = "(skip)|0[0-7]{3}", message = "must be either 'skip' or an octal number, with leading 0") public String getNewDirectoryPermissions() { return this.newDirectoryPermissions; } @Config("hive.fs.new-directory-permissions") @ConfigDescription("File system permissions for new directories") public HdfsConfig setNewDirectoryPermissions(String newDirectoryPermissions) { this.newDirectoryPermissions = requireNonNull(newDirectoryPermissions, "newDirectoryPermissions is null"); return this; } public boolean isNewFileInheritOwnership() { return newFileInheritOwnership; } @Config("hive.fs.new-file-inherit-ownership") @ConfigDescription("File system permissions for new directories") public HdfsConfig setNewFileInheritOwnership(boolean newFileInheritOwnership) { this.newFileInheritOwnership = newFileInheritOwnership; return this; } public boolean isVerifyChecksum() { return verifyChecksum; } @Config("hive.dfs.verify-checksum") public HdfsConfig setVerifyChecksum(boolean verifyChecksum) { this.verifyChecksum = verifyChecksum; return this; } @NotNull @MinDuration("1ms") public Duration getIpcPingInterval() { return ipcPingInterval; } @Config("hive.dfs.ipc-ping-interval") public HdfsConfig setIpcPingInterval(Duration pingInterval) { this.ipcPingInterval = pingInterval; return this; } @NotNull @MinDuration("1ms") public Duration getDfsTimeout() { return dfsTimeout; } @Config("hive.dfs-timeout") public HdfsConfig setDfsTimeout(Duration dfsTimeout) { this.dfsTimeout = dfsTimeout; return this; } @MinDuration("1ms") @NotNull public Duration getDfsConnectTimeout() { return dfsConnectTimeout; } @Config("hive.dfs.connect.timeout") public HdfsConfig setDfsConnectTimeout(Duration dfsConnectTimeout) { this.dfsConnectTimeout = dfsConnectTimeout; return this; } @Min(0) public int getDfsConnectMaxRetries() { return dfsConnectMaxRetries; } @Config("hive.dfs.connect.max-retries") public HdfsConfig setDfsConnectMaxRetries(int dfsConnectMaxRetries) { this.dfsConnectMaxRetries = dfsConnectMaxRetries; return this; } @NotNull @MinDuration("0ms") public Duration getDfsKeyProviderCacheTtl() { return dfsKeyProviderCacheTtl; } @Config("hive.dfs.key-provider.cache-ttl") public HdfsConfig setDfsKeyProviderCacheTtl(Duration dfsClientKeyProviderCacheTtl) { this.dfsKeyProviderCacheTtl = dfsClientKeyProviderCacheTtl; return this; } public String getDomainSocketPath() { return domainSocketPath; } @Config("hive.dfs.domain-socket-path") public HdfsConfig setDomainSocketPath(String domainSocketPath) { this.domainSocketPath = domainSocketPath; return this; } public HostAndPort getSocksProxy() { return socksProxy; } @Config("hive.hdfs.socks-proxy") public HdfsConfig setSocksProxy(HostAndPort socksProxy) { this.socksProxy = socksProxy; return this; } public boolean isWireEncryptionEnabled() { return wireEncryptionEnabled; } @Config("hive.hdfs.wire-encryption.enabled") @ConfigDescription("Should be turned on when HDFS wire encryption is enabled") public HdfsConfig setWireEncryptionEnabled(boolean wireEncryptionEnabled) { this.wireEncryptionEnabled = wireEncryptionEnabled; return this; } public int getFileSystemMaxCacheSize() { return fileSystemMaxCacheSize; } @Config("hive.fs.cache.max-size") @ConfigDescription("Hadoop FileSystem cache size") public HdfsConfig setFileSystemMaxCacheSize(int fileSystemMaxCacheSize) { this.fileSystemMaxCacheSize = fileSystemMaxCacheSize; return this; } @Min(1) public Integer getDfsReplication() { return dfsReplication; } @Config("hive.dfs.replication") @ConfigDescription("Hadoop FileSystem replication factor") public HdfsConfig setDfsReplication(Integer dfsReplication) { this.dfsReplication = dfsReplication; return this; } }
[ "zhengqijv@workingman.cn" ]
zhengqijv@workingman.cn
72c7e8bf2a5869f896f07c82fdbdada2b80b44aa
fcee9ba0994ff1643f041e8d71ed334aa7a7a4ea
/src/main/java/no/minecraft/Minecraftno/commands/MinecartCommand.java
fb40355d692afc1954d6fec8289d282836854e75
[]
no_license
Uraxys/Hardwork
3ed5156512bd11de246ab130540ffab9b3b707af
9518375c3f1c16c59eb21f24546609dbb3520005
refs/heads/master
2020-12-19T09:44:36.492141
2016-05-24T12:28:38
2016-05-24T12:28:38
235,700,410
0
0
null
2020-01-23T01:09:13
2020-01-23T01:09:12
null
UTF-8
Java
false
false
1,784
java
package no.minecraft.Minecraftno.commands; import no.minecraft.Minecraftno.Minecraftno; import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; import java.util.HashMap; import java.util.Map; public class MinecartCommand extends MinecraftnoCommand { private Map<String, Integer> cooldowns; public MinecartCommand(Minecraftno instance) { super(instance); setAccessLevel(1); this.cooldowns = new HashMap<String, Integer>(); } @Override public boolean onPlayerCommand(Player player, Command command, String label, String[] args) { String uname = player.getName(); /* Has cooldown? */ if (this.cooldowns.containsKey(uname)) { int time = (int) (System.currentTimeMillis() / 1000L); int left = this.cooldowns.get(uname) + 300; if (time < left) { int diff = left - time; int m = diff / 60 % 60; int s = diff % 60; player.sendMessage(this.getErrorChatColor() + "Du må vente " + this.getArgChatColor() + (m > 0 ? m + this.getErrorChatColor().toString() : 0) + " minutter og " + this.getArgChatColor() + (s > 0 ? s + this.getErrorChatColor().toString() : 0) + " sekunder " + this.getErrorChatColor().toString() + "før du kan bruke denne kommandoen igjen."); return true; } this.cooldowns.remove(uname); } // Give player a minecart, then add too cooldown. player.getInventory().addItem(new ItemStack(Material.MINECART, 1)); this.cooldowns.put(uname, ((int) (System.currentTimeMillis() / 1000L))); return true; } }
[ "jckf@jckf.no" ]
jckf@jckf.no
71224322442017cb9bff9ebb64bc1315d9d932e5
d0eebf8083358166f69ea0b487b168a512e30129
/hdw-upms-mapper/src/main/java/com/hdw/upms/mapper/SysUserRoleMapper.java
cb15874d4b28c82117fe3bd8f1e4cf4c14dd168e
[ "Apache-2.0" ]
permissive
liubinlive/hdw-dubbo
b07b243842911a3a26baf4929a0a7fac09360272
92b750e167d2f85cf3dc41c9fb057286592098c4
refs/heads/master
2020-05-30T13:54:54.463035
2019-05-30T10:40:37
2019-05-30T10:40:37
189,773,218
1
0
Apache-2.0
2019-06-01T20:06:11
2019-06-01T20:06:11
null
UTF-8
Java
false
false
957
java
package com.hdw.upms.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.hdw.upms.entity.SysUserRole; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.ResultType; import org.apache.ibatis.annotations.Select; import java.util.List; /** * 用户角色表 * * @author TuMinglong * @date 2018-12-11 11:35:15 */ public interface SysUserRoleMapper extends BaseMapper<SysUserRole> { /** * 根据用户查找用户角色集合 * @param userId * @return */ @Select("select t.role_id from t_sys_user_role t where t.user_id=#{userId}") @ResultType(Long.class) List<Long> selectRoleIdListByUserId(@Param("userId") Long userId); /** * 根据用户批量删除 * @param userIds */ void deleteBatchByUserIds(Long[] userIds); /** * 根据角色批量删除 * @param roleIds */ void deleteBatchByRoleIds(Long[] roleIds); }
[ "tuminglong@126.com" ]
tuminglong@126.com
5724bb8bc8d03ca48f64c3d6dc8c01756216aa47
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_99663fa7e6dc906dbdd1b5ebdf34b4992a94364e/PNPClientHandler/9_99663fa7e6dc906dbdd1b5ebdf34b4992a94364e_PNPClientHandler_t.java
93a23d4570abbf2988e9da3872753e5ff64225fe
[]
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
6,233
java
/* * ################################################################ * * ProActive Parallel Suite(TM): The Java(TM) library for * Parallel, Distributed, Multi-Core Computing for * Enterprise Grids & Clouds * * Copyright (C) 1997-2010 INRIA/University of * Nice-Sophia Antipolis/ActiveEon * Contact: proactive@ow2.org or contact@activeeon.com * * This library 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; version 3 of * the License. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * If needed, contact us to obtain a release under GPL Version 2 * or a different license than the GPL. * * Initial developer(s): The ActiveEon Team * http://www.activeeon.com/ * Contributor(s): * * ################################################################ * $$ACTIVEEON_INITIAL_DEV$$ */ package org.objectweb.proactive.extra.pnp; import org.apache.log4j.Logger; import org.jboss.netty.channel.ChannelHandlerContext; import org.jboss.netty.channel.ChannelPipelineCoverage; import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.ExceptionEvent; import org.jboss.netty.channel.MessageEvent; import org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler; import org.jboss.netty.handler.timeout.IdleStateEvent; import org.objectweb.proactive.core.util.log.ProActiveLogger; import org.objectweb.proactive.extra.pnp.PNPAgent.PNPClientChannel; import org.objectweb.proactive.extra.pnp.exception.PNPException; /** The client side handler of the PNP protocol * * @since ProActive 4.3.0 */ @ChannelPipelineCoverage("one") class PNPClientHandler extends IdleStateAwareChannelHandler { final private static Logger logger = ProActiveLogger.getLogger(PNPConfig.Loggers.PNP_HANDLER_CLIENT); /** The name of this handler */ final static String NAME = "PNPClientHandler"; /** The {@link PNPClientChannel} * * Unfortunately there is no way to set this field from the constructor since * we don't have a reference on the {@link PNPClientHandler} in the * pipeline factory. This field must be set by using * {@link PNPClientHandler#setPnpClientChannel(PNPClientChannel)} */ volatile private PNPClientChannel pnpClientChannel = null; @Override public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception { // Must be called ASAP to avoid late heartbeat pnpClientChannel.signalInputMessage(); if (!(e.getMessage() instanceof PNPFrame)) { throw new PNPException("Invalid message type " + e.getMessage().getClass().getName()); } PNPFrame msg = (PNPFrame) e.getMessage(); switch (msg.getType()) { case CALL_RESPONSE: pnpClientChannel.receiveResponse((PNPFrameCallResponse) msg); break; case HEARTBEAT: // OK we already notified the client channel break; default: throw new PNPException("Unexpected message type: " + msg); } } @Override public void channelIdle(ChannelHandlerContext ctx, IdleStateEvent e) throws Exception { this.pnpClientChannel.signalIdle(); } @Override public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws Exception { if (this.pnpClientChannel != null) { this.pnpClientChannel.close("exception caught", e.getCause()); } else { if (logger.isDebugEnabled()) { logger.debug("Connection failed (an exception will be throw to the user code by " + PNPAgent.class.getName() + " ) ", e.getCause()); } } } @Override public void channelDisconnected(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { this.pnpClientChannel.close("channel disconnected", null); } @Override public void channelClosed(ChannelHandlerContext ctx, ChannelStateEvent e) throws Exception { if (logger.isDebugEnabled()) { logger.debug("Channel closed " + e.getChannel()); } } /** Set the {@link PNPClientChannel} associated to this Channel * * @param cChanel the PNP Client Channel */ protected void setPnpClientChannel(PNPClientChannel cChanel) { if (this.pnpClientChannel != null) { logger.error("PPN Client channel already set", new PNPException()); return; } this.pnpClientChannel = cChanel; } @Override public void writeRequested(ChannelHandlerContext ctx, MessageEvent e) throws Exception { boolean ok = false; if (e.getMessage() instanceof PNPFrameCall) { ok = true; if (logger.isTraceEnabled()) { PNPFrameCall msg = (PNPFrameCall) e.getMessage(); logger.trace("Written request #" + msg.getCallId() + " on " + e.getChannel()); } } else if (e.getMessage() instanceof PNPFrameHeartbeatAdvertisement) { ok = true; if (logger.isTraceEnabled()) { PNPFrameHeartbeatAdvertisement msg = (PNPFrameHeartbeatAdvertisement) e.getMessage(); logger.trace("Written hbadv #" + msg.getHeartbeatPeriod() + " on " + e.getChannel()); } } if (ok) { ctx.sendDownstream(e); } else { throw new PNPException("Invalid message type " + e.getMessage().getClass().getName()); } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
9d43a50492880085e48200d9fef1abbd68c52448
f1e4d6713fa499aff9a0af455206e9e992811509
/XML PROCESSING - LECTURE/XMLDemo/src/main/java/app/entities/dtos/visible_dtos/Parts.java
bf38548f47a822e6fbfd8af4ff8d0ed8536ea634
[]
no_license
IvanBorislavovDimitrov/Databases-Frameworks---Hibernate-Spring-Data
bde308aeeaff54c98d905e16341870dc83286fad
a16e80ca2326cca16924ce01287a290df702e243
refs/heads/master
2020-03-07T23:06:12.248696
2018-04-23T13:58:44
2018-04-23T13:58:44
127,772,302
1
0
null
null
null
null
UTF-8
Java
false
false
769
java
package app.entities.dtos.visible_dtos; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import java.util.ArrayList; import java.util.List; @XmlRootElement(name = "parts") @XmlAccessorType(XmlAccessType.FIELD) public class Parts { @XmlElement(name = "part") private List<PartDto> partDtos; public Parts() { this.partDtos = new ArrayList<>(); } public Parts(List<PartDto> partDtos) { this.partDtos = partDtos; } public List<PartDto> getPartDtos() { return partDtos; } public void setPartDtos(List<PartDto> partDtos) { this.partDtos = partDtos; } }
[ "starstrucks1997@gmail.com" ]
starstrucks1997@gmail.com
09f67cffe782d8a80364e4ec8bc6f2535e55b764
eb9f655206c43c12b497c667ba56a0d358b6bc3a
/java/java-tests/testData/inspection/dataFlow/fixture/PolyadicEquality.java
e47b91f3a2c379d85c5a824491026096486881db
[ "Apache-2.0" ]
permissive
JetBrains/intellij-community
2ed226e200ecc17c037dcddd4a006de56cd43941
05dbd4575d01a213f3f4d69aa4968473f2536142
refs/heads/master
2023-09-03T17:06:37.560889
2023-09-03T11:51:00
2023-09-03T12:12:27
2,489,216
16,288
6,635
Apache-2.0
2023-09-12T07:41:58
2011-09-30T13:33:05
null
UTF-8
Java
false
false
296
java
// IDEA-193167 class Test { void test() { boolean b1 = true; boolean b2 = true; boolean b3 = false; System.out.println(<warning descr="Condition 'b1 == b2 == b3' is always 'false'"><warning descr="Condition 'b1 == b2' is always 'true'">b1 == b2</warning> == b3</warning>); } }
[ "Tagir.Valeev@jetbrains.com" ]
Tagir.Valeev@jetbrains.com
4af5beaf0880e06f93a7a861f4ebba2696751bcf
9bc55183486ccbb76284ac7b38a12dadef52ce66
/famous-game/src/main/java/com/liema/game/sign/entity/SignReward.java
9114c74111185219f42f40ba8059339fef84f081
[]
no_license
endlessc/Almost-Famous
ed08a13a1112b8e0bb271dbcb31738547cf8d9e2
c10adb37f622842ec2f31752c7b0a23c5362c7db
refs/heads/master
2020-07-23T22:37:15.950899
2019-09-10T09:06:08
2019-09-10T09:06:08
207,726,809
4
0
null
2019-09-11T04:59:56
2019-09-11T04:59:56
null
UTF-8
Java
false
false
494
java
package com.liema.game.sign.entity; import com.liema.common.bean.RewardBean; import com.liema.common.db.pojo.GeneralBean; import com.liema.common.global.Misc; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.data.mongodb.core.mapping.Document; import java.util.Map; @Data @NoArgsConstructor @Document(collection = "famous-game-sign-reward") public class SignReward extends GeneralBean { private Long rid; private Map<Integer, RewardBean> rewards; }
[ "noseparte@aliyun.com" ]
noseparte@aliyun.com
9e6594723915c6e4f841b1412719bde56dc0a4bb
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/14/14_609d142e340f5445c0611e8b1a33cfffd224e401/PmdRule/14_609d142e340f5445c0611e8b1a33cfffd224e401_PmdRule_s.java
cceb9b22c9f5813d5cac182e9e3a89993fbfeeb3
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,867
java
/* * SonarQube Java * Copyright (C) 2012 SonarSource * dev@sonar.codehaus.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 */ package org.sonar.plugins.pmd.xml; import java.util.ArrayList; import java.util.List; public class PmdRule { private String ref; private String priority; private String name; private String message; private List<PmdProperty> properties = new ArrayList<PmdProperty>(); private String clazz; public PmdRule(String ref) { this(ref, null); } public PmdRule(String ref, String priority) { this.ref = ref; this.priority = priority; } public String getRef() { return ref; } public void setProperties(List<PmdProperty> properties) { this.properties = properties; } public List<PmdProperty> getProperties() { return properties; } public PmdProperty getProperty(String propertyName) { for (PmdProperty prop : properties) { if (propertyName.equals(prop.getName())) { return prop; } } return null; } public int compareTo(String o) { return o.compareTo(ref); } public String getPriority() { return priority; } public void setPriority(String priority) { this.priority = priority; } public void addProperty(PmdProperty property) { if (properties == null) { properties = new ArrayList<PmdProperty>(); } properties.add(property); } public void setName(String name) { this.name = name; } public String getName() { return name; } public void setMessage(String message) { this.message = message; } public String getMessage() { return message; } public void setClazz(String clazz) { this.clazz = clazz; } public String getClazz() { return clazz; } public void setRef(String ref) { this.ref = ref; } public void removeProperty(String propertyName) { PmdProperty prop = getProperty(propertyName); properties.remove(prop); } public boolean hasProperties() { return properties != null && !properties.isEmpty(); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
3fc8b9457050866c2078a812b6571e2862c7a79a
866cc70a0f6ffc4446c9d378d2e01aee58919198
/src/main/java/mayday/pathway/keggview/pathways/gui/canvas/GeneComponent.java
ca3e9a02abd4efcc4d477220a420f8582228f3a6
[]
no_license
Integrative-Transcriptomics/Mayday-pathway
eb4a6ca4ee057f4a0280e487428f77dee5d5f9de
a64b6df0eb5c942daa8ed11a1b29f32d30eefe18
refs/heads/master
2023-01-12T00:46:38.341409
2016-08-01T09:07:07
2016-08-01T09:07:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,134
java
package mayday.pathway.keggview.pathways.gui.canvas; import java.awt.Image; import java.util.Iterator; import java.util.Set; import java.util.TreeSet; import mayday.core.Probe; import mayday.core.pluma.PluginInfo; import mayday.pathway.keggview.kegg.ko.KOEntry; import mayday.pathway.keggview.pathways.graph.GeneNode; import mayday.pathway.keggview.pathways.graph.PathwayGraph; @SuppressWarnings("serial") public class GeneComponent extends PathwayComponent { private static final Image enzymeIcon=PluginInfo.getIcon("mayday/image/enzyme2.png").getImage(); public GeneComponent(GeneNode node,PathwayGraph graph) { super(node,graph); setSize(80, 40); setToolTipText(makeToolTipText()); setLabel(prepareLabel()); } private String prepareLabel() { String label=""; Iterator<KOEntry> iter=((GeneNode)getNode()).getGenes().iterator(); label=((GeneNode)getNode()).getName(); if(!iter.hasNext()) label=((GeneNode)getNode()).getName(); else { KOEntry first= iter.next(); if(first==null ) return ""; if(first.getName()==null) return ""; label=first.getName(); if(label.length() > 4 && label.charAt(3)==':') label=label.substring(4); if(label.startsWith("TITLE:")) label=label.substring(6); if(label.indexOf(",")>0) { label=label.substring(0,label.indexOf(",")); } } return label; } private String makeToolTipText() { StringBuffer sb=new StringBuffer("<html><body><ul>"); for(KOEntry e:((GeneNode)getNode()).getGenes()) { if(e==null) continue; sb.append("<li>"+e.getName()+": "+e.getDefinition()+"</li>"); } for(Probe p:((GeneNode)getNode()).getProbes()) { sb.append("<li>"+p.getDisplayName()+"</li>"); } return sb.toString(); } public Image getImage() { return enzymeIcon; } @Override public void resetLabel() { setLabel(prepareLabel()); } @Override public void setProbeNamesAsLabel() { if(getProbes().isEmpty()) return; StringBuffer sb=new StringBuffer(""); Set<Probe> probes=new TreeSet<Probe>(getProbes()); for(Probe p:probes) { sb.append(p.getDisplayName()+", "); } setLabel(sb.toString()); } }
[ "adrian.geissler@student.uni-tuebingen.de" ]
adrian.geissler@student.uni-tuebingen.de
085d27740fc036b097c898df555cc9da6fa6f5a7
8b9190a8c5855d5753eb8ba7003e1db875f5d28f
/sources/com/google/protobuf/ProtobufArrayList.java
c0f5c777ecd13b426829d05141723701a28ed842
[]
no_license
stevehav/iowa-caucus-app
6aeb7de7487bd800f69cb0b51cc901f79bd4666b
e3c7eb39de0be6bbfa8b6b063aaa85dcbcee9044
refs/heads/master
2020-12-29T10:25:28.354117
2020-02-05T23:15:52
2020-02-05T23:15:52
238,565,283
21
3
null
null
null
null
UTF-8
Java
false
false
1,419
java
package com.google.protobuf; import java.util.ArrayList; import java.util.List; final class ProtobufArrayList<E> extends AbstractProtobufList<E> { private static final ProtobufArrayList<Object> EMPTY_LIST = new ProtobufArrayList<>(); private final List<E> list; static { EMPTY_LIST.makeImmutable(); } public static <E> ProtobufArrayList<E> emptyList() { return EMPTY_LIST; } ProtobufArrayList() { this(new ArrayList(10)); } private ProtobufArrayList(List<E> list2) { this.list = list2; } public ProtobufArrayList<E> mutableCopyWithCapacity(int i) { if (i >= size()) { ArrayList arrayList = new ArrayList(i); arrayList.addAll(this.list); return new ProtobufArrayList<>(arrayList); } throw new IllegalArgumentException(); } public void add(int i, E e) { ensureIsMutable(); this.list.add(i, e); this.modCount++; } public E get(int i) { return this.list.get(i); } public E remove(int i) { ensureIsMutable(); E remove = this.list.remove(i); this.modCount++; return remove; } public E set(int i, E e) { ensureIsMutable(); E e2 = this.list.set(i, e); this.modCount++; return e2; } public int size() { return this.list.size(); } }
[ "steve@havelka.co" ]
steve@havelka.co
14aa3431ab6d139ab7ba88f67f04811ccb1fe83d
6d54c69641e421d7a737950f6f7301b1fb0b9b12
/3.JavaMultithreading/src/com/javarush/task/task28/task2813/Solution.java
e66411b966359abaf6592b80b51bea8675c3b5ab
[]
no_license
MarvineGothic/JavaRushTasks
ab91358bbbce7934b2ed0d05bd62510be17747c9
ec77371bc91fe415ee06d949ed6ad9490d21b597
refs/heads/master
2021-08-05T20:51:23.112564
2021-07-27T18:24:19
2021-07-27T18:24:19
105,068,893
0
0
null
null
null
null
UTF-8
Java
false
false
1,797
java
package com.javarush.task.task28.task2813; import java.util.concurrent.*; /* FutureTask public class Solution { private static final ExecutorService threadpool = Executors.newFixedThreadPool(4); private static final int n = 16; public static void main(String args[]) throws InterruptedException, ExecutionException { FactorialCalculator task = new FactorialCalculator(n); System.out.println("Submitting Task ..."); Future future = threadpool.submit(task); System.out.println("Task was submitted successfully"); while (!future.isDone()) { System.out.println("Task is not completed yet...."); Thread.sleep(1); } System.out.println("Task is completed, let's check the result"); long factorial = (long) future.get(); System.out.println("Factorial of " + n + " is : " + factorial); threadpool.shutdown(); } } */ public class Solution { // solved private static final ExecutorService threadpool = Executors.newFixedThreadPool(4); private static final int n = 16; public static void main(String args[]) throws InterruptedException, ExecutionException { FactorialCalculator task = new FactorialCalculator(n); System.out.println("Submitting Task ..."); Future future = threadpool.submit(task); System.out.println("Task was submitted successfully"); while (!future.isDone()) { System.out.println("Task is not completed yet...."); Thread.sleep(1); } System.out.println("Task is completed, let's check the result"); long factorial = (long) future.get(); System.out.println("Factorial of " + n + " is : " + factorial); threadpool.shutdown(); } }
[ "seis@itu.dk" ]
seis@itu.dk
3ee3b7c1d375f361962151f14b690dc4cb5d880d
6039432df47c3de269cf6645b38e6392f421abf6
/spring-server-final/src/main/java/com/javaguys/webservices/endpoints/UserServiceEndpoints.java
cfe21df4a46945040d721d54b5f4f7d15a50fd12
[]
no_license
selvarajas/desingpattern
a61afdca3498f494be1b3943403b92ee1a3cb35e
ad71bba4faeb92cbdc7162f2d251009a4d114e08
refs/heads/master
2021-01-19T04:20:32.905520
2016-06-21T11:00:36
2016-06-21T11:00:36
60,693,311
1
0
null
null
null
null
UTF-8
Java
false
false
1,934
java
package com.javaguys.webservices.endpoints; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ws.server.endpoint.annotation.Endpoint; import org.springframework.ws.server.endpoint.annotation.PayloadRoot; import org.springframework.ws.server.endpoint.annotation.RequestPayload; import org.springframework.ws.server.endpoint.annotation.ResponsePayload; import com.javaguys.services.UserService; import com.javaguys.webservices.getUserServices.GetUserRequest; import com.javaguys.webservices.getUserServices.GetUserResponse; import com.javaguys.webservices.saveUserServices.SaveUserRequest; import com.javaguys.webservices.saveUserServices.SaveUserResponse; @Endpoint public class UserServiceEndpoints { private static final String GET_TARGET_NAMESPACE = "http://com/javaguys/webservices/getUserServices"; private static final String SAVE_TARGET_NAMESPACE = "http://com/javaguys/webservices/saveUserServices"; @Autowired private UserService userService; @PayloadRoot(localPart = "GetUserRequest", namespace = GET_TARGET_NAMESPACE) public @ResponsePayload GetUserResponse getUserDetails(@RequestPayload GetUserRequest request) { System.out.println("Get User !"); GetUserResponse response = new GetUserResponse(); response.setUserDetails(userService.getUserDetails(request.getUserId())); return response; } @PayloadRoot(localPart = "SaveUserRequest", namespace = SAVE_TARGET_NAMESPACE) public @ResponsePayload SaveUserResponse saveUserDetails(@RequestPayload SaveUserRequest request) { System.out.println("Save User !"); SaveUserResponse response = new SaveUserResponse(); response.setUserId(userService.saveUserDetails(request.getUserDetails())); return response; } public void setUserService(UserService userService_i) { this.userService = userService_i; } }
[ "selvaraja.savarimuthu@gmail.com" ]
selvaraja.savarimuthu@gmail.com
bcaa5695740160f683208dcecc9160c9d2152229
4ab2794c9530f3a6884519c74b43df979b9c3f65
/controltheland/src/main/java/com/btxtech/game/jsre/client/ExtendedAbsolutePanel.java
24a4c53f46f8cb233e072cec30670c401d2360cb
[]
no_license
kurdoxxx/controltheland
759b825b9e19c95a27f8b3345f1f620a6f8f308d
22fb17ff19446a9ed7c91b5a8e6d091488bf475e
refs/heads/master
2021-01-19T06:58:47.541857
2014-07-25T22:05:37
2014-07-25T22:05:37
37,353,316
0
0
null
null
null
null
UTF-8
Java
false
false
1,896
java
/* * Copyright (c) 2010. * * 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; version 2 of the License. * * 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. */ package com.btxtech.game.jsre.client; import com.google.gwt.event.dom.client.MouseDownEvent; import com.google.gwt.event.dom.client.MouseDownHandler; import com.google.gwt.event.dom.client.MouseMoveEvent; import com.google.gwt.event.dom.client.MouseMoveHandler; import com.google.gwt.event.dom.client.MouseOutEvent; import com.google.gwt.event.dom.client.MouseOutHandler; import com.google.gwt.event.dom.client.MouseUpEvent; import com.google.gwt.event.dom.client.MouseUpHandler; import com.google.gwt.event.shared.HandlerRegistration; import com.google.gwt.user.client.ui.AbsolutePanel; /** * User: beat * Date: 23.08.2010 * Time: 19:31:26 */ public class ExtendedAbsolutePanel extends AbsolutePanel { public ExtendedAbsolutePanel() { } public HandlerRegistration addMouseDownHandler(MouseDownHandler handler) { return addDomHandler(handler, MouseDownEvent.getType()); } public HandlerRegistration addMouseOutHandler(MouseOutHandler handler) { return addDomHandler(handler, MouseOutEvent.getType()); } public HandlerRegistration addMouseUpHandler(MouseUpHandler handler) { return addDomHandler(handler, MouseUpEvent.getType()); } public HandlerRegistration addMouseMoveHandler(MouseMoveHandler handler) { return addDomHandler(handler, MouseMoveEvent.getType()); } }
[ "beat.keller@btxtech.com" ]
beat.keller@btxtech.com
8cafd8226ae14d4a7533295641488af18ad9cce4
54c2ba8bcede572abae27886fe7a599215030924
/src/main/java/com/jd/open/api/sdk/request/website/cps/CPSWareDetailPageGetRequest.java
4137b211a54e09331f862562c8cef84afbc316c9
[]
no_license
pingjiang/jd-open-api-sdk-src
4c8bcc1e139657c0b6512126e9408cc71873ee30
0d82d3a14fb7f931a4a1e25dc18fb2f1cfaadd81
refs/heads/master
2021-01-01T17:57:04.734329
2014-06-26T03:49:36
2014-06-26T03:49:36
21,227,086
17
15
null
null
null
null
UTF-8
Java
false
false
2,142
java
// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) // Source File Name: CPSWareDetailPageGetRequest.java package com.jd.open.api.sdk.request.website.cps; import com.jd.open.api.sdk.internal.util.JsonUtil; import com.jd.open.api.sdk.request.AbstractRequest; import com.jd.open.api.sdk.request.JdRequest; import com.jd.open.api.sdk.response.website.cps.CPSWareDetailPageGetResponse; import java.io.IOException; import java.util.HashMap; import java.util.Map; public class CPSWareDetailPageGetRequest extends AbstractRequest implements JdRequest { public CPSWareDetailPageGetRequest() { } public String getLinkType() { return linkType; } public void setLinkType(String linkType) { this.linkType = linkType; } public String getImgSizeType() { return imgSizeType; } public void setImgSizeType(String imgSizeType) { this.imgSizeType = imgSizeType; } public String getFields() { return fields; } public void setFields(String fields) { this.fields = fields; } public String getSkuIds() { return skuIds; } public void setSkuIds(String skuIds) { this.skuIds = skuIds; } public String getMobile() { return isMobile; } public void setMobile(String mobile) { isMobile = mobile; } public String getApiMethod() { return "jingdong.tuiguang.wares.detail.get"; } public String getAppJsonParams() throws IOException { Map map = new HashMap(); map.put("fields", fields); map.put("is_mobile", isMobile); map.put("sku_ids", skuIds); map.put("link_type", linkType); map.put("img_size_type", imgSizeType); return JsonUtil.toJson(map); } public Class getResponseClass() { return CPSWareDetailPageGetResponse.class; } private String fields; private String skuIds; private String isMobile; private String linkType; private String imgSizeType; }
[ "pingjiang1989@gmail.com" ]
pingjiang1989@gmail.com
31c5e7401fc95f8ac716a3469cbb1681fe42ed10
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Time/26/org/joda/time/DateTimeZone_toString_1203.java
07818e8e44d272a9ff038148ed10ee895d276392
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
2,380
java
org joda time date time zone datetimezon repres time zone time zone system rule convert time geograph locat pari franc hour ahead london england london pari time zone rule express histor reason rel greenwich london local time greenwich refer greenwich time gmt similar precis ident univers coordin time utc librari term utc system america lo angel express utc utc summer offset america lo angel time obtain utc ad subtract hour offset differ summer daylight save time dst definit time gener utc refer time standard time local time daylight save time offset pari standard time utc daylight save time local time daylight save time offset offset typic hour typic countri equat pari daylight save time utc wall time local clock wall read standard time daylight save time depend time year locat daylight save time unlik java time zone timezon date time zone datetimezon immut support format time zone id est ect accept factori accept time zone timezon attempt convert suitabl date time zone datetimezon thread safe immut subclass author brian neill o'neil author stephen colebourn date time zone datetimezon serializ datetim zone string simpli zone string string tostr getid
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
6ea18b0cfc73331bda402d74f4b527644e301b4a
85d0389c49f660cdddf14cb7c00cfc3d3171f3c4
/matsin-contrib/.svn/pristine/6e/6ea18b0cfc73331bda402d74f4b527644e301b4a.svn-base
05c44b86f864f36ff91de5ce3b01931269836678
[]
no_license
anhpt204/tracnghiem_nham
05cc10efd1cfaab54806d3408f33cfd223d8af13
f159e63209b1aa73dc53ece36aa76e8deb086b70
refs/heads/master
2021-01-16T18:35:33.714347
2015-08-21T04:12:43
2015-08-21T04:12:43
38,027,945
1
0
null
null
null
null
UTF-8
Java
false
false
4,864
package org.matsim.contrib.freight.carrier; import java.io.BufferedWriter; import java.io.IOException; import java.util.Collection; import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; import org.matsim.api.core.v01.Id; import org.matsim.contrib.freight.carrier.Tour.Delivery; import org.matsim.contrib.freight.carrier.Tour.GeneralActivity; import org.matsim.contrib.freight.carrier.Tour.Pickup; import org.matsim.contrib.freight.carrier.Tour.TourElement; import org.matsim.core.basic.v01.IdImpl; import org.matsim.core.utils.io.MatsimXmlWriter; public class CarrierPlanWriter extends MatsimXmlWriter{ private static Logger logger = Logger.getLogger(CarrierPlanWriter.class); private Collection<Carrier> carriers; private int idCounter = 0; private Map<CarrierShipment,Id> registeredShipments = new HashMap<CarrierShipment, Id>(); public CarrierPlanWriter(Collection<Carrier> carriers) { super(); this.carriers = carriers; } public void write(String filename) { logger.info("write carrier plans"); try{ openFile(filename); writeXmlHead(); startCarriers(this.writer); for(Carrier carrier : carriers){ startCarrier(carrier,this.writer); writeVehicles(carrier,this.writer); writeContracts(carrier,this.writer); writeScheduledTours(carrier,this.writer); endCarrier(this.writer); } endCarriers(this.writer); close(); logger.info("done"); } catch (IOException e) { e.printStackTrace(); logger.error(e); System.exit(1); } } private void startCarriers(BufferedWriter writer) throws IOException { writer.write("\t<carriers>\n"); } private void startCarrier(Carrier carrier, BufferedWriter writer) throws IOException { writer.write("\t\t<carrier id=\"" + carrier.getId() + "\" linkId=\"" + carrier.getDepotLinkId() + "\">\n"); } private void writeVehicles(Carrier carrier, BufferedWriter writer) throws IOException { writer.write("\t\t\t<vehicles>\n"); for(CarrierVehicle v : carrier.getCarrierCapabilities().getCarrierVehicles()){ writer.write("\t\t\t\t<vehicle id=\"" + v.getVehicleId() + "\" linkId=\"" + v.getLocation() + "\"" + " cap=\"" + v.getCapacity() + "\"/>\n"); } writer.write("\t\t\t</vehicles>\n"); } private void writeContracts(Carrier carrier, BufferedWriter writer) throws IOException { writer.write("\t\t\t<shipments>\n"); for(CarrierContract contract : carrier.getContracts()){ CarrierShipment s = contract.getShipment(); Id shipmentId = createId(); registeredShipments.put(s, shipmentId); writer.write("\t\t\t\t<shipment "); writer.write("id=\"" + shipmentId + "\" "); writer.write("from=\"" + s.getFrom() + "\" "); writer.write("to=\"" + s.getTo() + "\" "); writer.write("size=\"" + s.getSize() + "\" "); writer.write("startPickup=\"" + s.getPickupTimeWindow().getStart() + "\" "); writer.write("endPickup=\"" + s.getPickupTimeWindow().getEnd() + "\" "); writer.write("startDelivery=\"" + s.getDeliveryTimeWindow().getStart() + "\" "); writer.write("endDelivery=\"" + s.getDeliveryTimeWindow().getEnd() + "\"/>\n"); } writer.write("\t\t\t</shipments>\n"); } private void writeScheduledTours(Carrier carrier, BufferedWriter writer) throws IOException { if(carrier.getSelectedPlan() == null){ return; } writer.write("\t\t\t<tours>\n"); for(ScheduledTour tour : carrier.getSelectedPlan().getScheduledTours()){ writer.write("\t\t\t\t<tour "); writer.write("vehicleId=\"" + tour.getVehicle().getVehicleId() + "\" "); writer.write("linkId=\"" + tour.getVehicle().getLocation() + "\" "); writer.write("start=\"" + tour.getDeparture() + "\">\n"); writer.write("\t\t\t\t\t<act type=\"" + FreightConstants.START + "\" />\n"); for(TourElement tourElement : tour.getTour().getTourElements()){ writer.write("\t\t\t\t\t<act "); writer.write("type=\"" + tourElement.getActivityType() + "\" "); if((tourElement instanceof Pickup) || (tourElement instanceof Delivery)){ writer.write("shipmentId=\"" + registeredShipments.get(tourElement.getShipment()) + "\""); } else if(tourElement instanceof GeneralActivity){ GeneralActivity genAct = (GeneralActivity)tourElement; writer.write("linkId=\"" + genAct.getLocation() + "\" "); writer.write("duration=\"" + genAct.getDuration() + "\""); } writer.write("/>\n"); } writer.write("\t\t\t\t\t<act type=\"" + FreightConstants.END + "\"/>\n"); writer.write("\t\t\t\t</tour>\n"); } writer.write("\t\t\t</tours>\n"); } private void endCarrier(BufferedWriter writer) throws IOException { writer.write("\t\t</carrier>\n"); registeredShipments.clear(); } private Id createId() { idCounter++; return new IdImpl(idCounter); } private void endCarriers(BufferedWriter writer) throws IOException { writer.write("\t</carriers>\n"); } }
[ "anh.pt204@gmail.com" ]
anh.pt204@gmail.com
d25e8cf2d4545e20a9263aea483f505a4d333b49
3118c18cd35244dea763c396ef8be550e0c477d6
/distest-web/src/main/java/com/testwa/distest/server/service/app/service/AppInfoService.java
1295038dabaf41d72fe2c8738c53e63855fc6540
[]
no_license
felixruan/TestwaCloud
e31f1576e87776cbe28c87d312dccbf5d3b976d6
fb9f2e94c6ac02ebe3f636d972f09c33e1f253fa
refs/heads/master
2023-04-15T19:49:03.829675
2020-03-10T04:31:50
2020-03-10T04:31:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
6,305
java
package com.testwa.distest.server.service.app.service; import com.testwa.core.base.service.BaseService; import com.testwa.core.base.vo.PageResult; import com.testwa.distest.server.condition.AppCondition; import com.testwa.distest.server.entity.App; import com.testwa.distest.server.entity.AppInfo; import com.testwa.distest.server.mapper.AppInfoMapper; import com.testwa.distest.server.mapper.AppMapper; import com.testwa.distest.server.service.app.form.AppListForm; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * Created by wen on 16/9/1. */ @Slf4j @Service @Transactional(propagation = Propagation.REQUIRES_NEW, readOnly = true) public class AppInfoService extends BaseService<AppInfo, Long> { private static final String REG_ANDROID_PACKAGE = "[a-zA-Z]+[0-9a-zA-Z_]*(\\.[a-zA-Z]+[0-9a-zA-Z_]*)*"; @Autowired private AppMapper appMapper; @Autowired private AppInfoMapper appInfoMapper; @Transactional(propagation = Propagation.REQUIRES_NEW) public void disableAppInfo(Long entityId){ AppInfo appInfo = get(entityId); this.disableAppInfo(appInfo); } @Transactional(propagation = Propagation.REQUIRES_NEW) public void disableAppInfo(AppInfo appInfo) { if (appInfo != null) { disable(appInfo.getId()); appMapper.disableAllBy(appInfo.getPackageName(), appInfo.getProjectId()); } } @Transactional(propagation = Propagation.REQUIRES_NEW) public void deleteAll(List<Long> entityIds){ entityIds.forEach(this::disableAppInfo); } public AppInfo findOneInProject(Long entityId, Long projectId) { return appInfoMapper.findOneInProject(entityId, projectId); } public List<AppInfo> list(Long projectId, AppListForm queryForm) { AppInfo query = new AppInfo(); query.setProjectId(projectId); if(StringUtils.isNotBlank(queryForm.getAppName())) { query.setName(queryForm.getAppName()); } if(StringUtils.isNotBlank(queryForm.getPackageName())) { query.setPackageName(queryForm.getPackageName()); } return appInfoMapper.findBy(query); } public PageResult<AppInfo> page(Long projectId, AppListForm queryForm){ //分页处理 AppInfo query = new AppInfo(); query.setProjectId(projectId); if(StringUtils.isNotBlank(queryForm.getAppName())) { query.setName(queryForm.getAppName()); } if(StringUtils.isNotBlank(queryForm.getPackageName())) { query.setPackageName(queryForm.getPackageName()); } int offset = 0; if(queryForm.getPageNo() >= 1) { offset = (queryForm.getPageNo() - 1) * queryForm.getPageSize(); } List<AppInfo> appList = appInfoMapper.findPage(query, queryForm.getOrderBy(), queryForm.getOrder(), offset, queryForm.getPageSize()); Long total = appInfoMapper.countBy(query); PageResult<AppInfo> pr = new PageResult<>(appList, total); return pr; } public List<AppInfo> listByProjectId(Long projectId) { AppInfo query = new AppInfo(); query.setProjectId(projectId); List<AppInfo> result = appInfoMapper.findBy(query); return result; } public List<AppInfo> findAll(List<Long> entityIds) { List<AppInfo> appInfos = new ArrayList<>(); entityIds.forEach(id -> { AppInfo appInfo = get(id); appInfos.add(appInfo); }); return appInfos; } public AppInfo getByPackage(Long projectId, String packageName) { AppCondition appCondition = new AppCondition(); appCondition.setProjectId(projectId); appCondition.setPackageName(packageName); List<AppInfo> appInfos = appInfoMapper.selectByCondition(appCondition); if(appInfos.isEmpty()) { return null; } return appInfos.get(0); } public AppInfo getByDisplayName(Long projectId, String displayName) { AppCondition appCondition = new AppCondition(); appCondition.setProjectId(projectId); appCondition.setDisplayName(displayName); List<AppInfo> appInfos = appInfoMapper.selectByCondition(appCondition); if(appInfos.isEmpty()) { return null; } return appInfos.get(0); } public AppInfo getByQuery(Long projectId, String query) { Pattern r = Pattern.compile(REG_ANDROID_PACKAGE); Matcher matcher = r.matcher(query); if (matcher.find()) { return getByPackage(projectId, query); } return getByDisplayName(projectId, query); } @Transactional(propagation = Propagation.REQUIRES_NEW) public void saveOrUpdateAppInfo(Long projectId, App app) { if(projectId == null) { return; } AppInfo appInfo = getByPackage(projectId, app.getPackageName()); if(appInfo == null) { appInfo = new AppInfo(); appInfo.setName(app.getDisplayName()); appInfo.setPackageName(app.getPackageName()); appInfo.setProjectId(app.getProjectId()); appInfo.setLatestUploadTime(new Date()); appInfo.setLatestAppId(app.getId()); appInfo.setCreateTime(new Date()); appInfo.setCreateBy(app.getCreateBy()); appInfo.setPlatform(app.getPlatform()); appInfo.setEnabled(true); appInfoMapper.insert(appInfo); }else{ appInfo.setName(app.getDisplayName()); appInfo.setLatestAppId(app.getId()); appInfo.setLatestUploadTime(new Date()); appInfo.setUpdateTime(new Date()); appInfo.setUpdateBy(app.getCreateBy()); appInfo.setPlatform(app.getPlatform()); appInfo.setEnabled(true); appInfoMapper.update(appInfo); } } }
[ "wencz0321@gmail.com" ]
wencz0321@gmail.com
2a68b8ba98ecdaa3f312325cfb5c2a4f159de3db
fb0e19758824bbbd5dda39a8ef911e5590eb1841
/gper-springboot/spring-boot-demo/src/main/java/com/aqqje/springbootdemo/dm01/AqCondition.java
9577bf0ba19957419bf10d492735f1576a26da81
[]
no_license
aqqje/bexercise
e16ceefd5a89ce75e20fa419e212ffaf15ff5a5f
bcc6a52d147d5b910cd4d495501bb986007168f3
refs/heads/master
2022-12-23T17:42:58.965990
2021-05-02T10:45:34
2021-05-02T10:45:34
182,517,809
0
0
null
2022-12-16T15:45:43
2019-04-21T10:07:28
Java
UTF-8
Java
false
false
513
java
package com.aqqje.springbootdemo.dm01; import org.springframework.context.annotation.Condition; import org.springframework.context.annotation.ConditionContext; import org.springframework.core.type.AnnotatedTypeMetadata; /** * spring boot 根据 Condition 判断是否进行装载 */ public class AqCondition implements Condition { @Override public boolean matches(ConditionContext conditionContext, AnnotatedTypeMetadata annotatedTypeMetadata) { // TODO semething return true; } }
[ "1042136232@qq.com" ]
1042136232@qq.com
de0c22179fb7df12cd4adef19b795d2c0a807015
aff1fc8c8a43897e6383e8d5c1974b11a8e35073
/src/main/java/concurrent/A/ZF_TestHarness.java
e6f55952ce9b2ba18f432da554f466478918adb6
[]
no_license
wangchao550586585/juc
a75056229024bed6d8eb45a0556df74d9bd76e25
af7d09161cf656188104d1e37efb991142eaa37f
refs/heads/master
2022-12-26T17:45:55.926344
2020-04-14T04:22:31
2020-04-14T04:22:31
255,508,968
0
0
null
2020-10-13T21:10:12
2020-04-14T04:21:19
Java
UTF-8
Java
false
false
1,607
java
package concurrent.A; import java.util.concurrent.*; /** * TestHarness * <p/> * Using CountDownLatch for starting and stopping threads in timing tests *使用CountDownLatch达到闭锁目的 * * @author Brian Goetz and Tim Peierls */ public class ZF_TestHarness { public static void main(String[] args) throws InterruptedException { System.out.println(new ZF_TestHarness().timeTasks(5, () -> System.out.println(1))); } public long timeTasks(int nThreads, final Runnable task) throws InterruptedException { final CountDownLatch startGate = new CountDownLatch(1); final CountDownLatch endGate = new CountDownLatch(nThreads); for (int i = 0; i < nThreads; i++) { Thread t = new Thread() { public void run() { try { //等待计时器=0 startGate.await(); try { task.run(); } finally { //递减 endGate.countDown(); } } catch (InterruptedException ignored) { } } }; t.start(); } long start = System.nanoTime(); //使主线程能释放所有工作线程 startGate.countDown(); //使主线程能够等待最后一个线程执行完成,而不是顺序等待每个线程完成 endGate.await(); long end = System.nanoTime(); return end - start; } }
[ "550586585@qq.com" ]
550586585@qq.com