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
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bf1771df47247d52116a0d2436e62a3ab88b58d5
|
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
|
/Code Snippet Repository/Jetty/Jetty5053.java
|
03bb24d3fe7d8b9247ac056192cb769218748c73
|
[] |
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
| 1,168
|
java
|
@Override
public V getBest(String s, int offset, int len)
{
TreeTrie<V> t = this;
for(int i=0; i < len; i++)
{
byte c=(byte)(0xff&s.charAt(offset+i));
int index=c>=0&&c<0x7f?__lookup[c]:-1;
if (index>=0)
{
if (t._nextIndex[index] == null)
break;
t = t._nextIndex[index];
}
else
{
TreeTrie<V> n=null;
for (int j=t._nextOther.size();j-->0;)
{
n=t._nextOther.get(j);
if (n._c==c)
break;
n=null;
}
if (n==null)
break;
t=n;
}
// Is the next Trie is a match
if (t._key!=null)
{
// Recurse so we can remember this possibility
V best=t.getBest(s,offset+i+1,len-i-1);
if (best!=null)
return best;
break;
}
}
return t._value;
}
|
[
"[email protected]"
] | |
57573afb17996febd280d8a981b445e25e32213f
|
7fa9c6b0fa1d0726ae1cda0199716c811a1ea01b
|
/Crawler/data/StockInter.java
|
26ea8a020c04f7fa691cd4229a3de8815b580733
|
[] |
no_license
|
NayrozD/DD2476-Project
|
b0ca75799793d8ced8d4d3ba3c43c79bb84a72c0
|
94dfb3c0a470527b069e2e0fd9ee375787ee5532
|
refs/heads/master
| 2023-03-18T04:04:59.111664
| 2021-03-10T15:03:07
| 2021-03-10T15:03:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,018
|
java
|
11
https://raw.githubusercontent.com/yfelvis/mtcc/master/mtcc-demo/mtcc-demo-order/src/main/java/com/hyf/mtcc/demo/order/inter/StockInter.java
package com.hyf.mtcc.demo.order.inter;
import com.hyf.mtcc.demo.order.request.DecreaseStockReq;
import com.yf.mtcc.core.annotation.Mtcc;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map;
@FeignClient(value = "cloud-stock", fallback = StockInterHystrix.class)
public interface StockInter {
@Mtcc
@PostMapping("/stock/decrease")
String decreaseStock(@RequestBody @Validated DecreaseStockReq req);
@GetMapping("/stock/findStockByName")
Map<String, Object> findStockByName(@RequestParam("productName") String productName);
}
|
[
"[email protected]"
] | |
47f8f489e505d662879e5b1c86cfa3f316aee940
|
95a54e3f3617bf55883210f0b5753b896ad48549
|
/java_src/com/liber8tech/tago/android/activity/TagoDetailsActivity$onCreate$5$1$3.java
|
7d6df6bcba2fe9eb6c8d259798549c9eaa46f88d
|
[] |
no_license
|
aidyk/TagoApp
|
ffc5a8832fbf9f9819f7f8aa7af29149fbab9ea5
|
e31a528c8f931df42075fc8694754be146eddc34
|
refs/heads/master
| 2022-12-22T02:20:58.486140
| 2021-05-16T07:42:02
| 2021-05-16T07:42:02
| 325,695,453
| 3
| 1
| null | 2022-12-16T00:32:10
| 2020-12-31T02:34:45
|
Smali
|
UTF-8
|
Java
| false
| false
| 904
|
java
|
package com.liber8tech.tago.android.activity;
import io.reactivex.functions.Consumer;
import kotlin.Metadata;
import timber.log.Timber;
/* access modifiers changed from: package-private */
@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "", "kotlin.jvm.PlatformType", "accept"}, k = 3, mv = {1, 1, 13})
/* compiled from: TagoDetailsActivity.kt */
public final class TagoDetailsActivity$onCreate$5$1$3<T> implements Consumer<Throwable> {
public static final TagoDetailsActivity$onCreate$5$1$3 INSTANCE = new TagoDetailsActivity$onCreate$5$1$3();
TagoDetailsActivity$onCreate$5$1$3() {
}
public final void accept(Throwable th) {
Timber.d(th);
}
}
|
[
"[email protected]"
] | |
6c83ebccc3fc3aa2ea99b24dfffe3b89aad27078
|
d11fb0d15b73a28742caa97e349dcfbe70d2563f
|
/server/iih_pub/iih.ci_pub/src/main/java/iih/ci/ord/d/CijudgeSpecillDTO.java
|
45b894c7dbc36d2cdfc000835b625a8982ffdff3
|
[] |
no_license
|
fhis/order.client
|
50a363fd3e4f56d95ccc5aa288e907a0a8571031
|
56cfa7877f600a10c54fdb30306a32ffa28b8217
|
refs/heads/master
| 2021-08-22T20:50:59.511923
| 2017-12-01T07:10:27
| 2017-12-01T07:10:27
| 112,678,072
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,457
|
java
|
package iih.ci.ord.d;
import xap.mw.core.data.*;
import xap.mw.coreitf.d.*;
import java.math.BigDecimal;
/**
* ci判断特殊病药 DTO数据
*
*/
public class CijudgeSpecillDTO extends BaseDTO {
private static final long serialVersionUID = 1L;
/**
* 药品
* @return String
*/
public String getId_mm() {
return ((String) getAttrVal("Id_mm"));
}
/**
* 药品
* @param Id_mm
*/
public void setId_mm(String Id_mm) {
setAttrVal("Id_mm", Id_mm);
}
/**
* 特殊病药
* @return FBoolean
*/
public FBoolean getFg_mmspecill() {
return ((FBoolean) getAttrVal("Fg_mmspecill"));
}
/**
* 特殊病药
* @param Fg_mmspecill
*/
public void setFg_mmspecill(FBoolean Fg_mmspecill) {
setAttrVal("Fg_mmspecill", Fg_mmspecill);
}
/**
* 诊断集合
* @return FMap2
*/
public FMap2 getDiagmap() {
return ((FMap2) getAttrVal("Diagmap"));
}
/**
* 诊断集合
* @param Diagmap
*/
public void setDiagmap(FMap2 Diagmap) {
setAttrVal("Diagmap", Diagmap);
}
/**
* 扩展字段
* @return String
*/
public String getStr() {
return ((String) getAttrVal("Str"));
}
/**
* 扩展字段
* @param Str
*/
public void setStr(String Str) {
setAttrVal("Str", Str);
}
/**
* 扩展字段2
* @return String
*/
public String getStr2() {
return ((String) getAttrVal("Str2"));
}
/**
* 扩展字段2
* @param Str2
*/
public void setStr2(String Str2) {
setAttrVal("Str2", Str2);
}
}
|
[
"[email protected]"
] | |
c36dee0a22f34d9d8ced2279b1c0758ba5a52e7e
|
9f907527f44fdfc33b5add9f8d313bbeb96d1192
|
/src/uva/volume003/Network.java
|
a1fe923e29e8b0d02c34363ef9db6c4da85ea548
|
[] |
no_license
|
kocko/algorithms
|
7af7052b13a080992dcfbff57171a2cac7c50c67
|
382b6b50538220a26e1af1644e72a4e1796374b6
|
refs/heads/master
| 2023-08-03T21:15:27.070471
| 2023-08-03T14:39:45
| 2023-08-03T14:39:45
| 45,342,667
| 5
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,137
|
java
|
package uva.volume003;
import java.io.Closeable;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import static java.lang.Integer.min;
public class Network implements Closeable {
private Scanner in = new Scanner(System.in);
private PrintWriter out = new PrintWriter(System.out);
public void solve() {
while ((n = Integer.parseInt(in.nextLine())) != 0) {
reset();
for (int i = 0; i <= n; i++) {
graph.add(new ArrayList<>());
}
String[] split;
while ((split = in.nextLine().split("\\s+")).length > 1) {
int u = Integer.parseInt(split[0]);
for (int i = 1; i < split.length; i++) {
int v = Integer.parseInt(split[i]);
graph.get(u).add(v);
graph.get(v).add(u);
}
}
dfs(1, 0);
int result = 0;
for (int i = 1; i <= n; i++) {
if (articulationPoint[i]) {
result++;
}
}
out.println(result);
}
}
private int n;
private int[] low, level;
private boolean[] articulationPoint;
private List<List<Integer>> graph;
private void reset() {
graph = new ArrayList<>();
level = new int[n + 1];
low = new int[n + 1];
Arrays.fill(low, Integer.MAX_VALUE);
articulationPoint = new boolean[n + 1];
}
private void dfs(int v, int p) {
level[v] = low[v] = level[p] + 1;
int children = 0;
for (int to : graph.get(v)) {
if (to == p) continue;
if (level[to] != 0) {
low[v] = min(low[v], level[to]);
} else {
dfs(to, v);
low[v] = min(low[v], low[to]);
if (low[to] >= level[v] && p != 0) {
articulationPoint[v] = true;
}
++children;
}
}
if (p == 0 && children > 1) {
articulationPoint[v] = true;
}
}
@Override
public void close() throws IOException {
in.close();
out.close();
}
public static void main(String[] args) throws IOException {
try (Network instance = new Network()) {
instance.solve();
}
}
}
|
[
"[email protected]"
] | |
124edd0919d53f2808d55eda6b798bd309e6064d
|
d727e53f2e557c88bcf59aa49f49ca5bbb7e6654
|
/src/com/massivecraft/mcore/util/TimeUnit.java
|
b008654fe3a11a17f3f9b68990f89ff092822aeb
|
[] |
no_license
|
riking/mcore
|
108ea59ac2e6d7a9e658455984fbe6cb8dfd59a8
|
f78872c15755ead8ed19051be3e08e19220fbb40
|
refs/heads/master
| 2021-01-17T23:50:30.851298
| 2013-08-29T08:55:35
| 2013-08-29T08:55:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,087
|
java
|
package com.massivecraft.mcore.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.TreeSet;
public class TimeUnit implements Comparable<TimeUnit>
{
// -------------------------------------------- //
// CONSTANTS
// -------------------------------------------- //
public static final long MILLIS_PER_MILLISECOND = 1L;
public static final long MILLIS_PER_SECOND = 1000L * MILLIS_PER_MILLISECOND;
public static final long MILLIS_PER_MINUTE = 60L * MILLIS_PER_SECOND;
public static final long MILLIS_PER_HOUR = 60L * MILLIS_PER_MINUTE;
public static final long MILLIS_PER_DAY = 24L * MILLIS_PER_HOUR;
public static final long MILLIS_PER_WEEK = 7L * MILLIS_PER_DAY;
public static final long MILLIS_PER_MONTH = 31L * MILLIS_PER_DAY;
public static final long MILLIS_PER_MONTHUP = 32L * MILLIS_PER_DAY;
public static final long MILLIS_PER_YEAR = 365L * MILLIS_PER_DAY;
public static final TimeUnit YEAR = new TimeUnit(MILLIS_PER_YEAR, "year", "years", "year", "years", "y", "year", "years");
public static final TimeUnit MONTH = new TimeUnit(MILLIS_PER_MONTH, "month", "months", "month", "months", "month", "months");
public static final TimeUnit WEEK = new TimeUnit(MILLIS_PER_WEEK, "week", "weeks", "week", "weeks", "w", "week", "weeks");
public static final TimeUnit DAY = new TimeUnit(MILLIS_PER_DAY, "day", "days", "day", "days", "d", "day", "days");
public static final TimeUnit HOUR = new TimeUnit(MILLIS_PER_HOUR, "hour", "hours", "h", "h", "h", "hs", "hour", "hours");
public static final TimeUnit MINUTE = new TimeUnit(MILLIS_PER_MINUTE, "minute", "minutes", "min", "min", "m", "min", "mins", "minute", "minutes");
public static final TimeUnit SECOND = new TimeUnit(MILLIS_PER_SECOND, "second", "seconds", "s", "s", "s", "sec", "secs", "second", "seconds");
public static final TimeUnit MILLISECOND = new TimeUnit(MILLIS_PER_MILLISECOND, "millisecond", "milliseconds", "ms", "ms", "millis", "millisec", "millisecs", "millisecond", "milliseconds", "ms", "msec", "msecs", "msecond", "mseconds");
// -------------------------------------------- //
// REGISTRY
// -------------------------------------------- //
private static final TreeSet<TimeUnit> all = new TreeSet<TimeUnit>();
public static TreeSet<TimeUnit> getAll() { return new TreeSet<TimeUnit>(all); }
public static TreeSet<TimeUnit> getAllButMillis()
{
TreeSet<TimeUnit> ret = new TreeSet<TimeUnit>(all);
ret.remove(MILLISECOND);
return ret;
}
public static TreeSet<TimeUnit> getAllButMillisAndSeconds()
{
TreeSet<TimeUnit> ret = new TreeSet<TimeUnit>(all);
ret.remove(MILLISECOND);
ret.remove(SECOND);
return ret;
}
public static TimeUnit get(String timeUnitString)
{
if (timeUnitString == null) return null;
String timeUnitStringLowerCase = timeUnitString.toLowerCase();
for(TimeUnit timeUnit : all)
{
for (String alias : timeUnit.aliases)
{
if (alias.equals(timeUnitStringLowerCase))
{
return timeUnit;
}
}
}
return null;
}
public static boolean register(TimeUnit timeUnit)
{
return all.add(timeUnit);
}
static
{
register(YEAR);
register(MONTH);
register(WEEK);
register(DAY);
register(HOUR);
register(MINUTE);
register(SECOND);
register(MILLISECOND);
}
// -------------------------------------------- //
// FIELDS
// -------------------------------------------- //
public final long millis;
public final String singularName;
public final String pluralName;
public final String singularUnit;
public final String pluralUnit;
public final Collection<String> aliases;
// -------------------------------------------- //
// CONSTRUCT
// -------------------------------------------- //
private TimeUnit(long millis, String singularName, String pluralName, String singularUnit, String pluralUnit, String... aliases)
{
this.millis = millis;
this.singularName = singularName;
this.pluralName = pluralName;
this.singularUnit = singularUnit;
this.pluralUnit = pluralUnit;
this.aliases = new ArrayList<String>(Arrays.asList(aliases));
}
// -------------------------------------------- //
// UTIL
// -------------------------------------------- //
public String getUnitString(long amount)
{
if (amount == 1) return this.singularUnit;
return this.pluralUnit;
}
public String getNameString(long amount)
{
if (amount == 1) return this.singularName;
return this.pluralName;
}
// -------------------------------------------- //
// BASIC
// -------------------------------------------- //
@Override
public String toString()
{
return this.singularName;
}
@Override
public int compareTo(TimeUnit that)
{
return Long.valueOf(this.millis).compareTo(that.millis) * -1;
}
@Override
public final boolean equals(Object other)
{
if (! (other instanceof TimeUnit)) return false;
return this.millis == ((TimeUnit)other).millis;
}
}
|
[
"[email protected]"
] | |
5b935176694db1bd383e1a199df407ca6bffd40d
|
d12db7e6171e03a3baf13c4972183408e0fd57d3
|
/extentmerge/src/main/java/com/relevantcodes/extentmerge/DataAggregator.java
|
e8b37ab8aa903335be4b75dd5d7d4550ffbeae4a
|
[
"BSD-3-Clause",
"MIT",
"BSD-2-Clause"
] |
permissive
|
ursmurli/extentreports
|
be50b0f366a407d3dd8ee463d68003e8d644979f
|
a0d328330bd84c5c2e327c0a6cea3c3f039a2f31
|
refs/heads/master
| 2020-12-26T04:56:45.569037
| 2015-10-09T18:27:07
| 2015-10-09T18:27:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 956
|
java
|
/*
* The MIT License (MIT)
*
* Copyright (c) 2015, Anshoo Arora (Relevant Codes)
*/
package com.relevantcodes.extentmerge;
import java.util.ArrayList;
import java.util.List;
class DataAggregator implements IAggregator {
private List<IAggregator> aggregatorList;
public DataAggregator(List<String> directoryList, List<String> htmlFilePathList, List<String> databaseFilePathList) {
aggregatorList = new ArrayList<IAggregator>();
aggregatorList.add(new FileInfoAggregator(htmlFilePathList));
aggregatorList.add(new DirectoryInfoAggregator(directoryList));
aggregatorList.add(new DatabaseInfoAggregator(databaseFilePathList));
}
public List<Report> getAggregatedData() {
List<Report> reportList = new ArrayList<Report>();
List<Report> list;
for (IAggregator aggregator : aggregatorList) {
list = aggregator.getAggregatedData();
if (list != null) {
reportList.addAll(list);
}
}
return reportList;
}
}
|
[
"[email protected]"
] | |
a5d63744106c9147f62d5d1883b38e35708047f3
|
5c3f7f329dc1c4daef4a549bcd5ee005faa97fe8
|
/semiProjectGroup1/src/controller/Admin_MoviePeopleUpdateController.java
|
4763bd4c688f794e8734f2bd7e73b086988c9a85
|
[] |
no_license
|
jhta1st/semiProjectGroup1
|
eb71ec2199800e4432f41556232a55991f5a8c02
|
5619502e8b96d27093033c419e21af302d2325a9
|
refs/heads/master
| 2020-05-04T19:30:32.697703
| 2019-04-16T10:59:17
| 2019-04-16T10:59:17
| 179,396,798
| 0
| 0
| null | null | null | null |
UHC
|
Java
| false
| false
| 2,808
|
java
|
package controller;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.oreilly.servlet.MultipartRequest;
import com.oreilly.servlet.multipart.DefaultFileRenamePolicy;
import dao.Admin_CharInfoDao;
import vo.Admin_CharInfoVo;
@WebServlet("/admin/MoviePeopleUpdate.do")
public class Admin_MoviePeopleUpdateController extends HttpServlet{
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
int charNum=Integer.parseInt(req.getParameter("charNum"));
Admin_CharInfoDao dao=Admin_CharInfoDao.getInstance();
Admin_CharInfoVo vo=dao.detail(charNum);
req.setAttribute("vo", vo);
req.setAttribute("pages", "/Admin/admin_MoviePeopleUpdate.jsp");
req.getRequestDispatcher("/main/layout.jsp").forward(req, resp);
}
@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
String dir=req.getServletContext().getRealPath("/Movie/images/char");
MultipartRequest mr=new MultipartRequest(
req,
dir,
1024*1024*5,
"utf-8",
new DefaultFileRenamePolicy()
);
Admin_CharInfoDao dao= Admin_CharInfoDao.getInstance();
int charNum=Integer.parseInt(mr.getParameter("charNum"));
Admin_CharInfoVo vo=dao.detail(charNum);
String charName=mr.getParameter("charName");
String charOrgFileName=mr.getOriginalFileName("file2");//전송된 파일명
int n=0;
if(charOrgFileName!=null){//수정할 파일이 전송된 경우
String savefile=mr.getFilesystemName("file2");//저장된 파일명
File f1=mr.getFile("file2");
Admin_CharInfoVo vo1=new Admin_CharInfoVo(charNum, charName, charOrgFileName, savefile);
n=dao.update(vo1);
//3. 기존파일삭제
String charSavFileName=vo.getCharSavFileName();
File f=new File(dir +"\\" + charSavFileName);
if(f.delete()){
}
}else{//수정할 파일이 전송되지 않은 경우
//기존정보 그대로 유지하기
Admin_CharInfoVo vo2=new Admin_CharInfoVo(charNum, charName, vo.getCharOrgFileName(), vo.getCharSavFileName());
n=dao.update(vo2);
}
if(n>0){
req.setAttribute("pages", "/admin/MoviePeopleList.do");
req.getRequestDispatcher("/main/layout.jsp").forward(req, resp);
}else{
req.setAttribute("code", "fail");
req.setAttribute("pages", "/User/user_result.jsp");
req.getRequestDispatcher("/main/layout.jsp").forward(req, resp);
}
}
}
|
[
"JHTA@JHTA-PC"
] |
JHTA@JHTA-PC
|
4f7efd73b176b0e29353e2f76506b160c68b75b8
|
e12af772256dccc4f44224f68b7a3124673d9ced
|
/jitsi/src/net/java/sip/communicator/plugin/sip2sipaccregwizz/Sip2SipAccRegWizzActivator.java
|
be62d3718e3d80f96a4092035c5bdc5b49a9125d
|
[] |
no_license
|
leshikus/dataved
|
bc2f17d9d5304b3d7c82ccb0f0f58c7abcd25b2a
|
6c43ab61acd08a25b21ed70432cd0294a5db2360
|
refs/heads/master
| 2021-01-22T02:33:58.915867
| 2016-11-03T08:35:22
| 2016-11-03T08:35:22
| 32,135,163
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,587
|
java
|
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.sip2sipaccregwizz;
import java.util.*;
import org.osgi.framework.*;
import net.java.sip.communicator.service.browserlauncher.*;
import net.java.sip.communicator.service.gui.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.resources.*;
/**
* Registers the <tt>GoogleTalkAccountRegistrationWizard</tt> in the UI Service.
*
* @author Lubomir Marinov
* @author Yana Stamcheva
*/
public class Sip2SipAccRegWizzActivator
implements BundleActivator
{
/**
* The bundle context.
*/
public static BundleContext bundleContext;
/**
* The browser launcher service.
*/
private static BrowserLauncherService browserLauncherService;
/**
* The resources service.
*/
private static ResourceManagementService resourcesService;
/**
* The ui service.
*/
private static UIService uiService;
/**
* Starts this bundle.
* @param bc BundleContext
* @throws Exception
*/
public void start(BundleContext bc)
throws Exception
{
bundleContext = bc;
System.setProperty(
"http.agent",
System.getProperty("sip-communicator.application.name")
+ "/"
+ System.getProperty("sip-communicator.version"));
uiService =
(UIService) bundleContext.getService(bundleContext
.getServiceReference(UIService.class.getName()));
Sip2SipAccountRegistrationWizard wizard
= new Sip2SipAccountRegistrationWizard(uiService
.getAccountRegWizardContainer());
Hashtable<String, String> containerFilter
= new Hashtable<String, String>();
containerFilter.put(
ProtocolProviderFactory.PROTOCOL,
Sip2SipAccountRegistrationWizard.PROTOCOL);
bundleContext.registerService(
AccountRegistrationWizard.class.getName(),
wizard,
containerFilter);
}
public void stop(BundleContext bundleContext) throws Exception {}
/**
* Returns the <tt>UIService</tt>.
*
* @return the <tt>UIService</tt>
*/
public static UIService getUIService()
{
return uiService;
}
/**
* Returns the <tt>BrowserLauncherService</tt> obtained from the bundle
* context.
* @return the <tt>BrowserLauncherService</tt> obtained from the bundle
* context
*/
public static BrowserLauncherService getBrowserLauncher()
{
if (browserLauncherService == null)
{
browserLauncherService
= (BrowserLauncherService) bundleContext.getService(
bundleContext.getServiceReference(
BrowserLauncherService.class.getName()));
}
return browserLauncherService;
}
/**
* Returns the service giving access to resources.
* @return the service giving access to resources
*/
public static ResourceManagementService getResources()
{
if (resourcesService == null)
resourcesService = ResourceManagementServiceUtils
.getService(Sip2SipAccRegWizzActivator.bundleContext);
return resourcesService;
}
}
|
[
"alexei.fedotov@917aa43a-1baf-11df-844d-27937797d2d2"
] |
alexei.fedotov@917aa43a-1baf-11df-844d-27937797d2d2
|
9956b806ed9944b66abe8cbcec4fe450b3d1ce94
|
c53d2df47f3092851bd43bf3c7a0298c620887c2
|
/src/main/java/io/quezone/registration/config/audit/AuditEventConverter.java
|
31c0598d00da332d86c0db49698c422cebb12e5d
|
[] |
no_license
|
vunguyenthe/RegistrationService
|
3df24e38c8589159e21d7960524d1c7641c0a3e6
|
4c704a68ae13841aadce40cb2fc8b372761bd0d9
|
refs/heads/master
| 2020-03-28T00:12:41.037559
| 2018-09-04T17:47:26
| 2018-09-04T17:47:26
| 147,385,340
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,209
|
java
|
package io.quezone.registration.config.audit;
import io.quezone.registration.domain.PersistentAuditEvent;
import org.springframework.boot.actuate.audit.AuditEvent;
import org.springframework.security.web.authentication.WebAuthenticationDetails;
import org.springframework.stereotype.Component;
import java.util.*;
@Component
public class AuditEventConverter {
/**
* Convert a list of PersistentAuditEvent to a list of AuditEvent
*
* @param persistentAuditEvents the list to convert
* @return the converted list.
*/
public List<AuditEvent> convertToAuditEvent(Iterable<PersistentAuditEvent> persistentAuditEvents) {
if (persistentAuditEvents == null) {
return Collections.emptyList();
}
List<AuditEvent> auditEvents = new ArrayList<>();
for (PersistentAuditEvent persistentAuditEvent : persistentAuditEvents) {
auditEvents.add(convertToAuditEvent(persistentAuditEvent));
}
return auditEvents;
}
/**
* Convert a PersistentAuditEvent to an AuditEvent
*
* @param persistentAuditEvent the event to convert
* @return the converted list.
*/
public AuditEvent convertToAuditEvent(PersistentAuditEvent persistentAuditEvent) {
if (persistentAuditEvent == null) {
return null;
}
return new AuditEvent(persistentAuditEvent.getAuditEventDate(), persistentAuditEvent.getPrincipal(),
persistentAuditEvent.getAuditEventType(), convertDataToObjects(persistentAuditEvent.getData()));
}
/**
* Internal conversion. This is needed to support the current SpringBoot actuator AuditEventRepository interface
*
* @param data the data to convert
* @return a map of String, Object
*/
public Map<String, Object> convertDataToObjects(Map<String, String> data) {
Map<String, Object> results = new HashMap<>();
if (data != null) {
for (Map.Entry<String, String> entry : data.entrySet()) {
results.put(entry.getKey(), entry.getValue());
}
}
return results;
}
/**
* Internal conversion. This method will allow to save additional data.
* By default, it will save the object as string
*
* @param data the data to convert
* @return a map of String, String
*/
public Map<String, String> convertDataToStrings(Map<String, Object> data) {
Map<String, String> results = new HashMap<>();
if (data != null) {
for (Map.Entry<String, Object> entry : data.entrySet()) {
// Extract the data that will be saved.
if (entry.getValue() instanceof WebAuthenticationDetails) {
WebAuthenticationDetails authenticationDetails = (WebAuthenticationDetails) entry.getValue();
results.put("remoteAddress", authenticationDetails.getRemoteAddress());
results.put("sessionId", authenticationDetails.getSessionId());
} else {
results.put(entry.getKey(), Objects.toString(entry.getValue()));
}
}
}
return results;
}
}
|
[
"[email protected]"
] | |
0b0d97e28a9cc6d346d2eff59f81e35dfc21bb68
|
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
|
/benchmark/training/org/springsource/loaded/test/IncrementalTypeDescriptorTests.java
|
b7e006f4c0ab0de3fd74cb25a34496f896ccfbb7
|
[] |
no_license
|
STAMP-project/dspot-experiments
|
f2c7a639d6616ae0adfc491b4cb4eefcb83d04e5
|
121487e65cdce6988081b67f21bbc6731354a47f
|
refs/heads/master
| 2023-02-07T14:40:12.919811
| 2019-11-06T07:17:09
| 2019-11-06T07:17:09
| 75,710,758
| 14
| 19
| null | 2023-01-26T23:57:41
| 2016-12-06T08:27:42
| null |
UTF-8
|
Java
| false
| false
| 6,435
|
java
|
/**
* Copyright 2010-2012 VMware and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springsource.loaded.test;
import java.util.List;
import org.junit.Assert;
import org.junit.Test;
import org.springsource.loaded.ClassRenamer;
import org.springsource.loaded.IncrementalTypeDescriptor;
import org.springsource.loaded.MethodMember;
import org.springsource.loaded.TypeDescriptor;
import org.springsource.loaded.TypeRegistry;
/**
* Tests for TypeDescriptor usage.
*
* @author Andy Clement
* @since 1.0
*/
/**
*
*
* @author Andy Clement
*/
public class IncrementalTypeDescriptorTests extends SpringLoadedTests {
/**
* Test comparison of two simple classes.
*/
@Test
public void simpleExtractor() {
TypeRegistry registry = getTypeRegistry("");
byte[] bytes = loadBytesForClass("data.SimpleClass");
TypeDescriptor typeDescriptor = extract(bytes, true);
byte[] bytes2 = ClassRenamer.rename("data.SimpleClass", loadBytesForClass("data.SimpleClass002"));
TypeDescriptor typeDescriptor2 = extract(bytes2, true);
IncrementalTypeDescriptor itd = new IncrementalTypeDescriptor(typeDescriptor);
itd.setLatestTypeDescriptor(typeDescriptor2);
List<MethodMember> newMethods = itd.getNewOrChangedMethods();
Assert.assertEquals(1, newMethods.size());
Assert.assertEquals("0x1 bar()Ljava/lang/String;", newMethods.get(0).toString());
List<MethodMember> deletedMethods = itd.getDeletedMethods();
Assert.assertEquals(1, deletedMethods.size());
Assert.assertEquals("0x1 foo()V", deletedMethods.get(0).toString());
}
// @Test
// public void newversionDescriptor() {
// byte[] classBytes = loadBytesForClass("data.SimpleClassFour");
// TypeDescriptor td = TypeDescriptorExtractor.extractFor(classBytes);
//
// byte[] classBytes2 = retrieveRename("data.SimpleClassFour", "data.SimpleClassFour002");
// TypeDescriptor td2 = TypeDescriptorExtractor.extractFor(classBytes2);
//
// IncrementalTypeDescriptor nvtd = new IncrementalTypeDescriptor(td);
// nvtd.setLatestTypeDescriptor(td2);
//
// // Now ask it questions about the changes
// List<MethodMember> ms = nvtd.getNewOrChangedMethods();
// Assert.assertEquals(2, ms.size());
//
// MethodMember rm = grabFrom(ms, "extraOne");
// Assert.assertNotNull(rm);
// Assert.assertEquals("0x1 extraOne(Ljava/lang/String;)V", rm.toString());
//
// rm = grabFrom(ms, "extraTwo");
// Assert.assertNotNull(rm);
// Assert.assertEquals("0x9 extraTwo(I)Ljava/lang/Double;", rm.toString());
// //
// // boolean b = nvtd.defines(false, "extraOne", "(Ljava/lang/String;)V");
// // Assert.assertTrue(b);
// //
// // b = nvtd.defines(true, "extraOne", "(Ljava/lang/String;)V");
// // Assert.assertFalse(b);
// }
// regular method deleted
@Test
public void deletedMethods() throws Exception {
TypeRegistry registry = getTypeRegistry("");
byte[] bytes = loadBytesForClass("typedescriptor.A");
TypeDescriptor typeDescriptor = extract(bytes, true);
byte[] bytes2 = ClassRenamer.rename("typedescriptor.A", loadBytesForClass("typedescriptor.A2"));
TypeDescriptor typeDescriptor2 = extract(bytes2, true);
IncrementalTypeDescriptor itd = new IncrementalTypeDescriptor(typeDescriptor);
itd.setLatestTypeDescriptor(typeDescriptor2);
Assert.assertEquals(1, itd.getDeletedMethods().size());
Assert.assertEquals("0x1 m()V", itd.getDeletedMethods().get(0).toString());
}
// overridden (caught) method deleted
@Test
public void deletedMethods2() throws Exception {
TypeRegistry registry = getTypeRegistry("");
byte[] bytes = loadBytesForClass("typedescriptor.B");
TypeDescriptor typeDescriptor = extract(bytes, true);
byte[] bytes2 = ClassRenamer.rename("typedescriptor.B", loadBytesForClass("typedescriptor.B2"));
TypeDescriptor typeDescriptor2 = extract(bytes2, true);
IncrementalTypeDescriptor itd = new IncrementalTypeDescriptor(typeDescriptor);
itd.setLatestTypeDescriptor(typeDescriptor2);
List<MethodMember> deleted = itd.getDeletedMethods();
System.out.println(deleted);
Assert.assertEquals(1, deleted.size());
Assert.assertEquals("0x1 m()V", deleted.get(0).toString());
}
// More subtle changes (modifier flags)
@Test
public void changedModifiers() throws Exception {
TypeRegistry registry = getTypeRegistry("");
byte[] bytes = loadBytesForClass("typedescriptor.C");
TypeDescriptor typeDescriptor = extract(bytes, true);
byte[] bytes2 = ClassRenamer.rename("typedescriptor.C", loadBytesForClass("typedescriptor.C2"));
TypeDescriptor typeDescriptor2 = extract(bytes2, true);
IncrementalTypeDescriptor itd = new IncrementalTypeDescriptor(typeDescriptor);
itd.setLatestTypeDescriptor(typeDescriptor2);
System.out.println(itd.toString(true));
List<MethodMember> changed = itd.getNewOrChangedMethods();
MethodMember m = getMethod(changed, "staticMethod");
Assert.assertTrue(IncrementalTypeDescriptor.isNowNonStatic(m));
m = getMethod(changed, "instanceMethod");
Assert.assertTrue(IncrementalTypeDescriptor.isNowStatic(m));
m = getMethod(changed, "publicMethod1");
Assert.assertTrue(IncrementalTypeDescriptor.hasVisibilityChanged(m));
// TODO Not detected as protected methods always made public in reloadable types... is that OK?
// m = getMethod(changed, "publicMethod2");
// Assert.assertTrue(IncrementalTypeDescriptor.hasVisibilityChanged(m));
m = getMethod(changed, "publicMethod3");
Assert.assertTrue(IncrementalTypeDescriptor.hasVisibilityChanged(m));
}
}
|
[
"[email protected]"
] | |
d0597048030942b98c76494690daf7b25f267a04
|
ba26af1bfe70673303f39fb34bf83f5c08ed5905
|
/analysis/src/main/java/org/apache/calcite/rex/RexSqlConvertlet.java
|
041aa59c853721365027834833b511a3d07859a1
|
[
"MIT"
] |
permissive
|
GinPonson/Quicksql
|
5a4a6671e87b3278e2d77eee497a4910ac340617
|
e31f65fb96ea2f2c373ba3acc43473a48dca10d1
|
refs/heads/master
| 2020-07-30T06:23:41.805009
| 2019-09-22T08:50:18
| 2019-09-22T08:50:18
| 210,116,844
| 0
| 0
|
MIT
| 2019-09-22T08:48:23
| 2019-09-22T08:48:23
| null |
UTF-8
|
Java
| false
| false
| 1,455
|
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.calcite.rex;
import org.apache.calcite.sql.SqlNode;
/**
* Converts a {@link RexNode} expression into a {@link SqlNode} expression.
*/
public interface RexSqlConvertlet {
//~ Methods ----------------------------------------------------------------
/**
* Converts a {@link RexCall} to a {@link SqlNode} expression.
*
* @param converter to use in translating
* @param call RexCall to translate
* @return SqlNode, or null if translation was unavailable
*/
SqlNode convertCall(
RexToSqlNodeConverter converter,
RexCall call);
}
// End RexSqlConvertlet.java
|
[
"[email protected]"
] | |
20707c2cb7898a1a10c3d10ec00004081cbe5d8a
|
70123d8b25800e4a1743626822eb651c38513cd7
|
/web/OfficeSuite/src/java/com/rift/coad/office/client/IconConstants.java
|
5225068e1fa296101f9a16e38b935b9250f11f67
|
[] |
no_license
|
brettchaldecott/dipforge
|
bb9205cddaba60d61ab7f65b58c22a058264b698
|
ca2fe194156754d142fc48fdb8b963f37aa7c6a3
|
refs/heads/master
| 2021-03-19T12:14:25.926735
| 2016-01-22T12:06:22
| 2016-01-22T12:06:22
| 1,043,676
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,230
|
java
|
/*
* OfficeSuite: The office suite for coadunation.
* Copyright (C) 2010 2015 Burntjam
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* IconConstants.java
*/
// package path
package com.rift.coad.office.client;
/**
* This class contants the constants
*
* @author brett chaldecott
*/
public class IconConstants {
/**
* The documents share
*/
public final static String DOCUMENTS = "folder.png";
/**
* The email icon
*/
public final static String EMAIL = "internet-mail.png";
}
|
[
"[email protected]"
] | |
0ed173529ff28cd24738eb51811c482c457fc2e3
|
bfe555829c44521696bab62ebc5e374698f74cfe
|
/webapi-sponge/src/main/java/valandur/webapi/serialize/view/data/PoweredDataView.java
|
4ed8a3dea80c1349436ac867e386d798f4b7a846
|
[
"MIT"
] |
permissive
|
jxsd1234a/Web-API
|
464b38a909d2349d7ac1a655d3f93861f3c4334c
|
8ec9e41e58b6655adfd1343069dccc3feb1469c4
|
refs/heads/master
| 2022-11-10T14:53:37.403195
| 2020-07-01T02:51:40
| 2020-07-01T02:51:40
| 267,387,574
| 0
| 0
|
MIT
| 2020-05-27T17:46:23
| 2020-05-27T17:46:22
| null |
UTF-8
|
Java
| false
| false
| 446
|
java
|
package valandur.webapi.serialize.view.data;
import com.fasterxml.jackson.annotation.JsonValue;
import org.spongepowered.api.data.manipulator.mutable.block.PoweredData;
import valandur.webapi.serialize.BaseView;
public class PoweredDataView extends BaseView<PoweredData> {
@JsonValue
public boolean powered;
public PoweredDataView(PoweredData value) {
super(value);
this.powered = value.powered().get();
}
}
|
[
"[email protected]"
] | |
930e3dedd9738916b47fe26f8297acc7de72f249
|
0f0603535d370ee0377a27f04f2735a4e305e88f
|
/HackerRank_Questions/SubarrayWithLargestSum.java
|
7dd7f059e802c4d2c97c5d4b3b40b1487593d68a
|
[] |
no_license
|
ishu2/DS-and-Algorithms
|
a35f6983222f15c3273328bf74bfe79ff3261b96
|
3b400915ed011144e8d577e95a485e0a23f1e90c
|
refs/heads/master
| 2022-01-16T11:08:51.979218
| 2017-10-10T06:26:34
| 2017-10-10T06:26:34
| 106,179,778
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 897
|
java
|
// KADANE'S ALGORITHM
package HackerRank_Questions;
public class SubarrayWithLargestSum {
public static int maxSubarraySum(int[] arr)
{
if(arr.length==0)
{
return 0;
}
if(arr.length==1)
{
return arr[0];
}
int sum=arr[0];
int end=arr[0];
for(int i=1;i<arr.length;i++)
{
sum=sum+arr[i];
if(sum>=end)
{
end=sum;
}
if(sum<=0)
{
sum=0;
}
}
return end;
}
public static int maxSubarraySumUsingDP(int[] arr)
{
if(arr.length==0)
{
return 0;
}
if(arr.length==1)
{
return arr[0];
}
int res=arr[0];
int finalRes=arr[0];
int i=0;
while(i<arr.length)
{
res=Math.max(arr[i], res+arr[i]);
finalRes=Math.max(res, finalRes);
i++;
}
return finalRes;
}
public static void main(String[] args) {
int[] arr={-20,-3,-10,-50,-40,-9};
int res=maxSubarraySumUsingDP(arr);
System.out.println(res);
}
}
|
[
"[email protected]"
] | |
ea8c10555e24c4aca0d52172022727824c89aa63
|
cfc60fc1148916c0a1c9b421543e02f8cdf31549
|
/src/testcases/CWE617_Reachable_Assertion/CWE617_Reachable_Assertion__connect_tcp_54a.java
|
700a727d7a265a3d8ca061e7c1022267dffe9e33
|
[
"LicenseRef-scancode-public-domain"
] |
permissive
|
zhujinhua/GitFun
|
c77c8c08e89e61006f7bdbc5dd175e5d8bce8bd2
|
987f72fdccf871ece67f2240eea90e8c1971d183
|
refs/heads/master
| 2021-01-18T05:46:03.351267
| 2012-09-11T16:43:44
| 2012-09-11T16:43:44
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,685
|
java
|
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE617_Reachable_Assertion__connect_tcp_54a.java
Label Definition File: CWE617_Reachable_Assertion.label.xml
Template File: sources-sink-54a.tmpl.java
*/
/*
* @description
* CWE: 617 Assertion is reachable
* BadSource: connect_tcp Read data using an outbound tcp connection
* GoodSource: A hardcoded string
* Sinks:
* BadSink : possibility of assertion being triggered
* Flow Variant: 54 Data flow: data passed as an argument from one method through three others to a fifth; all five functions are in different classes in the same package
*
* */
package testcases.CWE617_Reachable_Assertion;
import testcasesupport.*;
import javax.servlet.http.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.net.Socket;
import java.util.logging.Logger;
public class CWE617_Reachable_Assertion__connect_tcp_54a extends AbstractTestCase
{
public void bad() throws Throwable
{
String data;
Logger log_bad = Logger.getLogger("local-logger");
data = ""; /* init data */
Socket sock = null;
BufferedReader buffread = null;
InputStreamReader instrread = null;
try {
/* Read data using an outbound tcp connection */
sock = new Socket("host.example.org", 39544);
/* read input from socket */
instrread = new InputStreamReader(sock.getInputStream());
buffread = new BufferedReader(instrread);
data = buffread.readLine();
}
catch( IOException ioe )
{
log_bad.warning("Error with stream reading");
}
finally {
/* clean up stream reading objects */
try {
if( buffread != null )
{
buffread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing buffread");
}
finally {
try {
if( instrread != null )
{
instrread.close();
}
}
catch( IOException ioe )
{
log_bad.warning("Error closing instrread");
}
}
/* clean up socket objects */
try {
if( sock != null )
{
sock.close();
}
}
catch( IOException e )
{
log_bad.warning("Error closing sock");
}
}
(new CWE617_Reachable_Assertion__connect_tcp_54b()).bad_sink(data );
}
public void good() throws Throwable
{
goodG2B();
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B() throws Throwable
{
String data;
java.util.logging.Logger log_good = java.util.logging.Logger.getLogger("local-logger");
/* FIX: Use a hardcoded string */
data = "foo";
(new CWE617_Reachable_Assertion__connect_tcp_54b()).goodG2B_sink(data );
}
/* Below is the main(). It is only used when building this testcase on
its own for testing or for building a binary to use in testing binary
analysis tools. It is not used when compiling all the testcases as one
application, which is how source code analysis tools are tested. */
public static void main(String[] args) throws ClassNotFoundException,
InstantiationException, IllegalAccessException
{
mainFromParent(args);
}
}
|
[
"[email protected]"
] | |
4bb5f65a54f56e46a379f341e9554ce19c375d37
|
71cbe971466caf20ef665f690bac9037ad4afae4
|
/sla-core/sla-tools/src/main/java/eu/atos/sla/parser/data/Penalty.java
|
915030621742d57c7baf87f5e91d56a8015e024f
|
[
"Apache-2.0"
] |
permissive
|
angelolencina/ops.Sla-framework
|
333a2292a8c858440d8109fcf2e2b7e2e50b50a7
|
776663401292c603fab4287f47998ea65d2a31eb
|
refs/heads/master
| 2023-08-13T13:39:09.538978
| 2016-05-05T12:09:36
| 2016-05-05T12:09:36
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,831
|
java
|
package eu.atos.sla.parser.data;
import java.util.Date;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import eu.atos.sla.datamodel.ICompensation.IPenalty;
import eu.atos.sla.datamodel.ICompensationDefinition.IPenaltyDefinition;
import eu.atos.sla.parser.DateTimeDeserializerJSON;
import eu.atos.sla.parser.DateTimeSerializerJSON;
/**
* A POJO Object that stores all the information from a Penalty
*
* @author rsosa
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "penalty")
public class Penalty {
@XmlElement(name = "uuid")
private String uuid;
@XmlElement(name = "agreement_id")
private String agreementId;
@JsonSerialize(using=DateTimeSerializerJSON.class)
@JsonDeserialize(using=DateTimeDeserializerJSON.class)
@XmlElement(name = "datetime")
private Date datetime;
@XmlElement(name = "definition")
private eu.atos.sla.parser.data.wsag.custom.Penalty definition;
public Penalty() {
}
public Penalty(IPenalty penalty) {
this.uuid = penalty.getUuid();
this.agreementId = penalty.getAgreementId();
this.datetime = penalty.getDatetime();
IPenaltyDefinition def = penalty.getDefinition();
this.definition = new eu.atos.sla.parser.data.wsag.custom.Penalty(
def.getAction(), def.getValueExpression(), def.getValueUnit(), def.getValidity());
}
public String getUuid() {
return uuid;
}
public String getAgreementId() {
return agreementId;
}
public Date getDatetime() {
return datetime;
}
public eu.atos.sla.parser.data.wsag.custom.Penalty getDefinition() {
return definition;
}
}
|
[
"[email protected]"
] | |
4f743cfac04c8c88086966b55dd44417e70d46f7
|
23ec52180e445c39a0b357d5b3a99154ba681ed7
|
/DesignPatternJava/src/main/java/BehavioralPatterns/Command/sample1/Barbecuer.java
|
cb5bc894a2a325c5fc01fbb1ff55252ef18e4e9a
|
[] |
no_license
|
pisces312/MyJavaProjects
|
1408c5f33f1f39fc3929ebe34d39b6bcd6a5d166
|
0529ba813350e710d8aaca2d89c453570b244a64
|
refs/heads/master
| 2021-01-18T03:59:42.190929
| 2017-12-16T15:58:13
| 2017-12-16T15:58:13
| 84,271,420
| 0
| 0
| null | null | null | null |
GB18030
|
Java
| false
| false
| 410
|
java
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package BehavioralPatterns.Command.sample1;
/**
*接收者,实现所有命令的具体动作
* @author pisces312
*/
public class Barbecuer {
public void bakeMutton(){
System.out.println("烤羊肉");
}
public void bakeChickenWing(){
System.out.println("烤鸡翅");
}
}
|
[
"[email protected]"
] | |
f6d697f04bc756204d64a90c7777e26f6a0e481c
|
c056742be2f8db76303c0bd30be76b6a00fe96b7
|
/lang_interface/java/com/intel/daal/algorithms/decision_forest/regression/training/TrainingMethod.java
|
775572bd82a00b41d83b5e16ea58b50ebe8535fb
|
[
"Intel",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer",
"BSD-2-Clause",
"MIT",
"Zlib",
"LicenseRef-scancode-unknown-license-reference"
] |
permissive
|
Vika-F/daal
|
232de182ea4304ac49f9637efad09b4e08545ceb
|
53076ea8fa9e64edc7440f989f8e150ec21e83d5
|
refs/heads/master
| 2023-08-22T07:14:46.157341
| 2020-03-13T09:28:48
| 2020-03-13T09:28:48
| 224,593,020
| 1
| 0
|
Apache-2.0
| 2023-09-13T09:54:30
| 2019-11-28T07:19:00
|
C++
|
UTF-8
|
Java
| false
| false
| 1,956
|
java
|
/* file: TrainingMethod.java */
/*******************************************************************************
* Copyright 2014-2020 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
/**
* @defgroup decision_forest_regression_training Training
* @brief Contains classes for decision forest regression models training
* @ingroup decision_forest_regression
* @{
*/
package com.intel.daal.algorithms.decision_forest.regression.training;
/**
* <a name="DAAL-CLASS-ALGORITHMS__DECISION_FOREST__REGRESSION__TRAINING__TRAININGMETHOD"></a>
* @brief Available methods for training decision forest regression models
*/
public final class TrainingMethod {
private int _value;
/**
* Constructs the training method object using the provided value
* @param value Value corresponding to the training method object
*/
public TrainingMethod(int value) {
_value = value;
}
/**
* Returns the value corresponding to the training method object
* @return Value corresponding to the training method object
*/
public int getValue() {
return _value;
}
private static final int defaultDenseId = 0;
/** Default method. Bagging, random choice of features, variance-based impurity. */
public static final TrainingMethod defaultDense = new TrainingMethod(defaultDenseId);
}
/** @} */
|
[
"[email protected]"
] | |
88a037321c0b6d162c66e5ef63d8113c06cf222a
|
b111b77f2729c030ce78096ea2273691b9b63749
|
/oreilly-gradle-book-examples/testing-junitforkedthreads/src/test/java/org/gradle/example/simple/TestPerson110.java
|
0cd96c446df610144942eed421cb3cbdeedc4587
|
[] |
no_license
|
WeilerWebServices/Gradle
|
a1a55bdb0dd39240787adf9241289e52f593ccc1
|
6ab6192439f891256a10d9b60f3073cab110b2be
|
refs/heads/master
| 2023-01-19T16:48:09.415529
| 2020-11-28T13:28:40
| 2020-11-28T13:28:40
| 256,249,773
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 518
|
java
|
package org.gradle.example.simple;
import org.gradle.example.simple.Person;
import org.junit.Test;
import static org.junit.Assert.*;
public class TestPerson110 {
@Test
public void testPerson() {
Person p = new Person();
p.setAge(20);
p.setName("Fird Birfle");
p.setSalary(195750.22);
assertEquals(215325.242, p.calculateBonus(), 0.01);
assertEquals("The Honorable Fird Birfle", p.becomeJudge());
assertEquals(30, p.timeWarp());
p.wasteTime();
}
}
|
[
"[email protected]"
] | |
3027d4d5ad6d562aebe8fefbf6bf1d064ad63c6c
|
501989f313f923b069c9c1b06a507463ab946e2b
|
/src/com/jspgou/cms/manager/impl/AdvertiseMngImpl.java
|
a5d08b3171365dac256055de6fca00908d452541
|
[] |
no_license
|
xrogzu/shop
|
fded93f9dbc801ff983362fc10d33ad7a8c07fad
|
17568c709f64323e2b0dce06f4bc3d600a8157f8
|
refs/heads/master
| 2021-04-12T08:48:48.082699
| 2017-07-24T06:11:52
| 2017-07-24T06:16:10
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,607
|
java
|
package com.jspgou.cms.manager.impl;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.jspgou.common.hibernate3.Updater;
import com.jspgou.common.page.Pagination;
import com.jspgou.cms.dao.AdvertiseDao;
import com.jspgou.cms.entity.Advertise;
import com.jspgou.cms.manager.AdspaceMng;
import com.jspgou.cms.manager.AdvertiseMng;
/**
* This class should preserve.
* @preserve
*/
@Service
@Transactional
public class AdvertiseMngImpl implements AdvertiseMng {
@Override
@Transactional(readOnly = true)
public Pagination getPage( Integer adspaceId,
Boolean enabled, int pageNo, int pageSize) {
Pagination page = dao.getPage( adspaceId, enabled, pageNo,
pageSize);
return page;
}
@Override
@Transactional(readOnly = true)
public List<Advertise> getList(Integer adspaceId, Boolean enabled) {
return dao.getList(adspaceId, enabled);
}
@Override
@Transactional(readOnly = true)
public Advertise findById(Integer id) {
Advertise entity = dao.findById(id);
return entity;
}
@Override
public Advertise save(Advertise bean, Integer adspaceId,
Map<String, String> attr) {
bean.setAdspace(adspaceMng.findById(adspaceId));
bean.setAttr(attr);
bean.init();
dao.save(bean);
return bean;
}
@Override
public Advertise update(Advertise bean, Integer adspaceId,
Map<String, String> attr) {
Updater<Advertise> updater = new Updater<Advertise>(bean);
bean = dao.updateByUpdater(updater);
bean.setAdspace(adspaceMng.findById(adspaceId));
bean.getAttr().clear();
bean.getAttr().putAll(attr);
return bean;
}
@Override
public Advertise deleteById(Integer id) {
Advertise bean = dao.deleteById(id);
return bean;
}
@Override
public Advertise[] deleteByIds(Integer[] ids) {
Advertise[] beans = new Advertise[ids.length];
for (int i = 0, len = ids.length; i < len; i++) {
beans[i] = deleteById(ids[i]);
}
return beans;
}
@Override
public void display(Integer id) {
Advertise ad = findById(id);
if (ad != null) {
ad.setDisplayCount(ad.getDisplayCount() + 1);
}
}
@Override
public void click(Integer id) {
Advertise ad = findById(id);
if (ad != null) {
ad.setClickCount(ad.getClickCount() + 1);
}
}
private AdspaceMng adspaceMng;
private AdvertiseDao dao;
@Autowired
public void setAdspaceMng(AdspaceMng adspaceMng) {
this.adspaceMng = adspaceMng;
}
@Autowired
public void setDao(AdvertiseDao dao) {
this.dao = dao;
}
}
|
[
"[email protected]"
] | |
55fd2f2f86c807a687e9f22318f9415a4213fc91
|
6fde206c062b464929be2a53689a3ece8165e91f
|
/src/Search/DepthFirstSearch/Combination.java
|
f8c95e9eedb1a9d857bd71c7cac9654b15e08d94
|
[] |
no_license
|
cgcn/AlgorithmStudy
|
3646bc2030fbe85b1e0e22f7d75f2fe117fa38ab
|
fc225b97e85db2287f243f118b0325cf3dd6c235
|
refs/heads/master
| 2020-09-12T15:33:48.037657
| 2017-09-06T12:47:06
| 2017-09-06T12:47:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,386
|
java
|
package Search.DepthFirstSearch;
import java.util.Scanner;
/**
* Created by tlh on 2016/7/2.
* 组合算法 从n个数里取出m个数组合的算法
* 用01组合法
* 首先初始化,将数组前n个元素置1,表示第一个组合为前n个数。
* 然后从左到右扫描数组元素值的“10”组合,找到第一个“10”组合后将其变为
* “01”组合,同时将其左边的所有“1”全部移动到数组的最左端。
* 当第一个“1”移动到数组的m-n的位置,即n个“1”全部移动到最右端时,就得到了最后一个组合。
*/
public class Combination {
private int n;
private int m;
private int[] src;
//零一数组
private int[] zerones;
public Combination(int m, int n, int[] src) {
this.m = m;
this.n = n;
this.src = src;
zerones = new int[n];
for (int i = 0; i < m; i++) {
zerones[i] = 1;
}
}
public void run() {
while (true) {
outputCombination();
if (!findOneZero())
break;
}
}
private void outputCombination() {
for (int i = 0; i < n; i++) {
if (zerones[i] == 1)
System.out.print(src[i] + " ");
}
System.out.println();
}
private boolean findOneZero() {
int i;
for (i = 0; i < n - 1; i++) {
if (zerones[i] == 1 && zerones[i + 1] == 0) {
//将10组合变成01
zerones[i] = 0;
zerones[i + 1] = 1;
int ones = 0;
//将前面所有的1移到最右边
for (int j = 0; j < i; j++) {
if (zerones[j] == 1) ones++;
}
for (int j = 0; j < i; j++) {
if (j < ones)
zerones[j] = 1;
else zerones[j] = 0;
}
return true;
}
}
return false;
}
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int m = in.nextInt();
int[] src = new int[n];
for (int i = 0; i < n; i++) {
src[i] = in.nextInt();
}
Combination p = new Combination(m, n, src);
p.run();
in.close();
}
}
|
[
"[email protected]"
] | |
7c81530f6ea8d69412f92c1667791828356c8031
|
e58a8e0fb0cfc7b9a05f43e38f1d01a4d8d8cf1f
|
/MazeRunner2/src/com/puttysoftware/mazerunner2/creatures/monsters/AbstractBothRandomScalingMonster.java
|
7e4454d0b37cd382b987da886b8c8eed0fd5a337
|
[
"Unlicense"
] |
permissive
|
retropipes/older-java-games
|
777574e222f30a1dffe7936ed08c8bfeb23a21ba
|
786b0c165d800c49ab9977a34ec17286797c4589
|
refs/heads/master
| 2023-04-12T14:28:25.525259
| 2021-05-15T13:03:54
| 2021-05-15T13:03:54
| 235,693,016
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,648
|
java
|
/* MazeRunnerII: An RPG
Copyright (C) 2011-2012 Eric Ahnell
Any questions should be directed to the author via email at: [email protected]
*/
package com.puttysoftware.mazerunner2.creatures.monsters;
import com.puttysoftware.mazerunner2.creatures.StatConstants;
import com.puttysoftware.mazerunner2.creatures.party.PartyManager;
import com.puttysoftware.randomrange.RandomRange;
abstract class AbstractBothRandomScalingMonster
extends AbstractBothRandomMonster {
// Constructors
AbstractBothRandomScalingMonster() {
super();
}
@Override
public void loadMonster() {
final int newLevel = PartyManager.getParty().getPartyMeanLevel();
this.setLevel(newLevel);
this.setVitality(this.getInitialVitality());
this.setCurrentHP(this.getMaximumHP());
this.setIntelligence(this.getInitialIntelligence());
this.setCurrentMP(this.getMaximumMP());
this.setStrength(this.getInitialStrength());
this.setBlock(this.getInitialBlock());
this.setAgility(this.getInitialAgility());
this.setLuck(this.getInitialLuck());
this.setGold(this.getInitialGold());
this.setExperience((long) (this.getInitialExperience()
* this.adjustForLevelDifference()));
this.setAttacksPerRound(1);
this.setSpellsPerRound(1);
this.image = this.getInitialImage();
}
@Override
public boolean scales() {
return true;
}
private int getInitialStrength() {
final RandomRange r = new RandomRange(1,
Math.max(this.getLevel() * StatConstants.GAIN_STRENGTH, 1));
return r.generate();
}
private int getInitialBlock() {
final RandomRange r = new RandomRange(0,
this.getLevel() * StatConstants.GAIN_BLOCK);
return r.generate();
}
private long getInitialExperience() {
int minvar, maxvar;
minvar = (int) (this.getLevel()
* AbstractMonster.MINIMUM_EXPERIENCE_RANDOM_VARIANCE);
maxvar = (int) (this.getLevel()
* AbstractMonster.MAXIMUM_EXPERIENCE_RANDOM_VARIANCE);
final RandomRange r = new RandomRange(minvar, maxvar);
final long expbase = PartyManager.getParty().getPartyMaxToNextLevel();
final long factor = this.getBattlesToNextLevel();
return expbase / factor + r.generateLong();
}
private int getToughness() {
return this.getStrength() + this.getBlock() + this.getAgility()
+ this.getVitality() + this.getIntelligence() + this.getLuck();
}
private int getInitialGold() {
final int min = 0;
final int max = this.getToughness()
* AbstractMonster.GOLD_TOUGHNESS_MULTIPLIER;
final RandomRange r = new RandomRange(min, max);
return r.generate();
}
private int getInitialAgility() {
final RandomRange r = new RandomRange(1,
Math.max(this.getLevel() * StatConstants.GAIN_AGILITY, 1));
return r.generate();
}
private int getInitialVitality() {
final RandomRange r = new RandomRange(1,
Math.max(this.getLevel() * StatConstants.GAIN_VITALITY, 1));
return r.generate();
}
private int getInitialIntelligence() {
final RandomRange r = new RandomRange(0,
this.getLevel() * StatConstants.GAIN_INTELLIGENCE);
return r.generate();
}
private int getInitialLuck() {
final RandomRange r = new RandomRange(0,
this.getLevel() * StatConstants.GAIN_LUCK);
return r.generate();
}
}
|
[
"[email protected]"
] | |
afba9385d0522a888157587418abd5a25ae1770a
|
0bc20684e70d219f5deabd5010dd0b3b7e64b298
|
/oxd-wf-prototype/contrib/openclinica-module/src/org/openxdata/server/module/openclinica/ws/subjectlist/EventListType.java
|
93bd6c9440116577f37d769a2b648cdfbca2ccd4
|
[] |
no_license
|
mclabs/moveitserver
|
ee42aedfacf8bd563282378e82764e390c4b7109
|
6a49c6c8af95726f91e2826980234be25877187c
|
refs/heads/master
| 2021-01-18T14:09:35.961082
| 2012-03-12T14:15:50
| 2012-03-12T14:15:50
| 2,011,756
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,144
|
java
|
package org.openxdata.server.module.openclinica.ws.subjectlist;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.AccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import org.openxdata.server.module.openclinica.ws.subjectlist.EventListType;
import org.openxdata.server.module.openclinica.ws.subjectlist.StudyEventType;
/**
* <p>Java class for eventListType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="eventListType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="event" type="{http://openclinica.org/ws/listbeans}studyEventType" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(AccessType.FIELD)
@XmlType(name = "eventListType", propOrder = {
"event"
})
public class EventListType {
@XmlElement(namespace = "http://openclinica.org/ws/listbeans")
protected List<StudyEventType> event;
/**
* Gets the value of the event property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the event property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getEvent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link StudyEventType }
*
*
*/
public List<StudyEventType> getEvent() {
if (event == null) {
event = new ArrayList<StudyEventType>();
}
return this.event;
}
}
|
[
"[email protected]"
] | |
104b7ab6a02ced3437503afc49054758c215d04f
|
bba1b40129c217ca16baac1e234dcc936161f695
|
/src/main/java/com/bc/mall/server/Application.java
|
3f238343353a3396b4a539132d40d3e05989798f
|
[] |
no_license
|
BooksCup/mall-server
|
e3b30906ba860f8066905a68dbedc1c801c7e2bb
|
57b842463323647c0f7b4bfe510888ada3d8170e
|
refs/heads/master
| 2023-01-29T13:23:09.915822
| 2020-12-08T06:01:23
| 2020-12-08T06:01:23
| 298,232,433
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,085
|
java
|
package com.bc.mall.server;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory;
import org.springframework.context.annotation.Bean;
/**
* 启动类
* git test
*
* @author zhou
*/
@SpringBootApplication
@MapperScan("com.bc.mall.server.mapper")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
public ConfigurableServletWebServerFactory webServerFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
factory.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> connector.setProperty("relaxedQueryChars", "|{}[]\\"));
return factory;
}
}
|
[
"[email protected]"
] | |
bb7569045c9b5db78b6dfcbfa8ce1a52314e394c
|
d233678455207a90bffc1ca4ef5df96fce9f6edc
|
/fengmangbilu-microservices/fengmangbilu-microservice-oa/src/main/java/com/fengmangbilu/microservice/oa/utils/ExportExcelUtils.java
|
f55b7325b0ea6a2e2f635c409479028151f36882
|
[] |
no_license
|
sunliang123/springboot-springcloud
|
09df49fca50c2789c8e39df6eaabc60574aa6e02
|
fc155ae875baf3c4ab0763d9b9996aff6bb1afde
|
refs/heads/master
| 2020-03-18T05:29:05.308442
| 2018-05-22T02:09:21
| 2018-05-22T02:09:21
| 134,344,861
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,963
|
java
|
package com.fengmangbilu.microservice.oa.utils;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.FillPatternType;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.VerticalAlignment;
public class ExportExcelUtils {
public static void exportExcel(HttpServletRequest request, HttpServletResponse response, String fileName, ExcelData data)
throws Exception {
String userAgent = request.getHeader("User-Agent");
if (userAgent.contains("MSIE") || userAgent.contains("Trident")) {
fileName = URLEncoder.encode(fileName, "UTF-8");
} else {
fileName = new String(fileName.getBytes("GBK"), "ISO-8859-1");
}
response.setCharacterEncoding("UTF-8");
response.setHeader("Content-Type", "application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + fileName + ".xls");
exportExcel(data, response.getOutputStream());
}
public static void exportExcel(ExcelData data, OutputStream out) throws Exception {
HSSFWorkbook wb = new HSSFWorkbook();
try {
String sheetName = data.getName();
if (null == sheetName) {
sheetName = "Sheet1";
}
HSSFSheet sheet = wb.createSheet(sheetName);
writeExcel(wb, sheet, data);
wb.write(out);
} finally {
wb.close();
}
}
private static void writeExcel(HSSFWorkbook wb, HSSFSheet sheet, ExcelData data) {
int rowIndex = 0;
rowIndex = writeTitlesToExcel(wb, sheet, data.getTitles());
writeRowsToExcel(wb, sheet, data.getRows(), rowIndex);
autoSizeColumns(sheet, data.getTitles().size() + 1);
}
private static int writeTitlesToExcel(HSSFWorkbook wb, HSSFSheet sheet, List<String> titles) {
int rowIndex = 0;
int colIndex = 0;
Font titleFont = wb.createFont();
titleFont.setFontName("simsun");
titleFont.setBold(true);
// titleFont.setFontHeightInPoints((short) 14);
titleFont.setColor(IndexedColors.BLACK.index);
HSSFCellStyle titleStyle = wb.createCellStyle();
titleStyle.setAlignment(HorizontalAlignment.CENTER);
titleStyle.setVerticalAlignment(VerticalAlignment.CENTER);
titleStyle.setFillForegroundColor(HSSFColor.GREY_25_PERCENT.index);
titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
titleStyle.setFont(titleFont);
setBorder(titleStyle, BorderStyle.THIN, HSSFColor.BLACK.index);
Row titleRow = sheet.createRow(rowIndex);
// titleRow.setHeightInPoints(25);
colIndex = 0;
for (String field : titles) {
Cell cell = titleRow.createCell(colIndex);
cell.setCellValue(field);
cell.setCellStyle(titleStyle);
colIndex++;
}
rowIndex++;
return rowIndex;
}
private static int writeRowsToExcel(HSSFWorkbook wb, HSSFSheet sheet, List<List<Object>> rows, int rowIndex) {
int colIndex = 0;
Font dataFont = wb.createFont();
dataFont.setFontName("simsun");
// dataFont.setFontHeightInPoints((short) 14);
dataFont.setColor(IndexedColors.BLACK.index);
HSSFCellStyle dataStyle = wb.createCellStyle();
dataStyle.setAlignment(HorizontalAlignment.CENTER);
dataStyle.setVerticalAlignment(VerticalAlignment.CENTER);
dataStyle.setFont(dataFont);
setBorder(dataStyle, BorderStyle.THIN, HSSFColor.BLACK.index);
for (List<Object> rowData : rows) {
Row dataRow = sheet.createRow(rowIndex);
// dataRow.setHeightInPoints(25);
colIndex = 0;
for (Object cellData : rowData) {
Cell cell = dataRow.createCell(colIndex);
if (cellData != null) {
cell.setCellValue(cellData.toString());
} else {
cell.setCellValue("");
}
cell.setCellStyle(dataStyle);
colIndex++;
}
rowIndex++;
}
return rowIndex;
}
private static void autoSizeColumns(Sheet sheet, int columnNumber) {
for (int i = 0; i < columnNumber; i++) {
int orgWidth = sheet.getColumnWidth(i);
sheet.autoSizeColumn(i, true);
int newWidth = (int) (sheet.getColumnWidth(i) + 100);
if (newWidth > orgWidth) {
sheet.setColumnWidth(i, newWidth);
} else {
sheet.setColumnWidth(i, orgWidth);
}
}
}
private static void setBorder(HSSFCellStyle style, BorderStyle border, short color) {
style.setBorderTop(border);
style.setBorderLeft(border);
style.setBorderRight(border);
style.setBorderBottom(border);
style.setTopBorderColor(color);
style.setRightBorderColor(color);
style.setLeftBorderColor(color);
style.setBottomBorderColor(color);
}
}
|
[
"[email protected]"
] | |
f7fdef684918e2f7337dcc6aefa1ea1cedd5c936
|
3e355a798304584431e5e5a1f1bc141e16c330fc
|
/AL-Game/data/scripts/system/handlers/quest/daevation/_80291DurableDaevanionWeapon.java
|
2bdecc310f78b7f82a5934429780bb158fde5ceb
|
[] |
no_license
|
webdes27/Aion-Lightning-4.6-SRC
|
db0b2b547addc368b7d5e3af6c95051be1df8d69
|
8899ce60aae266b849a19c3f93f47be9485c70ab
|
refs/heads/master
| 2021-09-14T19:16:29.368197
| 2018-02-27T16:05:28
| 2018-02-27T16:05:28
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,095
|
java
|
/**
* This file is part of Aion-Lightning <aion-lightning.org>.
*
* Aion-Lightning is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Aion-Lightning is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. *
* You should have received a copy of the GNU General Public License
* along with Aion-Lightning.
* If not, see <http://www.gnu.org/licenses/>.
*/
package quest.daevation;
import com.aionemu.gameserver.model.DialogAction;
import com.aionemu.gameserver.model.gameobjects.Npc;
import com.aionemu.gameserver.model.gameobjects.player.Player;
import com.aionemu.gameserver.questEngine.handlers.QuestHandler;
import com.aionemu.gameserver.questEngine.model.QuestEnv;
import com.aionemu.gameserver.questEngine.model.QuestState;
import com.aionemu.gameserver.questEngine.model.QuestStatus;
/**
* @author Romanz
*/
public class _80291DurableDaevanionWeapon extends QuestHandler {
private final static int questId = 80291;
public _80291DurableDaevanionWeapon() {
super(questId);
}
@Override
public void register() {
qe.registerQuestNpc(831384).addOnQuestStart(questId);
qe.registerQuestNpc(831384).addOnTalkEvent(questId);
}
@Override
public boolean onDialogEvent(QuestEnv env) {
final Player player = env.getPlayer();
int targetId = 0;
if (env.getVisibleObject() instanceof Npc) {
targetId = ((Npc) env.getVisibleObject()).getNpcId();
}
QuestState qs = player.getQuestStateList().getQuestState(questId);
if (qs == null || qs.getStatus() == QuestStatus.NONE) {
if (targetId == 831384) {
if (env.getDialog() == DialogAction.QUEST_SELECT) {
int plate = player.getEquipment().itemSetPartsEquipped(299);
int chain = player.getEquipment().itemSetPartsEquipped(298);
int leather = player.getEquipment().itemSetPartsEquipped(297);
int cloth = player.getEquipment().itemSetPartsEquipped(296);
int gunner = player.getEquipment().itemSetPartsEquipped(371);
if (plate != 5 && chain != 5 && leather != 5 && cloth != 5 && gunner != 5) {
return sendQuestDialog(env, 1003);
} else {
return sendQuestDialog(env, 4762);
}
} else {
return sendQuestStartDialog(env);
}
}
}
if (qs == null) {
return false;
}
<<<<<<< .mine
int var = qs.getQuestVarById(0);
int var1 = qs.getQuestVarById(1);
=======
int var = qs.getQuestVarById(0);
qs.getQuestVarById(1);
>>>>>>> .r274
if (qs.getStatus() == QuestStatus.START) {
if (targetId == 831384) {
switch (env.getDialog()) {
case QUEST_SELECT:
if (var == 0) {
return sendQuestDialog(env, 1011);
}
case CHECK_USER_HAS_QUEST_ITEM:
if (var == 0) {
return checkQuestItems(env, 0, 1, true, 5, 0);
}
break;
case SELECT_ACTION_1352:
if (var == 0) {
return sendQuestDialog(env, 1352);
}
}
}
return false;
} else if (qs.getStatus() == QuestStatus.REWARD) {
if (targetId == 831384) {
return sendQuestEndDialog(env);
}
return false;
}
return false;
}
}
|
[
"[email protected]"
] | |
a4d8ac3728e561636fe816cc243086581b9fcdb0
|
a58dade8ddc2f0e5b650c6202e381bd72c81741c
|
/Auxiliary/RecipeManagers/CastingRecipes/Tiles/CropSpeedPlantRecipe.java
|
f9842dde6cd1ad7830d631a425a8bb794ff1c501
|
[] |
no_license
|
neconeco2/ChromatiCraft
|
e784be93dfa747ae9ccc67d2794e4157b8c3e600
|
90c8eefaf420c0949b7653dd83dccc75a37a849f
|
refs/heads/master
| 2020-12-30T11:51:55.379965
| 2017-05-27T20:03:33
| 2017-05-27T20:03:33
| 91,535,969
| 0
| 0
| null | 2017-05-17T05:11:52
| 2017-05-17T05:11:52
| null |
UTF-8
|
Java
| false
| false
| 1,032
|
java
|
/*******************************************************************************
* @author Reika Kalseki
*
* Copyright 2016
*
* All rights reserved.
* Distribution of the software in any form is only allowed with
* explicit, prior permission from the owner.
******************************************************************************/
package Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipes.Tiles;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import Reika.ChromatiCraft.Auxiliary.RecipeManagers.CastingRecipe.TempleCastingRecipe;
import Reika.ChromatiCraft.Registry.CrystalElement;
public class CropSpeedPlantRecipe extends TempleCastingRecipe {
public CropSpeedPlantRecipe(ItemStack out, IRecipe recipe) {
super(out, recipe);
this.addRune(CrystalElement.LIGHTBLUE, 2, -1, -4);
this.addRune(CrystalElement.GREEN, 2, -1, -5);
}
@Override
public int getNumberProduced() {
return 1;
}
@Override
public int getTypicalCraftedAmount() {
return 64;
}
}
|
[
"[email protected]"
] | |
ec8a3a6e35af3269f1679aa39b4467bbe9bacdc2
|
fe06f97c2cf33a8b4acb7cb324b79a6cb6bb9dac
|
/java/dao/impl/EHU_SACT/Def$PropagatorDAOImpl.java
|
571a811d55e58a7988c5742dc70a1c339dff06a7
|
[] |
no_license
|
HeimlichLin/TableSchema
|
3f67dae0b5b169ee3a1b34837ea9a2d34265f175
|
64b66a2968c3a169b75d70d9e5cf75fa3bb65354
|
refs/heads/master
| 2023-02-11T09:42:47.210289
| 2023-02-01T02:58:44
| 2023-02-01T02:58:44
| 196,526,843
| 0
| 0
| null | 2022-06-29T18:53:55
| 2019-07-12T07:03:58
|
Java
|
UTF-8
|
Java
| false
| false
| 1,738
|
java
|
package com.doc.common.dao.impl;
public class Def$PropagatorDAOImpl extends GeneralDAOImpl<Def$PropagatorPo> implements IDef$PropagatorDAO {
public static final Def$PropagatorDAOImpl INSTANCE = new Def$PropagatorDAOImpl();
public static final String TABLENAME = "DEF$_PROPAGATOR";
public Def$PropagatorDAOImpl() {
super(TABLENAME);
}
protected static final MapConverter<Def$PropagatorPo> CONVERTER = new MapConverter<Def$PropagatorPo>() {
@Override
public Def$PropagatorPo convert(final DataObject dataObject) {
final Def$PropagatorPo def$PropagatorPo = new Def$PropagatorPo();
def$PropagatorPo.setUserid(BigDecimalUtils.formObj(dataObject.getValue(Def$PropagatorPo.COLUMNS.USERID.name())));
def$PropagatorPo.setUsername(dataObject.getString(Def$PropagatorPo.COLUMNS.USERNAME.name()));
def$PropagatorPo.setCreated(TimestampUtils.of(dataObject.getValue(Def$PropagatorPo.COLUMNS.CREATED.name())));
return def$PropagatorPo;
}
@Override
public DataObject toDataObject(final Def$PropagatorPo def$PropagatorPo) {
final DataObject dataObject = new DataObject();
dataObject.setValue(Def$PropagatorPo.COLUMNS.USERID.name(), def$PropagatorPo.getUserid());
dataObject.setValue(Def$PropagatorPo.COLUMNS.USERNAME.name(), def$PropagatorPo.getUsername());
dataObject.setValue(Def$PropagatorPo.COLUMNS.CREATED.name(), def$PropagatorPo.getCreated());
return dataObject;
}
};
public MapConverter<Def$PropagatorPo> getConverter() {
return CONVERTER;
}
@Override
public SqlWhere getPkSqlWhere(Def$PropagatorPo po) {
SqlWhere sqlWhere = new SqlWhere();
sqlWhere.add(Def$PropagatorPo.COLUMNS.USERID.name(), po.getUserid());
return sqlWhere;
}
}
|
[
"[email protected]"
] | |
2c513014e3fa873129089c4e0c43998358504981
|
ad6434dc113e22e64f0709c95099babe6b2cc854
|
/src/ConcatenatedWords/ConcatenatedWords.java
|
a91c2de1a90740ce1b04e3416f3ba5b4306f796c
|
[] |
no_license
|
shiyanch/Leetcode_Java
|
f8b7807fbbc0174d45127b65b7b48d836887983c
|
20df421f44b1907af6528578baf53efddfee48b1
|
refs/heads/master
| 2023-05-28T00:40:30.569992
| 2023-05-17T03:51:34
| 2023-05-17T03:51:34
| 48,945,641
| 9
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,473
|
java
|
package ConcatenatedWords;
import java.util.*;
/**
* 472. Concatenated Words
*
* Given a list of words (without duplicates),
* please write a program that returns all concatenated words in the given list of words.
*
* A concatenated word is defined as a string that is comprised
* entirely of at least two shorter words in the given array.
*/
public class ConcatenatedWords {
public List<String> findAllConcatenatedWordsInADict(String[] words) {
List<String> res = new ArrayList<>();
Set<String> preWords = new HashSet<>();
Arrays.sort(words, new Comparator<String>() {
@Override
public int compare(String s1, String s2) {
return s1.length() - s2.length();
}
});
for (int i=0; i<words.length; i++) {
if (canFrom(words[i], preWords)) {
res.add(words[i]);
}
preWords.add(words[i]);
}
return res;
}
private boolean canFrom(String word, Set<String> dict) {
if (dict.isEmpty()) {
return false;
}
boolean[] dp = new boolean[word.length()+1];
dp[0] = true;
for (int i=1; i<=word.length(); i++) {
for (int j=0; j<i; j++) {
dp[i] = dp[j] && dict.contains(word.substring(j,i));
if (dp[i]) {
break;
}
}
}
return dp[word.length()];
}
}
|
[
"[email protected]"
] | |
b6e4263258782d9d5d47b2fd96792fe2b186690c
|
0af8b92686a58eb0b64e319b22411432aca7a8f3
|
/large-multiproject/project47/src/main/java/org/gradle/test/performance47_2/Production47_158.java
|
189358fc9c627ef1250f401905dc3268e76edd96
|
[] |
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.performance47_2;
public class Production47_158 extends org.gradle.test.performance14_2.Production14_158 {
private final String property;
public Production47_158() {
this.property = "foo";
}
public String getProperty() {
return property;
}
}
|
[
"[email protected]"
] | |
e5e7812698f0712349d5d1e9f34dd149b05057a4
|
98bfbb9c0d0dc614eb624b69e7e17f67fced0933
|
/proposals/system-test/sample-apps/everything-app/src/test/java/org/eclipse/microprofile/system/test/app/BasicJAXRSServiceTest.java
|
44c831a3e74c01442465109f5b08b478b359d3ee
|
[
"Apache-2.0",
"LicenseRef-scancode-generic-cla"
] |
permissive
|
eclipse/microprofile-sandbox
|
f3ac9cdb3814f049526eba6af2ecef5a29c0eb42
|
6ff385401d3e804824fd77df0e2febcebdcf5ad7
|
refs/heads/main
| 2023-09-06T08:39:36.302945
| 2023-07-13T13:42:02
| 2023-07-13T13:42:02
| 93,201,544
| 43
| 47
|
Apache-2.0
| 2023-07-06T14:25:17
| 2017-06-02T20:30:35
|
Java
|
UTF-8
|
Java
| false
| false
| 4,459
|
java
|
/*
* Copyright (c) 2019 IBM Corporation and others
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* 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.eclipse.microprofile.system.test.app;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Collection;
import javax.inject.Inject;
import javax.ws.rs.BadRequestException;
import javax.ws.rs.NotFoundException;
import org.eclipse.microprofile.system.test.jupiter.MicroProfileTest;
import org.eclipse.microprofile.system.test.jupiter.SharedContainerConfig;
import org.junit.jupiter.api.Test;
@MicroProfileTest
@SharedContainerConfig(AppContainerConfig.class)
public class BasicJAXRSServiceTest {
@Inject
public static PersonService personSvc;
@Test
public void testCreatePerson() {
Long createId = personSvc.createPerson("Hank", 42);
assertNotNull(createId);
}
@Test
public void testMinSizeName() {
Long minSizeNameId = personSvc.createPerson("Ha", 42);
assertEquals(new Person("Ha", 42, minSizeNameId),
personSvc.getPerson(minSizeNameId));
}
@Test
public void testMinAge() {
Long minAgeId = personSvc.createPerson("Newborn", 0);
assertEquals(new Person("Newborn", 0, minAgeId),
personSvc.getPerson(minAgeId));
}
@Test
public void testGetPerson() {
Long bobId = personSvc.createPerson("Bob", 24);
Person bob = personSvc.getPerson(bobId);
assertEquals("Bob", bob.name);
assertEquals(24, bob.age);
assertNotNull(bob.id);
}
@Test
public void testGetAllPeople() {
Long person1Id = personSvc.createPerson("Person1", 1);
Long person2Id = personSvc.createPerson("Person2", 2);
Person expected1 = new Person("Person1", 1, person1Id);
Person expected2 = new Person("Person2", 2, person2Id);
Collection<Person> allPeople = personSvc.getAllPeople();
assertTrue("Expected at least 2 people to be registered, but there were only: " + allPeople,
allPeople.size() >= 2);
assertTrue("Did not find person " + expected1 + " in all people: " + allPeople,
allPeople.contains(expected1));
assertTrue("Did not find person " + expected2 + " in all people: " + allPeople,
allPeople.contains(expected2));
}
@Test
public void testUpdateAge() {
Long personId = personSvc.createPerson("newAgePerson", 1);
Person originalPerson = personSvc.getPerson(personId);
assertEquals("newAgePerson", originalPerson.name);
assertEquals(1, originalPerson.age);
assertEquals(personId, Long.valueOf(originalPerson.id));
personSvc.updatePerson(personId, new Person(originalPerson.name, 2, originalPerson.id));
Person updatedPerson = personSvc.getPerson(personId);
assertEquals("newAgePerson", updatedPerson.name);
assertEquals(2, updatedPerson.age);
assertEquals(personId, Long.valueOf(updatedPerson.id));
}
@Test
public void testGetUnknownPerson() {
assertThrows(NotFoundException.class, () -> personSvc.getPerson(-1L));
}
@Test
public void testCreateBadPersonNullName() {
assertThrows(BadRequestException.class, () -> personSvc.createPerson(null, 5));
}
@Test
public void testCreateBadPersonNegativeAge() {
assertThrows(BadRequestException.class, () -> personSvc.createPerson("NegativeAgePersoN", -1));
}
@Test
public void testCreateBadPersonNameTooLong() {
assertThrows(BadRequestException.class, () -> personSvc.createPerson("NameTooLongPersonNameTooLongPersonNameTooLongPerson", 5));
}
}
|
[
"[email protected]"
] | |
2d167431dde4815d71d84a85960ce6fc4518bcf0
|
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
|
/junit_cluster/1293/src_1.java
|
516bd25ad8573991f120f134ad0e9174df0e5db0
|
[] |
no_license
|
martinezmatias/GenPat-data-C3
|
63cfe27efee2946831139747e6c20cf952f1d6f6
|
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
|
refs/heads/master
| 2022-04-25T17:59:03.905613
| 2020-04-15T14:41:34
| 2020-04-15T14:41:34
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 799
|
java
|
package junit.tests.framework;
import junit.framework.Test;
import junit.framework.TestSuite;
/**
* TestSuite that runs all the sample tests
*
*/
public class AllTests {
public static void main(String[] args) {
junit.textui.TestRunner.run(suite());
}
public static Test suite() {
TestSuite suite= new TestSuite("Framework Tests");
suite.addTestSuite(TestCaseTest.class);
suite.addTest(SuiteTest.suite()); // Tests suite building, so can't use automatic test extraction
suite.addTestSuite(TestListenerTest.class);
suite.addTestSuite(AssertTest.class);
suite.addTestSuite(TestImplementorTest.class);
suite.addTestSuite(NoArgTestCaseTest.class);
suite.addTestSuite(ComparisonFailureTest.class);
suite.addTestSuite(DoublePrecisionAssertTest.class);
return suite;
}
}
|
[
"[email protected]"
] | |
4987fca2777310b571ef1a1079d76cd8bcdd1ee1
|
3941243a80b553206558321fa49b8ca03ea599fa
|
/bin/custom/myhybris/myhybrisstorefront/web/src/mx/myhybris/storefront/controllers/pages/QuickOrderPageController.java
|
a84d12f897d29563fe433ee800b534d29c2383fa
|
[] |
no_license
|
lmartinezmx/MyStoreHybris
|
31c5f2ef85b6d9120ce4e252a1554ae250bae3a4
|
9451b9e8215d42be02b59a3cae5316ff1fd24996
|
refs/heads/master
| 2020-07-14T21:42:49.175463
| 2019-08-30T17:15:53
| 2019-08-30T17:15:53
| 205,409,281
| 0
| 0
| null | 2020-04-30T11:28:14
| 2019-08-30T15:30:13
|
Java
|
UTF-8
|
Java
| false
| false
| 4,607
|
java
|
/*
* [y] hybris Platform
*
* Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* ("Confidential Information"). You shall not disclose such Confidential
* Information and shall use it only in accordance with the terms of the
* license agreement you entered into with SAP.
*/
package mx.myhybris.storefront.controllers.pages;
import de.hybris.platform.acceleratorfacades.product.data.ProductWrapperData;
import de.hybris.platform.acceleratorstorefrontcommons.breadcrumb.ResourceBreadcrumbBuilder;
import de.hybris.platform.acceleratorstorefrontcommons.constants.WebConstants;
import de.hybris.platform.acceleratorstorefrontcommons.controllers.ThirdPartyConstants;
import de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.AbstractPageController;
import de.hybris.platform.cms2.exceptions.CMSItemNotFoundException;
import de.hybris.platform.commercefacades.product.ProductFacade;
import de.hybris.platform.commercefacades.product.ProductOption;
import de.hybris.platform.commercefacades.product.data.ProductData;
import de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException;
import de.hybris.platform.util.Config;
import mx.myhybris.storefront.controllers.ControllerConstants;
import java.util.Arrays;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
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 org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
/**
*
*/
@Controller
@RequestMapping(value = "/quickOrder")
public class QuickOrderPageController extends AbstractPageController
{
private static final Logger LOG = Logger.getLogger(QuickOrderPageController.class);
@Resource(name = "simpleBreadcrumbBuilder")
private ResourceBreadcrumbBuilder resourceBreadcrumbBuilder;
@Resource(name = "productVariantFacade")
private ProductFacade productFacade;
@RequestMapping(method = RequestMethod.GET)
public String getQuickOrderPage(final Model model) throws CMSItemNotFoundException // NOSONAR
{
storeCmsPageInModel(model, getContentPageForLabelOrId("quickOrderPage"));
model.addAttribute("quickOrderMinRows", Integer.valueOf(Config.getInt("myhybrisstorefront.quick.order.rows.min", 3)));
model.addAttribute("quickOrderMaxRows", Integer.valueOf(Config.getInt("myhybrisstorefront.quick.order.rows.max", 25)));
model.addAttribute(WebConstants.BREADCRUMBS_KEY, resourceBreadcrumbBuilder.getBreadcrumbs("breadcrumb.quickOrder"));
model.addAttribute(ThirdPartyConstants.SeoRobots.META_ROBOTS, ThirdPartyConstants.SeoRobots.NOINDEX_NOFOLLOW);
return ControllerConstants.Views.Pages.QuickOrder.QuickOrderPage;
}
@RequestMapping(value = "/productInfo", method = RequestMethod.GET, produces = "application/json")
@ResponseBody
public ProductWrapperData getProductInfo(@RequestParam("code") final String code)
{
ProductData productData = null;
String errorMsg = null;
try
{
productData = productFacade.getProductForCodeAndOptions(code, Arrays.asList(ProductOption.BASIC, ProductOption.PRICE,
ProductOption.URL, ProductOption.STOCK, ProductOption.VARIANT_MATRIX_BASE, ProductOption.VARIANT_MATRIX_URL,
ProductOption.VARIANT_MATRIX_MEDIA));
if (Boolean.FALSE.equals(productData.getPurchasable()))
{
errorMsg = getErrorMessage("text.quickOrder.product.not.purchaseable", null);
}
}
catch (final IllegalArgumentException iae)
{
errorMsg = getErrorMessage("text.quickOrder.product.not.unique", null);
logDebugException(iae);
}
catch (final UnknownIdentifierException uie)
{
errorMsg = getErrorMessage("text.quickOrder.product.not.found", null);
logDebugException(uie);
}
return createProductWrapperData(productData, errorMsg);
}
protected void logDebugException(final Exception ex)
{
if (LOG.isDebugEnabled())
{
LOG.debug(ex);
}
}
protected String getErrorMessage(final String messageKey, final Object[] args)
{
return getMessageSource().getMessage(messageKey, args, getI18nService().getCurrentLocale());
}
protected ProductWrapperData createProductWrapperData(final ProductData productData, final String errorMsg)
{
final ProductWrapperData productWrapperData = new ProductWrapperData();
productWrapperData.setProductData(productData);
productWrapperData.setErrorMsg(errorMsg);
return productWrapperData;
}
}
|
[
"[email protected]"
] | |
bfb5855be33acd4c699a153a92a20d4e35206df3
|
5119693954a68508c60c1f04624780b5f085188f
|
/jmfsrc/javax/media/rtp/TransmissionStats.java
|
819a0c5caad8feb4f6e5d386678e496ae0b9753b
|
[] |
no_license
|
faustvault/JavaFrameByFrameVideo
|
1356b2b278c60ea74035a0b0f9739f81bb2a171b
|
cfd67b91ee648b8babc93e94d2780884463987b4
|
refs/heads/master
| 2020-12-25T15:40:18.935023
| 2013-03-24T07:28:37
| 2013-03-24T07:28:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 937
|
java
|
/*
* @(#)TransmissionStats.java 1.6 02/08/21
*
* Copyright (c) 1996-2002 Sun Microsystems, Inc. All rights reserved.
*/
package javax.media.rtp;
/**
* Interface TransmissionStats---
* encapsulates data transmission statistics as well as RTCP statistics
* prepared by the RTPSM.A "PDU" is a a Protocol Data Unit and
* represents a single RTP packet.
*/
public interface TransmissionStats
{
/**
* Get the total number of PDU sent out by this source. This will
* be the total numer of RTP data packets sent out by this source.
*/
public int
getPDUTransmitted();
/**
* Get the total number of bytes or octets of data transmitted by
* this source.
*/
public int
getBytesTransmitted();
/**
* Get the total number of RTCP packets sent out by this source
* i.e total number of Sender Reports sent out by this source.
*/
public int
getRTCPSent();
}
|
[
"[email protected]"
] | |
438ca493d17a006caf684565f557c2da20e5c631
|
a666c798a28223f97d74d21786f9a4f4000d5acb
|
/edu.harvard.i2b2.crc/gensrc/edu/harvard/i2b2/crc/datavo/setfinder/query/TimingStepType.java
|
aae60b4ff73116af0f03e6ee7a4e36cf8586a096
|
[] |
no_license
|
gmacdonnell/i2b2-fsu-1704
|
d65239edf95aa3b25844a6ed9af599e06dcaa185
|
12638996fe46a7014ac827e359c40e5b0e8c1d3e
|
refs/heads/master
| 2021-01-23T07:02:31.537241
| 2015-01-27T15:09:33
| 2015-01-27T15:09:33
| 29,916,117
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,545
|
java
|
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-558
// 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.01.26 at 12:45:17 PM EST
//
package edu.harvard.i2b2.crc.datavo.setfinder.query;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>Java class for timingStepType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="timingStepType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="name" type="{http://www.w3.org/2001/XMLSchema}string"/>
* <element name="start_date" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* <element name="end_date" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
* <element name="total_time_second" type="{http://www.w3.org/2001/XMLSchema}double"/>
* <element name="message" type="{http://www.w3.org/2001/XMLSchema}string"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "timingStepType", propOrder = {
"name",
"startDate",
"endDate",
"totalTimeSecond",
"message"
})
public class TimingStepType {
@XmlElement(required = true)
protected String name;
@XmlElement(name = "start_date", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar startDate;
@XmlElement(name = "end_date", required = true)
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar endDate;
@XmlElement(name = "total_time_second")
protected double totalTimeSecond;
@XmlElement(required = true)
protected String message;
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the startDate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getStartDate() {
return startDate;
}
/**
* Sets the value of the startDate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setStartDate(XMLGregorianCalendar value) {
this.startDate = value;
}
/**
* Gets the value of the endDate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getEndDate() {
return endDate;
}
/**
* Sets the value of the endDate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setEndDate(XMLGregorianCalendar value) {
this.endDate = value;
}
/**
* Gets the value of the totalTimeSecond property.
*
*/
public double getTotalTimeSecond() {
return totalTimeSecond;
}
/**
* Sets the value of the totalTimeSecond property.
*
*/
public void setTotalTimeSecond(double value) {
this.totalTimeSecond = value;
}
/**
* Gets the value of the message property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMessage() {
return message;
}
/**
* Sets the value of the message property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMessage(String value) {
this.message = value;
}
}
|
[
"[email protected]"
] | |
244a4de34e7f7b176888fb3482005f9a4df59f3c
|
8b1f9fbec49a2d89467854ec8ba117fe33337524
|
/generic-arg/modules/interface/src/main/java/com/kepler/list/Members.java
|
ec70116c06e30eaa4888c80598f86c6135b81b07
|
[] |
no_license
|
Kepler-Framework/Kepler-Example
|
c13c91c80bfbdf11ea1ef53b9a5aeee921c52ff0
|
210aa7c0a172014d0c78de0430a77d346b0c12f4
|
refs/heads/master
| 2020-04-16T20:13:40.372720
| 2016-08-24T06:44:39
| 2016-08-24T06:44:39
| 52,214,797
| 3
| 12
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 514
|
java
|
package com.kepler.list;
import java.util.List;
/**
* @author KimShen
*
*/
public class Members {
private List<String> names;
private List<Role> roles;
public List<String> getNames() {
return this.names;
}
public void setNames(List<String> names) {
this.names = names;
}
public List<Role> getRoles() {
return this.roles;
}
public void setRoles(List<Role> roles) {
this.roles = roles;
}
public String toString() {
return "[names=" + this.names + "][roles=" + this.roles + "]";
}
}
|
[
"[email protected]"
] | |
409715f33ffe9b6446ba53c2dd28bab5499e5c27
|
7ab6f4e52dd665714e244c6f34e08f1fd4ef3469
|
/ciyuanplus2/app/src/main/java/com/ciyuanplus/mobile/net/parameter/RequestOrderListApiParameter.java
|
65610400c053b9ddb2d4686e4719a787fb28be07
|
[] |
no_license
|
heqianqian0516/ciyuan
|
2e9f8f84a1595317e8911cfece2e3f3919ebddeb
|
44410726a8f7e4467f06fab1ae709451ef293b3b
|
refs/heads/master
| 2020-07-11T04:11:24.935457
| 2019-11-06T03:37:45
| 2019-11-06T03:37:45
| 204,436,467
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,236
|
java
|
package com.ciyuanplus.mobile.net.parameter;
import com.ciyuanplus.mobile.manager.UserInfoData;
import com.ciyuanplus.mobile.net.ApiParamMap;
import com.ciyuanplus.mobile.net.ApiParameter;
/**
* Created by Alen on 2017/2/11.
*/
public class RequestOrderListApiParameter extends ApiParameter {
private final String merId;
private final String status;
private final String pager;
private final String pageSize;
private String userUuid;
public RequestOrderListApiParameter(String merId, String status, String pager, String pageSize) {
this.pager = pager;
this.pageSize = pageSize;
this.merId = merId;
this.status = status;
this.userUuid = UserInfoData.getInstance().getUserInfoItem().uuid;
}
@Override
public ApiParamMap buildExtraParameter() {
ApiParamMap map = new ApiParamMap();
map.put("pager", new ApiParamMap.ParamData(this.pager));
map.put("pageSize", new ApiParamMap.ParamData(this.pageSize));
map.put("merId", new ApiParamMap.ParamData(this.merId));
map.put("status", new ApiParamMap.ParamData(this.status));
map.put("userUuid", new ApiParamMap.ParamData(this.userUuid));
return map;
}
}
|
[
"[email protected]"
] | |
999d066dce0b4d7be0e191ba6f67d88a47d72167
|
fdac29341ee82f0b6080af618be084a9dd64735a
|
/FiapMetro/app/src/main/java/br/com/tairoroberto/fiapmetro/api/MetroApi.java
|
0c4d5d6ca776073e739e4f63bb46d85831802846
|
[] |
no_license
|
tairoroberto/Android_FIAP
|
ffdb6b4ffc028fa2a04211e1d76abdef5fef3a86
|
e9b4afca7f7a0631613e96e65576a57d25d482f8
|
refs/heads/master
| 2021-05-11T19:47:43.099925
| 2018-01-17T20:23:36
| 2018-01-17T20:23:36
| 117,888,419
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 521
|
java
|
package br.com.tairoroberto.fiapmetro.api;
import java.util.List;
import br.com.tairoroberto.fiapmetro.model.Estacao;
import br.com.tairoroberto.fiapmetro.model.LinhaMetro;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
/**
* Created by logonrm on 26/06/2017.
*/
public interface MetroApi {
@GET("/linhas")
Call<List<LinhaMetro>> consultarLinhasMetro();
@GET("/linhas/{linha}/estacoes")
rx.Observable<List<Estacao>> consultarEstacaoes(@Path("linha") String linha);
}
|
[
"[email protected]"
] | |
8d2061b5c5c35ff1c27ae3e9952e827e4764a91c
|
364bd91497a498b899c1de60e1ff028795eddbbc
|
/02Benchmarks/Openj9Test-Test/src/javaT/nio/channels/AsynchronousSocketChannel/StressLoopback.java
|
74daee42aa9e6fe8773a02c05a6c34d13628863e
|
[] |
no_license
|
JavaTailor/CFSynthesis
|
8485f5d94cec335bedfdf18c88ddc523e05a0567
|
bf9421fea49469fbac554da91169cf07aae3e08c
|
refs/heads/master
| 2023-04-15T02:37:04.252151
| 2021-11-12T09:57:06
| 2021-11-12T09:57:06
| 402,928,654
| 4
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,415
|
java
|
package javaT.nio.channels.AsynchronousSocketChannel;
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* @test
* @bug 6834246 6842687 8133647
* @summary Stress test connections through the loopback interface
* @run main StressLoopback
* @run main/othervm -Djdk.net.useFastTcpLoopback StressLoopback
* @key randomness
*/
import java.nio.ByteBuffer;
import java.net.*;
import java.nio.channels.*;
import java.util.Random;
import java.io.IOException;
public class StressLoopback {
static final Random rand = new Random();
public static void main(String[] args) throws Exception {
// setup listener
AsynchronousServerSocketChannel listener =
AsynchronousServerSocketChannel.open().bind(new InetSocketAddress(0));
int port =((InetSocketAddress)(listener.getLocalAddress())).getPort();
InetAddress lh = InetAddress.getLocalHost();
SocketAddress remote = new InetSocketAddress(lh, port);
// create sources and sinks
int count = 2 + rand.nextInt(9);
Source[] source = new Source[count];
Sink[] sink = new Sink[count];
for (int i=0; i<count; i++) {
AsynchronousSocketChannel ch = AsynchronousSocketChannel.open();
ch.connect(remote).get();
source[i] = new Source(ch);
sink[i] = new Sink(listener.accept().get());
}
// start the sinks and sources
for (int i=0; i<count; i++) {
sink[i].start();
source[i].start();
}
// let the test run for a while
Thread.sleep(20*1000);
// wait until everyone is done
boolean failed = false;
long total = 0L;
for (int i=0; i<count; i++) {
long nwrote = source[i].finish();
long nread = sink[i].finish();
if (nread != nwrote)
failed = true;
System.out.format("%d -> %d (%s)\n",
nwrote, nread, (failed) ? "FAIL" : "PASS");
total += nwrote;
}
if (failed)
throw new RuntimeException("Test failed - see log for details");
System.out.format("Total sent %d MB\n", total / (1024L * 1024L));
}
/**
* Writes bytes to a channel until "done". When done the channel is closed.
*/
static class Source {
private final AsynchronousByteChannel channel;
private final ByteBuffer sentBuffer;
private volatile long bytesSent;
private volatile boolean finished;
Source(AsynchronousByteChannel channel) {
this.channel = channel;
int size = 1024 + rand.nextInt(10000);
this.sentBuffer = (rand.nextBoolean()) ?
ByteBuffer.allocateDirect(size) : ByteBuffer.allocate(size);
}
void start() {
sentBuffer.position(0);
sentBuffer.limit(sentBuffer.capacity());
channel.write(sentBuffer, (Void)null, new CompletionHandler<Integer,Void> () {
public void completed(Integer nwrote, Void att) {
bytesSent += nwrote;
if (finished) {
closeUnchecked(channel);
} else {
sentBuffer.position(0);
sentBuffer.limit(sentBuffer.capacity());
channel.write(sentBuffer, (Void)null, this);
}
}
public void failed(Throwable exc, Void att) {
exc.printStackTrace();
closeUnchecked(channel);
}
});
}
long finish() {
finished = true;
waitUntilClosed(channel);
return bytesSent;
}
}
/**
* Read bytes from a channel until EOF is received.
*/
static class Sink {
private final AsynchronousByteChannel channel;
private final ByteBuffer readBuffer;
private volatile long bytesRead;
Sink(AsynchronousByteChannel channel) {
this.channel = channel;
int size = 1024 + rand.nextInt(10000);
this.readBuffer = (rand.nextBoolean()) ?
ByteBuffer.allocateDirect(size) : ByteBuffer.allocate(size);
}
void start() {
channel.read(readBuffer, (Void)null, new CompletionHandler<Integer,Void> () {
public void completed(Integer nread, Void att) {
if (nread < 0) {
closeUnchecked(channel);
} else {
bytesRead += nread;
readBuffer.clear();
channel.read(readBuffer, (Void)null, this);
}
}
public void failed(Throwable exc, Void att) {
exc.printStackTrace();
closeUnchecked(channel);
}
});
}
long finish() {
waitUntilClosed(channel);
return bytesRead;
}
}
static void waitUntilClosed(Channel c) {
while (c.isOpen()) {
try {
Thread.sleep(100);
} catch (InterruptedException ignore) { }
}
}
static void closeUnchecked(Channel c) {
try {
c.close();
} catch (IOException ignore) { }
}
}
|
[
"[email protected]"
] | |
5a79d947db44acb9daebf6004993299b3e6ee87b
|
82c73b14ca77a4e36976aab39d3a406faad399d1
|
/app/src/main/java/com/merrichat/net/activity/groupmarket/MarketActivity.java
|
b5cf33949f2bb5c1b9610509beede3789048b542
|
[] |
no_license
|
AndroidDeveloperRaj/aaaaa
|
ab85835b3155ebe8701085560c550a676098736d
|
e6733ab804168065926f41b7e8723e0d92cd1682
|
refs/heads/master
| 2020-03-25T11:19:48.899989
| 2018-05-10T05:53:07
| 2018-05-10T05:53:07
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,459
|
java
|
package com.merrichat.net.activity.groupmarket;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.merrichat.net.R;
import com.merrichat.net.activity.BaseActivity;
import java.util.ArrayList;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 群市场(涉及《我要买》和《我要卖》)
* Created by amssy on 18/1/18.
*/
public class MarketActivity extends BaseActivity {
@BindView(R.id.iv_back)
ImageView ivBack;
@BindView(R.id.tv_title_text)
TextView tvTitleText;
@BindView(R.id.viewPager_market)
ViewPager viewPagerMarket;
private ArrayList<Fragment> list;
private BuyMarketFragment buyMarketFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_market);
ButterKnife.bind(this);
initView();
}
private void initView() {
tvTitleText.setText("群市场");
buyMarketFragment = new BuyMarketFragment();
list = new ArrayList<>();
list.add(buyMarketFragment);
FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
public Fragment getItem(int position) {
return list.get(position);
}
@Override
public int getCount() {
return list.size();
}
};
viewPagerMarket.setAdapter(adapter);
viewPagerMarket.setCurrentItem(0);
viewPagerMarket.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
}
@Override
public void onPageSelected(int position) {
viewPagerMarket.setCurrentItem(position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
}
@OnClick({R.id.iv_back})
public void onViewClick(View view){
switch (view.getId()){
case R.id.iv_back:
finish();
break;
}
}
}
|
[
"[email protected]"
] | |
2d704043a9b89d77f0386cd437324ec3c1be95b5
|
fa91450deb625cda070e82d5c31770be5ca1dec6
|
/Diff-Raw-Data/11/11_4a27806cef1297fcb6fc37ee47641f488483c948/RecordsSidePanel/11_4a27806cef1297fcb6fc37ee47641f488483c948_RecordsSidePanel_t.java
|
d60f9b883949be6fb3b80f4aad864eca291f11de
|
[] |
no_license
|
zhongxingyu/Seer
|
48e7e5197624d7afa94d23f849f8ea2075bcaec0
|
c11a3109fdfca9be337e509ecb2c085b60076213
|
refs/heads/master
| 2023-07-06T12:48:55.516692
| 2023-06-22T07:55:56
| 2023-06-22T07:55:56
| 259,613,157
| 6
| 2
| null | 2023-06-22T07:55:57
| 2020-04-28T11:07:49
| null |
UTF-8
|
Java
| false
| false
| 4,133
|
java
|
package edu.brown.cs32.MFTG.gui;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import edu.brown.cs32.MFTG.tournament.Record;
public class RecordsSidePanel extends JPanel{
private JLabel _numMatches, _numMatchesWon, _numSets, _numSetsWon, _numGames, _numGamesWon, _numTurnsTaken;
private JLabel _matchWinningPercentage, _setWinningPercentage, _gameWinningPercentage;
private JLabel _numMatchesRecord, _numMatchesWonRecord, _numSetsRecord, _numSetsWonRecord, _numGamesRecord, _numGamesWonRecord, _numTurnsTakenRecord;
private JLabel _matchWinningPercentageRecord, _setWinningPercentageRecord, _gameWinningPercentageRecord;
public RecordsSidePanel() {
this.setLayout(new BorderLayout());
this.setBackground(Color.WHITE);
this.setBorder(new EmptyBorder(3,3,3,3));
JPanel topPanel = new JPanel();
topPanel.setBackground(Color.WHITE);
JLabel header= new JLabel("Records for this Profile");
topPanel.add(header);
_numMatches = new JLabel("Number of Matches: ");
_numMatchesRecord = new JLabel("");
_numMatchesWon = new JLabel("Number of Matches Won: ");
_numMatchesWonRecord = new JLabel("");
_matchWinningPercentage = new JLabel("Percentage of Matches Won: ");
_matchWinningPercentageRecord = new JLabel("");
JLabel break1 = new JLabel("");
JLabel break2 = new JLabel("");
_numSets = new JLabel("Number of Sets: ");
_numSetsRecord = new JLabel("");
_numSetsWon = new JLabel("Number of Sets Won: ");
_numSetsWonRecord = new JLabel("");
_setWinningPercentage = new JLabel("Percentage of Sets Won: ");
_setWinningPercentageRecord = new JLabel("");
JLabel break3 = new JLabel("");
JLabel break4 = new JLabel("");
_numGames = new JLabel("Number of Games: ");
_numGamesRecord = new JLabel("");
_numGamesWon = new JLabel("Number of Games Won: ");
_numGamesWonRecord = new JLabel("");
_gameWinningPercentage = new JLabel("Percentage of Games Won: ");
_gameWinningPercentageRecord = new JLabel("");
JPanel leftPanel = new JPanel();
leftPanel.setLayout(new GridLayout(0,1));
leftPanel.setBackground(Color.WHITE);
JPanel rightPanel = new JPanel();
rightPanel.setLayout(new GridLayout(0,1));
rightPanel.setBackground(Color.WHITE);
leftPanel.add(_numMatches);
rightPanel.add(_numMatchesRecord);
leftPanel.add(_numMatchesWon);
rightPanel.add(_numMatchesWonRecord);
leftPanel.add(_matchWinningPercentage);
rightPanel.add(_matchWinningPercentageRecord);
leftPanel.add(break1);
rightPanel.add(break2);
leftPanel.add(_numSets);
rightPanel.add(_numSetsRecord);
leftPanel.add(_numSetsWon);
rightPanel.add(_numSetsWonRecord);
leftPanel.add(_setWinningPercentage);
rightPanel.add(_setWinningPercentageRecord);
leftPanel.add(break3);
rightPanel.add(break4);
leftPanel.add(_numGames);
rightPanel.add(_numGamesRecord);
leftPanel.add(_numGamesWon);
rightPanel.add(_numGamesWonRecord);
leftPanel.add(_gameWinningPercentage);
rightPanel.add(_gameWinningPercentageRecord);
this.add(topPanel, BorderLayout.NORTH);
this.add(leftPanel,BorderLayout.WEST);
this.add(rightPanel,BorderLayout.EAST);
}
/**
* sets text based on a record
* @param r
*/
public void setRecords(Record r) {
if(r==null) {
return;
}
_numMatchesRecord.setText(String.valueOf(r.getNumMatches()));
_numMatchesWonRecord.setText(String.valueOf(r.getNumMatchesWon()));
_matchWinningPercentageRecord.setText(String.format("%.3f", r.getMatchWinningPercentage()));
_numSetsRecord.setText(String.valueOf(r.getNumSets()));
_numSetsWonRecord.setText(String.valueOf(r.getNumSetsWon()));
_setWinningPercentageRecord.setText(String.format("%.3f", r.getSetWinningPercentage()));
_numGamesRecord.setText(String.valueOf(r.getNumGames()));
_numGamesWonRecord.setText(String.valueOf(r.getNumGamesWon()));
_gameWinningPercentageRecord.setText(String.format("%.3f", r.getGameWinningPercentage()));
}
}
|
[
"[email protected]"
] | |
8c5173f7c9d3b82c32834eb10eb2114ccf86d3f8
|
5530b6e6f955980eea2c9ecbb2c18282c42ef897
|
/src/main/java/ua/edu/npu/thread/MyThread.java
|
3facf1bd86e623c875579cb085e590825b14972d
|
[] |
no_license
|
powerex/ThreadDemo
|
5f67a310492b221788fe58a1bcd8b0944baa7c50
|
f4aa8f48296320c85f2ee141f149977a8e68b5a9
|
refs/heads/master
| 2020-06-13T06:15:15.672958
| 2019-07-03T11:23:31
| 2019-07-03T11:23:31
| 194,567,158
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 547
|
java
|
package ua.edu.npu.thread;
public class MyThread extends Thread{
@Override
public void run() {
try {
System.out.println("I am demon " + this.isDaemon());
Thread.sleep(3000);
System.out.println(Thread.currentThread().getName() + " running myThread");
} catch (InterruptedException e) {
System.out.println(Thread.currentThread().getName() + " I am interrupted! ******");
}
//System.out.println(Thread.currentThread().getName() + " running myThread");
}
}
|
[
"[email protected]"
] | |
8fb089536a02d465beeda67c6391a65e79aa56a8
|
03539dfb4d2448426c9ddd8fe8813586b960cd3b
|
/groza-common/transport/src/main/java/com/sanshengshui/server/common/transport/quota/QuotaService.java
|
f54e71018aa20a9c2f1bc2f034582ea30d15eb51
|
[
"Apache-2.0"
] |
permissive
|
tonyshen277/Groza
|
a7ce34ad6b361bf02ce26d85552f8b68d9d8ba2e
|
0ed5fdd7de27b6d0e546342a3615182fc23cbb8e
|
refs/heads/master
| 2020-05-02T03:21:33.061286
| 2019-05-24T03:59:16
| 2019-05-24T03:59:16
| 177,726,695
| 0
| 0
|
Apache-2.0
| 2019-05-24T03:59:17
| 2019-03-26T06:19:52
|
Java
|
UTF-8
|
Java
| false
| false
| 189
|
java
|
package com.sanshengshui.server.common.transport.quota;
/**
* @author james mu
* @date 19-1-23 下午3:30
*/
public interface QuotaService {
boolean isQuotaExceeded(String key);
}
|
[
"[email protected]"
] | |
45ca92daec427c97ffbcaa953a3a14a4015202d6
|
69ee0508bf15821ea7ad5139977a237d29774101
|
/cmis-core/src/main/java/vmware/vim25/ArrayOfAlarmAction.java
|
c496717190b1eb9013a4b40bfe901763159c486a
|
[] |
no_license
|
bhoflack/cmis
|
b15bac01a30ee1d807397c9b781129786eba4ffa
|
09e852120743d3d021ec728fac28510841d5e248
|
refs/heads/master
| 2021-01-01T05:32:17.872620
| 2014-11-17T15:00:47
| 2014-11-17T15:00:47
| 8,852,575
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,892
|
java
|
package vmware.vim25;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for ArrayOfAlarmAction complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="ArrayOfAlarmAction">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="AlarmAction" type="{urn:vim25}AlarmAction" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ArrayOfAlarmAction", propOrder = {
"alarmAction"
})
public class ArrayOfAlarmAction {
@XmlElement(name = "AlarmAction")
protected List<AlarmAction> alarmAction;
/**
* Gets the value of the alarmAction property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the alarmAction property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getAlarmAction().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link AlarmAction }
*
*
*/
public List<AlarmAction> getAlarmAction() {
if (alarmAction == null) {
alarmAction = new ArrayList<AlarmAction>();
}
return this.alarmAction;
}
}
|
[
"[email protected]"
] | |
f9b0dbb22e74dd09609e25c3ed1340b8bedc12ae
|
2246623d541429e693930ac7ac71b265dae7e08e
|
/src/com/gmail/filoghost/ultrahardcore/utils/scatter/SquareSpotsGenerator.java
|
b3322027ed9a0cfa269a6cee21f391fdde2510d8
|
[
"BSD-2-Clause"
] |
permissive
|
UnfireGames/UltraHardcore
|
578ea78c419cf049009bf5bdcabccf639bbf40c5
|
245f50430140d83960842a80d2f47db2b0e5f8c3
|
refs/heads/master
| 2022-04-11T17:16:45.616765
| 2020-04-01T14:31:55
| 2020-04-01T14:31:55
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,512
|
java
|
/*
* Copyright (c) 2020, Wild Adventure
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* 4. Redistribution of this software in source or binary forms shall be free
* of all charges or fees to the recipient of this software.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.gmail.filoghost.ultrahardcore.utils.scatter;
import lombok.AllArgsConstructor;
import lombok.Getter;
public class SquareSpotsGenerator {
private int startSide;
private Integer[] sideCoords;
public SquareSpotsGenerator(int side) {
startSide = side;
}
public XZ[] generate() {
if (sideCoords == null) {
sideCoords = new Integer[] {-startSide, startSide};
return new XZ[]
{
new XZ(startSide, startSide),
new XZ(startSide, -startSide),
new XZ(-startSide, startSide),
new XZ(-startSide, -startSide),
};
}
Integer[] oldSideCoords = sideCoords;
sideCoords = new Integer[oldSideCoords.length * 2 - 1];
Integer[] addedCoords = new Integer[sideCoords.length - oldSideCoords.length];
int index = 0;
for (int i = 0; i < oldSideCoords.length; i++) {
if (i * 2 < sideCoords.length) {
sideCoords[i * 2] = oldSideCoords[i];
}
}
for (int i = 0; i < sideCoords.length; i++) {
if (sideCoords[i] == null) {
if (i > 0 && i < sideCoords.length - 1) {
sideCoords[i] = (sideCoords[i - 1] + sideCoords[i + 1]) / 2;
addedCoords[index++] = sideCoords[i];
}
}
}
return generateSpecular(addedCoords);
}
private XZ[] generateSpecular(Integer[] side) {
XZ[] specular = new XZ[side.length * 4];
for (int i = 0; i < side.length; i++) {
int value = side[i];
specular[i * 4] = new XZ(startSide, value);
specular[i * 4 + 1] = new XZ(- startSide, value);
specular[i * 4 + 2] = new XZ(value, startSide);
specular[i * 4 + 3] = new XZ(value, - startSide);
}
return specular;
}
@AllArgsConstructor
@Getter
public static class XZ {
private int x, z;
@Override
public String toString() {
return "XY[x=" + x + ", z=" + z + "]";
}
}
}
|
[
"[email protected]"
] | |
94433afcd2fbcec0d08ffb56b761d4d44a995c02
|
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
|
/data_defect4j/preprossed_method_corpus/Math/4/org/apache/commons/math3/random/RandomDataGenerator_nextGamma_487.java
|
32b8fbbe72a43655cb4bcdbc49b078ba3c816a7c
|
[] |
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
| 3,658
|
java
|
org apach common math3 random
implement link random data randomdata link random gener randomgener
instanc gener secur data link java secur secur random securerandom
instanc provid data code secur xxx nextsecurexxx code method
code random gener randomgener code provid constructor
link well19937c gener plug
implement implement code random gener randomgener code directli
extend link abstract random gener abstractrandomgener
support reseed underli pseudo random number gener prng
code secur provid securityprovid code code algorithm code
code secur random securerandom code instanc reset
detail prn prng link java util random
link java secur secur random securerandom
strong usag note strong
instanc variabl maintain code random gener randomgener code
code secur random securerandom code instanc data gener
gener random sequenc valu string
strong strong code random data impl randomdataimpl code instanc repeatedli
secur method slower
cryptograph secur random sequenc requir secur random
sequenc sequenc pseudo random valu addit
dispers subsequ valu
subsequ length addit properti
knowledg valu gener point sequenc make
easier predict subsequ valu
code random data impl randomdataimpl code creat underli random
number gener strong strong initi
explicitli seed secur gener seed
current time millisecond system ident hash code
hold secur gener provid code random gener randomgener code
constructor gener reseed constructor
reseed
code seed rese code code seed secur reseedsecur code method deleg
method underli code random gener randomgener code
code secur random securerandom code instanc code seed rese code
fulli reset initi state secur random number gener
reseed specif result subsequ
random sequenc seed secur reseedsecur strong strong
reiniti secur random number gener secur sequenc start
call rese secur reseedsecur ident
implement underli code random gener randomgener code
code secur random securerandom code instanc synchron
guarante thread safe instanc
concurr util multipl thread respons
client code synchron access seed data gener method
version
random data gener randomdatagener random data randomdata serializ
gener random
link org apach common math3 distribut gamma distribut gammadistribut gamma distribut
implement algorithm
shape
ahren dieter comput method
sampl gamma beta poisson binomi distribut
comput
shape
marsaglia tsang simpl method gener
gamma variabl acm transact mathemat softwar
volum issu septemb
param shape median gamma distribut
param scale scale paramet gamma distribut
random sampl gamma shape scale distribut
strictli posit except notstrictlypositiveexcept code shape
code scale
gamma nextgamma shape scale strictli posit except notstrictlypositiveexcept
gamma distribut gammadistribut random gener getrandomgener shape scale
gamma distribut gammadistribut default invers absolut accuraci sampl
|
[
"[email protected]"
] | |
bded90e91ba8d393d330b4b5c66dc5655e5f1cbd
|
b9cda73f759b80eac1d37b169c76cc90dba059a9
|
/src/day11/StringEqualityPractice_Condition2.java
|
57e0a9460b1c962220823292321f59707d5368c5
|
[] |
no_license
|
musajojo/Moses_CyberTek
|
07ce383eb2bad72b9601c71bb47ff9d2bc8c6e49
|
97d8d423d454fdba6ee0ffa3b5d818a51663d97e
|
refs/heads/master
| 2020-11-28T13:59:37.913082
| 2020-06-15T03:52:02
| 2020-06-15T03:52:02
| 229,839,863
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 569
|
java
|
package day11;
public class StringEqualityPractice_Condition2 {
public static void main(String[] args) {
/*
*check the value of myStr
* if it is Java -->> correct word
* if it is Cava -->> Pumpkin!!
*/
String myString ="cava";
if (myString.equals("java")) {
System.out.println(" Say correct word");
} else if ( myString.equals("cava")){
System.out.println(" Say Pumpkin ");
} else {
System.out.println(" Say not Java nor pumpkin");
}
}
}
|
[
"[email protected]"
] | |
36563d9d2c02224947a9584d38409e29d6ef2517
|
7c5ac4aca76f26e38f0701f44b4f80d071c1bd8c
|
/app/src/main/java/www/fiberathome/com/parkingapp/utils/AppConfig.java
|
ea536c7c2c505eb3b7f496196d039d9bf6d371a8
|
[] |
no_license
|
sakhawat19/ParkingApp
|
3acc17bdd63e32a14183fc045cbb985d95c6c4ea
|
3fee91df2c8165c57717487f425134ada40f6a08
|
refs/heads/master
| 2020-03-12T14:50:08.391050
| 2018-07-26T10:14:22
| 2018-07-26T10:14:22
| 130,675,145
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 969
|
java
|
package www.fiberathome.com.parkingapp.utils;
public class AppConfig {
// ROOT URL
private static final String ROOT_URL = "http://163.47.157.195/cportal/parkingapp/";
public static final String URL_REGISTER = ROOT_URL + "request_sms.php";
public static final String URL_LOGIN = ROOT_URL + "verify_user.php";
public static final String URL_VERIFY_OTP = ROOT_URL + "verify_otp.php";
public static final String IMAGES_URL = "http://163.47.157.195/cportal/parkingapp/uploads/";
// Retrofit URLs
public static final String URL_CHANGE_PASSWORD = ROOT_URL + "change_password.php/";
// SMS provider identification
// It should match with your SMS gateway origin
// You can use MSGIND, TESTER and ALERTS as sender ID
// If you want custom sender Id, approve Msg91 to get one
public static final String SMS_ORIGIN = "PARKINGAPP_";
public static final String SHARED_PREFERENCES = "";
}
|
[
"[email protected]"
] | |
98d2e30d0a619033af77ae607a3ecba310caff27
|
ed14f2dc0ce1a671f3742cf6c99433cf82663964
|
/src/main/java/fr/ariouz/ultimateutilities/utils/MessageUtils.java
|
7979a05e7a6211adb68cb51acc413cbad7121def
|
[] |
no_license
|
Ariouz/UltimateUtilities
|
8b1670e660e3f4c8b95d0d30e9ed7681c273dd3d
|
6891f04eba35aa1adf007dd6dbf73cd51ede41cb
|
refs/heads/main
| 2023-04-14T18:27:28.556899
| 2021-04-26T14:00:40
| 2021-04-26T14:00:40
| 361,753,441
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,201
|
java
|
package fr.ariouz.ultimateutilities.utils;
import fr.ariouz.ultimateutilities.UltimateUtilities;
import fr.ariouz.ultimateutilities.managers.config.ConfigPaths;
import me.clip.placeholderapi.PlaceholderAPI;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import java.util.ArrayList;
public class MessageUtils {
private final UltimateUtilities ultimateUtilities;
public MessageUtils(UltimateUtilities ultimateUtilities){
this.ultimateUtilities = ultimateUtilities;
}
public ArrayList<String> getMessages(CommandSender commandSender, ConfigPaths path){
ArrayList<String> l = new ArrayList<>();
ultimateUtilities.getMessagesConfig().getList(path.getPath()).forEach(t -> l.add(ChatColor.translateAlternateColorCodes('&', t.toString())));
return l;
}
public ArrayList<String> getMessages(Player player, ConfigPaths path){
ArrayList<String> l = new ArrayList<>();
ultimateUtilities.getMessagesConfig().getList(path.getPath()).forEach(t -> l.add(ChatColor.translateAlternateColorCodes('&', PlaceholderAPI.setPlaceholders(player, t.toString()))));
return l;
}
}
|
[
"[email protected]"
] | |
1cfbc2ca1d1b73b777636e82784788d567353ac8
|
40d38003df4807bf1f00ed1ebcf29d4ce444460d
|
/src/com/jeta/abeille/gui/main/AboutView.java
|
3b3d5aa2f67e52e2f58b5413955ddb76902125fc
|
[] |
no_license
|
jeff-tassin/abeilledb
|
c869dbd95fc229abc88b7f3938cd932dcedd8099
|
94ffd3d3dff345e35ed64173833d254685af13a1
|
refs/heads/master
| 2023-08-10T16:36:08.328238
| 2022-01-31T19:46:41
| 2022-01-31T19:46:41
| 225,102,904
| 2
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 7,052
|
java
|
package com.jeta.abeille.gui.main;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.FontMetrics;
import java.awt.Insets;
import java.awt.LayoutManager;
import javax.swing.BorderFactory;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import com.jeta.foundation.gui.components.TSPanel;
import com.jeta.foundation.gui.utils.TSGuiToolbox;
import com.jeta.foundation.interfaces.license.LicenseUtils;
import com.jeta.foundation.i18n.I18N;
/**
* This view shows the about information for the product.
*
* @author Jeff Tassin
*/
public class AboutView extends TSPanel {
/** data model for this view */
private AboutModel m_model;
/** size of the splash screen image */
private Dimension m_imagesize;
/** the panel that contains the info labels */
private JPanel m_infopanel;
private JLabel m_image;
private JLabel m_jetaware;
/** about labels */
private JLabel[] m_labels;
/** about controls */
private JComponent[] m_controls;
private static Color m_jetablue = new Color(42, 61, 170);
int Y_PADDING = 1;
/**
* ctor
*/
public AboutView(AboutModel model) {
m_model = model;
createView();
loadModel();
revalidate();
doLayout();
}
/**
* Creates the panel at the bottom of the view showing
* license/version/copyright information Licensed To: Serial Number:
* Version: www.jetaware.com Copyright 2002 Jeta Software Inc. Copyright �
* 2002 JETA Software Inc. All Rights Reserved
*/
private JPanel createInfoPanel() {
JPanel panel = new InfoPanel(new InfoLayout());
panel.setOpaque(true);
panel.setBackground(Color.white);
if (LicenseUtils.isEvaluation()) {
m_labels = new JLabel[2];
m_labels[0] = new JLabel(I18N.getLocalizedDialogLabel("License"));
m_labels[1] = new JLabel(I18N.getLocalizedDialogLabel("Version"));
m_controls = new JComponent[2];
m_controls[0] = new JLabel(m_model.getLicenseType());
m_controls[1] = new JLabel(m_model.getVersion());
} else {
m_labels = new JLabel[4];
m_labels[0] = new JLabel(I18N.getLocalizedDialogLabel("Licensed To"));
m_labels[1] = new JLabel(I18N.getLocalizedDialogLabel("Serial Number"));
m_labels[2] = new JLabel(I18N.getLocalizedDialogLabel("License"));
m_labels[3] = new JLabel(I18N.getLocalizedDialogLabel("Version"));
JLabel serial_no = new JLabel(m_model.getSerialNumber());
m_controls = new JComponent[4];
m_controls[0] = new JLabel(m_model.getLicensee());
m_controls[1] = serial_no;
m_controls[2] = new JLabel(m_model.getLicenseType());
m_controls[3] = new JLabel(m_model.getVersion());
}
java.awt.Font f = javax.swing.UIManager.getFont("Table.font");
for (int index = 0; index < m_labels.length; index++) {
m_labels[index].setFont(f);
m_controls[index].setFont(f);
panel.add(m_labels[index]);
panel.add(m_controls[index]);
}
panel.doLayout();
return panel;
}
/**
* Creates the panel that contains the main image for the about
*
* @return the panel
*/
private void createView() {
ImageIcon icon = TSGuiToolbox.loadImage("jeta_about.png");
m_imagesize = new Dimension(icon.getIconWidth(), icon.getIconHeight());
setLayout(new AboutViewLayout());
m_image = new JLabel(icon);
m_image.setBorder(BorderFactory.createLineBorder(Color.black));
add(m_image);
m_infopanel = createInfoPanel();
add(m_infopanel);
ImageIcon bottomicon = TSGuiToolbox.loadImage("about_bottom.png");
m_jetaware = new JLabel(bottomicon);
m_jetaware.setBorder(BorderFactory.createLineBorder(Color.black));
m_jetaware.setSize(new Dimension(400, 24));
add(m_jetaware);
setOpaque(true);
setBackground(m_jetablue);
}
/**
* @return the preferred size for this panel
*/
public Dimension getPreferredSize() {
Dimension d = new Dimension(m_imagesize);
d.height = d.height + m_infopanel.getPreferredSize().height + m_jetaware.getPreferredSize().height;
// d.height = d.height + m_jetaware.getY() + m_jetaware.getHeight() +
// 10;
return d;
}
/**
* Loads the datamodel into the view
*/
private void loadModel() {
}
public class AboutViewLayout implements LayoutManager {
public void addLayoutComponent(String name, Component comp) {
}
public void layoutContainer(Container parent) {
m_image.setSize(new Dimension(parent.getWidth(), m_imagesize.height));
// int x = (parent.getWidth() - m_imagesize.width)/2;
// if ( x < 0 )
int x = 0;
m_image.setLocation(x, 0);
m_infopanel.setLocation(0, m_image.getHeight());
m_infopanel.setSize(new Dimension(parent.getWidth(), m_infopanel.getPreferredSize().height));
// Font f = m_jetaware.getFont();
// FontMetrics metrics = m_jetaware.getFontMetrics(f);
// int jware_height = metrics.getHeight() + Y_PADDING + 10;
int jware_height = m_jetaware.getHeight();
m_jetaware.setLocation(0, m_infopanel.getY() + m_infopanel.getHeight());
m_jetaware.setSize(new java.awt.Dimension(parent.getWidth(), jware_height));
m_jetaware.setPreferredSize(m_jetaware.getSize());
}
public Dimension minimumLayoutSize(Container parent) {
return new Dimension(50, 50);
}
public Dimension preferredLayoutSize(Container parent) {
return getPreferredSize();
}
public void removeLayoutComponent(Component comp) {
}
}
public class InfoLayout implements LayoutManager {
public void addLayoutComponent(String name, Component comp) {
}
public void layoutContainer(Container parent) {
int max_label_width = 0;
Font f = m_labels[0].getFont();
FontMetrics metrics = m_labels[0].getFontMetrics(f);
int x = 10;
int y = 10;
for (int index = 0; index < m_labels.length; index++) {
JLabel label = m_labels[index];
label.setSize(label.getPreferredSize());
int label_width = metrics.stringWidth(label.getText());
if (label_width > max_label_width)
max_label_width = label_width;
label.setLocation(x, y);
JComponent comp = m_controls[index];
comp.setLocation(x, y);
y += label.getHeight() + Y_PADDING;
}
max_label_width += 20;
for (int index = 0; index < m_labels.length; index++) {
JComponent comp = m_controls[index];
int comp_width = parent.getWidth() - max_label_width - 10;
comp.setSize(new Dimension(comp_width, m_controls[0].getPreferredSize().height));
comp.setLocation(max_label_width, comp.getY());
}
}
public Dimension minimumLayoutSize(Container parent) {
return new Dimension(50, 50);
}
public Dimension preferredLayoutSize(Container parent) {
return getPreferredSize();
}
public void removeLayoutComponent(Component comp) {
}
}
public class InfoPanel extends JPanel {
public InfoPanel(LayoutManager layout) {
super(layout);
}
public Dimension getPreferredSize() {
JLabel label = m_labels[0];
return new Dimension(100, label.getHeight() * (m_labels.length + 1) + 10);
}
}
}
|
[
"[email protected]"
] | |
620a3c4bb31860c964c055652ead843fb9e40b2a
|
07af209df92e6c247d12f76b91f2f2e2edfb46f0
|
/SchildtExamples/Java 7 Schildt/6/6_ErrMsg/src/ErrMsg.java
|
c44418197a2fd80143dd7f83e782c18095470b7c
|
[] |
no_license
|
michaelzherdev/Java
|
7d19bf3358ce5d4cbb4774cdf86488aef9d26bb4
|
5b71e9b42814304d1128d696c91bb97f301a5d99
|
refs/heads/master
| 2021-01-10T06:31:36.341504
| 2015-10-15T19:31:46
| 2015-10-15T19:31:46
| 44,328,179
| 0
| 0
| null | null | null | null |
WINDOWS-1251
|
Java
| false
| false
| 581
|
java
|
// Возврат объекта типа String
class ErrorMsg {
String msgs[] = {
"Output Error",
"Input Error",
"Disk Full",
"Index Out-Of-Bounds"
};
// возвратить объект типа String в виде сообщения об ошибке
String getErrorMsg(int i) {
if(i >= 0 & i < msgs.length)
return msgs[i];
else
return "Invalid Error Code";
}
}
public class ErrMsg {
public static void main(String[] args) {
ErrorMsg err = new ErrorMsg();
System.out.println(err.getErrorMsg(2));
System.out.println(err.getErrorMsg(19));
}
}
|
[
"[email protected]"
] | |
f85178016d22c5e217b20c8287065c7dd9cb0f9e
|
1c5fd654b46d3fb018032dc11aa17552b64b191c
|
/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/ansi/AnsiOutputTests.java
|
6e59d740f24ab58f43bc056d11cd4fee2bbf5fb8
|
[
"Apache-2.0"
] |
permissive
|
yangfancoming/spring-boot-build
|
6ce9b97b105e401a4016ae4b75964ef93beeb9f1
|
3d4b8cbb8fea3e68617490609a68ded8f034bc67
|
refs/heads/master
| 2023-01-07T11:10:28.181679
| 2021-06-21T11:46:46
| 2021-06-21T11:46:46
| 193,871,877
| 0
| 0
|
Apache-2.0
| 2022-12-27T14:52:46
| 2019-06-26T09:19:40
|
Java
|
UTF-8
|
Java
| false
| false
| 780
|
java
|
package org.springframework.boot.ansi;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.springframework.boot.ansi.AnsiOutput.Enabled;
import static org.assertj.core.api.Assertions.assertThat;
/**
* Tests for {@link AnsiOutput}.
*
* @author Phillip Webb
*/
public class AnsiOutputTests {
@BeforeClass
public static void enable() {
AnsiOutput.setEnabled(Enabled.ALWAYS);
}
@AfterClass
public static void reset() {
AnsiOutput.setEnabled(Enabled.DETECT);
}
@Test
public void encoding() {
String encoded = AnsiOutput.toString("A", AnsiColor.RED, AnsiStyle.BOLD, "B",
AnsiStyle.NORMAL, "D", AnsiColor.GREEN, "E", AnsiStyle.FAINT, "F");
assertThat(encoded).isEqualTo("A[31;1mB[0mD[32mE[2mF[0;39m");
}
}
|
[
"[email protected]"
] | |
840ce9465b4098ddc4e59e8945e44a29d00d96d3
|
2415850be1a65a5f546c0e4ad0a30913a5547b03
|
/java/com/android/dialer/voicemail/settings/RecordVoicemailGreetingActivity.java
|
89e45dca7f67db1bc53c2eb0edc9eb9f48764151
|
[
"Apache-2.0"
] |
permissive
|
LineageOS/android_packages_apps_Dialer
|
fb5a262b9dc983bb665a968e6a6e8bca3a4d1420
|
3ff6f1dfe79ceff169131c7203f8394f0f973c0f
|
refs/heads/lineage-18.1
| 2023-09-01T13:18:46.937045
| 2023-08-01T18:25:41
| 2023-08-01T18:25:41
| 75,641,878
| 48
| 339
|
NOASSERTION
| 2021-04-24T19:04:15
| 2016-12-05T15:59:32
|
Java
|
UTF-8
|
Java
| false
| false
| 3,823
|
java
|
/*
* Copyright (C) 2018 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
*/
package com.android.dialer.voicemail.settings;
import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.IntDef;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/** Activity for recording a new voicemail greeting */
public class RecordVoicemailGreetingActivity extends Activity implements OnClickListener {
/** Possible states of RecordButton and RecordVoicemailGreetingActivity */
@Retention(RetentionPolicy.SOURCE)
@IntDef({
RECORD_GREETING_INIT,
RECORD_GREETING_RECORDING,
RECORD_GREETING_RECORDED,
RECORD_GREETING_PLAYING_BACK
})
public @interface ButtonState {}
public static final int RECORD_GREETING_INIT = 1;
public static final int RECORD_GREETING_RECORDING = 2;
public static final int RECORD_GREETING_RECORDED = 3;
public static final int RECORD_GREETING_PLAYING_BACK = 4;
public static final int MAX_GREETING_DURATION_MS = 45000;
private int currentState;
private int duration;
private RecordButton recordButton;
private Button saveButton;
private Button redoButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_record_voicemail_greeting);
recordButton = findViewById(R.id.record_button);
saveButton = findViewById(R.id.save_button);
redoButton = findViewById(R.id.redo_button);
duration = 0;
setState(RECORD_GREETING_INIT);
recordButton.setOnClickListener(this);
}
@Override
public void onClick(View v) {
if (v == recordButton) {
switch (currentState) {
case RECORD_GREETING_INIT:
setState(RECORD_GREETING_RECORDING);
break;
case RECORD_GREETING_RECORDED:
setState(RECORD_GREETING_PLAYING_BACK);
break;
case RECORD_GREETING_RECORDING:
case RECORD_GREETING_PLAYING_BACK:
setState(RECORD_GREETING_RECORDED);
break;
default:
break;
}
}
}
private void setState(@ButtonState int state) {
currentState = state;
switch (state) {
case RECORD_GREETING_INIT:
recordButton.setState(state);
recordButton.setTracks(0, 0);
setSaveRedoButtonsEnabled(false);
break;
case RECORD_GREETING_PLAYING_BACK:
case RECORD_GREETING_RECORDED:
recordButton.setState(state);
recordButton.setTracks(0, (float) duration / MAX_GREETING_DURATION_MS);
setSaveRedoButtonsEnabled(true);
break;
case RECORD_GREETING_RECORDING:
recordButton.setState(state);
recordButton.setTracks(0, 1f);
setSaveRedoButtonsEnabled(false);
break;
default:
break;
}
}
/** Enables/Disables save and redo buttons in the layout */
private void setSaveRedoButtonsEnabled(boolean enabled) {
if (enabled) {
saveButton.setVisibility(View.VISIBLE);
redoButton.setVisibility(View.VISIBLE);
} else {
saveButton.setVisibility(View.GONE);
redoButton.setVisibility(View.GONE);
}
}
}
|
[
"[email protected]"
] | |
f0f9193bf1287045c5d4b396e8a645e698d82750
|
2a040f5cb47915a58ff47e3a95fbb8e53ce09b5a
|
/app/src/main/java/com/farm/ui/Fragment_CommandDetail.java
|
61b53917a02cf8488bf7e402589d92b16353677e
|
[] |
no_license
|
githubwithme/farm
|
7ad23f520f289de716c76baa93e9b6f8427da5ce
|
34827ce4eb2db66c5057c384cc79344d91c85710
|
refs/heads/master
| 2020-12-12T13:56:05.409508
| 2016-02-26T08:03:37
| 2016-02-26T08:03:37
| 48,423,210
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 5,166
|
java
|
package com.farm.ui;
import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.alibaba.fastjson.JSON;
import com.farm.R;
import com.farm.adapter.Command_ExecuteArea_Adapter;
import com.farm.app.AppConfig;
import com.farm.app.AppContext;
import com.farm.bean.Result;
import com.farm.bean.commandtab;
import com.farm.bean.commembertab;
import com.farm.common.utils;
import com.lidroid.xutils.HttpUtils;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.RequestParams;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest;
import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EFragment;
import org.androidannotations.annotations.ViewById;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ${hmj} on 2016/1/20.
*/
@EFragment
public class Fragment_CommandDetail extends Fragment
{
Command_ExecuteArea_Adapter listAdapter;
commandtab commandtab;
@ViewById
LinearLayout ll_flyl;
@ViewById
ListView lv;
@ViewById
TextView tv_zyts;
@ViewById
TextView tv_cmdname;
@ViewById
TextView tv_yl;
@ViewById
TextView tv_note;
@ViewById
TextView tv_qx;
@AfterViews
void afterOncreate()
{
getListData();
showData();
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View rootView = inflater.inflate(R.layout.fragment_commanddetail, container, false);
commandtab = getArguments().getParcelable("bean");
return rootView;
}
private void getListData()
{
commembertab commembertab = AppContext.getUserInfo(getActivity());
RequestParams params = new RequestParams();
params.addQueryStringParameter("comID", commandtab.getId());
params.addQueryStringParameter("userid", commembertab.getId());
params.addQueryStringParameter("uid", commembertab.getuId());
params.addQueryStringParameter("username", commembertab.getuserName());
params.addQueryStringParameter("page_size", "10");
params.addQueryStringParameter("page_index", "10");
params.addQueryStringParameter("action", "commandGetListBycomID");
HttpUtils http = new HttpUtils();
http.send(HttpRequest.HttpMethod.POST, AppConfig.testurl, params, new RequestCallBack<String>()
{
@Override
public void onSuccess(ResponseInfo<String> responseInfo)
{
String a = responseInfo.result;
List<commandtab> listNewData = null;
Result result = JSON.parseObject(responseInfo.result, Result.class);
if (result.getResultCode() == 1)// -1出错;0结果集数量为0;结果列表
{
if (result.getAffectedRows() != 0)
{
listNewData = JSON.parseArray(result.getRows().toJSONString(), commandtab.class);
listAdapter = new Command_ExecuteArea_Adapter(getActivity(), listNewData);
lv.setAdapter(listAdapter);
utils.setListViewHeight(lv);
} else
{
listNewData = new ArrayList<commandtab>();
}
} else
{
AppContext.makeToast(getActivity(), "error_connectDataBase");
return;
}
}
@Override
public void onFailure(HttpException e, String s)
{
}
});
}
private void showData()
{
String[] nongzi = commandtab.getnongziName().split(",");
String flyl = "";
for (int i = 0; i < nongzi.length; i++)
{
flyl = flyl + nongzi[i] + " ; ";
}
tv_note.setText(commandtab.getcommNote());
tv_yl.setText(flyl);
tv_zyts.setText(commandtab.getcommDays() + "天");
tv_qx.setText(commandtab.getcommComDate());
if (commandtab.getstdJobType().equals("-1"))
{
ll_flyl.setVisibility(View.GONE);
if (commandtab.getcommNote().equals(""))
{
tv_cmdname.setText("暂无说明");
} else
{
tv_cmdname.setText(commandtab.getcommNote());
}
} else if (commandtab.getstdJobType().equals("0"))
{
if (commandtab.getcommNote().equals(""))
{
tv_cmdname.setText("暂无说明");
} else
{
tv_cmdname.setText(commandtab.getcommNote());
}
} else
{
tv_cmdname.setText(commandtab.getstdJobTypeName() + "——" + commandtab.getstdJobName());
}
}
}
|
[
"[email protected]"
] | |
f5e0c3ee356a6377cb51742d6f1a5027c71d526a
|
e45bdfe09f5abddcccbcbf44ca532729c6480123
|
/IDEA2020.1.1/springmvc_study/springmvc-intercept/src/main/java/com/wang/Interceptor/LJ1.java
|
bbcaa7537e2f8071033d943429da389a17d11386
|
[] |
no_license
|
18222137497/Learning-path
|
71417330650c326637290cbbb9c77375a284b94f
|
12a415ffce3ba8528666792ad99b8c9e6f9d107f
|
refs/heads/master
| 2023-03-12T06:37:09.380592
| 2021-02-23T10:18:32
| 2021-02-23T10:18:32
| 303,752,409
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 960
|
java
|
package com.wang.Interceptor;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class LJ1 implements HandlerInterceptor {
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
System.out.println("执行了拦截器-----前2");
return true;
}
@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
System.out.println("执行了拦截器-----后2");
}
@Override
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
System.out.println("执行了拦截器-----最终2");
}
}
|
[
"[email protected]"
] | |
d7d75bd1bfa3ff875f627a98efa098ffaf7f267d
|
3dbbfac39ac33d3fabec60b290118b361736f897
|
/leetcode/872-Leaf-Similar Trees.java
|
6d43cb13dfc6218f744d939c430a542cf5f9188e
|
[] |
no_license
|
joshua-qa/PS
|
7e0a61f764f7746e6b3c693c103da06b845552b7
|
c49c0b377f85c483b6d274806afb0cbc534500b7
|
refs/heads/master
| 2023-05-28T15:01:28.709522
| 2023-05-21T04:46:29
| 2023-05-21T04:46:29
| 77,836,098
| 7
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,094
|
java
|
// 1ms. 트리 순회법을 알고 있으면 5분 컷
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
* this.left = left;
* this.right = right;
* }
* }
*/
class Solution {
public boolean leafSimilar(TreeNode root1, TreeNode root2) {
List<Integer> leaf1 = new ArrayList<>();
List<Integer> leaf2 = new ArrayList<>();
dfs(root1, leaf1);
dfs(root2, leaf2);
return leaf1.equals(leaf2);
}
private void dfs(TreeNode curr, List<Integer> leafs) {
if (curr == null) {
return;
}
if (curr.left == null && curr.right == null) {
leafs.add(curr.val);
return;
}
if (curr.left != null) {
dfs(curr.left, leafs);
}
if (curr.right != null) {
dfs(curr.right, leafs);
}
}
}
|
[
"[email protected]"
] | |
cd2c11b2a009871b76522fc6809f2eb2d7eb1653
|
bc639d15bcc35b6e58f97ca02bee2dc66eba894b
|
/src/com/vmware/vim25/ArrayOfHostPortGroupPort.java
|
1358b3f57edf30c4ab64fb75db3248438a295109
|
[
"BSD-3-Clause"
] |
permissive
|
benn-cs/vijava
|
db473c46f1a4f449e52611055781f9cfa921c647
|
14fd6b5d2f1407bc981b3c56433c30a33e8d74ab
|
refs/heads/master
| 2021-01-19T08:15:17.194988
| 2013-07-11T05:17:08
| 2013-07-11T05:17:08
| 7,495,841
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,151
|
java
|
/*================================================================================
Copyright (c) 2012 Steve Jin. All Rights Reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of VMware, Inc. nor the names of its contributors may be used
to endorse or promote products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL VMWARE, INC. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
================================================================================*/
package com.vmware.vim25;
/**
* @author Steve Jin (http://www.doublecloud.org)
* @version 5.1
*/
public class ArrayOfHostPortGroupPort {
public HostPortGroupPort[] HostPortGroupPort;
public HostPortGroupPort[] getHostPortGroupPort() {
return this.HostPortGroupPort;
}
public HostPortGroupPort getHostPortGroupPort(int i) {
return this.HostPortGroupPort[i];
}
public void setHostPortGroupPort(HostPortGroupPort[] HostPortGroupPort) {
this.HostPortGroupPort=HostPortGroupPort;
}
}
|
[
"sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1"
] |
sjin2008@3374d856-466b-4dc9-8cc5-e1e8506a9ea1
|
26549c821f6b5e4dc42d6e67161e40169c14b2e5
|
d13e942b46aeb2c88b726aa438b987770eaba116
|
/Development of online data-driven monitoring methodologies and piloting analytical and monitoring tools by the State Audit Service of Ukraine/Public Dashboard/Back-End/src/main/java/com/datapath/sasu/integration/prozorro/tendering/containers/AwardAPI.java
|
641f1516d6d64d7591e97c122c0692f5f0b76f19
|
[] |
no_license
|
EBRD-ProzorroA7-RiskIndicators-SASU/Ukraine-Development-of-online-data-driven-monitoring-methodologies-and-piloting-analytical-tools
|
7f01956b454cfb8f2fa7821e713898068c3db81f
|
2a67c467c878e57f1ee81aef3b49f409bd8e2658
|
refs/heads/main
| 2023-06-18T23:18:28.367265
| 2021-07-13T18:22:10
| 2021-07-13T18:22:10
| 333,778,176
| 0
| 0
| null | 2021-01-28T14:09:57
| 2021-01-28T14:09:56
| null |
UTF-8
|
Java
| false
| false
| 200
|
java
|
package com.datapath.sasu.integration.prozorro.tendering.containers;
import lombok.Data;
@Data
public class AwardAPI {
private String id;
private Value value;
private String status;
}
|
[
"[email protected]"
] | |
ce3ad9318857517e469b2b368babe009799644e4
|
dda81b93a12e0695dc1c85a6a8ca3785f2e36e23
|
/spigot/work/decompile-93a89a75/net/minecraft/server/BiomeJungle.java
|
d6bbb01a949ee23aef6c0bb928819cced68209fa
|
[] |
no_license
|
skychwang/MindCraft
|
a4a8a337738b884af6ecc65c133b314418757a7d
|
48923ed1c2b9fbc807a61619cc17001312082b83
|
refs/heads/master
| 2023-07-20T14:36:48.872240
| 2021-09-07T20:00:04
| 2021-09-07T20:00:04
| 336,148,107
| 2
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,962
|
java
|
package net.minecraft.server;
public final class BiomeJungle extends BiomeBase {
public BiomeJungle() {
super((new BiomeBase.a()).a(WorldGenSurface.G, WorldGenSurface.v).a(BiomeBase.Precipitation.RAIN).a(BiomeBase.Geography.JUNGLE).a(0.1F).b(0.2F).c(0.95F).d(0.9F).a(4159204).b(329011).a((String) null));
this.a(WorldGenerator.JUNGLE_TEMPLE, (WorldGenFeatureConfiguration) WorldGenFeatureConfiguration.e);
this.a(WorldGenerator.MINESHAFT, (WorldGenFeatureConfiguration) (new WorldGenMineshaftConfiguration(0.004D, WorldGenMineshaft.Type.NORMAL)));
this.a(WorldGenerator.STRONGHOLD, (WorldGenFeatureConfiguration) WorldGenFeatureConfiguration.e);
BiomeDecoratorGroups.a(this);
BiomeDecoratorGroups.c(this);
BiomeDecoratorGroups.d(this);
BiomeDecoratorGroups.f(this);
BiomeDecoratorGroups.g(this);
BiomeDecoratorGroups.h(this);
BiomeDecoratorGroups.l(this);
BiomeDecoratorGroups.r(this);
BiomeDecoratorGroups.C(this);
BiomeDecoratorGroups.V(this);
BiomeDecoratorGroups.I(this);
BiomeDecoratorGroups.Z(this);
BiomeDecoratorGroups.aa(this);
BiomeDecoratorGroups.am(this);
BiomeDecoratorGroups.ac(this);
BiomeDecoratorGroups.ap(this);
this.a(EnumCreatureType.CREATURE, new BiomeBase.BiomeMeta(EntityTypes.SHEEP, 12, 4, 4));
this.a(EnumCreatureType.CREATURE, new BiomeBase.BiomeMeta(EntityTypes.PIG, 10, 4, 4));
this.a(EnumCreatureType.CREATURE, new BiomeBase.BiomeMeta(EntityTypes.CHICKEN, 10, 4, 4));
this.a(EnumCreatureType.CREATURE, new BiomeBase.BiomeMeta(EntityTypes.COW, 8, 4, 4));
this.a(EnumCreatureType.CREATURE, new BiomeBase.BiomeMeta(EntityTypes.PARROT, 40, 1, 2));
this.a(EnumCreatureType.CREATURE, new BiomeBase.BiomeMeta(EntityTypes.PANDA, 1, 1, 2));
this.a(EnumCreatureType.CREATURE, new BiomeBase.BiomeMeta(EntityTypes.CHICKEN, 10, 4, 4));
this.a(EnumCreatureType.AMBIENT, new BiomeBase.BiomeMeta(EntityTypes.BAT, 10, 8, 8));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.SPIDER, 100, 4, 4));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.ZOMBIE, 95, 4, 4));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.ZOMBIE_VILLAGER, 5, 1, 1));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.SKELETON, 100, 4, 4));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.CREEPER, 100, 4, 4));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.SLIME, 100, 4, 4));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.ENDERMAN, 10, 1, 4));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.WITCH, 5, 1, 1));
this.a(EnumCreatureType.MONSTER, new BiomeBase.BiomeMeta(EntityTypes.OCELOT, 2, 1, 1));
}
}
|
[
"[email protected]"
] | |
3ec8ae79bc71a669a1f0b8f55935163849677a4c
|
939768bc793510deefdbb3db10c6116c02275020
|
/src/main/java/org/silnith/browser/model/NavigationListener.java
|
4f344f19ac263a1859576aa6cf22ed774efbcd97
|
[] |
no_license
|
silnith/responsive-browser
|
87229ffeabebb4cd21657b5178efcd3af19105fe
|
8951c43ac45d35a32c2e2e8b6645166ef2ef9180
|
refs/heads/master
| 2021-01-10T03:52:07.535073
| 2016-01-29T20:13:12
| 2016-01-29T20:13:12
| 50,687,823
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,277
|
java
|
package org.silnith.browser.model;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;
import org.silnith.browser.ui.NavigationPanel;
public class NavigationListener implements ActionListener {
private final BrowsingContext browsingContext;
private final NavigationPanel navigationPanel;
public NavigationListener(final BrowsingContext browsingContext, final NavigationPanel navigationPanel) {
super();
this.browsingContext = browsingContext;
this.navigationPanel = navigationPanel;
}
@Override
public void actionPerformed(final ActionEvent event) {
assert EventQueue.isDispatchThread();
navigationPanel.clearErrors();
final String location = event.getActionCommand();
try {
final URL url = new URL(location);
final NavigationRequest navigationRequest = new NavigationRequest(url);
browsingContext.startNewNavigation(navigationRequest);
} catch (final MalformedURLException e) {
navigationPanel.showError(e);
}
}
}
|
[
"[email protected]"
] | |
33006c6117a64be7465464cc6a48a5fc15eca196
|
973ae40f2d3e2faba81155d3ec61c0f858e7017d
|
/mobile/src/main/java/com/shadow/manga/listeners/RecyclerEndlessOnScollListener.java
|
681825c79cbdad76c44cbabe0b78d974e5fef056
|
[] |
no_license
|
ShaneRich5/manga-app-android
|
879ac17a77b9f74fa18c207c18e7a9d77e549a69
|
b19854300c68651e807e3dac18c3e78d8af117ed
|
refs/heads/master
| 2016-08-05T11:28:17.997742
| 2015-05-18T16:57:27
| 2015-05-18T16:57:27
| 35,646,893
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,577
|
java
|
package com.shadow.manga.listeners;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
/**
* Created by Shane on 5/18/2015.
*/
public abstract class RecyclerEndlessOnScollListener extends RecyclerView.OnScrollListener{
private int previousTotal = 0;
private boolean loading = true;
private int visibleThreshold = 5;
private int firstVisibleItem, visibleItemCount, totalItemCount;
private int currentPage = 0;
private LinearLayoutManager mLinearLayoutManager;
public RecyclerEndlessOnScollListener(LinearLayoutManager mLinearLayoutManager) {
this.mLinearLayoutManager = mLinearLayoutManager;
}
@Override
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
visibleItemCount = recyclerView.getChildCount();
totalItemCount = mLinearLayoutManager.getItemCount();
firstVisibleItem = mLinearLayoutManager.findFirstVisibleItemPosition();
if (loading) {
if (totalItemCount > previousTotal) {
loading = false;
previousTotal = totalItemCount;
}
}
if (!loading && (totalItemCount - visibleItemCount)
<= (firstVisibleItem + visibleThreshold)) {
// End has been reached
// Do something
currentPage++;
onLoadMore(currentPage);
loading = true;
}
}
public abstract void onLoadMore(int currentPage);
}
|
[
"[email protected]"
] | |
ca144f834160c61631953be323a947467d9e86bf
|
58f9ed107e610a612af459d8231fbe97dd0c814f
|
/src/main/java/com/ht/extra/pojo/comm/PhamDict.java
|
52dfd3d91ac9c2d92a86698fc856a65823275a6e
|
[] |
no_license
|
tangguoqiang/htwebExtra
|
3bee6434a87e9333d80eeb391f80dfb72178675d
|
ca9d50a66586905d5164f6087b7778f233a1fd13
|
refs/heads/master
| 2020-03-15T13:13:57.645083
| 2018-08-22T12:54:44
| 2018-08-22T12:54:44
| 132,161,700
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,441
|
java
|
package com.ht.extra.pojo.comm;
public class PhamDict {
private String phamStdCode;
private String phamName;
private String phamSpec;
private String phamUnit;
private String phamForm;
private String toxicologyProperty;
private Long stdDose;
private String materialProperty;
private Integer dividePackDose;
private String conditionOfStorage;
public String getPhamStdCode() {
return phamStdCode;
}
public void setPhamStdCode(String phamStdCode) {
this.phamStdCode = phamStdCode == null ? null : phamStdCode.trim();
}
public String getPhamName() {
return phamName;
}
public void setPhamName(String phamName) {
this.phamName = phamName == null ? null : phamName.trim();
}
public String getPhamSpec() {
return phamSpec;
}
public void setPhamSpec(String phamSpec) {
this.phamSpec = phamSpec == null ? null : phamSpec.trim();
}
public String getPhamUnit() {
return phamUnit;
}
public void setPhamUnit(String phamUnit) {
this.phamUnit = phamUnit == null ? null : phamUnit.trim();
}
public String getPhamForm() {
return phamForm;
}
public void setPhamForm(String phamForm) {
this.phamForm = phamForm == null ? null : phamForm.trim();
}
public String getToxicologyProperty() {
return toxicologyProperty;
}
public void setToxicologyProperty(String toxicologyProperty) {
this.toxicologyProperty = toxicologyProperty == null ? null : toxicologyProperty.trim();
}
public Long getStdDose() {
return stdDose;
}
public void setStdDose(Long stdDose) {
this.stdDose = stdDose;
}
public String getMaterialProperty() {
return materialProperty;
}
public void setMaterialProperty(String materialProperty) {
this.materialProperty = materialProperty == null ? null : materialProperty.trim();
}
public Integer getDividePackDose() {
return dividePackDose;
}
public void setDividePackDose(Integer dividePackDose) {
this.dividePackDose = dividePackDose;
}
public String getConditionOfStorage() {
return conditionOfStorage;
}
public void setConditionOfStorage(String conditionOfStorage) {
this.conditionOfStorage = conditionOfStorage == null ? null : conditionOfStorage.trim();
}
}
|
[
"[email protected]"
] | |
7f75d39c7799b36b557b2ee1e9674f550d1f20a2
|
9b56c1a7ff68cec78d2d469242dc396fc9fd7b02
|
/bin/platform/bootstrap/gensrc/de/hybris/platform/impex/model/exp/ImpExExportMediaModel.java
|
1c2b40e1824501846f10bef9b47014f9175e4874
|
[] |
no_license
|
noiz23/TourHy
|
e32f411786c140e08b977dbe89f912061f47ce7f
|
8379099898362e7c697c6ef22ae988c85e41eae3
|
refs/heads/master
| 2020-04-11T08:14:00.193050
| 2019-01-03T10:15:13
| 2019-01-03T10:15:13
| 161,634,988
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,629
|
java
|
/*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! ---
* --- Generated at Dec 31, 2018 5:45:51 AM ---
* ----------------------------------------------------------------
*
* [y] hybris Platform
*
* Copyright (c) 2000-2016 SAP SE
* All rights reserved.
*
* This software is the confidential and proprietary information of SAP
* Hybris ("Confidential Information"). You shall not disclose such
* Confidential Information and shall use it only in accordance with the
* terms of the license agreement you entered into with SAP Hybris.
*
*/
package de.hybris.platform.impex.model.exp;
import de.hybris.platform.catalog.model.CatalogVersionModel;
import de.hybris.platform.core.model.ItemModel;
import de.hybris.platform.impex.model.ImpExMediaModel;
import de.hybris.platform.servicelayer.model.ItemModelContext;
/**
* Generated model class for type ImpExExportMedia first defined at extension impex.
*/
@SuppressWarnings("all")
public class ImpExExportMediaModel extends ImpExMediaModel
{
/**<i>Generated model type code constant.</i>*/
public final static String _TYPECODE = "ImpExExportMedia";
/**
* <i>Generated constructor</i> - Default constructor for generic creation.
*/
public ImpExExportMediaModel()
{
super();
}
/**
* <i>Generated constructor</i> - Default constructor for creation with existing context
* @param ctx the model context to be injected, must not be null
*/
public ImpExExportMediaModel(final ItemModelContext ctx)
{
super(ctx);
}
/**
* <i>Generated constructor</i> - Constructor with all mandatory attributes.
* @deprecated Since 4.1.1 Please use the default constructor without parameters
* @param _catalogVersion initial attribute declared by type <code>ImpExMedia</code> at extension <code>catalog</code>
* @param _code initial attribute declared by type <code>Media</code> at extension <code>core</code>
* @param _linesToSkip initial attribute declared by type <code>ImpExMedia</code> at extension <code>impex</code>
* @param _removeOnSuccess initial attribute declared by type <code>ImpExMedia</code> at extension <code>impex</code>
*/
@Deprecated
public ImpExExportMediaModel(final CatalogVersionModel _catalogVersion, final String _code, final int _linesToSkip, final boolean _removeOnSuccess)
{
super();
setCatalogVersion(_catalogVersion);
setCode(_code);
setLinesToSkip(_linesToSkip);
setRemoveOnSuccess(_removeOnSuccess);
}
/**
* <i>Generated constructor</i> - for all mandatory and initial attributes.
* @deprecated Since 4.1.1 Please use the default constructor without parameters
* @param _catalogVersion initial attribute declared by type <code>ImpExMedia</code> at extension <code>catalog</code>
* @param _code initial attribute declared by type <code>Media</code> at extension <code>core</code>
* @param _linesToSkip initial attribute declared by type <code>ImpExMedia</code> at extension <code>impex</code>
* @param _owner initial attribute declared by type <code>Item</code> at extension <code>core</code>
* @param _removeOnSuccess initial attribute declared by type <code>ImpExMedia</code> at extension <code>impex</code>
*/
@Deprecated
public ImpExExportMediaModel(final CatalogVersionModel _catalogVersion, final String _code, final int _linesToSkip, final ItemModel _owner, final boolean _removeOnSuccess)
{
super();
setCatalogVersion(_catalogVersion);
setCode(_code);
setLinesToSkip(_linesToSkip);
setOwner(_owner);
setRemoveOnSuccess(_removeOnSuccess);
}
}
|
[
"ruben.echeverri"
] |
ruben.echeverri
|
b1041c03667d4f5f375cc56789bbf90ea8de6d87
|
ae9d72e8e4493ec5baa492db35eaf148357975ae
|
/servlet/api/src/test/java/javax/servlet/http/TestHttpFilter.java
|
46796a6eaf9b63ba045757e13c9917456c1b8644
|
[
"BSD-3-Clause"
] |
permissive
|
PratesLab/piranha
|
49d00804dbeaa233c619bbeaf45a723fbb2feb3b
|
1b03e72752aee4a70e5ce5ba90a938d9937ac851
|
refs/heads/master
| 2023-01-14T01:45:50.312653
| 2020-08-13T14:25:14
| 2020-08-13T14:25:14
| 287,337,057
| 0
| 0
|
BSD-3-Clause
| 2020-11-22T21:14:14
| 2020-08-13T17:09:00
| null |
UTF-8
|
Java
| false
| false
| 2,508
|
java
|
/*
* Copyright (c) 2002-2020 Manorrock.com. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package javax.servlet.http;
import java.io.IOException;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
/**
* A Test HttpFilter.
*
* @author Manfred Riem ([email protected])
*/
public class TestHttpFilter extends HttpFilter {
/**
* Constructor.
*/
public TestHttpFilter() {
}
/**
* Do filter.
*
* @param request the request.
* @param response the response.
* @param chain the filter chain.
* @throws IOException when an I/O error occurs.
* @throws ServletException when a Servlet error occurs.
*/
@Override
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
throw new UnsupportedOperationException("Not supported yet.");
}
}
|
[
"[email protected]"
] | |
f06bfa94053111e70b2a22938ffae29b8b4bc8ae
|
473fc28d466ddbe9758ca49c7d4fb42e7d82586e
|
/app/src/main/java/com/syd/source/aosp/external/mockftpserver/tags/2.0-rc1/MockFtpServer/src/test/java/org/mockftpserver/core/util/PortParserTest.java
|
ee3e60e39347af39540a3287eed3bd8cf5f3fc35
|
[
"Apache-2.0"
] |
permissive
|
lz-purple/Source
|
a7788070623f2965a8caa3264778f48d17372bab
|
e2745b756317aac3c7a27a4c10bdfe0921a82a1c
|
refs/heads/master
| 2020-12-23T17:03:12.412572
| 2020-01-31T01:54:37
| 2020-01-31T01:54:37
| 237,205,127
| 4
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,229
|
java
|
/*
* Copyright 2008 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.mockftpserver.core.util;
import org.apache.log4j.Logger;
import org.mockftpserver.core.CommandSyntaxException;
import org.mockftpserver.test.AbstractTest;
import java.net.InetAddress;
import java.net.UnknownHostException;
/**
* Tests for the PortParser class
*
* @author Chris Mair
* @version $Revision$ - $Date$
*/
public final class PortParserTest extends AbstractTest {
private static final Logger LOG = Logger.getLogger(PortParserTest.class);
private static final String[] PARAMETERS = new String[]{"192", "22", "250", "44", "1", "206"};
private static final String[] PARAMETERS_INSUFFICIENT = new String[]{"7", "29", "99", "11", "77"};
private static final int PORT = (1 << 8) + 206;
private static final InetAddress HOST = inetAddress("192.22.250.44");
/**
* Test the parseHost() method
*
* @throws java.net.UnknownHostException
*/
public void testParseHost() throws UnknownHostException {
InetAddress host = PortParser.parseHost(PARAMETERS);
assertEquals("InetAddress", HOST, host);
}
/**
* Test the parsePortNumber() method
*/
public void testParsePortNumber() {
int portNumber = PortParser.parsePortNumber(PARAMETERS);
assertEquals("portNumber", PORT, portNumber);
}
/**
* Test the parseHost() method, passing in null
*
* @throws java.net.UnknownHostException
*/
public void testParseHost_Null() throws UnknownHostException {
try {
PortParser.parseHost(null);
fail("Expected CommandSyntaxException");
}
catch (CommandSyntaxException expected) {
LOG.info("Expected: " + expected);
}
}
/**
* Test the parseHost() method, passing in a String[] with not enough parameters
*
* @throws java.net.UnknownHostException
*/
public void testParseHost_InsufficientParameters() throws UnknownHostException {
try {
PortParser.parseHost(PARAMETERS_INSUFFICIENT);
fail("Expected CommandSyntaxException");
}
catch (CommandSyntaxException expected) {
LOG.info("Expected: " + expected);
}
}
/**
* Test the parsePortNumber() method, passing in null
*
* @throws java.net.UnknownHostException
*/
public void testParsePortNumber_Null() throws UnknownHostException {
try {
PortParser.parsePortNumber(null);
fail("Expected CommandSyntaxException");
}
catch (CommandSyntaxException expected) {
LOG.info("Expected: " + expected);
}
}
/**
* Test the parsePortNumber() method, passing in a String[] with not enough parameters
*
* @throws java.net.UnknownHostException
*/
public void testParsePortNumber_InsufficientParameters() throws UnknownHostException {
try {
PortParser.parsePortNumber(PARAMETERS_INSUFFICIENT);
fail("Expected CommandSyntaxException");
}
catch (CommandSyntaxException expected) {
LOG.info("Expected: " + expected);
}
}
/**
* Test convertHostAndPortToStringOfBytes() method
*/
public void testConvertHostAndPortToStringOfBytes() throws UnknownHostException {
int port = (23 << 8) + 77;
InetAddress host = InetAddress.getByName("196.168.44.55");
String result = PortParser.convertHostAndPortToCommaDelimitedBytes(host, port);
LOG.info("result=" + result);
assertEquals("result", "196,168,44,55,23,77", result);
}
}
|
[
"[email protected]"
] | |
ca250fb88198251a108c7f6cfbb544c9edbd3875
|
cec1602d23034a8f6372c019e5770773f893a5f0
|
/sources/kotlin/annotation/MustBeDocumented.java
|
ee7e765dcda24abdaf2d9fd1530a00677fb12651
|
[] |
no_license
|
sengeiou/zeroner_app
|
77fc7daa04c652a5cacaa0cb161edd338bfe2b52
|
e95ae1d7cfbab5ca1606ec9913416dadf7d29250
|
refs/heads/master
| 2022-03-31T06:55:26.896963
| 2020-01-24T09:20:37
| 2020-01-24T09:20:37
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 668
|
java
|
package kotlin.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import kotlin.Metadata;
@Target({ElementType.ANNOTATION_TYPE})
@Target(allowedTargets = {AnnotationTarget.ANNOTATION_CLASS})
@Metadata(bv = {1, 0, 2}, d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u001b\n\u0000\b\u0002\u0018\u00002\u00020\u0001B\u0000¨\u0006\u0002"}, d2 = {"Lkotlin/annotation/MustBeDocumented;", "", "kotlin-runtime"}, k = 1, mv = {1, 1, 8})
@Retention(RetentionPolicy.RUNTIME)
/* compiled from: Annotations.kt */
public @interface MustBeDocumented {
}
|
[
"[email protected]"
] | |
fc46a77399c74e35089d87e7ee4b71f7ef715af3
|
75e7d1a3ab7e6bf8e9305827aebb787cd6ed94e6
|
/study/thinkinjava/src/main/java/thinkinjava/containers/SlowMap.java
|
4f6798372c092a4d4b5e33a2696a9164e23ac278
|
[
"Apache-2.0"
] |
permissive
|
nickshang/study
|
9f3f8c9b4bfe72a67b54aed24973e9bb941b603a
|
49afda86aa3a816a21d998a8456106a6d78d7cf5
|
refs/heads/master
| 2021-01-22T10:59:36.107512
| 2018-03-01T14:57:24
| 2018-03-01T14:57:24
| 102,343,161
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,807
|
java
|
package thinkinjava.containers;//: containers/SlowMap.java
// A Map implemented with ArrayLists.
import net.mindview.util.Countries;
import java.util.*;
public class SlowMap<K,V> extends AbstractMap<K,V> {
private List<K> keys = new ArrayList<K>();
private List<V> values = new ArrayList<V>();
public V put(K key, V value) {
V oldValue = get(key); // The old value or null
if(!keys.contains(key)) {
keys.add(key);
values.add(value);
} else
values.set(keys.indexOf(key), value);
return oldValue;
}
public V get(Object key) { // key is type Object, not K
if(!keys.contains(key))
return null;
return values.get(keys.indexOf(key));
}
public Set<Entry<K,V>> entrySet() {
Set<Entry<K,V>> set= new HashSet<Entry<K,V>>();
Iterator<K> ki = keys.iterator();
Iterator<V> vi = values.iterator();
while(ki.hasNext())
set.add(new MapEntry<K,V>(ki.next(), vi.next()));
return set;
}
public static void main(String[] args) {
SlowMap<String,String> m= new SlowMap<String,String>();
m.putAll(Countries.capitals(15));
System.out.println(m);
System.out.println(m.get("BULGARIA"));
System.out.println(m.entrySet());
}
} /* Output:
{CAMEROON=Yaounde, CHAD=N'djamena, CONGO=Brazzaville, CAPE VERDE=Praia, ALGERIA=Algiers, COMOROS=Moroni, CENTRAL AFRICAN REPUBLIC=Bangui, BOTSWANA=Gaberone, BURUNDI=Bujumbura, BENIN=Porto-Novo, BULGARIA=Sofia, EGYPT=Cairo, ANGOLA=Luanda, BURKINA FASO=Ouagadougou, DJIBOUTI=Dijibouti}
Sofia
[CAMEROON=Yaounde, CHAD=N'djamena, CONGO=Brazzaville, CAPE VERDE=Praia, ALGERIA=Algiers, COMOROS=Moroni, CENTRAL AFRICAN REPUBLIC=Bangui, BOTSWANA=Gaberone, BURUNDI=Bujumbura, BENIN=Porto-Novo, BULGARIA=Sofia, EGYPT=Cairo, ANGOLA=Luanda, BURKINA FASO=Ouagadougou, DJIBOUTI=Dijibouti]
*///:~
|
[
"[email protected]"
] | |
bd1c280f32b3125628e4d4a609cc587b5455b1a7
|
2e007171683616881b62eb3f1db8b271dc3284d1
|
/axinfu-model/src/main/java/modellib/thrift/payment/QuickPayMethod.java
|
e5e318e8143fb9ad871a36c1bf0be944f97e2a95
|
[
"Apache-2.0"
] |
permissive
|
ZcrPro/axinfu
|
cc85856cefbd4b2050566d2d18f611e664facd9d
|
66fc7c6df4c6ea8a8a01a0008d5165eb6e53f09a
|
refs/heads/master
| 2020-03-20T08:45:38.205203
| 2018-07-09T01:56:39
| 2018-07-09T01:56:39
| 127,858,246
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 362
|
java
|
package modellib.thrift.payment;
import java.io.Serializable;
import java.util.List;
/**
* Created by zcrprozcrpro on 2017/8/1.
*/
public class QuickPayMethod implements Serializable {
public String merchant_code;
public String channel;
public String promotion_hint;
public String assistance_hint;
public List<String> supported_banks;
}
|
[
"[email protected]"
] | |
951c019c97cb947b500b2a788dded0418dc504c4
|
9259bb523e4f2085ca0ae3be84ff3ce861875b9a
|
/common/java/core/net/i2p/client/datagram/I2PDatagramDissector.java
|
945043ea6c145ade9fb7f8c0331fac40ddd1bbb8
|
[
"Unlicense",
"LicenseRef-scancode-public-domain"
] |
permissive
|
PDAHubbard/Nightweb
|
8f607bd48cf72dd7221a3093fc10bac4b53fed88
|
7966ab2bcb87ea92abd6741f6184885afbad6fee
|
refs/heads/master
| 2021-01-22T12:12:22.346366
| 2013-11-26T20:35:57
| 2013-11-26T20:35:57
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 6,991
|
java
|
package net.i2p.client.datagram;
/*
* free (adj.): unencumbered; not under the control of others
* Written by human in 2004 and released into the public domain
* with no warranty of any kind, either expressed or implied.
* It probably won't make your computer catch on fire, or eat
* your children, but it might. Use at your own risk.
*
*/
import java.io.ByteArrayInputStream;
import java.io.IOException;
import net.i2p.I2PAppContext;
import net.i2p.crypto.DSAEngine;
import net.i2p.crypto.SHA256Generator;
import net.i2p.data.DataFormatException;
import net.i2p.data.Destination;
import net.i2p.data.Hash;
import net.i2p.data.Signature;
import net.i2p.util.Log;
/**
* Class for dissecting I2P repliable datagrams, checking the authenticity of
* the sender. Note that objects of this class are NOT THREAD SAFE!
*
* @author human
*/
public final class I2PDatagramDissector {
private static final int DGRAM_BUFSIZE = 32768;
private final DSAEngine dsaEng = DSAEngine.getInstance();
private final SHA256Generator hashGen = SHA256Generator.getInstance();
private Hash rxHash;
private Signature rxSign;
private Destination rxDest;
private final byte[] rxPayload = new byte[DGRAM_BUFSIZE];
private int rxPayloadLen;
private boolean valid;
/**
* Crate a new I2P repliable datagram dissector.
*/
public I2PDatagramDissector() { // nop
}
/**
* Load an I2P repliable datagram into the dissector.
* Does NOT verify the signature.
*
* @param dgram non-null I2P repliable datagram to be loaded
*
* @throws DataFormatException If there's an error in the datagram format
*/
public void loadI2PDatagram(byte[] dgram) throws DataFormatException {
ByteArrayInputStream dgStream = new ByteArrayInputStream(dgram);
// set invalid(very important!)
this.valid = false;
try {
rxDest = new Destination();
rxSign = new Signature();
// read destination
rxDest.readBytes(dgStream);
// read signature
rxSign.readBytes(dgStream);
// read payload
rxPayloadLen = dgStream.read(rxPayload);
// calculate the hash of the payload
this.rxHash = hashGen.calculateHash(rxPayload, 0, rxPayloadLen);
assert this.hashGen.calculateHash(this.extractPayload()).equals(this.rxHash);
} catch (IOException e) {
Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramDissector.class);
log.error("Caught IOException - INCONSISTENT STATE!", e);
} catch(AssertionError e) {
Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramDissector.class);
log.error("Assertion failed!", e);
}
//_log.debug("Datagram payload size: " + rxPayloadLen + "; content:\n"
// + HexDump.dump(rxPayload, 0, rxPayloadLen));
}
/**
* Get the payload carried by an I2P repliable datagram (previously loaded
* with the loadI2PDatagram() method), verifying the datagram signature.
*
* @return A byte array containing the datagram payload
*
* @throws I2PInvalidDatagramException if the signature verification fails
*/
public byte[] getPayload() throws I2PInvalidDatagramException {
this.verifySignature();
return this.extractPayload();
}
/**
* Get the sender of an I2P repliable datagram (previously loaded with the
* loadI2PDatagram() method), verifying the datagram signature.
*
* @return The Destination of the I2P repliable datagram sender
*
* @throws I2PInvalidDatagramException if the signature verification fails
*/
public Destination getSender() throws I2PInvalidDatagramException {
this.verifySignature();
return this.extractSender();
}
/**
* Extract the hash of the payload of an I2P repliable datagram (previously
* loaded with the loadI2PDatagram() method), verifying the datagram
* signature.
* @return The hash of the payload of the I2P repliable datagram
* @throws I2PInvalidDatagramException if the signature verification fails
*/
public Hash getHash() throws I2PInvalidDatagramException {
// make sure it has a valid signature
this.verifySignature();
return this.extractHash();
}
/**
* Extract the payload carried by an I2P repliable datagram (previously
* loaded with the loadI2PDatagram() method), without verifying the
* datagram signature.
*
* @return A byte array containing the datagram payload
*/
public byte[] extractPayload() {
byte[] retPayload = new byte[this.rxPayloadLen];
System.arraycopy(this.rxPayload, 0, retPayload, 0, this.rxPayloadLen);
return retPayload;
}
/**
* Extract the sender of an I2P repliable datagram (previously loaded with
* the loadI2PDatagram() method), without verifying the datagram signature.
*
* @return The Destination of the I2P repliable datagram sender
*/
public Destination extractSender() {
if (this.rxDest == null)
return null;
Destination retDest = new Destination();
try {
retDest.fromByteArray(this.rxDest.toByteArray());
} catch (DataFormatException e) {
Log log = I2PAppContext.getGlobalContext().logManager().getLog(I2PDatagramDissector.class);
log.error("Caught DataFormatException", e);
return null;
}
return retDest;
}
/**
* Extract the hash of the payload of an I2P repliable datagram (previously
* loaded with the loadI2PDatagram() method), without verifying the datagram
* signature.
* @return The hash of the payload of the I2P repliable datagram
*/
public Hash extractHash() {
return this.rxHash;
}
/**
* Verify the signature of this datagram (previously loaded with the
* loadI2PDatagram() method)
* @throws I2PInvalidDatagramException if the signature is invalid
*/
public void verifySignature() throws I2PInvalidDatagramException {
// first check if it already got validated
if(this.valid)
return;
if (rxSign == null || rxSign.getData() == null || rxDest == null || rxDest.getSigningPublicKey() == null)
throw new I2PInvalidDatagramException("Datagram not yet read");
// now validate
if (!this.dsaEng.verifySignature(rxSign, rxHash.getData(), rxDest.getSigningPublicKey()))
throw new I2PInvalidDatagramException("Incorrect I2P repliable datagram signature");
// set validated
this.valid = true;
}
}
|
[
"[email protected]"
] | |
13b32ec30288f4db4fed244aa932960599a2fcf0
|
a94d20a6346d219c84cc97c9f7913f1ce6aba0f8
|
/felles/felles/db/src/main/java/no/nav/vedtak/felles/db/doc/model/Kodeverk.java
|
25de69a8ce1366deb7a4a6f377c8763c086dbcfa
|
[
"MIT"
] |
permissive
|
junnae/spsak
|
3c8a155a1bf24c30aec1f2a3470289538c9de086
|
ede4770de33bd896d62225a9617b713878d1efa5
|
refs/heads/master
| 2020-09-11T01:56:53.748986
| 2019-02-06T08:14:42
| 2019-02-06T08:14:42
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 4,365
|
java
|
package no.nav.vedtak.felles.db.doc.model;
import io.github.swagger2markup.markup.builder.MarkupDocBuilder;
import io.github.swagger2markup.markup.builder.MarkupTableColumn;
import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
public class Kodeverk implements MarkupOutput {
public static final String KODEVERK_PK_SPEC = System.getProperty("doc.plugin.jdbc.kodeverk.pk", "KODE");
public static final Set<String> KODEVERK_UNNTAK_KOLONNER = toList(
System.getProperty("doc.plugin.jdbc.kodeverk.kolonne.unntak",
"ENDRET_AV, OPPRETTET_AV, ENDRET_TID, OPPRETTET_TID"));
private Table table;
private Set<String> unntakKolonner = KODEVERK_UNNTAK_KOLONNER;
public Kodeverk(Table table) {
this.table = table;
}
@Override
public void apply(int sectionLevel, MarkupDocBuilder doc) {
doc.sectionTitleLevel(sectionLevel + 1, table.getName().toUpperCase());
if (!table.isErDelTabell()) table.writeTableComment(doc);
List<MarkupTableColumn> columnSpecs = new ArrayList<>();
for (Column c : table.getColumnsExcept(unntakKolonner)) {
columnSpecs.add(new MarkupTableColumn(c.getName()).withHeaderColumn(c.isPrimaryKey()));
}
final List<java.util.List<String>> cells = new ArrayList<>();
final AtomicInteger i = new AtomicInteger();
table.getRows().forEach(c -> {
if (i.incrementAndGet() >= 1) {
// skipper første rad, inneholder kun headere
cells.add(c);
}
});
if (cells.isEmpty()) {
cells.add(Collections.nCopies(columnSpecs.size(), ""));
}
doc.tableWithColumnSpecs(columnSpecs, cells);
}
public static Set<String> toList(String property) {
Set<String> list = new HashSet<>();
try (@SuppressWarnings("resource")
Scanner scanner = new Scanner(property).useDelimiter(",\\s*");) {
while (scanner.hasNext()) {
list.add(scanner.next());
}
return list;
}
}
public static void readReferenceData(JdbcModel jdbcModel, DataSource ds) throws SQLException {
try (Connection c = ds.getConnection()) {
for (Table table : jdbcModel.getTables()) {
if (table.isKodeverk() || table.isKodeliste()) {
List<Column> selectColumns = table.getColumnsExcept(KODEVERK_UNNTAK_KOLONNER);
readRows(c, table, selectColumns.stream().map(col -> col.getName()).collect(Collectors.toList()));
}
}
}
}
static void readRows(Connection c, Table table, List<String> selectColumns) throws SQLException {
int numRows = 0;
try (PreparedStatement ps = c
.prepareStatement("select " + String.join(", ", selectColumns) + " from " + table.getName());
ResultSet rs = ps.executeQuery();
) {
while (rs.next()) {
numRows++;
List<String> row = new ArrayList<>();
for (int i = 0; i < selectColumns.size(); i++) {
String column = selectColumns.get(i);
String value = rs.getString(column);
row.add(value);
}
if (table.isKodeliste()) {
Optional<List<String>> filteredRow = filterKodelisteRow(selectColumns, row);
if (filteredRow.isPresent()) {
table.addRow(filteredRow.get(), false);
}
} else {
table.addRow(row, false);
System.out.println(row);
}
}
}
if (numRows > 0) {
table.addRow(selectColumns, true);
}
}
private static Optional<List<String>> filterKodelisteRow(List<String> selectColumns, List<String> row) {
int colIndex = selectColumns.indexOf("KODEVERK");
if ("POSTSTED".equalsIgnoreCase(row.get(colIndex))) {
return Optional.empty();
}
return Optional.of(row);
}
}
|
[
"[email protected]"
] | |
941829b6932ca783275f9fa3945660004c014a02
|
13cbb329807224bd736ff0ac38fd731eb6739389
|
/java/nio/ByteBufferAsCharBufferL.java
|
5cf5f37e919cd410baa7c50a774b9a70f43cf2db
|
[] |
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
| 3,671
|
java
|
package java.nio;
class ByteBufferAsCharBufferL extends CharBuffer {
protected final ByteBuffer bb;
protected final int offset;
ByteBufferAsCharBufferL(ByteBuffer paramByteBuffer) {
super(-1, 0, paramByteBuffer.remaining() >> 1, paramByteBuffer.remaining() >> 1);
this.bb = paramByteBuffer;
int i = capacity();
limit(i);
int j = position();
assert j <= i;
this.offset = j;
}
ByteBufferAsCharBufferL(ByteBuffer paramByteBuffer, int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5) {
super(paramInt1, paramInt2, paramInt3, paramInt4);
this.bb = paramByteBuffer;
this.offset = paramInt5;
}
public CharBuffer slice() {
int i = position();
int j = limit();
assert i <= j;
int k = (i <= j) ? (j - i) : 0;
int m = (i << 1) + this.offset;
assert m >= 0;
return new ByteBufferAsCharBufferL(this.bb, -1, 0, k, k, m);
}
public CharBuffer duplicate() { return new ByteBufferAsCharBufferL(this.bb, markValue(), position(), limit(), capacity(), this.offset); }
public CharBuffer asReadOnlyBuffer() { return new ByteBufferAsCharBufferRL(this.bb, markValue(), position(), limit(), capacity(), this.offset); }
protected int ix(int paramInt) { return (paramInt << 1) + this.offset; }
public char get() { return Bits.getCharL(this.bb, ix(nextGetIndex())); }
public char get(int paramInt) { return Bits.getCharL(this.bb, ix(checkIndex(paramInt))); }
char getUnchecked(int paramInt) { return Bits.getCharL(this.bb, ix(paramInt)); }
public CharBuffer put(char paramChar) {
Bits.putCharL(this.bb, ix(nextPutIndex()), paramChar);
return this;
}
public CharBuffer put(int paramInt, char paramChar) {
Bits.putCharL(this.bb, ix(checkIndex(paramInt)), paramChar);
return this;
}
public CharBuffer compact() {
int i = position();
int j = limit();
assert i <= j;
int k = (i <= j) ? (j - i) : 0;
ByteBuffer byteBuffer1 = this.bb.duplicate();
byteBuffer1.limit(ix(j));
byteBuffer1.position(ix(0));
ByteBuffer byteBuffer2 = byteBuffer1.slice();
byteBuffer2.position(i << 1);
byteBuffer2.compact();
position(k);
limit(capacity());
discardMark();
return this;
}
public boolean isDirect() { return this.bb.isDirect(); }
public boolean isReadOnly() { return false; }
public String toString(int paramInt1, int paramInt2) {
if (paramInt2 > limit() || paramInt1 > paramInt2)
throw new IndexOutOfBoundsException();
try {
int i = paramInt2 - paramInt1;
char[] arrayOfChar = new char[i];
CharBuffer charBuffer1 = CharBuffer.wrap(arrayOfChar);
CharBuffer charBuffer2 = duplicate();
charBuffer2.position(paramInt1);
charBuffer2.limit(paramInt2);
charBuffer1.put(charBuffer2);
return new String(arrayOfChar);
} catch (StringIndexOutOfBoundsException stringIndexOutOfBoundsException) {
throw new IndexOutOfBoundsException();
}
}
public CharBuffer subSequence(int paramInt1, int paramInt2) {
int i = position();
int j = limit();
assert i <= j;
i = (i <= j) ? i : j;
int k = j - i;
if (paramInt1 < 0 || paramInt2 > k || paramInt1 > paramInt2)
throw new IndexOutOfBoundsException();
return new ByteBufferAsCharBufferL(this.bb, -1, i + paramInt1, i + paramInt2, capacity(), this.offset);
}
public ByteOrder order() { return ByteOrder.LITTLE_ENDIAN; }
}
/* Location: D:\software\jd-gui\jd-gui-windows-1.6.3\rt.jar!\java\nio\ByteBufferAsCharBufferL.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.0.7
*/
|
[
"[email protected]"
] | |
82a36f7d90d536cf55c9d7dd65fbdfcceb6ecd3f
|
7443cad6728a78e81ff18dfe95349044129c47b4
|
/src/skylight-commons-core/src/main/java/br/skylight/commons/plugin/annotations/ExtensionPointsInjection.java
|
68cc45a14d40a0c83aa1e2c33b9a88c6c5b556c3
|
[
"MIT"
] |
permissive
|
nibbleshift/skylight-uas
|
c78e022248a81e635f6ae13bc7fa9a7569eb29ec
|
d9be7a377ebd25bbf00aac857309a310d5121255
|
refs/heads/master
| 2021-05-21T03:48:19.477508
| 2020-04-02T18:12:01
| 2020-04-02T18:12:01
| 252,528,996
| 0
| 1
|
MIT
| 2020-04-02T17:59:33
| 2020-04-02T17:59:32
| null |
UTF-8
|
Java
| false
| false
| 675
|
java
|
package br.skylight.commons.plugin.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD,ElementType.FIELD})
public @interface ExtensionPointsInjection {
/**
* Create new extension point instances for each point of injection.
* If the injected element is inside a Service implementation or a ManagedMember, a
* singleton instance will be used because those elements are singleton too.
* Defaults to true.
*/
boolean createNewInstances() default true;
}
|
[
"[email protected]"
] | |
94b1cacfefa26dbdfd26ef44c99938315b669a90
|
8397330f51db7b70f812b13013004ba0362bac01
|
/src/main/java/org/cytoscape/analyzer/tasks/RemoveSelfLoopsTask.java
|
1c6a8e0d728101cdf43db6b0712614c25043a071
|
[] |
no_license
|
cytoscape/analyzer
|
ffc3af8f53520d283c7ffcbab60729103acefddb
|
ef8d1146b2a78a7e9a38cfa3ebba2475a5c26b34
|
refs/heads/master
| 2023-09-05T21:53:55.190587
| 2022-01-07T02:01:14
| 2022-01-07T02:01:14
| 167,079,989
| 0
| 1
| null | 2020-10-13T11:44:43
| 2019-01-22T22:54:52
|
Java
|
UTF-8
|
Java
| false
| false
| 3,275
|
java
|
package org.cytoscape.analyzer.tasks;
/*
* #%L
* Cytoscape NetworkAnalyzer Impl (network-analyzer-impl)
* $Id:$
* $HeadURL:$
* %%
* Copyright (C) 2006 - 2013
* Max Planck Institute for Informatics, Saarbruecken, Germany
* The Cytoscape Consortium
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/
import java.awt.Frame;
import java.awt.event.ActionEvent;
import java.util.Arrays;
import java.util.List;
import org.cytoscape.analyzer.util.CyNetworkUtils;
import org.cytoscape.application.CyApplicationManager;
import org.cytoscape.application.swing.CySwingApplication;
import org.cytoscape.model.CyNetwork;
import org.cytoscape.model.CyNetworkManager;
import org.cytoscape.work.AbstractTask;
import org.cytoscape.work.Tunable;
import org.cytoscape.work.ObservableTask;
import org.cytoscape.work.TaskMonitor;
import org.cytoscape.work.json.JSONResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Action handler for the menu item "Remove Self-loops".
*
* @author Yassen Assenov
* @author Sven-Eric Schelhorn
*/
public class RemoveSelfLoopsTask extends AbstractTask implements ObservableTask {
private static final Logger logger = LoggerFactory.getLogger(RemoveSelfLoopsTask.class);
public static String SM_REMSELFLOOPS = " self-loop(s) removed from ";
@Tunable(description="Network to remove the self loops from", required=true)
public CyNetwork network;
private String[] networkNames;
private int[] removedLoops;
/**
* Initializes a new instance of <code>RemoveSelfLoopsTask</code>.
*/
public RemoveSelfLoopsTask() {
}
@Override
public void run(TaskMonitor taskMonitor) {
networkNames = new String[1];
removedLoops = new int[1];
if (network != null) {
removedLoops[0] = CyNetworkUtils.removeSelfLoops(network);
}
}
@Override
public List<Class<?>> getResultClasses() {
return Arrays.asList(String.class, JSONResult.class);
}
@Override
public <R> R getResults(Class<? extends R> type) {
String r = constructReport(removedLoops, SM_REMSELFLOOPS, networkNames);
if (type.isAssignableFrom(JSONResult.class)) {
JSONResult res = () -> {
String str = "{\"network\":"+network.getSUID()+",";
str += "\"removed\":"+removedLoops[0]+"}";
return str;
};
return (R) res;
}
return (R)r;
}
private String constructReport(int[] removedLoops, String s, String[] networkNames) {
String report = "";
for (int index = 0; index < removedLoops.length; index++)
report += removedLoops[index]+s+networkNames[index]+"\n";
return report;
}
}
|
[
"[email protected]"
] | |
581d6cb734ba53c0bd70f2398c63710a57c1eba0
|
c885ef92397be9d54b87741f01557f61d3f794f3
|
/tests-without-trycatch/JacksonDatabind-110/com.fasterxml.jackson.databind.deser.impl.JavaUtilCollectionsDeserializers/BBC-F0-opt-20/16/com/fasterxml/jackson/databind/deser/impl/JavaUtilCollectionsDeserializers_ESTest.java
|
eb7f081aef85dc29d867d43a10cf06b56069ce47
|
[
"CC-BY-4.0",
"MIT"
] |
permissive
|
pderakhshanfar/EMSE-BBC-experiment
|
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
|
fea1a92c2e7ba7080b8529e2052259c9b697bbda
|
refs/heads/main
| 2022-11-25T00:39:58.983828
| 2022-04-12T16:04:26
| 2022-04-12T16:04:26
| 309,335,889
| 0
| 1
| null | 2021-11-05T11:18:43
| 2020-11-02T10:30:38
| null |
UTF-8
|
Java
| false
| false
| 8,104
|
java
|
/*
* This file was automatically generated by EvoSuite
* Fri Oct 22 02:47:36 GMT 2021
*/
package com.fasterxml.jackson.databind.deser.impl;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.deser.BeanDeserializerFactory;
import com.fasterxml.jackson.databind.deser.DefaultDeserializationContext;
import com.fasterxml.jackson.databind.deser.impl.JavaUtilCollectionsDeserializers;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.node.TextNode;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
import com.fasterxml.jackson.databind.type.MapLikeType;
import com.fasterxml.jackson.databind.type.ResolvedRecursiveType;
import com.fasterxml.jackson.databind.type.TypeBindings;
import com.fasterxml.jackson.databind.type.TypeFactory;
import java.sql.SQLClientInfoException;
import java.util.concurrent.atomic.AtomicReference;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class JavaUtilCollectionsDeserializers_ESTest extends JavaUtilCollectionsDeserializers_ESTest_scaffolding {
@Test(timeout = 4000)
public void test0() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
// Undeclared exception!
// try {
JavaUtilCollectionsDeserializers.findForMap(defaultDeserializationContext_Impl0, (JavaType) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("com.fasterxml.jackson.databind.deser.impl.JavaUtilCollectionsDeserializers", e);
// }
}
@Test(timeout = 4000)
public void test1() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JsonFactory jsonFactory0 = new JsonFactory();
DefaultSerializerProvider.Impl defaultSerializerProvider_Impl0 = new DefaultSerializerProvider.Impl();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0, defaultSerializerProvider_Impl0, defaultDeserializationContext_Impl0);
Class<SimpleModule> class0 = SimpleModule.class;
ObjectReader objectReader0 = objectMapper0.readerFor(class0);
TypeFactory typeFactory0 = objectReader0.getTypeFactory();
Class<Module> class1 = Module.class;
MapLikeType mapLikeType0 = typeFactory0.constructMapLikeType(class0, class1, class0);
SQLClientInfoException sQLClientInfoException0 = new SQLClientInfoException();
AtomicReference<Throwable> atomicReference0 = new AtomicReference<Throwable>(sQLClientInfoException0);
defaultDeserializationContext_Impl0.hasValueDeserializerFor(mapLikeType0, atomicReference0);
// Undeclared exception!
// try {
JavaUtilCollectionsDeserializers.findForMap(defaultDeserializationContext_Impl0, (JavaType) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("com.fasterxml.jackson.databind.deser.impl.JavaUtilCollectionsDeserializers", e);
// }
}
@Test(timeout = 4000)
public void test2() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
// Undeclared exception!
// try {
JavaUtilCollectionsDeserializers.findForCollection(defaultDeserializationContext_Impl0, (JavaType) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("com.fasterxml.jackson.databind.deser.impl.JavaUtilCollectionsDeserializers", e);
// }
}
@Test(timeout = 4000)
public void test3() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JsonFactory jsonFactory0 = new JsonFactory();
DefaultSerializerProvider.Impl defaultSerializerProvider_Impl0 = new DefaultSerializerProvider.Impl();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0, defaultSerializerProvider_Impl0, defaultDeserializationContext_Impl0);
Class<SimpleModule> class0 = SimpleModule.class;
ObjectReader objectReader0 = objectMapper0.readerFor(class0);
TypeFactory typeFactory0 = objectReader0.getTypeFactory();
Class<Module> class1 = Module.class;
MapLikeType mapLikeType0 = typeFactory0.constructMapLikeType(class0, class1, class0);
SQLClientInfoException sQLClientInfoException0 = new SQLClientInfoException();
AtomicReference<Throwable> atomicReference0 = new AtomicReference<Throwable>(sQLClientInfoException0);
defaultDeserializationContext_Impl0.hasValueDeserializerFor(mapLikeType0, atomicReference0);
// Undeclared exception!
// try {
JavaUtilCollectionsDeserializers.findForCollection(defaultDeserializationContext_Impl0, (JavaType) null);
// fail("Expecting exception: NullPointerException");
// } catch(NullPointerException e) {
// //
// // no message in exception (getMessage() returned null)
// //
// verifyException("com.fasterxml.jackson.databind.deser.impl.JavaUtilCollectionsDeserializers", e);
// }
}
@Test(timeout = 4000)
public void test4() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Class<TextNode> class0 = TextNode.class;
TypeBindings typeBindings0 = TypeBindings.emptyBindings();
ResolvedRecursiveType resolvedRecursiveType0 = new ResolvedRecursiveType(class0, typeBindings0);
JsonDeserializer<?> jsonDeserializer0 = JavaUtilCollectionsDeserializers.findForMap(defaultDeserializationContext_Impl0, resolvedRecursiveType0);
assertNull(jsonDeserializer0);
}
@Test(timeout = 4000)
public void test5() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Class<TextNode> class0 = TextNode.class;
TypeBindings typeBindings0 = TypeBindings.emptyBindings();
ResolvedRecursiveType resolvedRecursiveType0 = new ResolvedRecursiveType(class0, typeBindings0);
JsonDeserializer<?> jsonDeserializer0 = JavaUtilCollectionsDeserializers.findForCollection(defaultDeserializationContext_Impl0, resolvedRecursiveType0);
assertNull(jsonDeserializer0);
}
}
|
[
"[email protected]"
] | |
e4bde8f83005c54ee4eb2c6612b608e9c5de12c2
|
4fe3aa0d5c6d25088cb679414431aace2d1c2ee6
|
/src/main/java/ch/ethz/idsc/tensor/pdf/HypergeometricDistribution.java
|
1597afacc46b5415599301ba1d7de88524bfd9ee
|
[] |
no_license
|
shyding/tensor
|
8959d4a821418042ae61925b45cda2c9bf451cec
|
dc9b421b4f6542dd4568649c6cc989873ac4942a
|
refs/heads/master
| 2023-03-17T13:03:44.651851
| 2019-11-17T08:45:11
| 2019-11-17T08:45:11
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,656
|
java
|
// code by jph
package ch.ethz.idsc.tensor.pdf;
import ch.ethz.idsc.tensor.RationalScalar;
import ch.ethz.idsc.tensor.RealScalar;
import ch.ethz.idsc.tensor.Scalar;
import ch.ethz.idsc.tensor.alg.Binomial;
/** Quote from Mathematica:
* "A hypergeometric distribution gives the distribution of the number of successes
* in N draws from a population of size m_n containing n successes."
*
* <p>inspired by
* <a href="https://reference.wolfram.com/language/ref/HypergeometricDistribution.html">HypergeometricDistribution</a> */
public class HypergeometricDistribution extends EvaluatedDiscreteDistribution implements VarianceInterface {
/** see the Mathematica documentation of HypergeometricDistribution
*
* @param N number of draws
* @param n number of successes
* @param m_n population size
* @return */
public static Distribution of(int N, int n, int m_n) {
// (0 < N && N <= m_n && 0 <= n && n <= m_n)
if (N <= 0 || m_n < N || n < 0 || m_n < n)
throw new IllegalArgumentException(String.format("N=%d n=%d m_n=%d", N, n, m_n));
return new HypergeometricDistribution(N, n, m_n);
}
// ---
private final int N;
private final int n;
private final int m_n;
private final int m;
private final Binomial binomial_n;
private final Binomial binomial_m;
private final Binomial binomial_m_n;
private HypergeometricDistribution(int N, int n, int m_n) {
this.N = N;
this.n = n;
this.m_n = m_n;
this.m = m_n - n;
binomial_n = Binomial.of(n);
binomial_m = Binomial.of(m);
binomial_m_n = Binomial.of(m_n);
inverse_cdf_build(Math.min(N, n));
}
@Override // from MeanInterface
public Scalar mean() {
return RealScalar.of(N).multiply(RationalScalar.of(n, m_n));
}
@Override // from VarianceInterface
public Scalar variance() {
// ((mpn - n) n (mpn - N) N) / ((-1 + mpn) mpn^2)
Scalar rd1 = RationalScalar.of(m_n - n, m_n);
Scalar rd2 = RationalScalar.of(m_n - N, m_n);
// ( n N) / (-1 + mpn)
Scalar rd3 = RationalScalar.of(N, m_n - 1);
// ( n )
Scalar rd4 = RationalScalar.of(n, 1);
return rd1.multiply(rd2).multiply(rd3).multiply(rd4);
}
@Override // from DiscreteDistribution
public int lowerBound() {
return 0;
}
@Override // from AbstractDiscreteDistribution
protected Scalar protected_p_equals(int i) {
return i <= N && i <= n //
? binomial_n.over(i).multiply(binomial_m.over(N - i)).divide(binomial_m_n.over(N))
: RealScalar.ZERO;
}
@Override // from Object
public String toString() {
return String.format("%s[%d, %d, %d]", getClass().getSimpleName(), N, n, m_n);
}
}
|
[
"[email protected]"
] | |
8c9f0f5fc5539df0113639d9f6336b38a33a61d7
|
ca030864a3a1c24be6b9d1802c2353da4ca0d441
|
/classes7.dex_source_from_JADX/com/facebook/photos/albums/AlbumsAdapterProvider.java
|
cc187da0f7578572ef66deb3d46c252e946aebfa
|
[] |
no_license
|
pxson001/facebook-app
|
87aa51e29195eeaae69adeb30219547f83a5b7b1
|
640630f078980f9818049625ebc42569c67c69f7
|
refs/heads/master
| 2020-04-07T20:36:45.758523
| 2018-03-07T09:04:57
| 2018-03-07T09:04:57
| 124,208,458
| 4
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 421
|
java
|
package com.facebook.photos.albums;
import com.facebook.inject.AbstractAssistedProvider;
import com.facebook.photos.albums.AlbumsAdapter.AlbumsAdapterMode;
/* compiled from: marginHorizontal */
public class AlbumsAdapterProvider extends AbstractAssistedProvider<AlbumsAdapter> {
public static AlbumsAdapter m11332a(AlbumsAdapterMode albumsAdapterMode) {
return new AlbumsAdapter(albumsAdapterMode);
}
}
|
[
"[email protected]"
] | |
a5510b6172b4b260efeee803c70d89b9a66e64cd
|
bc541f0e686034bcd8693a37cbb0e9cb40474047
|
/springboot-httpclient/src/main/java/com/example/httpclient/SpringbootHttpclientApplication.java
|
bdd799d2df5776390dc741491ca3dff5e1d9ac41
|
[] |
no_license
|
zhupeng0521/springboot-collections
|
847d95cc36f8424b64eb88368ee972248c87fbf8
|
d0def11b6f7d3924a2b26d925bd3198d7a49590c
|
refs/heads/master
| 2021-05-16T18:28:56.797977
| 2020-02-10T06:41:03
| 2020-02-10T06:41:03
| 250,419,692
| 0
| 1
| null | 2020-03-27T02:15:24
| 2020-03-27T02:15:24
| null |
UTF-8
|
Java
| false
| false
| 355
|
java
|
package com.example.httpclient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringbootHttpclientApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootHttpclientApplication.class, args);
}
}
|
[
"[email protected]"
] | |
e1e570ba327014872cd26be0559f756bd12acea2
|
f1d8e49c37dd701e564a82f5b90b00042eb96e17
|
/src/main/java/org/jadice/jpeg2000/internal/decode/push/stage/ResultCollector.java
|
87019b286a5c6c4d96a32c275f69df88cb358e1b
|
[
"Apache-2.0"
] |
permissive
|
levigo/jpeg2000-imageio-plugin
|
ae9e3be86dd514785df34b117b24af6cba328d06
|
9a10fbca29a54553fbfdd8a6baa27c07002fd3dd
|
refs/heads/master
| 2023-08-30T20:46:10.800733
| 2019-12-05T13:34:55
| 2019-12-05T13:34:55
| 226,107,413
| 0
| 0
|
Apache-2.0
| 2022-05-20T21:17:27
| 2019-12-05T13:22:18
|
Java
|
UTF-8
|
Java
| false
| false
| 1,397
|
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.jadice.jpeg2000.internal.decode.push.stage;
import org.jadice.jpeg2000.JPEG2000Exception;
import org.jadice.jpeg2000.internal.decode.DecoderParameters;
import org.jadice.jpeg2000.internal.decode.push.Pushable;
import org.jadice.jpeg2000.internal.decode.push.Receiver;
public class ResultCollector<P extends Pushable> implements Receiver<P> {
private P result;
@Override
public void receive(P pushable, DecoderParameters parameters) throws JPEG2000Exception {
result = pushable;
}
public P getResult() {
return result;
}
}
|
[
"[email protected]"
] | |
b4c9e404ef6be8fc842b0c9a2a7730b4eb5f9836
|
96f8d42c474f8dd42ecc6811b6e555363f168d3e
|
/budejie/sources/cn/v6/sixrooms/room/chat/RoomChatStyleHandler.java
|
706978640c86e15e582c981632581ad3b527d103
|
[] |
no_license
|
aheadlcx/analyzeApk
|
050b261595cecc85790558a02d79739a789ae3a3
|
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
|
refs/heads/master
| 2020-03-10T10:24:49.773318
| 2018-04-13T09:44:45
| 2018-04-13T09:44:45
| 129,332,351
| 6
| 2
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,637
|
java
|
package cn.v6.sixrooms.room.chat;
import cn.v6.sixrooms.bean.RoommsgBean;
import cn.v6.sixrooms.room.view.DraweeTextView;
public class RoomChatStyleHandler extends ChatStyleHandler {
private ChatListAdapter a;
public RoomChatStyleHandler(ChatListAdapter chatListAdapter) {
this.a = chatListAdapter;
registerChatStyle(new ShadowChatStyle());
registerChatStyle(new MovementChatStyle());
registerChatStyle(0, new OnHeadLineChatStyle(this.a));
registerChatStyle(1, new WelcomeChatStyle(this.a, this.a.getBaseActivity()));
registerChatStyle(3, new SystemNoticeChatStyle(this.a.getBaseActivity()));
registerChatStyle(4, new WealthRankStyle(this.a.getBaseActivity()));
registerChatStyle(5, new SuperFireworksStyle(this.a.getBaseActivity(), this.a));
registerChatStyle(6, new SendGiftStyle(this.a.getBaseActivity(), this.a, this.a.getFrid()));
registerChatStyle(2, new PublicChatStyle(this.a.getBaseActivity(), this.a, this.a.getFrid()));
registerChatStyle(7, new SmashEggStyle(this.a.getBaseActivity(), this.a, this.a.getFrid()));
registerChatStyle(8, new SendRedStyle(this.a.getBaseActivity(), this.a));
registerChatStyle(9, new GrilSystemGiftStyle(this.a.getBaseActivity(), this.a, this.a.getFrid()));
registerChatStyle(10, new ActivityStyle(this.a.getBaseActivity(), this.a));
}
public void processBean(DraweeTextView draweeTextView, RoommsgBean roommsgBean) {
if (roommsgBean.getChatStyle() != -1) {
handleStyle(roommsgBean.getChatStyle(), roommsgBean, draweeTextView);
}
}
}
|
[
"[email protected]"
] | |
9af0d68f48eab72d2d0d5968fe25702e04d35546
|
ee64a549f9f9c3fd434dc82f22b2f374e0883b18
|
/src/main/java/com/shang/springboot/readinglist/support/ReaderHandlerMethodArgumentResolver.java
|
95cd92f5284a17795ebc9f5e9ec100bf24e09bd8
|
[
"Apache-2.0"
] |
permissive
|
nickshang/ShangMicroArchitecture
|
6159a132ff3f3704ef99dc128144970424186620
|
8dfbba0e7010c9a5fd46a7a6eac74b002918a6e3
|
refs/heads/master
| 2021-09-07T21:50:10.969758
| 2018-03-01T14:52:28
| 2018-03-01T14:52:28
| 94,010,479
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,266
|
java
|
package com.shang.springboot.readinglist.support;
import com.shang.springboot.readinglist.entity.Reader;
import org.springframework.core.MethodParameter;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.support.WebDataBinderFactory;
import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
/**
* 自定义解析器-自定义解析器实现请求参数绑定方法参数
*/
@Component
public class ReaderHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver {
@Override
public boolean supportsParameter(MethodParameter parameter) {
return Reader.class.isAssignableFrom(parameter.getParameterType());
}
@Override
public Object resolveArgument(MethodParameter parameter,
ModelAndViewContainer mavContainer, NativeWebRequest webRequest,
WebDataBinderFactory binderFactory) throws Exception {
Authentication auth = (Authentication) webRequest.getUserPrincipal();
return auth != null && auth.getPrincipal() instanceof Reader ? auth.getPrincipal() : null;
}
}
|
[
"[email protected]"
] | |
766ae2192f30b0179f8d8ce858297bdda7dd7d40
|
278a44f854ce69a464bb4f96e51a4782cd17b846
|
/java/object-builder/src/main/java/com/chris/framework/builder/libs/springboot/controller/BaseBodyFulController.java
|
8e66707183b64d8852cccb924898d0a77b4fdc63
|
[] |
no_license
|
Yi-Kuan/development-libs
|
e308a61b43b6fc903b4843ce7fa8af826bf676fa
|
47398214fbdb9aeb137b0cca82fa9b18518d3295
|
refs/heads/master
| 2021-05-26T10:52:54.045814
| 2020-02-19T17:49:43
| 2020-02-19T17:49:43
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,216
|
java
|
package com.chris.framework.builder.libs.springboot.controller;
import com.chris.framework.builder.core.manager.QueryManager;
import com.chris.framework.builder.libs.springboot.service.BaseService;
import com.chris.framework.builder.model.PageModel;
import com.chris.framework.builder.model.PageParams;
import com.chris.framework.builder.model.object.QueryParams;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.PostConstruct;
import java.util.List;
/**
* ydx-web-demo
* com.ydx.demo.libs
* Created by Chris Chen
* 2018/2/10
* Explain:基本RequestBody+ResponseBody风格的Controller
*/
@RestController
public abstract class BaseBodyFulController<T, S extends BaseService> {
protected S service;
protected abstract S service(); //设置service
@PostConstruct
public void init() {
this.service = service();
}
@RequestMapping("/add")//增加
public Integer add(@RequestBody T entity) {
return service.addOne(entity);
}
@RequestMapping("/remove")//删除
public Boolean remove(Integer id) {
return service.removeOne(id);
}
@RequestMapping("/update")//修改
public Boolean update(@RequestBody T entity) {
return service.updateEntity(entity);
}
@RequestMapping("/get")//获取
public T get(Integer id) {
return (T) service.getEntity(id);
}
@RequestMapping("/getList")//获取集合
public List<T> getList() {
return service.getAll();
}
@RequestMapping("/getPage")//获取分页
public PageModel<T> getPage(@RequestBody PageParams pageParams) {
return service.getPage(pageParams);
}
@RequestMapping("/queryList")//查询集合
public List<T> queryList(@RequestBody QueryParams queryParams) {
return QueryManager.queryList(queryParams, (Class<T>) Object.class);
}
@RequestMapping("/queryPage")//查询分页
public PageModel<T> queryPage(@RequestBody QueryParams queryParams) {
return QueryManager.queryPage(queryParams, (Class<T>) Object.class);
}
}
|
[
"[email protected]"
] | |
7f87298015eda5d9779918797637e1889b394044
|
c35894bc2cc7d38d01295d81baee76a7dce10b20
|
/Ch05_Classes/src/p03/singletone/SingleTone2.java
|
64ae6ca215e317f64ccbd0d8a94bec4a5549cf66
|
[] |
no_license
|
jongtix/JAVA_jongtix
|
93e5c289ed3e514cd481373988f18904b8c698cf
|
4f9f29456ac3956a34d05428c9bf7df14bb7b718
|
refs/heads/master
| 2021-08-29T23:14:02.840808
| 2017-12-15T07:43:22
| 2017-12-15T07:43:22
| 107,648,776
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 257
|
java
|
package p03.singletone;
public class SingleTone2 {
// 필드
private static SingleTone2 instance;
private SingleTone2() {}
public static SingleTone2 getInstance() {
if (instance != null) {
instance = new SingleTone2();
}
return instance;
}
}
|
[
"[email protected]"
] | |
5da6503decf65b49c7eab618c98c8bba82dbdce7
|
b3ef78c187ad3a4ae870252f4afd41446cdd9519
|
/pine-spring-boot-common/src/main/java/com/github/thierrysquirrel/netty/domain/constant/Modular.java
|
1262fb74eebdcef8427e47e9d1640e0aa8d7fee4
|
[
"Apache-2.0"
] |
permissive
|
15662664518/pine-spring-boot-starter
|
7610d22205986abcca77825122e66a64234c194e
|
e977327284752ad6c195cd9a5488f565c91ea097
|
refs/heads/master
| 2020-08-22T09:44:00.200033
| 2019-10-20T10:46:06
| 2019-10-20T10:46:06
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,024
|
java
|
/**
* Copyright 2019 the original author or authors.
* <p>
* 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
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* 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.thierrysquirrel.netty.domain.constant;
/**
* ClassName: Modular
* Description:
* date: 2019/10/17 17:51
*
* @author ThierrySquirrel
* @since JDK 1.8
*/
public enum Modular {
/**
* Heartbeat
*/
HEARTBEAT,
/**
* Synchronizing
*/
SYNCHRONIZING,
/**
* Consumption
*/
CONSUMPTION;
}
|
[
"[email protected]"
] | |
aa2146a7a7f8dc207925622242cee0b79656f42d
|
0ac28b7e3cb0c11a028c529d1720547ec7b60a06
|
/src/main/java/osm5/ns/riftware/_1/_0/vnfd/base/rev170228/vnfd/descriptor/ScalingGroupDescriptorKey.java
|
240c9584700fc282ee124b59ef45b9a79eeefd6c
|
[
"Apache-2.0"
] |
permissive
|
openslice/io.openslice.sol005nbi.osm5
|
5d76e8dd9b4170bdbb9b2359459371abb2324d41
|
f4f6cf80dbd61f5336052ebfcd572ae238d68d89
|
refs/heads/master
| 2021-11-18T00:35:31.753227
| 2020-06-15T15:50:33
| 2020-06-15T15:50:33
| 198,384,737
| 0
| 0
|
Apache-2.0
| 2021-08-02T17:18:18
| 2019-07-23T08:16:53
|
Java
|
UTF-8
|
Java
| false
| false
| 2,660
|
java
|
/*-
* ========================LICENSE_START=================================
* io.openslice.sol005nbi.osm5
* %%
* Copyright (C) 2019 openslice.io
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* =========================LICENSE_END==================================
*/
package osm5.ns.riftware._1._0.vnfd.base.rev170228.vnfd.descriptor;
import com.google.common.base.MoreObjects;
import java.lang.Override;
import java.lang.String;
import java.util.Objects;
import org.opendaylight.yangtools.yang.binding.CodeHelpers;
import org.opendaylight.yangtools.yang.binding.Identifier;
public class ScalingGroupDescriptorKey
implements Identifier<ScalingGroupDescriptor> {
private static final long serialVersionUID = 1071512605706250128L;
private final String _name;
public ScalingGroupDescriptorKey(String _name) {
this._name = _name;
}
/**
* Creates a copy from Source Object.
*
* @param source Source object
*/
public ScalingGroupDescriptorKey(ScalingGroupDescriptorKey source) {
this._name = source._name;
}
public String getName() {
return _name;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Objects.hashCode(_name);
return result;
}
@Override
public boolean equals(java.lang.Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
ScalingGroupDescriptorKey other = (ScalingGroupDescriptorKey) obj;
if (!Objects.equals(_name, other._name)) {
return false;
}
return true;
}
@Override
public String toString() {
final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ScalingGroupDescriptorKey.class);
CodeHelpers.appendValue(helper, "_name", _name);
return helper.toString();
}
}
|
[
"[email protected]"
] | |
7b7bee10a9e9f032e7578e41f930f923ec9892d3
|
791ddf4cbc563f533e7d00a9259e24fe85008877
|
/kernel/src/test/java/org/jboss/test/kernel/config/support/CustomValueBean.java
|
711614eca5892ff587a224c0f80fe81f017062e1
|
[] |
no_license
|
wolfc/microcontainer
|
7dd1fe85057c31575458ad1a22c3f74534f72bd0
|
4ef8127e690e18f54f40287b72f68dbf3541b07c
|
refs/heads/master
| 2020-04-25T23:27:30.830476
| 2013-01-09T14:15:50
| 2013-01-09T14:15:50
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,358
|
java
|
/*
* JBoss, Home of Professional Open Source.
* Copyright 2006, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.test.kernel.config.support;
/**
*
* @author <a href="[email protected]">Kabir Khan</a>
* @version $Revision: 1.1 $
*/
public class CustomValueBean
{
CustomValue value;
public CustomValue getValue()
{
return value;
}
public void setValue(CustomValue value)
{
this.value = value;
}
}
|
[
"[email protected]"
] | |
231a9253878d9d5c35ae509e13edcd376b739898
|
04aa74719f9f6e71f129ab2681f0bf174c02d03a
|
/core/src/com/alee/managers/language/data/TranslationInformation.java
|
8cff38e0bb8fd2bcbd613020bae776b9da09b2b8
|
[] |
no_license
|
jxl-taylor/rpa-master
|
a963269f3136d08474c06536ed4ba115f558146a
|
52fab1d69478c9129a80c67d84dc836bd2ab7fc7
|
refs/heads/master
| 2022-02-08T23:13:19.372274
| 2020-01-19T06:22:10
| 2020-01-19T06:22:10
| 233,237,950
| 1
| 0
| null | 2022-02-01T01:00:39
| 2020-01-11T13:41:30
|
Java
|
UTF-8
|
Java
| false
| false
| 3,918
|
java
|
/*
* This file is part of WebLookAndFeel library.
*
* WebLookAndFeel library is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* WebLookAndFeel library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WebLookAndFeel library. If not, see <http://www.gnu.org/licenses/>.
*/
package com.alee.managers.language.data;
import com.alee.api.merge.Mergeable;
import com.alee.managers.language.LanguageUtils;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import java.io.Serializable;
import java.util.Locale;
/**
* {@link TranslationInformation} contains some general information about single available translation.
* Instances of {@link TranslationInformation} might be automatically generated by {@link Dictionary} when necessary.
*
* @author Mikle Garin
* @see <a href="https://github.com/mgarin/weblaf/wiki/How-to-use-LanguageManager">How to use LanguageManager</a>
* @see com.alee.managers.language.LanguageManager
* @see Dictionary
*/
@XStreamAlias ( "Translation" )
@XStreamConverter ( TranslationInformationConverter.class )
public final class TranslationInformation implements Mergeable, Cloneable, Serializable
{
/**
* Translation {@link Locale}.
*/
@XStreamAsAttribute
@XStreamAlias ( "lang" )
private Locale locale;
/**
* Translation language title.
*/
@XStreamAsAttribute
private String title;
/**
* Translation author.
*/
@XStreamAsAttribute
private String author;
/**
* Constructs new empty {@link TranslationInformation}.
*/
public TranslationInformation ()
{
super ();
}
/**
* Constructs new {@link TranslationInformation}.
*
* @param locale translation {@link Locale}
* @param title translation language title
* @param author translation author
*/
public TranslationInformation ( final Locale locale, final String title, final String author )
{
super ();
this.locale = locale;
this.title = title;
this.author = author;
}
/**
* Returns translation {@link Locale}.
*
* @return translation {@link Locale}
*/
public Locale getLocale ()
{
return locale;
}
/**
* Sets translation {@link Locale}.
*
* @param locale new translation {@link Locale}
*/
public void setLocale ( final Locale locale )
{
this.locale = locale;
}
/**
* Returns translation language title.
*
* @return translation language title
*/
public String getTitle ()
{
return title;
}
/**
* Sets translation language title.
*
* @param title new translation language title
*/
public void setTitle ( final String title )
{
this.title = title;
}
/**
* Returns translation author.
*
* @return translation author
*/
public String getAuthor ()
{
return author;
}
/**
* Sets translation author.
*
* @param author new translation author
*/
public void setAuthor ( final String author )
{
this.author = author;
}
@Override
public String toString ()
{
return "Translation[" + LanguageUtils.toString ( getLocale () ) + ", " + getAuthor () + ", " + getTitle () + "]";
}
}
|
[
"[email protected]"
] | |
c89884e941f83d098c0a6a9cf1495a777800b215
|
772d3e6ac425b1e6fa13ef3858adecf4eb51e8dc
|
/ch07/Phone.java
|
d93769ba7850dbd4b23153ba25cc81f86d52abc3
|
[] |
no_license
|
go88hoontops/java
|
2723a13decbf5eaf7a4928476a76e94341f5c58c
|
ea7c4f2f577874dc1ec8ab5d5f7f910432ab3f37
|
refs/heads/master
| 2023-04-06T09:10:10.373247
| 2021-04-06T01:09:46
| 2021-04-06T01:09:46
| 355,005,350
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 341
|
java
|
package com.jh.ch07;
//추상클래스 abstract
public abstract class Phone {
public String owner; //필드
//생성자
public Phone(String owner) {
this.owner=owner;
}
//메소드
public void turnOn() {
System.out.println("폰을켭니다.");
}
public void turnOff() {
System.out.println("폰을 끕니다.");
}
}
|
[
"[email protected]"
] | |
20725b517aacfdb604fd7175b5644c4374241007
|
25362caa28070530fa4249dde5d189197c706155
|
/src/Main.java
|
a37514bc5299a8f49c19be7a8d4d2acdc214ba12
|
[] |
no_license
|
yizhaocs/RedisStoreImage
|
cceada6a5e05e51675b48af1133ce11d626c1a40
|
ee66aaa1a2f5738c4a8a221b65fc71b7a2560757
|
refs/heads/master
| 2021-01-02T15:33:34.768918
| 2014-10-28T18:18:20
| 2014-10-28T18:18:20
| 25,882,514
| 1
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,260
|
java
|
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Arrays;
import org.apache.commons.io.IOUtils;
import redis.clients.jedis.Jedis;
public class Main {
public static void main(String[] args) {
try {
storeBinaryDataToRedis();
} catch (IOException e) {
System.out.println("Caught IOException: " + e.getMessage());
}
}
public static void storeBinaryDataToRedis() throws IOException {
// Connecting to Redis on localhost
Jedis jedis = new Jedis("localhost");
FileInputStream in = null;
FileOutputStream out = null;
try {
in = new FileInputStream("image.png");
byte[] key = { 'k' };
byte[] value = IOUtils.toByteArray(in);
jedis.set(key, value);
System.out.println(Arrays.toString(jedis.get(key))); // getting the key value
System.out.println(Arrays.toString(value).equals(Arrays.toString(jedis.get(key))));
} catch (FileNotFoundException e) {
System.out.println("Caught FileNotFoundException: " + e.getMessage());
} catch (IOException e) {
System.out.println("Caught IOException: " + e.getMessage());
} finally {
if (in != null) {
in.close();
}
if (out != null) {
out.close();
}
}
}
}
|
[
"[email protected]"
] | |
3385d38dfceae947f1f055874547c8ef33882fe2
|
fc6c869ee0228497e41bf357e2803713cdaed63e
|
/weixin6519android1140/src/sourcecode/com/tencent/mm/plugin/order/model/e.java
|
9eccb850cf2e79f4cb69b0e16f6becee84478862
|
[] |
no_license
|
hyb1234hi/reverse-wechat
|
cbd26658a667b0c498d2a26a403f93dbeb270b72
|
75d3fd35a2c8a0469dbb057cd16bca3b26c7e736
|
refs/heads/master
| 2020-09-26T10:12:47.484174
| 2017-11-16T06:54:20
| 2017-11-16T06:54:20
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,851
|
java
|
package com.tencent.mm.plugin.order.model;
import com.tencent.gmtrace.GMTrace;
import com.tencent.mm.sdk.platformtools.w;
import com.tencent.mm.wallet_core.g.a.h;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public final class e
extends h
{
public int jWn;
private int mJd;
public List<i> nEV;
public List<d> nEW;
public String nEX;
public e(int paramInt, String paramString)
{
GMTrace.i(6626731884544L, 49373);
this.nEV = null;
this.nEW = null;
HashMap localHashMap = new HashMap();
localHashMap.put("Limit", "10");
localHashMap.put("Offset", String.valueOf(paramInt));
localHashMap.put("Extbuf", paramString);
x(localHashMap);
GMTrace.o(6626731884544L, 49373);
}
public final void a(int paramInt, String paramString, JSONObject paramJSONObject)
{
int i = 0;
GMTrace.i(6627000320000L, 49375);
w.d("MicroMsg.NetScenePatchQueryUserRoll", "errCode " + paramInt + " errMsg: " + paramString);
this.nEV = new LinkedList();
try
{
this.jWn = paramJSONObject.getInt("TotalNum");
this.mJd = paramJSONObject.getInt("RecNum");
this.nEX = paramJSONObject.optString("Extbuf");
paramString = paramJSONObject.getJSONArray("UserRollList");
Object localObject;
if (paramString != null)
{
paramInt = 0;
while (paramInt < paramString.length())
{
localObject = new i();
JSONObject localJSONObject = paramString.getJSONObject(paramInt);
((i)localObject).nFi = localJSONObject.optInt("PayType");
((i)localObject).nFa = localJSONObject.optString("Transid");
((i)localObject).nFb = localJSONObject.optDouble("TotalFee");
((i)localObject).nFc = localJSONObject.optString("GoodsName");
((i)localObject).nFd = localJSONObject.optInt("CreateTime");
((i)localObject).nFf = localJSONObject.optInt("ModifyTime");
((i)localObject).nFg = localJSONObject.optString("FeeType");
((i)localObject).nFl = localJSONObject.optString("AppThumbUrl");
((i)localObject).nFe = localJSONObject.optString("TradeStateName");
((i)localObject).nFq = localJSONObject.optString("StatusColor");
((i)localObject).nFr = localJSONObject.optString("FeeColor");
((i)localObject).nFs = localJSONObject.optDouble("ActualPayFee");
((i)localObject).nFt = localJSONObject.optString("BillId");
this.nEV.add(localObject);
paramInt += 1;
}
}
this.nEW = new LinkedList();
paramString = paramJSONObject.optJSONArray("month_info");
if (paramString != null)
{
paramInt = i;
while (paramInt < paramString.length())
{
paramJSONObject = paramString.getJSONObject(paramInt);
localObject = new d();
((d)localObject).year = paramJSONObject.optInt("year");
((d)localObject).month = paramJSONObject.optInt("month");
((d)localObject).nEU = paramJSONObject.optString("feetext");
this.nEW.add(localObject);
paramInt += 1;
}
}
GMTrace.o(6627000320000L, 49375);
return;
}
catch (JSONException paramString)
{
w.e("MicroMsg.NetScenePatchQueryUserRoll", "Parse Json exp:" + paramString.getLocalizedMessage());
GMTrace.o(6627000320000L, 49375);
}
}
public final int aoD()
{
GMTrace.i(6626866102272L, 49374);
GMTrace.o(6626866102272L, 49374);
return 105;
}
}
/* Location: D:\tools\apktool\weixin6519android1140\jar\classes2-dex2jar.jar!\com\tencent\mm\plugin\order\model\e.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/
|
[
"[email protected]"
] | |
ff0c1e791927dccb4da39e81631006e699d615dc
|
5d76b555a3614ab0f156bcad357e45c94d121e2d
|
/src-v3/com/crumby/lib/router/AssetWrapper.java
|
0c206aa5355551ca6ffed8c25741b0d6b48f652e
|
[] |
no_license
|
BinSlashBash/xcrumby
|
8e09282387e2e82d12957d22fa1bb0322f6e6227
|
5b8b1cc8537ae1cfb59448d37b6efca01dded347
|
refs/heads/master
| 2016-09-01T05:58:46.144411
| 2016-02-15T13:23:25
| 2016-02-15T13:23:25
| 51,755,603
| 5
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 521
|
java
|
package com.crumby.lib.router;
import android.content.res.AssetManager;
import java.io.IOException;
import java.io.InputStream;
public class AssetWrapper implements FileOpener {
private AssetManager manager;
public AssetWrapper(AssetManager manager) {
this.manager = manager;
}
public InputStream open(String filename) {
try {
return this.manager.open(filename);
} catch (IOException e) {
e.printStackTrace();
return null;
}
}
}
|
[
"[email protected]"
] | |
c9a7030075443947ee5eccb4237ce8453f2905cf
|
3c36c9c7be3ffb4874f6c4d08cf69bb9c2f62406
|
/icm-parent/icm-core/src/main/java/com/github/jochenw/icm/core/impl/plugins/DefaultSqlStatementExecutor.java
|
68aa595764f4e031a35a38c03ba82858eefc7efe
|
[
"Apache-2.0"
] |
permissive
|
jochenw/icm
|
72466df6daf32a40ea8b38e3854a96f00e49cf7c
|
000318976d3449b77c6b568020cafc9b53e430f6
|
refs/heads/master
| 2021-12-26T16:03:01.201541
| 2021-07-08T15:23:40
| 2021-07-08T15:23:40
| 144,324,302
| 0
| 0
|
Apache-2.0
| 2021-12-14T20:33:03
| 2018-08-10T19:21:51
|
Java
|
UTF-8
|
Java
| false
| false
| 898
|
java
|
package com.github.jochenw.icm.core.impl.plugins;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import com.github.jochenw.icm.core.api.cf.InjectLogger;
import com.github.jochenw.icm.core.api.log.IcmLogger;
import com.github.jochenw.icm.core.api.plugins.SqlStatementExecutor;
public class DefaultSqlStatementExecutor implements SqlStatementExecutor {
@InjectLogger private IcmLogger logger;
@Override
public void execute(Connection pConnection, String pStatement) throws SQLException {
logger.debug(pStatement);
try (PreparedStatement stmt = pConnection.prepareStatement(pStatement)) {
stmt.executeUpdate();
}
}
@Override
public PreparedStatement prepare(Connection pConnection, String pStatement) throws SQLException {
logger.debug(pStatement);
return pConnection.prepareStatement(pStatement);
}
}
|
[
"[email protected]"
] | |
aacf90eee703289116e5e43ca59248e83d1a84ff
|
ed3bccd412e16b54d0fec06454408bc13c420e0d
|
/HTOAWork/src/com/ht/service/finance/FinanceFeedbackdetailService.java
|
6c14774228af2e0d912fac5bf8c812633d7eb811
|
[] |
no_license
|
Hholz/HTOAWork
|
387978548874d1660c559b30b97b9570956b47dd
|
bacafc4e291e4e9f68bfded90bf3698c704c874c
|
refs/heads/master
| 2021-01-12T05:23:07.621967
| 2017-01-03T12:44:51
| 2017-01-03T12:44:51
| 77,915,150
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 484
|
java
|
package com.ht.service.finance;
import java.util.List;
import com.ht.popj.finance.FinanceFeedbackdetail;
public interface FinanceFeedbackdetailService {
int insertSelective(FinanceFeedbackdetail record);
int insert(FinanceFeedbackdetail record);
List<FinanceFeedbackdetail> selectAll();
List<FinanceFeedbackdetail> selectDynamic(FinanceFeedbackdetail record);
int updateByPrimaryKeySelective(FinanceFeedbackdetail record);
int deleteByPrimaryKey(Integer id);
}
|
[
"[email protected]"
] | |
9b37e1149910b2491495cf4ce8cbbaa9993c5529
|
a25301bf5baa309540f7486d14fae6113bc8351f
|
/app/src/main/java/com/atta/findme/menu/ShopMenuActivity.java
|
c54ccf4a97d911a3dd526da4770a0375858553dd
|
[] |
no_license
|
MostafaAtta/FindMe
|
3229d8e7002b6299096ed09d1fb353b738a0a537
|
98b5e87decd77661730fdf310f6d6da63c3b5848
|
refs/heads/master
| 2020-06-04T11:16:26.352603
| 2019-06-14T20:07:21
| 2019-06-14T20:07:21
| 191,440,102
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 3,211
|
java
|
package com.atta.findme.menu;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;
import com.andremion.counterfab.CounterFab;
import com.atta.findme.CategoriesActivity;
import com.atta.findme.R;
import com.atta.findme.cart.CartActivity;
import com.atta.findme.model.Product;
import com.atta.findme.model.ProductsAdapter;
import com.atta.findme.model.Shop;
import java.util.ArrayList;
public class ShopMenuActivity extends AppCompatActivity implements ShopMenuContract.View{
RecyclerView recyclerView;
ShopMenuPresenter shopMenuPresenter;
CounterFab counterFab;
ImageView backToMain;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_shop_menu);
recyclerView = findViewById(R.id.recycler);
counterFab = findViewById(R.id.fab);
backToMain = findViewById(R.id.btn_back);
shopMenuPresenter = new ShopMenuPresenter( this, this);
final Shop shop = (Shop) getIntent().getSerializableExtra("shop");
backToMain.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(ShopMenuActivity.this, CategoriesActivity.class);
if (shop != null){
intent.putExtra("fragment", shop.getCategory());
}
startActivity(intent);
}
});
shopMenuPresenter.getProducts(shop.getCategory(), shop.getId());
shopMenuPresenter.getCartItemsNum();
counterFab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (counterFab.getCount() > 0) {
Intent intent = new Intent(ShopMenuActivity.this, CartActivity.class);
startActivity(intent);
}else showMessage("Cart is empty");
}
});
}
@Override
public void showRecyclerView(ArrayList<Product> products) {
ProductsAdapter myAdapter = new ProductsAdapter(this, shopMenuPresenter, this, products);
recyclerView.setLayoutManager(new GridLayoutManager(this, 3));
recyclerView.setAdapter(myAdapter);
}
@Override
public void showMessage(String message) {
Toast.makeText(this,message,Toast.LENGTH_LONG).show();
}
@Override
public void addToCart(Product product) {
shopMenuPresenter.addToCart(product);
}
@Override
public void increaseCartSign() {
counterFab.increase();
}
@Override
public void decreaseCartSign() {
counterFab.decrease();
counterFab.setCount(0);
}
@Override
public void clearCartSign() {
counterFab.setCount(0);
}
@Override
public void setCounterFabCount(int numOfCartItem) {
counterFab.setCount(numOfCartItem);
}
}
|
[
"[email protected]"
] | |
e4c8b41cb7e9c3a362ffcb622b5356edb532c511
|
63d319fbd88e49701d8dcc2919c8f3a6013e90d0
|
/Applications/CIM/plugins/es.tid.cim.diagram/src/es/tid/cim/diagram/edit/policies/NetworkPortCanonicalEditPolicy.java
|
7e475c2b32bc1cf3245a0ceb622e94b738416b6b
|
[] |
no_license
|
DevBoost/Reuseware
|
2e6b3626c0d434bb435fcf688e3a3c570714d980
|
4c2f0170df52f110c77ee8cffd2705af69b66506
|
refs/heads/master
| 2021-01-19T21:28:13.184309
| 2019-06-09T20:39:41
| 2019-06-09T20:48:34
| 5,324,741
| 1
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 701
|
java
|
package es.tid.cim.diagram.edit.policies;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy;
import org.eclipse.gmf.runtime.notation.View;
/**
* @generated
*/
public class NetworkPortCanonicalEditPolicy extends CanonicalEditPolicy {
/**
* @generated
*/
protected List getSemanticChildrenList() {
return Collections.EMPTY_LIST;
}
/**
* @generated
*/
protected boolean isOrphaned(Collection semanticChildren, final View view) {
return false;
}
/**
* @generated
*/
protected String getDefaultFactoryHint() {
return null;
}
}
|
[
"[email protected]"
] | |
e1864d80c003b570b5447d438299455bb171c54b
|
620a39fe25cc5fbd0ed09218b62ccbea75863cda
|
/wfj_front/src/tuan/dao/imp/TuanProductTypeDao.java
|
957b544bb755cc568b1d3a0f72ca91a6c2c350b5
|
[] |
no_license
|
hukeling/wfj
|
f9d2a1dc731292acfc67b1371f0f6933b0af1d17
|
0aed879a73b1349d74948efd74dadd97616d8fb8
|
refs/heads/master
| 2021-01-16T18:34:47.111453
| 2017-08-12T07:48:58
| 2017-08-12T07:48:58
| 100,095,588
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 298
|
java
|
package tuan.dao.imp;
import tuan.dao.ITuanProductTypeDao;
import tuan.pojo.TuanProductType;
import util.dao.BaseDao;
/**
* 团购商品分类Dao接口实现类
* @author
*
*/
public class TuanProductTypeDao extends BaseDao <TuanProductType> implements ITuanProductTypeDao {
}
|
[
"[email protected]"
] | |
33afbfa6a181d60f396ab98d16f6e38160d1ed74
|
d60e287543a95a20350c2caeabafbec517cabe75
|
/LACCPlus/Cloudstack/578_1.java
|
2192b1441c4e206a379d7c0dad9cce09842cada0
|
[
"MIT"
] |
permissive
|
sgholamian/log-aware-clone-detection
|
242067df2db6fd056f8d917cfbc143615c558b2c
|
9993cb081c420413c231d1807bfff342c39aa69a
|
refs/heads/main
| 2023-07-20T09:32:19.757643
| 2021-08-27T15:02:50
| 2021-08-27T15:02:50
| 337,837,827
| 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 2,743
|
java
|
//,temp,GlobalLoadBalancingRulesServiceImplTest.java,934,977,temp,GlobalLoadBalancingRulesServiceImplTest.java,503,564
//,3
public class xxx {
void runDeleteGlobalLoadBalancerRuleTestWithLbRules() throws Exception {
TransactionLegacy txn = TransactionLegacy.open("runDeleteGlobalLoadBalancerRuleTestWithLbRules");
GlobalLoadBalancingRulesServiceImpl gslbServiceImpl = new GlobalLoadBalancingRulesServiceImpl();
gslbServiceImpl._accountMgr = Mockito.mock(AccountManager.class);
gslbServiceImpl._gslbRuleDao = Mockito.mock(GlobalLoadBalancerRuleDao.class);
gslbServiceImpl._gslbLbMapDao = Mockito.mock(GlobalLoadBalancerLbRuleMapDao.class);
gslbServiceImpl._regionDao = Mockito.mock(RegionDao.class);
gslbServiceImpl._rulesMgr = Mockito.mock(RulesManager.class);
gslbServiceImpl._lbDao = Mockito.mock(LoadBalancerDao.class);
gslbServiceImpl._networkDao = Mockito.mock(NetworkDao.class);
gslbServiceImpl._globalConfigDao = Mockito.mock(ConfigurationDao.class);
gslbServiceImpl._ipAddressDao = Mockito.mock(IPAddressDao.class);
gslbServiceImpl._agentMgr = Mockito.mock(AgentManager.class);
DeleteGlobalLoadBalancerRuleCmd deleteCmd = new DeleteGlobalLoadBalancerRuleCmdExtn();
Class<?> _class = deleteCmd.getClass().getSuperclass();
Account account = new AccountVO("testaccount", 1, "networkdomain", (short)0, UUID.randomUUID().toString());
when(gslbServiceImpl._accountMgr.getAccount(anyLong())).thenReturn(account);
Field gslbRuleId = _class.getDeclaredField("id");
gslbRuleId.setAccessible(true);
gslbRuleId.set(deleteCmd, new Long(1));
GlobalLoadBalancerRuleVO gslbRule =
new GlobalLoadBalancerRuleVO("test-gslb-rule", "test-gslb-rule", "test-domain", "roundrobin", "sourceip", "tcp", 1, 1, 1, GlobalLoadBalancerRule.State.Active);
when(gslbServiceImpl._gslbRuleDao.findById(new Long(1))).thenReturn(gslbRule);
GlobalLoadBalancerLbRuleMapVO gslbLmMap = new GlobalLoadBalancerLbRuleMapVO(1, 1, 1);
List<GlobalLoadBalancerLbRuleMapVO> gslbLbMapVos = new ArrayList<GlobalLoadBalancerLbRuleMapVO>();
gslbLbMapVos.add(gslbLmMap);
when(gslbServiceImpl._gslbLbMapDao.listByGslbRuleId(new Long(1))).thenReturn(gslbLbMapVos);
try {
gslbServiceImpl.deleteGlobalLoadBalancerRule(deleteCmd);
Assert.assertTrue(gslbRule.getState() == GlobalLoadBalancerRule.State.Revoke);
Assert.assertTrue(gslbLmMap.isRevoke() == true);
} catch (Exception e) {
s_logger.info("exception in testing runDeleteGlobalLoadBalancerRuleTestWithLbRules. " + e.toString());
}
}
};
|
[
"[email protected]"
] | |
a73a6f96da3c26372213e24e2dc75a09a03e8e92
|
b89bcefd24d87025b55e48b702aa8be791c68a91
|
/src/main/java/com/hongdu/src/datastructurejava/tree/base/api/baseapi/TreeInterface.java
|
a6c97f617f13646d5f78c4c6189fcc4056851be3
|
[] |
no_license
|
hddudu/daily_concat_code
|
03895abdf4311ecb8aa5856c8b7d7827f5e4830d
|
fa71024e80fb6b7414eb950603b3c3bf398e505f
|
refs/heads/master
| 2022-12-30T03:23:57.665030
| 2019-06-06T15:56:17
| 2019-06-06T15:56:17
| 145,688,275
| 0
| 0
| null | 2022-12-16T04:43:02
| 2018-08-22T09:40:44
|
JavaScript
|
UTF-8
|
Java
| false
| false
| 258
|
java
|
package com.hongdu.src.datastructurejava.tree.base.api.baseapi;
/**
* 树的常用操作
* @param <E>
*/
public interface TreeInterface<E> {
E getRootData();
int getHeight();
int getNumberOfNodes();
boolean isEmpty();
void clear();
}
|
[
"[email protected]"
] | |
34161335a0fcbf1c4c2805fd9137012c029cb7c8
|
95b93c921adf5c09793c41a7f0104374201212ab
|
/ws-Client/src/main/java/demo/spring/service_large/SayHi994Response.java
|
5dd29844d8c2dbe18a2e57af2769e67d2e1fa0dd
|
[] |
no_license
|
yhjhoo/WS-CXF-AuthTest
|
d6ad62bdf95af7f4832f16ffa242785fc0a93eb8
|
ded10abaefdc2e8b3b32becdc6f5781471acf27f
|
refs/heads/master
| 2020-06-15T02:21:42.204025
| 2015-04-08T00:05:02
| 2015-04-08T00:05:02
| 33,409,007
| 0
| 1
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,435
|
java
|
package demo.spring.service_large;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for sayHi994Response complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="sayHi994Response">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "sayHi994Response", propOrder = {
"_return"
})
public class SayHi994Response {
@XmlElement(name = "return")
protected String _return;
/**
* Gets the value of the return property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getReturn() {
return _return;
}
/**
* Sets the value of the return property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setReturn(String value) {
this._return = value;
}
}
|
[
"[email protected]"
] | |
781f8d59d7bfcb9ad71a1528d753a7278f6f76d5
|
1ef4d95915cb37ae26f1a00c11072ef89f3b073d
|
/sitegen/src/main/java/io/helidon/sitegen/PageRenderer.java
|
e952fdaa0a71d852cfed4354c08dfc6000610937
|
[
"Apache-2.0"
] |
permissive
|
diogene/helidon-build-tools
|
1871a3ab95a6ebde034c90020edfd4cac0b38195
|
d9f133cd4d16f63f5c98b561ff0aa98ed99017f3
|
refs/heads/master
| 2020-03-31T09:22:30.850467
| 2018-09-14T03:19:35
| 2018-09-14T03:19:35
| null | 0
| 0
| null | null | null | null |
UTF-8
|
Java
| false
| false
| 1,509
|
java
|
/*
* Copyright (c) 2018 Oracle and/or its affiliates. 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 io.helidon.sitegen;
import java.io.File;
import io.helidon.sitegen.Page.Metadata;
/**
* Capability to render and read metadata for specific type of document.
*
* @author rgrecour
*/
public interface PageRenderer {
/**
* Read a given document metadata.
* @param source the file to read the metadata from
* @return the {@link Metadata} instance, never {@code null}
*/
Metadata readMetadata(File source);
/**
* Process the rendering of a given document.
* @param page the {@link Page} representing the document
* @param ctx the context representing the site processing invocation
* @param pagesdir the directory where to generate the rendered pages
* @param ext the file extension to use for the rendered pages
*/
void process(Page page, RenderingContext ctx, File pagesdir, String ext);
}
|
[
"[email protected]"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.