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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
01b195a85cfd32f0e8695908946e424aa3576cd7 | 3c5e0a73867838bc2afbc3b431dcc53ef8ea3af0 | /src/com/ulane/base/service/xitong/impl/BeanExtSetServiceImpl.java | 3fdef2abc6a470362f092c6f78fa41927af10493 | [] | no_license | cjp472/crm | 5f5d21c9b2307ab5d144ca8a762f374823a950c4 | d4a7f4dbf2983f0d3abb38ba0d0a916c08cb0c86 | refs/heads/master | 2020-03-19T09:48:34.976163 | 2018-05-05T07:47:27 | 2018-05-05T07:47:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 838 | java | package com.ulane.base.service.xitong.impl;
/*
* 北京优创融联科技有限公司 综合客服管理系统 -- http://www.ulane.cn
* Copyright (C) 2008-2010 Beijing Ulane Technology Co., LTD
*/
import com.htsoft.core.service.impl.BaseServiceImpl;
import com.ulane.base.dao.xitong.BeanExtSetDao;
import com.ulane.base.model.xitong.BeanExtSet;
import com.ulane.base.service.xitong.BeanExtSetService;
/**
*
* @author cf0666@gmail.com
*
*/
public class BeanExtSetServiceImpl extends BaseServiceImpl<BeanExtSet> implements BeanExtSetService{
@SuppressWarnings("unused")
private BeanExtSetDao dao;
public BeanExtSetServiceImpl(BeanExtSetDao dao) {
super(dao);
this.dao=dao;
}
@Override
public Object getByColumnsId(Long columnsId) {
// TODO Auto-generated method stub
return dao.getByColumnsId(columnsId);
}
} | [
"huyang3868@163.com"
] | huyang3868@163.com |
f6477fe31bbe301ad5a6703ec06c8fd4c923fec4 | c80f25f9c8faa1ea9db5bb1b8e36c3903a80a58b | /laosiji-sources/feng/android/sources/com/meizu/cloud/pushsdk/networking/okio/SegmentPool.java | 3237c2b6bd8c4df1a26093d361b7117e7f1e1faa | [] | no_license | wenzhaot/luobo_tool | 05c2e009039178c50fd878af91f0347632b0c26d | e9798e5251d3d6ba859bb15a00d13f085bc690a8 | refs/heads/master | 2020-03-25T23:23:48.171352 | 2019-09-21T07:09:48 | 2019-09-21T07:09:48 | 144,272,972 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,085 | java | package com.meizu.cloud.pushsdk.networking.okio;
final class SegmentPool {
static final long MAX_SIZE = 65536;
static long byteCount;
static Segment next;
private SegmentPool() {
}
static Segment take() {
synchronized (SegmentPool.class) {
if (next != null) {
Segment result = next;
next = result.next;
result.next = null;
byteCount -= 2048;
return result;
}
return new Segment();
}
}
static void recycle(Segment segment) {
if (segment.next != null || segment.prev != null) {
throw new IllegalArgumentException();
} else if (!segment.shared) {
synchronized (SegmentPool.class) {
if (byteCount + 2048 > 65536) {
return;
}
byteCount += 2048;
segment.next = next;
segment.limit = 0;
segment.pos = 0;
next = segment;
}
}
}
}
| [
"tanwenzhao@vipkid.com.cn"
] | tanwenzhao@vipkid.com.cn |
327243b13061c88225f0d321b4e07edfd0ff9c5e | 05800e7432adda95c07f13a19642b0230ea83752 | /maxkey-protocols/maxkey-protocol-oauth-2.0/src/main/java/org/maxkey/authz/oauth2/common/util/Jackson2JsonParser.java | 0f0530efe51a1286adf2ff92a0395449f30ec64a | [
"Zlib",
"EPL-1.0",
"LZMA-exception",
"bzip2-1.0.6",
"CPL-1.0",
"CDDL-1.0",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | MaxKeyTop/MaxKey | 180517ffa8ce7798c13a9c7cec710e0116107c89 | e0b33ac419ec0c7ceec14ffdc86b97dae745efff | refs/heads/master | 2023-08-14T13:48:40.742105 | 2023-01-07T10:39:52 | 2023-01-07T10:39:52 | 465,170,514 | 5 | 3 | Apache-2.0 | 2022-03-02T05:33:44 | 2022-03-02T05:33:43 | null | UTF-8 | Java | false | false | 1,331 | java | /*
* Copyright 2013-2014 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.maxkey.authz.oauth2.common.util;
import java.util.Map;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* @author Dave Syer
*
*/
public class Jackson2JsonParser implements JsonParser {
private ObjectMapper mapper = new ObjectMapper();
@SuppressWarnings("unchecked")
@Override
public Map<String, Object> parseMap(String json) {
try {
return mapper.readValue(json, Map.class);
}
catch (Exception e) {
throw new IllegalArgumentException("Cannot parse json", e);
}
}
@Override
public String formatMap(Map<String, ?> map) {
try {
return mapper.writeValueAsString(map);
}
catch (Exception e) {
throw new IllegalArgumentException("Cannot format json", e);
}
}
} | [
"shimingxy@163.com"
] | shimingxy@163.com |
2acdac23efa39d26d74d00365bd233a6f82f8705 | 7e1511cdceeec0c0aad2b9b916431fc39bc71d9b | /flakiness-predicter/input_data/original_tests/square-okhttp/nonFlakyMethods/okio.OkBufferTest-indexOf.java | 0d9f1d26a137da450031e06466ce3becc8cd87ea | [
"BSD-3-Clause"
] | permissive | Taher-Ghaleb/FlakeFlagger | 6fd7c95d2710632fd093346ce787fd70923a1435 | 45f3d4bc5b790a80daeb4d28ec84f5e46433e060 | refs/heads/main | 2023-07-14T16:57:24.507743 | 2021-08-26T14:50:16 | 2021-08-26T14:50:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,136 | java | @Test public void indexOf() throws Exception {
OkBuffer buffer=new OkBuffer();
assertEquals(-1,buffer.indexOf((byte)'a'));
buffer.writeUtf8("a");
assertEquals(0,buffer.indexOf((byte)'a'));
assertEquals(-1,buffer.indexOf((byte)'b'));
buffer.writeUtf8(repeat('b',Segment.SIZE - 2));
assertEquals(0,buffer.indexOf((byte)'a'));
assertEquals(1,buffer.indexOf((byte)'b'));
assertEquals(-1,buffer.indexOf((byte)'c'));
buffer.readUtf8(2);
assertEquals(-1,buffer.indexOf((byte)'a'));
assertEquals(0,buffer.indexOf((byte)'b'));
assertEquals(-1,buffer.indexOf((byte)'c'));
buffer.writeUtf8("c");
assertEquals(-1,buffer.indexOf((byte)'a'));
assertEquals(0,buffer.indexOf((byte)'b'));
assertEquals(Segment.SIZE - 3,buffer.indexOf((byte)'c'));
buffer.readUtf8(2);
assertEquals(-1,buffer.indexOf((byte)'a'));
assertEquals(0,buffer.indexOf((byte)'b'));
assertEquals(Segment.SIZE - 5,buffer.indexOf((byte)'c'));
buffer.writeUtf8("d");
assertEquals(asList(Segment.SIZE - 4,1),buffer.segmentSizes());
assertEquals(Segment.SIZE - 4,buffer.indexOf((byte)'d'));
assertEquals(-1,buffer.indexOf((byte)'e'));
}
| [
"aalsha2@masonlive.gmu.edu"
] | aalsha2@masonlive.gmu.edu |
0582ee5fdf002051df766b72ecf45923b451356b | bd7a8558b233337a5e3511db15639ef0a12a0b02 | /app/src/main/java/cn/teach/equip/bean/pojo/VersionBO.java | e7a426919edc235b3259e410ae12d69db6a1e816 | [] | no_license | sengeiou/teach | db54d70bf058c92a37dbdfb3bf4250b0d4bb1af0 | 2a9e625de5519685a687838fdc0a6f22e76cbc8c | refs/heads/master | 2023-06-07T18:20:58.144395 | 2021-06-24T10:40:31 | 2021-06-24T10:40:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,046 | java | package cn.teach.equip.bean.pojo;
public class VersionBO {
/**
* latestVersion : 2
* downloadUrl : https://shjz.yingjin.pro/api/upload/app/app-debug.apk
* isForceUpdate : 0
* content : 新功能上线
*/
private String latestVersion;
private String downloadUrl;
private int isForceUpdate;
private String content;
public String getLatestVersion() {
return latestVersion;
}
public void setLatestVersion(String latestVersion) {
this.latestVersion = latestVersion;
}
public String getDownloadUrl() {
return downloadUrl;
}
public void setDownloadUrl(String downloadUrl) {
this.downloadUrl = downloadUrl;
}
public int getIsForceUpdate() {
return isForceUpdate;
}
public void setIsForceUpdate(int isForceUpdate) {
this.isForceUpdate = isForceUpdate;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}
| [
"wy19941007"
] | wy19941007 |
8dd5a23706b2389d6216d244c1f20d11678fa45b | 4bec34f9f496db1f092d71b3dedbc77e2b9d2ee1 | /cbs.api.common/src/main/java/com/lifeix/cbs/api/common/util/CommerceMath.java | c9f020e1a4c554060c74f20918fd811047434437 | [] | no_license | 888xin/cbs.api | 08ec358363f1d7a0fc9037cf6746cc441c879497 | d9667aa1933fd9f0e02d2be97bc8aa7b8c8fe782 | refs/heads/master | 2020-03-27T07:14:56.367782 | 2018-08-26T11:49:04 | 2018-08-26T11:50:00 | 146,175,221 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,060 | java | package com.lifeix.cbs.api.common.util;
import java.math.BigDecimal;
public class CommerceMath {
// 默认除法运算精度
private static final int REMAINDER_ACCURACY = 10;
/**
* 提供精确的加法运算。
*
* @param v1
* 被加数
* @param v2
* 加数
* @return 两个参数的和
*/
public static double add(double v1, double v2) {
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.add(b2).doubleValue();
}
/**
* 提供精确的减法运算。
*
* @param v1
* 被减数
* @param v2
* 减数
* @return 两个参数的差
*/
public static double sub(double v1, double v2) {
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.subtract(b2).doubleValue();
}
/**
* 提供精确的乘法运算。
*
* @param v1
* 被乘数
* @param v2
* 乘数
* @return 两个参数的积
*/
public static double mul(double v1, double v2) {
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.multiply(b2).doubleValue();
}
/**
* 提供(相对)精确的除法运算,当发生除不尽的情况时,精确到 小数点以后10位,以后的数字四舍五入。
*
* @param v1
* 被除数
* @param v2
* 除数
* @return 两个参数的商
*/
public static double div(double v1, double v2) {
return div(v1, v2, REMAINDER_ACCURACY);
}
/**
* 提供(相对)精确的除法运算。当发生除不尽的情况时,由scale参数指 定精度,以后的数字四舍五入。
*
* @param v1
* 被除数
* @param v2
* 除数
* @param scale
* 表示表示需要精确到小数点以后几位。
* @return 两个参数的商
*/
public static double div(double v1, double v2, int scale) {
if (scale < 0) {
throw new IllegalArgumentException("The scale must be a positive integer or zero");
}
BigDecimal b1 = new BigDecimal(Double.toString(v1));
BigDecimal b2 = new BigDecimal(Double.toString(v2));
return b1.divide(b2, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
}
/**
* 提供精确的小数位四舍五入处理。
*
* @param v
* 需要四舍五入的数字
* @param scale
* 小数点后保留几位
* @return 四舍五入后的结果
*/
public static double round(double v, int scale) {
if (scale < 0) {
throw new IllegalArgumentException("The scale must be a positive integer or zero");
}
BigDecimal b = new BigDecimal(Double.toString(v));
BigDecimal one = new BigDecimal("1");
return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue();
}
}
| [
"888xin@sina.com"
] | 888xin@sina.com |
8eedb960dd70c62516ac6740948d946ef01b02c5 | 5f94d15174b067937b7133a12c84ba5e145aa93a | /Cvac/src/main/java/cn/misection/cvac/constant/LexerCommon.java | eb16614b55c1e2957efdb6b5380118a218916ac9 | [
"MIT"
] | permissive | MilitaryIntelligence6/Cva | 6516ca266c36b1e4fe6d126189c0ca41b3028148 | c66a168b448b4316d09f7a81d152e3c3eede2bd8 | refs/heads/master | 2023-07-19T01:11:30.110403 | 2021-09-01T15:37:14 | 2021-09-01T15:37:14 | 338,727,422 | 73 | 12 | null | 2021-02-27T13:12:34 | 2021-02-14T04:19:07 | Java | UTF-8 | Java | false | false | 405 | java | package cn.misection.cvac.constant;
/**
* @author Military Intelligence 6 root
* @version 1.0.0
* @ClassName TokenConstPool
* @Description TODO
* @CreateTime 2021年02月16日 20:32:00
*/
public final class LexerCommon {
/**
* lexer 和buffer中文件末尾;
*/
public static final char EOF = 0;
public static final char NEW_LINE = '\n';
private LexerCommon() {
}
}
| [
"hlrongzun@qq.com"
] | hlrongzun@qq.com |
48ae23d08d5cf30757865f39e678d352c701273b | 01b9219c796f14b39486b1b6d3e21618f3ea7bdc | /faceye-search-book-manager/src/main/java/com/faceye/component/spider/doc/MatcherConfig.java | 21bda5adc9f340b8311019766d6bf33875188acb | [] | no_license | haipenge/faceye-search | aedb93f3d90da0ba0231b35064540608966aaebb | c47cd9021fa60d7e0c66cf9981abb91d1a8be5cf | refs/heads/master | 2020-07-15T01:18:10.555756 | 2019-04-29T06:02:32 | 2019-04-29T06:02:32 | 73,872,563 | 0 | 2 | null | null | null | null | UTF-8 | Java | false | false | 3,285 | java | package com.faceye.component.spider.doc;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import org.springframework.data.mongodb.core.mapping.Document;
/**
* MatcherConfig ORM 实体
* 数据库表:spider_matcherConfig
* @author @haipenge
* haipenge@gmail.com
* Create Date:2014年5月21日
*/
@Document(collection="spider_matcherConfig")
public class MatcherConfig implements Serializable {
/**
*
*/
private static final long serialVersionUID = 8926119711730830203L;
@Id
private Long id=null;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
/**
* 说明:名称
* 属性名: name
* 类型: String
* 数据库字段:name
* @author haipenge
*/
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
/**
* 说明:正则表达式
* 属性名: regexp
* 类型: String
* 数据库字段:regexp
* @author haipenge
*/
private String regexp;
public String getRegexp() {
return regexp;
}
public void setRegexp(String regexp) {
this.regexp = regexp;
}
/**
* 说明:站ID
* 属性名: siteId
* 类型: Long
* 数据库字段:site_id
* @author haipenge
*/
private Long siteId;
public Long getSiteId() {
return siteId;
}
public void setSiteId(Long siteId) {
this.siteId = siteId;
}
/**
* 说明:页面匹配类型
* 属性名: type
* 类型: Integer
* 数据库字段:type
* @author haipenge
*/
private Integer type;
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
/**
* 说明:前缀
* 属性名: prefix
* 类型: String
* 数据库字段:prefix
* @author haipenge
*/
private String prefix;
public String getPrefix() {
return prefix;
}
public void setPrefix(String prefix) {
this.prefix = prefix;
}
/**
* 说明:缀
* 属性名: suffix
* 类型: String
* 数据库字段:suffix
* @author haipenge
*/
private String suffix;
public String getSuffix() {
return suffix;
}
public void setSuffix(String suffix) {
this.suffix = suffix;
}
/**
* 说明:标题匹配
* 属性名: titleRegexp
* 类型: String
* 数据库字段:title_regexp
* @author haipenge
*/
private String titleRegexp;
public String getTitleRegexp() {
return titleRegexp;
}
public void setTitleRegexp(String titleRegexp) {
this.titleRegexp = titleRegexp;
}
/**
* 说明:解析后的链接类型
* 属性名: typeOfLinkAfterParse
* 类型: Integer
* 数据库字段:type_of_link_after_parse
* @author haipenge
*/
private Integer typeOfLinkAfterParse;
public Integer getTypeOfLinkAfterParse() {
return typeOfLinkAfterParse;
}
public void setTypeOfLinkAfterParse(Integer typeOfLinkAfterParse) {
this.typeOfLinkAfterParse = typeOfLinkAfterParse;
}
}/**@generate-entity-source@**/
| [
"haipenge@gmail.com"
] | haipenge@gmail.com |
9e4a7f2626e65ec9295e05024a6c037c08e58afd | e977c424543422f49a25695665eb85bfc0700784 | /benchmark/icse15/922409/buggy-version/incubator/cassandra/trunk/src/java/org/apache/cassandra/locator/AbstractReplicationStrategy.java | 313b372263b19c9daa1311d8e6f9aca78ed9f7b6 | [] | no_license | amir9979/pattern-detector-experiment | 17fcb8934cef379fb96002450d11fac62e002dd3 | db67691e536e1550245e76d7d1c8dced181df496 | refs/heads/master | 2022-02-18T10:24:32.235975 | 2019-09-13T15:42:55 | 2019-09-13T15:42:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,473 | 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.cassandra.locator;
import java.net.InetAddress;
import java.util.*;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.log4j.Logger;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import org.apache.cassandra.dht.Range;
import org.apache.cassandra.dht.Token;
import org.apache.cassandra.gms.FailureDetector;
import org.apache.cassandra.gms.Gossiper;
import org.apache.cassandra.service.WriteResponseHandler;
import org.apache.cassandra.thrift.ConsistencyLevel;
import org.apache.cassandra.utils.FBUtilities;
/**
* This class contains a helper method that will be used by
* all abstraction that implement the IReplicaPlacementStrategy
* interface.
*/
public abstract class AbstractReplicationStrategy
{
protected static final Logger logger_ = Logger.getLogger(AbstractReplicationStrategy.class);
private TokenMetadata tokenMetadata_;
protected final IEndPointSnitch snitch_;
AbstractReplicationStrategy(TokenMetadata tokenMetadata, IEndPointSnitch snitch)
{
tokenMetadata_ = tokenMetadata;
snitch_ = snitch;
}
/**
* get the endpoints that should store the given Token, for the given table.
* Note that while the endpoints are conceptually a Set (no duplicates will be included),
* we return a List to avoid an extra allocation when sorting by proximity later.
*/
public abstract ArrayList<InetAddress> getNaturalEndpoints(Token token, TokenMetadata metadata, String table);
public WriteResponseHandler getWriteResponseHandler(int blockFor, ConsistencyLevel consistency_level, String table)
{
return new WriteResponseHandler(blockFor, table);
}
public ArrayList<InetAddress> getNaturalEndpoints(Token token, String table)
{
return getNaturalEndpoints(token, tokenMetadata_, table);
}
/**
* returns multimap of {live destination: ultimate targets}, where if target is not the same
* as the destination, it is a "hinted" write, and will need to be sent to
* the ultimate target when it becomes alive again.
*/
public Multimap<InetAddress, InetAddress> getHintedEndpoints(String table, Collection<InetAddress> targets)
{
Multimap<InetAddress, InetAddress> map = HashMultimap.create(targets.size(), 1);
IEndPointSnitch endPointSnitch = DatabaseDescriptor.getEndPointSnitch(table);
// first, add the live endpoints
for (InetAddress ep : targets)
{
if (FailureDetector.instance.isAlive(ep))
map.put(ep, ep);
}
if (map.size() == targets.size())
return map; // everything was alive
// assign dead endpoints to be hinted to the closest live one, or to the local node
// (since it is trivially the closest) if none are alive. This way, the cost of doing
// a hint is only adding the hint header, rather than doing a full extra write, if any
// destination nodes are alive.
//
// we do a 2nd pass on targets instead of using temporary storage,
// to optimize for the common case (everything was alive).
InetAddress localAddress = FBUtilities.getLocalAddress();
for (InetAddress ep : targets)
{
if (map.containsKey(ep))
continue;
InetAddress destination = map.isEmpty()
? localAddress
: endPointSnitch.getSortedListByProximity(localAddress, map.keySet()).get(0);
map.put(destination, ep);
}
return map;
}
/**
* write endpoints may be different from read endpoints, because read endpoints only need care about the
* "natural" nodes for a token, but write endpoints also need to account for nodes that are bootstrapping
* into the ring, and write data there too so that they stay up to date during the bootstrap process.
* Thus, this method may return more nodes than the Replication Factor.
*
* If possible, will return the same collection it was passed, for efficiency.
*
* Only ReplicationStrategy should care about this method (higher level users should only ask for Hinted).
* todo: this method should be moved into TokenMetadata.
*/
public Collection<InetAddress> getWriteEndpoints(Token token, String table, Collection<InetAddress> naturalEndpoints)
{
if (tokenMetadata_.getPendingRanges(table).isEmpty())
return naturalEndpoints;
List<InetAddress> endpoints = new ArrayList<InetAddress>(naturalEndpoints);
for (Map.Entry<Range, Collection<InetAddress>> entry : tokenMetadata_.getPendingRanges(table).entrySet())
{
if (entry.getKey().contains(token))
{
endpoints.addAll(entry.getValue());
}
}
return endpoints;
}
/*
NOTE: this is pretty inefficient. also the inverse (getRangeAddresses) below.
this is fine as long as we don't use this on any critical path.
(fixing this would probably require merging tokenmetadata into replicationstrategy, so we could cache/invalidate cleanly.)
*/
public Multimap<InetAddress, Range> getAddressRanges(TokenMetadata metadata, String table)
{
Multimap<InetAddress, Range> map = HashMultimap.create();
for (Token token : metadata.sortedTokens())
{
Range range = metadata.getPrimaryRangeFor(token);
for (InetAddress ep : getNaturalEndpoints(token, metadata, table))
{
map.put(ep, range);
}
}
return map;
}
public Multimap<Range, InetAddress> getRangeAddresses(TokenMetadata metadata, String table)
{
Multimap<Range, InetAddress> map = HashMultimap.create();
for (Token token : metadata.sortedTokens())
{
Range range = metadata.getPrimaryRangeFor(token);
for (InetAddress ep : getNaturalEndpoints(token, metadata, table))
{
map.put(range, ep);
}
}
return map;
}
public Multimap<InetAddress, Range> getAddressRanges(String table)
{
return getAddressRanges(tokenMetadata_, table);
}
public Collection<Range> getPendingAddressRanges(TokenMetadata metadata, Token pendingToken, InetAddress pendingAddress, String table)
{
TokenMetadata temp = metadata.cloneOnlyTokenMap();
temp.updateNormalToken(pendingToken, pendingAddress);
return getAddressRanges(temp, table).get(pendingAddress);
}
}
| [
"durieuxthomas@hotmail.com"
] | durieuxthomas@hotmail.com |
c45860deceee4fec22169f72e5ef8f1f0a7f030b | c2d8181a8e634979da48dc934b773788f09ffafb | /storyteller/output/tonersaver/PostDepartmentDetailAction.java | ca6b0c51bc389ff76ae4fd9fbe900ae75d977c5b | [] | no_license | toukubo/storyteller | ccb8281cdc17b87758e2607252d2d3c877ffe40c | 6128b8d275efbf18fd26d617c8503a6e922c602d | refs/heads/master | 2021-05-03T16:30:14.533638 | 2016-04-20T12:52:46 | 2016-04-20T12:52:46 | 9,352,300 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,945 | java | package net.tonersaver.web.app;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.tonersaver.model.*;
import net.tonersaver.beans.*;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.web.context.support.WebApplicationContextUtils;
import net.enclosing.util.HibernateSession;
import net.storyteller.desktop.CopyProperties;
public class PostDepartmentDetailAction extends Action{
public ActionForward execute(
ActionMapping mapping,
ActionForm form,
HttpServletRequest req,
HttpServletResponse res) throws Exception{
Session session = new HibernateSession().currentSession(this
.getServlet().getServletContext());
Department department = new DepartmentImpl();
DepartmentForm departmentform = new DepartmentForm();
Criteria criteria = session.createCriteria(Department.class);
if (req.getAttribute("form")== null && req.getParameter("id")!=null){
criteria.add(Restrictions.idEq(Integer.valueOf(req
.getParameter("id"))));
department = (Department) criteria.uniqueResult();
new CopyProperties(department,departmentform);
} else if(req.getAttribute("form")!=null){
departmentform = (DepartmentForm)req.getAttribute("form");
criteria.add(Restrictions.idEq(departmentform.getId()));
department = (Department) criteria.uniqueResult();
}
req.setAttribute("model",department);
req.setAttribute("form",departmentform);
return mapping.findForward("success");
}
} | [
"toukubo@gmail.com"
] | toukubo@gmail.com |
a2dcc2f2a5f7a2144c5906e98ce8f34ece780f5e | 42cf61c31bc325a5aea4826dff2d5d6cf0fe43a7 | /core-customize/tcstorefront/web/src/com/taloscommerce/storefront/tags/TestIdTag.java | 3e6234f40d7ddc4c19808478637e0293686005de | [] | no_license | alejandroGranada/spartacus-training-mentorship | 13124011cb012c5f108189bf5de3e1d8b1891be2 | 9a2fac012075e4666a814907d6428b78e8e63299 | refs/heads/master | 2023-07-11T11:29:40.607278 | 2021-07-01T15:51:25 | 2021-07-01T15:51:25 | 381,724,390 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,937 | java | /*
* Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
*/
package com.taloscommerce.storefront.tags;
import de.hybris.platform.util.Config;
import java.io.IOException;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.PageContext;
import javax.servlet.jsp.tagext.SimpleTagSupport;
/**
* Tag that generates a wrapping div with the specified id. The id is suffixed with an incrementing counter for the page
* request to ensure that it is unique. The wrapper divs can be turned on and off via a configuration property.
*/
public class TestIdTag extends SimpleTagSupport
{
protected static final String ENABLE_TEST_IDS_PROPERTY = "tcstorefront.testIds.enable";
protected static final String TEST_ID_TAG_NEXT = "__test_id_tag_next__";
private String code;
protected String getCode()
{
return code;
}
public void setCode(final String code)
{
this.code = code;
}
@Override
public void doTag() throws JspException, IOException
{
final boolean enabled = Config.getBoolean(ENABLE_TEST_IDS_PROPERTY, false);
if (enabled)
{
final PageContext pageContext = (PageContext) getJspContext();
final JspWriter jspWriter = pageContext.getOut();
final int nextUniqueId = getNextUniqueId(pageContext);
jspWriter.append("<div id=\"").append("test_").append(cleanupHtmlId(getCode())).append("_$")
.append(String.valueOf(nextUniqueId)).append("\" style=\"display:inline\">");
// Write the body out
getJspBody().invoke(null);
jspWriter.println("</div>");
}
else
{
// Just render the contents
getJspBody().invoke(null);
}
}
protected int getNextUniqueId(final PageContext pageContext)
{
final Object value = pageContext.getAttribute(TEST_ID_TAG_NEXT, PageContext.PAGE_SCOPE);
if (value instanceof Integer)
{
final int nextVal = ((Integer) value).intValue();
pageContext.setAttribute(TEST_ID_TAG_NEXT, Integer.valueOf(nextVal + 1), PageContext.PAGE_SCOPE);
return nextVal;
}
else
{
// No attribute found, set next to 2, and return 1.
pageContext.setAttribute(TEST_ID_TAG_NEXT, Integer.valueOf(2), PageContext.PAGE_SCOPE);
return 1;
}
}
protected String cleanupHtmlId(final String text)
{
final StringBuilder result = new StringBuilder(text.length());
for (int i = 0; i < text.length(); i++)
{
processCharacter(text, result, i);
}
return result.toString();
}
protected void processCharacter(final String text, final StringBuilder result, final int i) {
final char c = text.charAt(i);
checkAlphanumeric(c, result);
checkSpecial(c, result);
}
protected void checkAlphanumeric(final char c, final StringBuilder result) {
if (Character.isLetterOrDigit(c)) {
result.append(c);
}
}
protected void checkSpecial(final char c, final StringBuilder result) {
if ( c == '-' || c == '_' || c == '.' || c == ':') {
result.append(c);
}
}
}
| [
"sergio.granada@talosdigital.com"
] | sergio.granada@talosdigital.com |
c219bfea2a39c3a317254328edba5e13de57853f | 0af8b92686a58eb0b64e319b22411432aca7a8f3 | /large-multiproject/project97/src/main/java/org/gradle/test/performance97_3/Production97_284.java | e4011bad9f09d48cd81f064a99b3f2bba55035c3 | [] | no_license | gradle/performance-comparisons | b0d38db37c326e0ce271abebdb3c91769b860799 | e53dc7182fafcf9fedf07920cbbea8b40ee4eef4 | refs/heads/master | 2023-08-14T19:24:39.164276 | 2022-11-24T05:18:33 | 2022-11-24T05:18:33 | 80,121,268 | 17 | 15 | null | 2022-09-30T08:04:35 | 2017-01-26T14:25:33 | null | UTF-8 | Java | false | false | 305 | java | package org.gradle.test.performance97_3;
public class Production97_284 extends org.gradle.test.performance17_3.Production17_284 {
private final String property;
public Production97_284() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
| [
"cedric.champeau@gmail.com"
] | cedric.champeau@gmail.com |
21a2c1dc0c194d7bc71ee7de97342476ffbfa26c | 195d20adbfe6c17fdff26d3b4518e6a903cbb777 | /src/main/java/com/space/repository/ShipRepository.java | 5cb11c931f358d7335a65b60c7c04999fd6e11e3 | [] | no_license | Ponser2000/cosmoport | 46437eba305c1e0d4330d124e91b4a253fb5fc83 | fe8660c13c42a42306859b747b53b8823680692b | refs/heads/master | 2023-02-06T03:48:17.355470 | 2020-12-28T13:09:01 | 2020-12-28T17:34:51 | 323,714,289 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 410 | java | package com.space.repository;
import com.space.model.Ship;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
/**
* @author Sergey Ponomarev on 23.12.2020
* @project cosmoport/com.space.repository
*/
@Repository
public interface ShipRepository extends CrudRepository<Ship, Long> {
}
| [
"ponser2000@gmail.com"
] | ponser2000@gmail.com |
e544a9b346bd1be66ec6aa19e3dab9a44dc85dd7 | bd9e8f278e9aae9ad497ac61f064e1636b1cb5e0 | /core/src/test/java/co/aikar/taskchain/MockTaskChainFactory.java | d57def97ddb988ff0a3185e932cbc63990bb2cf8 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | MiniDigger/TaskChain | 967a30b478b436f31ca2528a05cc516520373d4e | de217f49597231b103fbf695a488a3def152b65a | refs/heads/master | 2023-04-18T13:56:23.244496 | 2016-10-31T19:10:31 | 2016-10-31T19:10:31 | 72,451,277 | 1 | 0 | MIT | 2023-04-04T00:19:09 | 2016-10-31T15:41:41 | Java | UTF-8 | Java | false | false | 2,672 | java | /*
* Copyright (c) 2016 Daniel Ennis (Aikar) - MIT License
*
* 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.aikar.taskchain;
/**
* Created by MiniDigger on 31.10.2016.
*/
@SuppressWarnings({"WeakerAccess", "unused"})
public class MockTaskChainFactory extends TaskChainFactory {
private MockTaskChainFactory(MockScheduler scheduler) {
super(new MockGameInterface(scheduler));
}
public static TaskChainFactory create(MockScheduler scheduler) {
return new MockTaskChainFactory(scheduler);
}
@SuppressWarnings("PublicInnerClass")
private static class MockGameInterface implements GameInterface {
private final AsyncQueue asyncQueue;
private final MockScheduler mockScheduler;
MockGameInterface(MockScheduler scheduler) {
this.mockScheduler = scheduler;
this.asyncQueue = new TaskChainAsyncQueue();
}
@Override
public AsyncQueue getAsyncQueue() {
return this.asyncQueue;
}
@Override
public boolean isMainThread() {
return mockScheduler.isMainThread();
}
@Override
public void postToMain(Runnable run) {
mockScheduler.postToMain(run);
}
@Override
public void scheduleTask(int ticks, Runnable run) {
mockScheduler.scheduleTask(ticks, run);
}
@Override
public void registerShutdownHandler(TaskChainFactory factory) {
mockScheduler.registerShutdownHandler(factory);
}
}
}
| [
"admin@minidigger.me"
] | admin@minidigger.me |
88f5034357070898873b3a41e3d12fe3041903c2 | 73e79f827b1c74684d6cf7072ae5abd30921efc4 | /test/integ/DefaultAnnotationTest.java | 268bb0717ed2b458fc70fab493e5a369f7232393 | [
"MIT"
] | permissive | MedRedha/redex | a202bb74fd3a7ac51cc0d6afedc4f58bca08c0ae | aba81f4b2425800c451c44cb52066d9e392e4926 | refs/heads/master | 2020-06-06T03:53:06.378094 | 2019-06-18T23:11:11 | 2019-06-18T23:16:46 | 192,630,837 | 1 | 0 | MIT | 2019-06-19T00:36:27 | 2019-06-19T00:36:27 | null | UTF-8 | Java | false | false | 1,025 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* This Java class is used to test the parsing of default annotation values
*/
package com.facebook.redextest;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@interface ExampleAnnotation {
String strVal() default "defaultStrValue";
int intVal() default 42;
boolean booleanVal() default true;
}
class Annotation {
@ExampleAnnotation
public static void foo() {
return;
}
@ExampleAnnotation(strVal = "overriddenStrValue", intVal = 100, booleanVal=false)
public static void bar() {
return;
}
}
public class DefaultAnnotationTest {
public static void main(String[] args) {
Annotation.foo();
Annotation.bar();
}
}
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
850854ac31a2437554775899f3898cd7539627d3 | 103e0d6c397ef2756a028fb1b3ef01b7b03f5460 | /foursquare/src/main/java/com/platzerworld/foursquare/listeners/CheckInListener.java | 5429983539b8004cec41f3b5f02c8c9c8b6e4e6c | [] | no_license | platzerg/FakeMe | c46369f582cdf9ddd84cd153c2c56dd48cb46546 | 8fd3d4c973821ec83ac2d8262995adf359754262 | refs/heads/master | 2021-01-22T17:58:02.582762 | 2014-09-07T09:58:50 | 2014-09-07T09:58:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 208 | java | package com.platzerworld.foursquare.listeners;
import com.platzerworld.foursquare.models.Checkin;
public interface CheckInListener extends ErrorListener {
public void onCheckInDone(Checkin checkin);
}
| [
"guenter.platzerworld@googlemail.com"
] | guenter.platzerworld@googlemail.com |
27590d995aa554fe429405c1cffd5fb0f21bbc41 | eeec0d68507a64b0eae5dbaaa83d24edfdac912b | /Folder01/java_basic/src/day14/chap01StringClass/mainClass.java | 0ada9ad9b85047569a4398003d5eb8bd7b58b43f | [] | no_license | BellKim/Bitcmap_java_basic | 0eece2fa4bf6e8ef9c42be8d8e4d2f6340854d9a | 6cda0e88793e59d61d16da8f621b9a96f954d41d | refs/heads/master | 2022-12-24T22:30:04.586343 | 2020-03-29T17:55:46 | 2020-03-29T17:55:46 | 219,406,630 | 1 | 1 | null | 2022-12-16T14:51:43 | 2019-11-04T03:07:26 | Java | UTF-8 | Java | false | false | 4,460 | java | package day14.chap01StringClass;
public class mainClass {
public static void main(String[] args) {
// String
// 문자열 저장,편집,정보
String str; // String == class -> 설계
// str == Object(객체), instance(주체)
// [선언방법]
str = new String(); // case1
// str : 메모리상 stack영역 속함
// new String : 메모리상 Heap영역 속함
str = "hello";
// str = "hello" == char cArr[] = {'h','e','l','l','o',};
char cArr[] = { 'h', 'e', 'l', 'l', 'o' };
String str1 = new String(cArr); // case2
String str2 = new String("hahahoho");
System.out.println("str = " + str);
System.out.println("str1 = " + str1);
System.out.println("str2 = " + str2);
// operator +
String str3 = str1 + str2;
String str4 = str3 + "java";
System.out.println("str3 = " + str3);
System.out.println("str4 = " + str4);
// 비교함수
// equals()
// 문자열 비교시 사용하는 함수
String str5 = null;
String str6 = "";
System.out.println(str5);
System.out.println(str6);
str5 = "world";
str6 = "worl";
str6 = str6 + "d";
// (==)
if (str5 == str6) { // 다른 문자열로 출력됨
System.out.println("같은 문자열");
} else {
System.out.println("다른 문자열");
}
// (equals)
if (str5.equals(str6) == true) { // 같은 문자열로 출력됨
System.out.println("같은 문자열");
} else {
System.out.println("다른 문자열");
}
// indexOf()
// 문자열에서 특정 문자가 몇번째 위치에 존재하는지 수치(index값(0부터시작))로 리턴하는 함수
// 앞에서부터의 순서 (indexOf)
String str7 = "welcome";
int n = str7.indexOf("c");
System.out.println("n = " + n);
// 뒤에서부터의 순서 (lastIndexOf)
n = str7.lastIndexOf("c");
System.out.println("n = " + n);
// length()
// 문자열의 총길이 리턴하는 함수
System.out.println("str7 = " + str7.length());
// replace()
// 문자열 수정하는 함수
String str8 = "A*B*C*D*E*F";
String repStr = str8.replace("*", " ");
System.out.println("Str8 = " + str8);
System.out.println("repStr = " + repStr);
// substring-> substr
// 원하는 부분의 문자열만을 산출.
// substring("시작위치의 index 0~", "지정위치의 전까지") abcde (1,4)
String str9 = "홍길동-24-17/12/13-서울시";
String subStr = str9.substring(4, 6);// 4~6가지 불러와라.
System.out.println(subStr);
str9 = "abcDEF";
// toUpperCase
// toLowCase
String upStr = str9.toUpperCase();
String lowStr = str9.toLowerCase();
System.out.println(upStr + " " + lowStr);
// trim
// 공백을 없애주는 함수()
String str10 = " java java java3 ";
System.out.println(str10);
System.out.println(str10.trim());
// 검색을 할때 처음부터 공백을 입력하고 단어를 치는것과, 공백없이 입력하는것과는 전혀 다른단어가된다.
// trim() 메소드는 이런 상황을 피해주기 위해서 첫 입력공간에 공백을 없애주는 역할을 한다.
// valueOf
// 숫자 => 문자열로 변경.
// 123 -> "123"
// 123.4567 -> "123.4567"
int num = 123;
long lo = 12345L;// 롱 형태에서는 L 을 붙혀야 오류가 안난다.
double d = 123.4567;
String iStr = String.valueOf(num);
String lStr = String.valueOf(lo);
String dStr = String.valueOf(d);
System.out.println(" " + iStr + " " + lStr + " " + dStr);
String _str = num + "";
System.out.println(_str);
// contains
// 탐색
// 알고리즘 : 정렬, 셔플, 트리, 탐색 => 탐색이 제일 많이 사용하는 알고리즘이다.(검색이라고도한다.)
String str11 = "서울시 강남구";
String findstr = "강남";
boolean b1 = str11.contains(findstr); // contains의 출력값은 블린형.
System.out.println();
if (b1) {
System.out.println("검색한 문자열이 있습니다. ");
} else {
System.out.println("검색한 문자열이 없습습니다. ");
}
// charAt
// string 을 배열과 같이 사용할 수 있는 함수.
char ch = str11.charAt(5);
System.out.println("ch = " + ch);
// concat
String str12 = "안녕하세요";
String str13 = "반갑습니다.";
String conStr = str12.concat(str13); // 잘 사용 안한다.
System.out.println("conStr = " + conStr);//
String ss = str12 + str13; // 더 편한 방법이 있기때문에.
System.out.println("ss = " + ss);
}// end main
}
| [
"goste390@gmail.com"
] | goste390@gmail.com |
981759842f45605e981d093b61dfdc49537f3155 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/2/2_5a4782df34c85ca03afc186a6b63f27aa4603618/PluginDeployer/2_5a4782df34c85ca03afc186a6b63f27aa4603618_PluginDeployer_s.java | 44ec39c4b93fabe5b52cf43509154670328dcc9f | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 8,182 | java | /*
* Sonar, open source software quality management tool.
* Copyright (C) 2008-2012 SonarSource
* mailto:contact AT sonarsource DOT com
*
* Sonar 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.
*
* Sonar 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 Sonar; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
package org.sonar.server.plugins;
import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.sonar.api.ServerComponent;
import org.sonar.api.platform.PluginMetadata;
import org.sonar.api.platform.Server;
import org.sonar.api.utils.SonarException;
import org.sonar.api.utils.TimeProfiler;
import org.sonar.core.plugins.DefaultPluginMetadata;
import org.sonar.core.plugins.PluginInstaller;
import org.sonar.server.platform.DefaultServerFileSystem;
import org.sonar.updatecenter.common.PluginReferential;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
public class PluginDeployer implements ServerComponent {
private static final Logger LOG = LoggerFactory.getLogger(PluginDeployer.class);
private final Server server;
private final DefaultServerFileSystem fileSystem;
private final PluginInstaller installer;
private final Map<String, PluginMetadata> pluginByKeys = Maps.newHashMap();
public PluginDeployer(Server server, DefaultServerFileSystem fileSystem) {
this(server, fileSystem, new PluginInstaller());
}
PluginDeployer(Server server, DefaultServerFileSystem fileSystem, PluginInstaller installer) {
this.server = server;
this.fileSystem = fileSystem;
this.installer = installer;
}
public void start() {
TimeProfiler profiler = new TimeProfiler().start("Install plugins");
deleteUninstalledPlugins();
loadUserPlugins();
moveAndLoadDownloadedPlugins();
loadCorePlugins();
deployPlugins();
profiler.stop();
}
private void deleteUninstalledPlugins() {
File trashDir = fileSystem.getRemovedPluginsDir();
try {
if (trashDir.exists()) {
FileUtils.deleteDirectory(trashDir);
}
} catch (IOException e) {
throw new SonarException("Fail to clean the plugin trash directory: " + trashDir, e);
}
}
private void loadUserPlugins() {
for (File file : fileSystem.getUserPlugins()) {
registerPlugin(file, false, false);
}
}
private void registerPlugin(File file, boolean isCore, boolean canDelete) {
DefaultPluginMetadata metadata = installer.extractMetadata(file, isCore);
if (StringUtils.isBlank(metadata.getKey())) {
return;
}
PluginMetadata existing = pluginByKeys.put(metadata.getKey(), metadata);
if ((existing != null) && !canDelete) {
throw new IllegalStateException("Found two plugins with the same key '" + metadata.getKey() + "': " + metadata.getFile().getName() + " and "
+ existing.getFile().getName());
}
if (existing != null) {
FileUtils.deleteQuietly(existing.getFile());
LOG.info("Plugin " + metadata.getKey() + " replaced by new version");
}
}
private void moveAndLoadDownloadedPlugins() {
if (fileSystem.getDownloadedPluginsDir().exists()) {
Collection<File> jars = FileUtils.listFiles(fileSystem.getDownloadedPluginsDir(), new String[] {"jar"}, false);
for (File jar : jars) {
File movedJar = moveDownloadedFile(jar);
if (movedJar != null) {
registerPlugin(movedJar, false, true);
}
}
}
}
private File moveDownloadedFile(File jar) {
File destDir = fileSystem.getUserPluginsDir();
File destFile = new File(destDir, jar.getName());
if (destFile.exists()) {
// plugin with same filename already installed
FileUtils.deleteQuietly(jar);
return null;
}
try {
FileUtils.moveFileToDirectory(jar, destDir, true);
return destFile;
} catch (IOException e) {
LOG.error("Fail to move the downloaded file: " + jar.getAbsolutePath(), e);
return null;
}
}
private void loadCorePlugins() {
for (File file : fileSystem.getCorePlugins()) {
registerPlugin(file, true, false);
}
}
public void uninstall(String pluginKey) {
for (String key : getPluginReferential().findReleasesWithDependencies(pluginKey)) {
uninstallPlugin(key);
}
}
private void uninstallPlugin(String pluginKey) {
PluginMetadata metadata = pluginByKeys.get(pluginKey);
if ((metadata != null) && !metadata.isCore()) {
try {
File masterFile = new File(fileSystem.getUserPluginsDir(), metadata.getFile().getName());
FileUtils.moveFileToDirectory(masterFile, fileSystem.getRemovedPluginsDir(), true);
} catch (IOException e) {
throw new SonarException("Fail to uninstall plugin: " + pluginKey, e);
}
}
}
public List<String> getUninstalls() {
List<String> names = Lists.newArrayList();
if (fileSystem.getRemovedPluginsDir().exists()) {
List<File> files = (List<File>) FileUtils.listFiles(fileSystem.getRemovedPluginsDir(), new String[] {"jar"}, false);
for (File file : files) {
names.add(file.getName());
}
}
return names;
}
public void cancelUninstalls() {
if (fileSystem.getRemovedPluginsDir().exists()) {
List<File> files = (List<File>) FileUtils.listFiles(fileSystem.getRemovedPluginsDir(), new String[] {"jar"}, false);
for (File file : files) {
try {
FileUtils.moveFileToDirectory(file, fileSystem.getUserPluginsDir(), false);
} catch (IOException e) {
throw new SonarException("Fail to cancel plugin uninstalls", e);
}
}
}
}
private void deployPlugins() {
for (PluginMetadata metadata : pluginByKeys.values()) {
deploy((DefaultPluginMetadata) metadata);
}
}
private void deploy(DefaultPluginMetadata plugin) {
LOG.info("Deploy plugin {}", Joiner.on(" / ").skipNulls().join(plugin.getName(), plugin.getVersion(), plugin.getImplementationBuild()));
Preconditions.checkState(plugin.isCompatibleWith(server.getVersion()),
"Plugin %s needs a more recent version of Sonar than %s. At least %s is expected",
plugin.getKey(), server.getVersion(), plugin.getSonarVersion());
try {
File pluginDeployDir = new File(fileSystem.getDeployedPluginsDir(), plugin.getKey());
FileUtils.forceMkdir(pluginDeployDir);
FileUtils.cleanDirectory(pluginDeployDir);
List<File> deprecatedExtensions = fileSystem.getExtensions(plugin.getKey());
for (File deprecatedExtension : deprecatedExtensions) {
plugin.addDeprecatedExtension(deprecatedExtension);
}
installer.install(plugin, pluginDeployDir);
} catch (IOException e) {
throw new RuntimeException("Fail to deploy the plugin " + plugin, e);
}
}
public Collection<PluginMetadata> getMetadata() {
return pluginByKeys.values();
}
public PluginMetadata getMetadata(String pluginKey) {
return pluginByKeys.get(pluginKey);
}
private PluginReferential getPluginReferential() {
return PluginReferentialMetadataConverter.getInstalledPluginReferential(getMetadata());
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
34a9d0f3cf40a21ce74a898b8595403cec72cca0 | 8b46b9c92e7b35919618b0696b3657ee13010945 | /src/main/java/org/codelibs/fione/h2o/bindings/pojos/XGBoostModelOutputV3.java | 9fe08fd757ea0b34a3896518ad7366d3dc2ae7a5 | [
"Apache-2.0"
] | permissive | fireae/fione | 837bebc22f7b7d42ed3079ff212eaf17cbcfebc6 | b26f74d2fff6b9c34f64446503dd45edf0716ed8 | refs/heads/master | 2021-03-11T05:02:53.309517 | 2020-03-09T20:49:31 | 2020-03-09T20:49:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,025 | java | /*
* Copyright 2012-2020 CodeLibs Project and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.codelibs.fione.h2o.bindings.pojos;
import org.codelibs.fione.entity.ChartData;
import com.google.gson.GsonBuilder;
import com.google.gson.annotations.SerializedName;
public class XGBoostModelOutputV3 extends ModelOutputSchemaV3 {
/**
* Variable Importances
*/
@SerializedName("variable_importances")
public TwoDimTableV3 variableImportances;
/**
* Variable Importances - Cover
*/
@SerializedName("variable_importances_cover")
public TwoDimTableV3 variableImportancesCover;
/**
* Variable Importances - Frequency
*/
@SerializedName("variable_importances_frequency")
public TwoDimTableV3 variableImportancesFrequency;
/**
* XGBoost Native Parameters
*/
@SerializedName("native_parameters")
public TwoDimTableV3 nativeParameters;
/**
* Sparse
*/
public boolean sparse;
/*------------------------------------------------------------------------------------------------------------------
// INHERITED
//------------------------------------------------------------------------------------------------------------------
// Column names
public String[] names;
// Column types
public String[] columnTypes;
// Domains for categorical columns
public String[][] domains;
// Cross-validation models (model ids)
public ModelKeyV3[] crossValidationModels;
// Cross-validation predictions, one per cv model (deprecated, use cross_validation_holdout_predictions_frame_id
// instead)
public FrameKeyV3[] crossValidationPredictions;
// Cross-validation holdout predictions (full out-of-sample predictions on training data)
public FrameKeyV3 crossValidationHoldoutPredictionsFrameId;
// Cross-validation fold assignment (each row is assigned to one holdout fold)
public FrameKeyV3 crossValidationFoldAssignmentFrameId;
// Category of the model (e.g., Binomial)
public ModelCategory modelCategory;
// Model summary
public TwoDimTableV3 modelSummary;
// Scoring history
public TwoDimTableV3 scoringHistory;
// Training data model metrics
public ModelMetricsBaseV3 trainingMetrics;
// Validation data model metrics
public ModelMetricsBaseV3 validationMetrics;
// Cross-validation model metrics
public ModelMetricsBaseV3 crossValidationMetrics;
// Cross-validation model metrics summary
public TwoDimTableV3 crossValidationMetricsSummary;
// Job status
public String status;
// Start time in milliseconds
public long startTime;
// End time in milliseconds
public long endTime;
// Runtime in milliseconds
public long runTime;
// Help information for output fields
public Map<String,String> help;
*/
/**
* Public constructor
*/
public XGBoostModelOutputV3() {
sparse = false;
status = "";
startTime = 0L;
endTime = 0L;
runTime = 0L;
}
/**
* Return the contents of this object as a JSON String.
*/
@Override
public String toString() {
return new GsonBuilder().serializeSpecialFloatingPointValues().create().toJson(this);
}
@Override
public ChartData getVariableImportancesChart() {
return getVariableImportancesChart(variableImportances);
}
}
| [
"shinsuke@apache.org"
] | shinsuke@apache.org |
a07e15c5347f91dc64c018b5ff858e0ebb9c9af0 | f0d25d83176909b18b9989e6fe34c414590c3599 | /app/src/main/java/com/google/android/gms/internal/zzcea.java | 49ff1588f4c004aa5080759c510125a50691a969 | [] | no_license | lycfr/lq | e8dd702263e6565486bea92f05cd93e45ef8defc | 123914e7c0d45956184dc908e87f63870e46aa2e | refs/heads/master | 2022-04-07T18:16:31.660038 | 2020-02-23T03:09:18 | 2020-02-23T03:09:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,224 | java | package com.google.android.gms.internal;
import android.os.Parcel;
import android.os.Parcelable;
import com.google.android.gms.common.internal.safeparcel.zzb;
import java.util.ArrayList;
public final class zzcea implements Parcelable.Creator<zzcdy> {
public final /* synthetic */ Object createFromParcel(Parcel parcel) {
int zzd = zzb.zzd(parcel);
ArrayList<zzcdw> arrayList = null;
String str = null;
String str2 = null;
while (parcel.dataPosition() < zzd) {
int readInt = parcel.readInt();
switch (65535 & readInt) {
case 1:
str2 = zzb.zzq(parcel, readInt);
break;
case 2:
str = zzb.zzq(parcel, readInt);
break;
case 6:
arrayList = zzb.zzc(parcel, readInt, zzcdw.CREATOR);
break;
default:
zzb.zzb(parcel, readInt);
break;
}
}
zzb.zzF(parcel, zzd);
return new zzcdy(str2, str, arrayList);
}
public final /* synthetic */ Object[] newArray(int i) {
return new zzcdy[i];
}
}
| [
"quyenlm.vn@gmail.com"
] | quyenlm.vn@gmail.com |
bff769577ec2eb9944ed2f8bb33b8749b4b85b91 | cae9c594e7dc920d17363c5731700088d30ef969 | /src/leetcode/algorithms/_334IncreasingTripletSubsequence.java | 038ec62c1755f77cdf78f36e3f84eec639d7a6ca | [] | no_license | tech-interview-prep/technical-interview-preparation | a0dd552838305d6995bf9e7dfb90f4571e2e2025 | 8b299d3e282452789f05b8d08135b5ff66c7b890 | refs/heads/master | 2022-02-08T09:28:35.889755 | 2022-02-06T22:20:48 | 2022-02-06T22:20:48 | 77,586,682 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 767 | java | package leetcode.algorithms;
/**
* https://oj.leetcode.com/problems/two-sum-ii-input-array-is-sorted/
* @author bkoteshwarreddy
*/
/**
* https://leetcode.com/problems/palindrome-number/
* @author bkoteshwarreddy
*/
public class _334IncreasingTripletSubsequence {
// [-3,3,4,90], 0
public int[] twoSum(int[] numbers, int target) {
int l = 0, r = numbers.length - 1, sum;
int[] idx = new int[2];
while (l < r) {
sum = numbers[l] + numbers[r];
if (sum == target) {
idx[0] = l + 1;
idx[1] = r + 1;
break;
} else if (sum < target) {
l++;
} else {
r--;
}
}
return idx;
}
}
| [
"bkoteshwarreddy+github@gmail.com"
] | bkoteshwarreddy+github@gmail.com |
2689601d00d65a39e76acbf2d34eb1521c5d3d66 | ad1ef39ddc137267b9123d47773f15962f26cbf9 | /app/src/main/java/com/wlm/wlm/ui/LoadRecyclerView.java | aec304b7e61bf45688fa73d49d746306b8d2e53a | [] | no_license | lilinkun/wlm | 6613393090202f1b0114274e26b6eef2e7ac6a66 | c8023b622417ca62dd7ebc0a665972ba5d240505 | refs/heads/master | 2021-07-05T21:35:02.448029 | 2020-11-19T09:12:53 | 2020-11-19T09:12:53 | 202,707,004 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,171 | java | package com.wlm.wlm.ui;
import android.content.Context;
import android.support.annotation.Nullable;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
public class LoadRecyclerView extends RecyclerView {
private RecyclerViewScrollListener rvScrollListener;
public LoadRecyclerView(Context context) {
this(context, null);
}
public LoadRecyclerView(Context context, @Nullable AttributeSet attrs) {
this(context, attrs, 0);
}
public LoadRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
init();
}
// 初始化方法
private void init() {
rvScrollListener = new RecyclerViewScrollListener();
this.addOnScrollListener(rvScrollListener);
}
// 设置是否加载更多
public void setLoading(boolean bool) {
rvScrollListener.setLoadingMore(bool);
}
// 加载更多
public void setOnLoadListener(RecyclerViewScrollListener.OnLoadListener onLoadListener) {
if (rvScrollListener != null)
rvScrollListener.setOnLoadListener(onLoadListener);
}
}
| [
"503735093@qq.com"
] | 503735093@qq.com |
b007e23b2079ccaf5b4d549b55aa2bc7a4a381c3 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a184/A184544Test.java | 7fb271be6cf4a783819929449c669d31746f686b | [] | 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.a184;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A184544Test extends AbstractSequenceTest {
}
| [
"sean.irvine@realtimegenomics.com"
] | sean.irvine@realtimegenomics.com |
59e429e33d637ba5f7f59633b6c0229fcdfb8010 | fe5623885c276372b3cec6ac41f8420c13229957 | /src/main/java/com/raoulvdberge/refinedstorage/gui/GuiFluidInterface.java | e9485447f2094b73e5cb25683a1ddb297199ad25 | [
"MIT"
] | permissive | Darkere/refinedstorage | ea4f468be410c5564debd091870db7f05c51b4f2 | 27cc76c39d86268502171c8c68eaa47631998a2c | refs/heads/mc1.12 | 2023-07-21T02:36:53.428047 | 2019-05-10T07:58:55 | 2019-05-10T07:58:55 | 182,048,628 | 0 | 0 | MIT | 2022-01-22T15:09:21 | 2019-04-18T08:31:40 | Java | UTF-8 | Java | false | false | 2,650 | java | package com.raoulvdberge.refinedstorage.gui;
import com.raoulvdberge.refinedstorage.apiimpl.API;
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeFluidInterface;
import com.raoulvdberge.refinedstorage.container.ContainerFluidInterface;
import com.raoulvdberge.refinedstorage.gui.control.SideButtonRedstoneMode;
import com.raoulvdberge.refinedstorage.tile.TileFluidInterface;
import com.raoulvdberge.refinedstorage.util.RenderUtils;
import net.minecraft.util.text.TextFormatting;
public class GuiFluidInterface extends GuiBase {
private static final RenderUtils.FluidRenderer TANK_RENDERER = new RenderUtils.FluidRenderer(NetworkNodeFluidInterface.TANK_CAPACITY, 12, 47);
public GuiFluidInterface(ContainerFluidInterface container) {
super(container, 211, 204);
}
@Override
public void init(int x, int y) {
addSideButton(new SideButtonRedstoneMode(this, TileFluidInterface.REDSTONE_MODE));
}
@Override
public void update(int x, int y) {
}
@Override
public void drawBackground(int x, int y, int mouseX, int mouseY) {
bindTexture("gui/fluid_interface.png");
drawTexture(x, y, 0, 0, screenWidth, screenHeight);
if (TileFluidInterface.TANK_IN.getValue() != null) {
TANK_RENDERER.draw(mc, x + 46, y + 56, TileFluidInterface.TANK_IN.getValue());
}
if (TileFluidInterface.TANK_OUT.getValue() != null) {
TANK_RENDERER.draw(mc, x + 118, y + 56, TileFluidInterface.TANK_OUT.getValue());
}
}
@Override
public void drawForeground(int mouseX, int mouseY) {
drawString(7, 7, t("gui.refinedstorage:fluid_interface"));
drawString(43 + 4, 20, t("gui.refinedstorage:fluid_interface.in"));
drawString(115 + 1, 20, t("gui.refinedstorage:fluid_interface.out"));
drawString(7, 111, t("container.inventory"));
if (inBounds(46, 56, 12, 47, mouseX, mouseY) && TileFluidInterface.TANK_IN.getValue() != null) {
drawTooltip(mouseX, mouseY, TileFluidInterface.TANK_IN.getValue().getLocalizedName() + "\n" + TextFormatting.GRAY + API.instance().getQuantityFormatter().formatInBucketForm(TileFluidInterface.TANK_IN.getValue().amount) + TextFormatting.RESET);
}
if (inBounds(118, 56, 12, 47, mouseX, mouseY) && TileFluidInterface.TANK_OUT.getValue() != null) {
drawTooltip(mouseX, mouseY, TileFluidInterface.TANK_OUT.getValue().getLocalizedName() + "\n" + TextFormatting.GRAY + API.instance().getQuantityFormatter().formatInBucketForm(TileFluidInterface.TANK_OUT.getValue().amount) + TextFormatting.RESET);
}
}
}
| [
"raoulvdberge@gmail.com"
] | raoulvdberge@gmail.com |
acb2b92011705c6901e28687abb087ace5dec48e | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/11/11_50c04fda28b222ad665ee6a0435b1df1cb7c9c47/VOptionGroup/11_50c04fda28b222ad665ee6a0435b1df1cb7c9c47_VOptionGroup_t.java | 70203b6913c9832acdb7c27b1e2a9cbe13f22e3e | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,280 | java | /*
@ITMillApache2LicenseForJavaFiles@
*/
package com.vaadin.terminal.gwt.client.ui;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.user.client.ui.CheckBox;
import com.google.gwt.user.client.ui.FocusWidget;
import com.google.gwt.user.client.ui.Focusable;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.UIDL;
public class VOptionGroup extends VOptionGroupBase {
public static final String CLASSNAME = "v-select-optiongroup";
private final Panel panel;
private final Map optionsToKeys;
public VOptionGroup() {
super(CLASSNAME);
panel = (Panel) optionsContainer;
optionsToKeys = new HashMap();
}
/*
* Return true if no elements were changed, false otherwise.
*/
@Override
protected void buildOptions(UIDL uidl) {
panel.clear();
for (final Iterator it = uidl.getChildIterator(); it.hasNext();) {
final UIDL opUidl = (UIDL) it.next();
CheckBox op;
if (isMultiselect()) {
op = new VCheckBox();
op.setText(opUidl.getStringAttribute("caption"));
} else {
op = new RadioButton(id, opUidl.getStringAttribute("caption"));
op.setStyleName("v-radiobutton");
}
op.addStyleName(CLASSNAME_OPTION);
op.setValue(opUidl.getBooleanAttribute("selected"));
op.setEnabled(!opUidl.getBooleanAttribute("disabled")
&& !isReadonly() && !isDisabled());
op.addClickHandler(this);
optionsToKeys.put(op, opUidl.getStringAttribute("key"));
panel.add(op);
}
}
@Override
protected Object[] getSelectedItems() {
return selectedKeys.toArray();
}
@Override
public void onClick(ClickEvent event) {
super.onClick(event);
if (event.getSource() instanceof CheckBox) {
final boolean selected = ((CheckBox) event.getSource()).getValue();
final String key = (String) optionsToKeys.get(event.getSource());
if (!isMultiselect()) {
selectedKeys.clear();
}
if (selected) {
selectedKeys.add(key);
} else {
selectedKeys.remove(key);
}
client.updateVariable(id, "selected", getSelectedItems(),
isImmediate());
}
}
@Override
protected void setTabIndex(int tabIndex) {
for (Iterator iterator = panel.iterator(); iterator.hasNext();) {
FocusWidget widget = (FocusWidget) iterator.next();
widget.setTabIndex(tabIndex);
}
}
public void focus() {
Iterator<Widget> iterator = panel.iterator();
if (iterator.hasNext()) {
((Focusable) iterator.next()).setFocus(true);
}
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
148508a29ad14e26c24608b8809821ab2894c1fc | 4981fc0e1e82dc9226116aa8f0a29413c947b0ec | /Build/src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java | 0b1655ad8b72f1d2cab57c99029b106ecf2ed6f0 | [
"MIT",
"W3C",
"GPL-1.0-or-later",
"SAX-PD",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-unknown"
] | permissive | Mayo-WE01051879/mayosapp | 7e33d4b73b20e6f58f0ae593ae7c9ac10afff20c | 4c678635cfd2823c2df6937165e102fdac72cb86 | refs/heads/master | 2022-12-10T01:22:54.629304 | 2021-02-24T20:16:36 | 2021-02-24T20:16:36 | 16,258,006 | 0 | 0 | MIT | 2022-12-05T23:23:59 | 2014-01-26T17:50:40 | Java | UTF-8 | Java | false | false | 4,283 | 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.tools.ant.taskdefs.optional.javah;
import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.launch.Locator;
import org.apache.tools.ant.taskdefs.ExecuteJava;
import org.apache.tools.ant.taskdefs.optional.Javah;
import org.apache.tools.ant.types.Commandline;
import org.apache.tools.ant.types.Path;
/**
* Adapter to com.sun.tools.javah.oldjavah.Main or com.sun.tools.javah.Main.
*
* @since Ant 1.6.3
*/
public class SunJavah implements JavahAdapter {
/** the name of the javah adapter - sun */
public static final String IMPLEMENTATION_NAME = "sun";
/**
* Performs the actual compilation.
* @param javah the calling javah task.
* @return true if the compilation was successful.
* @throws BuildException if there is an error.
* @since Ant 1.6.3
*/
public boolean compile(Javah javah) throws BuildException {
Commandline cmd = setupJavahCommand(javah);
ExecuteJava ej = new ExecuteJava();
Class c = null;
try {
try {
// first search for the "old" javah class in 1.4.2 tools.jar
c = Class.forName("com.sun.tools.javah.oldjavah.Main");
} catch (ClassNotFoundException cnfe) {
// assume older than 1.4.2 tools.jar
c = Class.forName("com.sun.tools.javah.Main");
}
} catch (ClassNotFoundException ex) {
throw new BuildException(
"Can't load javah", ex, javah.getLocation());
}
cmd.setExecutable(c.getName());
ej.setJavaCommand(cmd);
File f = Locator.getClassSource(c);
if (f != null) {
ej.setClasspath(new Path(javah.getProject(), f.getPath()));
}
return ej.fork(javah) == 0;
}
private Commandline setupJavahCommand(Javah javah) {
Commandline cmd = new Commandline();
if (javah.getDestdir() != null) {
cmd.createArgument().setValue("-d");
cmd.createArgument().setFile(javah.getDestdir());
}
if (javah.getOutputfile() != null) {
cmd.createArgument().setValue("-o");
cmd.createArgument().setFile(javah.getOutputfile());
}
if (javah.getClasspath() != null) {
cmd.createArgument().setValue("-classpath");
cmd.createArgument().setPath(javah.getClasspath());
}
if (javah.getVerbose()) {
cmd.createArgument().setValue("-verbose");
}
if (javah.getOld()) {
cmd.createArgument().setValue("-old");
}
if (javah.getForce()) {
cmd.createArgument().setValue("-force");
}
if (javah.getStubs() && !javah.getOld()) {
throw new BuildException(
"stubs only available in old mode.", javah.getLocation());
}
if (javah.getStubs()) {
cmd.createArgument().setValue("-stubs");
}
Path bcp = new Path(javah.getProject());
if (javah.getBootclasspath() != null) {
bcp.append(javah.getBootclasspath());
}
bcp = bcp.concatSystemBootClasspath("ignore");
if (bcp.size() > 0) {
cmd.createArgument().setValue("-bootclasspath");
cmd.createArgument().setPath(bcp);
}
cmd.addArguments(javah.getCurrentArgs());
javah.logAndAddFiles(cmd);
return cmd;
}
}
| [
"delapaz.mayo@gmail.com"
] | delapaz.mayo@gmail.com |
9bfb63258ca72c412255a009291565ac1c16ccf2 | 920b542441734dd116558a99d2dba20858030515 | /xiaoshixun2/week_0103_2/src/main/java/com/bawei/week_0103_2/MainActivity.java | b02099a7e9ff3c1667b4febe96dc389dab48f0a1 | [] | no_license | 2318279444/xiaoshixun1_1 | b06a2dfb49c82458f438b86b22f74385f9db7751 | 43f9c4c20a5cc62e4e6058c9714d1259a7b3ac09 | refs/heads/master | 2020-12-02T00:44:07.748727 | 2020-04-20T14:40:53 | 2020-04-20T14:40:53 | 230,830,720 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,026 | java | package com.bawei.week_0103_2;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.os.Bundle;
import android.util.Log;
import android.widget.LinearLayout;
import com.bawei.adapter.MyFenleiAdapter;
import com.bawei.adapter.MyXiangqingAdapter;
import com.bawei.base.BaseActivity;
import com.bawei.base.BasePresenter;
import com.bawei.bean.FenleiBean;
import com.bawei.bean.Xiangqingbean;
import com.bawei.contract.Icontract;
import com.bawei.presenter.MyPresenter;
import com.bawei.url.MyUrl;
import com.bawei.util.NetUtil;
import com.bawei.week_0103_2.R;
import com.google.gson.Gson;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class MainActivity extends BaseActivity implements Icontract.ToCall {
RecyclerView recyclerView1,recyclerView2;
List<FenleiBean.ResultBean.SecondCategoryVoBean> list=new ArrayList<>();
private MyFenleiAdapter myFenleiAdapter;
private MyPresenter myPresenter;
private static Map<String, Object> map;
@Override
protected void inidata() {
myPresenter = (MyPresenter) p;
myPresenter.pFenlei(MyUrl.BASEFENLEI, FenleiBean.class);
}
@Override
protected void iniview() {
recyclerView1=findViewById(R.id.RecyclerView1);
LinearLayoutManager manager=new LinearLayoutManager(this);
manager.setOrientation(RecyclerView.VERTICAL);
recyclerView1.setLayoutManager(manager);
recyclerView2=findViewById(R.id.RecyclerView2);
GridLayoutManager manager1=new GridLayoutManager(this,3);
recyclerView2.setLayoutManager(manager1);
}
@Override
protected int inilayout() {
return R.layout.activity_main;
}
@Override
protected BasePresenter Ipresenter() {
return new MyPresenter();
}
@Override
public void success(final String stra) {
Gson gson = new Gson();
FenleiBean fenleiBean = gson.fromJson(stra, FenleiBean.class);
List<FenleiBean.ResultBean> result = fenleiBean.getResult();
for (int i = 0; i < result.size(); i++) {
list.addAll(result.get(i).getSecondCategoryVo());
}
myFenleiAdapter = new MyFenleiAdapter(list, this);
recyclerView1.setAdapter(myFenleiAdapter);
myFenleiAdapter.setFenleiCallBack(new MyFenleiAdapter.FenleiCallBack() {
@Override
public void onclick(int position) {
myFenleiAdapter.setColorposition(position);
//Eventbus传值
EventBus.getDefault().post(list.get(position).getId());
//
String id = list.get(position).getId();
}
});
myFenleiAdapter.notifyDataSetChanged();
//dianji
}
@Subscribe
public void toEvent(String s){
map = new HashMap<>();
map.put("categoryId",s);
map.put("page",1);
map.put("count",10);
Log.e("ann",""+s);
NetUtil.getInstance().netxiangqing(MyUrl.BASEXIANGQING, Xiangqingbean.class, map, new Icontract.ToCall() {
@Override
public void success(String stra) {
Gson gson1 = new Gson();
Xiangqingbean xiangqingbean = gson1.fromJson(stra, Xiangqingbean.class);
MyXiangqingAdapter myXiangqingAdapter = new MyXiangqingAdapter(xiangqingbean.getResult(), MainActivity.this);
recyclerView2.setAdapter(myXiangqingAdapter);
}
});
}
@Override
protected void onStart() {
super.onStart();
EventBus.getDefault().register(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
}
| [
"2318279444@qq.com"
] | 2318279444@qq.com |
6129b369d1560613dd9866a3d582812077a0d95e | 61cf3109eaf4561e071d93f9daf0d3cf9155ca9f | /src/com/rbt/dao/ICollectDao.java | 2d63830780374972e486c3f7859fcaef601f2b6c | [] | no_license | haoouwen/epf | b620fe05c93db178a122cfef778d31c036a2a822 | abe0f1ed564f33dcf766591c5f9b04ce2b5e8094 | refs/heads/master | 2021-01-19T13:46:10.278247 | 2017-08-20T10:40:12 | 2017-08-20T10:40:12 | 100,859,509 | 1 | 2 | null | null | null | null | UTF-8 | Java | false | false | 748 | java | /*
* Package:com.rbt.dao
* FileName: ICollectDao.java
*/
package com.rbt.dao;
import java.util.List;
import java.util.Map;
import com.rbt.model.Collect;
/**
* @function 功能 记录会员商机收藏信息dao层业务接口
* @author 创建人HZX
* @date 创建日期 Mon Jan 14 10:40:08 CST 2014
*/
public interface ICollectDao extends IGenericDao<Collect,String>{
/**
* @author:HXM
* @date:May 30, 20149:35:42 AM
* @param:
* @Description:分组查询通过cust_id 分组
*/
public List getListByGroup(Map map);
/**
* @author:HXM
* @date:May 30, 201410:54:39 AM
* @param:
* @Description:查询获得分组总条数
*/
public int getGroupCount(Map map);
public void deleteByGoodsId(String goods_id);
}
| [
"Administrator@USER-20170608NM"
] | Administrator@USER-20170608NM |
1e7e480decffab944ec4906a3d9dc73984335269 | dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9 | /data_defect4j/preprossed_method_corpus/Math/98/org/apache/commons/math/ode/FirstOrderIntegrator_integrate_102.java | e57458f80c0ff60f273f015086f156cf094ec7f2 | [] | 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 | 1,078 | java |
org apach common math od
repres order integr
differenti equat
class devot solv order differenti
equat implement problem
handl implement link
order differenti equat firstorderdifferentialequ
order differenti equat firstorderdifferentialequ
step handler stephandl
switch function switchingfunct
version revis date
order integr firstorderintegr serializ
integr differenti equat time
method solv initi problem ivp
method store intern state variabl made
integr link
current sign stepsiz getcurrentsignedsteps thread safe
param equat differenti equat integr
param initi time
param initi state vector
param target time integr
set smaller code code backward integr
param placehold put state vector success
step end integr object
integr except integratorexcept integr perform integr
deriv except derivativeexcept except propag caller
underli user function trigger
integr order differenti equat firstorderdifferentialequ equat
deriv except derivativeexcept integr except integratorexcept
| [
"hvdthong@gmail.com"
] | hvdthong@gmail.com |
baaff3da345340bf4c07df824cf1324fc6b64220 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/17/17_49295de4c8e8fa33a9f89d46591e659e49ae6dee/YiiPhpModuleExtender/17_49295de4c8e8fa33a9f89d46591e659e49ae6dee_YiiPhpModuleExtender_t.java | 3f98ee8589665adaf3cf828aec33f92bde7d33c8 | [] | 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,211 | java | /*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright 2013 Oracle and/or its affiliates. All rights reserved.
*
* Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common
* Development and Distribution License("CDDL") (collectively, the
* "License"). You may not use this file except in compliance with the
* License. You can obtain a copy of the License at
* http://www.netbeans.org/cddl-gplv2.html
* or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
* specific language governing permissions and limitations under the
* License. When distributing the software, include this License Header
* Notice in each file and include the License file at
* nbbuild/licenses/CDDL-GPL-2-CP. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the GPL Version 2 section of the License file that
* accompanied this code. If applicable, add the following below the
* License Header, with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* If you wish your version of this file to be governed by only the CDDL
* or only the GPL Version 2, indicate your decision by adding
* "[Contributor] elects to include this software in this distribution
* under the [CDDL or GPL Version 2] license." If you do not indicate a
* single choice of license, a recipient has the option to distribute
* your version of this file under either the CDDL, the GPL Version 2 or
* to extend the choice of license to its licensees as provided above.
* However, if you add GPL Version 2 code and therefore, elected the GPL
* Version 2 license, then the option applies only if the new code is
* made subject to such option by the copyright holder.
*
* Contributor(s):
*
* Portions Copyrighted 2013 Sun Microsystems, Inc.
*/
package org.nbphpcouncil.modules.php.yii;
import java.io.IOException;
import java.util.HashSet;
import java.util.Set;
import java.util.logging.Logger;
import javax.swing.JComponent;
import javax.swing.event.ChangeListener;
import org.nbphpcouncil.modules.php.yii.commands.YiiScript;
import org.nbphpcouncil.modules.php.yii.preferences.YiiPreferences;
import org.nbphpcouncil.modules.php.yii.ui.options.YiiOptions;
import org.nbphpcouncil.modules.php.yii.ui.wizards.NewProjectConfigurationPanel;
import org.nbphpcouncil.modules.php.yii.util.ProjectPropertiesSupport;
import org.nbphpcouncil.modules.php.yii.util.YiiUtils;
import org.netbeans.modules.php.api.executable.InvalidPhpExecutableException;
import org.netbeans.modules.php.api.phpmodule.PhpModule;
import org.netbeans.modules.php.spi.framework.PhpModuleExtender;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.util.Exceptions;
import org.openide.util.HelpCtx;
/**
*
* @author junichi11
*/
public class YiiPhpModuleExtender extends PhpModuleExtender {
private NewProjectConfigurationPanel panel;
private static final Logger LOGGER = Logger.getLogger(YiiPhpModuleExtender.class.getName());
@Override
public void addChangeListener(ChangeListener listener) {
}
@Override
public void removeChangeListener(ChangeListener listener) {
}
@Override
public JComponent getComponent() {
return getPanel();
}
@Override
public HelpCtx getHelp() {
return HelpCtx.DEFAULT_HELP;
}
@Override
public boolean isValid() {
String yiic = YiiOptions.getInstance().getYiiScript();
if (yiic == null || yiic.isEmpty()) {
return false;
}
return true;
}
@Override
public String getErrorMessage() {
return null;
}
@Override
public String getWarningMessage() {
return null;
}
@Override
public Set<FileObject> extend(PhpModule phpModule) throws ExtendingException {
boolean isSuccess = false;
try {
YiiScript script = YiiScript.forPhpModule(phpModule, true, true);
isSuccess = script.initProject(phpModule);
} catch (InvalidPhpExecutableException ex) {
Exceptions.printStackTrace(ex);
}
boolean usePHPUnit = panel.usePHPUnit();
HashSet<FileObject> files = new HashSet<FileObject>();
if (isSuccess) {
// update module
// some directories may null
YiiModule yiiModule = YiiModuleFactory.create(phpModule);
FileUtil.refreshFor(FileUtil.toFile(yiiModule.getWebroot()));
yiiModule.initDirectories();
// set PHPUnit Test
if (usePHPUnit) {
ProjectPropertiesSupport.setPHPUnit(phpModule);
}
try {
YiiUtils.createCodeCompletionFile(phpModule);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
FileObject sourceDirectory = phpModule.getSourceDirectory();
FileObject config = null;
FileObject index = null;
if (sourceDirectory != null) {
sourceDirectory.refresh();
index = sourceDirectory.getFileObject("index.php"); // NOI18N
config = sourceDirectory.getFileObject("protected/config/main.php"); // NOI18N
}
if (index != null) {
files.add(index);
}
if (config != null) {
files.add(config);
}
// set enabled
YiiPreferences.setEnabled(phpModule, true);
}
return files;
}
private synchronized NewProjectConfigurationPanel getPanel() {
if (panel == null) {
panel = new NewProjectConfigurationPanel();
}
return panel;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
f877c90c4840449e36fe2c544d275206072c968e | 4a7cb14aa934df8f362cf96770e3e724657938d8 | /MFES/ATS/Classes/CodeRefactoringAula2/src/ContactList.java | cdc5ac2b7b8e257d0d32e339441c53f84929698b | [] | no_license | pCosta99/Masters | 7091a5186f581a7d73fd91a3eb31880fa82bff19 | f835220de45a3330ac7a8b627e5e4bf0d01d9f1f | refs/heads/master | 2023-08-11T01:01:53.554782 | 2021-09-22T07:51:51 | 2021-09-22T07:51:51 | 334,012,667 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 437 | java | import java.util.ArrayList;
public class ContactList {
private final ArrayList<Contact> contacts;
public ContactList() {
contacts = new ArrayList<>();
}
public int getNumberOfContacts() {
return contacts.size();
}
public Contact getContactByName(String name) {
for (Contact c : contacts)
if (c.getName().equals(name))
return c;
return null;
}
}
| [
"costapedro.a1999@gmail.com"
] | costapedro.a1999@gmail.com |
eef233b1845c9c261af3cbf678cca571e13e6a6d | 35d40584db81ae6d48b58c463e78ef3d87feef33 | /javasrc/javasrc/ch4/Pop.java | 36a36c2a9c4fddaea29d2020dd8a92f625318fac | [] | no_license | takagotch/java2 | c0edea513a9857f54b2ec1916f09a279b994bb47 | 0fd059cfc69539510d327931489e74e44aca6971 | refs/heads/master | 2018-09-30T16:27:46.316538 | 2018-07-27T03:18:22 | 2018-07-27T03:18:22 | 103,270,566 | 0 | 0 | null | null | null | null | SHIFT_JIS | Java | false | false | 6,042 | java | // Pop3 によるメール受信プログラムPop.java
// このプログラムは,指定されたPOPサーバからメールを取得します
// 使い方java Pop
// 起動後,POPサーバのアドレスを聞いてきます
// 対話の例
// POP サーバのアドレスを入力してください
// kiku.fuis.fukui-u.ac.jp
// POPサーバのアドレス:kiku.fuis.fukui-u.ac.jp
// 以上でよろしいですか?(y/n)
// y
// +OK QPOP (version 2.53) at kiku.fuis.fukui-u.ac.jp starting.
// <4752.923273295@kiku.fuis.fukui-u.ac.jp>
// その後,POP のユーザ名とパスワードを聞いてきます
// 対話の例
// user nameを入力してください
// odaka
// Passwordを入力してください
// XXXXXXXX
// user name:odaka
// Password:XXXXXXXX
// 以上でよろしいですか?(y/n)
// ライブラリの利用
import java.net.*;
import java.io.*;
import java.util.*;
// Popクラス
// Popクラスは,Pop プログラムの本体です
public class Pop {
final int POP_PORT = 110;// POP接続用ポート番号(110 番)
BufferedReader pop_in = null ;// 読み出し用ストリーム
PrintWriter pop_out = null ;// 書き込み用ストリーム
Socket pop = null ;// ソケット
// transactionメソッド
// POP3のセッションを進めます
public void transaction()
throws IOException
{
String buf = "" ;
BufferedReader lineread // 標準入力読み取り用
= new BufferedReader(new InputStreamReader(System.in)) ;
boolean cont = true ;
while(cont){ //入力のループ
System.out.println(
"Command : L)ist R)etrieve D)elete Q)uit") ;
buf = lineread.readLine() ;
// QUIT
if(buf.equalsIgnoreCase("Q")) cont = false ;
// LIST
else if(buf.equalsIgnoreCase("L")) getLines("LIST") ;
// RETR
else if(buf.equalsIgnoreCase("R")) {
System.out.println("Number? : ") ;
buf = lineread.readLine() ;
getLines("RETR " + buf) ;
}
// DELE
else if("D".equals(buf) || "d".equals(buf)){
System.out.println("Number? : ") ;
buf = lineread.readLine() ;
getSingleLine("DELE " + buf) ;
}
}
}
// getLinesメソッド
// 回答が複数行に渡るコマンドの処理を行います
public void getLines(String command)
throws IOException
{
boolean cont = true ;
String buf = null ;
// コマンドの送付
pop_out.print(command +"\r\n");
pop_out.flush() ;
String res = pop_in.readLine();//返答の読み取り
System.out.println(res) ;
// もし返答コードが+OKでなければ・・・
if (!("+OK".equals(res.substring(0,3)))){
pop.close();// コネクションを閉じます
throw new RuntimeException(res);
}
while(cont){// 複数行の読み取り
buf = pop_in.readLine();//1行読み取り
System.out.println(buf) ;
// 行頭の単独ピリオドで終了
if(".".equals(buf)) cont = false ;
}
}
// getSingleLineメソッド
// 返答が1行となるコマンドの処理を行います
public void getSingleLine(String command)
throws IOException
{
// コマンドの送付
pop_out.print(command +"\r\n");
pop_out.flush() ;
System.out.println(command) ;
String res = pop_in.readLine();//返答の読み取り
System.out.println(res) ;
// もし返答コードが+OKでなければ・・・
if (!("+OK".equals(res.substring(0,3)))){
pop.close();// コネクションを閉じます
throw new RuntimeException(res);
}
}
// authorizationメソッド
// TCPコネクションの設定と認証を行います
public void authorization()
throws IOException
{
String buf = "" ;
BufferedReader lineread
= new BufferedReader(new InputStreamReader(System.in)) ;
boolean cont = true ;
String pop_server = null ;
String username = null ;
String password = null ;
//POPサーバのアドレスの設定
while(cont){ //入力のループ
System.out.println("POP サーバのアドレスを入力してください") ;
pop_server = lineread.readLine() ;
System.out.println(" POP サーバのアドレス:" + pop_server) ;
System.out.println("以上でよろしいですか?(y/n)") ;
buf = lineread.readLine() ;
if("y".equals(buf)) cont = false ;
}
// サーバとの接続
pop = new Socket(pop_server, POP_PORT);
pop_in = new BufferedReader(
new InputStreamReader(pop.getInputStream()));
pop_out = new PrintWriter(pop.getOutputStream());
// メッセージの取得
String res = pop_in.readLine();//返答の読み取り
System.out.println(res) ;
// もし返答コードが+OKでなければ・・・
if (!("+OK".equals(res.substring(0,3)))){
pop.close();// コネクションを閉じます
throw new RuntimeException(res);
}
// 認証情報の取得
cont = true ;
while(cont){ //入力のループ
System.out.println("user nameを入力してください") ;
username = lineread.readLine() ;
System.out.println("Passwordを入力してください") ;
password = lineread.readLine() ;
System.out.println(" user name:" + username) ;
System.out.println(" Password:" + password) ;
System.out.println("以上でよろしいですか?(y/n)") ;
buf = lineread.readLine() ;
if("y".equals(buf)) cont = false ;
}
// USERコマンドとPASSコマンドによる認証作業
getSingleLine("USER " + username) ;
getSingleLine("PASS " + password) ;
}
// updateメソッド
// POP3 のセッションを終了します
public void update()
throws IOException
{
// QUIT
getSingleLine("QUIT");
pop.close();// コネクションを閉じます
}
// mainprocメソッド
// POP の各処理メソッドを呼び出します
public void mainproc(String[] args)
throws IOException
{
if(args.length == 0){
authorization() ;
transaction() ;
update() ;
}else{
System.out.println("usage: java Pop ");
}
}
// mainメソッド
// Popクラスのオブジェクトを生成します
public static void main(String[] args)
throws IOException
{
Pop p = new Pop() ;
p.mainproc(args) ;
}
} | [
"dyaccb@gmail.com"
] | dyaccb@gmail.com |
c50d09cc0e464f09058fff9c713a505f7fa51bcf | 1fd24d5925988856c87e18d87edc04df3853e743 | /src/main/java/ua/com/clinicaltrials/repositories/StudyRelatedMaterialRepository.java | d29c819a47cfba16d9270fb589ed0430305c1faa | [] | no_license | lomk/clinicaltrials_rest | d7fc194d70bd730fc6c451590352ba25f009ff3d | 97c9b0ac7b0e71ad08bbdcecaf1d2b41185268da | refs/heads/master | 2021-09-11T17:54:58.041744 | 2018-04-10T15:59:30 | 2018-04-10T15:59:30 | 107,945,135 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 313 | java | package ua.com.clinicaltrials.repositories;
import org.springframework.data.jpa.repository.JpaRepository;
import ua.com.clinicaltrials.domain.StudyRelatedMaterial;
/**
* Created by mater on 24-Jan-17.
*/
public interface StudyRelatedMaterialRepository extends JpaRepository<StudyRelatedMaterial, Integer> {
}
| [
"materynko@gmail.com"
] | materynko@gmail.com |
935a3880d3a60891c24b24924927b1aa4e279235 | 225011bbc304c541f0170ef5b7ba09b967885e95 | /com/bgjd/ici/plugin/C1526h.java | 2547d6c74bc71cded4ef41cf749718861a2c9577 | [] | no_license | sebaudracco/bubble | 66536da5367f945ca3318fecc4a5f2e68c1df7ee | e282cda009dfc9422594b05c63e15f443ef093dc | refs/heads/master | 2023-08-25T09:32:04.599322 | 2018-08-14T15:27:23 | 2018-08-14T15:27:23 | 140,444,001 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,857 | java | package com.bgjd.ici.plugin;
import android.content.Context;
import com.bgjd.ici.MarketBeaconService;
import com.bgjd.ici.p025b.C1394a;
import com.bgjd.ici.p025b.C1395h;
import com.bgjd.ici.p025b.C1402i;
import com.bgjd.ici.p025b.C1410m;
import com.bgjd.ici.p028c.C1434d;
import com.bgjd.ici.p028c.C1435a;
import com.bgjd.ici.p030e.C1482g;
import com.bgjd.ici.p030e.C1485h.C1484a;
import com.bgjd.ici.p030e.C1485h.C1484a.C1483a;
import com.bgjd.ici.p031f.C1492e;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
public class C1526h implements C1517a {
private static final String f2510a = "FKLBST";
private Class<?> f2511b = null;
private Object f2512c;
private C1395h f2513d;
private String f2514e = "";
class C15251 implements InvocationHandler {
final /* synthetic */ C1526h f2509a;
C15251(C1526h c1526h) {
this.f2509a = c1526h;
}
public Object invoke(Object obj, Method method, Object[] objArr) throws Throwable {
C1434d c1435a = new C1435a(new C1410m(this.f2509a.f2513d));
c1435a.open();
if (c1435a.IsConnected()) {
int i;
C1492e c1492e = (C1492e) c1435a.getMapper(C1492e.class, C1482g.class);
if (method.getName().contains("onConfigRequest")) {
C1394a G = this.f2509a.f2513d.mo2179G();
if (G != null) {
G.mo2329a(this.f2509a.f2513d.getContext());
}
i = 1;
} else if (method.getName().contains("onConfigResponse")) {
i = 2;
} else {
i = 0;
}
if (i > 0) {
String str = C1526h.f2510a;
String[] strArr = new String[1];
strArr[0] = method.getName() + " : " + (objArr[0] != null ? objArr[0].toString() : "");
C1402i.m2901b(str, strArr);
c1492e.m3187a(new C1482g(i, this.f2509a.f2514e, objArr[0] != null ? objArr[0].toString() : ""));
}
}
c1435a.close();
return null;
}
}
public C1526h(C1395h c1395h) {
this.f2513d = c1395h;
}
public void mo2343a(String str) {
this.f2514e = str;
}
public void mo2342a() {
try {
C1520d b = C1532j.m3310b();
if (b.mo2360b(this.f2514e)) {
Object a = b.mo2357a(this.f2514e);
this.f2512c = a.getClass().getMethod(C1483a.m3115k(), new Class[]{Context.class}).invoke(a, new Object[]{this.f2513d.getContext()});
this.f2511b = this.f2512c.getClass();
Class loadClass = MarketBeaconService.f2015a.loadClass(C1484a.m3120a());
Method method = this.f2511b.getMethod(C1483a.m3116l(), new Class[]{loadClass});
a = Proxy.newProxyInstance(loadClass.getClassLoader(), new Class[]{loadClass}, new C15251(this));
method.invoke(this.f2512c, new Object[]{a});
this.f2511b.getMethod(C1483a.m3106b(), new Class[0]).invoke(this.f2512c, new Object[0]);
}
} catch (Throwable e) {
C1402i.m2898a(f2510a, e, e.getMessage());
} catch (Throwable e2) {
C1402i.m2898a(f2510a, e2, e2.getMessage());
} catch (Throwable e22) {
C1402i.m2898a(f2510a, e22, e22.getMessage());
} catch (Throwable e222) {
C1402i.m2898a(f2510a, e222, e222.getMessage());
} catch (Throwable e2222) {
C1402i.m2898a(f2510a, e2222, e2222.getMessage());
} catch (Throwable e22222) {
C1402i.m2898a(f2510a, e22222, e22222.getMessage());
}
}
public void mo2344b() {
if (this.f2512c != null) {
try {
this.f2511b.getMethod(C1483a.m3117m(), new Class[0]).invoke(this.f2512c, new Object[0]);
} catch (Throwable e) {
C1402i.m2898a(f2510a, e, e.getMessage());
} catch (Throwable e2) {
C1402i.m2898a(f2510a, e2, e2.getMessage());
} catch (Throwable e22) {
C1402i.m2898a(f2510a, e22, e22.getMessage());
}
}
}
public void mo2345c() {
if (this.f2512c != null) {
try {
this.f2511b.getMethod(C1483a.m3107c(), new Class[0]).invoke(this.f2512c, new Object[0]);
} catch (Throwable e) {
C1402i.m2898a(f2510a, e, e.getMessage());
} catch (Throwable e2) {
C1402i.m2898a(f2510a, e2, e2.getMessage());
} catch (Throwable e22) {
C1402i.m2898a(f2510a, e22, e22.getMessage());
}
}
}
}
| [
"sebaudracco@gmail.com"
] | sebaudracco@gmail.com |
4587be6278a69de4da2d878daaa5595a17cf9e28 | 4461d7177934ecffe58369756621d7da91f33bde | /metric-hub/src/main/java/com/heliosapm/metrichub/speedment/tsdb/public_/tsd_fqn_tagpair/TsdFqnTagpairManager.java | abde344ca8e52216f07c836f32eb4fe5fdbdf2f4 | [
"Apache-2.0"
] | permissive | nickman/HeliosStreams | acaa1ff427f00d2e80e9e8ee88b0c5f728ab95b3 | 9152a7bba7198fef3122360f6b3ed0ffa5048824 | refs/heads/master | 2020-04-10T11:57:20.404389 | 2017-03-31T00:52:43 | 2017-03-31T00:52:43 | 61,433,602 | 7 | 4 | null | null | null | null | UTF-8 | Java | false | false | 541 | java | package com.heliosapm.metrichub.speedment.tsdb.public_.tsd_fqn_tagpair;
import com.heliosapm.metrichub.speedment.tsdb.public_.tsd_fqn_tagpair.generated.GeneratedTsdFqnTagpairManager;
/**
* The main interface for the manager of every {@link
* com.heliosapm.metrichub.speedment.tsdb.public_.tsd_fqn_tagpair.TsdFqnTagpair}
* entity.
* <p>
* This file is safe to edit. It will not be overwritten by the code generator.
*
* @author Helios APM
*/
public interface TsdFqnTagpairManager extends GeneratedTsdFqnTagpairManager {
} | [
"whitehead.nicholas@gmail.com"
] | whitehead.nicholas@gmail.com |
19eb650d5d7da5e302e28d9a94e16fc6497ddbb2 | 623b8eb08aa8c4a7679cc20b0728844f801f9ce6 | /src/main/java/com/xiaoyi/bis/system/service/impl/RoleServiceImpl.java | 803a0fd043720fe72b403edf825fa46c9972593f | [] | no_license | LiuYPGitHub/xiaoyi2 | e8a9ef1b63161804e742d5ac08819cc2b97ed3f7 | f713cfe91d5b6bc8102876e644e503666f028a34 | refs/heads/master | 2022-07-10T08:26:01.686314 | 2019-12-12T02:48:34 | 2019-12-12T02:48:34 | 227,505,173 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,727 | java | package com.xiaoyi.bis.system.service.impl;
import com.xiaoyi.bis.common.domain.QueryRequest;
import com.xiaoyi.bis.common.utils.SortUtil;
import com.xiaoyi.bis.system.dao.RoleMapper;
import com.xiaoyi.bis.system.dao.RoleMenuMapper;
import com.xiaoyi.bis.system.domain.Role;
import com.xiaoyi.bis.system.domain.RoleMenu;
import com.xiaoyi.bis.system.manager.UserManager;
import com.xiaoyi.bis.system.service.RoleMenuServie;
import com.xiaoyi.bis.system.service.RoleService;
import com.xiaoyi.bis.system.service.UserRoleService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
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.Arrays;
import java.util.Date;
import java.util.List;
@Slf4j
@Service("roleService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
@Autowired
private RoleMenuMapper roleMenuMapper;
@Autowired
private UserRoleService userRoleService;
@Autowired
private RoleMenuServie roleMenuService;
@Autowired
private UserManager userManager;
@Override
public IPage<Role> findRoles(Role role, QueryRequest request) {
try {
LambdaQueryWrapper<Role> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isNotBlank(role.getRoleName())) {
queryWrapper.eq(Role::getRoleName, role.getRoleName());
}
if (StringUtils.isNotBlank(role.getCreateTimeFrom()) && StringUtils.isNotBlank(role.getCreateTimeTo())) {
queryWrapper
.ge(Role::getCreateTime, role.getCreateTimeFrom())
.le(Role::getCreateTime, role.getCreateTimeTo());
}
Page<Role> page = new Page<>();
SortUtil.handlePageSort(request, page, true);
return this.page(page,queryWrapper);
} catch (Exception e) {
log.error("获取角色信息失败", e);
return null;
}
}
@Override
public List<Role> findUserRole(String userName) {
return baseMapper.findUserRole(userName);
}
@Override
public Role findByName(String roleName) {
return baseMapper.selectOne(new LambdaQueryWrapper<Role>().eq(Role::getRoleName, roleName));
}
@Override
public void createRole(Role role) {
role.setCreateTime(new Date());
this.save(role);
String[] menuIds = role.getMenuId().split(StringPool.COMMA);
setRoleMenus(role, menuIds);
}
@Override
public void deleteRoles(String[] roleIds) throws Exception {
// 查找这些角色关联了那些用户
List<String> userIds = this.userRoleService.findUserIdsByRoleId(roleIds);
List<String> list = Arrays.asList(roleIds);
baseMapper.deleteBatchIds(list);
this.roleMenuService.deleteRoleMenusByRoleId(roleIds);
this.userRoleService.deleteUserRolesByRoleId(roleIds);
// 重新将这些用户的角色和权限缓存到 Redis中
this.userManager.loadUserPermissionRoleRedisCache(userIds);
}
@Override
public void updateRole(Role role) throws Exception {
// 查找这些角色关联了那些用户
String[] roleId = {String.valueOf(role.getRoleId())};
List<String> userIds = this.userRoleService.findUserIdsByRoleId(roleId);
role.setModifyTime(new Date());
baseMapper.updateById(role);
roleMenuMapper.delete(new LambdaQueryWrapper<RoleMenu>().eq(RoleMenu::getRoleId, role.getRoleId()));
String[] menuIds = role.getMenuId().split(StringPool.COMMA);
setRoleMenus(role, menuIds);
// 重新将这些用户的角色和权限缓存到 Redis中
this.userManager.loadUserPermissionRoleRedisCache(userIds);
}
private void setRoleMenus(Role role, String[] menuIds) {
Arrays.stream(menuIds).forEach(menuId -> {
RoleMenu rm = new RoleMenu();
rm.setMenuId(Long.valueOf(menuId));
rm.setRoleId(role.getRoleId());
this.roleMenuMapper.insert(rm);
});
}
}
| [
"Philo@DESKTOP-OPRVRF1"
] | Philo@DESKTOP-OPRVRF1 |
babbc2ee8e8b498927b61143bb6b0276d0585acd | 95e944448000c08dd3d6915abb468767c9f29d3c | /sources/com/facebook/appevents/codeless/C13127b.java | 5d51801ea0576b3814aa7f5a58a09ea192fcd545 | [] | no_license | xrealm/tiktok-src | 261b1faaf7b39d64bb7cb4106dc1a35963bd6868 | 90f305b5f981d39cfb313d75ab231326c9fca597 | refs/heads/master | 2022-11-12T06:43:07.401661 | 2020-07-04T20:21:12 | 2020-07-04T20:21:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,786 | java | package com.facebook.appevents.codeless;
import android.app.Activity;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorManager;
import android.os.Build;
import android.os.Bundle;
import com.C1642a;
import com.facebook.AccessToken;
import com.facebook.C13499h;
import com.facebook.GraphRequest;
import com.facebook.GraphRequest.C13090b;
import com.facebook.appevents.codeless.C13143f.C13144a;
import com.facebook.appevents.internal.C13173c;
import com.facebook.internal.C13892b;
import com.facebook.internal.C13924n;
import com.facebook.internal.C13926o;
import com.facebook.internal.C13967z;
import java.util.Locale;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONArray;
import org.json.JSONObject;
/* renamed from: com.facebook.appevents.codeless.b */
public final class C13127b {
/* renamed from: a */
public static C13137e f34769a;
/* renamed from: b */
public static String f34770b;
/* renamed from: c */
public static Boolean f34771c = Boolean.valueOf(false);
/* renamed from: d */
public static volatile Boolean f34772d = Boolean.valueOf(false);
/* renamed from: e */
private static final C13143f f34773e = new C13143f();
/* renamed from: f */
private static SensorManager f34774f;
/* renamed from: g */
private static final AtomicBoolean f34775g = new AtomicBoolean(true);
/* renamed from: a */
public static void m38379a() {
f34775g.set(true);
}
/* renamed from: b */
public static void m38383b() {
f34775g.set(false);
}
/* renamed from: d */
static boolean m38387d() {
return f34771c.booleanValue();
}
/* renamed from: c */
static String m38385c() {
if (f34770b == null) {
f34770b = UUID.randomUUID().toString();
}
return f34770b;
}
/* renamed from: a */
static void m38381a(Boolean bool) {
f34771c = bool;
}
/* renamed from: c */
public static void m38386c(Activity activity) {
C13130c.m38390a().mo32303c(activity);
}
/* renamed from: a */
public static void m38382a(final String str) {
if (!f34772d.booleanValue()) {
f34772d = Boolean.valueOf(true);
C13499h.m39719e().execute(new Runnable() {
public final void run() {
String str;
String str2;
boolean z = true;
GraphRequest a = GraphRequest.m38253a((AccessToken) null, C1642a.m8035a(Locale.US, "%s/app_indexing_session", new Object[]{str}), (JSONObject) null, (C13090b) null);
Bundle bundle = a.f34680j;
if (bundle == null) {
bundle = new Bundle();
}
C13892b a2 = C13892b.m41018a(C13499h.m39721g());
JSONArray jSONArray = new JSONArray();
if (Build.MODEL != null) {
str = Build.MODEL;
} else {
str = "";
}
jSONArray.put(str);
if (a2 == null || a2.mo33547a() == null) {
jSONArray.put("");
} else {
jSONArray.put(a2.mo33547a());
}
jSONArray.put("0");
if (C13173c.m38494a()) {
str2 = "1";
} else {
str2 = "0";
}
jSONArray.put(str2);
Locale b = C13967z.m41255b();
StringBuilder sb = new StringBuilder();
sb.append(b.getLanguage());
sb.append("_");
sb.append(b.getCountry());
jSONArray.put(sb.toString());
String jSONArray2 = jSONArray.toString();
bundle.putString("device_session_id", C13127b.m38385c());
bundle.putString("extinfo", jSONArray2);
a.f34680j = bundle;
JSONObject jSONObject = a.mo31788a().f34702b;
if (jSONObject == null || !jSONObject.optBoolean("is_app_indexing_enabled", false)) {
z = false;
}
Boolean valueOf = Boolean.valueOf(z);
C13127b.f34771c = valueOf;
if (!valueOf.booleanValue()) {
C13127b.f34770b = null;
} else if (C13127b.f34769a != null) {
C13127b.f34769a.mo32311a();
}
C13127b.f34772d = Boolean.valueOf(false);
}
});
}
}
/* renamed from: b */
public static void m38384b(Activity activity) {
if (f34775g.get()) {
C13130c.m38390a().mo32302b(activity);
if (f34769a != null) {
f34769a.mo32313b();
}
if (f34774f != null) {
f34774f.unregisterListener(f34773e);
}
}
}
/* renamed from: a */
public static void m38380a(Activity activity) {
if (f34775g.get()) {
C13130c.m38390a().mo32300a(activity);
Context applicationContext = activity.getApplicationContext();
final String k = C13499h.m39725k();
final C13924n a = C13926o.m41097a(k);
if (a != null && a.f36848l) {
SensorManager sensorManager = (SensorManager) applicationContext.getSystemService("sensor");
f34774f = sensorManager;
if (sensorManager != null) {
Sensor defaultSensor = f34774f.getDefaultSensor(1);
f34769a = new C13137e(activity);
f34773e.f34815a = new C13144a() {
/* renamed from: a */
public final void mo32298a() {
boolean z;
if (a == null || !a.f36848l) {
z = false;
} else {
z = true;
}
boolean o = C13499h.m39729o();
if (z && o) {
C13127b.m38382a(k);
}
}
};
f34774f.registerListener(f34773e, defaultSensor, 2);
if (a != null && a.f36848l) {
f34769a.mo32311a();
}
}
}
}
}
}
| [
"65450641+Xyzdesk@users.noreply.github.com"
] | 65450641+Xyzdesk@users.noreply.github.com |
eb87334a1604a31798cdb9cb3722473650421c8b | a4f94f4701a59cafc7407aed2d525b2dff985c95 | /falcon/src/codeOrchestra/flex/processors/transparent/WithAccessOperationExpressionProcessor.java | fad2a8143faf21cb03b318349684eab4e50b5ffc | [] | no_license | jamice/code-orchestra-core | ffda62860f5b117386aa6455f4fdf61661abbe9e | b2bbf8362be2e2173864c294c635badb2e27ecc6 | refs/heads/master | 2021-01-15T13:24:53.517854 | 2013-05-09T21:39:28 | 2013-05-09T21:39:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 326 | java | package codeOrchestra.flex.processors.transparent;
import jetbrains.mps.smodel.SNode;
/**
* @author Anton.I.Neverov
*/
public class WithAccessOperationExpressionProcessor extends TransparentNodeProcessor {
public WithAccessOperationExpressionProcessor(SNode node) {
super(node);
childName = "operation";
}
}
| [
"a.a.eliseyev@gmail.com"
] | a.a.eliseyev@gmail.com |
0246801fc23e15d6f0bd439f6b215f227407bf9c | ac723cb4a7e9e8d117caa6fb15d16f820e6359a4 | /src/yp/Tree/Y_101_对称二叉树.java | 6a1d2b425ae1ea7a7a47bc6abab95273f067eab3 | [] | no_license | RickYinPeng/LeetCode | c9ff0ba02fae4d29ccecd70063bdca37805bd450 | 053ba873fe8c87a8d33193e449a918f67fec3f17 | refs/heads/master | 2020-04-02T20:32:20.121545 | 2020-03-11T12:58:14 | 2020-03-11T12:58:14 | 154,771,933 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,185 | java | package yp.Tree;
import java.util.ArrayList;
import java.util.Arrays;
/**
* @author RickYinPeng
* @ClassName Y_101_对称二叉树
* @Description
* @date 2019/3/6/18:01
*
* 给定一个二叉树,检查它是否是镜像对称的。
* 例如,二叉树 [1,2,2,3,4,4,3] 是对称的。
*
*/
public class Y_101_对称二叉树 {
static class TreeNode {
int val;
TreeNode left;
TreeNode right;
TreeNode(int x) {
val = x;
}
}
public static void main(String[] args) {
TreeNode root = new TreeNode(1);
TreeNode a = new TreeNode(2);
TreeNode b = new TreeNode(2);
root.left = a;
root.right = b;
boolean symmetric = isSymmetric(root);
System.out.println(symmetric);
}
public static boolean isSymmetric(TreeNode root) {
if(root==null || root.left==null && root.right==null){
return true;
}
InOrder(root);
int[] arr = new int[list.size()];
int count = 0;
for (Integer integer : list) {
arr[count] = integer;
count++;
}
System.out.println(Arrays.toString(arr));
for(int i = 0,j= arr.length-1;i!=j;i++,j--){
if(arr[i]!=arr[j]){
return false;
}
}
return true;
}
static ArrayList<Integer> list = new ArrayList<>();
public static void InOrder(TreeNode root){
if(root==null){
return ;
}
if(root.left!=null){
InOrder(root.left);
}
list.add(root.val);
if(root.right!=null){
InOrder(root.right);
}
}
public static boolean isSymmetric2(TreeNode root) {
return isMirror(root, root);
}
public static boolean isMirror(TreeNode t1, TreeNode t2) {
if (t1 == null && t2 == null) return true;
if (t1 == null || t2 == null) return false;
return (t1.val == t2.val)
&& isMirror(t1.right, t2.left)
&& isMirror(t1.left, t2.right);
}
}
| [
"272940172@qq.com"
] | 272940172@qq.com |
2ee779c1f325d32b2f0e44d67274a8be30a4699b | 3fb8acf2d6eaf3d458c00d1cfd5518bfc8847a54 | /liquibase-common/src/main/java/liquibase/parser/json/JsonParser.java | 55d5ba13c0b674f37841ee3b0352923f63b98f24 | [] | no_license | liquibase/liquibase4 | b6df61f2b20c92e8fee21c37076685a9c70b5466 | b868890e2ab093d61b55ef0c9b7819da2d4204e1 | refs/heads/master | 2023-06-30T01:31:46.329261 | 2016-05-27T16:36:48 | 2016-05-27T16:36:48 | 50,212,230 | 3 | 2 | null | 2016-05-05T15:08:07 | 2016-01-22T22:45:58 | Java | UTF-8 | Java | false | false | 2,046 | java | package liquibase.parser.json;
import com.google.gson.*;
import liquibase.Scope;
import liquibase.exception.LiquibaseException;
import liquibase.exception.ParseException;
import liquibase.parser.AbstractParser;
import liquibase.parser.ParsedNode;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
/**
* Parses json files using GSON.
*
* @see ParsedNodeTypeAdapter
*/
public class JsonParser extends AbstractParser {
@Override
public int getPriority(String path, Scope scope) {
if ((path.toLowerCase().endsWith(".json")) && scope.getResourceAccessor() != null) {
return PRIORITY_DEFAULT;
}
return PRIORITY_NOT_APPLICABLE;
}
@Override
public ParsedNode parse(String path, Scope scope) throws ParseException {
try (InputStream inputStream = scope.getResourceAccessor().openStream(path)) {
if (inputStream == null) {
throw new ParseException("Could not find file to parse: " + path, null);
}
try (Reader reader = new InputStreamReader(inputStream)) {
Gson gson = new GsonBuilder()
.setLenient()
.registerTypeAdapter(ParsedNode.class, new ParsedNodeTypeAdapter())
.create();
ParsedNode node = null;
try {
node = gson.fromJson(reader, ParsedNode.class);
} catch (JsonSyntaxException | JsonIOException e) {
throw new ParseException(e, null);
}
node.addChild("physicalPath").setValue(path);
return node;
}
} catch (ParseException e) {
throw e;
} catch (LiquibaseException | IOException e) {
throw new ParseException(e, null);
}
}
@Override
public String describeOriginal(ParsedNode parsedNode) {
return new JsonParser().describeOriginal(parsedNode);
}
}
| [
"nathan@voxland.net"
] | nathan@voxland.net |
4eec387819c3cef038107c131463d7a1febd6ffa | abe5d4b95fede40563400d05833e773855322af3 | /src/main/java/com/vuhien/application/repository/OrderRepository.java | de7824d9194ffca9280342e1f9218d1262bc7909 | [] | no_license | 01662024622/shoes | 63ddd322069ef70de26345f09745729927605306 | 975b4cc60bfbddc1c4c32c530700051074887e52 | refs/heads/master | 2023-08-24T03:18:20.416787 | 2021-10-25T15:24:10 | 2021-10-25T15:24:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,487 | java | package com.vuhien.application.repository;
import com.vuhien.application.entity.Order;
import com.vuhien.application.model.dto.OrderDetailDTO;
import com.vuhien.application.model.dto.OrderInfoDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface OrderRepository extends JpaRepository<Order, Long> {
@Query(value = "SELECT * FROM orders " +
"WHERE id LIKE CONCAT('%',?1,'%') " +
"AND receiver_name LIKE CONCAT('%',?2,'%') " +
"AND receiver_phone LIKE CONCAT('%',?3,'%') " +
"AND status LIKE CONCAT('%',?4,'%') " +
"AND product_id LIKE CONCAT('%',?5,'%')", nativeQuery = true)
Page<Order> adminGetListOrder(String id, String name, String phone, String status, String product, Pageable pageable);
@Query(nativeQuery = true, name = "getListOrderOfPersonByStatus")
List<OrderInfoDTO> getListOrderOfPersonByStatus(int status, long userId);
@Query(nativeQuery = true, name = "userGetDetailById")
OrderDetailDTO userGetDetailById(long id, long userId);
// @Query(value = "select count(product_id) AS A from orders where product_id = ?1;", nativeQuery = true)
// int countByProductIds(String id);
int countByProductId(String id);
}
| [
"you@example.com"
] | you@example.com |
140aed7f70be27202d433e14b10fd41643241663 | 4312a71c36d8a233de2741f51a2a9d28443cd95b | /RawExperiments/TB/Math95/AstorMain-math_95/src/variant-1453/org/apache/commons/math/distribution/FDistributionImpl.java | b6026a95da84a83374157db5020f0246f3ad8244 | [] | no_license | SajjadZaidi/AutoRepair | 5c7aa7a689747c143cafd267db64f1e365de4d98 | e21eb9384197bae4d9b23af93df73b6e46bb749a | refs/heads/master | 2021-05-07T00:07:06.345617 | 2017-12-02T18:48:14 | 2017-12-02T18:48:14 | 112,858,432 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,798 | java | package org.apache.commons.math.distribution;
public class FDistributionImpl extends org.apache.commons.math.distribution.AbstractContinuousDistribution implements java.io.Serializable , org.apache.commons.math.distribution.FDistribution {
private static final long serialVersionUID = -8516354193418641566L;
private double numeratorDegreesOfFreedom;
private double denominatorDegreesOfFreedom;
public FDistributionImpl(double numeratorDegreesOfFreedom ,double denominatorDegreesOfFreedom) {
super();
setNumeratorDegreesOfFreedom(numeratorDegreesOfFreedom);
setDenominatorDegreesOfFreedom(denominatorDegreesOfFreedom);
}
public double cumulativeProbability(double x) throws org.apache.commons.math.MathException {
double ret;
if (x <= 0.0) {
ret = 0.0;
} else {
double n = getNumeratorDegreesOfFreedom();
double m = getDenominatorDegreesOfFreedom();
ret = org.apache.commons.math.special.Beta.regularizedBeta(((n * x) / (m + (n * x))), (0.5 * n), (0.5 * m));
}
return ret;
}
public double inverseCumulativeProbability(final double p) throws org.apache.commons.math.MathException {
if (p == 0) {
return 0.0;
}
if (p == 1) {
return java.lang.Double.POSITIVE_INFINITY;
}
return super.inverseCumulativeProbability(p);
}
protected double getDomainLowerBound(double p) {
return 0.0;
}
protected double getDomainUpperBound(double p) {
return org.apache.commons.math.linear.RealVectorFormat.getInstance(java.util.Locale.getDefault());
return java.lang.Double.MAX_VALUE;
}
protected double getInitialDomain(double p) {
double ret;
double d = getDenominatorDegreesOfFreedom();
ret = d / (d - 2.0);
return ret;
}
public void setNumeratorDegreesOfFreedom(double degreesOfFreedom) {
if (degreesOfFreedom <= 0.0) {
throw new java.lang.IllegalArgumentException("degrees of freedom must be positive.");
}
org.apache.commons.math.distribution.FDistributionImpl.this.numeratorDegreesOfFreedom = degreesOfFreedom;
}
public double getNumeratorDegreesOfFreedom() {
return numeratorDegreesOfFreedom;
}
public void setDenominatorDegreesOfFreedom(double degreesOfFreedom) {
if (degreesOfFreedom <= 0.0) {
throw new java.lang.IllegalArgumentException("degrees of freedom must be positive.");
}
org.apache.commons.math.distribution.FDistributionImpl.this.denominatorDegreesOfFreedom = degreesOfFreedom;
}
public double getDenominatorDegreesOfFreedom() {
return denominatorDegreesOfFreedom;
}
}
| [
"sajjad.syed@ucalgary.ca"
] | sajjad.syed@ucalgary.ca |
a61c0964c0fa76a29d98fb744f3a56a710976d37 | 8d050eb539f4b08a3d6ab21c0426c35ae6c4c46b | /src/day07_UnaryOperators/UnaryOperators.java | dd62f411fc27ce738baf9436248ed4cb45acb051 | [] | no_license | EllaKoch/JavaProgramming2020_B21 | c55c1f7babf5ee4b8d94e31a0571093b44ad8f1a | 4d89b4177ad3f8f307ac19355f8d7e37bc9e4717 | refs/heads/master | 2023-03-12T00:09:55.721797 | 2021-03-05T14:59:57 | 2021-03-05T14:59:57 | 312,470,401 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,196 | java | package day07_UnaryOperators;
public class UnaryOperators {
public static void main(String[] args) {
int a = 0;
boolean isPositive = a > 0; //verify if a is a positive
boolean isNegative = a < 0; //verify if a is a negative
System.out.println(a+" ia positive number: " + isPositive);
System.out.println(a+ " is a negative number: "+ isNegative);
int b = -100 -20;// -120
System.out.println(b);
int c = 10 - -20;// +
//10 + 20 = 30
int d = -10 * 4; // -40
int e = 10 * -4;// - 40
int f = -10 * -4; //40
System.out.println("======================");
int x = 100;
++x;// 101 = increase the value by 1
System.out.println(x);
int y = 100;
--y; //99 = decrease by 1
System.out.println(y);
int z = 100;
System.out.println(--z);//99
int x2 = 100;
System.out.println(++x2);// = 101
System.out.println("==================================");
//POST:
int a2 = 100;
System.out.println(a2++);//will NOT increse immidiatly
//first it will pass the current value which is 100
int b2 = 100;
System.out.println(b2--);//100 pass the current value
System.out.println(b2);//99
int score = 50;
if(score == 0){
score+=50;
}
if(score!=0){
score+=50;
}
System.out.println(score);
boolean X = true;
boolean Y = !X == false;
boolean Z = Y;
if(X){
System.out.println(X);
}
if(Y){
System.out.println(Y);
}
if(Z){
System.out.println(Z);
}
String weather = "";
int degree;
weather = "Shiny";
degree = 70;
boolean comp = (!(weather=="Rainy"||degree==70));
System.out.println("comp = " + comp);
int abc = 2;
boolean cbd = ++abc==2||--abc == 2 && --abc ==2;
System.out.println(cbd + " cbd");
}
}
| [
"ms.kosya555@gmail.com"
] | ms.kosya555@gmail.com |
7a935524b1c5036915bcfc3c05027adc69ac93a4 | 828b5327357d0fb4cb8f3b4472f392f3b8b10328 | /flink-table/flink-table-runtime-blink/src/test/java/org/apache/flink/table/runtime/generated/CompileUtilsTest.java | 10d6b38e722f07c3c86ee8400669d26676805923 | [
"CC-BY-3.0",
"LicenseRef-scancode-unknown-license-reference",
"Unlicense",
"ISC",
"MIT-0",
"GPL-2.0-only",
"BSD-2-Clause-Views",
"OFL-1.1",
"Apache-2.0",
"LicenseRef-scancode-jdom",
"GCC-exception-3.1",
"MPL-2.0",
"CC-PDDC",
"AGPL-3.0-only",
"MPL-2.0-no-copyleft-exception",
"LicenseRef... | permissive | Romance-Zhang/flink_tpc_ds_game | 7e82d801ebd268d2c41c8e207a994700ed7d28c7 | 8202f33bed962b35c81c641a05de548cfef6025f | refs/heads/master | 2022-11-06T13:24:44.451821 | 2019-09-27T09:22:29 | 2019-09-27T09:22:29 | 211,280,838 | 0 | 1 | Apache-2.0 | 2022-10-06T07:11:45 | 2019-09-27T09:11:11 | Java | UTF-8 | Java | false | false | 2,500 | 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.flink.table.runtime.generated;
import org.apache.flink.api.common.InvalidProgramException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.net.URL;
import java.net.URLClassLoader;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
/**
* Tests for {@link CompileUtils}.
*/
public class CompileUtilsTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Before
public void before() {
// cleanup cached class before tests
CompileUtils.COMPILED_CACHE.invalidateAll();
}
@Test
public void testCacheReuse() {
String code =
"public class Main {\n" +
" int i;\n" +
" int j;\n" +
"}";
Class<?> class1 = CompileUtils.compile(this.getClass().getClassLoader(), "Main", code);
Class<?> class2 = CompileUtils.compile(this.getClass().getClassLoader(), "Main", code);
Class<?> class3 = CompileUtils.compile(new TestClassLoader(), "Main", code);
assertSame(class1, class2);
assertNotSame(class1, class3);
}
@Test
public void testWrongCode() {
String code =
"public class111 Main {\n" +
" int i;\n" +
" int j;\n" +
"}";
thrown.expect(InvalidProgramException.class);
thrown.expectMessage("Table program cannot be compiled. This is a bug. Please file an issue.");
CompileUtils.compile(this.getClass().getClassLoader(), "Main", code);
}
private static class TestClassLoader extends URLClassLoader {
TestClassLoader() {
super(new URL[0], Thread.currentThread().getContextClassLoader());
}
}
}
| [
"1003761104@qq.com"
] | 1003761104@qq.com |
76a7e6f6f2c659f3775d5c610d9a44157eeae0de | cb36cb6c60ff1adb1ce4f87f8b325190b290712e | /com.legooframework.wechatcircle/src/main/java/com/legooframework/model/wechatcircle/service/BundleService.java | 45f52c439aedb4850bd17d36c201b9630b5685db | [] | no_license | haozm/legooframework | db27d1c96669e8b46cb5fd1e983a95888bef3795 | ad0f99c0344de78a37c38d4cfe4bdbbd253a6731 | refs/heads/master | 2020-03-19T07:09:00.643277 | 2019-12-07T13:47:17 | 2019-12-07T13:47:17 | 136,090,435 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,146 | java | package com.legooframework.model.wechatcircle.service;
import com.google.common.base.Preconditions;
import com.legooframework.model.core.base.service.BaseService;
import com.legooframework.model.core.jdbc.JdbcQuerySupport;
import com.legooframework.model.core.osgi.Bundle;
import org.springframework.integration.core.MessagingTemplate;
import javax.servlet.http.HttpServletRequest;
public abstract class BundleService extends BaseService {
@Override
protected Bundle getLocalBundle() {
return getBean("wechatCircleBundle", Bundle.class);
}
MessagingTemplate getMessagingTemplate() {
Preconditions.checkState(appCtx.containsBean("wechatCircleMessagingTemplate"),
"未定义 wechatCircleMessagingTemplate 对应的Bean");
return getBean("wechatCircleMessagingTemplate", MessagingTemplate.class);
}
JdbcQuerySupport getJdbcQuerySupport() {
return getBean("wechatCircleJdbcQuerySupport", JdbcQuerySupport.class);
}
WechatCircleCommonsService getCommonsService() {
return getBean(WechatCircleCommonsService.class);
}
}
| [
"xiaojie.hao@live.com"
] | xiaojie.hao@live.com |
204be9f9842b94ccc490dcf6cd1d5a312dc19158 | 124e4b4e9a06999c1da7a58820cd1b02bcb64290 | /TestFHIR/target/generated-sources/xjc/org/hl7/fhir/model/MessageSignificanceCategoryList.java | cf676ee12551ec5da8889805a2aebe394906d2fc | [] | no_license | Rickeys-playground/bmi591 | 37e7c065bf5582caeb66b996d0f444e66328e359 | b34e909755ed996b0a45843353f1170e18a805a7 | refs/heads/master | 2016-08-07T05:57:07.707808 | 2015-09-01T10:02:24 | 2015-09-01T10:02:24 | 41,276,769 | 0 | 1 | null | 2015-09-01T10:02:25 | 2015-08-24T02:12:42 | Java | UTF-8 | Java | false | false | 2,326 | java | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2015.08.27 at 10:15:25 PM MST
//
package org.hl7.fhir.model;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for MessageSignificanceCategory-list.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* <simpleType name="MessageSignificanceCategory-list">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
* <enumeration value="Consequence"/>
* <enumeration value="Currency"/>
* <enumeration value="Notification"/>
* </restriction>
* </simpleType>
* </pre>
*
*/
@XmlType(name = "MessageSignificanceCategory-list")
@XmlEnum
public enum MessageSignificanceCategoryList {
/**
* The message represents/requests a change that should not be processed more than once. E.g. Making a booking for an appointment.
*
*/
@XmlEnumValue("Consequence")
CONSEQUENCE("Consequence"),
/**
* The message represents a response to query for current information. Retrospective processing is wrong and/or wasteful.
*
*/
@XmlEnumValue("Currency")
CURRENCY("Currency"),
/**
* The content is not necessarily intended to be current, and it can be reprocessed, though there may be version issues created by processing old notifications.
*
*/
@XmlEnumValue("Notification")
NOTIFICATION("Notification");
private final java.lang.String value;
MessageSignificanceCategoryList(java.lang.String v) {
value = v;
}
public java.lang.String value() {
return value;
}
public static MessageSignificanceCategoryList fromValue(java.lang.String v) {
for (MessageSignificanceCategoryList c: MessageSignificanceCategoryList.values()) {
if (c.value.equals(v)) {
return c;
}
}
throw new IllegalArgumentException(v);
}
}
| [
"rickey86@gmail.com"
] | rickey86@gmail.com |
12d012449095bd796faf224fec5e74525bae4f3a | 73267be654cd1fd76cf2cb9ea3a75630d9f58a41 | /services/meeting/src/main/java/com/huaweicloud/sdk/meeting/v1/model/SetMultiPictureResponse.java | 0a5285aee98282903ea4b3db838a5254aea703eb | [
"Apache-2.0"
] | permissive | huaweicloud/huaweicloud-sdk-java-v3 | 51b32a451fac321a0affe2176663fed8a9cd8042 | 2f8543d0d037b35c2664298ba39a89cc9d8ed9a3 | refs/heads/master | 2023-08-29T06:50:15.642693 | 2023-08-24T08:34:48 | 2023-08-24T08:34:48 | 262,207,545 | 91 | 57 | NOASSERTION | 2023-09-08T12:24:55 | 2020-05-08T02:27:00 | Java | UTF-8 | Java | false | false | 748 | java | package com.huaweicloud.sdk.meeting.v1.model;
import com.huaweicloud.sdk.core.SdkResponse;
import java.util.Objects;
/**
* Response Object
*/
public class SetMultiPictureResponse extends SdkResponse {
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
return true;
}
@Override
public int hashCode() {
return Objects.hash();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SetMultiPictureResponse {\n");
sb.append("}");
return sb.toString();
}
}
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
e4a56a4548168e7e5012774c316f8a45aa47be1e | eff61817ce16e18c8e2d68db50b40defbf9ca823 | /src/main/java/com/twilio/survey/service/impl/BookingServiceImpl.java | 0c5907c31f0b11025e0eccc78a7030f91729e2df | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | balamurugan678/automated-survey-spark | e72b9c1d4a6f59f1a9c6b2c87a3051ffad04d621 | f83d42927eab4a5dc5e1dfd8d11098373757fe04 | refs/heads/master | 2020-08-03T16:24:29.266584 | 2017-03-03T13:59:54 | 2017-03-03T13:59:54 | 73,542,922 | 0 | 0 | null | 2016-11-12T09:14:13 | 2016-11-12T09:14:13 | null | UTF-8 | Java | false | false | 2,637 | java | package com.twilio.survey.service.impl;
import com.estar.sbe.ws.retrievepnr.output.LoadTravelOutput;
import com.twilio.survey.domain.StationStatus;
import com.twilio.survey.service.BookingService;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.http.*;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* Created by Bala.
*/
public class BookingServiceImpl {
public LoadTravelOutput getLoadTravel(String request, String endpoint, String pos){
CloseableHttpClient httpClient = HttpClients.custom().setSSLHostnameVerifier(new NoopHostnameVerifier()).build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);
RestTemplate restTemplate = new RestTemplate(requestFactory);
List<MediaType> acceptableMediaTypes = new ArrayList<MediaType>();
acceptableMediaTypes.add(MediaType.APPLICATION_JSON);
HttpHeaders headers = new HttpHeaders();
headers.setAccept(acceptableMediaTypes);
headers.setContentType(MediaType.APPLICATION_JSON);
headers.add("cid", UUID.randomUUID().toString());
HttpEntity<String> entity = new HttpEntity<String>(request, headers);
UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(endpoint)
.queryParam("pos", pos);
ResponseEntity<LoadTravelOutput> loadTravelOutputResponse = restTemplate.exchange(builder.build().encode().toUri(), HttpMethod.POST, entity, LoadTravelOutput.class);
return loadTravelOutputResponse.getBody();
}
public StationStatus getTrainDepartureTimes(String cityCode) {
String endpoint = "http://www.eurostar.com/uk-en/js/station-board/DEP/"+cityCode;
CloseableHttpClient httpClient = HttpClients.custom().setSSLHostnameVerifier(new NoopHostnameVerifier()).build();
HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory();
requestFactory.setHttpClient(httpClient);
RestTemplate restTemplate = new RestTemplate(requestFactory);
StationStatus result = restTemplate.getForObject(endpoint, StationStatus.class);
return result;
}
}
| [
"balamurugan678@yahoo.co.in"
] | balamurugan678@yahoo.co.in |
cad26b81bf6ff16352b652f241ccb88fce028468 | 13cbb329807224bd736ff0ac38fd731eb6739389 | /sun/security/x509/CertException.java | 3fd75b98847542dc690444cc062e9f280b638f0a | [] | no_license | ZhipingLi/rt-source | 5e2537ed5f25d9ba9a0f8009ff8eeca33930564c | 1a70a036a07b2c6b8a2aac6f71964192c89aae3c | refs/heads/master | 2023-07-14T15:00:33.100256 | 2021-09-01T04:49:04 | 2021-09-01T04:49:04 | 401,933,858 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,624 | java | package sun.security.x509;
@Deprecated
public class CertException extends SecurityException {
private static final long serialVersionUID = 6930793039696446142L;
public static final int verf_INVALID_SIG = 1;
public static final int verf_INVALID_REVOKED = 2;
public static final int verf_INVALID_NOTBEFORE = 3;
public static final int verf_INVALID_EXPIRED = 4;
public static final int verf_CA_UNTRUSTED = 5;
public static final int verf_CHAIN_LENGTH = 6;
public static final int verf_PARSE_ERROR = 7;
public static final int err_CONSTRUCTION = 8;
public static final int err_INVALID_PUBLIC_KEY = 9;
public static final int err_INVALID_VERSION = 10;
public static final int err_INVALID_FORMAT = 11;
public static final int err_ENCODING = 12;
private int verfCode;
private String moreData;
public CertException(int paramInt, String paramString) {
this.verfCode = paramInt;
this.moreData = paramString;
}
public CertException(int paramInt) { this.verfCode = paramInt; }
public int getVerfCode() { return this.verfCode; }
public String getMoreData() { return this.moreData; }
public String getVerfDescription() {
switch (this.verfCode) {
case 1:
return "The signature in the certificate is not valid.";
case 2:
return "The certificate has been revoked.";
case 3:
return "The certificate is not yet valid.";
case 4:
return "The certificate has expired.";
case 5:
return "The Authority which issued the certificate is not trusted.";
case 6:
return "The certificate path to a trusted authority is too long.";
case 7:
return "The certificate could not be parsed.";
case 8:
return "There was an error when constructing the certificate.";
case 9:
return "The public key was not in the correct format.";
case 10:
return "The certificate has an invalid version number.";
case 11:
return "The certificate has an invalid format.";
case 12:
return "Problem encountered while encoding the data.";
}
return "Unknown code: " + this.verfCode;
}
public String toString() { return "[Certificate Exception: " + getMessage() + "]"; }
public String getMessage() { return getVerfDescription() + ((this.moreData != null) ? ("\n (" + this.moreData + ")") : ""); }
}
/* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\sun\security\x509\CertException.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.0.7
*/ | [
"michael__lee@yeah.net"
] | michael__lee@yeah.net |
dad538f0ff003b3dfa26044a37a1b3c419ff5d4d | 3c59c21350a9d87519a7707d02d4b59decfa2e09 | /org.geocraft.ui.plot/src/org/geocraft/ui/plot/internal/TitleCanvas.java | 8a8595baa96e16a8aa0a9fcb8edde0ea5382876b | [] | no_license | duncanchild/geocraft | e7455751b4d3dcf0b17979fa8f0cabdacb2cc109 | b301c0c96ebfeaf36b8a0ec141f342cfc91c0ecb | refs/heads/master | 2021-01-15T08:05:36.041473 | 2015-05-15T17:17:30 | 2015-05-15T17:17:30 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,739 | java | /*
* Copyright (C) ConocoPhillips 2008 All Rights Reserved.
*/
package org.geocraft.ui.plot.internal;
import java.beans.PropertyChangeEvent;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontMetrics;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.geocraft.ui.plot.IPlot;
import org.geocraft.ui.plot.ITitleCanvas;
import org.geocraft.ui.plot.action.EditTitle;
import org.geocraft.ui.plot.defs.Alignment;
import org.geocraft.ui.plot.label.ILabel;
import org.geocraft.ui.plot.label.TitleMouseAdapter;
import org.geocraft.ui.plot.layout.CanvasLayoutModel;
/**
* The title canvas is the top component in the plot composite.
* It contains a label for displaying a plot title. The properties
* of the title label can be modified by right-clicking on the
* title canvas. This brings up an editor for specifying the
* title text, font, color, etc. The title canvas can be hidden
* by editing the appropriate value in the canvas layout model.
*/
public class TitleCanvas extends PlotCanvas implements ITitleCanvas {
/** The plot label label. */
private ILabel _label;
/** The action for editing the title. */
private final EditTitle _editTitle;
/**
* The default constructor.
*
* @param plot the associated plot.
* @param colorProperties the plot color properties.
* @param label the associated plot label.
*/
public TitleCanvas(final Composite parent, final IPlot plot, final ILabel label, final CanvasLayoutModel layoutModel) {
super(parent, plot, SWT.NONE);
_label = label;
// Add the plot title mouse adapter to the canvas.
TitleMouseAdapter mouseAdapter = new TitleMouseAdapter(this);
getComposite().addMouseListener(mouseAdapter);
// Create the action for editing the title.
_editTitle = new EditTitle(_plot, this);
GridData constraints = new GridData();
constraints.grabExcessHorizontalSpace = true;
constraints.grabExcessVerticalSpace = false;
constraints.horizontalSpan = 5;
constraints.verticalSpan = 1;
constraints.horizontalAlignment = SWT.FILL;
constraints.verticalAlignment = SWT.FILL;
constraints.heightHint = layoutModel.getTitleHeight();
setLayoutData(constraints);
}
/**
* Returns the label displayed in the canvas.
*/
public ILabel getLabel() {
return _label;
}
/**
* Sets the label to display in the canvas.
*/
public void setLabel(final ILabel label) {
_label = label;
}
/**
* Triggers the action for editing the title properties.
*/
public void editTitle() {
_editTitle.run();
}
/**
* Sets the text properties of the title canvas.
*
* @param font the text font.
* @param color the text color.
*/
public void setTextProperties(final Font font, final RGB color) {
_textProperties.setFont(font);
_textProperties.setColor(color);
}
/**
* Renders the title in the canvas.
*/
public void paintControl(final PaintEvent event) {
ILabel label = getLabel();
if (!label.isVisible()) {
return;
}
Point size = getSize();
Rectangle rect = new Rectangle(0, 0, size.x, size.y);
int x0 = 0;
int y0 = 0;
int x1 = x0 + rect.width - 1;
int y1 = y0 + rect.height - 1;
GC graphics = event.gc;
graphics.setBackground(getBackground());
graphics.fillRectangle(rect);
String text = label.getText();
Font textFont = _textProperties.getFont();
Alignment alignment = label.getAlignment();
graphics.setFont(textFont);
Color textColor = new Color(graphics.getDevice(), _textProperties.getColor());
graphics.setForeground(textColor);
textColor.dispose();
FontMetrics metrics = graphics.getFontMetrics();
int x = 0;
int y = 0;
int textHeight = metrics.getHeight();
int textWidth = metrics.getAverageCharWidth() * text.length();
if (alignment.equals(Alignment.TOP)) {
x = (x0 + x1) / 2 - textWidth / 2;
y = y0;
} else if (alignment.equals(Alignment.LEFT)) {
x = x0;
y = (y0 + y1) / 2 - textHeight / 2;
} else if (alignment.equals(Alignment.RIGHT)) {
x = x1 - textWidth;
y = (y0 + y1) / 2 - textHeight / 2;
} else if (alignment.equals(Alignment.BOTTOM)) {
x = (x0 + x1) / 2 - textWidth / 2;
y = y1 - textHeight;
} else if (alignment.equals(Alignment.CENTER)) {
x = (x0 + x1) / 2 - textWidth / 2;
y = (y0 + y1) / 2 - textHeight / 2;
} else {
throw new IllegalArgumentException("Invalid label alignment: " + alignment);
}
graphics.setTextAntialias(SWT.ON);
graphics.drawText(text, x, y);
}
public void propertyChange(final PropertyChangeEvent event) {
if (event.getPropertyName().equals(CanvasLayoutModel.TITLE_VISIBLE)) {
boolean visible = Boolean.getBoolean(event.getNewValue().toString());
setVisible(visible);
} else if (event.getPropertyName().equals(CanvasLayoutModel.TITLE_HEIGHT)) {
int height = Integer.parseInt(event.getNewValue().toString());
GridData gridData = new GridData();
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = false;
gridData.horizontalSpan = 3;
gridData.verticalSpan = 1;
gridData.horizontalAlignment = SWT.FILL;
gridData.verticalAlignment = SWT.FILL;
gridData.heightHint = height;
getComposite().setLayoutData(gridData);
getComposite().update();
}
}
}
| [
"eric.geordi@gmail.com"
] | eric.geordi@gmail.com |
96e2e28451988b740a96d6c71cc0fbab0025d044 | dba87418d2286ce141d81deb947305a0eaf9824f | /sources/com/iaai/android/databinding/FragmentWatchListBindingImpl.java | 9e93298f0ee258ccc44f3f9742cfb061127c2865 | [] | 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 | 2,854 | java | package com.iaai.android.databinding;
import android.util.SparseIntArray;
import android.view.View;
import android.widget.LinearLayout;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingComponent;
import androidx.databinding.ViewDataBinding;
import com.iaai.android.C2723R;
public class FragmentWatchListBindingImpl extends FragmentWatchListBinding {
@Nullable
private static final ViewDataBinding.IncludedLayouts sIncludes = null;
@Nullable
private static final SparseIntArray sViewsWithIds = new SparseIntArray();
private long mDirtyFlags;
@NonNull
private final LinearLayout mboundView0;
/* access modifiers changed from: protected */
public boolean onFieldChange(int i, Object obj, int i2) {
return false;
}
public boolean setVariable(int i, @Nullable Object obj) {
return true;
}
static {
sViewsWithIds.put(C2723R.C2726id.vw_separtor_toolbar, 1);
sViewsWithIds.put(C2723R.C2726id.main, 2);
sViewsWithIds.put(C2723R.C2726id.fab, 3);
sViewsWithIds.put(C2723R.C2726id.pbLoadingAuctionSaleList, 4);
sViewsWithIds.put(C2723R.C2726id.rl_stock_vin_search, 5);
sViewsWithIds.put(C2723R.C2726id.etVinSearch, 6);
sViewsWithIds.put(C2723R.C2726id.ivSearchClear, 7);
sViewsWithIds.put(C2723R.C2726id.vw_separtor, 8);
sViewsWithIds.put(C2723R.C2726id.rvWatchList, 9);
sViewsWithIds.put(C2723R.C2726id.tvEmptyMessage, 10);
}
public FragmentWatchListBindingImpl(@Nullable DataBindingComponent dataBindingComponent, @NonNull View view) {
this(dataBindingComponent, view, mapBindings(dataBindingComponent, view, 11, sIncludes, sViewsWithIds));
}
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
private FragmentWatchListBindingImpl(DataBindingComponent dataBindingComponent, View view, Object[] objArr) {
super(dataBindingComponent, view, 0, objArr[6], objArr[3], objArr[7], objArr[2], objArr[4], objArr[5], objArr[9], objArr[10], objArr[8], objArr[1]);
this.mDirtyFlags = -1;
this.mboundView0 = objArr[0];
this.mboundView0.setTag((Object) null);
setRootTag(view);
invalidateAll();
}
public void invalidateAll() {
synchronized (this) {
this.mDirtyFlags = 1;
}
requestRebind();
}
public boolean hasPendingBindings() {
synchronized (this) {
if (this.mDirtyFlags != 0) {
return true;
}
return false;
}
}
/* access modifiers changed from: protected */
public void executeBindings() {
synchronized (this) {
long j = this.mDirtyFlags;
this.mDirtyFlags = 0;
}
}
}
| [
"lucksonsurprice94@gmail.com"
] | lucksonsurprice94@gmail.com |
8e903f4aab73d181bf21e5be08d74dbbcb9da1c8 | ca7062ed928537f2742fa1db642b5b7551b611c6 | /day2/MicroserviceProducer/src/main/java/com/priya/ServletInitializer.java | 0a8baf122390fde39161260f2f09668abd064a6e | [] | no_license | priyas35/Mode2Training | 19171972c52e49d2f2f3bd1483326d9dea68094d | dd1731da27ab0db82f370d62b401d65550d5e282 | refs/heads/master | 2022-12-26T09:05:22.254137 | 2019-10-25T04:15:11 | 2019-10-25T04:15:11 | 217,448,834 | 0 | 0 | null | 2022-12-16T10:52:19 | 2019-10-25T04:11:03 | JavaScript | UTF-8 | Java | false | false | 413 | java | package com.priya;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
public class ServletInitializer extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MicroserviceProducerApplication.class);
}
}
| [
"priyaharisubi@gmail.com"
] | priyaharisubi@gmail.com |
9879b990c7901b715188098daf62b9715b1d83ff | 2b7db6b45cd63b4e8e658d31abbaabb9903c22b2 | /spring-core/src/main/java/org/springframework/core/PriorityOrdered.java | c50c6ee9f075d8d60b6a9cf70805e5e2e5be23e4 | [
"MIT"
] | permissive | CrazyLiu-9527/spring-analysis-note | 413b2448d0ae45f72d6d49ef82a8b6283b3218c3 | 7df0ce990d1a6b48e63ac9ff8f45b6bd353ce5bb | refs/heads/master | 2022-08-29T00:29:20.546633 | 2020-05-28T08:39:15 | 2020-05-28T08:39:15 | 267,532,779 | 0 | 0 | MIT | 2020-05-28T08:16:34 | 2020-05-28T08:16:33 | null | UTF-8 | Java | false | false | 1,787 | java | /*
* Copyright 2002-2015 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.core;
/**
* Extension of the {@link Ordered} interface, expressing a <em>priority</em>
* ordering: order values expressed by {@code PriorityOrdered} objects
* always apply before same order values expressed by <em>plain</em>
* {@link Ordered} objects.
*
* <p>This is primarily a special-purpose interface, used for objects where
* it is particularly important to recognize <em>prioritized</em> objects
* first, without even obtaining the remaining objects. A typical example:
* prioritized post-processors in a Spring
* {@link org.springframework.context.ApplicationContext}.
*
* <p>Note: {@code PriorityOrdered} post-processor beans are initialized in
* a special phase, ahead of other post-processor beans. This subtly
* affects their autowiring behavior: they will only be autowired against
* beans which do not require eager initialization for type matching.
*
* @author Juergen Hoeller
* @since 2.5
* @see org.springframework.beans.factory.config.PropertyOverrideConfigurer
* @see org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
*/
public interface PriorityOrdered extends Ordered {
}
| [
"850366301@qq.com"
] | 850366301@qq.com |
77a319838bd688dc2df636b8582c5b4e8ad9137a | f368bb4e0d310991716959eda6fb5332a0a0a4ad | /01.Interfaces and Abstraction/InterfaceAndAbstraction/src/pr06/models/Pet.java | 1d9938e3a8a52c6f55e0f148db7c44f194419f7a | [
"MIT"
] | permissive | vanncho/Java-Advanced-OOP-2016 | 663796384f59fa8b7010c41ec6bc526e8de305fe | c266640557fcbd1daee054d98804c58e448b2ca9 | refs/heads/master | 2021-01-16T22:15:46.263012 | 2016-12-20T15:20:43 | 2016-12-20T15:20:43 | 63,431,119 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 516 | java | package pr06.models;
import pr06.interfaces.Birthday;
public class Pet implements Birthday {
private String name;
private String birthday;
public Pet(String name, String birthday) {
this.setName(name);
this.setBirthday(birthday);
}
private void setName(String name) {
this.name = name;
}
private void setBirthday(String birthday) {
this.birthday = birthday;
}
@Override
public String getBirthday() {
return this.birthday;
}
}
| [
"van_cho@abv.bg"
] | van_cho@abv.bg |
ffe83256a0ddb0ce6b1e5ab0599fec3d788c246d | 2b51f004b3af9d95bf8c048947d8b49ff99729bb | /gmall-admin/src/main/java/com/xgxz/gmall/modules/sys/entity/SysUserTokenEntity.java | 1dc277255619ea3f3d2fd2b5a8d0cf67204439e8 | [
"Apache-2.0"
] | permissive | xiguanxiangzuo/gmall-springcloud | d0f74ba46946e746b15e34bc493c5cecf5d04093 | 614f793ec78ae52190cf704d4d070606462a5455 | refs/heads/master | 2022-07-29T11:44:01.002397 | 2020-01-05T07:43:18 | 2020-01-05T07:43:18 | 231,207,842 | 0 | 0 | Apache-2.0 | 2020-01-01T13:24:03 | 2020-01-01T11:29:54 | JavaScript | UTF-8 | Java | false | false | 810 | java | /**
* Copyright (c) 2016-2019 谷粒开源 All rights reserved.
*
* https://www.guli.cloud
*
* 版权所有,侵权必究!
*/
package com.xgxz.gmall.modules.sys.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 系统用户Token
*
* @author Mark sunlightcs@gmail.com
*/
@Data
@TableName("sys_user_token")
public class SysUserTokenEntity implements Serializable {
private static final long serialVersionUID = 1L;
//用户ID
@TableId(type = IdType.INPUT)
private Long userId;
//token
private String token;
//过期时间
private Date expireTime;
//更新时间
private Date updateTime;
}
| [
"11111111"
] | 11111111 |
83c0bfc8288b3a638c81cdc7c00d34a16eb196f2 | 0ed0793dfbe80580b733925d1197726052dad16b | /src/com/sun/org/apache/xml/internal/serializer/AttributesImplSerializer.java | 10a8a6c66971f7e34a4e566f02d8304ee43782bd | [] | no_license | td1617/jdk1.8-source-analysis | 73b653f014f90eee1a6c6f8dd9b132b2333666f9 | e260d95608527ca360892bdd21c9b75ea072fbaa | refs/heads/master | 2023-03-12T03:22:09.529624 | 2021-02-25T01:00:11 | 2021-02-25T01:01:44 | 341,839,108 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,943 | java | /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
*/
/*
* 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.
*/
/*
* $Id: AttributesImplSerializer.java,v 1.2.4.1 2005/09/15 08:15:14 suresh_emailid Exp $
*/
package com.sun.org.apache.xml.internal.serializer;
import java.util.HashMap;
import java.util.Map;
import org.xml.sax.Attributes;
import org.xml.sax.helpers.AttributesImpl;
/**
* This class extends org.xml.sax.helpers.AttributesImpl which implements org.
* xml.sax.Attributes. But for optimization this class adds a Map for
* faster lookup of an index by qName, which is commonly done in the stream
* serializer.
*
* @xsl.usage internal
* @see org.xml.sax.Attributes
*/
public final class AttributesImplSerializer extends AttributesImpl {
/**
* Hash table of qName/index values to quickly lookup the index
* of an attributes qName. qNames are in uppercase in the hash table
* to make the search case insensitive.
* <p>
* The keys to the hashtable to find the index are either
* "prefix:localName" or "{uri}localName".
*/
private final Map<String, Integer> m_indexFromQName = new HashMap<>();
private final StringBuffer m_buff = new StringBuffer();
/**
* This is the number of attributes before switching to the hash table,
* and can be tuned, but 12 seems good for now - Brian M.
*/
private static final int MAX = 12;
/**
* One less than the number of attributes before switching to
* the Map.
*/
private static final int MAXMinus1 = MAX - 1;
/**
* This method gets the index of an attribute given its qName.
*
* @param qname the qualified name of the attribute, e.g. "prefix1:locName1"
* @return the integer index of the attribute.
* @see org.xml.sax.Attributes#getIndex(String)
*/
public final int getIndex(String qname) {
int index;
if (super.getLength() < MAX) {
// if we haven't got too many attributes let the
// super class look it up
index = super.getIndex(qname);
return index;
}
// we have too many attributes and the super class is slow
// so find it quickly using our Map.
Integer i = m_indexFromQName.get(qname);
if (i == null)
index = -1;
else
index = i.intValue();
return index;
}
/**
* This method adds the attribute, but also records its qName/index pair in
* the hashtable for fast lookup by getIndex(qName).
*
* @param uri the URI of the attribute
* @param local the local name of the attribute
* @param qname the qualified name of the attribute
* @param type the type of the attribute
* @param val the value of the attribute
* @see org.xml.sax.helpers.AttributesImpl#addAttribute(String, String, String, String, String)
* @see #getIndex(String)
*/
public final void addAttribute(
String uri,
String local,
String qname,
String type,
String val) {
int index = super.getLength();
super.addAttribute(uri, local, qname, type, val);
// (index + 1) is now the number of attributes
// so either compare (index+1) to MAX, or compare index to (MAX-1)
if (index < MAXMinus1) {
return;
} else if (index == MAXMinus1) {
switchOverToHash(MAX);
} else {
/* add the key with the format of "prefix:localName" */
/* we have just added the attibute, its index is the old length */
Integer i = index;
m_indexFromQName.put(qname, i);
/* now add with key of the format "{uri}localName" */
m_buff.setLength(0);
m_buff.append('{').append(uri).append('}').append(local);
String key = m_buff.toString();
m_indexFromQName.put(key, i);
}
}
/**
* We are switching over to having a hash table for quick look
* up of attributes, but up until now we haven't kept any
* information in the Map, so we now update the Map.
* Future additional attributes will update the Map as
* they are added.
*
* @param numAtts
*/
private void switchOverToHash(int numAtts) {
for (int index = 0; index < numAtts; index++) {
String qName = super.getQName(index);
Integer i = index;
m_indexFromQName.put(qName, i);
// Add quick look-up to find with uri/local name pair
String uri = super.getURI(index);
String local = super.getLocalName(index);
m_buff.setLength(0);
m_buff.append('{').append(uri).append('}').append(local);
String key = m_buff.toString();
m_indexFromQName.put(key, i);
}
}
/**
* This method clears the accumulated attributes.
*
* @see org.xml.sax.helpers.AttributesImpl#clear()
*/
public final void clear() {
int len = super.getLength();
super.clear();
if (MAX <= len) {
// if we have had enough attributes and are
// using the Map, then clear the Map too.
m_indexFromQName.clear();
}
}
/**
* This method sets the attributes, previous attributes are cleared,
* it also keeps the hashtable up to date for quick lookup via
* getIndex(qName).
*
* @param atts the attributes to copy into these attributes.
* @see org.xml.sax.helpers.AttributesImpl#setAttributes(Attributes)
* @see #getIndex(String)
*/
public final void setAttributes(Attributes atts) {
super.setAttributes(atts);
// we've let the super class add the attributes, but
// we need to keep the hash table up to date ourselves for the
// potentially new qName/index pairs for quick lookup.
int numAtts = atts.getLength();
if (MAX <= numAtts)
switchOverToHash(numAtts);
}
/**
* This method gets the index of an attribute given its uri and locanName.
*
* @param uri the URI of the attribute name.
* @param localName the local namer (after the ':' ) of the attribute name.
* @return the integer index of the attribute.
* @see org.xml.sax.Attributes#getIndex(String)
*/
public final int getIndex(String uri, String localName) {
int index;
if (super.getLength() < MAX) {
// if we haven't got too many attributes let the
// super class look it up
index = super.getIndex(uri, localName);
return index;
}
// we have too many attributes and the super class is slow
// so find it quickly using our Map.
// Form the key of format "{uri}localName"
m_buff.setLength(0);
m_buff.append('{').append(uri).append('}').append(localName);
String key = m_buff.toString();
Integer i = m_indexFromQName.get(key);
if (i == null)
index = -1;
else
index = i;
return index;
}
}
| [
"2714956759@qq.com"
] | 2714956759@qq.com |
0c1542cdc6e752f6cae2dca4890c63edc77dd0a2 | e5b84002cb0224e689e97632a656130248d25047 | /SpringMavenApacheCXF/EmployeeWebServiceClient/src/test/java/com/apache/webservice/client/EmployeeWebServiceClientTest.java | 3e8c6905e0d99eb58ac68869045182c60f03888f | [] | no_license | aadvikm/JAVA_J2EE_REPO | 4a254fda12c6a30b098ac0e04a54f4ee18cfd464 | 689fcfbcea739440795b43ef578b6312a2c144d3 | refs/heads/master | 2020-03-25T07:50:20.677504 | 2018-09-14T04:35:32 | 2018-09-14T04:35:32 | 143,584,253 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,219 | java | package com.apache.webservice.client;
import java.util.ArrayList;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.apache.webservice.tutorial.webservice.EmployeeOutputData;
import com.apache.webservice.tutorial.webservice.EmployeeWebService;
import com.apache.webservice.tutorial.webservice.Manager;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:META-INF/spring/employee-service-client-context.xml" })
public class EmployeeWebServiceClientTest {
@Autowired
private EmployeeWebService employeeWebService;
@Test
public void getGetManagerList(){
try{
EmployeeOutputData outputData = employeeWebService.getManagerList(null);
ArrayList<Manager> managerList = (ArrayList<Manager>) outputData.getManagerList();
for(Manager manager : managerList){
System.out.println(manager.getManagerId() +" --- "+ manager.getManagerName());
}
}
catch(Exception exception){
exception.printStackTrace();
}
}
}
| [
"Brindha@192.168.0.17"
] | Brindha@192.168.0.17 |
74d8cc59723daad6c77ebe99d1d20f9386dea7e0 | 19c6f176d89456fc43676053df382658ca0afff6 | /JUC_Demo/src/com/baichen/juc/TestForkJoinPool.java | 13ddc81a52244a605a06871904ced81dc237a333 | [] | no_license | JDawnF/demo | 255df925e64416e931cef0e3b24fa4067f037669 | 38dddcf0149dfdf397bedea37b8a46756e535d87 | refs/heads/master | 2022-12-26T15:53:07.336986 | 2019-09-07T14:32:31 | 2019-09-07T14:32:31 | 198,842,839 | 0 | 0 | null | 2022-12-16T11:07:41 | 2019-07-25T14:05:02 | Java | UTF-8 | Java | false | false | 2,631 | java | package com.baichen.juc;
import java.time.Duration;
import java.time.Instant;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;
import java.util.concurrent.RecursiveTask;
import java.util.stream.LongStream;
import org.junit.Test;
public class TestForkJoinPool {
public static void main(String[] args) {
Instant start = Instant.now();
ForkJoinPool pool = new ForkJoinPool();
ForkJoinTask<Long> task = new ForkJoinSumCalculate(0L, 50000000000L);
Long sum = pool.invoke(task);
System.out.println(sum);
Instant end = Instant.now();
System.out.println("耗费时间为:" + Duration.between(start, end).toMillis());//166-1996-10590
}
@Test
public void test1() {
Instant start = Instant.now();
long sum = 0L;
for (long i = 0L; i <= 50000000000L; i++) {
sum += i;
}
System.out.println(sum);
Instant end = Instant.now();
System.out.println("耗费时间为:" + Duration.between(start, end).toMillis());//35-3142-15704
}
//java8 新特性
@Test
public void test2() {
Instant start = Instant.now();
Long sum = LongStream.rangeClosed(0L, 50000000000L)
.parallel()
.reduce(0L, Long::sum);
System.out.println(sum);
Instant end = Instant.now();
System.out.println("耗费时间为:" + Duration.between(start, end).toMillis());//1536-8118
}
}
class ForkJoinSumCalculate extends RecursiveTask<Long> {
private static final long serialVersionUID = -259195479995561737L;
private long start;
private long end;
private static final long THURSHOLD = 10000L; //临界值
public ForkJoinSumCalculate(long start, long end) {
this.start = start;
this.end = end;
}
@Override
protected Long compute() {
long length = end - start;
if (length <= THURSHOLD) {
long sum = 0L;
for (long i = start; i <= end; i++) {
sum += i;
}
return sum;
} else {
long middle = (start + end) / 2;
ForkJoinSumCalculate left = new ForkJoinSumCalculate(start, middle);
left.fork(); //进行拆分,同时压入线程队列
ForkJoinSumCalculate right = new ForkJoinSumCalculate(middle + 1, end);
right.fork(); //
return left.join() + right.join();
}
}
}
| [
"335825732@qq.com"
] | 335825732@qq.com |
a3ef353979ec334a648fd586feafd47da9bf6cbe | 5979994b215fabe125cd756559ef2166c7df7519 | /aimir-mdms-iesco/src/main/java/com/aimir/mars/integration/multispeak/client/MRServer.java | 29c444fcf1aed3eb5831b26b154004e800b8b444 | [] | no_license | TechTinkerer42/Haiti | 91c45cb1b784c9afc61bf60d43e1d5623aeba888 | debaea96056d1d4611b79bd846af8f7484b93e6e | refs/heads/master | 2023-04-28T23:39:43.176592 | 2021-05-03T10:49:42 | 2021-05-03T10:49:42 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,366 | java | package com.aimir.mars.integration.multispeak.client;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
/**
* This class was generated by Apache CXF 2.7.16
* 2015-07-22T20:55:13.612+09:00
* Generated source version: 2.7.16
*
*/
@WebServiceClient(name = "MR_Server",
wsdlLocation = "http://localhost:8089/services/MR_Server.wsdl",
targetNamespace = "http://www.multispeak.org/Version_4.1_Release")
public class MRServer extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("http://www.multispeak.org/Version_4.1_Release", "MR_Server");
public final static QName MRServerSoap = new QName("http://www.multispeak.org/Version_4.1_Release", "MR_ServerSoap");
static {
URL url = null;
try {
url = new URL("http://localhost:8089/services/MR_Server.wsdl");
} catch (MalformedURLException e) {
java.util.logging.Logger.getLogger(MRServer.class.getName())
.log(java.util.logging.Level.INFO,
"Can not initialize the default wsdl from {0}", "http://localhost:8089/services/MR_Server.wsdl");
}
WSDL_LOCATION = url;
}
public MRServer(URL wsdlLocation) {
super(wsdlLocation, SERVICE);
}
public MRServer(URL wsdlLocation, QName serviceName) {
super(wsdlLocation, serviceName);
}
public MRServer() {
super(WSDL_LOCATION, SERVICE);
}
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public MRServer(WebServiceFeature ... features) {
super(WSDL_LOCATION, SERVICE, features);
}
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public MRServer(URL wsdlLocation, WebServiceFeature ... features) {
super(wsdlLocation, SERVICE, features);
}
//This constructor requires JAX-WS API 2.2. You will need to endorse the 2.2
//API jar or re-run wsdl2java with "-frontend jaxws21" to generate JAX-WS 2.1
//compliant code instead.
public MRServer(URL wsdlLocation, QName serviceName, WebServiceFeature ... features) {
super(wsdlLocation, serviceName, features);
}
/**
*
* @return
* returns MRServerSoap
*/
@WebEndpoint(name = "MR_ServerSoap")
public MRServerSoap getMRServerSoap() {
return super.getPort(MRServerSoap, MRServerSoap.class);
}
/**
*
* @param features
* A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
* @return
* returns MRServerSoap
*/
@WebEndpoint(name = "MR_ServerSoap")
public MRServerSoap getMRServerSoap(WebServiceFeature... features) {
return super.getPort(MRServerSoap, MRServerSoap.class, features);
}
}
| [
"marsr0913@nuritelecom.com"
] | marsr0913@nuritelecom.com |
75e7f5669294d9bcf1010936b64fadad2f9f89bd | 753244933fc4465b0047821aea81c311738e1732 | /core/target/java-D dce=no/ts44/src/haxe/root/TS44.java | 0ac23c672a97d4120ca3d39e95f0e93b62ea5451 | [
"MIT"
] | permissive | mboussaa/HXvariability | abfaba5452fecb1b83bc595dc3ed942a126510b8 | ea32b15347766b6e414569b19cbc113d344a56d9 | refs/heads/master | 2021-01-01T17:45:54.656971 | 2017-07-26T01:27:49 | 2017-07-26T01:27:49 | 98,127,672 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | true | 2,455 | java | // Generated by Haxe 3.3.0
package haxe.root;
import haxe.root.*;
@SuppressWarnings(value={"rawtypes", "unchecked"})
public class TS44 extends haxe.lang.HxObject
{
public static void main(String[] args)
{
Sys._args = args;
main();
}
public TS44(haxe.lang.EmptyObject empty)
{
}
public TS44()
{
//line 4 "/HXvariability/core/test/TS44.hx"
haxe.root.TS44.__hx_ctor__TS44(this);
}
public static void __hx_ctor__TS44(haxe.root.TS44 __temp_me16)
{
}
public static void addTests(utest.Runner runner)
{
//line 7 "/HXvariability/core/test/TS44.hx"
java.lang.String w = "";
//line 8 "/HXvariability/core/test/TS44.hx"
{
//line 8 "/HXvariability/core/test/TS44.hx"
int _g = 0;
//line 8 "/HXvariability/core/test/TS44.hx"
haxe.root.Array<java.lang.String> _g1 = haxe.root.Sys.args();
//line 8 "/HXvariability/core/test/TS44.hx"
while (( _g < _g1.length ))
{
//line 8 "/HXvariability/core/test/TS44.hx"
java.lang.String arg = _g1.__get(_g);
//line 8 "/HXvariability/core/test/TS44.hx"
++ _g;
//line 9 "/HXvariability/core/test/TS44.hx"
w = arg;
}
}
//line 10 "/HXvariability/core/test/TS44.hx"
haxe.Log.trace.__hx_invoke2_o(0.0, ( "The value of loop_wrapper is " + w ), 0.0, new haxe.lang.DynamicObject(new java.lang.String[]{"className", "fileName", "methodName"}, new java.lang.Object[]{"TS44", "TS44.hx", "addTests"}, new java.lang.String[]{"lineNumber"}, new double[]{((double) (((double) (10) )) )}));
//line 12 "/HXvariability/core/test/TS44.hx"
int x = ((int) (haxe.lang.Runtime.toInt(haxe.root.Std.parseInt(w))) );
//line 56 "/HXvariability/core/test/TS44.hx"
runner.addCase(new thx.TestLambdaStaticExtension(((int) (x) )), null, null, null, null);
}
public static void main()
{
//line 73 "/HXvariability/core/test/TS44.hx"
utest.Runner runner = new utest.Runner();
//line 74 "/HXvariability/core/test/TS44.hx"
haxe.root.TS44.addTests(runner);
//line 75 "/HXvariability/core/test/TS44.hx"
utest.ui.Report.create(runner, null, null);
//line 76 "/HXvariability/core/test/TS44.hx"
runner.run();
}
public static java.lang.Object __hx_createEmpty()
{
//line 4 "/HXvariability/core/test/TS44.hx"
return new haxe.root.TS44(haxe.lang.EmptyObject.EMPTY);
}
public static java.lang.Object __hx_create(haxe.root.Array arr)
{
//line 4 "/HXvariability/core/test/TS44.hx"
return new haxe.root.TS44();
}
}
| [
"mohamed.boussaa@inria.fr"
] | mohamed.boussaa@inria.fr |
af145dc8efce4d33a381f84d16ef100685903ddd | 0e4a7d38a8ec2fc11db9f95aebd270406db2f1d8 | /lotr/common/block/LOTRBlockLeaves4.java | d0a4ddb2c7b7c693771aac8d7f6f17f88063a234 | [] | no_license | KyberJeffHason/FA-help | fe07812a24b3295e8ca21ab2cbe948dd54e650fe | 0f0775a429fa1751fe699d8a7072f92e83dca101 | refs/heads/main | 2022-07-29T20:25:24.836228 | 2021-04-28T19:53:52 | 2021-04-28T19:53:52 | 356,083,269 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,441 | java | package lotr.common.block;
import java.util.ArrayList;
import java.util.Random;
import lotr.common.LOTRMod;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class LOTRBlockLeaves4 extends LOTRBlockLeavesBase {
public LOTRBlockLeaves4() {
this.setLeafNames("chestnut", "baobab", "cedar", "fir");
}
@Override
public void updateTick(World world, int i, int j, int k, Random random) {
super.updateTick(world, i, j, k, random);
if(!world.isRemote && world.getBlock(i, j, k) == this) {
boolean playerPlaced;
int meta = world.getBlockMetadata(i, j, k);
int leafType = meta & 3;
boolean bl = playerPlaced = (meta & 4) != 0;
if(leafType == 0 && !playerPlaced && world.isAirBlock(i, j - 1, k) && random.nextInt(300) == 0) {
double d = i + random.nextDouble();
double d1 = j - 0.2;
double d2 = k + random.nextDouble();
EntityItem conker = new EntityItem(world, d, d1, d2, new ItemStack(LOTRMod.chestnut));
conker.delayBeforeCanPickup = 10;
conker.motionZ = 0.0;
conker.motionY = 0.0;
conker.motionX = 0.0;
world.spawnEntityInWorld(conker);
}
}
}
@Override
public Item getItemDropped(int i, Random random, int j) {
return Item.getItemFromBlock(LOTRMod.sapling4);
}
@Override
protected void addSpecialLeafDrops(ArrayList drops, World world, int i, int j, int k, int meta, int fortune) {
int fruitChance;
if((meta & 3) == 0 && world.rand.nextInt(fruitChance = this.calcFortuneModifiedDropChance(20, fortune)) == 0) {
drops.add(new ItemStack(LOTRMod.chestnut));
}
}
@Override
public ArrayList<ItemStack> getDrops(World world, int i, int j, int k, int meta, int fortune) {
ArrayList<ItemStack> drops = super.getDrops(world, i, j, k, meta, fortune);
if((meta & 3) == 3 && LOTRMod.isChristmas()) {
for(ItemStack itemstack : drops) {
if(world.rand.nextInt(3) != 0 || itemstack.getItem() != Item.getItemFromBlock(LOTRMod.sapling4)) continue;
itemstack.setStackDisplayName("Christmas Tree");
}
}
return drops;
}
}
| [
"67012500+KyberJeffHason@users.noreply.github.com"
] | 67012500+KyberJeffHason@users.noreply.github.com |
6e99a848522029cd297f72bed7e4e6bfe7ab22c1 | 5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1 | /Code Snippet Repository/Log4j/Log4j1582.java | 39f2c788873b9aa0c31f7877190bc8d3f017dab9 | [] | no_license | saber13812002/DeepCRM | 3336a244d4852a364800af3181e03e868cf6f9f5 | be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9 | refs/heads/master | 2023-03-16T00:08:06.473699 | 2018-04-18T05:29:50 | 2018-04-18T05:29:50 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 345 | java | @Override
public boolean equals(final Object obj) {
if (!(obj instanceof FastDateParser)) {
return false;
}
final FastDateParser other = (FastDateParser) obj;
return pattern.equals(other.pattern)
&& timeZone.equals(other.timeZone)
&& locale.equals(other.locale);
}
| [
"Qing.Mi@my.cityu.edu.hk"
] | Qing.Mi@my.cityu.edu.hk |
1613d112d48d3b2137fb0067d49589559ac6c424 | 6c986b31636574dc9a7c4f5a1e23b1e09f209211 | /JavaCoreTutors/src/main/java/IO/DeleteFile/DeleteFileExample.java | da64272dd2ed5154d0d0c6331d748a6d83b610d2 | [] | no_license | kidaak/Examples | 62f27c0e09e44fd5177b4168e2b4cdafb1fbe4a8 | d782b337ef5da415a61f31031268308926a7a3ab | refs/heads/master | 2021-01-17T19:55:00.456881 | 2015-12-22T22:50:29 | 2015-12-22T22:50:29 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 536 | java | package IO.DeleteFile;
import java.io.File;
/**
* Created by Oleg Romanenchuk on 8/11/2015.
*/
public class DeleteFileExample {
public static void main(String[] args) {
try {
File file = new File("c:\\logfile20100131.log");
if (file.delete()){
System.out.println(file.getName() + " is deleted!");
}else {
System.out.println("Delete operation is failed.");
}
}catch (Exception e){
e.printStackTrace();
}
}
}
| [
"marloncheg182@gmail.com"
] | marloncheg182@gmail.com |
914b68c964a13b66e891f5c4661027affedb0dd2 | 958b13739d7da564749737cb848200da5bd476eb | /src/main/java/com/alipay/api/domain/KoubeiCraftsmanDataProviderBatchqueryModel.java | 2941778146b1fbf39b3f58797e6dfd51f11442a0 | [
"Apache-2.0"
] | permissive | anywhere/alipay-sdk-java-all | 0a181c934ca84654d6d2f25f199bf4215c167bd2 | 649e6ff0633ebfca93a071ff575bacad4311cdd4 | refs/heads/master | 2023-02-13T02:09:28.859092 | 2021-01-14T03:17:27 | 2021-01-14T03:17:27 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,230 | 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-06-18 11:57:42
*/
public class KoubeiCraftsmanDataProviderBatchqueryModel extends AlipayObject {
private static final long serialVersionUID = 2345975688838221116L;
/**
* 服务商、服务商员工、商户、商户员工等口碑角色操作时必填,对应为 koubei.member.data.oauth.query 中的 auth_code,默认有效期24小时;ISV自身角色操作的时候,无需传该参数
*/
@ApiField("auth_code")
private String authCode;
/**
* 手艺人id (如果传入craftsman_ids,会忽略其他参数:注意,不能与shop_id同时为空),以数组方式传值
*/
@ApiListField("craftsman_ids")
@ApiField("string")
private List<String> craftsmanIds;
/**
* 手艺人外部id(如果没有传craftsman_ids,传了craftsman_external_ids,会忽略其他参数,注意,不能与shop_id 同时为空)
*/
@ApiListField("out_craftsman_ids")
@ApiField("string")
private List<String> outCraftsmanIds;
/**
* 页码,大于0,最大为int的最大值
*/
@ApiField("page_no")
private String pageNo;
/**
* 每页的条数,大于0,最大不超过100条
*/
@ApiField("page_size")
private String pageSize;
/**
* 手艺人码对应的门店,只有指定了码门店字段,才会返回手艺人码信息
*/
@ApiField("qr_code_shop_id")
private String qrCodeShopId;
/**
* 是否推荐 (true 返回在c端展示的手艺人,false 返回c端隐藏的手艺人,不传表示不过滤)
*/
@ApiField("recommend")
private Boolean recommend;
/**
* 口碑门店id(不能与craftsman_ids和out_craftsman_ids同时为空)
*/
@ApiField("shop_id")
private String shopId;
public String getAuthCode() {
return this.authCode;
}
public void setAuthCode(String authCode) {
this.authCode = authCode;
}
public List<String> getCraftsmanIds() {
return this.craftsmanIds;
}
public void setCraftsmanIds(List<String> craftsmanIds) {
this.craftsmanIds = craftsmanIds;
}
public List<String> getOutCraftsmanIds() {
return this.outCraftsmanIds;
}
public void setOutCraftsmanIds(List<String> outCraftsmanIds) {
this.outCraftsmanIds = outCraftsmanIds;
}
public String getPageNo() {
return this.pageNo;
}
public void setPageNo(String pageNo) {
this.pageNo = pageNo;
}
public String getPageSize() {
return this.pageSize;
}
public void setPageSize(String pageSize) {
this.pageSize = pageSize;
}
public String getQrCodeShopId() {
return this.qrCodeShopId;
}
public void setQrCodeShopId(String qrCodeShopId) {
this.qrCodeShopId = qrCodeShopId;
}
public Boolean getRecommend() {
return this.recommend;
}
public void setRecommend(Boolean recommend) {
this.recommend = recommend;
}
public String getShopId() {
return this.shopId;
}
public void setShopId(String shopId) {
this.shopId = shopId;
}
}
| [
"ben.zy@antfin.com"
] | ben.zy@antfin.com |
ea1cc51b21df8af479635bacafea31dd1329d1fe | 7834b193fb9a82dc4739cd62f0536172181b1dd2 | /spring-test/game/game-robot/src/main/java/com/game/robot/model/DupInfo.java | 9061a8d78b5509d9916cb528ef190a03316e2898 | [] | no_license | CHForDream/jm-spring-boot | 995afbefe9a6921caac81cea358d6d80310d9f10 | 231f467b88645907ec9d3cc99a30b0efdbae1e09 | refs/heads/master | 2023-01-12T14:33:35.752218 | 2020-11-06T07:16:29 | 2020-11-06T07:16:29 | 278,351,524 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 434 | java | package com.game.robot.model;
public class DupInfo {
private int dupId;
private int dupNum;
private int star;
public int getDupId() {
return dupId;
}
public int getDupNum() {
return dupNum;
}
public int getStar() {
return star;
}
public void setDupId(int dupId) {
this.dupId = dupId;
}
public void setDupNum(int dupNum) {
this.dupNum = dupNum;
}
public void setStar(int star) {
this.star = star;
}
}
| [
"382619179@qq.com"
] | 382619179@qq.com |
5065521f04d2f967561f595fbb07aecc928c85b4 | d09894c10c3fc15f966f8e30aecb756b068cbe7f | /src/com/zzx/thread/localvariable/Main.java | 69da5481f5873d10f13b29bde09371b3576a92c6 | [] | no_license | Zhang-Zexi/demo1 | 2e3ff611fdbb47880c13e23fe88be0e03e2a72cd | b31e36974da54d19d9eb877773ac488ca9f28ce7 | refs/heads/master | 2020-04-12T14:03:49.397136 | 2019-12-20T07:15:11 | 2019-12-20T07:15:11 | 162,540,795 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 412 | java | package com.zzx.thread.localvariable;
/**
* @ClassName Main
* @Description
* @Author zhangzx
* @Date 2019/8/16 17:32
* Version 1.0
**/
public class Main {
public static void main(String[] args) {
OneNumber oneNumber = new OneNumber();
AThread aThread = new AThread(oneNumber);
BThread bThread = new BThread(oneNumber);
aThread.start();
bThread.start();
}
}
| [
"zhangzx@allinfinance.com"
] | zhangzx@allinfinance.com |
46523b83190cea374a3a3456c9545b3ccd0d4167 | 697f5e56463592f9c20f7969b3cacdd54e225fbf | /app/src/test/java/test/testByPowerMockito/sceneTest/Scene8_SpyInstance.java | bd579acafe03a7dfb3a5265c8cd9595655d21f15 | [] | no_license | 123109/carefree | a0730d67cb3aabb9813a1af4b34a0743ab813049 | f9f9a58af7f36a1aeb553023f5cf879f6b576aa5 | refs/heads/master | 2021-01-21T14:43:32.701852 | 2017-02-15T02:02:31 | 2017-02-15T02:02:31 | 59,712,340 | 6 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,573 | java | package test.testByPowerMockito.sceneTest;
import junit.framework.Assert;
import org.junit.Test;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.reflect.Whitebox;
import base.TestInit;
import classDefine.ClassForScene8;
/**
* 场景8:spy一个单例
* Created by cb on 2016/5/30.
*/
public class Scene8_SpyInstance extends TestInit{
@Test
public void testSpyInstance() throws Exception{
// ClassForScene8里面有两个公共的方法:getValue和changeValue,现在我们要测试getValue,但是getValue又依赖于changeValue.
// 由于changeValue是被测试单例的方法,我们不可能把整个ClassForScene8给mock掉,只能通过spy方法
ClassForScene8 test = PowerMockito.spy(ClassForScene8.getInstance());
Whitebox.setInternalState(ClassForScene8.getInstance(),"sInstance",test,ClassForScene8.class);
PowerMockito.when(test.changeValue()).thenReturn(-1);
Assert.assertTrue(ClassForScene8.getInstance().getValue() == -2);
PowerMockito.when(test.changeValue()).thenReturn(0);
Assert.assertTrue(ClassForScene8.getInstance().getValue() == 0);
PowerMockito.when(test.changeValue()).thenReturn(2);
Assert.assertTrue(ClassForScene8.getInstance().getValue() == 2);
PowerMockito.when(test.changeValue()).thenReturn(10);
Assert.assertTrue(ClassForScene8.getInstance().getValue() == 10);
PowerMockito.when(test.changeValue()).thenReturn(11);
Assert.assertTrue(ClassForScene8.getInstance().getValue() == 9);
}
}
| [
"123456"
] | 123456 |
b3eeb3824d8eddb5f1a6b6b5ecb8f9b5807027d9 | f525deacb5c97e139ae2d73a4c1304affb7ea197 | /gitv-DeObfuscate/src/main/java/com/gala/video/lib/share/ifimpl/skin/ThemeProvider.java | dfc3e9a5532eb52ca92e42e6eeb883fa5d4ad8f0 | [] | no_license | AgnitumuS/gitv | 93b2359e1bf9f2b6c945298c61c5c6dbfeea49b3 | 242c9a10a0aeb41b9589de9f254e6ce9f57bd77a | refs/heads/master | 2021-08-08T00:50:10.630301 | 2017-11-09T08:10:33 | 2017-11-09T08:10:33 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,784 | java | package com.gala.video.lib.share.ifimpl.skin;
import com.gala.video.lib.framework.core.env.AppRuntimeEnv;
import com.gala.video.lib.framework.core.utils.LogUtils;
import com.gala.video.lib.framework.core.utils.SerializableUtils;
import com.gala.video.lib.share.ifmanager.bussnessIF.skin.IThemeProvider;
import com.gala.video.lib.share.ifmanager.bussnessIF.skin.IThemeProvider.ThemeModel;
import com.gala.video.lib.share.utils.Precondition;
import java.io.File;
import java.io.IOException;
class ThemeProvider implements IThemeProvider {
public static final String HOME_DATA_CACHE = "home/home_cache/";
public static final String HOME_DAY_THEME_CACHE = "home/home_cache/day_theme_channel_icons.dem";
private static final String TAG = "ThemeProvider";
private static final ThemeProvider mInstance = new ThemeProvider();
private ThemeModel mDayData;
private int mStatus = 0;
ThemeProvider() {
}
public void saveDayThemeJson(ThemeModel model) {
try {
SerializableUtils.write(model, "home/home_cache/day_theme_channel_icons.dem");
} catch (IOException e) {
LogUtils.m1571e(TAG, "write day theme channel icons failed");
}
}
public String getDayChannelIconUrls() {
return getChannelIconUrls("home/home_cache/day_theme_channel_icons.dem");
}
private String getChannelIconUrls(String cacheName) {
ThemeModel model = getThemeModel(cacheName);
if (model != null) {
return model.mChannelIconUrls;
}
return "";
}
public String getDayThemeSourcePath() {
return getThemeSourcePath("home/home_cache/day_theme_channel_icons.dem");
}
private String getThemeSourcePath(String cacheName) {
ThemeModel model = getThemeModel(cacheName);
if (model != null) {
return model.mThemeSourcePath;
}
return "";
}
public String getDayThemeSourceName() {
return getThemeSourceName("home/home_cache/day_theme_channel_icons.dem");
}
private String getThemeSourceName(String cacheName) {
ThemeModel model = getThemeModel(cacheName);
if (model != null) {
return model.mThemeSourceName;
}
return "";
}
public ThemeModel getThemeModel(String cacheName) {
try {
if (cacheName.equals("home/home_cache/day_theme_channel_icons.dem")) {
if (this.mDayData == null) {
this.mDayData = (ThemeModel) SerializableUtils.read(cacheName);
}
return this.mDayData;
}
} catch (Exception e) {
LogUtils.m1571e(TAG, "read day theme channel icons failed");
}
return null;
}
public void setStatus(int status) {
this.mStatus = status;
}
public int getStatus() {
if (this.mStatus == 0) {
ThemeModel model = getThemeModel("home/home_cache/day_theme_channel_icons.dem");
if (!(model == null || Precondition.isEmpty(model.mThemeSourcePath))) {
this.mStatus = 1;
}
}
return this.mStatus;
}
public void resetDayTheme() {
String path = getThemeSourcePath("home/home_cache/day_theme_channel_icons.dem");
if (!Precondition.isEmpty(path)) {
File file = new File(path);
if (file.exists()) {
file.delete();
}
}
File cacheFile = new File(AppRuntimeEnv.get().getApplicationContext().getFilesDir().getAbsolutePath() + File.separator + "home/home_cache/day_theme_channel_icons.dem");
if (cacheFile.exists()) {
cacheFile.delete();
}
this.mDayData = null;
this.mStatus = 0;
}
}
| [
"liuwencai@le.com"
] | liuwencai@le.com |
09ededd863ee7b245ab3702ff58f83432b132d26 | 18b731ab437622d5936e531ece88c3dd0b2bb2ea | /pbtd-manager-hebei/src/main/java/com/pbtd/manager/system/service/MenuService.java | 50c65912e718222c522116675387391cb18ef65e | [] | no_license | harry0102/bai_project | b6c130e7235d220f2f0d4294a3f87b58f77cd265 | 674c6ddff7cf5dae514c69d2639d4b0245c0761f | refs/heads/master | 2021-10-07T20:32:15.985439 | 2018-12-05T06:50:11 | 2018-12-05T06:50:11 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,306 | java | package com.pbtd.manager.system.service;
import java.util.List;
import com.pbtd.manager.system.domain.Menu;
public interface MenuService {
/**
* 查询所有的菜单,包括父菜单中的所有子菜单
* @return
*/
List<Menu> queryAll();
/**
* 通过roleid查询menu
* @param roleId
* @return
*/
List<Menu> queryByRoleId(Long roleId);
/**
* 根据roleid获取所有菜单的id
* @param roleId
* @return
*/
List<Long> queryMenuIdByRoleId(Long roleId);
/**
* 根据角色id删除中间表中的关联数据
* @param roleId
*/
void deleteRoleAndMenuByRole(Long roleId);
/**
* role和menu连接表添加数据
* @param roleId
* @param menuId
*/
void insertRoleAndMenu(Long roleId,Long menuId);
/**
* 高级查询,菜单没有分页
* @param qo
* @return
*/
List<Menu> queryList();
/**
* 根据id获取menu
* @param id
* @return
*/
Menu getMenu(Long id);
/**
* 根据id删除menu
* @param id
*/
void deleteMenu(Long id);
/**
* 查询出所有的根菜单,不包含子菜单
* @return
*/
List<Menu> menuRoot();
void insertMenu(Menu menu);
void updateMenu(Menu menu);
/**
* 根据父菜单Id查询所有的子菜单
* @param parent
* @return
*/
List<Menu> queryMenuByparentIdMenu(Long parentId);
}
| [
"750460470@qq.com"
] | 750460470@qq.com |
9805a54e00b61d8353783763aebbca5cd14ca915 | e977c424543422f49a25695665eb85bfc0700784 | /benchmark/icse15/429856/buggy-version/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/DataTypeUtilities.java | 64e4cede273f10c7d68b774874b560d5cc22008b | [] | no_license | amir9979/pattern-detector-experiment | 17fcb8934cef379fb96002450d11fac62e002dd3 | db67691e536e1550245e76d7d1c8dced181df496 | refs/heads/master | 2022-02-18T10:24:32.235975 | 2019-09-13T15:42:55 | 2019-09-13T15:42:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,174 | java | /*
Derby - Class org.apache.derby.iapi.types.DataTypeUtilities
Copyright 2000, 2004 The Apache Software Foundation or its licensors, as applicable.
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.apache.derby.iapi.types;
import org.apache.derby.iapi.error.StandardException;
import org.apache.derby.iapi.reference.JDBC30Translation;
import org.apache.derby.iapi.services.io.StoredFormatIds;
import java.sql.Types;
import java.sql.ResultSetMetaData;
/**
A set of static utility methods for data types.
* @author djd
*/
public abstract class DataTypeUtilities {
/**
Get the precision of the datatype.
@param dtd data type descriptor
*/
public static int getPrecision(DataTypeDescriptor dtd) {
int typeId = dtd.getTypeId().getJDBCTypeId();
switch ( typeId )
{
case Types.CHAR: // CHAR et alia return their # characters...
case Types.VARCHAR:
case Types.LONGVARCHAR:
case Types.CLOB:
case Types.BINARY: // BINARY types return their # bytes...
case Types.VARBINARY:
case Types.LONGVARBINARY:
case Types.BLOB:
case StoredFormatIds.XML_TYPE_ID:
return dtd.getMaximumWidth();
case Types.SMALLINT:
return 5;
case JDBC30Translation.SQL_TYPES_BOOLEAN:
return 1;
}
return dtd.getPrecision();
}
/**
Get the precision of the datatype, in decimal digits
This is used by EmbedResultSetMetaData.
@param dtd data type descriptor
*/
public static int getDigitPrecision(DataTypeDescriptor dtd) {
int typeId = dtd.getTypeId().getJDBCTypeId();
switch ( typeId )
{
case Types.FLOAT:
case Types.DOUBLE:
return TypeId.DOUBLE_PRECISION_IN_DIGITS;
case Types.REAL:
return TypeId.REAL_PRECISION_IN_DIGITS;
default: return getPrecision(dtd);
}
}
/**
Is the data type currency.
@param dtd data type descriptor
*/
public static boolean isCurrency(DataTypeDescriptor dtd) {
int typeId = dtd.getTypeId().getJDBCTypeId();
// Only the NUMERIC and DECIMAL types are currency
return ((typeId == Types.DECIMAL) || (typeId == Types.NUMERIC));
}
/**
Is the data type case sensitive.
@param dtd data type descriptor
*/
public static boolean isCaseSensitive(DataTypeDescriptor dtd) {
int typeId = dtd.getTypeId().getJDBCTypeId();
return (typeId == Types.CHAR ||
typeId == Types.VARCHAR ||
typeId == Types.CLOB ||
typeId == Types.LONGVARCHAR ||
typeId == StoredFormatIds.XML_TYPE_ID);
}
/**
Is the data type nullable.
@param dtd data type descriptor
*/
public static int isNullable(DataTypeDescriptor dtd) {
return dtd.isNullable() ?
ResultSetMetaData.columnNullable :
ResultSetMetaData.columnNoNulls;
}
/**
Is the data type signed.
@param dtd data type descriptor
*/
public static boolean isSigned(DataTypeDescriptor dtd) {
int typeId = dtd.getTypeId().getJDBCTypeId();
return ( typeId == Types.INTEGER ||
typeId == Types.FLOAT ||
typeId == Types.DECIMAL ||
typeId == Types.SMALLINT ||
typeId == Types.BIGINT ||
typeId == Types.TINYINT ||
typeId == Types.NUMERIC ||
typeId == Types.REAL ||
typeId == Types.DOUBLE );
}
/**
* Gets the display width of a column of a given type.
*
* @param dtd data type descriptor
*
* @return associated column display width
*/
public static int getColumnDisplaySize(DataTypeDescriptor dtd)
{
int typeId = dtd.getTypeId().getJDBCTypeId();
int storageLength = dtd.getMaximumWidth();
return DataTypeUtilities.getColumnDisplaySize(typeId, storageLength);
}
public static int getColumnDisplaySize(int typeId, int storageLength)
{
int size;
switch (typeId)
{
case Types.TIMESTAMP:
size = 26;
break;
case Types.DATE:
size = 10;
break;
case Types.TIME:
size = 8;
break;
case Types.INTEGER:
size = 11;
break;
case Types.SMALLINT :
size = 6;
break;
case Types.REAL :
case Types.FLOAT :
size = 13;
break;
case Types.DOUBLE:
size = 22;
break;
case Types.TINYINT :
size = 15;
break;
case Types.BINARY:
case Types.VARBINARY:
case Types.LONGVARBINARY:
case Types.BLOB:
size = 2*storageLength;
if (size < 0)
size = Integer.MAX_VALUE;
break;
case Types.BIGINT:
size = 20;
break;
case Types.BIT:
case JDBC30Translation.SQL_TYPES_BOOLEAN:
// Types.BIT == SQL BOOLEAN, so 5 chars for 'false'
// In JDBC 3.0, Types.BIT or Types.BOOLEAN = SQL BOOLEAN
size = 5;
break;
default:
// MaximumWidth is -1 when it is unknown.
int w = storageLength;
size = (w > 0 ? w : 15);
break;
}
return size;
}
/**
* Compute the maximum width (column display width) of a decimal or numeric data value,
* given its precision and scale.
*
* @param precision The precision (number of digits) of the data value.
* @param scale The number of fractional digits (digits to the right of the decimal point).
*
* @return The maximum number of chracters needed to display the value.
*/
public static int computeMaxWidth( int precision, int scale)
{
// There are 3 possible cases with respect to finding the correct max
// width for DECIMAL type.
// 1. If scale = 0, only sign should be added to precision.
// 2. scale=precision, 3 should be added to precision for sign, decimal and an additional char '0'.
// 3. precision > scale > 0, 2 should be added to precision for sign and decimal.
return (scale ==0) ? (precision +1) : ((scale == precision) ? (precision + 3) : (precision + 2));
}
}
| [
"durieuxthomas@hotmail.com"
] | durieuxthomas@hotmail.com |
3540d3a3a385ca5e5c02dbb33146d9dd80bdf36f | c0b37a664fde6a57ae61c4af635e6dea28d7905e | /Helpful dev stuff/AeriesMobilePortal_v1.2.0_apkpure.com_source_from_JADX/com/aeries/mobileportal/dagger/components/AssignmentsFragmentComponent.java | b4e1358ce5a614345ca5bae1409514ed859e8e03 | [] | no_license | joshkmartinez/Grades | a21ce8ede1371b9a7af11c4011e965f603c43291 | 53760e47f808780d06c4fbc2f74028a2db8e2942 | refs/heads/master | 2023-01-30T13:23:07.129566 | 2020-12-07T18:20:46 | 2020-12-07T18:20:46 | 131,549,535 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,310 | java | package com.aeries.mobileportal.dagger.components;
import com.aeries.mobileportal.dagger.modules.AssignmentsFragmentModule;
import com.aeries.mobileportal.dagger.modules.AssignmentsPresenterModule;
import com.aeries.mobileportal.dagger.modules.InteractorModule;
import com.aeries.mobileportal.dagger.scopes.FragmentScope;
import com.aeries.mobileportal.views.fragments.AssignmentsFragment;
import dagger.Component;
import kotlin.Metadata;
import org.jetbrains.annotations.NotNull;
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\bg\u0018\u00002\u00020\u0001J\u0010\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u0005H&¨\u0006\u0006"}, d2 = {"Lcom/aeries/mobileportal/dagger/components/AssignmentsFragmentComponent;", "", "inject", "", "fragment", "Lcom/aeries/mobileportal/views/fragments/AssignmentsFragment;", "app_release"}, k = 1, mv = {1, 1, 10})
@FragmentScope
@Component(dependencies = {PSPComponent.class}, modules = {AssignmentsFragmentModule.class, AssignmentsPresenterModule.class, InteractorModule.class})
/* compiled from: AssignmentsFragmentComponent.kt */
public interface AssignmentsFragmentComponent {
void inject(@NotNull AssignmentsFragment assignmentsFragment);
}
| [
"joshkmartinez@gmail.com"
] | joshkmartinez@gmail.com |
39df18ac2330febaa7d42abb1339cb019de49dd5 | c6c0e128c0b221a59368654b9905fc04083a86d1 | /src/main/java/stellarapi/feature/gui/overlay/time/OverlayTime.java | 6c9f6e7323ce66a54cefebf20e789ea25b037594 | [] | permissive | Morpheus1101/StellarAPI | db7ed82ba7456b6cabd30c4e76f2241c675ce215 | 765fb2d80aa49c06aa7fffff8c52f79c59473674 | refs/heads/master | 2020-04-17T08:08:39.950260 | 2016-07-26T03:12:41 | 2016-07-26T03:12:41 | 166,399,997 | 0 | 0 | MIT | 2019-01-18T12:15:01 | 2019-01-18T12:15:00 | null | UTF-8 | Java | false | false | 4,360 | java | package stellarapi.feature.gui.overlay.time;
import java.util.List;
import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.resources.I18n;
import stellarapi.api.CelestialPeriod;
import stellarapi.api.PeriodHelper;
import stellarapi.api.StellarAPIReference;
import stellarapi.api.daywake.DaytimeChecker;
import stellarapi.api.daywake.EnumDaytimeDescriptor;
import stellarapi.api.gui.overlay.EnumOverlayMode;
import stellarapi.api.gui.overlay.IOverlayElement;
import stellarapi.api.gui.overlay.PerOverlaySettings;
public class OverlayTime implements IOverlayElement<PerOverlaySettings> {
private static final int WIDTH = 100;
private static final int HEIGHT = 10;
private static final int ANIMATION_DURATION = 10;
private Minecraft mc;
EnumOverlayMode currentMode = EnumOverlayMode.OVERLAY;
private List<EnumDaytimeDescriptor> descriptors = Lists.newArrayList();
private boolean isDay = true;
private boolean invalidDay = false;
private int icolor;
boolean markForUpdate = false;
@Override
public void initialize(Minecraft mc, PerOverlaySettings settings) {
this.mc = mc;
}
@Override
public int getWidth() {
return WIDTH;
}
@Override
public int getHeight() {
return HEIGHT * (descriptors.size() + 3);
}
@Override
public float animationOffsetX(float partialTicks) {
return 0.0f;
}
@Override
public float animationOffsetY(float partialTicks) {
return 0.0f;
}
@Override
public void switchMode(EnumOverlayMode mode) {
this.currentMode = mode;
}
@Override
public void updateOverlay() {
if (mc.theWorld == null)
return;
CelestialPeriod dayPeriod = PeriodHelper.getDayPeriod(mc.theWorld);
if (dayPeriod == null) {
descriptors.clear();
this.invalidDay = true;
return;
}
descriptors.clear();
DaytimeChecker checker = StellarAPIReference.getDaytimeChecker();
long dawnTime = checker.timeForCertainDescriptor(mc.theWorld, EnumDaytimeDescriptor.DAWN, -1L);
long duskTime = checker.timeForCertainDescriptor(mc.theWorld, EnumDaytimeDescriptor.DUSK, -1L);
if (dawnTime == -1 || duskTime == -1)
this.invalidDay = true;
else
this.invalidDay = false;
double dawn = dayPeriod.getOffset(dawnTime, 0.0f);
double dusk = dayPeriod.getOffset(duskTime, 0.0f);
double current = dayPeriod.getOffset(mc.theWorld.getWorldTime(), 0.0f);
this.isDay = current > dawn - 1.0 / 32 && current < dusk + 1.0 / 32;
float[] colors = mc.theWorld.provider.calcSunriseSunsetColors(mc.theWorld.getCelestialAngle(0.0f), 0.0f);
if (colors != null)
this.icolor = ((int) (colors[0] * 255.0) << 16) + ((int) (colors[1] * 255.0) << 8)
+ (int) (colors[2] * 255.0);
else
this.icolor = this.isDay ? 0x77ff77 : 0xbb3333;
for (EnumDaytimeDescriptor descriptor : EnumDaytimeDescriptor.values())
if (checker.isDescriptorApply(mc.theWorld, descriptor, mc.theWorld.getWorldTime(),
(int) (dayPeriod.getPeriodLength() / 16), false))
descriptors.add(descriptor);
}
@Override
public boolean mouseClicked(int mouseX, int mouseY, int eventButton) {
return false;
}
@Override
public boolean mouseReleased(int mouseX, int mouseY, int eventButton) {
return false;
}
@Override
public boolean keyTyped(char eventChar, int eventKey) {
return false;
}
@Override
public void render(int mouseX, int mouseY, float partialTicks) {
int yOffset = 0;
this.drawString(mc.fontRendererObj, "display", WIDTH / 2, 10 * (yOffset++) + 5, 255, 0xffffff);
this.drawString(mc.fontRendererObj, this.invalidDay ? "invalid" : this.isDay ? "day" : "night", WIDTH / 2,
10 * (yOffset++) + 5, 255, this.invalidDay ? 0x770000 : this.isDay ? 0xffff77 : 0x5555aa);
for (EnumDaytimeDescriptor descriptor : this.descriptors)
if (mc.theWorld != null)
this.drawString(mc.fontRendererObj, descriptor.name(), WIDTH / 2, 10 * (yOffset++) + 5, 255,
this.icolor);
}
private void drawString(FontRenderer fontRenderer, String str, int x, int y, int alpha, int color) {
str = I18n.format("gui.time." + str.toLowerCase());
fontRenderer.drawStringWithShadow(str, x - fontRenderer.getStringWidth(str) / 2, y, color + (alpha << 24));
}
@Override
public boolean mouseClickMove(int scaledMouseX, int scaledMouseY, int eventButton, long timeSinceLastClick) {
return false;
}
}
| [
"abab9579@gmail.com"
] | abab9579@gmail.com |
b6e0633d55d9136f27f69ede22ccae9bbee47d58 | 20eb62855cb3962c2d36fda4377dfd47d82eb777 | /IntroClassJava/dataset/grade/9c9308d4cdf5bc5dfe6efc2b1a9c9bc9a44fbff73c5367c97e3be37861bbb3ba9ac7ad3ddec74dc66e34fe8f0804e46186819b4e90e8f9a59d1b82d9cf0a6218/003/mutations/64/grade_9c9308d4_003.java | 13b6de70e22d4974f73e533f250441e885c8f4c7 | [] | no_license | ozzydong/CapGen | 356746618848065cce4e253e5d3c381baa85044a | 0ba0321b6b1191443276021f1997833342f02515 | refs/heads/master | 2023-03-18T20:12:02.923428 | 2020-08-21T03:08:28 | 2020-08-21T03:08:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,344 | java | package introclassJava;
class IntObj {
public int value;
public IntObj () {
} public IntObj (int i) {
value = i;
}
}
class FloatObj {
public float value;
public FloatObj () {
} public FloatObj (float i) {
value = i;
}
}
class LongObj {
public long value;
public LongObj () {
} public LongObj (long i) {
value = i;
}
}
class DoubleObj {
public double value;
public DoubleObj () {
} public DoubleObj (double i) {
value = i;
}
}
class CharObj {
public char value;
public CharObj () {
} public CharObj (char i) {
value = i;
}
}
public class grade_9c9308d4_003 {
public java.util.Scanner scanner;
public String output = "";
public static void main (String[]args) throws Exception {
grade_9c9308d4_003 mainClass = new grade_9c9308d4_003 ();
String output;
if (args.length > 0) {
mainClass.scanner = new java.util.Scanner (args[0]);
} else {
mainClass.scanner = new java.util.Scanner (System.in);
}
mainClass.exec ();
System.out.println (mainClass.output);
}
public void exec () throws Exception {
if (true) return ;
DoubleObj A = new DoubleObj (), B = new DoubleObj (), C =
new DoubleObj (), D = new DoubleObj (), studentscore = new DoubleObj ();
CharObj lettergrade = new CharObj ();
output +=
(String.format
("Enter thresholds for A, B, C, D in that order, decreasing percentages > Thank you. "));
A.value = scanner.nextDouble ();
B.value = scanner.nextDouble ();
C.value = scanner.nextDouble ();
D.value = scanner.nextDouble ();
output += (String.format ("Now enter student score (perecnt) >"));
studentscore.value = scanner.nextDouble ();
if (studentscore.value >= A.value) {
lettergrade.value = 'A';
} else if (studentscore.value >= B.value) {
lettergrade.value = 'B';
} else if (studentscore.value >= C.value) {
lettergrade.value = 'C';
} else {
lettergrade.value = 'D';
}
output +=
(String.format ("Student has an %c grade\n", lettergrade.value));
if (true)
return;;
}
}
| [
"justinwm@163.com"
] | justinwm@163.com |
3660794820b548170f4986031be0c221cf92b357 | 884056b6a120b2a4c1c1202a4c69b07f59aecc36 | /java projects/commons-lang-master/commons-lang-master/src/test/java/org/apache/commons/lang3/math/IEEE754rUtilsTest.java | 2ed667014c8e17e52744ec9cd5d53d7ae0232770 | [
"MIT",
"LicenseRef-scancode-generic-cla",
"Apache-2.0"
] | permissive | NazaninBayati/SMBFL | a48b16dbe2577a3324209e026c1b2bf53ee52f55 | 999c4bca166a32571e9f0b1ad99085a5d48550eb | refs/heads/master | 2021-07-17T08:52:42.709856 | 2020-09-07T12:36:11 | 2020-09-07T12:36:11 | 204,252,009 | 3 | 0 | MIT | 2020-01-31T18:22:23 | 2019-08-25T05:47:52 | Java | UTF-8 | Java | false | false | 4,232 | 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.commons.lang3.math;
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 org.junit.jupiter.api.Test;
/**
* Unit tests {@link org.apache.commons.lang3.math.IEEE754rUtils}.
*/
public class IEEE754rUtilsTest {
@Test
public void testLang381() {
assertEquals(1.2, IEEE754rUtils.min(1.2, 2.5, Double.NaN), 0.01);
assertEquals(2.5, IEEE754rUtils.max(1.2, 2.5, Double.NaN), 0.01);
assertTrue(Double.isNaN(IEEE754rUtils.max(Double.NaN, Double.NaN, Double.NaN)));
assertEquals(1.2f, IEEE754rUtils.min(1.2f, 2.5f, Float.NaN), 0.01);
assertEquals(2.5f, IEEE754rUtils.max(1.2f, 2.5f, Float.NaN), 0.01);
assertTrue(Float.isNaN(IEEE754rUtils.max(Float.NaN, Float.NaN, Float.NaN)));
final double[] a = new double[] { 1.2, Double.NaN, 3.7, 27.0, 42.0, Double.NaN };
assertEquals(42.0, IEEE754rUtils.max(a), 0.01);
assertEquals(1.2, IEEE754rUtils.min(a), 0.01);
final double[] b = new double[] { Double.NaN, 1.2, Double.NaN, 3.7, 27.0, 42.0, Double.NaN };
assertEquals(42.0, IEEE754rUtils.max(b), 0.01);
assertEquals(1.2, IEEE754rUtils.min(b), 0.01);
final float[] aF = new float[] { 1.2f, Float.NaN, 3.7f, 27.0f, 42.0f, Float.NaN };
assertEquals(1.2f, IEEE754rUtils.min(aF), 0.01);
assertEquals(42.0f, IEEE754rUtils.max(aF), 0.01);
final float[] bF = new float[] { Float.NaN, 1.2f, Float.NaN, 3.7f, 27.0f, 42.0f, Float.NaN };
assertEquals(1.2f, IEEE754rUtils.min(bF), 0.01);
assertEquals(42.0f, IEEE754rUtils.max(bF), 0.01);
}
@Test
public void testEnforceExceptions() {
assertThrows(
IllegalArgumentException.class,
() -> IEEE754rUtils.min( (float[]) null),
"IllegalArgumentException expected for null input");
assertThrows(
IllegalArgumentException.class,
() -> IEEE754rUtils.min(),
"IllegalArgumentException expected for empty input");
assertThrows(
IllegalArgumentException.class,
() -> IEEE754rUtils.max( (float[]) null),
"IllegalArgumentException expected for null input");
assertThrows(
IllegalArgumentException.class,
IEEE754rUtils::max,
"IllegalArgumentException expected for empty input");
assertThrows(
IllegalArgumentException.class,
() -> IEEE754rUtils.min( (double[]) null),
"IllegalArgumentException expected for null input");
assertThrows(
IllegalArgumentException.class,
() -> IEEE754rUtils.min(new double[0]),
"IllegalArgumentException expected for empty input");
assertThrows(
IllegalArgumentException.class,
() -> IEEE754rUtils.max( (double[]) null),
"IllegalArgumentException expected for null input");
assertThrows(
IllegalArgumentException.class,
() -> IEEE754rUtils.max(new double[0]),
"IllegalArgumentException expected for empty input");
}
@Test
public void testConstructorExists() {
new IEEE754rUtils();
}
}
| [
"n.bayati20@gmail.com"
] | n.bayati20@gmail.com |
90311263965b983a83cd74a8ae4aaa8edf53599c | 10c53980778e455351e89754bc90b71378c07a2b | /examples/spring-boot-on-openshift-example/src/test/java/io/dekorate/example/SpringBootOnOpenshiftIT.java | f14fbd7c944578017e5e481c134cd84bc97e733a | [
"Apache-2.0"
] | permissive | dswiecki/dekorate | f54156a9777c7eab24f6854c6a4aa0248406af04 | c43d2719794364161a59835688789178aa2f9590 | refs/heads/master | 2023-04-11T09:46:53.947176 | 2021-04-20T22:02:46 | 2021-04-20T22:02:46 | 298,585,345 | 0 | 0 | Apache-2.0 | 2020-09-25T13:46:55 | 2020-09-25T13:46:55 | null | UTF-8 | Java | false | false | 2,056 | java | /**
* Copyright 2018 The original authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* 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.dekorate.example;
import io.fabric8.kubernetes.api.model.KubernetesList;
import io.fabric8.kubernetes.api.model.Pod;
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.LocalPortForward;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import io.dekorate.testing.annotation.Inject;
import io.dekorate.testing.openshift.annotation.OpenshiftIntegrationTest;
import org.junit.jupiter.api.Test;
import java.net.URL;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
@OpenshiftIntegrationTest
class SpringBootOnOpenshiftIT {
@Inject
private KubernetesClient client;
@Inject
private KubernetesList list;
@Inject
Pod pod;
@Test
public void shouldRespondWithHelloWorld() throws Exception {
assertNotNull(client);
assertNotNull(list);
System.out.println("Forwarding port");
try (LocalPortForward p = client.pods().withName(pod.getMetadata().getName()).portForward(8080)) {
assertTrue(p.isAlive());
URL url = new URL("http://localhost:"+p.getLocalPort()+"/");
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().get().url(url).build();
Response response = client.newCall(request).execute();
assertEquals(response.body().string(), "Hello world");
} catch (Exception e) {
e.printStackTrace();
}
}
}
| [
"iocanel@gmail.com"
] | iocanel@gmail.com |
7c0b93874ba232ad117dc5dd9e6089d0020a71a3 | 9b3f1510a0bbfa00c2b75d82ac8c58d18fe99544 | /shells/security-pkcs11-shell/src/main/java/org/xipki/security/shell/pkcs11/P11RSAKeyGenAction.java | da1f8ab0e2ad651f621e4e4331b239ed8edd2ec4 | [
"Apache-2.0"
] | permissive | pkitools/xipki | d5ef4c6ab6933ffbb08648ccbdaef39a051b3290 | 063b2e990f8a17b88cecf6fb5d5b00da7a369754 | refs/heads/master | 2020-03-17T07:19:02.249570 | 2018-05-13T19:32:21 | 2018-05-13T19:32:21 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,888 | java | /*
*
* Copyright (c) 2013 - 2018 Lijun Liao
*
* 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.xipki.security.shell.pkcs11;
import org.apache.karaf.shell.api.action.Command;
import org.apache.karaf.shell.api.action.Option;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.xipki.console.karaf.IllegalCmdParamException;
import org.xipki.security.pkcs11.P11ObjectIdentifier;
import org.xipki.security.pkcs11.P11Slot;
/**
* TODO.
* @author Lijun Liao
* @since 2.0.0
*/
@Command(scope = "xi", name = "rsa-p11",
description = "generate RSA keypair in PKCS#11 device")
@Service
// CHECKSTYLE:SKIP
public class P11RSAKeyGenAction extends P11KeyGenAction {
@Option(name = "--key-size",
description = "keysize in bit")
private Integer keysize = 2048;
@Option(name = "-e",
description = "public exponent")
private String publicExponent = "0x10001";
@Override
protected Object execute0() throws Exception {
if (keysize % 1024 != 0) {
throw new IllegalCmdParamException("keysize is not multiple of 1024: " + keysize);
}
P11Slot slot = getSlot();
P11ObjectIdentifier objId = slot.generateRSAKeypair(keysize, toBigInt(publicExponent),
label, getControl());
finalize("RSA", objId);
return null;
}
@Override
protected boolean getDefaultExtractable() {
return false;
}
}
| [
"lijun.liao@gmail.com"
] | lijun.liao@gmail.com |
8b0f962687d781c389e08a415d8d086d67c69995 | 011144431398fb65287b3fc9fe024cfff0b43c78 | /Airline_Exam_Skeleton/src/main/java/softuni/exam/service/impl/PassengerServiceImpl.java | 52fd0e9211632a0021c0e14095ff700dc27e5b2a | [] | no_license | zulnerub/SpringData-Hybernate | 66bf31dde2d8b82177d12bb37dc3fd6523d94463 | 3fc7eeadabfb5dc7bee67bba2b461fdae565fb6d | refs/heads/master | 2022-07-02T05:19:51.289510 | 2020-04-06T17:14:57 | 2020-04-06T17:14:57 | 244,436,427 | 0 | 0 | null | 2022-06-21T02:58:42 | 2020-03-02T17:48:08 | Java | UTF-8 | Java | false | false | 4,257 | java | package softuni.exam.service.impl;
import com.google.gson.Gson;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import softuni.exam.models.dtos.PassengerSeedDto;
import softuni.exam.models.entities.Passenger;
import softuni.exam.models.entities.Town;
import softuni.exam.repository.PassengerRepository;
import softuni.exam.service.PassengerService;
import softuni.exam.util.FileUtil;
import softuni.exam.util.ValidationUtil;
import java.io.IOException;
import java.util.Arrays;
import java.util.Optional;
import static softuni.exam.constants.GlobalConstants.PASSENGERS_FILE_PATH;
@Service
@Transactional
public class PassengerServiceImpl implements PassengerService {
private final PassengerRepository passengerRepository;
private final FileUtil fileUtil;
private final ModelMapper modelMapper;
private final ValidationUtil validationUtil;
private final Gson gson;
private final TownServiceImpl townService;
@Autowired
public PassengerServiceImpl(PassengerRepository passengerRepository, FileUtil fileUtil, ModelMapper modelMapper, ValidationUtil validationUtil, Gson gson, TownServiceImpl townService) {
this.passengerRepository = passengerRepository;
this.fileUtil = fileUtil;
this.modelMapper = modelMapper;
this.validationUtil = validationUtil;
this.gson = gson;
this.townService = townService;
}
@Override
public Optional<Passenger> getPassengerByEmail(String email) {
return this.passengerRepository.findByEmail(email);
}
@Override
public boolean areImported() {
return this.passengerRepository.count() > 0;
}
@Override
public String readPassengersFileContent() throws IOException {
return this.fileUtil.readFile(PASSENGERS_FILE_PATH);
}
@Override
public String importPassengers() throws IOException {
StringBuilder sb = new StringBuilder();
System.out.println();
PassengerSeedDto[] passengerSeedDto =
this.gson.fromJson(this.readPassengersFileContent(), PassengerSeedDto[].class);
Arrays.stream(passengerSeedDto)
.forEach(p -> {
if (this.validationUtil.isValid(p)) {
Passenger passenger = this.modelMapper.map(p, Passenger.class);
if (this.passengerRepository.findByEmail(passenger.getEmail()).orElse(null) == null) {
Town town = this.townService.getTownByName(p.getTown()).orElse(null);
if (town != null) {
passenger.setTown(town);
sb.append(String.format("Successfully imported %s %s - %s",
passenger.getClass().getSimpleName(), passenger.getLastName(), passenger.getEmail()));
this.passengerRepository.saveAndFlush(passenger);
} else {
sb.append("Invalid Passenger");
}
} else {
sb.append("Invalid Passenger");
}
} else {
sb.append("Invalid Passenger");
}
sb.append(System.lineSeparator());
});
return sb.toString();
}
@Override
public String getPassengersOrderByTicketsCountDescendingThenByEmail() {
StringBuilder sb = new StringBuilder();
this.passengerRepository.findAllOrOrderByTicketsSizeDescEmailAsc()
.forEach(p -> {
sb.append(String.format("Passenger %s %s\n" +
"\tEmail - %s\n" +
"\tPhone - %s\n" +
"\tNumber of tickets - %d",
p.getFirstName(), p.getLastName(), p.getEmail(), p.getPhoneNumber(), p.getTickets().size()));
sb.append(System.lineSeparator());
});
return sb.toString();
}
}
| [
"drsimeon_87@abv.bg"
] | drsimeon_87@abv.bg |
8c99f2e744a676cbe30dad7a2c16636c1b2e4c1e | 06578e855f7004a3aae22aa7c79a5e92ddb57b83 | /app/src/main/java/ping/otmsapp/viewHolders/recycycleItems/second/ScanRecycleBoxRecycleItem.java | ea78c43c355d236211649a369325004516e46af7 | [] | no_license | 15608447849/OTMSAPP | e81bf95a34680855bbb15e410a2e93075a6e5536 | d15887b2d7fe55f53cea3b77c1cf3ff5b8386448 | refs/heads/master | 2021-07-16T19:21:15.382844 | 2018-12-28T03:25:48 | 2018-12-28T03:25:48 | 127,735,914 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 652 | java | package ping.otmsapp.viewHolders.recycycleItems.second;
import android.view.View;
import android.widget.TextView;
import ping.otmsapp.R;
import ping.otmsapp.entitys.annotations.Rid;
import ping.otmsapp.entitys.interfaces.AutoRecycleViewHolder;
/**
* Created by Leeping on 2018/4/10.
* email: 793065165@qq.com
*/
public class ScanRecycleBoxRecycleItem extends AutoRecycleViewHolder {
//箱号
@Rid(R.id.recycle_item_tv_boxNo)
public TextView boxNoTv;
//类型
@Rid(R.id.recycle_item_tv_boxState)
public TextView scannerStateTv;
public ScanRecycleBoxRecycleItem(View itemView) {
super(itemView);
}
}
| [
"793065165@qq.com"
] | 793065165@qq.com |
d04c8cc6fd4fc4caf2141670a8a637066f970781 | 7beb062b1720ca30700c3546139d2d5d0510f54d | /web/src/main/java/com/aatrox/web/mq/consumer/Consumer.java | fd9873e96f6e070b79701a61a6ab0bccbdcd79f7 | [] | no_license | beiyuanbing/aatrox-cloud | 7976024f02200bd12a2e4812cadab42c4ef424e2 | bfc2ecac7f7f3d1c98b85379f1135ab511fb7535 | refs/heads/master | 2023-08-28T20:13:29.701897 | 2021-06-09T07:11:48 | 2021-06-09T07:11:48 | 245,924,093 | 0 | 0 | null | 2021-04-22T19:11:45 | 2020-03-09T02:12:26 | Java | UTF-8 | Java | false | false | 503 | java | package com.aatrox.web.mq.consumer;
/*@Component
public class Consumer {
// 使用JmsListener配置消费者监听的队列,其中text是接收到的消息
//返回给对应的队列
@JmsListener(*//*containerFactory = "jmsListenerContainerFactory",*//*destination = "mytest")
@SendTo(QueueTopicConstants.MYTEST_OUT)
public String receiveQueue(String text) {
System.out.println("Consumer收到的报文为:" + text);
return "return message" + text;
}
}*/
| [
"425210220@qq.com"
] | 425210220@qq.com |
f6868c6dbac46971d582c6e52e3c61286484aed5 | 97fd02f71b45aa235f917e79dd68b61c62b56c1c | /src/main/java/com/tencentcloudapi/tcss/v20201101/models/ScanCompliancePolicyItemsResponse.java | 00e49848b2c999dcc5dfaac884c6cc63fcd38f34 | [
"Apache-2.0"
] | permissive | TencentCloud/tencentcloud-sdk-java | 7df922f7c5826732e35edeab3320035e0cdfba05 | 09fa672d75e5ca33319a23fcd8b9ca3d2afab1ec | refs/heads/master | 2023-09-04T10:51:57.854153 | 2023-09-01T03:21:09 | 2023-09-01T03:21:09 | 129,837,505 | 537 | 317 | Apache-2.0 | 2023-09-13T02:42:03 | 2018-04-17T02:58:16 | Java | UTF-8 | Java | false | false | 3,156 | java | /*
* Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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.tencentcloudapi.tcss.v20201101.models;
import com.tencentcloudapi.common.AbstractModel;
import com.google.gson.annotations.SerializedName;
import com.google.gson.annotations.Expose;
import java.util.HashMap;
public class ScanCompliancePolicyItemsResponse extends AbstractModel{
/**
* 返回重新检测任务的ID。
*/
@SerializedName("TaskId")
@Expose
private Long TaskId;
/**
* 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
@SerializedName("RequestId")
@Expose
private String RequestId;
/**
* Get 返回重新检测任务的ID。
* @return TaskId 返回重新检测任务的ID。
*/
public Long getTaskId() {
return this.TaskId;
}
/**
* Set 返回重新检测任务的ID。
* @param TaskId 返回重新检测任务的ID。
*/
public void setTaskId(Long TaskId) {
this.TaskId = TaskId;
}
/**
* Get 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @return RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public String getRequestId() {
return this.RequestId;
}
/**
* Set 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
* @param RequestId 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
*/
public void setRequestId(String RequestId) {
this.RequestId = RequestId;
}
public ScanCompliancePolicyItemsResponse() {
}
/**
* NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy,
* and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy.
*/
public ScanCompliancePolicyItemsResponse(ScanCompliancePolicyItemsResponse source) {
if (source.TaskId != null) {
this.TaskId = new Long(source.TaskId);
}
if (source.RequestId != null) {
this.RequestId = new String(source.RequestId);
}
}
/**
* Internal implementation, normal users should not use it.
*/
public void toMap(HashMap<String, String> map, String prefix) {
this.setParamSimple(map, prefix + "TaskId", this.TaskId);
this.setParamSimple(map, prefix + "RequestId", this.RequestId);
}
}
| [
"tencentcloudapi@tencent.com"
] | tencentcloudapi@tencent.com |
0aeb380b628704a3e106ffd629b742b1d8cbcadf | 2af5bb16ac9855606379fe060144bb13a4ad2c0f | /src/main/java/io/github/hsyyid/halocraft/items/firearms/ItemIncinerationCannon.java | d76f0b0f70049d294b209ad5e3b26764c4620ea7 | [] | no_license | connorcodes/HaloMod | 4916fce9760ba2d276ab47b6f13672378b1f4c4e | c8e58745e7828a72ba2ce82d8babf0edc0890eb7 | refs/heads/master | 2021-01-21T08:12:03.813310 | 2016-08-08T19:23:33 | 2016-08-08T19:23:33 | 68,651,650 | 1 | 0 | null | 2016-09-19T22:21:26 | 2016-09-19T22:21:26 | null | UTF-8 | Java | false | false | 1,497 | java | package io.github.hsyyid.halocraft.items.firearms;
import io.github.hsyyid.halocraft.entities.EntityRedPlasma;
import io.github.hsyyid.halocraft.items.ItemRedPlasmaAmmo;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.SoundCategory;
import net.minecraft.world.World;
public class ItemIncinerationCannon extends ItemFirearm
{
public static String name = "itemIncinerationCannon";
public static ItemFirearm instance = new ItemIncinerationCannon();
public ItemIncinerationCannon()
{
super();
this.ammoItem = ItemRedPlasmaAmmo.instance;
this.setUnlocalizedName("halocraft:" + name.toLowerCase());
}
@Override
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
{
if (playerIn.capabilities.isCreativeMode || playerIn.inventory.clearMatchingItems(this.ammoItem, -1, 1, null) == 1)
{
worldIn.playSound(playerIn, playerIn.getPosition(), SoundEvents.ENTITY_SKELETON_SHOOT, SoundCategory.HOSTILE, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
if (!worldIn.isRemote)
{
worldIn.spawnEntityInWorld(new EntityRedPlasma(worldIn, playerIn));
itemStackIn.damageItem(1, playerIn);
}
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, itemStackIn);
}
}
| [
"hassansyyid@gmail.com"
] | hassansyyid@gmail.com |
e97caf2e5c589dd84444a461564837bd15c43513 | d2eee6e9a3ad0b3fd2899c3d1cf94778615b10cb | /PROMISE/archives/ivy/2.0/org/apache/ivy/util/AbstractMessageLogger.java | f1e0c4a3a20ac911e76a3a89e3e43be1469ff05d | [] | no_license | hvdthong/DEFECT_PREDICTION | 78b8e98c0be3db86ffaed432722b0b8c61523ab2 | 76a61c69be0e2082faa3f19efd76a99f56a32858 | refs/heads/master | 2021-01-20T05:19:00.927723 | 2018-07-10T03:38:14 | 2018-07-10T03:38:14 | 89,766,606 | 5 | 1 | null | null | null | null | UTF-8 | Java | false | false | 3,688 | java | package org.apache.ivy.util;
import java.util.ArrayList;
import java.util.List;
/**
* An abstract base class to ease {@link MessageLogger} implementation.
*/
public abstract class AbstractMessageLogger implements MessageLogger {
private List problems = new ArrayList();
private List warns = new ArrayList();
private List errors = new ArrayList();
private boolean showProgress = true;
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#debug(java.lang.String)
*/
public void debug(String msg) {
log(msg, Message.MSG_DEBUG);
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#verbose(java.lang.String)
*/
public void verbose(String msg) {
log(msg, Message.MSG_VERBOSE);
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#deprecated(java.lang.String)
*/
public void deprecated(String msg) {
log("DEPRECATED: " + msg, Message.MSG_WARN);
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#info(java.lang.String)
*/
public void info(String msg) {
log(msg, Message.MSG_INFO);
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#info(java.lang.String)
*/
public void rawinfo(String msg) {
rawlog(msg, Message.MSG_INFO);
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#warn(java.lang.String)
*/
public void warn(String msg) {
log("WARN: " + msg, Message.MSG_VERBOSE);
problems.add("WARN: " + msg);
getWarns().add(msg);
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#error(java.lang.String)
*/
public void error(String msg) {
log("ERROR: " + msg, Message.MSG_VERBOSE);
problems.add("\tERROR: " + msg);
getErrors().add(msg);
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#getProblems()
*/
public List getProblems() {
return problems;
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#sumupProblems()
*/
public void sumupProblems() {
MessageLoggerHelper.sumupProblems(this);
clearProblems();
}
public void clearProblems() {
problems.clear();
warns.clear();
errors.clear();
}
public List getErrors() {
return errors;
}
public List getWarns() {
return warns;
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#progress()
*/
public void progress() {
if (showProgress) {
doProgress();
}
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#endProgress()
*/
public void endProgress() {
endProgress("");
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#endProgress(java.lang.String)
*/
public void endProgress(String msg) {
if (showProgress) {
doEndProgress(msg);
}
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#isShowProgress()
*/
public boolean isShowProgress() {
return showProgress;
}
/* (non-Javadoc)
* @see org.apache.ivy.util.MessageLogger#setShowProgress(boolean)
*/
public void setShowProgress(boolean progress) {
showProgress = progress;
}
/**
* Indicates a progression for a long running task
*/
protected abstract void doProgress();
/**
* Indicates the end of a long running task
* @param msg the message associated with long running task end.
*/
protected abstract void doEndProgress(String msg);
}
| [
"hvdthong@github.com"
] | hvdthong@github.com |
1d1ada2308bf80f5c26d3225534b72991cf2042a | a0cd546101594e679544d24f92ae8fcc17013142 | /refactorit-core/src/test/java/net/sf/refactorit/test/cli/CommaSeparatedTableFormatTest.java | 05828dde34bb865bc346b97496bf3a427ab94091 | [] | no_license | svn2github/RefactorIT | f65198bb64f6c11e20d35ace5f9563d781b7fe5c | 4b1fc1ebd06c8e192af9ccd94eb5c2d96f79f94c | refs/heads/master | 2021-01-10T03:09:28.310366 | 2008-09-18T10:17:56 | 2008-09-18T10:17:56 | 47,540,746 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,125 | java | /*
* Copyright 2001-2008 Aqris Software AS. All rights reserved.
*
* This program is dual-licensed under both the Common Development
* and Distribution License ("CDDL") and the GNU General Public
* License ("GPL"). You may elect to use one or the other of these
* licenses.
*/
package net.sf.refactorit.test.cli;
import net.sf.refactorit.ui.treetable.writer.CommaSeparatedTableFormat;
import junit.framework.TestCase;
public class CommaSeparatedTableFormatTest extends TestCase {
private CommaSeparatedTableFormat t = new CommaSeparatedTableFormat();
public void testSimpleEscape() {
assertEquals("", t.escapeColumnContents(""));
assertEquals("a", t.escapeColumnContents("a"));
assertEquals("a a", t.escapeColumnContents("a a"));
}
public void testComma() {
assertEquals("\",\"", t.escapeColumnContents(","));
}
public void testQuotesInside() {
assertEquals("\",,,\"\",,,\"", t.escapeColumnContents(",,,\",,,"));
}
public void testQuotesWithoutDelimiters() {
assertEquals("\"xxx\"\"xxx\"", t.escapeColumnContents("xxx\"xxx"));
}
}
| [
"l950637@285b47d1-db48-0410-a9c5-fb61d244d46c"
] | l950637@285b47d1-db48-0410-a9c5-fb61d244d46c |
8ffad7ba7769627761c93e134205e91a8a1a06c6 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/30/30_fa811fbd3d11f7922d19b4efda93e642e85d4432/Provider/30_fa811fbd3d11f7922d19b4efda93e642e85d4432_Provider_t.java | 640e6202a02ce7297b85b742134e17ae682bc151 | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,012 | java | package br.com.caelum.vraptor.vraptor2;
import java.util.ArrayList;
import java.util.List;
import br.com.caelum.vraptor.core.DefaultInterceptorStack;
import br.com.caelum.vraptor.core.DefaultResult;
import br.com.caelum.vraptor.http.OgnlParametersProvider;
import br.com.caelum.vraptor.http.ParanamerParameterNameProvider;
import br.com.caelum.vraptor.http.StupidTranslator;
import br.com.caelum.vraptor.http.asm.AsmBasedTypeCreator;
import br.com.caelum.vraptor.interceptor.DefaultInterceptorRegistry;
import br.com.caelum.vraptor.interceptor.ExecuteMethodInterceptor;
import br.com.caelum.vraptor.interceptor.InstantiateInterceptor;
import br.com.caelum.vraptor.interceptor.InterceptorListPriorToExecutionExtractor;
import br.com.caelum.vraptor.interceptor.ResourceLookupInterceptor;
import br.com.caelum.vraptor.ioc.pico.DefaultDirScanner;
import br.com.caelum.vraptor.ioc.pico.PicoProvider;
import br.com.caelum.vraptor.ioc.pico.WebInfClassesScanner;
import br.com.caelum.vraptor.resource.DefaultResourceRegistry;
/**
* Customized provider with support for both vraptor 2 and 3 components.
*
* @author Guilherme Silveira
*/
public class Provider extends PicoProvider {
protected List<Class<?>> getCoreComponents() {
List<Class<?>> components = new ArrayList<Class<?>>();
components.add(StupidTranslator.class);
components.add(DefaultResourceRegistry.class);
components.add(DefaultDirScanner.class);
components.add(WebInfClassesScanner.class);
components.add(DefaultInterceptorRegistry.class);
components.add(AsmBasedTypeCreator.class);
components.add(VRaptor2MethodLookupBuilder.class);
components.add(VRaptor2PathResolver.class);
components.add(VRaptor2Config.class);
components.add(ParanamerParameterNameProvider.class);
return components;
}
protected List<Class<?>> getChildComponentTypes() {
List<Class<?>> components = new ArrayList<Class<?>>();
components.add(DefaultInterceptorStack.class);
components.add(InterceptorListPriorToExecutionExtractor.class);
components.add(VRaptor2RequestExecution.class);
components.add(ResourceLookupInterceptor.class);
components.add(InstantiateInterceptor.class);
components.add(DefaultResult.class);
components.add(ExecuteAndViewInterceptor.class);
components.add(ViewsPropertiesPageResult.class);
components.add(OgnlParametersProvider.class);
components.add(VRaptor2Converters.class);
components.add(Validator.class);
components.add(ViewInterceptor.class);
components.add(OutjectionInterceptor.class);
components.add(RequestResult.class);
// TODO the following components are not required by vraptor2/3
// compatibility mode, but was added for unit tests
components.add(ExecuteMethodInterceptor.class);
return components;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
3603c368ab37aac9adfb0f1efe338f5fe2002e67 | 0e0dae718251c31cbe9181ccabf01d2b791bc2c2 | /archive/SCT1/trunk/com.yakindu.statechart.editing.ui/plugins/org.mda4e.statemachine.diagram/src/statemachine/diagram/expressions/StatemachineAbstractExpression.java | 592611ec48bf50289dcb9ac1cbc4a4bb1e78c63b | [] | no_license | huybuidac20593/yakindu | 377fb9100d7db6f4bb33a3caa78776c4a4b03773 | 304fb02b9c166f340f521f5e4c41d970268f28e9 | refs/heads/master | 2021-05-29T14:46:43.225721 | 2015-05-28T11:54:07 | 2015-05-28T11:54:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,383 | java | /**
* Copyright (c) 2006-2009 committers of mda4e 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:
* committers of mda4e (http://www.mda4e.org/) - initial API and implementation
*
*/
package statemachine.diagram.expressions;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collections;
import java.util.Map;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EEnumLiteral;
import org.eclipse.emf.ecore.util.EcoreUtil;
import statemachine.diagram.part.StatemachineDiagramEditorPlugin;
/**
* @generated
*/
public abstract class StatemachineAbstractExpression {
/**
* @generated
*/
private IStatus status = Status.OK_STATUS;
/**
* @generated
*/
protected void setStatus(int severity, String message, Throwable throwable) {
String pluginID = StatemachineDiagramEditorPlugin.ID;
this.status = new Status(severity, pluginID, -1,
(message != null) ? message : "", throwable); //$NON-NLS-1$
if (!this.status.isOK()) {
StatemachineDiagramEditorPlugin
.getInstance()
.logError(
"Expression problem:" + message + "body:" + body(), throwable); //$NON-NLS-1$ //$NON-NLS-2$
}
}
/**
* @generated
*/
public IStatus getStatus() {
return status;
}
/**
* @generated
*/
private final String myBody;
/**
* @generated
*/
public String body() {
return myBody;
}
/**
* @generated
*/
private final EClassifier myContext;
/**
* @generated
*/
public EClassifier context() {
return myContext;
}
/**
* @generated
*/
protected StatemachineAbstractExpression(String body, EClassifier context) {
myBody = body;
myContext = context;
}
/**
* @generated
*/
protected abstract Object doEvaluate(Object context, Map env);
/**
* @generated
*/
public Object evaluate(Object context) {
return evaluate(context, Collections.EMPTY_MAP);
}
/**
* @generated
*/
public Object evaluate(Object context, Map env) {
if (context().isInstance(context)) {
try {
return doEvaluate(context, env);
} catch (Exception e) {
StatemachineDiagramEditorPlugin.getInstance().logError(
"Expression evaluation failure: " + body(), e); //$NON-NLS-1$
}
}
return null;
}
/**
* Expression may return number value which is not directly compatible with feature type (e.g. Double when Integer is expected), or EEnumLiteral meta-object when literal instance is expected
* @generated
*/
public static Object performCast(Object value, EDataType targetType) {
if (targetType instanceof EEnum) {
if (value instanceof EEnumLiteral) {
EEnumLiteral literal = (EEnumLiteral) value;
return (literal.getInstance() != null) ? literal.getInstance()
: literal;
}
}
if (false == value instanceof Number || targetType == null
|| targetType.getInstanceClass() == null) {
return value;
}
Class targetClass = targetType.getInstanceClass();
Number num = (Number) value;
Class valClass = value.getClass();
Class targetWrapperClass = targetClass;
if (targetClass.isPrimitive()) {
targetWrapperClass = EcoreUtil.wrapperClassFor(targetClass);
}
if (valClass.equals(targetWrapperClass)) {
return value;
}
if (Number.class.isAssignableFrom(targetWrapperClass)) {
if (targetWrapperClass.equals(Byte.class))
return new Byte(num.byteValue());
if (targetWrapperClass.equals(Integer.class))
return new Integer(num.intValue());
if (targetWrapperClass.equals(Short.class))
return new Short(num.shortValue());
if (targetWrapperClass.equals(Long.class))
return new Long(num.longValue());
if (targetWrapperClass.equals(BigInteger.class))
return BigInteger.valueOf(num.longValue());
if (targetWrapperClass.equals(Float.class))
return new Float(num.floatValue());
if (targetWrapperClass.equals(Double.class))
return new Double(num.doubleValue());
if (targetWrapperClass.equals(BigDecimal.class))
return new BigDecimal(num.doubleValue());
}
return value;
}
}
| [
"terfloth@itemis.de"
] | terfloth@itemis.de |
a7b4c979cc505f133e533bb3915449d7e6a967d1 | 85913b481c2b5e1a6a75c18b777556d0150c0263 | /FredBoat/src/main/java/fredboat/util/TextUtils.java | cf1eb309acc7e4842c5656e4e91b1e2b331f504d | [
"MIT"
] | permissive | Tigerwhit4/FredBoat | 59a80bb88a46369a49b9b859fa980e843caaf655 | 1e06b4069cbde0be77f44c1e27c60b6582212479 | refs/heads/master | 2020-06-14T03:09:10.681863 | 2016-12-04T00:07:16 | 2016-12-04T00:07:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,051 | java | /*
* The MIT License (MIT)
* Copyright (c) 2016 Frederik Mikkelsen
*
* 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 fredboat.util;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import fredboat.FredBoat;
import fredboat.commandmeta.MessagingException;
import net.dv8tion.jda.MessageBuilder;
import net.dv8tion.jda.entities.Message;
import net.dv8tion.jda.entities.MessageChannel;
import net.dv8tion.jda.entities.TextChannel;
import net.dv8tion.jda.entities.User;
import org.slf4j.LoggerFactory;
public class TextUtils {
private static final org.slf4j.Logger log = LoggerFactory.getLogger(TextUtils.class);
private TextUtils() {
}
public static Message prefaceWithMention(User user, String msg) {
MessageBuilder builder = new MessageBuilder().appendMention(user).appendString(msg);
return builder.build();
}
public static Message replyWithMention(TextChannel channel, User user, String msg) {
MessageBuilder builder = new MessageBuilder().appendMention(user).appendString(msg);
Message mes = builder.build();
channel.sendMessage(mes);
return mes;
}
public static void handleException(Throwable e, MessageChannel channel) {
handleException(e, channel, null);
}
public static void handleException(Throwable e, MessageChannel channel, User invoker) {
if (e instanceof MessagingException) {
channel.sendMessage(invoker.getUsername() + ": " + e.getMessage());
return;
}
log.error("Caught exception while executing a command", e);
MessageBuilder builder = new MessageBuilder();
if (invoker != null) {
builder.appendMention(invoker);
String filtered = " an error occured :anger: ```java\n" + e.toString() + "\n";
for (String str : FredBoat.getGoogleKeys()) {
filtered = filtered.replace(str, "GOOGLE_SERVER_KEY");
}
builder.appendString(filtered);
} else {
String filtered = "An error occured :anger: ```java\n" + e.toString() + "\n";
for (String str : FredBoat.getGoogleKeys()) {
filtered = filtered.replace(str, "GOOGLE_SERVER_KEY");
}
builder.appendString(filtered);
}
//builder.appendString("```java\n");
for (StackTraceElement ste : e.getStackTrace()) {
builder.appendString("\t" + ste.toString() + "\n");
if ("prefixCalled".equals(ste.getMethodName())) {
break;
}
}
builder.appendString("\t...```");
try {
channel.sendMessage(builder.build());
} catch (UnsupportedOperationException tooLongEx) {
channel.sendMessage("An error occured :anger: Error was too long to display.");
}
}
public static String postToHastebin(String body) throws UnirestException {
return Unirest.post("http://hastebin.com/documents").body(body).asJson().getBody().getObject().getString("key");
}
public static String postToHastebin(String body, boolean asURL) throws UnirestException {
if (asURL) {
return "http://hastebin.com/" + postToHastebin(body);
} else {
return postToHastebin(body);
}
}
public static String formatTime(long millis) {
if (millis == Long.MAX_VALUE) {
return "LIVE";
}
long t = millis / 1000L;
int sec = (int) (t % 60L);
int min = (int) ((t % 3600L) / 60L);
int hrs = (int) (t / 3600L);
String timestamp;
if (hrs != 0) {
timestamp = forceTwoDigits(hrs) + ":" + forceTwoDigits(min) + ":" + forceTwoDigits(sec);
} else {
timestamp = forceTwoDigits(min) + ":" + forceTwoDigits(sec);
}
return timestamp;
}
private static String forceTwoDigits(int i) {
return i < 10 ? "0" + i : Integer.toString(i);
}
}
| [
"frogkr@gmail.com"
] | frogkr@gmail.com |
deec35b56439d810211458f45d3c7fcfcfc3a9ca | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/alibaba--druid/8b51ecf0217a48750353a8a6e74ed444ad69994d/before/MySqlCreateTableTest22.java | 025d0bd772908e0ff0320cf366ee84e01041c1f7 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,574 | java | /*
* Copyright 1999-2017 Alibaba Group Holding Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.alibaba.druid.bvt.sql.mysql.create;
import java.util.List;
import org.junit.Assert;
import com.alibaba.druid.sql.MysqlTest;
import com.alibaba.druid.sql.SQLUtils;
import com.alibaba.druid.sql.ast.SQLStatement;
import com.alibaba.druid.sql.dialect.mysql.parser.MySqlStatementParser;
import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlSchemaStatVisitor;
import com.alibaba.druid.stat.TableStat;
public class MySqlCreateTableTest22 extends MysqlTest {
public void test_0() throws Exception {
String sql = "CREATE TABLE t1 (" + //
"c1 INT STORAGE DISK," + //
"c2 INT STORAGE MEMORY " + //
") TABLESPACE ts_1 ENGINE NDB;";
MySqlStatementParser parser = new MySqlStatementParser(sql);
List<SQLStatement> statementList = parser.parseStatementList();
SQLStatement stmt = statementList.get(0);
// print(statementList);
Assert.assertEquals(1, statementList.size());
MySqlSchemaStatVisitor visitor = new MySqlSchemaStatVisitor();
stmt.accept(visitor);
// System.out.println("Tables : " + visitor.getTables());
// System.out.println("fields : " + visitor.getColumns());
// System.out.println("coditions : " + visitor.getConditions());
// System.out.println("orderBy : " + visitor.getOrderByColumns());
Assert.assertEquals(1, visitor.getTables().size());
Assert.assertEquals(2, visitor.getColumns().size());
Assert.assertEquals(0, visitor.getConditions().size());
Assert.assertTrue(visitor.getTables().containsKey(new TableStat.Name("t1")));
String output = SQLUtils.toMySqlString(stmt);
Assert.assertEquals("CREATE TABLE t1 (" + //
"\n\tc1 INT STORAGE DISK, " + //
"\n\tc2 INT STORAGE MEMORY" + //
"\n) TABLESPACE ts_1 ENGINE = NDB", output);
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
6e783f75c27edbab4cabf8b17c8ffea79bd23ce8 | 22c06ce39649e70f5eee3b77a2f355f064a51c74 | /model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/authorization/entities/InScope.java | c345677c50b6fab5c2e8159a807eff1098005951 | [
"Apache-2.0"
] | permissive | keycloak/keycloak | fa71d8b0712c388faeb89ade03ea5f1073ffb837 | a317f78e65c1ee63eb166c61767f34f72be0a891 | refs/heads/main | 2023-09-01T20:04:48.392597 | 2023-09-01T17:12:35 | 2023-09-01T17:12:35 | 11,125,589 | 17,920 | 7,045 | Apache-2.0 | 2023-09-14T19:48:31 | 2013-07-02T13:38:51 | Java | UTF-8 | Java | false | false | 868 | java | /*
* Copyright 2016 Red Hat, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
*
* 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.keycloak.models.cache.infinispan.authorization.entities;
/**
* @author <a href="mailto:psilva@redhat.com">Pedro Igor</a>
*/
public interface InScope {
String getScopeId();
}
| [
"pigor.craveiro@gmail.com"
] | pigor.craveiro@gmail.com |
6a4be04574a6a1317d2e9cb37b324166084e7365 | 9cb212fbaea1acd6fbf686a180c9e3add29eee94 | /linear structure 线性结构/src/recursion/migong.java | f1fda70b1f705d016530527ee9ddfe79d4e08258 | [] | no_license | hexiaoq/data-struct-and-algorithms | eafaf07c35bd0308abfea2170e7630c3b375ad9c | 80c5da9ae335b0e4b63a76931a150a53929e8978 | refs/heads/master | 2023-05-31T05:38:53.712737 | 2021-07-06T15:23:14 | 2021-07-06T15:23:14 | 330,865,715 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,757 | java | package recursion;
//迷宫问题
public class migong {
public static void main(String[] args) {
int[][] map = new int[8][7];
//使地图的边界置为1
for (int i = 0; i < 7; i++) {
map[0][i] = 1;
map[7][i] = 1;
}
for (int j = 0; j < 8; j++) {
map[j][0] = 1;
map[j][6] = 1;
}
map[3][2] = 1;
map[3][1] = 1;
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 7; j++) {
System.out.print(map[i][j] + " ");
}
System.out.println();
}
System.out.println("分割线");
setway(map, 1, 1);
for (int i = 0; i < 8; i++) {
for (int j = 0; j < 7; j++) {
System.out.print(map[i][j] + " ");
}
System.out.println();
}
}
/**
* 走的策略为 向下 向右 向左 向上
* @param map
* @param i j为开始的位置
* @return true为走完,false为未走完
*/
public static boolean setway(int[][] map,int i,int j)
{//终止递归的条件
if(map[6][5]==2)
return true;
if(map[i][j]==0)
{
map[i][j]=2;
if(setway(map,i+1,j))
{return true;
}
else if(setway(map,i,j+1))
{
return true;
}
else if(setway(map,i,j-1))
{
return true;
}
else if(setway(map,i-1,j))
{
return true;
}
else { map[i][j]=3;
return false;
}
}
//终止的递归的条件 当map[i][j]不为0,说明走过但后续走不通或者是墙,所以不再走
else
return false;
}
}
| [
"156437734@qq.com"
] | 156437734@qq.com |
4b9342970acda60dce28d4752c9a31032f234ff3 | 26edf248b438e119caaf7c8a8f3d33a5f634e82a | /gallerypick/src/main/java/com/yancy/gallerypick/config/GalleryConfig.java | 65ae3d881e1fef6317898c944eaaf3c73879fbf6 | [] | no_license | whaoming/WebViewCacheModule | cb41716d8cf7a623c69b90ec4ebfb7d329e6e759 | dfa15c396118ff22402221b4f1208e6ebe856f4d | refs/heads/master | 2021-06-09T13:42:56.550068 | 2016-11-29T01:38:03 | 2016-11-29T01:38:03 | 74,924,283 | 36 | 12 | null | null | null | null | UTF-8 | Java | false | false | 6,557 | java | package com.yancy.gallerypick.config;
import com.yancy.gallerypick.inter.IHandlerCallBack;
import com.yancy.gallerypick.inter.ImageLoader;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* GalleryPick 配置器
* Created by Yancy on 2016/1/27.
*/
public class GalleryConfig {
private ImageLoader imageLoader; // 图片加载器
private IHandlerCallBack iHandlerCallBack; // GalleryPick 生命周期接口
private boolean multiSelect; // 是否开启多选 默认 : false
private int maxSize; // 配置开启多选时 最大可选择的图片数量。 默认:9
private boolean isShowCamera; // 是否开启相机 默认:true
private String filePath; // 拍照以及截图后 存放的位置。 默认:/Gallery/Pictures
private ArrayList<String> pathList; // 已选择照片的路径
private boolean isOpenCamera; // 是否直接开启相机 默认:false
private boolean isCrop; // 是否开启裁剪 默认关闭
private float aspectRatioX; // 裁剪比 默认 1:1
private float aspectRatioY; // 裁剪比 默认 1:1
private int maxWidth; // 最大的裁剪值 默认 500
private int maxHeight; // 最大的裁剪值 默认 500
private Builder builder;
private GalleryConfig(Builder builder) {
setBuilder(builder);
}
private void setBuilder(Builder builder) {
this.imageLoader = builder.imageLoader;
this.iHandlerCallBack = builder.iHandlerCallBack;
this.multiSelect = builder.multiSelect;
this.maxSize = builder.maxSize;
this.isShowCamera = builder.isShowCamera;
this.pathList = builder.pathList;
this.filePath = builder.filePath;
this.isOpenCamera = builder.isOpenCamera;
this.isCrop = builder.isCrop;
this.aspectRatioX = builder.aspectRatioX;
this.aspectRatioY = builder.aspectRatioY;
this.maxWidth = builder.maxWidth;
this.maxHeight = builder.maxHeight;
this.builder = builder;
}
public static class Builder implements Serializable {
private static GalleryConfig galleryConfig;
private ImageLoader imageLoader;
private IHandlerCallBack iHandlerCallBack;
private boolean multiSelect = false;
private int maxSize = 9;
private boolean isShowCamera = true;
private String filePath = "/Gallery/Pictures";
private boolean isCrop = false;
private float aspectRatioX = 1;
private float aspectRatioY = 1;
private int maxWidth = 500;
private int maxHeight = 500;
private ArrayList<String> pathList = new ArrayList<>();
private boolean isOpenCamera = false;
public Builder crop(boolean isCrop) {
this.isCrop = isCrop;
return this;
}
public Builder crop(boolean isCrop, float aspectRatioX, float aspectRatioY, int maxWidth, int maxHeight) {
this.isCrop = isCrop;
this.aspectRatioX = aspectRatioX;
this.aspectRatioY = aspectRatioY;
this.maxWidth = maxWidth;
this.maxHeight = maxHeight;
return this;
}
public Builder imageLoader(ImageLoader imageLoader) {
this.imageLoader = imageLoader;
return this;
}
public Builder iHandlerCallBack(IHandlerCallBack iHandlerCallBack) {
this.iHandlerCallBack = iHandlerCallBack;
return this;
}
public Builder multiSelect(boolean multiSelect) {
this.multiSelect = multiSelect;
return this;
}
public Builder multiSelect(boolean multiSelect, int maxSize) {
this.multiSelect = multiSelect;
this.maxSize = maxSize;
return this;
}
public Builder maxSize(int maxSize) {
this.maxSize = maxSize;
return this;
}
public Builder isShowCamera(boolean isShowCamera) {
this.isShowCamera = isShowCamera;
return this;
}
public Builder filePath(String filePath) {
this.filePath = filePath;
return this;
}
public Builder isOpenCamera(boolean isOpenCamera) {
this.isOpenCamera = isOpenCamera;
return this;
}
public Builder pathList(List<String> pathList) {
this.pathList.clear();
this.pathList.addAll(pathList);
return this;
}
public GalleryConfig build() {
if (galleryConfig == null) {
galleryConfig = new GalleryConfig(this);
} else {
galleryConfig.setBuilder(this);
}
return galleryConfig;
}
}
public ImageLoader getImageLoader() {
return imageLoader;
}
public boolean isMultiSelect() {
return multiSelect;
}
public int getMaxSize() {
return maxSize;
}
public boolean isShowCamera() {
return isShowCamera;
}
public ArrayList<String> getPathList() {
return pathList;
}
public String getFilePath() {
return filePath;
}
public IHandlerCallBack getIHandlerCallBack() {
return iHandlerCallBack;
}
public Builder getBuilder() {
return builder;
}
public boolean isOpenCamera() {
return isOpenCamera;
}
public int getMaxHeight() {
return maxHeight;
}
public boolean isCrop() {
return isCrop;
}
public float getAspectRatioX() {
return aspectRatioX;
}
public float getAspectRatioY() {
return aspectRatioY;
}
public int getMaxWidth() {
return maxWidth;
}
}
/*
* ┏┓ ┏┓
* ┏┛┻━━━┛┻┓
* ┃ ┃
* ┃ ━ ┃
* ┃ ┳┛ ┗┳ ┃
* ┃ ┃
* ┃ ┻ ┃
* ┃ ┃
* ┗━┓ ┏━┛
* ┃ ┃
* ┃ ┃
* ┃ ┗━━━┓
* ┃ ┣┓
* ┃ ┏┛
* ┗┓┓┏━┳┓┏┛
* ┃┫┫ ┃┫┫
* ┗┻┛ ┗┻┛
* 神兽保佑
* 代码无BUG!
*/ | [
"122627018@qq.com"
] | 122627018@qq.com |
ff64614ab3f3e3dd5feda1fde35bf3e07dd50e23 | 15bad1bcfc3776a07655db76261a116d07b7c44e | /faf-java-server-app/src/main/java/com/faforever/server/cache/CacheNames.java | 531b52361a8093e4d2e950b43fcbbb1d92251aa4 | [] | no_license | FAForever/faf-java-server | 5b1bc2056afc0a0b733771553eab612a584fc9e4 | b12727562e38f33edf06a656e50419c3ae63ad5f | refs/heads/develop | 2021-07-05T05:02:09.932905 | 2019-02-21T08:21:35 | 2019-02-24T12:07:58 | 78,750,512 | 14 | 7 | null | 2019-02-24T12:07:59 | 2017-01-12T13:54:53 | Java | UTF-8 | Java | false | false | 301 | java | package com.faforever.server.cache;
public class CacheNames {
public static final String FEATURED_MODS = "featuredMods";
public static final String RANKED_MODS = "rankedMods";
public static final String MAP_VERSIONS = "mapVersions";
public static final String MOD_VERSIONS = "modVersions";
}
| [
"michel.jung89@gmail.com"
] | michel.jung89@gmail.com |
1e94c236c9a6627e85d5188bdc8be33305deb4ac | de91657cdaf0d5f582beda30274c01675899b9f5 | /SpringProgramming/src/main/java/com/mycompany/myapp/exam13/controller/Exam13Controller.java | 4f3b35b45a8e51bd354aba2f83a5a94a29d783c1 | [] | no_license | JinByeungKu/MyRepository | 98722e827e5cae9029efd146d289ad7e132371f1 | e478ba492d069de53fe5a6151bb296fd2daed9d4 | refs/heads/master | 2020-04-12T08:49:45.275190 | 2016-11-16T06:12:53 | 2016-11-16T06:12:53 | 65,832,475 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,515 | java | package com.mycompany.myapp.exam13.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.mycompany.myapp.exam13.dto.Member;
import com.mycompany.myapp.exam13.service.Exam13MemberService;
@Controller
@RequestMapping("/exam13")
public class Exam13Controller {
private static final Logger logger = LoggerFactory.getLogger(Exam13Controller.class);
@Autowired
private Exam13MemberService exam13memberService;
@RequestMapping("/index")
public String index() {
logger.info("index 처리");
return "exam13/index";
}
@RequestMapping(value="/memberjoin", method=RequestMethod.GET)
public String memberJoinForm() {
logger.info("joinForm 처리");
return "exam13/memberjoinForm";
}
@RequestMapping(value="/memberjoin", method=RequestMethod.POST)
public String memberJoin(Member member) {
logger.info("join 처리");
exam13memberService.join(member);
return "redirect:/exam13/index";
}
@RequestMapping("/memberInfo")
public String memberInfo(String mid, Model model) {
logger.info("memberinfo 처리");
Member member = exam13memberService.info(mid);
model.addAttribute("member", member);
return "exam13/memberInfo";
}
}
| [
"splendid1014@naver.com"
] | splendid1014@naver.com |
172b09442c99621edf5e4e25814161d75873c5af | 9021db47cd2732a63720d28b4787d9fe93b4d760 | /pinyougou-sellergoods-service/src/main/java/com/pinyougou/sellergoods/service/impl/ItemCatServiceImpl.java | 8adf7c56fd5cf9d3118bcb920d3c03cb00442f24 | [] | no_license | litao06370/pyg1010 | 79832aeadf1a6223810185f24604d14c2ed2dc76 | d23d538632386e6c179dd087dcd8a73e8a77dba0 | refs/heads/master | 2020-03-31T17:50:44.107337 | 2018-10-13T10:32:04 | 2018-10-13T10:32:04 | 152,436,188 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,002 | java | package com.pinyougou.sellergoods.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.pinyougou.mapper.TbItemCatMapper;
import com.pinyougou.pojo.TbItemCat;
import com.pinyougou.pojo.TbItemCatExample;
import com.pinyougou.pojo.TbItemCatExample.Criteria;
import com.pinyougou.sellergoods.service.ItemCatService;
import entity.PageResult;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.transaction.annotation.Transactional;
/**
* 服务实现层
* @author Administrator
*
*/
@Service
@Transactional
public class ItemCatServiceImpl implements ItemCatService {
@Autowired
private TbItemCatMapper itemCatMapper;
@Autowired
private RedisTemplate redisTemplate;
/**
* 查询全部
*/
@Override
public List<TbItemCat> findAll() {
return itemCatMapper.selectByExample(null);
}
/**
* 按分页查询
*/
@Override
public PageResult findPage(int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
Page<TbItemCat> page= (Page<TbItemCat>) itemCatMapper.selectByExample(null);
return new PageResult(page.getTotal(), page.getResult());
}
/**
* 增加
*/
@Override
public void add(TbItemCat itemCat) {
itemCatMapper.insert(itemCat);
}
/**
* 修改
*/
@Override
public void update(TbItemCat itemCat){
itemCatMapper.updateByPrimaryKey(itemCat);
}
/**
* 根据ID获取实体
* @param id
* @return
*/
@Override
public TbItemCat findOne(Long id){
return itemCatMapper.selectByPrimaryKey(id);
}
/**
* 批量删除
*/
@Override
public void delete(Long[] ids) {
for(Long id:ids){
itemCatMapper.deleteByPrimaryKey(id);
}
}
@Override
public PageResult findPage(TbItemCat itemCat, int pageNum, int pageSize) {
PageHelper.startPage(pageNum, pageSize);
TbItemCatExample example=new TbItemCatExample();
Criteria criteria = example.createCriteria();
if(itemCat!=null){
if(itemCat.getName()!=null && itemCat.getName().length()>0){
criteria.andNameLike("%"+itemCat.getName()+"%");
}
}
Page<TbItemCat> page= (Page<TbItemCat>)itemCatMapper.selectByExample(example);
return new PageResult(page.getTotal(), page.getResult());
}
@Override
public List<TbItemCat> findByParentId(Long parentId) {
TbItemCatExample example = new TbItemCatExample();
Criteria criteria = example.createCriteria();
//设置条件
criteria.andParentIdEqualTo(parentId);
//将模板ID放入缓存
List<TbItemCat> itemCatList = findAll();
for (TbItemCat itemCat : itemCatList) {
redisTemplate.boundHashOps("itemCat").put(itemCat.getName(),itemCat.getTypeId());
}
System.out.println("将模板ID放入缓存");
return itemCatMapper.selectByExample(example);
}
}
| [
"zhangsan@itcast.cn"
] | zhangsan@itcast.cn |
0fa23de5cca47cb9fbeb66815d6946628f33c8c3 | 17abe434c2bc8995fbc73f7f81217e49a0283c2e | /src/main/java/com/google/gwt/user/client/ui/MouseWheelVelocity.java | d2c3d9b3e34d0390782da9f8adb53d833238916a | [
"Apache-2.0"
] | permissive | aliz-ai/gwt-mock-2.5.1 | 6d7d41c9f29d3110eef5c74b23a3d63b3af5e71b | af5495454005f2bba630b8d869fde75930d4ec2e | refs/heads/master | 2022-12-31T06:00:31.983924 | 2020-07-13T12:06:47 | 2020-07-13T12:06:47 | 55,702,877 | 1 | 1 | NOASSERTION | 2020-10-13T09:09:21 | 2016-04-07T14:48:45 | Java | UTF-8 | Java | false | false | 3,215 | java | /*
* Copyright 2007 Google 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.google.gwt.user.client.ui;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
/**
* Encapsulates the direction and velocity of mouse wheel events. Not all
* combinations of browser and user input devices can generate all combinations
* of direction or range of velocity information.
*
* @see com.google.gwt.dom.client.DOM#eventGetMouseWheelVelocityY An
* explanation of the units used for mouse wheel velocity.
* @deprecated use
* {@link com.google.gwt.event.dom.client.MouseWheelEvent#getDeltaY()}
* instead
*/
@Deprecated
public class MouseWheelVelocity {
/**
* Stores the Y-axis velocity.
*/
protected final int vY;
/**
* Construct the higher-level view of the original ONMOUSEWHEEL Event.
*
* @param e the event
*/
public MouseWheelVelocity(Event e) {
vY = DOM.eventGetMouseWheelVelocityY(e);
}
@Override
public boolean equals(Object o) {
if (o instanceof MouseWheelVelocity) {
MouseWheelVelocity v = (MouseWheelVelocity) o;
return getDeltaY() == v.getDeltaY();
}
return false;
}
/**
* Returns the change in the mouse wheel position along the Y-axis; positive if
* the mouse wheel is moving north (toward the top of the screen) or negative
* if the mouse wheel is moving south (toward the bottom of the screen).
*
* @deprecated use
* {@link com.google.gwt.event.dom.client.MouseWheelEvent#getDeltaY()}
* instead
*/
@Deprecated
public int getDeltaY() {
return vY;
}
@Override
public int hashCode() {
return getDeltaY();
}
/**
* Convenience method that returns <code>true</code> if {@link #getDeltaY()}
* is a negative value.
*
* @return <code>true</code> if the velocity includes a component directed
* toword the top of the screen
* @deprecated use
* {@link com.google.gwt.event.dom.client.MouseWheelEvent#isNorth()}
* instead
*/
@Deprecated
public boolean isNorth() {
return getDeltaY() < 0;
}
/**
* Convenience method that returns <code>true</code> if {@link #getDeltaY()}
* is a positive value.
*
* @return <code>true</code> if the velocity includes a component directed
* toword the bottom of the screen
* @deprecated use
* {@link com.google.gwt.event.dom.client.MouseWheelEvent#isSouth()}
* instead
*/
@Deprecated
public boolean isSouth() {
return getDeltaY() > 0;
}
@Override
public String toString() {
return "<" + getDeltaY() + ">";
}
}
| [
"gabor.farkas@doctusoft.com"
] | gabor.farkas@doctusoft.com |
1a0f872f9140ab9a4bdca7d4840379f2a908917e | 1989c5cc23087cc425d29cb2ebb3376ff8cd85f4 | /nandhi/module/App/UIView/Component/src/main/java/nandhi/app/ui/component/form/EntityForm.java | 95298f0fac088d9fab5ac5e789fae2d7553ba3be | [] | no_license | sivarajs/Dewbag | 8a6479cf87126b87652c3db8e2f43366a7713484 | 796dc4472e164959190e6fc7142e855b8b3587da | refs/heads/master | 2021-03-12T23:58:25.243671 | 2015-07-26T15:36:07 | 2015-07-26T15:36:07 | 39,730,434 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 432 | java | package nandhi.app.ui.component.form;
public class EntityForm extends Form {
public static final String NAME = "entityForm";
public EntityForm() {
super(NAME);
}
public String getEntity() {
return getAttribute("entity");
}
public String getEntityId() {
return getAttribute("entityId");
}
public String getListenVar() {
return getAttribute("listenVar");
}
}
| [
"sivarajs@gmail.com"
] | sivarajs@gmail.com |
d1fed7c3cdb6d2978ba2de7d7dece475b1945b82 | befde1e4446dec36af350e49bacac9cdb84e9d96 | /ymir-core/src/test/java/org/seasar/ymir/annotation/handler/impl/InheritedBaseBase.java | b8f63c58a072c3c8bb0e607917aab07a0fb0bfe5 | [] | no_license | seasarorg/test-ymir-component-1 | c6c9ae715b090edae3f994e602047d4086363661 | cb53d0e4c193b9a2211df16bfabdaf23665f24b7 | refs/heads/master | 2016-09-09T19:01:46.293634 | 2013-10-01T17:36:25 | 2013-10-01T17:36:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 324 | java | package org.seasar.ymir.annotation.handler.impl;
import org.seasar.ymir.constraint.annotation.Numeric;
import org.seasar.ymir.constraint.annotation.Required;
@Required(allowWhitespace = false)
public class InheritedBaseBase {
@Numeric
@Required(allowWhitespace = false)
public void hoe() {
}
}
| [
"skirnir@ce2cb714-bd0d-0410-8c66-e472ade7ad34"
] | skirnir@ce2cb714-bd0d-0410-8c66-e472ade7ad34 |
1302cc5041a9225e7544cd27b829bc3e51e6d43e | 3838d5bba2227af9083f47e72cc8fd630a1e6243 | /view-redis-core/src/main/java/com/github/huifer/view/redis/api/RedisSetOperation.java | c9ed92c9e4a039c4838795316a354c22e8cf4bb4 | [
"Apache-2.0"
] | permissive | BestJex/view-redis | 87b789c840a567c54c6fa16770699bd0de66d558 | 00d431ac123c8decc744ada9f13cabe1404e17e6 | refs/heads/main | 2023-01-29T22:25:06.662743 | 2020-11-10T06:38:07 | 2020-11-10T06:38:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,628 | java | /*
*
* Copyright 2020 HuiFer 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.github.huifer.view.redis.api;
import java.util.Collection;
import com.github.huifer.view.redis.model.RedisConnectionConfig;
/**
* redis 的 set 数据类型操作
* @author huifer
* */
public interface RedisSetOperation extends IRedisOperationLabel {
/**
* 添加一个 set
*
* @param config redis 连接配置
* @param k 键
* @param v 值
*/
void add(RedisConnectionConfig config, String k, String v);
/**
* 获取set数据值
*
* @param config redis 连接配置
* @param k 键
* @return 值
*/
Collection get(RedisConnectionConfig config, String k);
/**
* 修改一个键的老数据
*
* @param config redis 连接配置
* @param k 键
* @param ov 老数据
* @param nv 新数据
*/
void update(RedisConnectionConfig config, String k, String ov, String nv);
/**
* 删除一个键下面的值
*
* @param config redis 连接配置
* @param k 键
* @param v 值
*/
void del(RedisConnectionConfig config, String k, String v);
}
| [
"huifer97@163.com"
] | huifer97@163.com |
86f8643ada7fffb8b209a97ec3c3c42a898e181a | 473b76b1043df2f09214f8c335d4359d3a8151e0 | /benchmark/bigclonebenchdata_partial/3657883.java | 6a5a0ebd6d4971e836861d4afd56fcfc89c0395a | [] | no_license | whatafree/JCoffee | 08dc47f79f8369af32e755de01c52d9a8479d44c | fa7194635a5bd48259d325e5b0a190780a53c55f | refs/heads/master | 2022-11-16T01:58:04.254688 | 2020-07-13T20:11:17 | 2020-07-13T20:11:17 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,732 | java |
class c3657883 {
@Override
public void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException {
String context = request.getContextPath();
String resource = request.getRequestURI().replace(context, "");
resource = resource.replaceAll("^/\\w*/", "");
if ((StringUtils.isEmpty(resource)) || (resource.endsWith("/"))) {
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return;
}
URL url = ClassLoaderUtils.getResource(resource);
if (url == null) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
if ((this.deny != null) && (this.deny.length > 0)) {
for (String s : this.deny) {
s = s.trim();
if (s.indexOf('*') != -1) {
s = s.replaceAll("\\*", ".*");
}
if (Pattern.matches(s, resource)) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
}
}
InputStream input = url.openStream();
OutputStream output = response.getOutputStream();
URLConnection connection = url.openConnection();
String contentEncoding = connection.getContentEncoding();
int contentLength = connection.getContentLength();
String contentType = connection.getContentType();
if (contentEncoding != null) {
response.setCharacterEncoding(contentEncoding);
}
response.setContentLength(contentLength);
response.setContentType(contentType);
IOUtils.copy(input, output, true);
}
}
| [
"piyush16066@iiitd.ac.in"
] | piyush16066@iiitd.ac.in |
0db113da66ae6de3c5a42ec5ba79518667d5be19 | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/spring-projects--spring-framework/431e9350113499f5a51c4dcf14aa0edfefbda6c0/after/AsyncConfigurationSelector.java | 9bb99a3eb1c643530c75bc94727ac6ca9ee5250e | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,552 | java | /*
* Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.scheduling.annotation;
import java.util.Map;
import org.springframework.context.annotation.AnnotationConfigUtils;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.context.config.AdviceMode;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.util.Assert;
/**
* Selects which implementation of {@link AbstractAsyncConfiguration}
* should be used based on the value of {@link EnableAsync#mode} on the
* importing @{@link Configuration} class.
*
* @author Chris Beams
* @since 3.1
* @see EnableAsync
* @see AbstractAsyncConfiguration
* @see ProxyAsyncConfiguration
* @see AnnotationConfigUtils#ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME
*/
public class AsyncConfigurationSelector implements ImportSelector {
/**
* {@inheritDoc}
* <p>This implementation selects {@link ProxyAsyncConfiguration} if
* {@link EnableAsync#mode()} equals {@code PROXY}, and otherwise selects
* {@link org.springframework.scheduling.aspectj.AspectJAsyncConfiguration
* AspectJAsyncConfiguration}. No additional {@code BeanDefinition}s are registered
* in either case.
*/
public String[] selectImports(ImportSelector.Context context) {
AnnotationMetadata importingClassMetadata = context.getImportingClassMetadata();
Map<String, Object> enableAsync =
importingClassMetadata.getAnnotationAttributes(EnableAsync.class.getName());
Assert.notNull(enableAsync,
"@EnableAsync is not present on importing class " +
importingClassMetadata.getClassName());
switch ((AdviceMode) enableAsync.get("mode")) {
case PROXY:
return new String[] {ProxyAsyncConfiguration.class.getName()};
case ASPECTJ:
return new String[] {AnnotationConfigUtils.ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME};
default:
throw new IllegalArgumentException("Unknown AdviceMode " + enableAsync.get("mode"));
}
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
ca4314903d694b098bbe6e64422916968861b88d | 03482d89174b363d8b7ca03d7eaf05c12a012a77 | /cws_map_to_db_skel/test/uo/ri/persistence/PersistenceTest.java | 21da00b19c3f966c0fcd64affd9a88c552e2e7c8 | [] | no_license | cafeteru/RI | 15c2145cc19dae890484b181ca3be4efd25ec969 | dd2f3e32eec71178e95bbb0287e6850604b92652 | refs/heads/master | 2022-01-09T02:43:24.159852 | 2018-10-17T22:45:24 | 2018-10-17T22:45:24 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,156 | java | package uo.ri.persistence;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.EntityTransaction;
import javax.persistence.Persistence;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import alb.util.date.DateUtil;
import uo.ri.model.Association;
import uo.ri.model.Averia;
import uo.ri.model.Bono;
import uo.ri.model.Cargo;
import uo.ri.model.Cliente;
import uo.ri.model.Factura;
import uo.ri.model.Intervencion;
import uo.ri.model.Mecanico;
import uo.ri.model.MedioPago;
import uo.ri.model.Metalico;
import uo.ri.model.Repuesto;
import uo.ri.model.Sustitucion;
import uo.ri.model.TarjetaCredito;
import uo.ri.model.TipoVehiculo;
import uo.ri.model.Vehiculo;
import uo.ri.model.exception.BusinessException;
public class PersistenceTest {
private EntityManagerFactory factory;
private Cliente cliente;
private Sustitucion sustitucion;
private Cargo cargo;
@Before
public void setUp() throws BusinessException {
factory = Persistence.createEntityManagerFactory("carworkshop");
List<Object> graph = createGraph();
persistGraph(graph);
}
@After
public void tearDown() {
removeGraph();
factory.close();
}
@Test
public void testCliente() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Cliente cl = mapper.merge(cliente);
assertNotNull(cl.getId());
assertEquals(cl.getApellidos(), "apellidos");
assertEquals(cl.getNombre(), "nombre");
assertEquals(cl.getDni(), "dni");
trx.commit();
mapper.close();
}
@Test
public void testVehiculos() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Cliente cl = mapper.merge(cliente);
Set<Vehiculo> vehiculos = cl.getVehiculos();
Vehiculo v = vehiculos.iterator().next();
assertTrue(vehiculos.size() == 1);
assertSame(v.getCliente(), cl);
assertNotNull(v.getId());
assertEquals(v.getMarca(), "seat");
assertEquals(v.getModelo(), "ibiza");
assertEquals(v.getMatricula(), "1234 GJI");
trx.commit();
mapper.close();
}
@Test
public void testSustituir() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Sustitucion s = mapper.merge(sustitucion);
Repuesto r = s.getRepuesto();
Intervencion i = s.getIntervencion();
assertTrue(r.getSustituciones().contains(s));
assertTrue(i.getSustituciones().contains(s));
trx.commit();
mapper.close();
}
@Test
public void testTrabajarArreglar() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Sustitucion s = mapper.merge(sustitucion);
Intervencion i = s.getIntervencion();
Mecanico m = i.getMecanico();
Averia a = i.getAveria();
assertTrue(m.getIntervenciones().contains(i));
assertTrue(a.getIntervenciones().contains(i));
trx.commit();
mapper.close();
}
@Test
public void testTener() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Sustitucion s = mapper.merge(sustitucion);
Averia a = s.getIntervencion().getAveria();
Vehiculo v = a.getVehiculo();
assertTrue(v.getAverias().contains(a));
trx.commit();
mapper.close();
}
@Test
public void testSerPoseer() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Sustitucion s = mapper.merge(sustitucion);
Vehiculo v = s.getIntervencion().getAveria().getVehiculo();
TipoVehiculo tv = v.getTipo();
Cliente c = v.getCliente();
assertTrue(tv.getVehiculos().contains(v));
assertTrue(c.getVehiculos().contains(v));
trx.commit();
mapper.close();
}
@Test
public void testCargar() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Cargo c = mapper.merge(cargo);
Factura f = c.getFactura();
MedioPago mp = c.getMedioPago();
assertTrue(mp.getCargos().contains(c));
assertTrue(f.getCargos().contains(c));
trx.commit();
mapper.close();
}
@Test
public void testFacturar() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Sustitucion s = mapper.merge(sustitucion);
Averia a = s.getIntervencion().getAveria();
Factura f = a.getFactura();
assertTrue(f.getAverias().contains(a));
trx.commit();
mapper.close();
}
@Test
public void testPagar() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
Sustitucion s = mapper.merge(sustitucion);
Cliente c = s.getIntervencion().getAveria().getVehiculo().getCliente();
Set<MedioPago> medios = c.getMediosPago();
for (MedioPago mp : medios) {
assertSame(mp.getCliente(), c);
}
trx.commit();
mapper.close();
}
protected List<Object> createGraph() throws BusinessException {
cliente = new Cliente("dni", "nombre", "apellidos");
Vehiculo vehiculo = new Vehiculo("1234 GJI", "seat", "ibiza");
Association.Poseer.link(cliente, vehiculo);
TipoVehiculo tipoVehiculo = new TipoVehiculo("coche", 50.0);
Association.Clasificar.link(tipoVehiculo, vehiculo);
Averia averia = new Averia(vehiculo, "falla la junta la trocla");
Mecanico mecanico = new Mecanico("dni-mecanico", "nombre", "apellidos");
averia.assignTo(mecanico);
Intervencion intervencion = new Intervencion(mecanico, averia);
intervencion.setMinutos(60);
averia.markAsFinished();
Repuesto repuesto = new Repuesto("R1001", "junta la trocla", 100.0);
sustitucion = new Sustitucion(repuesto, intervencion);
sustitucion.setCantidad(2);
Bono bono = new Bono("B-100", 100.0);
Association.Pagar.link(bono, cliente);
TarjetaCredito tarjetaCredito = new TarjetaCredito("1234567");
tarjetaCredito.setTipo("Visa");
tarjetaCredito.setValidez(DateUtil.inYearsTime(1));
Association.Pagar.link(tarjetaCredito, cliente);
Metalico metalico = new Metalico(cliente);
Factura factura = new Factura(1L);
factura.setFecha(DateUtil.today());
factura.addAveria(averia);
cargo = new Cargo(factura, tarjetaCredito, factura.getImporte());
List<Object> res = new LinkedList<Object>();
res.add(tipoVehiculo);
res.add(repuesto);
res.add(mecanico);
res.add(cliente);
res.add(bono);
res.add(tarjetaCredito);
res.add(metalico);
res.add(vehiculo);
res.add(factura);
res.add(averia);
res.add(intervencion);
res.add(sustitucion);
res.add(cargo);
return res;
}
private void persistGraph(List<Object> graph) {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
for (Object o : graph) {
mapper.persist(o);
}
trx.commit();
mapper.close();
}
private void removeGraph() {
EntityManager mapper = factory.createEntityManager();
EntityTransaction trx = mapper.getTransaction();
trx.begin();
List<Object> merged = mergeGraph(mapper);
for (Object o : merged) {
mapper.remove(o);
}
trx.commit();
mapper.close();
}
private List<Object> mergeGraph(EntityManager mapper) {
List<Object> res = new LinkedList<Object>();
res.add(mapper.merge(cargo));
Sustitucion s = mapper.merge(sustitucion);
res.add(s);
res.add(s.getRepuesto());
res.add(s.getIntervencion());
res.add(s.getIntervencion().getMecanico());
res.add(s.getIntervencion().getAveria());
res.add(s.getIntervencion().getAveria().getVehiculo());
res.add(s.getIntervencion().getAveria().getVehiculo().getTipo());
res.add(s.getIntervencion().getAveria().getFactura());
Cliente cl = mapper.merge(cliente);
res.add(cl);
for (MedioPago mp : cl.getMediosPago()) {
res.add(mp);
}
return res;
}
}
| [
"ivangonzalezmahagamage@gmail.com"
] | ivangonzalezmahagamage@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.