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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
178dcb2b189b478f2034e51530fa25af6c9a426d | fb80d88d8cdc81d0f4975af5b1bfb39d194e0d97 | /Platform_SwingTree/test/net/sf/anathema/platform/tree/view/draw/TextWriterTest.java | d332b168a2da4bd474ad11dfbd9d91e2b97c8f52 | [] | no_license | mindnsoul2003/Raksha | b2f61d96b59a14e9dfb4ae279fc483b624713b2e | 2533cdbb448ee25ff355f826bc1f97cabedfdafe | refs/heads/master | 2021-01-17T16:43:35.551343 | 2014-02-19T19:28:43 | 2014-02-19T19:28:43 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,051 | java | package net.sf.anathema.platform.tree.view.draw;
import org.junit.Before;
import org.junit.Test;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.awt.Polygon;
import static java.awt.Color.RED;
import static org.mockito.Mockito.verify;
public class TextWriterTest {
private TextWriter writer = new TextWriter(new Polygon(new int[]{0, 100}, new int[]{0, 100}, 2));
private Font font = new Font("SansSerif", Font.PLAIN, 15);
private Graphics2D graphics = GraphicsMother.createForFont(font);
@Before
public void setUp() throws Exception {
writer.setText("ABC");
writer.setStroke(Color.RED);
}
@Test
public void writesGivenText() throws Exception {
writer.write(graphics);
verify(graphics).drawString("ABC", 50, 46);
}
@Test
public void usesGivenTextColor() throws Exception {
writer.write(graphics);
verify(graphics).setColor(RED);
}
@Test
public void setsFontForText() throws Exception {
writer.write(graphics);
verify(graphics).setFont(font);
}
} | [
"ursreupke@gmail.com"
] | ursreupke@gmail.com |
d8fffb8580dace91691b648e9dd485ce5b83459a | 76852b1b29410436817bafa34c6dedaedd0786cd | /sources-2020-07-19-tempmail/sources/android/support/v4/media/MediaDescriptionCompatApi23.java | 627851dee80090ebd829c9f839d757e6e2f89463 | [] | no_license | zteeed/tempmail-apks | 040e64e07beadd8f5e48cd7bea8b47233e99611c | 19f8da1993c2f783b8847234afb52d94b9d1aa4c | refs/heads/master | 2023-01-09T06:43:40.830942 | 2020-11-04T18:55:05 | 2020-11-04T18:55:05 | 310,075,224 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 506 | java | package android.support.v4.media;
import android.media.MediaDescription;
import android.net.Uri;
class MediaDescriptionCompatApi23 {
static class Builder {
private Builder() {
}
public static void setMediaUri(Object obj, Uri uri) {
((MediaDescription.Builder) obj).setMediaUri(uri);
}
}
private MediaDescriptionCompatApi23() {
}
public static Uri getMediaUri(Object obj) {
return ((MediaDescription) obj).getMediaUri();
}
}
| [
"zteeed@minet.net"
] | zteeed@minet.net |
285eaa8908c85614329554007abbf1d131d7c7d4 | 662078ae9db0919b6c8f14f18d66ee21655a22f5 | /src/unicorn/common/internet/IpUtils.java | d34cf0900d3bebc437e1e70701a2efbe70bf09ad | [] | no_license | riceDarling/CAS_jcci | 9f4e196ba60888b7abc6a81c49be67b1758e7108 | f48c70544fccef83697044bd7b878c6e54781238 | refs/heads/master | 2021-01-21T12:31:24.997006 | 2017-09-01T06:04:59 | 2017-09-01T06:04:59 | 102,079,141 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,030 | java | package unicorn.common.internet;
import unicorn.common.charset.StringUtils;
import javax.servlet.http.HttpServletRequest;
public class IpUtils {
/**
* 获取访问者的IP地址.
*
* @param request HttpServletReqeust对象
* @return 访问者的IP地址
*/
public static String getIpAddr(HttpServletRequest request) {
String ipAddr = request.getHeader("x-forwarded-for");
if (StringUtils.isEmpty(ipAddr) || "unknown".equalsIgnoreCase(ipAddr)) {
ipAddr = request.getHeader("Proxy-Client-IP");
}
if (StringUtils.isEmpty(ipAddr) || "unknown".equalsIgnoreCase(ipAddr)) {
ipAddr = request.getHeader("WL-Proxy-Client-IP");
}
if (StringUtils.isEmpty(ipAddr) || "unknown".equalsIgnoreCase(ipAddr)) {
ipAddr = request.getRemoteAddr();
}
if (StringUtils.isNotEmpty(ipAddr) && ipAddr.length() > 15) {
if (ipAddr.indexOf(",") > 0) {
ipAddr = ipAddr.substring(0, ipAddr.indexOf(","));
}
}
return ipAddr;
}
}
| [
"2398300521@qq.com"
] | 2398300521@qq.com |
b271e3763419aa002e171e8a7b810e5f0c623bd8 | 804825d9b8041948ed775d4f37d425e1f117ba4b | /zoyibean/src/org/zoyi/po/UchomePic.java | f4ec5dae6f1ab5a2ef6f4f8fc6485ae2fbb63346 | [] | no_license | BGCX261/zoyijavabean-svn-to-git | c6459ea382d1b4a6d27568641801f59bc8a4ed31 | 1b4ae8e1de4ca8aeb14cc5da32a26edd5bdd8ab3 | refs/heads/master | 2021-01-01T19:33:51.782198 | 2015-08-25T15:52:38 | 2015-08-25T15:52:38 | 41,600,155 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,242 | java | package org.zoyi.po;
/**
* UchomePic entity. @author MyEclipse Persistence Tools
*/
public class UchomePic implements java.io.Serializable {
// Fields
private Integer picid;
private Integer albumid;
private Integer topicid;
private Integer uid;
private String username;
private Integer dateline;
private String postip;
private String filename;
private String title;
private String type;
private Integer size;
private String filepath;
private Short thumb;
private Short remote;
private Integer hot;
private Short click6;
private Short click7;
private Short click8;
private Short click9;
private Short click10;
private Short magicframe;
// Constructors
/** default constructor */
public UchomePic() {
}
/** full constructor */
public UchomePic(Integer picid, Integer albumid, Integer topicid,
Integer uid, String username, Integer dateline, String postip,
String filename, String title, String type, Integer size,
String filepath, Short thumb, Short remote, Integer hot,
Short click6, Short click7, Short click8, Short click9,
Short click10, Short magicframe) {
this.picid = picid;
this.albumid = albumid;
this.topicid = topicid;
this.uid = uid;
this.username = username;
this.dateline = dateline;
this.postip = postip;
this.filename = filename;
this.title = title;
this.type = type;
this.size = size;
this.filepath = filepath;
this.thumb = thumb;
this.remote = remote;
this.hot = hot;
this.click6 = click6;
this.click7 = click7;
this.click8 = click8;
this.click9 = click9;
this.click10 = click10;
this.magicframe = magicframe;
}
// Property accessors
public Integer getPicid() {
return this.picid;
}
public void setPicid(Integer picid) {
this.picid = picid;
}
public Integer getAlbumid() {
return this.albumid;
}
public void setAlbumid(Integer albumid) {
this.albumid = albumid;
}
public Integer getTopicid() {
return this.topicid;
}
public void setTopicid(Integer topicid) {
this.topicid = topicid;
}
public Integer getUid() {
return this.uid;
}
public void setUid(Integer uid) {
this.uid = uid;
}
public String getUsername() {
return this.username;
}
public void setUsername(String username) {
this.username = username;
}
public Integer getDateline() {
return this.dateline;
}
public void setDateline(Integer dateline) {
this.dateline = dateline;
}
public String getPostip() {
return this.postip;
}
public void setPostip(String postip) {
this.postip = postip;
}
public String getFilename() {
return this.filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getTitle() {
return this.title;
}
public void setTitle(String title) {
this.title = title;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public Integer getSize() {
return this.size;
}
public void setSize(Integer size) {
this.size = size;
}
public String getFilepath() {
return this.filepath;
}
public void setFilepath(String filepath) {
this.filepath = filepath;
}
public Short getThumb() {
return this.thumb;
}
public void setThumb(Short thumb) {
this.thumb = thumb;
}
public Short getRemote() {
return this.remote;
}
public void setRemote(Short remote) {
this.remote = remote;
}
public Integer getHot() {
return this.hot;
}
public void setHot(Integer hot) {
this.hot = hot;
}
public Short getClick6() {
return this.click6;
}
public void setClick6(Short click6) {
this.click6 = click6;
}
public Short getClick7() {
return this.click7;
}
public void setClick7(Short click7) {
this.click7 = click7;
}
public Short getClick8() {
return this.click8;
}
public void setClick8(Short click8) {
this.click8 = click8;
}
public Short getClick9() {
return this.click9;
}
public void setClick9(Short click9) {
this.click9 = click9;
}
public Short getClick10() {
return this.click10;
}
public void setClick10(Short click10) {
this.click10 = click10;
}
public Short getMagicframe() {
return this.magicframe;
}
public void setMagicframe(Short magicframe) {
this.magicframe = magicframe;
}
} | [
"you@example.com"
] | you@example.com |
ad0456023acebd43ac8390f2fc405bb14e236fbb | 23ec52180e445c39a0b357d5b3a99154ba681ed7 | /EffectiveJava2nd/src/Chapter8/Item53/MakeSet.java | df04d35746479fe9f4ba83d611231191b11e24d6 | [] | 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 | UTF-8 | Java | false | false | 976 | java | package Chapter8.Item53;
// Reflective instantiation with interface access - Page 231
import java.util.*;
public class MakeSet {
public static void main(String[] args) {
// Translate the class name into a Class object
Class<?> cl = null;
try {
cl = Class.forName(args[0]);
} catch(ClassNotFoundException e) {
System.err.println("Class not found.");
System.exit(1);
}
// Instantiate the class
Set<String> s = null;
try {
s = (Set<String>) cl.newInstance();
} catch(IllegalAccessException e) {
System.err.println("Class not accessible.");
System.exit(1);
} catch(InstantiationException e) {
System.err.println("Class not instantiable.");
System.exit(1);
}
// Exercise the set
s.addAll(Arrays.asList(args).subList(1, args.length));
System.out.println(s);
}
}
| [
"lee.ni@emc.com"
] | lee.ni@emc.com |
189d2ce966269077db8bbea41d2efd75710ff138 | be4dcae13ec8ea3e3ec61869febef96d91ddb200 | /operators/src/main/java/Equivalence.java | e55fdca03b6dea50225cc65b77be99de352947f7 | [] | no_license | zcdJason/java8-maven | 32379e852c48870f114c2fa8d749a26ac2b50694 | db7dea9d4a04384a269d0c5cefa23682f7c89beb | refs/heads/master | 2023-07-11T04:06:37.303186 | 2021-08-16T01:50:39 | 2021-08-16T01:50:39 | 395,219,459 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 424 | java | // operators/Equivalence.java
// (c)2017 MindView LLC: see Copyright.txt
// We make no guarantees that this code is fit for any purpose.
// Visit http://OnJava8.com for more book information.
public class Equivalence {
public static void main(String[] args) {
Integer n1 = 47;
Integer n2 = 47;
System.out.println(n1 == n2);
System.out.println(n1 != n2);
}
}
/* Output:
true
false
*/
| [
"736777445@qq.com"
] | 736777445@qq.com |
4a4c81ab025bf211fc9b2f6fae29b803c22b754b | 3efa417c5668b2e7d1c377c41d976ed31fd26fdc | /src/br/com/mind5/webhook/pagarmeHook/info/PagookSetterIdPayment.java | 9abeb7e5a3f06153ea0e016f425bc7b50552442e | [] | no_license | grazianiborcai/Agenda_WS | 4b2656716cc49a413636933665d6ad8b821394ef | e8815a951f76d498eb3379394a54d2aa1655f779 | refs/heads/master | 2023-05-24T19:39:22.215816 | 2023-05-15T15:15:15 | 2023-05-15T15:15:15 | 109,902,084 | 0 | 0 | null | 2022-06-29T19:44:56 | 2017-11-07T23:14:21 | Java | UTF-8 | Java | false | false | 1,317 | java | package br.com.mind5.webhook.pagarmeHook.info;
import br.com.mind5.common.DefaultValue;
import br.com.mind5.info.InfoSetterTemplate;
public final class PagookSetterIdPayment extends InfoSetterTemplate<PagookInfo> {
@Override protected PagookInfo setAttrHook(PagookInfo recordInfo) {
recordInfo.codOwner = getOwner(recordInfo);
recordInfo.codPayOrder = getPayord(recordInfo);
recordInfo.codPayOrderItem = getPayordem(recordInfo);
return recordInfo;
}
private long getOwner(PagookInfo recordInfo) {
String[] parts = getParts(recordInfo);
if (parts.length < 1)
return DefaultValue.number();
return Long.valueOf(parts[0]);
}
private long getPayord(PagookInfo recordInfo) {
String[] parts = getParts(recordInfo);
if (parts.length < 2)
return DefaultValue.number();
return Long.valueOf(parts[1]);
}
private long getPayordem(PagookInfo recordInfo) {
String[] parts = getParts(recordInfo);
if (parts.length < 3)
return DefaultValue.number();
return Long.valueOf(parts[2]);
}
private String[] getParts(PagookInfo recordInfo) {
String[] emptyArray = {};
if (recordInfo.data == null)
return emptyArray;
if (recordInfo.data.code == null)
return emptyArray;
return recordInfo.data.code.split("-");
}
}
| [
"mmaciel@mind5.com"
] | mmaciel@mind5.com |
6ea11a073df69163903d10888d68399c0b080521 | 31f49c479ff58671ebc2e24de033215d264f9960 | /common/src/main/java/com/dafy/common/util/BankUtils.java | 9bf52b09ca34defd4960a85b9bbf6643a0ae5be1 | [] | no_license | k42jc/octopus | 3288b20dbb04fb3ab358ddab456d68f73bb66a48 | 61c85bbfe7fbef29a0313460d9f67ee639bf450d | refs/heads/master | 2020-03-24T03:03:10.497392 | 2018-07-26T08:44:54 | 2018-07-26T08:44:54 | 142,402,617 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,909 | java | package com.dafy.common.util;
import java.util.HashMap;
import java.util.Map;
public class BankUtils {
private static final String BANK_PREFIX = "**** **** **** ";
private static final Map<String,String> BANK_LIST = new HashMap<>(32);
static {
BANK_LIST.put("中国工商银行","ICBC");
BANK_LIST.put("中国农业银行","ABC");
BANK_LIST.put("中国建设银行","CCB");
BANK_LIST.put("中国银行","BOC");
BANK_LIST.put("中国交通银行","BCOM");
BANK_LIST.put("兴业银行","CIB");
BANK_LIST.put("中信银行","CITIC");
BANK_LIST.put("光大银行","CEB");
BANK_LIST.put("平安银行","PAB");
BANK_LIST.put("中国邮政储蓄银行","PSBC");
BANK_LIST.put("上海银行","SHB");
BANK_LIST.put("浦东发展银行","SPDB");
BANK_LIST.put("中国民生银行","CMBC");
BANK_LIST.put("招商银行","CMB");
BANK_LIST.put("广发银行","GDB");
BANK_LIST.put("华夏银行","HXB");
BANK_LIST.put("杭州银行","HZB");
BANK_LIST.put("北京银行","BOB");
BANK_LIST.put("宁波银行","NBCB");
BANK_LIST.put("江苏银行","JSB");
BANK_LIST.put("浙商银行","ZSB");
}
private static final Map<String,String> BANK_CODE_LIST = new HashMap<>(32);
static {
BANK_CODE_LIST.put("1020000", "ICBC");
BANK_CODE_LIST.put("1020076", "ICBC");
BANK_CODE_LIST.put("1030000", "ABC");
BANK_CODE_LIST.put("1040000", "BOC");
BANK_CODE_LIST.put("1040036", "BOC");
BANK_CODE_LIST.put("5190344", "BOC");
BANK_CODE_LIST.put("1050000", "CCB");
BANK_CODE_LIST.put("1050001", "CCB");
BANK_CODE_LIST.put("5330344", "CCB");
BANK_CODE_LIST.put("3050000", "CMBC");
BANK_CODE_LIST.put("3010000", "BCOM");
BANK_CODE_LIST.put("3030000", "CEB");
BANK_CODE_LIST.put("3060000", "GDB");
BANK_CODE_LIST.put("3090000", "CIB");
BANK_CODE_LIST.put("3070010", "PAB");
BANK_CODE_LIST.put("4100000", "PAB");
BANK_CODE_LIST.put("4105840", "PAB");
BANK_CODE_LIST.put("6105840", "PAB");
BANK_CODE_LIST.put("3100000", "SPDB");
BANK_CODE_LIST.put("4010000", "SHB");
BANK_CODE_LIST.put("4012900", "SHB");
BANK_CODE_LIST.put("4012902", "SHB");
BANK_CODE_LIST.put("1000000", "PSBC");
BANK_CODE_LIST.put("1009999", "PSBC");
BANK_CODE_LIST.put("1004900", "PSBC");
BANK_CODE_LIST.put("3020000", "CITIC");
BANK_CODE_LIST.put("3080000", "CMB");
BANK_CODE_LIST.put("3040000", "HXB");
}
/**
* 通过银行全称获取简称
* @param bankName 全称
* @return
*/
public static String getShortNameByName(String bankName){
if ("".equals(bankName)||null==bankName) {
return null;
}
return BANK_LIST.get(bankName);
}
/**
* ocr的code转换为简称
* @param bankCode
* @return
*/
public static String getShortNameByCode(String bankCode){
if ("".equals(bankCode)||null==bankCode) {
return null;
}
return BANK_CODE_LIST.get(bankCode);
}
/**
* 获取加密后的银行卡号
* @param bankCardNum
* @return
*/
public static String getBankCardNum(String bankCardNum){
if ("".equals(bankCardNum)||null==bankCardNum) {
return null;
}
int length = bankCardNum.length();
if (length < 16){
return "";
}
StringBuffer s1 = new StringBuffer(bankCardNum);
StringBuffer s2 = new StringBuffer(BANK_PREFIX);
return s2.append(s1.substring(length - 4, length)).toString();
}
public static void main(String[] args) {
System.out.println(getBankCardNum("1234234534564567"));
}
}
| [
"liao"
] | liao |
3a6861310dd81301db81ede4f8f7b6e5ca02ec77 | d4a877437612a282a31e9811bf7c4f3d0ad5a07f | /app/src/main/java/com/tns/espapp/fragment/EntitlementFragment.java | 337afc0c92a16ab34120bc624276d09aafd3f9e6 | [] | no_license | deepak-tns/ESPAppLatest | cfa91f048f936220d934b96622232427523294b7 | 80aac7600a4b00b950fcff0fe4cd2f10e0e41652 | refs/heads/master | 2020-03-20T00:30:06.442833 | 2018-06-12T09:07:17 | 2018-06-12T09:07:17 | 137,046,168 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,548 | java | package com.tns.espapp.fragment;
import android.app.DownloadManager;
import android.app.ProgressDialog;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.DownloadListener;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.Toast;
import com.tns.espapp.AppConstraint;
import com.tns.espapp.R;
import com.tns.espapp.Utility.SharedPreferenceUtils;
import static android.content.Context.DOWNLOAD_SERVICE;
/**
* Created by GARIMA on 6/23/2017.
*/
public class EntitlementFragment extends Fragment {
private View view;
private WebView webView;
private ProgressDialog pd;
private SharedPreferenceUtils sharedPreferences;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
view = inflater.inflate(R.layout.fragment_pernsonal_info, container, false);
getLayoutsId();
return view;
}
private void getLayoutsId() {
webView = (WebView) view.findViewById(R.id.webview);
pd = new ProgressDialog(getContext());
pd.setMessage("Please wait Loading...");
pd.show();
pd.setCancelable(false);
webView.setWebViewClient(new MyBrowser());
webView.getSettings().setLoadsImagesAutomatically(true);
webView.getSettings().setJavaScriptEnabled(true);
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webView.setDownloadListener(new DownloadListener() {
@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype,
long contentLength) {
DownloadManager.Request request = new DownloadManager.Request(
Uri.parse(url));
request.allowScanningByMediaScanner();
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED); //Notify client once download is completed!
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "");
DownloadManager dm = (DownloadManager)getContext().getSystemService(DOWNLOAD_SERVICE);
dm.enqueue(request);
Toast.makeText(getContext(), "Downloading File", //To notify the Client that the file is being downloaded
Toast.LENGTH_LONG).show();
}
});
sharedPreferences = SharedPreferenceUtils.getInstance();
sharedPreferences.setContext(getContext());
String empId = sharedPreferences.getString(AppConstraint.EMPID);
webView.loadUrl("http://182.71.51.35/ESP/Info/EntitlementInfoWebView/"+empId);
}
private class MyBrowser extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
if (!pd.isShowing()) {
pd.show();
}
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
System.out.println("on finish");
if (pd.isShowing()) {
pd.dismiss();
}
}
}
}
| [
"deepaksachan8@gmail.com"
] | deepaksachan8@gmail.com |
9c13ebb824533788a092b6ceb6489977caecbcb4 | 69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e | /methods/Method_45742.java | 5c96e59dedac5f16c80f3412a5ae61e1862ed4ec | [] | no_license | P79N6A/icse_20_user_study | 5b9c42c6384502fdc9588430899f257761f1f506 | 8a3676bc96059ea2c4f6d209016f5088a5628f3c | refs/heads/master | 2020-06-24T08:25:22.606717 | 2019-07-25T15:31:16 | 2019-07-25T15:31:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 238 | java | public static SofaRpcRuntimeException buildRuntime(String configKey,String configValue){
String msg="The value of config " + configKey + " [" + configValue + "] is illegal, please check it";
return new SofaRpcRuntimeException(msg);
}
| [
"sonnguyen@utdallas.edu"
] | sonnguyen@utdallas.edu |
9215e83064fce95511afd94ba3d94cbd672b9f22 | aaceb37979a0bc65ce86928aada3027f5db9f3f0 | /androidyoutube/app/src/main/java/com/example/android/androidyoutube/SimpleBrowser.java | ab60771ae666a59df4a6e7e30f2079375182b310 | [] | no_license | KevinKimaru/android_practice-projects | f13e66b8f7fc89d4370ead5c081e27172be26234 | 82a1a872a2718b157c134ab90884b9388a13fb9b | refs/heads/master | 2021-05-12T02:06:24.851267 | 2018-01-15T18:04:14 | 2018-01-15T18:04:14 | 117,578,056 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,605 | java | package com.example.android.androidyoutube;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;
public class SimpleBrowser extends AppCompatActivity implements View.OnClickListener {
WebView ourBrow;
EditText url;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_simple_browser);
ourBrow = (WebView) findViewById(R.id.wvBrowser);
ourBrow.getSettings().setJavaScriptEnabled(true);
ourBrow.getSettings().setLoadWithOverviewMode(true);
ourBrow.getSettings().setUseWideViewPort(true);
ourBrow.setWebViewClient(new OurViewClient());
try {
ourBrow.loadUrl("http://www.google.com");
} catch (Exception e) {
e.printStackTrace();
}
Button go = (Button) findViewById(R.id.bGo);
Button back = (Button) findViewById(R.id.bBack);
Button refresh = (Button) findViewById(R.id.bRefresh);
Button forward = (Button) findViewById(R.id.bForward);
Button clearHistory = (Button) findViewById(R.id.bHistory);
url = (EditText) findViewById(R.id.etUrl);
go.setOnClickListener(this);
back.setOnClickListener(this);
refresh.setOnClickListener(this);
forward.setOnClickListener(this);
clearHistory.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.bGo:
String web = url.getText().toString();
ourBrow.loadUrl(web);
//Hiding keyboard after using an edit text
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(url.getWindowToken(), 0);
break;
case R.id.bBack:
if (ourBrow.canGoBack()) {
ourBrow.goBack();
}
break;
case R.id.bRefresh:
ourBrow.reload();
break;
case R.id.bForward:
if (ourBrow.canGoForward()) {
ourBrow.goForward();
}
break;
case R.id.bHistory:
ourBrow.clearHistory();
break;
}
}
}
| [
"kevinkimaru99@gmail.com"
] | kevinkimaru99@gmail.com |
281c61ad8f6a9829cab7096acb192034168b4895 | b5a4790330d45512e481060d0e930223defbbb35 | /src/main/java/com/igomall/service/SmsService.java | af0790d00e5c1419f11a8dcbfb259b634ad6bd4b | [] | no_license | heyewei/cms_shop | 451081a46b03e85938d8dd256a9b97662241ac63 | 29047908c40202ddaa3487369a4429ab15634b9d | refs/heads/master | 2023-02-13T15:43:17.118001 | 2020-12-29T09:58:52 | 2020-12-29T09:58:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,705 | java | /*
* Copyright 2008-2018 shopxx.net. All rights reserved.
* Support: localhost
* License: localhost/license
* FileId: cXX8XlVmh1w9j3MlGLAdDs7CasR8BbDJ
*/
package com.igomall.service;
import java.util.Date;
import java.util.Map;
import com.igomall.entity.Business;
import com.igomall.entity.Member;
import com.igomall.entity.Order;
import com.igomall.entity.Store;
/**
* Service - 短信
*
* @author 爱购 Team
* @version 6.1
*/
public interface SmsService {
/**
* 发送短信
*
* @param mobiles
* 手机号码
* @param content
* 内容
* @param sendTime
* 发送时间
* @param async
* 是否异步
*/
void send(String[] mobiles, String content, Date sendTime, boolean async);
/**
* 发送短信
*
* @param mobiles
* 手机号码
* @param templatePath
* 模板路径
* @param model
* 数据
* @param sendTime
* 发送时间
* @param async
* 是否异步
*/
void send(String[] mobiles, String templatePath, Map<String, Object> model, Date sendTime, boolean async);
/**
* 发送短信(异步)
*
* @param mobile
* 手机号码
* @param content
* 内容
*/
void send(String mobile, String content);
/**
* 发送短信(异步)
*
* @param mobile
* 手机号码
* @param templatePath
* 模板路径
* @param model
* 数据
*/
void send(String mobile, String templatePath, Map<String, Object> model);
/**
* 发送会员注册短信(异步)
*
* @param member
* 会员
*/
void sendRegisterMemberSms(Member member);
/**
* 发送订单创建短信(异步)
*
* @param order
* 订单
*/
void sendCreateOrderSms(Order order);
/**
* 发送订单更新短信(异步)
*
* @param order
* 订单
*/
void sendUpdateOrderSms(Order order);
/**
* 发送订单取消短信(异步)
*
* @param order
* 订单
*/
void sendCancelOrderSms(Order order);
/**
* 发送订单审核短信(异步)
*
* @param order
* 订单
*/
void sendReviewOrderSms(Order order);
/**
* 发送订单收款短信(异步)
*
* @param order
* 订单
*/
void sendPaymentOrderSms(Order order);
/**
* 发送订单退款短信(异步)
*
* @param order
* 订单
*/
void sendRefundsOrderSms(Order order);
/**
* 发送订单发货短信(异步)
*
* @param order
* 订单
*/
void sendShippingOrderSms(Order order);
/**
* 发送订单退货短信(异步)
*
* @param order
* 订单
*/
void sendReturnsOrderSms(Order order);
/**
* 发送订单收货短信(异步)
*
* @param order
* 订单
*/
void sendReceiveOrderSms(Order order);
/**
* 发送订单完成短信(异步)
*
* @param order
* 订单
*/
void sendCompleteOrderSms(Order order);
/**
* 发送订单失败短信(异步)
*
* @param order
* 订单
*/
void sendFailOrderSms(Order order);
/**
* 发送商家注册短信(异步)
*
* @param business
* 商家
*/
void sendRegisterBusinessSms(Business business);
/**
* 发送店铺审核成功短信(异步)
*
* @param store
* 店铺
*/
void sendApprovalStoreSms(Store store);
/**
* 发送店铺审核失败短信(异步)
*
* @param store
* 店铺
* @param content
* 内容
*/
void sendFailStoreSms(Store store, String content);
/**
* 获取短信余额
*
* @return 短信余额
*/
long getBalance();
} | [
"1169794338@qq.com"
] | 1169794338@qq.com |
8d63d2b7c32b3cebf88b3b5282b19500c49f8537 | ed5159d056e98d6715357d0d14a9b3f20b764f89 | /test/irvine/oeis/a242/A242658Test.java | 5e344ff6d13a98c27c0f621f79e03e2f10ca5039 | [] | no_license | flywind2/joeis | c5753169cf562939b04dd246f8a2958e97f74558 | e5efd6971a0062ac99f4fae21a7c78c9f9e74fea | refs/heads/master | 2020-09-13T18:34:35.080552 | 2019-11-19T05:40:55 | 2019-11-19T05:40:55 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 195 | java | package irvine.oeis.a242;
import irvine.oeis.AbstractSequenceTest;
/**
* Tests the corresponding class.
* @author Sean A. Irvine
*/
public class A242658Test extends AbstractSequenceTest {
}
| [
"sairvin@gmail.com"
] | sairvin@gmail.com |
adc4db95614625e62b9be4b84ae400cdff089bab | 79d6581b637a5e157fed8d4335f183c8447e07de | /src/main/java/com/tuowazi/base/sort/compare/QuickSortCompare.java | 4174e0463d6ad7defa2d66c7011cb790f4a6179e | [] | no_license | zwxbest/Coding-Interview-Guide | 8482c7e695afcd867f91e8a6bd8ad54b995ce0e9 | 68b732f741251e561e87b89a907c13da5f19787b | refs/heads/master | 2021-06-13T21:04:31.824752 | 2019-07-11T12:51:10 | 2019-07-11T12:51:10 | 175,943,407 | 0 | 0 | null | 2020-10-13T12:24:13 | 2019-03-16T07:58:41 | Java | UTF-8 | Java | false | false | 449 | java | package com.tuowazi.base.sort.compare;
import com.tuowazi.base.sort.BaseSort;
import com.tuowazi.base.sort.quick.QuickSort;
import com.tuowazi.base.sort.quick.QuickSort2;
import com.tuowazi.base.sort.quick.QuickSort3;
public class QuickSortCompare extends BaseSort {
public static void main(String[] args) {
BaseSort.COUNT = 100_0000;
QuickSort.main(null);
QuickSort2.main(null);
QuickSort3.main(null);
}
}
| [
"zhangweixiao@live.com"
] | zhangweixiao@live.com |
3639bc87ebb90c60a07c652824e6c52ba50c7f1f | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/25/25_ff65d9ab07a7f4076ef9305ef6a230b628c8f409/Loader/25_ff65d9ab07a7f4076ef9305ef6a230b628c8f409_Loader_s.java | e8b0951437d6cdb74b3723d35b850dd34215adbf | [] | no_license | zhongxingyu/Seer | 48e7e5197624d7afa94d23f849f8ea2075bcaec0 | c11a3109fdfca9be337e509ecb2c085b60076213 | refs/heads/master | 2023-07-06T12:48:55.516692 | 2023-06-22T07:55:56 | 2023-06-22T07:55:56 | 259,613,157 | 6 | 2 | null | 2023-06-22T07:55:57 | 2020-04-28T11:07:49 | null | UTF-8 | Java | false | false | 3,484 | java | package level;
import entities.Background;
import entities.BreakableWall;
import entities.Finishpoint;
import entities.Player;
import entities.Wall;
import entities.WallWithFinishingPoint;
import game.Game;
import game.KeySettings;
import game.Main;
import java.util.ArrayList;
import java.util.Scanner;
public class Loader {
/**
* Creates a level from a map file Types: 0 = empty Background 1 = Breakable
* Wall 2 = Solid Wall 3 = Spawnpoint 4 = Finishpoint 5 =
* WallWithFinishPoint
*
* @param filename
*/
public void loadMap(String filename) {
int x = 0, type, y = 0;
int player_count = 0;
Scanner maps;
try {
maps = new Scanner(Main.class.getResourceAsStream("/ressources/maps/" + filename));
while (maps.hasNextLine()) {
String text = maps.nextLine();
for (x = 0; x < text.length(); x++) {
type = Integer.parseInt("" + text.charAt(x));
if (type == 0) {
Game.staticBackground.add(new Background(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE));
} else if (type == 1) {
Game.entities.add(new BreakableWall(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE));
} else if (type == 2) {
Game.entities.add(new Wall(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE));
} else if (type == 3) {
Player p = new Player(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE);
KeySettings keys = Game.getKeySettings(player_count);
p.setKeys(keys);
player_count++;
Game.entities.add(p);
Game.players.add(p);
Game.staticBackground.add(new Background(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE));
} else if (type == 4) {
Game.entities.add(new Finishpoint(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE));
Game.staticBackground.add(new Background(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE));
} else if (type == 5) {
Game.entities.add(new WallWithFinishingPoint(x * Game.BLOCK_SIZE, y * Game.BLOCK_SIZE));
}
}
y++;
}
Game.FIELD_HEIGHT = y;
Game.FIELD_WIDTH = x;
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* parses a map for multiplayer mode 0 = empty Background 1 = Breakable Wall
* 2 = Solid Wall 3 = Spawnpoint 4 = Finishpoint 5 = WallWithFinishPoint
*
* @param filename
* @return
*/
public int parseForMultiplayer(String filename) {
int x = 0, type, y = 0;
int player_count = 0;
Scanner maps;
try {
maps = new Scanner(Main.class.getResourceAsStream("/ressources/maps/" + filename));
while (maps.hasNextLine()) {
String text = maps.nextLine();
for (x = 0; x < text.length(); x++) {
type = Integer.parseInt("" + text.charAt(x));
if (type == 3) {
player_count++;
}
}
y++;
}
} catch (Exception e) {
e.printStackTrace();
}
return player_count;
}
public ArrayList<Point> getSpawnPoints(String filename) {
int x = 0, type, y = 0;
ArrayList<Point> spawnpoints = new ArrayList<Point>();
Scanner maps;
try {
maps = new Scanner(Main.class.getResourceAsStream("/ressources/maps/" + filename));
while (maps.hasNextLine()) {
String text = maps.nextLine();
for (x = 0; x < text.length(); x++) {
type = Integer.parseInt("" + text.charAt(x));
if (type == 3) {
spawnpoints.add(new Point(x, y));
}
}
y++;
}
} catch (Exception e) {
e.printStackTrace();
}
return spawnpoints;
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
9cc32149558a678e78b74ecbdcd3828043644cff | 5148293c98b0a27aa223ea157441ac7fa9b5e7a3 | /Method_Scraping/xml_scraping/NicadOutputFile_t1_flink_new2/Nicad_t1_flink_new27596.java | d4e7f86890a642d8e52f7ebadf9accac9be6563f | [] | no_license | ryosuke-ku/TestCodeSeacherPlus | cfd03a2858b67a05ecf17194213b7c02c5f2caff | d002a52251f5461598c7af73925b85a05cea85c6 | refs/heads/master | 2020-05-24T01:25:27.000821 | 2019-08-17T06:23:42 | 2019-08-17T06:23:42 | 187,005,399 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 500 | java | // clone pairs:27930:90%
// 43656:flink/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/ScheduledFutureAdapter.java
public class Nicad_t1_flink_new27596
{
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ScheduledFutureAdapter<?> that = (ScheduledFutureAdapter<?>) o;
return tieBreakerUid == that.tieBreakerUid && scheduleTimeNanos == that.scheduleTimeNanos;
}
} | [
"naist1020@gmail.com"
] | naist1020@gmail.com |
eca6447793d8e598cb990012648a988f8c12552e | 88223fcec3030c77cc70af4516a251b7744e3560 | /2.Multidimentional Arrays/src/WrongMeasurments.java | da6cc2fb71aa5503ff04316ef03bf6ec265a0037 | [] | no_license | aarabadjieva/SoftUni-Java-Advanced | 2f8fb25840d2cf47702d0b931886df85f2dc2d7a | e2828404005e672432ed7d395d238ca0a3a36f9a | refs/heads/master | 2022-05-12T10:34:39.727189 | 2020-04-28T11:17:12 | 2020-04-28T11:17:12 | 259,614,875 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,898 | java | import java.util.Arrays;
import java.util.Scanner;
public class WrongMeasurments {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int size = Integer.parseInt(scanner.nextLine());
int matrix[][] = new int[size][size];
for (int i = 0; i < size; i++) {
int[] input = Arrays.stream(scanner.nextLine().split(" "))
.mapToInt(Integer::parseInt)
.toArray();
matrix[i] = input;
}
int[] coordinates = Arrays.stream(scanner.nextLine().split(" "))
.mapToInt(Integer::parseInt)
.toArray();
int wrongValue = matrix[coordinates[0]][coordinates[1]];
for (int i = 0; i < size; i++) {
for (int j = 0; j < matrix[0].length; j++) {
if (matrix[i][j] == wrongValue) {
int left = 0;
int right = 0;
int up = 0;
int down = 0;
int sum = 0;
if (i - 1 >= 0 && matrix[i - 1][j] != wrongValue) {
up = matrix[i - 1][j];
}
if (i + 1 < size && matrix[i + 1][j] != wrongValue) {
down = matrix[i + 1][j];
}
if (j - 1 >= 0 && matrix[i][j - 1] != wrongValue) {
left = matrix[i][j - 1];
}
if (j + 1 <matrix[0].length && matrix[i][j + 1] != wrongValue) {
right = matrix[i][j + 1];
}
sum = left + right + up + down;
System.out.print(sum + " ");
} else {
System.out.print(matrix[i][j] + " ");
}
}
System.out.println();
}
}
}
| [
"l.i.n@abv.bg"
] | l.i.n@abv.bg |
402f2eccca2f381159cdb3245c149376468744c9 | fd026788a9b0fc12be524d6cb6f0edfff5b76eef | /src/main/java/com/demo/mapreduce/login_mysql/LoginReducer.java | 6da079bbb58f0dddd7b6fcdefd82a9524a2106dc | [] | no_license | Grace007/zhou-hw | a6e76580a489a0d0f2259e02413837121f5dda4d | 2da03e08b01c7265296b4518c85e05d06ca46d00 | refs/heads/master | 2020-03-22T19:09:01.898056 | 2018-07-11T02:07:08 | 2018-07-11T02:07:08 | 140,509,229 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package com.demo.mapreduce.login_mysql;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import java.io.IOException;
public class LoginReducer extends Reducer<Text, IntWritable, LoginWritable, LoginWritable> {
@Override
protected void reduce(Text key, Iterable<IntWritable> values,Context context) throws IOException, InterruptedException {
// values只有一个值,因为key没有相同的
int sum = 0;
for(IntWritable val:values){
sum += val.get();
}
String[] time = key.toString().split("-");
context.write(new LoginWritable(time[0]+"-"+time[1],time[2], sum), null);
}
}
| [
"15809713216run"
] | 15809713216run |
bd72e6731c271db516fe65a2f695c3b2e276153e | c03a28264a1da6aa935a87c6c4f84d4d28afe272 | /Leetcode/src/secret/Q302_Smallest_Rectangle_Enclosing_Black_Pixels.java | 683b0536b2251723090c4fe22b57c51e2f616205 | [] | no_license | bbfeechen/Algorithm | d59731686f06d6f4d4c13d66a8963f190a84f361 | 87a158a608d842e53e13bccc73526aadd5d129b0 | refs/heads/master | 2021-04-30T22:35:03.499341 | 2019-05-03T07:26:15 | 2019-05-03T07:26:15 | 7,991,128 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,215 | java | package secret;
public class Q302_Smallest_Rectangle_Enclosing_Black_Pixels {
private static int minX = Integer.MAX_VALUE;
private static int minY = Integer.MAX_VALUE;
private static int maxX = 0;
private static int maxY = 0;
public static int minArea(char[][] image, int x, int y) {
if(image == null || image.length == 0 || image[0].length == 0) return 0;
dfs(image, x, y);
return(maxX - minX + 1) * (maxY - minY + 1);
}
private static void dfs(char[][] image, int x, int y){
int m = image.length, n = image[0].length;
if(x < 0 || y < 0 || x >= m || y >= n || image[x][y] == '0') return;
image[x][y] = '0';
minX = Math.min(minX, x);
maxX = Math.max(maxX, x);
minY = Math.min(minY, y);
maxY = Math.max(maxY, y);
dfs(image, x + 1, y);
dfs(image, x - 1, y);
dfs(image, x, y - 1);
dfs(image, x, y + 1);
}
public static void main(String[] args) {
char[][] image = {
{'0', '0', '0', '1', '1', '1', '0', '0', '0'},
{'0', '0', '0', '1', '0', '1', '0', '0', '0'},
{'0', '0', '0', '1', '0', '1', '1', '0', '0'},
{'0', '0', '1', '1', '0', '0', '1', '0', '0'},
};
}
}
| [
"bbfeechen@gmail.com"
] | bbfeechen@gmail.com |
61ac9d9a5d823c451c32b48539aeb49dab2c34ad | 706dae6cc6526064622d4f5557471427441e5c5e | /src/test/java/com/anbo/juja/patterns/cache_18/classic/case2_lru_with_decorator/LRUCacheTest.java | 95bd7686dfab26beff65380e817db39d5f2f563f | [] | no_license | Anton-Bondar/Design-patterns-JUJA-examples- | 414edabfd8c4148640de7de8d01f809b01c3c17c | 9e3d628f7e45c0106514f8f459ea30fffed702d5 | refs/heads/master | 2021-10-09T04:45:42.372993 | 2018-12-21T12:09:00 | 2018-12-21T12:11:14 | 121,509,668 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,068 | java | package com.anbo.juja.patterns.cache_18.classic.case2_lru_with_decorator;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertSame;
import static org.mockito.Mockito.*;
/**
* Created by oleksandr.baglai on 11.01.2016.
*/
public class LRUCacheTest {
// данные в кеше есть
@Test
public void testExist() {
// given
LRUCache cache = new LRUCache(10);
// when
cache.put(1, new Resource(1));
cache.put(2, new Resource(2));
// then
assertEquals(true, cache.contains(1));
assertEquals(true, cache.contains(2));
assertEquals("Resource:1", cache.get(1).toString());
assertEquals("Resource:2", cache.get(2).toString());
}
// запрашиваем несуществующие данные
@Test
public void testNotExist() {
// given
LRUCache cache = new LRUCache(10);
// when
cache.put(1, new Resource(1));
// then
assertEquals(false, cache.contains(4));
assertEquals(null, cache.get(4));
}
// кеш переполнен
@Test
public void testMoreThanMaxSize() {
// given
LRUCache cache = new LRUCache(2);
// when
cache.put(1, new Resource(1));
cache.put(2, new Resource(2));
cache.put(3, new Resource(3));
// then
assertEquals(false, cache.contains(1));
assertEquals(true, cache.contains(2));
assertEquals(true, cache.contains(3));
assertEquals(null, cache.get(1));
assertEquals("Resource:2", cache.get(2).toString());
assertEquals("Resource:3", cache.get(3).toString());
}
// кеш может сохранять null значения
@Test
public void testNullValue() {
// given
LRUCache cache = new LRUCache(10);
// when
cache.put(1, null);
// then
assertEquals(true, cache.contains(1));
assertEquals(null, cache.get(1));
}
}
| [
"AntonBondar2013@gmail.com"
] | AntonBondar2013@gmail.com |
f7125dacb5639045de555b574085e5dfff98ba24 | 085184420a70c0ed43d4ade62c73785c773af97d | /cam/src/tdm/cam/tlf/imos2tlf/filter/DiagonalFailAndWarningFilter.java | bbb3ee4fca10a388d1e03d1a24aa12746ddf76f4 | [] | no_license | archmage74/tdm | 7203f9753e9135ecea8f4505e737d19aa5602a99 | 0fad1fb0a58e83a7f35345a4fdf93d771db27495 | refs/heads/master | 2021-01-18T01:43:40.441249 | 2013-02-23T16:33:02 | 2013-02-23T16:33:02 | 7,385,893 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 669 | java | package tdm.cam.tlf.imos2tlf.filter;
import java.util.List;
import tdm.cam.model.imos.ImosDrilling;
public class DiagonalFailAndWarningFilter extends DiagonalFailFilter {
protected final String WARNING_FORMAT_STRING = "Schraegbohrung gefunden: %1s wird ignoriert";
protected List<String> warnings;
public DiagonalFailAndWarningFilter(List<String> warnings) {
this.warnings = warnings;
}
@Override
public ImosDrilling filter(ImosDrilling drilling) {
ImosDrilling result = super.filter(drilling);
if (result == null) {
warnings.add(String.format(WARNING_FORMAT_STRING, drilling.toString()));
}
return result;
}
}
| [
"werner.puff@gmx.net"
] | werner.puff@gmx.net |
cb8317c33537e4dbc5df6d77d90989063e3c8bf5 | 7774c3f37fe58c39e502f60b829e33dc98fc0857 | /app/src/main/java/com/cvnavi/app/db/MessageDao.java | 285b151cbf1b3f989f516f7845b17a08bdc9aa25 | [] | no_license | ChenJun1/VehicleTerminalSystem1 | 3b092f443044faf64bb306499b91d60c776467ab | 2a780080be922f27a97a3e85f3562ed831e753d3 | refs/heads/master | 2021-05-08T00:18:48.276023 | 2017-10-20T01:39:46 | 2017-10-20T01:39:46 | 107,619,362 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,044 | java | package com.cvnavi.app.db;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.cvnavi.app.bean.MessageBean;
import java.util.ArrayList;
import java.util.List;
/**
* Created by zww on 2017/8/4.
*/
public class MessageDao {
private DB_Helper helper;
public MessageDao(Context context) {
helper = DB_Helper.getInstance(context);
}
public void closeDataBase() {
helper.close();
}
public boolean insert(MessageBean messageBean) {
SQLiteDatabase db = helper.getWritableDatabase();
long insertResult;
ArrayList<String> errorList = new ArrayList<>();
ContentValues values = new ContentValues();
values.put(DBConstants.MESSAGE_TIME, messageBean.getTime());
values.put(DBConstants.MESSAGE_TYPE, messageBean.getType());
values.put(DBConstants.MESSAGE_SOURCE, messageBean.getSource());
values.put(DBConstants.MESSAGE_CONENT, messageBean.getContent());
insertResult = db.insert(DBConstants.TB_MESSAGE, null, values);
if (insertResult == 0)
errorList.add(messageBean.getTime()+"遗漏");
return errorList.size() == 0;
}
public List<MessageBean> query() {
List<MessageBean> list = null;
SQLiteDatabase db = helper.getReadableDatabase();
Cursor cursor = db.rawQuery("select * from message where id>?",
new String[]{"0"});
if (cursor != null) {
list = new ArrayList<>();
while (cursor.moveToNext()) {
MessageBean messageBean = new MessageBean();
messageBean.setTime(cursor.getString(1));
messageBean.setType(cursor.getString(2));
messageBean.setSource(cursor.getString(3));
messageBean.setContent(cursor.getString(4));
list.add(messageBean);
}
cursor.close();
}
return list;
}
}
| [
"791954958@qq.com"
] | 791954958@qq.com |
090b2d4bc2510d76639839a1720f34b39e44fefe | 8af1164bac943cef64e41bae312223c3c0e38114 | /results-java/prestodb--presto/5b7278764c89c1823156c4bb71350fb0a9bede9e/after/PlanOptimizersFactory.java | 38844e717945b6225fd33bd36b9bc53520c5c1c4 | [] | no_license | fracz/refactor-extractor | 3ae45c97cc63f26d5cb8b92003b12f74cc9973a9 | dd5e82bfcc376e74a99e18c2bf54c95676914272 | refs/heads/master | 2021-01-19T06:50:08.211003 | 2018-11-30T13:00:57 | 2018-11-30T13:00:57 | 87,353,478 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,359 | java | /*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.facebook.presto.sql.planner;
import com.facebook.presto.metadata.AliasDao;
import com.facebook.presto.metadata.Metadata;
import com.facebook.presto.metadata.NodeManager;
import com.facebook.presto.metadata.ShardManager;
import com.facebook.presto.split.SplitManager;
import com.facebook.presto.sql.planner.optimizations.ImplementSampleAsFilter;
import com.facebook.presto.sql.planner.optimizations.LimitPushDown;
import com.facebook.presto.sql.planner.optimizations.MergeProjections;
import com.facebook.presto.sql.planner.optimizations.PlanOptimizer;
import com.facebook.presto.sql.planner.optimizations.PredicatePushDown;
import com.facebook.presto.sql.planner.optimizations.PruneRedundantProjections;
import com.facebook.presto.sql.planner.optimizations.PruneUnreferencedOutputs;
import com.facebook.presto.sql.planner.optimizations.SetFlatteningOptimizer;
import com.facebook.presto.sql.planner.optimizations.SimplifyExpressions;
import com.facebook.presto.sql.planner.optimizations.TableAliasSelector;
import com.facebook.presto.sql.planner.optimizations.UnaliasSymbolReferences;
import com.google.common.collect.ImmutableList;
import com.google.inject.Inject;
import javax.inject.Provider;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
public class PlanOptimizersFactory
implements Provider<List<PlanOptimizer>>
{
private final Metadata metadata;
private List<PlanOptimizer> optimizers;
@Inject
public PlanOptimizersFactory(Metadata metadata, SplitManager splitManager)
{
this.metadata = checkNotNull(metadata, "metadata is null");
ImmutableList.Builder<PlanOptimizer> builder = ImmutableList.builder();
builder.add(new ImplementSampleAsFilter(),
new SimplifyExpressions(metadata),
new PruneUnreferencedOutputs(),
new UnaliasSymbolReferences(),
new PruneRedundantProjections(),
new SetFlatteningOptimizer(),
new LimitPushDown(), // Run the LimitPushDown after flattening set operators to make it easier to do the set flattening
new PredicatePushDown(metadata, splitManager),
new PredicatePushDown(metadata, splitManager), // Run predicate push down one more time in case we can leverage new information from generated partitions
new MergeProjections(),
new SimplifyExpressions(metadata), // Re-run the SimplifyExpressions to simplify any recomposed expressions from other optimizations
new UnaliasSymbolReferences(), // Run again because predicate pushdown might add more projections
new PruneUnreferencedOutputs(), // Prune outputs again in case predicate pushdown move predicates all the way into the table scan
new PruneRedundantProjections()); // Run again because predicate pushdown might add more projections
// TODO: figure out how to improve the set flattening optimizer so that it can run at any point
this.optimizers = builder.build();
}
@Inject(optional = true)
public synchronized void injectAdditionalDependencies(AliasDao aliasDao, NodeManager nodeManager, ShardManager shardManager)
{
checkNotNull(aliasDao, "aliasDao is null");
checkNotNull(nodeManager, "nodeManager is null");
checkNotNull(shardManager, "shardManager is null");
ImmutableList.Builder<PlanOptimizer> builder = ImmutableList.builder();
builder.addAll(optimizers);
builder.add(new TableAliasSelector(metadata, aliasDao, nodeManager, shardManager));
this.optimizers = builder.build();
}
@Override
public synchronized List<PlanOptimizer> get()
{
return optimizers;
}
} | [
"fraczwojciech@gmail.com"
] | fraczwojciech@gmail.com |
f0c77b3d7ab7785cab179a24c4b9947111b2ae19 | 2d2c8090c86cc97c125c3ab4afd0e92ff1bd1b49 | /app/src/main/java/com/example/wanhao/homemakingapp/util/RetrofitHelper.java | d2f05d9b3cb280b882b8002fbd6f1ca04dfad658 | [] | no_license | 3441242166/HomemakingApp | 493d860a4788b445647fc340579874d99631c967 | 15e276a6bb2d5a71c2d05e1b6d237062f851bdfb | refs/heads/master | 2021-04-03T05:31:28.669917 | 2018-03-19T15:28:01 | 2018-03-19T15:28:01 | 125,171,669 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 2,628 | java | package com.example.wanhao.homemakingapp.util;
import com.example.wanhao.homemakingapp.config.ApiConstant;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
/**
* Created by wanhao on 2017/11/7.
*/
public class RetrofitHelper {
private static final String TAG = "RetrofitHelper";
public static Retrofit retrofit = null;
/**
* 得到service实例
*
* @param baseUrl
* @param tClass
* @param <T>
* @return
*/
public static <T> T getHttpService(String baseUrl, Class<T> tClass) {
//公共请求头
Interceptor headerInterceptor = new Interceptor() {
@Override
public okhttp3.Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
Request.Builder requestBuilder = originalRequest.newBuilder();
Request request = requestBuilder
.build();
return chain.proceed(request);
}
};
//日志拦截器
// HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
// logging.setLevel(HttpLoggingInterceptor.Level.BODY);
OkHttpClient.Builder builder = new OkHttpClient.Builder();
//设置头
builder.retryOnConnectionFailure(true) //自动重连
.connectTimeout(10, TimeUnit.SECONDS)
//.addNetworkInterceptor(logging)
.addInterceptor(headerInterceptor);
OkHttpClient okHttpClient = builder.build();
retrofit = new Retrofit.Builder()
.baseUrl(baseUrl)
.client(okHttpClient)
//.addConverterFactory(CustomGsonConverterFactory.create())
.build();
return retrofit.create(tClass);
}
public static <T> T get(Class<T> tClass) {
OkHttpClient.Builder builder = new OkHttpClient().newBuilder();
builder.retryOnConnectionFailure(true)
.retryOnConnectionFailure(true)
.connectTimeout(5, TimeUnit.SECONDS);
return new Retrofit.Builder().baseUrl(ApiConstant.BASE_URL)
.client(builder.build())
.addConverterFactory(GsonConverterFactory.create())
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.build()
.create(tClass);
}
}
| [
"3441242166@qq.com"
] | 3441242166@qq.com |
eeb50ad64187122ecdf253d70ed900e9a1b84865 | 51fa3cc281eee60058563920c3c9059e8a142e66 | /Java/src/testcases/CWE336_Same_Seed_in_PRNG/CWE336_Same_Seed_in_PRNG__basic_06.java | 71e2742a64d8d61e03bb2d481ed68f7ada5e9744 | [] | no_license | CU-0xff/CWE-Juliet-TestSuite-Java | 0b4846d6b283d91214fed2ab96dd78e0b68c945c | f616822e8cb65e4e5a321529aa28b79451702d30 | refs/heads/master | 2020-09-14T10:41:33.545462 | 2019-11-21T07:34:54 | 2019-11-21T07:34:54 | 223,105,798 | 1 | 4 | null | null | null | null | UTF-8 | Java | false | false | 3,078 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE336_Same_Seed_in_PRNG__basic_06.java
Label Definition File: CWE336_Same_Seed_in_PRNG__basic.label.xml
Template File: point-flaw-06.tmpl.java
*/
/*
* @description
* CWE: 336 Same Seed in PRNG
* Sinks:
* GoodSink: no explicit seed specified
* BadSink : hardcoded seed
* Flow Variant: 06 Control flow: if(PRIVATE_STATIC_FINAL_FIVE==5) and if(PRIVATE_STATIC_FINAL_FIVE!=5)
*
* */
package testcases.CWE336_Same_Seed_in_PRNG;
import testcasesupport.*;
import java.security.SecureRandom;
public class CWE336_Same_Seed_in_PRNG__basic_06 extends AbstractTestCase
{
/* The variable below is declared "final", so a tool should be able
* to identify that reads of this will always give its initialized
* value.
*/
private static final int PRIVATE_STATIC_FINAL_FIVE = 5;
public void bad() throws Throwable
{
if (PRIVATE_STATIC_FINAL_FIVE == 5)
{
final byte[] SEED = new byte[] {0x01, 0x02, 0x03, 0x04, 0x05};
SecureRandom secureRandom = new SecureRandom();
/* FLAW: using the same seed can make the PRNG sequence predictable if the seed is known */
secureRandom.setSeed(SEED);
IO.writeLine("" + secureRandom.nextInt()); /* run this several times and notice that the bad values are always the same */
IO.writeLine("" + secureRandom.nextInt());
}
}
/* good1() changes PRIVATE_STATIC_FINAL_FIVE==5 to PRIVATE_STATIC_FINAL_FIVE!=5 */
private void good1() throws Throwable
{
if (PRIVATE_STATIC_FINAL_FIVE != 5)
{
/* INCIDENTAL: CWE 561 Dead Code, the code below will never run */
IO.writeLine("Benign, fixed string");
}
else
{
SecureRandom secureRandom = new SecureRandom();
/* FIX: no explicit seed specified; produces far less predictable PRNG sequence */
IO.writeLine("" + secureRandom.nextInt());
IO.writeLine("" + secureRandom.nextInt());
}
}
/* good2() reverses the bodies in the if statement */
private void good2() throws Throwable
{
if (PRIVATE_STATIC_FINAL_FIVE == 5)
{
SecureRandom secureRandom = new SecureRandom();
/* FIX: no explicit seed specified; produces far less predictable PRNG sequence */
IO.writeLine("" + secureRandom.nextInt());
IO.writeLine("" + secureRandom.nextInt());
}
}
public void good() throws Throwable
{
good1();
good2();
}
/* 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);
}
}
| [
"frank@fischer.com.mt"
] | frank@fischer.com.mt |
5ca008c44f60120f7488004e8b0be27e05589fc0 | 3f605d058523f0b1e51f6557ed3c7663d5fa31d6 | /core/org.ebayopensource.vjet.core.jsnative/src/org/ebayopensource/dsf/jsnative/HtmlArea.java | 610620cd3f526c030e9fe4e37cc4f2cc2391605b | [] | no_license | vjetteam/vjet | 47e21a13978cd860f1faf5b0c2379e321a9b688c | ba90843b89dc40d7a7eb289cdf64e127ec548d1d | refs/heads/master | 2020-12-25T11:05:55.420303 | 2012-08-07T21:56:30 | 2012-08-07T21:56:30 | 3,181,492 | 3 | 1 | null | null | null | null | UTF-8 | Java | false | false | 8,142 | java | /*******************************************************************************
* Copyright (c) 2005-2011 eBay Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
*******************************************************************************/
package org.ebayopensource.dsf.jsnative;
import org.ebayopensource.dsf.javatojs.anno.AJavaOnly;
import org.ebayopensource.dsf.javatojs.anno.ARename;
import org.ebayopensource.dsf.jsnative.anno.Alias;
import org.ebayopensource.dsf.jsnative.anno.DOMSupport;
import org.ebayopensource.dsf.jsnative.anno.DomLevel;
import org.ebayopensource.dsf.jsnative.anno.JsMetatype;
import org.ebayopensource.dsf.jsnative.anno.Property;
/**
* http://www.w3.org/TR/1999/REC-html401-19991224/struct/objects.html#edef-AREA
*
*/
@Alias("HTMLAreaElement")
@DOMSupport(DomLevel.ONE)
@JsMetatype
public interface HtmlArea extends HtmlElement{
/** "default" */
@AJavaOnly @ARename(name="'default'")
public static final String SHAPE_DEFAULT = "default" ;
/** "rect" */
@AJavaOnly @ARename(name="'rect'")
public static final String SHAPE_RECT = "rect" ;
/** "circle" */
@AJavaOnly @ARename(name="'circle'")
public static final String SHAPE_CIRCLE = "circle" ;
/** "poly" */
@AJavaOnly @ARename(name="'poly'")
public static final String SHAPE_POLY = "poly" ;
@Property String getAccessKey();
@Property void setAccessKey(String accessKey);
@Property String getAlt();
@Property void setAlt(String alt);
@Property String getCoords();
@Property void setCoords(String coords);
@Property String getHref();
@Property void setHref(String href);
@Property boolean getNoHref();
@Property void setNoHref(boolean noHref);
@Property String getShape();
@Property void setShape(String shape);
@Property int getTabIndex();
@Property void setTabIndex(int tabIndex);
@Property String getTarget();
@Property void setTarget(String target);
/**
* Returns the onblur event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onblur.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onblur")
Object getOnBlur();
/**
* Sets the onblur event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onblur.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onblur")
void setOnBlur(Object functionRef);
/**
* Returns the onfocus event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onfocus.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onfocus")
Object getOnFocus();
/**
* Sets the onfocus event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onfocus.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onfocus")
void setOnFocus(Object functionRef);
/**
* Returns the onkeydown event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onkeydown.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onkeydown")
Object getOnKeyDown();
/**
* Sets the onkeydown event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onkeydown.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onkeydown")
void setOnKeyDown(Object functionRef);
/**
* Returns the onkeypress event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onkeypress.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onkeypress")
Object getOnKeyPress();
/**
* Sets the onkeypress event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onkeypress.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onkeypress")
void setOnKeyPress(Object functionRef);
/**
* Returns the onkeyup event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onkeyup.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onkeyup")
Object getOnKeyUp();
/**
* Sets the onkeyup event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onkeyup.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onkeyup")
void setOnKeyUp(Object functionRef);
/**
* Returns the onclick event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onclick.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onclick")
Object getOnClick();
/**
* Sets the onclick event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onclick.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onclick")
void setOnClick(Object functionRef);
/**
* Returns the ondblclick event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_ondblclick.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="ondblclick")
Object getOnDblClick();
/**
* Sets the ondblclick event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_ondblclick.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="ondblclick")
void setOnDblClick(Object functionRef);
/**
* Returns the onmousedown event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onmousedown.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmousedown")
Object getOnMouseDown();
/**
* Sets the onmousedown event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onmousedown.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmousedown")
void setOnMouseDown(Object functionRef);
/**
* Returns the onmouseup event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onmouseup.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmouseup")
Object getOnMouseUp();
/**
* Sets the onmouseup event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onmouseup.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmouseup")
void setOnMouseUp(Object functionRef);
/**
* Returns the onmousemove event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onmousemove.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmousemove")
Object getOnMouseMove();
/**
* Sets the onmousemove event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onmousemove.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmousemove")
void setOnMouseMove(Object functionRef);
/**
* Returns the onmouseout event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onmouseout.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmouseout")
Object getOnMouseOut();
/**
* Sets the onmouseout event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onmouseout.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmouseout")
void setOnMouseOut(Object functionRef);
/**
* Returns the onmouseover event handler code on the current element.
* @see http://www.w3schools.com/jsref/jsref_onmouseover.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmouseover")
Object getOnMouseOver();
/**
* Sets the onmouseover event handler code on the current element.
* @param functionRef
* @see http://www.w3schools.com/jsref/jsref_onmouseover.asp
*/
@DOMSupport(DomLevel.ZERO)
@Property(name="onmouseover")
void setOnMouseOver(Object functionRef);
}
| [
"pwang@27f4aac7-f869-4a38-a8c2-f1a995e726e6"
] | pwang@27f4aac7-f869-4a38-a8c2-f1a995e726e6 |
17e198e83ef2f217129d52e1004fcd00fb23d21c | 30455dcf8d0db40aaa36cd54a6cf75a83812fcfb | /sources/com/google/android/gms/ads/mediation/customevent/d.java | 4d884818e4346ab01587f984bac4f26aeef6ad34 | [] | no_license | excellmania/FastCharger | 76c294ca3d172bfdc8bbba46c0f9d38a7e444510 | 536d0ead49ee2574e7f6a889e81515b899c23a9a | refs/heads/master | 2020-05-01T03:26:45.850182 | 2019-03-23T05:53:49 | 2019-03-23T05:53:49 | 177,245,158 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 305 | java | package com.google.android.gms.ads.mediation.customevent;
import com.google.ads.mediation.i;
import java.util.HashMap;
@Deprecated
public final class d implements i {
private final HashMap<String, Object> a = new HashMap();
public Object a(String str) {
return this.a.get(str);
}
}
| [
"47793867+excellmania@users.noreply.github.com"
] | 47793867+excellmania@users.noreply.github.com |
45ff5fcd86590c49bf79a8e384c2ad51d38f8ccf | 31fb9f1198b0df7246e58d1a897e49a23f9d2160 | /src/main/java/com/ocdsoft/bacta/soe/controller/ObjController.java | 4b4e13ec188ca6f1716daa8b99b3a5127516f526 | [] | no_license | Parz1val/soe | 99c16058fea0311fe22119974d8eb1484dcbb367 | 0f5faffa0a5f2415bd28613340f8d4dba4516f15 | refs/heads/master | 2021-01-15T20:13:53.600992 | 2016-04-22T07:07:39 | 2016-04-22T07:07:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package com.ocdsoft.bacta.soe.controller;
import com.ocdsoft.bacta.engine.network.controller.Controller;
import com.ocdsoft.bacta.soe.connection.SoeUdpConnection;
public interface ObjController<Message, Object> extends Controller {
public void handleIncoming(final SoeUdpConnection connection, final Message message, final Object invoker);
}
| [
"mustangcoupe69@gmail.com"
] | mustangcoupe69@gmail.com |
4a80c788a763d554c0ad28b739dee0ee86858aab | fa26b41621cf540abe609b3137ba14d3ce91debd | /src/main/java/com/miscitems/MiscItemsAndBlocks/Gui/Electric/GuiSolarPanel.java | 0a6cd8fe83106d3ae94eab85cf70e99061601909 | [
"MIT"
] | permissive | Horeak/MiscItemsAndBlocks-Source-Code | 2f15c9f8c40a11d0b89218fb618aa5fa2e889cf0 | 5cbaa12f507cc4f56b5ba9ac238cbe99fb02eb30 | refs/heads/master | 2022-05-10T22:44:08.301118 | 2015-04-27T18:56:00 | 2015-04-27T18:56:00 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,180 | java | package com.miscitems.MiscItemsAndBlocks.Gui.Electric;
import com.miscitems.MiscItemsAndBlocks.Container.Electric.ContainerSolarPanel;
import com.miscitems.MiscItemsAndBlocks.TileEntity.Electric.TileEntitySolarPanel;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiTextField;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import org.lwjgl.opengl.GL11;
public class GuiSolarPanel extends GuiContainer{
private TileEntitySolarPanel tile;
private final ResourceLocation Texture = new ResourceLocation("miscitems" , "textures/gui/SolarPanelGui.png");
GuiTextField textfield;
public GuiSolarPanel(InventoryPlayer InvPlayer, TileEntitySolarPanel tile) {
super(new ContainerSolarPanel(InvPlayer, tile));
this.xSize = 176;
this.ySize = 166;
this.tile = tile;
}
@Override
protected void drawGuiContainerForegroundLayer(int param1, int param2) {
fontRendererObj.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
fontRendererObj.drawString(StatCollector.translateToLocal("gui.solarpanel"), 7, 3, 4210752);
textfield.drawTextBox();
}
@Override
protected void drawGuiContainerBackgroundLayer(float f, int X, int Y)
{
GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
Minecraft.getMinecraft().renderEngine.bindTexture(Texture);
int x = (this.width - this.xSize) / 2;
int y = (this.height - this.ySize) / 2;
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
String Mode = "No Charger";
String State = "off";
int MetaData = tile.GetMeta();
if(MetaData == 1 || MetaData == 0){
Mode = StatCollector.translateToLocal("gui.string.solar.state1");
State = "on";
}else if (MetaData == 2){
Mode = StatCollector.translateToLocal("gui.string.solar.state2");
State = "blocked";
}else if (MetaData == 3){
Mode = StatCollector.translateToLocal("gui.string.solar.state3");
State = "rain";
}else if (MetaData == 4){
Mode = StatCollector.translateToLocal("gui.string.solar.state3");
State = "night";
}
textfield.setText(Mode);
if(State == "on"){
this.drawTexturedModalRect(x + 79, y + 14, 176, 3, 18, 18);
}else if (State == "rain"){
this.drawTexturedModalRect(x + 79, y + 14, 176, 39, 18, 18);
}else if (State == "blocked"){
this.drawTexturedModalRect(x + 79, y + 14, 176, 21, 18, 18);
}else if (State == "night"){
this.drawTexturedModalRect(x + 79, y + 14, 176, 57, 18, 18);
}
}
@Override
public void initGui(){
super.initGui();
buttonList.clear();
textfield = new GuiTextField(fontRendererObj, 7, 45, 162, 21);
}
}
| [
"haavardpc@hotmail.com"
] | haavardpc@hotmail.com |
78b1e37f40a89dabad59947100c6397f60fbb09b | 0cc354986d2900e6b928c038538d6835ac3c5b84 | /oak-core/src/test/java/org/apache/jackrabbit/oak/spi/security/authorization/AbstractAccessControlTest.java | badcb9ce2ecd6a654a94e4b6a065addb652c172b | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | tteofili/jackrabbit-oak | 1a5574bbfeffedc04a7c51e8d0c4b80f0c04dd83 | 3ff901ca66416e071024748423a47d88cb171732 | refs/heads/0.6 | 2020-04-05T22:46:38.451698 | 2013-01-24T08:54:17 | 2013-01-24T08:54:17 | 11,504,427 | 0 | 0 | Apache-2.0 | 2018-06-28T16:34:34 | 2013-07-18T14:10:35 | Java | UTF-8 | Java | false | false | 3,491 | 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.jackrabbit.oak.spi.security.authorization;
import javax.jcr.NamespaceRegistry;
import javax.jcr.security.Privilege;
import org.apache.jackrabbit.api.security.JackrabbitAccessControlManager;
import org.apache.jackrabbit.api.security.authorization.PrivilegeManager;
import org.apache.jackrabbit.oak.AbstractSecurityTest;
import org.apache.jackrabbit.oak.api.Root;
import org.apache.jackrabbit.oak.api.Tree;
import org.apache.jackrabbit.oak.namepath.NamePathMapper;
import org.apache.jackrabbit.oak.plugins.name.ReadWriteNamespaceRegistry;
import org.apache.jackrabbit.oak.security.authorization.AccessControlManagerImpl;
import org.apache.jackrabbit.oak.spi.security.authorization.restriction.RestrictionProvider;
/**
* AbstractAccessControlTest... TODO
*/
public abstract class AbstractAccessControlTest extends AbstractSecurityTest {
private PrivilegeManager privMgr;
private RestrictionProvider restrictionProvider;
protected void registerNamespace(String prefix, String uri) throws Exception {
NamespaceRegistry nsRegistry = new ReadWriteNamespaceRegistry() {
@Override
protected Root getWriteRoot() {
return root;
}
@Override
protected Tree getReadTree() {
return root.getTree("/");
}
};
nsRegistry.registerNamespace(prefix, uri);
}
protected NamePathMapper getNamePathMapper() {
return namePathMapper;
}
protected Privilege[] privilegesFromNames(String... privilegeNames) throws Exception {
Privilege[] privs = new Privilege[privilegeNames.length];
for (int i = 0; i < privilegeNames.length; i++) {
privs[i] = getPrivilegeManager().getPrivilege(privilegeNames[i]);
}
return privs;
}
protected JackrabbitAccessControlManager getAccessControlManager(Root root) {
// TODO
//acMgr = securityProvider.getAccessControlConfiguration().getAccessControlManager(root, NamePathMapper.DEFAULT);
return new AccessControlManagerImpl(root, getNamePathMapper(), getSecurityProvider());
}
protected RestrictionProvider getRestrictionProvider() {
if (restrictionProvider == null) {
restrictionProvider = getSecurityProvider().getAccessControlConfiguration().getRestrictionProvider(getNamePathMapper());
}
return restrictionProvider;
}
protected PrivilegeManager getPrivilegeManager() {
if (privMgr == null) {
privMgr = getSecurityProvider().getPrivilegeConfiguration().getPrivilegeManager(root, getNamePathMapper());
}
return privMgr;
}
} | [
"angela@apache.org"
] | angela@apache.org |
c8ee1523a55201fa765f10901ffa4e0c86ea0c9c | 35eb25f4d99484efcc26ba0c4bd1f573ebe1882a | /vmvm/src/main/java/edu/columbia/cs/psl/vmvm/asm/mvs/UnconditionalChrootMethodVisitor.java | dbfe84641094d6745f5de3d36d312dc322a91baf | [
"MIT",
"BSD-3-Clause",
"Apache-2.0"
] | permissive | SoftwareEngineeringToolDemos/ICSE-2014-VMVM | 2627d23ecb4ad83f054e1e36abb8ae036b7bd549 | 1984f3c665566fc6305c1f17b3d1d3c12dfad9c3 | refs/heads/master | 2020-12-28T03:17:29.681359 | 2016-06-24T17:49:02 | 2016-06-24T17:49:02 | 43,308,968 | 0 | 3 | null | 2015-12-04T03:37:52 | 2015-09-28T15:21:57 | Java | UTF-8 | Java | false | false | 6,160 | java | package edu.columbia.cs.psl.vmvm.asm.mvs;
import java.io.File;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
import edu.columbia.cs.psl.vmvm.asm.VMVMClassVisitor;
import edu.columbia.cs.psl.vmvm.chroot.ChrootUtils;
import edu.columbia.cs.psl.vmvm.org.objectweb.asm.MethodVisitor;
import edu.columbia.cs.psl.vmvm.org.objectweb.asm.Opcodes;
import edu.columbia.cs.psl.vmvm.org.objectweb.asm.Type;
import edu.columbia.cs.psl.vmvm.org.objectweb.asm.commons.AdviceAdapter;
public class UnconditionalChrootMethodVisitor extends AdviceAdapter {
public static HashMap<String, String> fsInputMethods = new HashMap<>();
public static HashSet<String> fsOutputMethods = new HashSet<>();
static {
try {
Scanner s = new Scanner(new File("fs-input-methods.txt"));
while (s.hasNextLine()) {
String[] d = s.nextLine().split("\t");
fsInputMethods.put(d[0], d[1]);
}
s.close();
s = new Scanner(new File("fs-output-methods.txt"));
while (s.hasNextLine()) {
fsOutputMethods.add(s.nextLine());
}
s.close();
} catch (Exception ex) {
ex.printStackTrace();
}
}
private String className;
private VMVMClassVisitor icv;
public UnconditionalChrootMethodVisitor(int api, MethodVisitor mv, int access, String name, String desc, String className, VMVMClassVisitor icv) {
super(api, mv, access, name, desc);
this.className = className;
this.icv = icv;
}
private boolean superInit = false;
@Override
protected void onMethodEnter() {
superInit = true;
}
@Override
public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itfc) {
if (fsInputMethods.containsKey(owner + "." + name + desc) || fsOutputMethods.contains(owner + "." + name + desc)) {
if (!superInit) {
/*
* If we are calling the super init, and that super init method
* is an fs method, we have this gorgeous hack that passes all
* of the args to a capture method that returns the args back!
*/
// EqMethodInsnNode mi = new EqMethodInsnNode(opcode, owner, name, desc, EqMethodInsnNode.FLAG_SUPER_INVOKE_CHROOT);
// Type[] args = Type.getArgumentTypes(desc);
// String captureDesc = Type.getMethodDescriptor(Type.getType("[Ljava/lang/Object;"), args);
//
// super.visitMethodInsn(Opcodes.INVOKESTATIC, className, ChrootUtils.getCaptureInitParentMethodName(mi), captureDesc);
// for (int i = 0; i < args.length; i++) {
// visitInsn(DUP);
// visitIntInsn(BIPUSH, i);
// visitInsn(AALOAD);
// checkCast(args[i]);
// visitInsn(SWAP);
// }
// visitInsn(POP);
//
// super.visitMethodInsn(opcode, owner, name, desc);
// icv.addChrootMethodToGen(mi);
throw new UnsupportedOperationException("Not implemented yet");
} else {
String captureType = fsInputMethods.get(owner + "." + name + desc);
// EqMethodInsnNode mi = new EqMethodInsnNode(opcode, owner, name, desc);
Type[] args = Type.getArgumentTypes(desc);
boolean swapBack = false;
Type typeToVirtualize = null;
if(captureType == null)
{
if(args.length > 0)
captureType = "0";
else
captureType = "this";
// throw new IllegalArgumentException("Can't find capture type for "+owner+"."+name+desc);
}
if (captureType.startsWith("0")) {
typeToVirtualize = args[0];
if (args.length == 2) {
visitInsn(SWAP);
swapBack = true;
} else if (args.length > 2) {
throw new IllegalArgumentException("Not coded to process args where we need to swap more than once");
}
} else if (captureType.startsWith("this")) {
typeToVirtualize = Type.getType("L"+owner+";");
if (args.length == 1) {
visitInsn(SWAP);
swapBack = true;
} else if (args.length > 1) {
throw new IllegalArgumentException("Not coded to process args where we need to swap more than once");
}
}
else
{
throw new IllegalStateException("Can't parse capture type<"+captureType+">");
}
boolean isOutput = false;
if (fsOutputMethods.contains(owner + "." + name + desc)) {
isOutput = true;
}
if(isOutput)
super.visitInsn(ICONST_1);
else
super.visitInsn(ICONST_0);
super.visitMethodInsn(Opcodes.INVOKESTATIC, Type.getInternalName(ChrootUtils.class), "chrootCapture" + (captureType.endsWith("INV") ? "INV" : ""), "(" + typeToVirtualize.getDescriptor()
+ "Z)" + typeToVirtualize.getDescriptor(), false);
if (swapBack)
visitInsn(SWAP);
// mi.desc= desc;
// icv.addChrootMethodToGen(mi);
// if (name.equals("<init>")) {
// if (superInit) {
// super.visitInsn(Opcodes.SWAP);
// super.visitInsn(Opcodes.POP);
// }
// super.visitInsn(Opcodes.SWAP);
// super.visitInsn(Opcodes.POP);
// }
}
}
super.visitMethodInsn(opcode, owner, name, desc, itfc);
}
public static void sandboxCallToFSOutputMethod(MethodVisitor mv, int opcode, String owner, String name, String desc) {
Type[] args = Type.getArgumentTypes(desc);
String captureArgType = null;
switch (args.length) {
case 0:
captureArgType = "L" + owner + ";";
mv.visitMethodInsn(INVOKESTATIC, Type.getInternalName(ChrootUtils.class), "logFileWrite", "(" + captureArgType + ")"+captureArgType, false);
// mv.visitMethodInsn(opcode, owner, name, desc);
break;
case 1:
captureArgType = args[0].getDescriptor();
mv.visitMethodInsn(INVOKESTATIC, Type.getInternalName(ChrootUtils.class), "logFileWrite", "(" + captureArgType + ")"+captureArgType, false);
// mv.visitMethodInsn(opcode, owner, name, desc);
break;
case 2:
captureArgType = args[0].getDescriptor();
mv.visitInsn(SWAP);
mv.visitMethodInsn(INVOKESTATIC, Type.getInternalName(ChrootUtils.class), "logFileWrite", "(" + captureArgType + ")"+captureArgType, false);
// mv.visitMethodInsn(opcode, owner, name, desc);
mv.visitInsn(SWAP);
break;
default:
break;
}
if (captureArgType == null) {
mv.visitMethodInsn(opcode, Type.getInternalName(ChrootUtils.class), name, desc, false);
} else {
}
}
}
| [
"jbell@cs.columbia.edu"
] | jbell@cs.columbia.edu |
81c56af09acf8ba1b1bbe0759317272852a570e8 | 5a076617e29016fe75d6421d235f22cc79f8f157 | /Android模仿乐淘的应用程序分析源码/src/com/jclt/activity/more/LetaoMicroBlogActivity.java | fc4375e43e578e3e5ebba22c261f1cd81c3e4f1b | [] | no_license | dddddttttt/androidsourcecodes | 516b8c79cae7f4fa71b97a2a470eab52844e1334 | 3d13ab72163bbeed2ef226a476e29ca79766ea0b | refs/heads/master | 2020-08-17T01:38:54.095515 | 2018-04-08T15:17:24 | 2018-04-08T15:17:24 | null | 0 | 0 | null | null | null | null | GB18030 | Java | false | false | 2,055 | java | package com.jclt.activity.more;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.view.Window;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.jclt.activity.CommonActivity;
import com.jclt.activity.R;
public class LetaoMicroBlogActivity extends CommonActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// 去除手机界面默认标题
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.letao_more_bolg);
// 手机界面标题设置
super.textViewTitle = (TextView) findViewById(R.id.title);
super.textViewTitle.setText(R.string.microblog);
super.listViewAll = (ListView)findViewById(android.R.id.list);
// 通过线程来循环调用进度条
super.progressDialog = ProgressDialog.show(this, "历通购物", "数据获取中....",true);
super.progressDialog.show();
super.handler.post(this);
bottomMenuOnClick();
}
/**
* 底部菜单监听器
*/
private void bottomMenuOnClick(){
imageViewIndex = (ImageView) findViewById(R.id.menu_home_img);
imageViewIndex.setOnTouchListener(viewIndex);
imageViewIndex.setImageResource(R.drawable.menu_home_released);
imageViewType = (ImageView) findViewById(R.id.menu_brand_img);
imageViewType.setOnTouchListener(viewType);
imageViewType.setImageResource(R.drawable.menu_brand_released);
imageViewShooping = (ImageView) findViewById(R.id.menu_shopping_cart_img);
imageViewShooping.setOnTouchListener(viewShooping);
imageViewShooping.setImageResource(R.drawable.menu_shopping_cart_released);
imageViewMyLetao = (ImageView) findViewById(R.id.menu_my_letao_img);
imageViewMyLetao.setOnTouchListener(viewMyLetao);
imageViewMyLetao.setImageResource(R.drawable.menu_my_letao_released);
imageViewMore = (ImageView) findViewById(R.id.menu_more_img);
imageViewMore.setOnTouchListener(viewMore);
imageViewMore.setImageResource(R.drawable.menu_more_pressed);
}
}
| [
"harry.han@gmail.com"
] | harry.han@gmail.com |
8dd0c18a0b5e732c969d9654dd05bc8ec9e30d03 | dfbc143422bb1aa5a9f34adf849a927e90f70f7b | /Contoh Project/video walp/com/google/android/gms/internal/ads/bdl.java | 350a732bf29eb1baee3b73da4ffe1dae8fadaed0 | [] | no_license | IrfanRZ44/Set-Wallpaper | 82a656acbf99bc94010e4f74383a4269e312a6f6 | 046b89cab1de482a9240f760e8bcfce2b24d6622 | refs/heads/master | 2020-05-18T11:18:14.749232 | 2019-05-01T04:17:54 | 2019-05-01T04:17:54 | 184,367,300 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,428 | java | package com.google.android.gms.internal.ads;
import android.os.Bundle;
import android.view.View;
import com.google.android.gms.a.a;
import com.google.android.gms.a.b;
import com.google.android.gms.ads.VideoController;
import com.google.android.gms.ads.formats.NativeAd.Image;
import com.google.android.gms.ads.mediation.NativeAdMapper;
import com.google.android.gms.ads.mediation.NativeContentAdMapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@cm
public final class bdl
extends bdb
{
private final NativeContentAdMapper a;
public bdl(NativeContentAdMapper paramNativeContentAdMapper)
{
this.a = paramNativeContentAdMapper;
}
public final String a()
{
return this.a.getHeadline();
}
public final void a(a parama)
{
this.a.handleClick((View)b.a(parama));
}
public final void a(a parama1, a parama2, a parama3)
{
HashMap localHashMap1 = (HashMap)b.a(parama2);
HashMap localHashMap2 = (HashMap)b.a(parama3);
this.a.trackViews((View)b.a(parama1), localHashMap1, localHashMap2);
}
public final List b()
{
List localList = this.a.getImages();
if (localList != null)
{
ArrayList localArrayList = new ArrayList();
Iterator localIterator = localList.iterator();
while (localIterator.hasNext())
{
NativeAd.Image localImage = (NativeAd.Image)localIterator.next();
localArrayList.add(new ate(localImage.getDrawable(), localImage.getUri(), localImage.getScale()));
}
return localArrayList;
}
return null;
}
public final void b(a parama)
{
this.a.trackView((View)b.a(parama));
}
public final String c()
{
return this.a.getBody();
}
public final void c(a parama)
{
this.a.untrackView((View)b.a(parama));
}
public final aun d()
{
NativeAd.Image localImage = this.a.getLogo();
if (localImage != null) {
return new ate(localImage.getDrawable(), localImage.getUri(), localImage.getScale());
}
return null;
}
public final String e()
{
return this.a.getCallToAction();
}
public final String f()
{
return this.a.getAdvertiser();
}
public final void g()
{
this.a.recordImpression();
}
public final boolean h()
{
return this.a.getOverrideImpressionRecording();
}
public final boolean i()
{
return this.a.getOverrideClickHandling();
}
public final Bundle j()
{
return this.a.getExtras();
}
public final a k()
{
View localView = this.a.getAdChoicesContent();
if (localView == null) {
return null;
}
return b.a(localView);
}
public final aqg l()
{
if (this.a.getVideoController() != null) {
return this.a.getVideoController().zzbc();
}
return null;
}
public final auj m()
{
return null;
}
public final a n()
{
View localView = this.a.zzvy();
if (localView == null) {
return null;
}
return b.a(localView);
}
public final a o()
{
return null;
}
}
/* Location: C:\Users\IrfanRZ\Desktop\video walp\classes_dex2jar.jar
* Qualified Name: com.google.android.gms.internal.ads.bdl
* JD-Core Version: 0.7.0.1
*/ | [
"irfan.rozal44@gmail.com"
] | irfan.rozal44@gmail.com |
bf5965d13943adb46d04cbcebcd47324163fdebb | eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3 | /tags/2007-04-25/seasar2-2.4.13-rc1/s2-framework/src/test/java/org/seasar/framework/util/LikeUtilTest.java | 0c9d09783cda677a34d6cc98c7b6e17ac52f550a | [
"Apache-2.0"
] | permissive | svn2github/s2container | 54ca27cf0c1200a93e1cb88884eb8226a9be677d | 625adc6c4e1396654a7297d00ec206c077a78696 | refs/heads/master | 2020-06-04T17:15:02.140847 | 2013-08-09T09:38:15 | 2013-08-09T09:38:15 | 10,850,644 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 1,922 | java | /*
* Copyright 2004-2007 the Seasar Foundation and the Others.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
package org.seasar.framework.util;
import junit.framework.TestCase;
public class LikeUtilTest extends TestCase {
public void testMatch() throws Exception {
assertEquals("1", true, LikeUtil.match("SCOTT", "SCOTT"));
assertEquals("2", true, LikeUtil.match("_COT_", "SCOTT"));
assertEquals("3", true, LikeUtil.match("SC%", "SCOTT"));
assertEquals("4", true, LikeUtil.match("SC%T", "SCOTT"));
assertEquals("5", true, LikeUtil.match("%TT", "SCOTT"));
assertEquals("6", true, LikeUtil.match("S_O%T", "SCOTT"));
assertEquals("7", false, LikeUtil.match("COTT", "SCOTT"));
assertEquals("8", false, LikeUtil.match("_COT", "SCOTT"));
assertEquals("9", false, LikeUtil.match("SC%A", "SCOTT"));
assertEquals("10", false, LikeUtil.match("%OT", "SCOTT"));
assertEquals("11", true, LikeUtil.match("SCOTT%", "SCOTT"));
assertEquals("12", false, LikeUtil.match("SCOTT_", "SCOTT"));
assertEquals("13", true, LikeUtil.match("%SCOTT", "SCOTT"));
assertEquals("14", true, LikeUtil.match("%SCOTT%", "SCOTT"));
assertEquals("15", true, LikeUtil.match("S%", "SCOTT"));
assertEquals("16", true, LikeUtil.match("%abc%abc", "xxxabcyyyabc"));
}
} | [
"higa@319488c0-e101-0410-93bc-b5e51f62721a"
] | higa@319488c0-e101-0410-93bc-b5e51f62721a |
3834705d4831a3a1b766c0d769d7f583ce78ad3e | 97b46ff38b675d934948ff3731cf1607a1cc0fc9 | /Server/java/pk/elfo/loginserver/network/gameserverpackets/ChangeAccessLevel.java | 74a468e5b2ce96a9631ae7d371fa8ff8c6e6095d | [] | no_license | l2brutal/pk-elfo_H5 | a6703d734111e687ad2f1b2ebae769e071a911a4 | 766fa2a92cb3dcde5da6e68a7f3d41603b9c037e | refs/heads/master | 2020-12-28T13:33:46.142303 | 2016-01-20T09:53:10 | 2016-01-20T09:53:10 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,509 | java | /*
* Copyright (C) 2004-2013 L2J Server
*
* This file is part of L2J Server.
*
* L2J Server 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.
*
* L2J Server is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package pk.elfo.loginserver.network.gameserverpackets;
import java.util.logging.Logger;
import pk.elfo.loginserver.GameServerThread;
import pk.elfo.loginserver.LoginController;
import pk.elfo.util.network.BaseRecievePacket;
/**
* @author -Wooden-
*/
public class ChangeAccessLevel extends BaseRecievePacket
{
protected static Logger _log = Logger.getLogger(ChangeAccessLevel.class.getName());
/**
* @param decrypt
* @param server
*/
public ChangeAccessLevel(byte[] decrypt, GameServerThread server)
{
super(decrypt);
int level = readD();
String account = readS();
LoginController.getInstance().setAccountAccessLevel(account, level);
_log.info("Changed " + account + " access level to " + level);
}
}
| [
"PkElfo@13720c4f-9a1f-4619-977f-b36a0ac534ba"
] | PkElfo@13720c4f-9a1f-4619-977f-b36a0ac534ba |
709631a01d79c7192f346ddf7b38e15c51d2ea3a | 761a37d6d23030785a97d7e7a479c85c54b1bc75 | /src/mojang/vs.java | 2323305e4d6d924efcc12ce5ddee6cbd33177bc2 | [] | no_license | Lyx52/minecraft-1-2-5-decompiled | 35ae210920d92dd6087facf90ef32edb70bda1fd | 091efe0c238eaec6c7ab626dc2e98da0776837fb | refs/heads/master | 2023-04-04T23:04:18.475541 | 2021-04-02T17:29:45 | 2021-04-02T17:29:45 | 354,087,923 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 388 | java | package mojang;
public class vs extends fe {
public vs() {
super(new aiw(), 0.3F);
}
protected float a(qn var1) {
return 180.0F;
}
public void a(qn var1, double var2, double var4, double var6, float var8, float var9) {
super.a((acq)var1, var2, var4, var6, var8, var9);
}
protected int a(qn var1, int var2, float var3) {
return -1;
}
}
| [
"lyxikars123@gmail.com"
] | lyxikars123@gmail.com |
cda4067d5b95d02b4f85c3be2f8a7e7a4f69f68b | cc59bbccd7dc50db9d7153999b90d4e16bca8278 | /dbus-mysql-extractor/src/main/java/com/creditease/dbus/extractor/container/MsgStatusContainer.java | a2fe887e1c2ab9322f17f8e3ecd60ea19660e652 | [
"Apache-2.0"
] | permissive | cammette/DBus | e9c834610a5326875162d782217525537a0fb85c | 905c8b1a8ab09f7f4d7d36394fbec72318aa88eb | refs/heads/master | 2020-03-12T21:24:26.532577 | 2018-04-20T06:07:13 | 2018-04-20T06:07:13 | 130,827,392 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,521 | java | /*-
* <<
* DBus
* ==
* Copyright (C) 2016 - 2017 Bridata
* ==
* 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.creditease.dbus.extractor.container;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import com.creditease.dbus.extractor.common.utils.Constants;
import com.creditease.dbus.extractor.vo.SendStatusVo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MsgStatusContainer {
protected Logger logger = LoggerFactory.getLogger(getClass());
private static MsgStatusContainer msgStatusContainer;
private static final long timeout = 10 * 60 * 1000;
private ConcurrentMap<Long, SendStatusVo> map = new ConcurrentHashMap<Long, SendStatusVo>();
private MsgStatusContainer() {
}
public static MsgStatusContainer getInstance() {
if (msgStatusContainer == null) {
synchronized (MsgStatusContainer.class) {
if (msgStatusContainer == null) {
msgStatusContainer = new MsgStatusContainer();
}
}
}
return msgStatusContainer;
}
public int getSize() {
return map.size();
}
public void setTotal(long batchId, int totalSplit, boolean status) {
SendStatusVo vo = null;
synchronized (this) {
vo = map.get(batchId);
if (vo != null) {
vo.setTotal(totalSplit);
vo.setStatus(status);
} else {
vo = new SendStatusVo();
vo.setTotal(totalSplit);
vo.setStatus(status);
map.put(batchId, vo);
}
}
}
public void setCompleted(long batchId, int completed) {
SendStatusVo vo = null;
synchronized (this) {
vo = map.get(batchId);
if (vo != null) {
vo.setCompleted(vo.getCompleted() + 1);
}
}
}
public void setError(long batchId, boolean isErr) {
SendStatusVo vo = null;
synchronized (this) {
vo = map.get(batchId);
if (vo != null) {
vo.setError(isErr);
}
}
}
public void deleteMsg(long batchId) {
synchronized (this) {
map.remove(batchId);
}
}
public void clear() {
synchronized (this) {
map.clear();
}
}
public Set<SendStatusVo> getNeedAckOrRollbackBatch() {
Set<SendStatusVo> setRet = new TreeSet<SendStatusVo>();
SendStatusVo vo = null;
Integer numNeedAcl = 0;
Integer numNeedRollback = 0;
Integer numNotCompleted = 0;
for (Map.Entry<Long, SendStatusVo> entry : map.entrySet()) {
vo = entry.getValue();
SendStatusVo voRet = new SendStatusVo();
voRet.setBatchId(entry.getKey());
if (vo.getTotal() != 0 && vo.getCompleted() != 0 && !vo.isError()
&& vo.isStatus() && (vo.getTotal() <= vo.getCompleted())) {
voRet.setResult(Constants.NEED_ACK_CANAL);
numNeedAcl = numNeedAcl + 1;
} else if ((System.currentTimeMillis() - vo.getCreateTime() > timeout) || vo.isError()) {
voRet.setResult(Constants.NEED_ROLLBACK_CANAL);
numNeedRollback = numNeedRollback + 1;
} else {
voRet.setResult(Constants.SEND_NOT_COMPLETED);
numNotCompleted = numNotCompleted + 1;
}
setRet.add(voRet);
}
logger.debug("up to now, need ack canal number is {}, need rollback canal number is {}, not completed number is {}.",
numNeedAcl, numNeedRollback, numNotCompleted);
return setRet;
}
}
| [
"dongwang47@creditease.cn"
] | dongwang47@creditease.cn |
8aa3b16cafd4de073d1c095b136609d4eb152d61 | 0fd45dce370e6c808301dd1496b850be1f214718 | /Help/ForceLayout/src/au/gov/asd/tac/constellation/plugins/arrangements/d3/force/Simulation.java | 9fb80f2e2ac08528532529b819ad8fc0295b5264 | [
"Apache-2.0"
] | permissive | constellation-app/miscellaneous | 407e6342c6d1f2069f6137bfb70505ca16ebac6f | 2c80e3472d076afb3bf7a944088b3fa93437b238 | refs/heads/master | 2021-07-19T16:31:47.760852 | 2021-01-11T15:16:27 | 2021-01-11T15:16:27 | 228,289,110 | 1 | 2 | Apache-2.0 | 2019-12-18T18:12:41 | 2019-12-16T02:46:31 | null | UTF-8 | Java | false | false | 4,416 | java | /*
* Copyright 2010-2020 Australian Signals Directorate
*
* 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 au.gov.asd.tac.constellation.plugins.arrangements.d3.force;
import java.util.LinkedHashMap;
import java.util.List;
/**
*
* @author algol
*/
public final class Simulation {
private final List<IVertex> vxs;
private double alpha;
private double alphaMin;
private double alphaDecay;
private double alphaTarget;
private double velocityDecay;
private final LinkedHashMap<String, Force> forces;
final double initialRadius = 10;
final double initalAngle = Math.PI * (3-Math.sqrt(5));
public Simulation(final List<IVertex> vxs) {
this.vxs = vxs;
alpha = 1;
alphaMin = 0.001;
alphaDecay = 1.0 - Math.pow(alphaMin, 1.0/300.0);
alphaTarget = 0;
velocityDecay = 0.6;
forces = new LinkedHashMap<>();
initialiseVertices();
}
public Simulation addForce(final String name, final Force force) {
forces.put(name, force);
force.initialise(vxs);
return this;
}
private void initialiseVertices() {
int i = 0;
for(final IVertex vx : vxs) {
vx.setIndex(i);
if(Double.isNaN(vx.getX()) || Double.isNaN(vx.getY())) {
final double radius = initialRadius * Math.sqrt(i);
final double angle = i * initalAngle;
vx.setX((radius * Math.cos(angle)));
vx.setY((radius * Math.sin(angle)));
}
if(true) { // Double.isNaN(vx.getXVelocity()) || Double.isNaN(vx.getYVelocity())) {
vx.setXVelocity(0);
vx.setYVelocity(0);
}
i++;
}
}
void step() {
while(alpha>=alphaMin) {
tick(1);
// if(alpha<=0.1) {//772372209558107) {
// System.out.printf("@@ alpha=%s\n", alpha); alpha = 0; System.out.printf("@@ alpha=0\n"); // @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
// }
}
}
void tick(final int iterations) {
for(int k=0; k<iterations; k++) {
alpha += (alphaTarget - alpha) * alphaDecay;
forces.forEach((name, force) -> {
// System.out.printf("@@force %s %s %s\n", name, force, alpha);
force.force(alpha);
});
// int[] _i = new int[1];
vxs.forEach(vx -> {
// System.out.printf("@@vel %s %s\n", vx.getXVelocity(), vx.getYVelocity());
vx.setXVelocity(vx.getXVelocity() * velocityDecay);
vx.setX(vx.getX() + vx.getXVelocity());
vx.setYVelocity(vx.getYVelocity() * velocityDecay);
vx.setY(vx.getY() + vx.getYVelocity());
// System.out.printf("@@tick %s %s %s\n", _i[0]++, vx.getX(), vx.getY());
});
}
}
public double getAlpha() {
return alpha;
}
public Simulation setAlpha(final double alpha) {
this.alpha = alpha;
return this;
}
public double getAlphaMin() {
return alphaMin;
}
public Simulation setAlphaMin(final double alphaMin) {
this.alphaMin = alphaMin;
return this;
}
public double getAlphaDecay() {
return alphaDecay;
}
public Simulation setAlphaDecay(final double alphaDecay) {
this.alphaDecay = alphaDecay;
return this;
}
public double getAlphaTarget() {
return alphaTarget;
}
public Simulation setAlphaTarget(final double alphaTarget) {
this.alphaTarget = alphaTarget;
return this;
}
public double getVelocityDecay() {
return velocityDecay;
}
public Simulation setVelocityDecay(final double velocityDecay) {
this.velocityDecay = velocityDecay;
return this;
}
}
| [
"39325530+arcturus2@users.noreply.github.com"
] | 39325530+arcturus2@users.noreply.github.com |
183c8b78197ac439f8baa9a255ec08294dd1060d | 180e78725121de49801e34de358c32cf7148b0a2 | /dataset/protocol1/kylin/learning/6221/BitSets.java | eed6e6357a037d2916303170ee23501ccf5b8cc6 | [] | no_license | ASSERT-KTH/synthetic-checkstyle-error-dataset | 40e8d1e0a7ebe7f7711def96a390891a6922f7bd | 40c057e1669584bfc6fecf789b5b2854660222f3 | refs/heads/master | 2023-03-18T12:50:55.410343 | 2019-01-25T09:54:39 | 2019-01-25T09:54:39 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,325 | 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.kylin.common.util;
import java.util.BitSet;
public class BitSets {
public static BitSet valueOf(int[] indexes) {
if (indexes == null || indexes.length == 0) {
return new BitSet();
}
int maxIndex = Integer.MIN_VALUE;
for (int index : indexes) { maxIndex = Math.max(maxIndex, index);
}
BitSet set = new BitSet(maxIndex);
for (int index : indexes) {
set.set(index);
}
return set;
}
}
| [
"bloriot97@gmail.com"
] | bloriot97@gmail.com |
e533d9b14647653df447f544587782b9675f9835 | b754ac4baf965f986b4482cef2690d9a0aa7dda0 | /trunk/ezlive-war/src/balises/KeywordsNews.java | fc8f1f170717797870d7bff392e6ac1dd751cea7 | [] | no_license | BGCX067/ezlive-svn-to-git | d0030514fbdddc56e1c42378e47bd91863aa86e7 | 8267f57ee66faea6b6e8bdbab633cd6e9fa12900 | refs/heads/master | 2016-09-01T08:51:10.181446 | 2015-12-28T14:34:49 | 2015-12-28T14:34:49 | 48,872,255 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,973 | java | package balises;
import java.util.ArrayList;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.TagSupport;
import divers.Keyword;
import divers.NewsKeyword;
public class KeywordsNews extends TagSupport {
private static final long serialVersionUID = 1L;
private int idNews;
private int nb;
private ArrayList keys;
private ArrayList AllKeywords;
public int doStartTag() throws JspException {
stockerKeywords();
nb = 0;
keys = new ArrayList();
String realId = (String) pageContext.getAttribute("realIdNews");
idNews = Integer.parseInt(realId);
traiterKeys((ArrayList) pageContext.getServletContext().getAttribute(
"newsKeyword"));
traiterKeywords();
return EVAL_BODY_INCLUDE;
}
private void stockerKeywords() {
AllKeywords = (ArrayList) pageContext.getServletContext().getAttribute(
"keywords");
}
private String getKeyword(int id) {
String resultat = "";
for (int i = 0; i < AllKeywords.size(); ++i) {
Keyword kwd = (Keyword) AllKeywords.get(i);
if (id == kwd.getId()) {
resultat = kwd.getNom();
break;
}
}
return resultat;
}
private void traiterKeywords() {
if (keys != null && !keys.isEmpty()) {
int myId = Integer.parseInt((String) keys.get(nb));
pageContext.setAttribute("keyword", getKeyword(myId));
pageContext.setAttribute("idKeyword", String.valueOf(myId));
}
}
private void traiterKeys(ArrayList allNewsKeywords) {
for (int i = 0; i < allNewsKeywords.size(); ++i) {
NewsKeyword nkwd = (NewsKeyword) allNewsKeywords.get(i);
if (nkwd.getNews_id() == idNews) {
keys.add(String.valueOf(nkwd.getKeyword_id()));
}
}
}
public int doAfterBody() throws JspException {
++nb;
if (nb >= keys.size()) {
return SKIP_BODY;
}
idNews = Integer.parseInt((String) pageContext
.getAttribute("realIdNews"));
traiterKeywords();
return EVAL_BODY_AGAIN;
}
}
| [
"you@example.com"
] | you@example.com |
84cfa36f1c1be4b5e3f95e905587fdab5376b2c9 | b58157a55a5a1f9c5c88c37d36905a6a8097e983 | /core/question19/src/main/java/org/spring/cert/proxy/spring/Runner.java | 287d1c5671fc2664a0cbc689d09d4b1b5d43c233 | [] | no_license | Abdulrehman0693/spring5-cert-study-notes | fc725f6d5ddf3fbba424050150105413e2c94e53 | 0c1c3a0bb0a64936a08ce75f8261b0924708eff2 | refs/heads/main | 2023-05-31T04:59:07.363236 | 2021-06-20T19:17:38 | 2021-06-20T19:17:38 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 356 | java | package org.spring.cert.proxy.spring;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
public class Runner {
public static void main(String[] args) {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ApplicationConfig.class);
context.registerShutdownHook();
}
}
| [
"aketzamaster@gmail.com"
] | aketzamaster@gmail.com |
c83cd934a5a90c6c7db6741f99c6a91a92de3190 | b7c0a4cd36272e2951a8aaf6e94d7f6fd191b3c1 | /OrderFood1/app/src/main/java/com/example/orderfood1/LayoutListItem.java | 69df1e442807459b11d30f4a8170a331a69850cd | [] | no_license | xuanthu9x/BaiTapUngDungDiDong | 096f6dc293e01f36cfa4d9180fe1537f8bfc6819 | bbef33e6bfb76ec77e281d7958a557f66ffc94f3 | refs/heads/master | 2022-10-17T04:40:52.436363 | 2020-06-21T11:44:16 | 2020-06-21T11:44:16 | 273,041,902 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 350 | java | package com.example.orderfood1;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
public class LayoutListItem extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_layout_list_item);
}
}
| [
"="
] | = |
e34bc74048a210dd6c1ed213c1a26c6817408d3c | 2ea1219ab522f4cabc695b065064830791c6b2c9 | /Nomin-Erdene/Classwork26_April262019_nominerdene/April262019_Classwork26_nominerdene/LogicOpTest.java | aa9ab950f991c7c0b4f07ce6da7c0f796dcd981e | [] | no_license | khangaikhuu/cs_intro_2019 | d6f1ab58942a26ddde7bb89e8997eea6b219944e | 98b096ba8648afcba60538fad320c64686530ea7 | refs/heads/master | 2020-05-05T13:32:02.548969 | 2019-06-04T06:32:26 | 2019-06-04T06:32:26 | 180,082,134 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 408 | java |
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class LogicOpTest
{
@Test
public void TestLogicOperation()
{
LogicOp l1 = new LogicOp();
assertEquals(true, l1.LogicOp(true,true,true));
assertEquals(true, l1.LogicOp(true,false,true));
assertEquals(false, l1.LogicOp(false,false,false));
}
}
| [
"g12@asu.local"
] | g12@asu.local |
94713bc19e3ec2e5ac1283e229119c0bad267b34 | 1de0bd7e9bf278009bcccb892864b893883ed0cb | /.history/95.unique-binary-search-trees-ii_20190315231030.java | 49bdf0a3fe853fb5f6c515a9f58921bb6f60a438 | [] | no_license | zhejianusc/leetcode_vs_code | b90a6539ff3d610302df06284d9ef2c4b27c6cca | 485565448adc98f90cc1135c7cd12cfdd3fde31c | refs/heads/master | 2020-04-24T00:44:20.160179 | 2020-03-24T04:40:32 | 2020-03-24T04:40:32 | 171,574,685 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,889 | java | /*
* @lc app=leetcode id=95 lang=java
*
* [95] Unique Binary Search Trees II
*
* https://leetcode.com/problems/unique-binary-search-trees-ii/description/
*
* algorithms
* Medium (34.62%)
* Total Accepted: 130K
* Total Submissions: 372.3K
* Testcase Example: '3'
*
* Given an integer n, generate all structurally unique BST's (binary search
* trees) that store values 1 ... n.
*
* Example:
*
*
* Input: 3
* Output:
* [
* [1,null,3,2],
* [3,2,null,1],
* [3,1,null,null,2],
* [2,1,3],
* [1,null,2,null,3]
* ]
* Explanation:
* The above output corresponds to the 5 unique BST's shown below:
*
* 1 3 3 2 1
* \ / / / \ \
* 3 2 1 1 3 2
* / / \ \
* 2 1 2 3
*
*
*/
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
class Solution {
public List<TreeNode> generateTrees(int n) {
if(n == 0) return new ArrayList<>();
return genTree(1, n);
}
private List<TreeNode> genTree(int start, int end) {
List<TreeNode> res = new ArrayList<>();
if(start > end) {
res.add(null);
}
if(start == end) {
return res;
}
for(int i = start; i <= end; i++) {
List<TreeNode> left = genTree(start, i);
List<TreeNode> right = genTree(i + 1, end);
for(TreeNode l : left) {
for(TreeNode r : right) {
TreeNode root = new TreeNode(i);
root.left = l;
root.right = r;
res.add(root);
}
}
}
return res;
}
}
| [
"jianzher@sina.com"
] | jianzher@sina.com |
da90d08896863ec4f213237ce15951cd7932e96b | b308232b5f9a1acd400fe15b45780e348048fccd | /Entity/src/main/java/com/param/entity/model/procurement/PurchaseOrderOtherChargesMapper.java | ac7ebe1dc1e084238fed9f5f28143fa8fc835298 | [] | no_license | PravatKumarPradhan/his | 2aae12f730b7d652b9590ef976b12443fc2c2afb | afb2b3df65c0bc1b1864afc1f958ca36a2562e3f | refs/heads/master | 2022-12-22T20:43:44.895342 | 2018-07-31T17:04:26 | 2018-07-31T17:04:26 | 143,041,254 | 1 | 0 | null | 2022-12-16T03:59:53 | 2018-07-31T16:43:36 | HTML | UTF-8 | Java | false | false | 2,202 | java | package com.param.entity.model.procurement;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import com.param.entity.model.base.BaseEntity;
import com.param.entity.model.master.OtherCharge;
@Entity(name = "PurchaseOrderOtherChargesMapper")
@Table(name = "t_other_charges_po_mapper", schema = "procurement")
public class PurchaseOrderOtherChargesMapper extends BaseEntity implements Serializable{
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private Integer id;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name = "purchase_order_detail_id")
private PurchaseOrderDetail purchaseOrderDetail;
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name = "other_charges_id")
private OtherCharge otherCharge;
@Column(name = "amount")
private Double amount;
public PurchaseOrderOtherChargesMapper() {
super();
}
public PurchaseOrderOtherChargesMapper(OtherCharge otherCharge, Double amount) {
super();
this.otherCharge = otherCharge;
this.amount = amount;
}
public void updatePoOtherChargesMapper(OtherCharge otherCharge, Double amount) {
this.otherCharge = otherCharge;
this.amount = amount;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public PurchaseOrderDetail getPurchaseOrderDetail() {
return purchaseOrderDetail;
}
public void setPurchaseOrderDetail(PurchaseOrderDetail purchaseOrderDetail) {
this.purchaseOrderDetail = purchaseOrderDetail;
}
public OtherCharge getOtherCharge() {
return otherCharge;
}
public void setOtherCharge(OtherCharge otherCharge) {
this.otherCharge = otherCharge;
}
public Double getAmount() {
return amount;
}
public void setAmount(Double amount) {
this.amount = amount;
}
}
| [
"pkp751989@gmail.com"
] | pkp751989@gmail.com |
d629e1f44589f14278a1460520555881b058aac2 | 7e5acfd551c5e28b8b79ea47e1d40cc44873b5d0 | /src/main/java/org/jsynthlib/patch/model/impl/PatchHandler.java | ca564b5d36fa75fcbec82e5da9c7b1451ac07ea1 | [] | no_license | Xycl/JSynthLib | c1c69d043b8146a00e84bc1c7381d569392d4f46 | a4a9e37b7fda8f495caf138728be5a6f78c4bc01 | refs/heads/master | 2021-01-15T13:34:55.882406 | 2014-12-29T22:15:18 | 2014-12-29T22:15:18 | 99,676,396 | 1 | 3 | null | 2021-01-07T12:38:12 | 2017-08-08T09:39:01 | Java | UTF-8 | Java | false | false | 1,869 | java | /*
* Copyright 2014 Pascal Collberg
*
* This file is part of JSynthLib.
*
* JSynthLib 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 2 of the License,
* or(at your option) any later version.
*
* JSynthLib 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 JSynthLib; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*/
package org.jsynthlib.patch.model.impl;
import org.jsynthlib.core.viewcontroller.desktop.JSLFrame;
/**
* @author Pascal Collberg
*
*/
public interface PatchHandler {
/** Get the selected patch. */
Patch getSelectedPatch();
/** Copy the selected patch. */
void copySelectedPatch();
/**
* Send the selected patch to the Edit buffer of the synth for the patch.
* Only for Single Patch.
*/
void sendSelectedPatch();
/**
* Send the selected patch to the Edit buffer of the synth specified by
* user. Only for Single Patch.
*/
void sendToSelectedPatch();
/**
* Send the selected patch to a buffer of the synth specified by user. Only
* for Single Patch.
*/
void storeSelectedPatch();
/** Reassign the driver of the selected patch. */
void reassignSelectedPatch();
/** Play the selected patch. */
void playSelectedPatch();
/** Invoke an editor for the selected patch. */
JSLFrame editSelectedPatch();
}
| [
"packe01@yahoo.se"
] | packe01@yahoo.se |
2ffc58a1d49873e09da6dd3ba8c934591c4aad63 | 6675a1a9e2aefd5668c1238c330f3237b253299a | /2.15/dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-organisationunit/src/main/java/org/hisp/dhis/oum/action/organisationunit/GetOrganisationUnitListAction.java | 40cc5dccd7d2cc48d291ec2dc7dd61bb3291231e | [
"BSD-3-Clause"
] | permissive | hispindia/dhis-2.15 | 9e5bd360bf50eb1f770ac75cf01dc848500882c2 | f61f791bf9df8d681ec442e289d67638b16f99bf | refs/heads/master | 2021-01-12T06:32:38.660800 | 2016-12-27T07:44:32 | 2016-12-27T07:44:32 | 77,379,159 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,645 | java | package org.hisp.dhis.oum.action.organisationunit;
/*
* Copyright (c) 2004-2014, University of Oslo
* 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 the HISP project nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import static org.apache.commons.lang.StringUtils.isNotBlank;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.hisp.dhis.common.comparator.IdentifiableObjectNameComparator;
import org.hisp.dhis.organisationunit.OrganisationUnit;
import org.hisp.dhis.organisationunit.OrganisationUnitService;
import org.hisp.dhis.ouwt.manager.OrganisationUnitSelectionManager;
import org.hisp.dhis.paging.ActionPagingSupport;
/**
* @author Torgeir Lorange Ostby
* @version $Id: GetOrganisationUnitListAction.java 1898 2006-09-22 12:06:56Z
* torgeilo $
*/
public class GetOrganisationUnitListAction
extends ActionPagingSupport<OrganisationUnit>
{
// -------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------
private OrganisationUnitService organisationUnitService;
public void setOrganisationUnitService( OrganisationUnitService organisationUnitService )
{
this.organisationUnitService = organisationUnitService;
}
private OrganisationUnitSelectionManager selectionManager;
public void setSelectionManager( OrganisationUnitSelectionManager selectionManager )
{
this.selectionManager = selectionManager;
}
// -------------------------------------------------------------------------
// Input & Output
// -------------------------------------------------------------------------
private List<OrganisationUnit> organisationUnits = new ArrayList<OrganisationUnit>();
public List<OrganisationUnit> getOrganisationUnits()
{
return organisationUnits;
}
private String key;
public String getKey()
{
return key;
}
public void setKey( String key )
{
this.key = key;
}
// -------------------------------------------------------------------------
// Action implementation
// -------------------------------------------------------------------------
public String execute()
throws Exception
{
Collection<OrganisationUnit> selectedUnits = selectionManager.getSelectedOrganisationUnits();
if ( selectedUnits.isEmpty() )
{
organisationUnits.addAll( selectionManager.getRootOrganisationUnits() );
}
else
{
for ( OrganisationUnit selectedUnit : selectedUnits )
{
organisationUnits.addAll( selectedUnit.getChildren() );
}
}
Collections.sort( organisationUnits, new IdentifiableObjectNameComparator() );
if ( isNotBlank( key ) )
{
organisationUnitService.searchOrganisationUnitByName( organisationUnits, key );
}
this.paging = createPaging( organisationUnits.size() );
organisationUnits = getBlockElement( organisationUnits, paging.getStartPos(), paging.getPageSize() );
return SUCCESS;
}
}
| [
"[sagarb.4488@gmail.com]"
] | [sagarb.4488@gmail.com] |
baa3d374729a3fecf3d5146f45cf24aa0dfb13ec | 50a916153c64e09c2c0ac43d01c9aa89a94d369a | /service-fee/src/main/java/com/java110/fee/dao/impl/FeeFormulaServiceDaoImpl.java | a388e6c45949c62025b9427d15208265d12616b9 | [
"Apache-2.0"
] | permissive | geffzhang/MicroCommunity | 9e191f925c496b913794db68236099ec7ae095f9 | 2983e87da0ce17e3b96bac30940adb4d2eda72b2 | refs/heads/master | 2021-08-28T15:52:56.644401 | 2021-08-02T14:12:32 | 2021-08-02T14:12:32 | 239,411,253 | 2 | 3 | Apache-2.0 | 2021-08-02T14:12:33 | 2020-02-10T02:28:08 | null | UTF-8 | Java | false | false | 3,096 | java | package com.java110.fee.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.fee.dao.IFeeFormulaServiceDao;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* 费用公式服务 与数据库交互
* Created by wuxw on 2017/4/5.
*/
@Service("feeFormulaServiceDaoImpl")
//@Transactional
public class FeeFormulaServiceDaoImpl extends BaseServiceDao implements IFeeFormulaServiceDao {
private static Logger logger = LoggerFactory.getLogger(FeeFormulaServiceDaoImpl.class);
/**
* 保存费用公式信息 到 instance
* @param info bId 信息
* @throws DAOException DAO异常
*/
@Override
public void saveFeeFormulaInfo(Map info) throws DAOException {
logger.debug("保存费用公式信息Instance 入参 info : {}",info);
int saveFlag = sqlSessionTemplate.insert("feeFormulaServiceDaoImpl.saveFeeFormulaInfo",info);
if(saveFlag < 1){
throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存费用公式信息Instance数据失败:"+ JSONObject.toJSONString(info));
}
}
/**
* 查询费用公式信息(instance)
* @param info bId 信息
* @return List<Map>
* @throws DAOException DAO异常
*/
@Override
public List<Map> getFeeFormulaInfo(Map info) throws DAOException {
logger.debug("查询费用公式信息 入参 info : {}",info);
List<Map> businessFeeFormulaInfos = sqlSessionTemplate.selectList("feeFormulaServiceDaoImpl.getFeeFormulaInfo",info);
return businessFeeFormulaInfos;
}
/**
* 修改费用公式信息
* @param info 修改信息
* @throws DAOException DAO异常
*/
@Override
public void updateFeeFormulaInfo(Map info) throws DAOException {
logger.debug("修改费用公式信息Instance 入参 info : {}",info);
int saveFlag = sqlSessionTemplate.update("feeFormulaServiceDaoImpl.updateFeeFormulaInfo",info);
if(saveFlag < 1){
throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改费用公式信息Instance数据失败:"+ JSONObject.toJSONString(info));
}
}
/**
* 查询费用公式数量
* @param info 费用公式信息
* @return 费用公式数量
*/
@Override
public int queryFeeFormulasCount(Map info) {
logger.debug("查询费用公式数据 入参 info : {}",info);
List<Map> businessFeeFormulaInfos = sqlSessionTemplate.selectList("feeFormulaServiceDaoImpl.queryFeeFormulasCount", info);
if (businessFeeFormulaInfos.size() < 1) {
return 0;
}
return Integer.parseInt(businessFeeFormulaInfos.get(0).get("count").toString());
}
}
| [
"928255095@qq.com"
] | 928255095@qq.com |
a9664279dd82fa9ada407a69b201d6a6bd6f5081 | 83d56024094d15f64e07650dd2b606a38d7ec5f1 | /sicc_druida/fuentes/java/MaeEncueAplicClienTransactionQuery.java | b41d0ac9b5beacfcb186f0c411d20e8d4f1d0857 | [] | no_license | cdiglesias/SICC | bdeba6af8f49e8d038ef30b61fcc6371c1083840 | 72fedb14a03cb4a77f62885bec3226dbbed6a5bb | refs/heads/master | 2021-01-19T19:45:14.788800 | 2016-04-07T16:20:51 | 2016-04-07T16:20:51 | null | 0 | 0 | null | null | null | null | ISO-8859-1 | Java | false | false | 4,502 | java |
/*
INDRA/CAR/mmg
$Id: MaeEncueAplicClienTransactionQuery.java,v 1.1 2009/12/03 18:35:38 pecbazalar Exp $
DESC
*/
import java.util.*;
import es.indra.utils.*;
import es.indra.druida.belcorp.MMGDruidaHelper;
import es.indra.druida.belcorp.MMGDruidaTransaction;
import es.indra.druida.belcorp.MMGException;
import es.indra.druida.belcorp.MMGNoSessionException;
import es.indra.druida.DruidaConector;
import es.indra.mare.common.dto.MareDTO;
import es.indra.mare.common.dto.IMareDTO;
import es.indra.mare.common.mln.MareBusinessID;
import es.indra.sicc.util.UtilidadesSession;
import es.indra.belcorp.mso.*;
// Definicion de la clase
public class MaeEncueAplicClienTransactionQuery extends MMGDruidaTransaction {
//Constante que determina el atributo chocice de la entidada
//Constantes usadas en la clase. Simplemente representan
//los nombre de conectore y de logicas de negocio
public static final String BUSINESSID_QUERY = "MMGMaeEncueAplicClienQueryFromToUserPage";
public static final String CONECTOR_QUERY_LIST = "MaeEncueAplicClienConectorQueryList";
// Definicion del constructor
public MaeEncueAplicClienTransactionQuery(){
super();
}
// Definicion del metodo abstracto ejecucion
public void ejecucion() throws Exception {
try{
//Ejecutamos las acciones comunes
super.ejecucion();
//Metemos en la sesión la query de la busqueda en formato param1|param2|....|paramN(para el tema de volver a la
//pagina anterior y ,mantener los últimos resultados)
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY,
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY));
traza("MMG:: LLegao a transaction Query de entidad MaeEncueAplicClien");
String clieOidClie = (String)getEntrada("clieOidClie");
traza("MMG:: Valor de atributo clieOidClie: " + clieOidClie);
String reenOidResp = (String)getEntrada("reenOidResp");
traza("MMG:: Valor de atributo reenOidResp: " + reenOidResp);
//Construimos los MSOs (from y to) con los elementos de la búsqueda
MaeEncueAplicClienData maeEncueAplicClienFrom =new MaeEncueAplicClienData();
MaeEncueAplicClienData maeEncueAplicClienTo = new MaeEncueAplicClienData();
//Construimos el from. Los campos que no sean de intervalo ponemos
//el mismo valor que el from. y los que si sen de intervalo ponemos el valor
//corespondiente
es.indra.belcorp.mso.MaeClienData clieOidClieData = null;
if(clieOidClie != null && !clieOidClie.trim().equals("")){
clieOidClieData = new es.indra.belcorp.mso.MaeClienData();
clieOidClieData.setId(new Long(clieOidClie));
}
maeEncueAplicClienFrom.setClieOidClie(clieOidClieData);
es.indra.belcorp.mso.MaeRespuEncueData reenOidRespData = null;
if(reenOidResp != null && !reenOidResp.trim().equals("")){
reenOidRespData = new es.indra.belcorp.mso.MaeRespuEncueData();
reenOidRespData.setId(new Long(reenOidResp));
}
maeEncueAplicClienFrom.setReenOidResp(reenOidRespData);
//Construimos el to
maeEncueAplicClienTo = (MaeEncueAplicClienData)maeEncueAplicClienFrom.clone();
//Metemos tanto el fromo como el to como últimos mso con parámetros de búsqueda
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY_OBJ_FROM, maeEncueAplicClienFrom);
conectorParametroSesion(SESSION_ATTRIBUTE_LAST_QUERY_OBJ_TO, maeEncueAplicClienTo);
//Sacamos los datos de paginación
Integer pageCount = new Integer((String)getEntrada("pageCount"));
Integer pageSize = new Integer((String)getEntrada("pageSize"));
//Creamos el dto y el bussines id correspondientes a la acción de realiza una query
Vector datos = new Vector();
MareDTO dto = new MareDTO();
dto.addProperty("maeEncueAplicClienFrom", maeEncueAplicClienFrom);
dto.addProperty("maeEncueAplicClienTo", maeEncueAplicClienTo);
dto.addProperty("pageCount", pageCount);
dto.addProperty("pageSize", pageSize);
dto.addProperty("userProperties", MMGDruidaHelper.getUserProperties(this));
datos.add(dto);
datos.add(new MareBusinessID(BUSINESSID_QUERY));
//Invocamos la lógica de negocio
traza("MMG:: Iniciada ejecución Query de entidad MaeEncueAplicClien");
DruidaConector conectorQuery = conectar(CONECTOR_QUERY_LIST, datos);
traza("MMG:: Finalizada ejecución Query de entidad MaeEncueAplicClien");
//Definimos el resultado del conector
setConector(conectorQuery);
}catch(Exception e){
handleException(e);
}
}
}
| [
"hp.vega@hotmail.com"
] | hp.vega@hotmail.com |
f8aac3cdd02d78cc1dff2871ded3656cdcf90447 | 36bbde826ff3e123716dce821020cf2a931abf6e | /plugin/core/src/main/java/com/perl5/lang/perl/extensions/packageprocessor/PerlPackageParentsProvider.java | 9c5876b883259dfb90b6d3e8eb9d053d289a7bcb | [
"Apache-2.0"
] | permissive | Camelcade/Perl5-IDEA | 0332dd4794aab5ed91126a2c1ecd608f9c801447 | deecc3c4fcdf93b4ff35dd31b4c7045dd7285407 | refs/heads/master | 2023-08-08T07:47:31.489233 | 2023-07-27T05:18:40 | 2023-07-27T06:17:04 | 33,823,684 | 323 | 79 | NOASSERTION | 2023-09-13T04:36:15 | 2015-04-12T16:09:15 | Java | UTF-8 | Java | false | false | 1,447 | java | /*
* Copyright 2015-2023 Alexandr Evstigneev
*
* 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.perl5.lang.perl.extensions.packageprocessor;
import com.perl5.lang.perl.psi.impl.PerlUseStatementElement;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* Implement this interface if your package modifies @ISA and provides package information
*/
public interface PerlPackageParentsProvider {
/**
* Modify list of parents provided by this package. Informaion being collected from all processors sequentially
*
* @param useStatement use statement to fetch parameters from
* @param currentList current parents list
*/
void changeParentsList(@NotNull PerlUseStatementElement useStatement, @NotNull List<? super String> currentList);
/**
* Returns true if we should show available package files in autocompletion
*
* @return result
*/
boolean hasPackageFilesOptions();
}
| [
"hurricup@gmail.com"
] | hurricup@gmail.com |
ceac6ced88fe2bb1ec3cafb0489b7e791c9b820a | 0e39a114c7cf5ba4ad019e8431b8fb968aba4161 | /sso-common/src/main/java/com/tongwei/auth/helper/AuthValidateHelper.java | f5552e735802e284f16d3883d6419a6617587c49 | [] | no_license | bearmokey/tw-sso-master | 4b00bb5dee108c7cef195902354d0ff8744bb8d7 | 56a539237acaa70532f4fe30d748332c20e9522f | refs/heads/master | 2020-06-09T08:34:51.766461 | 2018-12-06T07:33:12 | 2018-12-06T07:33:12 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,371 | java | package com.tongwei.auth.helper;
import com.tongwei.auth.util.AuthUtil;
/**
* @author yangz
* @date 2018年2月7日 上午10:51:15
* @description 权限认证帮助类
*/
public class AuthValidateHelper {
public static boolean hasPermAny(String[] permGroups) {
for (String str : permGroups) {
String[] split = str.split(":");
if (split.length != 2) {
throw new IllegalArgumentException("value格式错误!,permGroupCode:permCode1,permCode2...");
}
String permGroup = split[0];
String permsStr = split[1];
String[] perms = permsStr.split(",");
if (AuthUtil.hasPermsAny(permGroup, perms)) {
return true;
}
}
return false;
}
public static boolean hasPermAll(String[] permGroups) {
for (String str : permGroups) {
String[] split = str.split(":");
if (split.length != 2) {
throw new IllegalArgumentException("value格式错误!,permGroupCode:permCode1,permCode2...");
}
String permGroup = split[0];
String permsStr = split[1];
String[] perms = permsStr.split(",");
if (!AuthUtil.hasPermsAll(permGroup, perms)) {
return false;
}
}
return true;
}
}
| [
"caozhi_soft@163.com"
] | caozhi_soft@163.com |
f1872adc994f61173fd8c19ccbca8477d4128292 | 4f58a60cc9399f48d958590dc872ecfae431b866 | /documentation/src/main/asciidoc/topics/code_examples/MaxCountMemory.java | 0ec048f0da54af50aae357ae7de378c78d0fa340 | [
"Apache-2.0",
"LicenseRef-scancode-dco-1.1"
] | permissive | wfink/infinispan | 528e16f1f8737886e55539b990ba93fcb8244a4a | 04cc9fd806c820a550d3890470c00f780532fad3 | refs/heads/master | 2023-05-25T19:53:22.274511 | 2021-06-03T14:29:01 | 2021-06-10T09:20:27 | 254,347,412 | 2 | 0 | Apache-2.0 | 2020-04-09T11:02:12 | 2020-04-09T11:02:11 | null | UTF-8 | Java | false | false | 201 | java | ConfigurationBuilder cfg = new ConfigurationBuilder();
cfg
.encoding()
.mediaType("application/x-protostream")
.memory()
.maxCount(500)
.whenFull(EvictionStrategy.REMOVE)
.build());
| [
"gustavonalle@gmail.com"
] | gustavonalle@gmail.com |
07d66a0d8180c57995820b80fcbd11ba5f8a600e | d84a968e843dc267aeaf79005cdf91be051efe35 | /Mage.Sets/src/mage/cards/v/VexingArcanix.java | 91e1525a0d7d4cf405aaf1bb42225a6789df9f84 | [
"MIT"
] | permissive | lzybluee/MageX | da7a630a65baa56546e4687f9c1f13ae106ff265 | fc36104bc8e6aebb147d9aca7ce49477dbf9d315 | refs/heads/master | 2022-11-27T03:36:53.892274 | 2021-10-10T23:04:18 | 2021-10-10T23:04:18 | 115,675,633 | 1 | 0 | MIT | 2022-11-16T12:23:35 | 2017-12-29T01:58:13 | Java | UTF-8 | Java | false | false | 3,535 | java | package mage.cards.v;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.*;
import mage.cards.repository.CardRepository;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author BetaSteward_at_googlemail.com & L_J
*/
public final class VexingArcanix extends CardImpl {
public VexingArcanix(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}");
// {3}, {tap}: Target player chooses a card name, then reveals the top card of their library. If that card has the chosen name, the player puts it into their hand. Otherwise, the player puts it into their graveyard and Vexing Arcanix deals 2 damage to them.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VexingArcanixEffect(), new GenericManaCost(3));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
}
public VexingArcanix(final VexingArcanix card) {
super(card);
}
@Override
public VexingArcanix copy() {
return new VexingArcanix(this);
}
}
class VexingArcanixEffect extends OneShotEffect {
public VexingArcanixEffect() {
super(Outcome.DrawCard);
staticText = "Target player chooses a card name, then reveals the top card of their library. If that card has the chosen name, the player puts it into their hand. Otherwise, the player puts it into their graveyard and {this} deals 2 damage to them";
}
public VexingArcanixEffect(final VexingArcanixEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
MageObject sourceObject = source.getSourceObject(game);
Player player = game.getPlayer(targetPointer.getFirst(game, source));
if (sourceObject != null && player != null) {
Choice cardChoice = new ChoiceImpl();
cardChoice.setChoices(CardRepository.instance.getNames());
cardChoice.setMessage("Name a card");
if (!player.choose(Outcome.DrawCard, cardChoice, game)) {
return false;
}
String cardName = cardChoice.getChoice();
game.informPlayers(sourceObject.getLogName() + ", player: " + player.getLogName() + ", named: [" + cardName + ']');
Card card = player.getLibrary().getFromTop(game);
if (card != null) {
Cards cards = new CardsImpl(card);
player.revealCards(sourceObject.getIdName(), cards, game);
if (CardUtil.haveSameNames(card.getName(), cardName)) {
player.moveCards(cards, Zone.HAND, source, game);
} else {
player.moveCards(cards, Zone.GRAVEYARD, source, game);
player.damage(2, source.getSourceId(), game, false, true);
}
}
return true;
}
return false;
}
@Override
public VexingArcanixEffect copy() {
return new VexingArcanixEffect(this);
}
}
| [
"lzybluee@gmail.com"
] | lzybluee@gmail.com |
624b7fa7c37b4c2931256abedaebd57202358d81 | 6193f2aab2b5aba0fcf24c4876cdcb6f19a1be88 | /wds2/src/public/nc/vo/ld/InvclVO.java | 014baf60cb3b5b8d2c2d03f9607bf59d6f20a5e3 | [] | no_license | uwitec/nc-wandashan | 60b5cac6d1837e8e1e4f9fbb1cc3d9959f55992c | 98d9a19dc4eb278fa8aa15f120eb6ebd95e35300 | refs/heads/master | 2016-09-06T12:15:04.634079 | 2011-11-05T02:29:15 | 2011-11-05T02:29:15 | 41,097,642 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,067 | java | package nc.vo.ld;
import nc.vo.pub.SuperVO;
public class InvclVO extends SuperVO{
private String pk_invcl;
private String invclasscode ;
private String invclassname;
private String invclasslev;
public String getPk_invcl() {
return pk_invcl;
}
public void setPk_invcl(String pk_invcl) {
this.pk_invcl = pk_invcl;
}
public String getInvclasscode() {
return invclasscode;
}
public void setInvclasscode(String invclasscode) {
this.invclasscode = invclasscode;
}
public String getInvclassname() {
return invclassname;
}
public void setInvclassname(String invclassname) {
this.invclassname = invclassname;
}
public String getInvclasslev() {
return invclasslev;
}
public void setInvclasslev(String invclasslev) {
this.invclasslev = invclasslev;
}
@Override
public String getPKFieldName() {
return "pk_invcl";
}
@Override
public String getParentPKFieldName() {
return null;
}
@Override
public String getTableName() {
return null;
}
}
| [
"liuyushi_alice@163.com"
] | liuyushi_alice@163.com |
d1f1d42faa2d5f221f8514f1d08dc9d5392d8a5c | 36627a07794a7e0dde733daf71757b188067e88e | /cloudx-server/cloudx-server-system/src/main/java/com/cloudx/server/system/config/WebConfig.java | 69a6725194d4cb28e47879207161aa1ac6dac3f0 | [
"Apache-2.0"
] | permissive | sin97/cloudx | 4f50ad0836477af5e40675bef0ea9686ca380c7c | cd5ee9eed8040e8c0f9e0a3cacc3ac5b1dc24173 | refs/heads/master | 2022-05-23T22:41:19.113830 | 2020-05-02T14:18:31 | 2020-05-02T14:18:31 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 888 | java | package com.cloudx.server.system.config;
import com.baomidou.mybatisplus.core.parser.ISqlParser;
import com.baomidou.mybatisplus.extension.parsers.BlockAttackSqlParser;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import java.util.ArrayList;
import java.util.List;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author chachae
* @since 2020/5/1 11:12
*/
@Configuration
public class WebConfig {
/**
* 注册分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
List<ISqlParser> sqlParserList = new ArrayList<>();
sqlParserList.add(new BlockAttackSqlParser());
paginationInterceptor.setSqlParserList(sqlParserList);
return paginationInterceptor;
}
}
| [
"chenyuexin1998@gmail.com"
] | chenyuexin1998@gmail.com |
cb7c067e13efe95a5516a138a1749a7081285228 | 22395fd543755e9c638551a60bf00fb682ecaa71 | /prj/android-disl/src/ch/usi/dag/disl/util/Constants.java | 540b1c93d39873ba413e969ea699a846cba42db2 | [
"Apache-2.0"
] | permissive | andrewpedia/disl-android | e9274c234295f6431b4310049ec1c98a93ddf43f | 393f9ee82750dede78f7ab4a9524d6055bf2fbe9 | refs/heads/master | 2022-02-13T15:30:32.929508 | 2017-04-01T08:48:57 | 2017-04-01T08:48:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 449 | java | package ch.usi.dag.disl.util;
public class Constants {
final public static String STATIC_CONTEXT_METHOD_DELIM = ".";
final public static char PACKAGE_STD_DELIM = '.';
final public static char PACKAGE_INTERN_DELIM = '/';
final public static String CONSTRUCTOR_NAME = "<init>";
final public static String STATIC_INIT_NAME = "<clinit>";
final public static String CLASS_DELIM = ".";
final public static String CLASS_EXT = ".class";
}
| [
"you@example.com"
] | you@example.com |
b185881e8e547828f85d851e4522dc821c57355d | 4417886f50f85f3348a44b417e57c1ecac9930a4 | /src/main/java/com/sliu/framework/app/sys/controller/SysMenuController.java | 8ef9f1524511ff0cb12991c7142e1cb18f18bc64 | [] | no_license | itxiaojian/wechatpf | 1fcf2ecc783c36c5c84d8408d78639de22263bde | bdf2b36c9733b1125feabb5d078e84f51034f718 | refs/heads/master | 2021-01-19T20:55:50.196667 | 2017-04-19T02:20:35 | 2017-04-19T02:20:35 | 88,578,665 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 4,636 | java | package com.sliu.framework.app.sys.controller;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import com.likegene.framework.core.BaseController;
import com.likegene.framework.core.logger.Logger;
import com.likegene.framework.core.logger.LoggerFactory;
import com.sliu.framework.app.common.dao.support.Pagination;
import com.sliu.framework.app.sys.model.SysMenu;
import com.sliu.framework.app.sys.model.SysYh;
import com.sliu.framework.app.sys.service.SysMenuService;
import com.sliu.framework.app.util.AppUtil;
import com.sliu.framework.app.util.ResponseData;
@Controller
@RequestMapping("/sys/SysMenu")
public class SysMenuController extends BaseController{
protected final transient Logger logger = LoggerFactory.getPresentationLog(SysMenuController.class);
@Autowired
private SysMenuService service;
@RequestMapping(value = "/menulist")
public ModelAndView openSysAdpzPage() {
ModelAndView modelAndView = new ModelAndView("/sys/SysMenu/menulist");
return modelAndView;
}
/**
* 分页查询菜单父节点信息
* @param start
* @param limit
* @return
*/
@RequestMapping(value = "/getFirstMenu", method = RequestMethod.POST)
@ResponseBody
public Pagination<Object> getFirstMenu(Integer start,Integer limit) {
return service.getFirstMenu(start, limit);
}
/**
* 分页查询菜单子节点信息
* @param start
* @param limit
* @return
*/
@RequestMapping(value = "/getSonMenu", method = RequestMethod.POST)
@ResponseBody
public Pagination<Object> getSonMenu(Integer start,Integer limit,Integer sjid) {
return service.getSonMenu(start, limit,sjid);
}
/**
* 保存父菜单
*
* @param model
* @param entity
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ResponseBody
public ResponseData save(ModelMap model, SysMenu entity,
HttpServletRequest request, HttpServletResponse response) {
String result = service.save(entity);
if (!"1".equalsIgnoreCase(result)) {
return new ResponseData(false,"保存失败,请联系管理员!");
}
return ResponseData.SUCCESS_NO_DATA;
}
/**
* 修改父菜单
* @author:chenhui
* @version 创建时间:2016年6月4日 上午9:19:04
* @param model
* @param entity
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/update", method = RequestMethod.POST)
@ResponseBody
public ResponseData update(ModelMap model, SysMenu entity,
HttpServletRequest request, HttpServletResponse response) {
//查询该图文是否绑定属性cd信息
String result = service.update(entity);
if ("1".equalsIgnoreCase(result)) {
return ResponseData.SUCCESS_NO_DATA;
}else{
return new ResponseData(false,"保存失败,请联系管理员!");
}
}
/**
* 删除菜单
* @author:chenhui
* @version 创建时间:2015年6月4日 上午10:10:07
* @param ids
* @return
*/
@RequestMapping(value="/delete")
@ResponseBody
public ResponseData deleteTuWenMcInfo(String[] ids)
{
for (String cdbh : ids)
{
//查询该图文是否绑定属性cd信息
List<Map<String,Object>> list = service.getSonMenu(cdbh);
if(list.isEmpty()){
//删除
service.delete(cdbh);
}else{
return new ResponseData(false,"该菜单还有下级菜单,请先删除下级菜单");
}
}
return ResponseData.SUCCESS_NO_DATA;
}
/**
* 登陆后页面重定向跳转至mainjsp
* @author:zhangyi
* @version 创建时间:2015年6月4日 上午10:10:07
* @param ids
* @return
*/
@RequestMapping(value = "/main")
public ModelAndView main() {
ModelAndView modelAndView = new ModelAndView("/sys/SysMenu/main");
SysYh user=AppUtil.getCurrentUser();
List<Map<String,Object>> CurrentUserMenu = service.getCurrentUserMenu(user.getYhbh());
modelAndView.addObject("CurrentUserMenu", CurrentUserMenu);
return modelAndView;
}
}
| [
"2629690209@qq.com"
] | 2629690209@qq.com |
9bc5c6af3129f43bf27eca555b6df7b77be6fde5 | 57313b5733029352104342942ccdea70e6a7b722 | /app/src/main/java/com/regenpod/smartlightcontrol/ui/bean/ControlBean.java | 4fbfdd1254682085c53799be41f6faf4e0e51ce0 | [] | no_license | ax3726/SmartLightControl | 43fc21c92f63ff14b1a3388be950a2267b8e613b | 9eb9bd4465e4a4114bdea22823e175c72369f95d | refs/heads/main | 2023-02-21T18:17:52.893786 | 2021-01-26T07:56:47 | 2021-01-26T07:56:47 | 308,266,694 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 600 | java | package com.regenpod.smartlightcontrol.ui.bean;
/**
* @auther liming
* @date 2020-12-24
* @desc
*/
public class ControlBean {
//指令
private int command = 0;
//值
private int value = 0;
public ControlBean(int command, int value) {
this.command = command;
this.value = value;
}
public int getCommand() {
return command;
}
public void setCommand(int command) {
this.command = command;
}
public int getValue() {
return value;
}
public void setValue(int value) {
this.value = value;
}
}
| [
"15970060419lma"
] | 15970060419lma |
91209df3d35c12e6b4d77145726ee76d1a9d63f7 | 6ffb1f9524f6799cbedca651b6037c90e8dd78f5 | /src/main/java/com/itdan/shopmall/activemq/message/MyMessageListener.java | 049e470b15794d6c170b52d53bc9ed1356bdb4bb | [] | no_license | 18376108492/shopmall | 26ef30fca7670706e39ed34de741002923b71fe5 | 5fb540522d386e9e4a6ceade51f4cd184a16c410 | refs/heads/master | 2020-04-17T22:08:37.351354 | 2019-02-27T10:36:06 | 2019-02-27T10:36:06 | 166,982,103 | 5 | 0 | null | null | null | null | UTF-8 | Java | false | false | 571 | java | package com.itdan.shopmall.activemq.message;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
/**
* ActiveMQ信息接收例子
*/
public class MyMessageListener implements MessageListener {
//接收信息
@Override
public void onMessage(Message message) {
TextMessage textMessage=(TextMessage) message;
//获取内容
try {
String text= textMessage.getText();
System.out.println(text);
}catch (Exception e){
e.printStackTrace();
}
}
}
| [
"2207161187@qq.com"
] | 2207161187@qq.com |
8148083d3ce8cb38d320d34ef8a9e726cfafddf4 | da1bae3a7d98dfeaf0d79b72cfb6ae140eb4df7c | /app/src/main/java/com/panda/org/angrypandacv/MainActivity.java | 3a5378035577e805aa6a6e2f4e57ecb01570c895 | [] | no_license | MMLoveMeMM/AngryPandaCV | 9babe50c1381006ed1c0529f9cc0ebc297c21cfd | ddb9146087c2a99b32b0de54761116fdb038b7e4 | refs/heads/master | 2021-08-07T11:12:49.513627 | 2017-11-08T03:36:33 | 2017-11-08T03:36:33 | 109,835,908 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,912 | java | package com.panda.org.angrypandacv;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import com.panda.org.angrypandacv.core.OpenCVHelper;
public class MainActivity extends Activity {
private Button mImageProc;
private Button mProcSobel;
private ImageView mImage;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mImageProc=(Button)findViewById(R.id.imageproc);
mImageProc.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bitmap bitmap = ((BitmapDrawable) getResources().getDrawable(
R.mipmap.panda)).getBitmap();
int w = bitmap.getWidth(), h = bitmap.getHeight();
int[] pix = new int[w * h];
bitmap.getPixels(pix, 0, w, 0, 0, w, h);
int [] resultPixes= OpenCVHelper.Gray(pix,w,h);
Bitmap result = Bitmap.createBitmap(w,h, Bitmap.Config.RGB_565);
result.setPixels(resultPixes, 0, w, 0, 0,w, h);
mImage.setImageBitmap(result);
}
});
mProcSobel=(Button)findViewById(R.id.procsobel);
mProcSobel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bitmap mBuildedBmp = BitmapFactory.decodeResource(getResources(), R.mipmap.panda);
OpenCVHelper.SobelImage(mBuildedBmp);
mImage.setImageBitmap(mBuildedBmp);
}
});
mImage=(ImageView)findViewById(R.id.image);
}
}
| [
"270791800@qq.com"
] | 270791800@qq.com |
8fd835d4d9ea231ba57fa453cbbe194998ec5e4d | e737a537195a431fe255fa3839a1e337d806a372 | /java/src/concurrencies/high_level_concurrency_objects/executors/threadpools/custom/TimedExecutorService2.java | c216d280fea26c1767642ee6b9d646fe4586018d | [] | no_license | iceleeyo/concurrency | 132e9444fe20e5c80efd5c13d477af7e5c3a5d13 | fa8a1d1ccad92330c17ae4b7e34d17c65076a7a4 | refs/heads/master | 2023-05-09T09:11:36.706861 | 2020-09-10T10:52:15 | 2020-09-10T10:52:15 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,989 | java | package threadpools.custom;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicReference;
/**
* <h1>Extending Threadpool Executor with BeforeExecute method not working
* properly for threads more than the pool size</h1> I am creating a multi
* threaded programming with ThreadPoolExecutor. I want to interrupt a thread if
* it is taking too much time to complete the task. So i am overriding
* beforeExecute method. It works good for the specified number of threads.
* Example if i am defining number of threads as 5, then five threads are
* working fine. But for the rest of the tasks, it creates new threads but all
* are failing saying sleep interrupted. <br/>
* Request your help to fix this issue. <br/>
* Here is the working code. If there is any other best approach, please post.
*
* @author EMAIL:vuquangtin@gmail.com , tel:0377443333
* @version 1.0.0
* @see <a href="https://github.com/vuquangtin/concurrency">https://github.com/
* vuquangtin/concurrency</a>
*
*/
public class TimedExecutorService2 extends ThreadPoolExecutor {
long timeout;
public TimedExecutorService2(int numThreads, long timeout, TimeUnit unit) {
super(numThreads, numThreads, 0L, TimeUnit.MILLISECONDS, new ArrayBlockingQueue<Runnable>(1000));
this.timeout = unit.toMillis(timeout);
}
@Override
protected void beforeExecute(Thread thread, Runnable runnable) {
System.out.println("beforeExecute:" + thread.getName());
Thread interruptionThread = new Thread(new Runnable() {
@Override
public void run() {
try {
// Wait until timeout and interrupt this thread
System.out.println("timeout:" + timeout);
Thread.sleep(timeout);
thread.interrupt();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
});
interruptionThread.start();
}
public static void main(String[] args) {
int numThreads = 4, timeout = 5;
ThreadPoolExecutor timedExecutor = new TimedExecutorService2(numThreads, timeout, TimeUnit.SECONDS);
for (int i = 0; i < 6; i++) {
timedExecutor.execute(new Business(i));
}
timedExecutor.shutdown();
}
public static void main1(String args[]) throws Exception {
final TimeoutExecutorService executor = new TimeoutExecutorService(6);
final List<Future<?>> futures = new ArrayList<>();
for (int i = 0; i < 16; i++) {
futures.add(executor.submit(new Business(i), 4000));
}
for (final Future<?> future : futures) {
future.get();
}
executor.workExecutor.shutdownNow();
executor.timeoutExecutor.shutdownNow();
}
}
class TimeoutExecutorService {
final ExecutorService workExecutor;
final ScheduledExecutorService timeoutExecutor = Executors.newSingleThreadScheduledExecutor();
public TimeoutExecutorService(final int numThreads) {
this.workExecutor = Executors.newFixedThreadPool(numThreads);
}
final Future<?> submit(final Runnable runnable, final long timeoutMillis) {
// use an atomic reference to allow code inside a runnable to refer
// to its own future
final AtomicReference<Future<?>> futureReference = new AtomicReference<>();
futureReference.set(workExecutor.submit(() -> {
// schedule a different thread to cancel this one after a
// certain amount of time
final Future<?> cancelFuture = timeoutExecutor.schedule(() -> {
futureReference.get().cancel(true);
}, timeoutMillis, TimeUnit.MILLISECONDS);
try {
// do the thing
runnable.run();
} finally {
// if the runnable completes before the cancelFuture
// interrupts this thread,
// prevent the cancelFuture from running
cancelFuture.cancel(true);
}
}));
return futureReference.get();
}
} | [
"vuquangtin@gmail.com"
] | vuquangtin@gmail.com |
763a5588624da057a724070ef0859a71095a517a | c6788399476a5cfd7ffbdf9e8ea817f62a5dfa4d | /demo/src/com/tarot/sdfnash/tarot/session/extension/CustomAttachmentType.java | a55f46fccc54f67f59a2806cf0586fc0d1396188 | [] | no_license | sdfnash/TAROTNEW | 5e25d68831f83f37af0f4fd6eb5c4c433ca81dda | ae995871cfd5a9012f2e9908a80c2e40554e729f | refs/heads/master | 2019-08-06T01:06:13.574315 | 2017-10-31T06:26:15 | 2017-10-31T06:26:15 | 66,058,581 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 253 | java | package com.tarot.sdfnash.tarot.session.extension;
/**
* Created by zhoujianghua on 2015/4/9.
*/
public interface CustomAttachmentType {
// 多端统一
int Guess = 1;
int SnapChat = 2;
int Sticker = 3;
int RTS = 4;
}
| [
"liuyi@baijiahulian.com"
] | liuyi@baijiahulian.com |
7d34963252857a97f867116022cd63083fbdf6a4 | 40d844c1c780cf3618979626282cf59be833907f | /src/testcases/CWE129_Improper_Validation_of_Array_Index/s02/CWE129_Improper_Validation_of_Array_Index__getCookies_Servlet_array_size_68a.java | 8b90c8ecab5cfe616f3690233f46fd0c64c270f2 | [] | no_license | rubengomez97/juliet | f9566de7be198921113658f904b521b6bca4d262 | 13debb7a1cc801977b9371b8cc1a313cd1de3a0e | refs/heads/master | 2023-06-02T00:37:24.532638 | 2021-06-23T17:22:22 | 2021-06-23T17:22:22 | 379,676,259 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,253 | java | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE129_Improper_Validation_of_Array_Index__getCookies_Servlet_array_size_68a.java
Label Definition File: CWE129_Improper_Validation_of_Array_Index.label.xml
Template File: sources-sinks-68a.tmpl.java
*/
/*
* @description
* CWE: 129 Improper Validation of Array Index
* BadSource: getCookies_Servlet Read data from the first cookie using getCookies()
* GoodSource: A hardcoded non-zero, non-min, non-max, even number
* Sinks: array_size
* GoodSink: data is used to set the size of the array and it must be greater than 0
* BadSink : data is used to set the size of the array, but it could be set to 0
* Flow Variant: 68 Data flow: data passed as a member variable in the "a" class, which is used by a method in another class in the same package
*
* */
package testcases.CWE129_Improper_Validation_of_Array_Index.s02;
import testcasesupport.*;
import javax.servlet.http.*;
import java.util.logging.Level;
public class CWE129_Improper_Validation_of_Array_Index__getCookies_Servlet_array_size_68a extends AbstractTestCaseServlet
{
public static int data;
public void bad(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
data = Integer.MIN_VALUE; /* initialize data in case there are no cookies */
/* Read data from cookies */
{
Cookie cookieSources[] = request.getCookies();
if (cookieSources != null)
{
/* POTENTIAL FLAW: Read data from the first cookie value */
String stringNumber = cookieSources[0].getValue();
try
{
data = Integer.parseInt(stringNumber.trim());
}
catch(NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception reading data from cookie", exceptNumberFormat);
}
}
}
(new CWE129_Improper_Validation_of_Array_Index__getCookies_Servlet_array_size_68b()).badSink(request, response);
}
public void good(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
goodG2B(request, response);
goodB2G(request, response);
}
/* goodG2B() - use goodsource and badsink */
private void goodG2B(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
/* FIX: Use a hardcoded number that won't cause underflow, overflow, divide by zero, or loss-of-precision issues */
data = 2;
(new CWE129_Improper_Validation_of_Array_Index__getCookies_Servlet_array_size_68b()).goodG2BSink(request, response);
}
/* goodB2G() - use badsource and goodsink */
private void goodB2G(HttpServletRequest request, HttpServletResponse response) throws Throwable
{
data = Integer.MIN_VALUE; /* initialize data in case there are no cookies */
/* Read data from cookies */
{
Cookie cookieSources[] = request.getCookies();
if (cookieSources != null)
{
/* POTENTIAL FLAW: Read data from the first cookie value */
String stringNumber = cookieSources[0].getValue();
try
{
data = Integer.parseInt(stringNumber.trim());
}
catch(NumberFormatException exceptNumberFormat)
{
IO.logger.log(Level.WARNING, "Number format exception reading data from cookie", exceptNumberFormat);
}
}
}
(new CWE129_Improper_Validation_of_Array_Index__getCookies_Servlet_array_size_68b()).goodB2GSink(request, response);
}
/* 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);
}
}
| [
"you@example.com"
] | you@example.com |
445c0295fbded0bc1ea4f0334a9c5255789318d1 | 504185d88cd5dbd37a0dc3680f691467fd9564a1 | /_src/IntentServiceSandbox/app/src/debug/java/net/callmeike/android/alarmscheduler/tasks/TaskModule.java | b6aed46257161eb0286957c457f4980af49a76fc | [] | no_license | paullewallencom/android-978-0-13-417743-4 | 8643e56bb1ee138341d08e2f3b43cbf772adbdb8 | fecd8e7a7a0361b62f0a836bb7109ffd9bd9f311 | refs/heads/master | 2021-01-18T04:00:09.862508 | 2020-12-23T03:39:13 | 2020-12-23T03:39:13 | 85,772,616 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,266 | java | /* $Id: $
Copyright 2012, G. Blake Meike
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 net.callmeike.android.alarmscheduler.tasks;
import android.util.Log;
import javax.inject.Singleton;
import net.callmeike.android.alarmscheduler.net.Client;
import dagger.Module;
import dagger.Provides;
/**
* @author <a href="mailto:blake.meike@gmail.com">G. Blake Meike</a>
* @version $Revision: $
*/
@Module
class TaskModule {
@Provides
@Singleton
SampleTask providePeriodicTask(Client client) {
return new SampleTask(client) {
@Override
public void run() {
Log.d("TASK", "starting");
super.run();
Log.d("TASK", "complete");
}
};
}
}
| [
"paullewallencom@users.noreply.github.com"
] | paullewallencom@users.noreply.github.com |
b7763a41b0e45fa90a79a3942f0fc24676dfa013 | fa91450deb625cda070e82d5c31770be5ca1dec6 | /Diff-Raw-Data/25/25_cf2679490089a04fdc8654283e072d41c63fffd5/ObjectExtJavaValue/25_cf2679490089a04fdc8654283e072d41c63fffd5_ObjectExtJavaValue_t.java | d49eb4f3de05f1427c3976db9d10184085b6caee | [] | 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,090 | java | /*
* Copyright (c) 1998-2010 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source 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 2 of the License, or
* (at your option) any later version.
*
* Resin Open Source 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, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Resin Open Source; if not, write to the
*
* Free Software Foundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Scott Ferguson
*/
package com.caucho.quercus.env;
import com.caucho.quercus.program.JavaClassDef;
import com.caucho.vfs.WriteStream;
import java.io.IOException;
import java.io.Serializable;
import java.util.IdentityHashMap;
/**
* Represents a PHP object which extends a Java value.
*/
public class ObjectExtJavaValue extends ObjectExtValue
implements Serializable
{
private Object _object;
private final JavaClassDef _javaClassDef;
public ObjectExtJavaValue(QuercusClass cl, Object object,
JavaClassDef javaClassDef)
{
super(cl);
_object = object;
_javaClassDef = javaClassDef;
}
public ObjectExtJavaValue(QuercusClass cl,
JavaClassDef javaClassDef)
{
super(cl);
_javaClassDef = javaClassDef;
}
//
// field
//
/**
* Returns fields not explicitly specified by this value.
*/
@Override
protected Value getFieldExt(Env env, StringValue name)
{
if (_object == null) {
_object = createJavaObject(env);
}
Value value = _javaClassDef.getField(env, this, name);
if (value != null)
return value;
else
return super.getFieldExt(env, name);
}
/**
* Sets fields not specified by the value.
*/
protected Value putFieldExt(Env env, StringValue name, Value value)
{
if (_object == null) {
createJavaObject(env);
}
return _javaClassDef.putField(env, this, name, value);
}
/**
* Returns the java object.
*/
@Override
public Object toJavaObject()
{
if (_object == null) {
_object = createJavaObject(Env.getInstance());
}
return _object;
}
/**
* Binds a Java object to this object.
*/
@Override
public void setJavaObject(Value value)
{
if (_object == null)
_object = value.toJavaObject();
}
/**
* Creats a backing Java object for this php object.
*/
private Object createJavaObject(Env env)
{
Value javaWrapper = _javaClassDef.callNew(env, Value.NULL_ARGS);
return javaWrapper.toJavaObject();
}
public void varDumpImpl(Env env,
WriteStream out,
int depth,
IdentityHashMap<Value, String> valueSet)
throws IOException
{
if (_object == null) {
_object = createJavaObject(Env.getInstance());
}
if (! _javaClassDef.varDumpImpl(env, this, _object, out, depth, valueSet))
super.varDumpImpl(env, out, depth, valueSet);
}
@Override
protected void printRImpl(Env env,
WriteStream out,
int depth,
IdentityHashMap<Value, String> valueSet)
throws IOException
{
if (_object == null) {
_object = createJavaObject(Env.getInstance());
}
_javaClassDef.printRImpl(env, _object, out, depth, valueSet);
}
}
| [
"yuzhongxing88@gmail.com"
] | yuzhongxing88@gmail.com |
81604a3cb3e15d2146e5d3c896a846d4d3f35d75 | 3f3dcbe32799de090eef8b452d7d3cfd8d78a047 | /backend_front_end/coreservicesv5/src/main/java/com/us/weavx/core/model/Venue.java | 331e187e9f167f0a2010828f2705c350803608c3 | [] | no_license | saymonset/stripe-js | 4dd28170c5171457b1d5f406a00eaacdeb93a478 | e94c657d1506e9bd98df4794597032a3ee91621d | refs/heads/main | 2023-02-21T17:49:35.066596 | 2021-01-25T12:34:41 | 2021-01-25T12:34:41 | 311,181,209 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,455 | java | package com.us.weavx.core.model;
public class Venue {
private long id;
private long eventId;
private String description;
private String address;
private int capacity;
public Venue(long id, long eventId, String description, String address, int capacity) {
super();
this.id = id;
this.eventId = eventId;
this.description = description;
this.address = address;
this.capacity = capacity;
}
public Venue(int eventId, String description, String address, int capacity) {
super();
this.eventId = eventId;
this.description = description;
this.address = address;
this.capacity = capacity;
}
public Venue() {
super();
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public long getEventId() {
return eventId;
}
public void setEventId(long eventId) {
this.eventId = eventId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public int getCapacity() {
return capacity;
}
public void setCapacity(int capacity) {
this.capacity = capacity;
}
@Override
public String toString() {
return "VenueDescription [id=" + id + ", eventId=" + eventId + ", description=" + description + ", address="
+ address + ", capacity=" + capacity + "]";
}
}
| [
"saymon_set@hotmail.com"
] | saymon_set@hotmail.com |
3b4b881c070b11c3dc6336cd908fa34b102a8e8d | cee115f873555762b79c37d03b5a4d77e298ab8c | /agorava-empireavenue-cdi/src/main/java/org/agorava/empireavenue/cdi/EmpireAvenueOAuth20Service.java | b1f8aac2d5c40fa190d67b7fb8b60b6e5584f160 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | sasikumars/agorava-empireavenue | 21be9493b8447fa70f147b5ea1dc2b24236ec359 | 02e72abb9150754f72cef5ca5cf339fe200cf1fa | refs/heads/master | 2021-01-21T02:45:10.350574 | 2013-12-31T12:25:03 | 2013-12-31T12:25:03 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 802 | java | package org.agorava.empireavenue.cdi;
import org.agorava.AgoravaConstants;
import org.agorava.api.atinject.GenericBean;
import org.agorava.api.oauth.OAuth;
import org.agorava.api.oauth.OAuthRequest;
import org.agorava.api.oauth.Token;
import org.agorava.api.oauth.application.OAuthAppSettings;
import org.agorava.oauth.OAuth20FinalServiceImpl;
/**
* @author Antoine Sabot-Durand
*/
@GenericBean
@OAuth(OAuth.OAuthVersion.OTHER)
public class EmpireAvenueOAuth20Service extends OAuth20FinalServiceImpl {
@Override
public void signRequest(Token accessToken, OAuthRequest request) {
OAuthAppSettings config = getTunedOAuthAppSettings();
super.signRequest(accessToken, request);
request.addQuerystringParameter(AgoravaConstants.CLIENT_ID, config.getApiKey());
}
}
| [
"antoine@sabot-durand.net"
] | antoine@sabot-durand.net |
0882ef3653e55648af821c5a771863cfd93387dc | 83ad664814871071423112fb7ca142b3d066511e | /src/com/anda/moments/ui/CompanyDetailActivity.java | 12295fa0f0f7475481bf0cdd228b1b0f936475bc | [] | no_license | pf5512/friend-moments | 78e82a74d35132f3209da54f0dd0de3d341fb997 | 08bf3cb8033e382af6ff52cee56e3a86d7835f8b | refs/heads/master | 2020-03-09T09:45:41.192314 | 2017-09-03T15:34:04 | 2017-09-03T15:34:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,287 | java | package com.anda.moments.ui;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import com.anda.moments.R;
import com.anda.moments.api.ApiUserUtils;
import com.anda.moments.api.constant.ApiConstants;
import com.anda.moments.commons.AppManager;
import com.anda.moments.entity.ParseModel;
import com.anda.moments.entity.User;
import com.anda.moments.ui.base.BaseActivity;
import com.anda.moments.utils.JsonUtils;
import com.anda.moments.utils.StringUtils;
import com.anda.moments.utils.HttpConnectionUtil.RequestCallback;
import com.anda.moments.utils.ToastUtils;
import com.anda.moments.views.ActionBar;
import com.anda.moments.views.LoadingDialog;
/**
* 公司介绍
* @author pengweiqiang
*
*/
public class CompanyDetailActivity extends BaseActivity {
ActionBar mActionbar;
LoadingDialog loadingDialog;
@Override
@SuppressLint("InlinedApi")
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.company_detail);
super.onCreate(savedInstanceState);
}
@Override
public void initView() {
mActionbar = (ActionBar)findViewById(R.id.actionBar);
mActionbar.setTitle("公司介绍");
mActionbar.setLeftActionButtonListener(new OnClickListener() {
@Override
public void onClick(View v) {
AppManager.getAppManager().finishActivity();
}
});
}
@Override
public void initListener() {
}
OnClickListener onClickListener = new OnClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
// case R.id.btn_complaint:
// startActivity(ComplaintActivity.class);
// break;
default:
break;
}
}
};
private void getPartTimeDetail(){
// String schoolName = mEtSchoolName.getText().toString().trim();
// if(StringUtils.isEmpty(schoolName)){
// mEtSchoolName.requestFocus();
// ToastUtils.showToast(mContext, "请选择学校");
// return ;
// }
// String studentId = mEtStudentId.getText().toString().trim();
// if(StringUtils.isEmpty(studentId)){
// mEtStudentId.requestFocus();
// ToastUtils.showToast(mContext, "请选择学号");
// return ;
// }
// String password = mEtPassword.getText().toString().trim();
// if(StringUtils.isEmpty(password)){
// mEtPassword.requestFocus();
// ToastUtils.showToast(mContext, "请选择密码");
// return ;
// }
//
// loadingDialog = new LoadingDialog(mContext, "登录中...");
// loadingDialog.show();
// ApiUserUtils.login(mContext, studentId, schoolName, password, new RequestCallback() {
//
// @Override
// public void execute(ParseModel parseModel) {
// loadingDialog.cancel();
// if(ApiConstants.RESULT_SUCCESS.equals(parseModel.getState())){
// User user = JsonUtils.fromJson(parseModel.getUserMessage().toString(), User.class);
// String userRandom = parseModel.getUserRandom();
// logined(userRandom, user);
// ToastUtils.showToast(mContext, "登录成功");
// AppManager.getAppManager().finishActivity();
// }else{
// ToastUtils.showToast(mContext, StringUtils.isEmpty(parseModel.getErrorMessage())?"登录失败,稍后请重试!":parseModel.getErrorMessage());
// }
// }
// });
}
}
| [
"pengweiqiang@shopin.cn"
] | pengweiqiang@shopin.cn |
2ff2bcd303b2ca2fb2386a444c0f82bc4a10736a | f7e0a04d1e31d225cd4992ca926d0ce23d293087 | /spring-aop/src/main/java/org/springframework/aop/interceptor/SimpleAsyncUncaughtExceptionHandler.java | 48fa0b90a0c60df22f8d3136fd59f5a0998344f9 | [] | no_license | designer-framework/Spring-Framework | adfea060850613e7f2b751b74359ec2c74826fb5 | 93039bf6e702d814dd0591bdb1acd70da5b31909 | refs/heads/master | 2023-04-27T07:05:00.875434 | 2021-05-18T13:07:31 | 2021-05-18T13:07:31 | 360,019,495 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,381 | java | /*
* Copyright 2002-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.aop.interceptor;
import java.lang.reflect.Method;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* A default {@link AsyncUncaughtExceptionHandler} that simply logs the exception.
*
* @author Stephane Nicoll
* @since 4.1
*/
public class SimpleAsyncUncaughtExceptionHandler implements AsyncUncaughtExceptionHandler {
private static final Log logger = LogFactory.getLog(SimpleAsyncUncaughtExceptionHandler.class);
@Override
public void handleUncaughtException(Throwable ex, Method method, Object... params) {
if (logger.isErrorEnabled()) {
logger.error("Unexpected error occurred invoking async method: " + method, ex);
}
}
}
| [
"742743697@qq.com"
] | 742743697@qq.com |
f6dc127c07e7be92631f5a6e9534b74e2663d6a1 | ce46ee3174fffecaf380d6fb5736212e75e963d4 | /app/build/generated/source/r/debug/android/support/compat/R.java | 6cbc54eaea6f0cdc13a1cba31b9d05b750949c8d | [] | no_license | lichao3140/IDRDemo-requestpermission | 85090a9b4876ec2f5e6ed1076f7f21199693e81a | 8acd20f8223ab314d91ca5377612e9f6213537de | refs/heads/master | 2020-04-04T18:09:00.413470 | 2018-11-05T02:55:23 | 2018-11-05T02:55:23 | 156,151,711 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,919 | java | /* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* gradle plugin from the resource data it found. It
* should not be modified by hand.
*/
package android.support.compat;
public final class R {
public static final class attr {
public static final int font = 0x7f030091;
public static final int fontProviderAuthority = 0x7f030093;
public static final int fontProviderCerts = 0x7f030094;
public static final int fontProviderFetchStrategy = 0x7f030095;
public static final int fontProviderFetchTimeout = 0x7f030096;
public static final int fontProviderPackage = 0x7f030097;
public static final int fontProviderQuery = 0x7f030098;
public static final int fontStyle = 0x7f030099;
public static final int fontWeight = 0x7f03009a;
}
public static final class bool {
public static final int abc_action_bar_embed_tabs = 0x7f040000;
}
public static final class color {
public static final int notification_action_color_filter = 0x7f050049;
public static final int notification_icon_bg_color = 0x7f05004a;
public static final int ripple_material_light = 0x7f050055;
public static final int secondary_text_default_material_light = 0x7f050057;
}
public static final class dimen {
public static final int compat_button_inset_horizontal_material = 0x7f06004d;
public static final int compat_button_inset_vertical_material = 0x7f06004e;
public static final int compat_button_padding_horizontal_material = 0x7f06004f;
public static final int compat_button_padding_vertical_material = 0x7f060050;
public static final int compat_control_corner_material = 0x7f060051;
public static final int notification_action_icon_size = 0x7f060088;
public static final int notification_action_text_size = 0x7f060089;
public static final int notification_big_circle_margin = 0x7f06008a;
public static final int notification_content_margin_start = 0x7f06008b;
public static final int notification_large_icon_height = 0x7f06008c;
public static final int notification_large_icon_width = 0x7f06008d;
public static final int notification_main_column_padding_top = 0x7f06008e;
public static final int notification_media_narrow_margin = 0x7f06008f;
public static final int notification_right_icon_size = 0x7f060090;
public static final int notification_right_side_padding_top = 0x7f060091;
public static final int notification_small_icon_background_padding = 0x7f060092;
public static final int notification_small_icon_size_as_large = 0x7f060093;
public static final int notification_subtext_size = 0x7f060094;
public static final int notification_top_pad = 0x7f060095;
public static final int notification_top_pad_large_text = 0x7f060096;
}
public static final class drawable {
public static final int notification_action_background = 0x7f070062;
public static final int notification_bg = 0x7f070063;
public static final int notification_bg_low = 0x7f070064;
public static final int notification_bg_low_normal = 0x7f070065;
public static final int notification_bg_low_pressed = 0x7f070066;
public static final int notification_bg_normal = 0x7f070067;
public static final int notification_bg_normal_pressed = 0x7f070068;
public static final int notification_icon_background = 0x7f070069;
public static final int notification_template_icon_bg = 0x7f07006a;
public static final int notification_template_icon_low_bg = 0x7f07006b;
public static final int notification_tile_bg = 0x7f07006c;
public static final int notify_panel_notification_icon_bg = 0x7f07006d;
}
public static final class id {
public static final int action_container = 0x7f08000e;
public static final int action_divider = 0x7f080010;
public static final int action_image = 0x7f080011;
public static final int action_text = 0x7f080018;
public static final int actions = 0x7f080019;
public static final int async = 0x7f08001f;
public static final int blocking = 0x7f080022;
public static final int chronometer = 0x7f08002c;
public static final int forever = 0x7f08004a;
public static final int icon = 0x7f08004e;
public static final int icon_group = 0x7f08004f;
public static final int info = 0x7f080053;
public static final int italic = 0x7f080054;
public static final int line1 = 0x7f080058;
public static final int line3 = 0x7f080059;
public static final int normal = 0x7f080065;
public static final int notification_background = 0x7f080066;
public static final int notification_main_column = 0x7f080067;
public static final int notification_main_column_container = 0x7f080068;
public static final int right_icon = 0x7f080071;
public static final int right_side = 0x7f080072;
public static final int tag_transition_group = 0x7f080099;
public static final int text = 0x7f08009a;
public static final int text2 = 0x7f08009b;
public static final int time = 0x7f0800a2;
public static final int title = 0x7f0800a3;
}
public static final class integer {
public static final int status_bar_notification_info_maxnum = 0x7f090009;
}
public static final class layout {
public static final int notification_action = 0x7f0a002b;
public static final int notification_action_tombstone = 0x7f0a002c;
public static final int notification_template_custom_big = 0x7f0a0033;
public static final int notification_template_icon_group = 0x7f0a0034;
public static final int notification_template_part_chronometer = 0x7f0a0038;
public static final int notification_template_part_time = 0x7f0a0039;
}
public static final class string {
public static final int status_bar_notification_info_overflow = 0x7f0e0028;
}
public static final class style {
public static final int TextAppearance_Compat_Notification = 0x7f0f00f0;
public static final int TextAppearance_Compat_Notification_Info = 0x7f0f00f1;
public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0f00f3;
public static final int TextAppearance_Compat_Notification_Time = 0x7f0f00f6;
public static final int TextAppearance_Compat_Notification_Title = 0x7f0f00f8;
public static final int Widget_Compat_NotificationActionContainer = 0x7f0f016e;
public static final int Widget_Compat_NotificationActionText = 0x7f0f016f;
}
public static final class styleable {
public static final int[] FontFamily = { 0x7f030093, 0x7f030094, 0x7f030095, 0x7f030096, 0x7f030097, 0x7f030098 };
public static final int FontFamily_fontProviderAuthority = 0;
public static final int FontFamily_fontProviderCerts = 1;
public static final int FontFamily_fontProviderFetchStrategy = 2;
public static final int FontFamily_fontProviderFetchTimeout = 3;
public static final int FontFamily_fontProviderPackage = 4;
public static final int FontFamily_fontProviderQuery = 5;
public static final int[] FontFamilyFont = { 0x01010532, 0x01010533, 0x0101053f, 0x7f030091, 0x7f030099, 0x7f03009a };
public static final int FontFamilyFont_android_font = 0;
public static final int FontFamilyFont_android_fontWeight = 1;
public static final int FontFamilyFont_android_fontStyle = 2;
public static final int FontFamilyFont_font = 3;
public static final int FontFamilyFont_fontStyle = 4;
public static final int FontFamilyFont_fontWeight = 5;
}
}
| [
"396229938@qq.com"
] | 396229938@qq.com |
1253cc015d5b6195ea1f69faaa5b1c23e1923136 | 15b260ccada93e20bb696ae19b14ec62e78ed023 | /v2/src/main/java/com/alipay/api/request/AlipayMarketingVoucherTemplatelistQueryRequest.java | 076f427dee079fa781ce90b9a3a34ffd9ab7efe4 | [
"Apache-2.0"
] | permissive | alipay/alipay-sdk-java-all | df461d00ead2be06d834c37ab1befa110736b5ab | 8cd1750da98ce62dbc931ed437f6101684fbb66a | refs/heads/master | 2023-08-27T03:59:06.566567 | 2023-08-22T14:54:57 | 2023-08-22T14:54:57 | 132,569,986 | 470 | 207 | Apache-2.0 | 2022-12-25T07:37:40 | 2018-05-08T07:19:22 | Java | UTF-8 | Java | false | false | 3,075 | java | package com.alipay.api.request;
import com.alipay.api.domain.AlipayMarketingVoucherTemplatelistQueryModel;
import java.util.Map;
import com.alipay.api.AlipayRequest;
import com.alipay.api.internal.util.AlipayHashMap;
import com.alipay.api.response.AlipayMarketingVoucherTemplatelistQueryResponse;
import com.alipay.api.AlipayObject;
/**
* ALIPAY API: alipay.marketing.voucher.templatelist.query request
*
* @author auto create
* @since 1.0, 2023-08-21 03:07:19
*/
public class AlipayMarketingVoucherTemplatelistQueryRequest implements AlipayRequest<AlipayMarketingVoucherTemplatelistQueryResponse> {
private AlipayHashMap udfParams; // add user-defined text parameters
private String apiVersion="1.0";
/**
* 查询券模板列表
*/
private String bizContent;
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
public String getBizContent() {
return this.bizContent;
}
private String terminalType;
private String terminalInfo;
private String prodCode;
private String notifyUrl;
private String returnUrl;
private boolean needEncrypt=false;
private AlipayObject bizModel=null;
public String getNotifyUrl() {
return this.notifyUrl;
}
public void setNotifyUrl(String notifyUrl) {
this.notifyUrl = notifyUrl;
}
public String getReturnUrl() {
return this.returnUrl;
}
public void setReturnUrl(String returnUrl) {
this.returnUrl = returnUrl;
}
public String getApiVersion() {
return this.apiVersion;
}
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
}
public void setTerminalType(String terminalType){
this.terminalType=terminalType;
}
public String getTerminalType(){
return this.terminalType;
}
public void setTerminalInfo(String terminalInfo){
this.terminalInfo=terminalInfo;
}
public String getTerminalInfo(){
return this.terminalInfo;
}
public void setProdCode(String prodCode) {
this.prodCode=prodCode;
}
public String getProdCode() {
return this.prodCode;
}
public String getApiMethodName() {
return "alipay.marketing.voucher.templatelist.query";
}
public Map<String, String> getTextParams() {
AlipayHashMap txtParams = new AlipayHashMap();
txtParams.put("biz_content", this.bizContent);
if(udfParams != null) {
txtParams.putAll(this.udfParams);
}
return txtParams;
}
public void putOtherTextParam(String key, String value) {
if(this.udfParams == null) {
this.udfParams = new AlipayHashMap();
}
this.udfParams.put(key, value);
}
public Class<AlipayMarketingVoucherTemplatelistQueryResponse> getResponseClass() {
return AlipayMarketingVoucherTemplatelistQueryResponse.class;
}
public boolean isNeedEncrypt() {
return this.needEncrypt;
}
public void setNeedEncrypt(boolean needEncrypt) {
this.needEncrypt=needEncrypt;
}
public AlipayObject getBizModel() {
return this.bizModel;
}
public void setBizModel(AlipayObject bizModel) {
this.bizModel=bizModel;
}
}
| [
"auto-publish"
] | auto-publish |
0d91a06be1e68133b36e594a3708a7f1a69be4b8 | c1c55cad8dd84a094b3eb1e9c472254f0a38aef5 | /src/main/java/me/ryanhamshire/griefprevention/provider/worldedit/GPActor.java | 5a14001a2fdff46e98a07e023a5bd305df5d34eb | [
"MIT"
] | permissive | jxsd1234a/GriefPrevention | f02b2d04b8fc2eaa12aa3fa8a19d8d52ec296511 | 9771a360da35776653147ff7ebb7259e24b520eb | refs/heads/master | 2022-09-08T15:46:37.111105 | 2020-05-28T18:19:55 | 2020-05-28T18:19:55 | 267,663,738 | 0 | 0 | MIT | 2020-05-28T18:18:34 | 2020-05-28T18:18:33 | null | UTF-8 | Java | false | false | 7,224 | java | /*
* This file is part of GriefPrevention, licensed under the MIT License (MIT).
*
* Copyright (c) bloodmc
* Copyright (C) sk89q <http://www.sk89q.com>
* Copyright (C) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package me.ryanhamshire.griefprevention.provider.worldedit;
import com.sk89q.util.StringUtil;
import com.sk89q.worldedit.Vector;
import com.sk89q.worldedit.WorldVector;
import com.sk89q.worldedit.entity.BaseEntity;
import com.sk89q.worldedit.extension.platform.AbstractPlayerActor;
import com.sk89q.worldedit.extent.inventory.BlockBag;
import com.sk89q.worldedit.internal.LocalWorldAdapter;
import com.sk89q.worldedit.internal.cui.CUIEvent;
import com.sk89q.worldedit.session.SessionKey;
import com.sk89q.worldedit.util.Location;
import io.netty.buffer.Unpooled;
import me.ryanhamshire.griefprevention.GriefPreventionPlugin;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.SPacketCustomPayload;
import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.world.World;
import java.nio.charset.Charset;
import java.util.UUID;
import javax.annotation.Nullable;
public class GPActor extends AbstractPlayerActor {
private final EntityPlayerMP player;
public static final Charset UTF_8_CHARSET = Charset.forName("UTF-8");
public static final String CUI_PLUGIN_CHANNEL = "WECUI";
public GPActor(Player player) {
this.player = (EntityPlayerMP) player;
}
@Override
public UUID getUniqueId() {
return this.player.getUniqueID();
}
@Override
public int getItemInHand() {
ItemStack is = this.player.getHeldItem(EnumHand.MAIN_HAND);
return is == null ? 0 : Item.getIdFromItem(is.getItem());
}
@Override
public String getName() {
return this.player.getName();
}
@Override
public BaseEntity getState() {
throw new UnsupportedOperationException("Cannot create a state from this object");
}
@Override
public Location getLocation() {
return new Location(
this.getWorld(),
new Vector(this.player.posX, this.player.posY, this.player.posZ),
this.player.rotationYaw,
this.player.rotationPitch);
}
@SuppressWarnings("deprecation")
@Override
public WorldVector getPosition() {
return new WorldVector(LocalWorldAdapter.adapt(this.getWorld()), this.player.posX, this.player.posY, this.player.posZ);
}
@Override
public com.sk89q.worldedit.world.World getWorld() {
return GriefPreventionPlugin.instance.worldEditProvider.getWorld((World) this.player.getEntityWorld()) ;
}
@Override
public double getPitch() {
return this.player.rotationPitch;
}
@Override
public double getYaw() {
return this.player.rotationYaw;
}
@Override
public void giveItem(int type, int amt) {
this.player.inventory.addItemStackToInventory(new ItemStack(Item.getItemById(type), amt, 0));
}
@Override
public void dispatchCUIEvent(CUIEvent event) {
String[] params = event.getParameters();
String send = event.getTypeId();
if (params.length > 0) {
send = send + "|" + StringUtil.joinString(params, "|");
}
PacketBuffer buffer = new PacketBuffer(Unpooled.copiedBuffer(send.getBytes(UTF_8_CHARSET)));
SPacketCustomPayload packet = new SPacketCustomPayload(CUI_PLUGIN_CHANNEL, buffer);
this.player.connection.sendPacket(packet);
}
@Override
public void printRaw(String msg) {
for (String part : msg.split("\n")) {
this.player.sendMessage(new TextComponentString(part));
}
}
@Override
public void printDebug(String msg) {
sendColorized(msg, TextFormatting.GRAY);
}
@Override
public void print(String msg) {
sendColorized(msg, TextFormatting.LIGHT_PURPLE);
}
@Override
public void printError(String msg) {
sendColorized(msg, TextFormatting.RED);
}
private void sendColorized(String msg, TextFormatting formatting) {
for (String part : msg.split("\n")) {
TextComponentString component = new TextComponentString(part);
component.getStyle().setColor(formatting);
this.player.sendMessage(component);
}
}
@Override
public void setPosition(Vector pos, float pitch, float yaw) {
this.player.connection.setPlayerLocation(pos.getX(), pos.getY(), pos.getZ(), yaw, pitch);
}
@Override
public String[] getGroups() {
return new String[]{};
}
@Override
public BlockBag getInventoryBlockBag() {
return null;
}
@Override
public boolean hasPermission(String perm) {
return ((Player) this.player).hasPermission(perm);
}
@Nullable
@Override
public <T> T getFacet(Class<? extends T> cls) {
return null;
}
@Override
public SessionKey getSessionKey() {
return new SessionKeyImpl(this.player.getUniqueID(), this.player.getName());
}
private static class SessionKeyImpl implements SessionKey {
// If not static, this will leak a reference
private final UUID uuid;
private final String name;
private SessionKeyImpl(UUID uuid, String name) {
this.uuid = uuid;
this.name = name;
}
@Override
public UUID getUniqueId() {
return this.uuid;
}
@Nullable
@Override
public String getName() {
return this.name;
}
@Override
public boolean isActive() {
return Sponge.getServer().getPlayer(this.uuid).isPresent();
}
@Override
public boolean isPersistent() {
return true;
}
}
} | [
"jdroque@gmail.com"
] | jdroque@gmail.com |
5b4e6ba8b132794d3f66fac49d7e2dad638074e2 | f16f359429a3a658dbb107189f37653e0d94c279 | /errai-codegen/src/main/java/org/jboss/errai/codegen/framework/builder/FieldBuildStart.java | d88cf0b44feadd01565cb2247d5b50eb8d4b4b11 | [] | no_license | dobermai/errai | b2387e89171b29a0b63a000ef3c476d6617c63b4 | 18e10b8d43da812f55eb93e31dda145757f78c06 | refs/heads/master | 2021-01-17T10:19:00.090986 | 2011-11-15T21:51:19 | 2011-11-15T21:51:19 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 931 | java | /*
* Copyright 2011 JBoss, a divison Red Hat, Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jboss.errai.codegen.framework.builder;
/**
* @author Mike Brock <cbrock@redhat.com>
*/
public interface FieldBuildStart<T> {
public FieldBuildType<T> publicScope();
public FieldBuildType<T> privateScope();
public FieldBuildType<T> protectedScope();
public FieldBuildType<T> packageScope();
}
| [
"brockm@gmail.com"
] | brockm@gmail.com |
0016e5c1bf2a6ea6fb8b054b5d0cf15082a4c300 | aae49c4e518bb8cb342044758c205a3e456f2729 | /GeogebraiOS/javasources/org/apache/commons/collections15/functors/ConstantFactory.java | 64569bd4f8f860423e773a4859918383ab7abd7c | [] | no_license | kwangkim/GeogebraiOS | 00919813240555d1f2da9831de4544f8c2d9776d | ca3b9801dd79a889da6cb2fdf24b761841fd3f05 | refs/heads/master | 2021-01-18T05:29:52.050694 | 2015-10-04T02:29:03 | 2015-10-04T02:29:03 | 45,118,575 | 4 | 2 | null | 2015-10-28T14:36:32 | 2015-10-28T14:36:31 | null | UTF-8 | Java | false | false | 2,637 | java | // GenericsNote: Converted.
/*
* Copyright 2001-2004 The Apache Software Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.collections15.functors;
import java.io.Serializable;
import org.apache.commons.collections15.Factory;
/**
* Factory implementation that returns the same constant each time.
* <p/>
* No check is made that the object is immutable. In general, only immutable
* objects should use the constant factory. Mutable objects should
* use the prototype factory.
*
* @author Matt Hall, John Watkinson, Stephen Colebourne
* @version $Revision: 1.1 $ $Date: 2005/10/11 17:05:24 $
* @since Commons Collections 3.0
*/
public class ConstantFactory <T> implements Factory<T>, Serializable {
/**
* Serial version UID
*/
static final long serialVersionUID = -3520677225766901240L;
/**
* Returns null each time
*/
public static final Factory NULL_INSTANCE = new ConstantFactory(null);
/**
* The closures to call in turn
*/
private final T iConstant;
/**
* Factory method that performs validation.
*
* @param constantToReturn the constant object to return each time in the factory
* @return the <code>constant</code> factory.
*/
public static <T> Factory<T> getInstance(T constantToReturn) {
if (constantToReturn == null) {
return NULL_INSTANCE;
}
return new ConstantFactory<T>(constantToReturn);
}
/**
* Constructor that performs no validation.
* Use <code>getInstance</code> if you want that.
*
* @param constantToReturn the constant to return each time
*/
public ConstantFactory(T constantToReturn) {
super();
iConstant = constantToReturn;
}
/**
* Always return constant.
*
* @return the stored constant value
*/
public T create() {
return iConstant;
}
/**
* Gets the constant.
*
* @return the constant
* @since Commons Collections 3.1
*/
public T getConstant() {
return iConstant;
}
}
| [
"kuoyichun1102@gmail.com"
] | kuoyichun1102@gmail.com |
f24d5bffaee09d7289cd9fbb2dd00c213659a715 | cdbd53ceb24f1643b5957fa99d78b8f4efef455a | /vertx-gaia/vertx-co/src/main/java/io/vertx/aeon/eon/em/TypeBy.java | 76ba55b701d1ee8330d06af96271b8464e7ee4d3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | chundcm/vertx-zero | f3dcb692ae6b9cc4ced52386cab01e5896e69d80 | d2a2d096426c30d90be13b162403d66c8e72cc9a | refs/heads/master | 2023-04-27T18:41:47.489584 | 2023-04-23T01:53:40 | 2023-04-23T01:53:40 | 244,054,093 | 0 | 0 | Apache-2.0 | 2020-02-29T23:00:59 | 2020-02-29T23:00:58 | null | UTF-8 | Java | false | false | 300 | java | package io.vertx.aeon.eon.em;
/*
* New Structure for different interface ( Default value )
* BY_ID / BY_KEY / BY_TENANT / BY_SIGMA
*/
public enum TypeBy {
BY_ID, // APP_ID
BY_KEY, // APP_KEY
BY_TENANT, // TENANT_ID
BY_SIGMA // SIGMA
}
| [
"silentbalanceyh@126.com"
] | silentbalanceyh@126.com |
e139662a08edbf4b21966efd35b01392f56efbe5 | 48e835e6f176a8ac9ae3ca718e8922891f1e5a18 | /benchmark/training/com/facebook/imagepipeline/producers/BaseConsumerTest.java | ed81ae8342fa2c3b2568c95a14a9e350cb022cb0 | [] | 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 | 4,376 | java | /**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
package com.facebook.imagepipeline.producers;
import Consumer.IS_LAST;
import Consumer.IS_PLACEHOLDER;
import Consumer.NO_FLAGS;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import static Consumer.DO_NOT_CACHE_ENCODED;
import static Consumer.IS_LAST;
import static Consumer.IS_PARTIAL_RESULT;
import static Consumer.IS_PLACEHOLDER;
@RunWith(RobolectricTestRunner.class)
public class BaseConsumerTest {
@Mock
public Consumer mDelegatedConsumer;
private Object mResult;
private Object mResult2;
private Exception mException;
private BaseConsumer mBaseConsumer;
@Test
public void testOnNewResultDoesNotThrow() {
Mockito.doThrow(new RuntimeException()).when(mDelegatedConsumer).onNewResult(ArgumentMatchers.anyObject(), ArgumentMatchers.anyInt());
mBaseConsumer.onNewResult(mResult, 0);
Mockito.verify(mDelegatedConsumer).onNewResult(mResult, 0);
}
@Test
public void testOnFailureDoesNotThrow() {
Mockito.doThrow(new RuntimeException()).when(mDelegatedConsumer).onFailure(ArgumentMatchers.any(Throwable.class));
mBaseConsumer.onFailure(mException);
Mockito.verify(mDelegatedConsumer).onFailure(mException);
}
@Test
public void testOnCancellationDoesNotThrow() {
Mockito.doThrow(new RuntimeException()).when(mDelegatedConsumer).onCancellation();
mBaseConsumer.onCancellation();
Mockito.verify(mDelegatedConsumer).onCancellation();
}
@Test
public void testDoesNotForwardAfterFinalResult() {
mBaseConsumer.onNewResult(mResult, IS_LAST);
mBaseConsumer.onFailure(mException);
mBaseConsumer.onCancellation();
Mockito.verify(mDelegatedConsumer).onNewResult(mResult, IS_LAST);
Mockito.verifyNoMoreInteractions(mDelegatedConsumer);
}
@Test
public void testDoesNotForwardAfterOnFailure() {
mBaseConsumer.onFailure(mException);
mBaseConsumer.onNewResult(mResult, IS_LAST);
mBaseConsumer.onCancellation();
Mockito.verify(mDelegatedConsumer).onFailure(mException);
Mockito.verifyNoMoreInteractions(mDelegatedConsumer);
}
@Test
public void testDoesNotForwardAfterOnCancellation() {
mBaseConsumer.onCancellation();
mBaseConsumer.onNewResult(mResult, IS_LAST);
mBaseConsumer.onFailure(mException);
Mockito.verify(mDelegatedConsumer).onCancellation();
Mockito.verifyNoMoreInteractions(mDelegatedConsumer);
}
@Test
public void testDoesForwardAfterIntermediateResult() {
mBaseConsumer.onNewResult(mResult, 0);
mBaseConsumer.onNewResult(mResult2, IS_LAST);
Mockito.verify(mDelegatedConsumer).onNewResult(mResult2, IS_LAST);
}
@Test
public void testIsLast() {
assertThat(BaseConsumer.isLast(IS_LAST)).isTrue();
assertThat(BaseConsumer.isLast(NO_FLAGS)).isFalse();
}
@Test
public void testIsNotLast() {
assertThat(BaseConsumer.isNotLast(IS_LAST)).isFalse();
assertThat(BaseConsumer.isNotLast(NO_FLAGS)).isTrue();
}
@Test
public void testTurnOnStatusFlag() {
int turnedOn = BaseConsumer.turnOnStatusFlag(NO_FLAGS, IS_LAST);
assertThat(BaseConsumer.isLast(turnedOn)).isTrue();
}
@Test
public void testTurnOffStatusFlag() {
int turnedOff = BaseConsumer.turnOffStatusFlag(IS_LAST, IS_LAST);
assertThat(BaseConsumer.isNotLast(turnedOff)).isTrue();
}
@Test
public void testStatusHasFlag() {
assertThat(BaseConsumer.statusHasFlag(((IS_PLACEHOLDER) | (IS_LAST)), IS_PLACEHOLDER)).isTrue();
assertThat(BaseConsumer.statusHasFlag(((DO_NOT_CACHE_ENCODED) | (IS_LAST)), IS_PLACEHOLDER)).isFalse();
}
@Test
public void testStatusHasAnyFlag() {
assertThat(BaseConsumer.statusHasAnyFlag(((IS_PLACEHOLDER) | (IS_LAST)), ((IS_PLACEHOLDER) | (DO_NOT_CACHE_ENCODED)))).isTrue();
assertThat(BaseConsumer.statusHasAnyFlag(((IS_PLACEHOLDER) | (IS_LAST)), ((IS_PARTIAL_RESULT) | (DO_NOT_CACHE_ENCODED)))).isFalse();
}
}
| [
"benjamin.danglot@inria.fr"
] | benjamin.danglot@inria.fr |
15cf90d45eebfb77bc3e0e8b05c4dc11b636ddce | 124df74bce796598d224c4380c60c8e95756f761 | /gov.noaa.nws.ncep.edex.plugin.sgwhv/src/gov/noaa/nws/ncep/edex/plugin/sgwhv/util/SgwhvParser.java | 5a550d05bcf0a6da28a4ba88b8f65d7037f28f7f | [] | no_license | Mapoet/AWIPS-Test | 19059bbd401573950995c8cc442ddd45588e6c9f | 43c5a7cc360b3cbec2ae94cb58594fe247253621 | refs/heads/master | 2020-04-17T03:35:57.762513 | 2017-02-06T17:17:58 | 2017-02-06T17:17:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,258 | java | /**
*
* SgwhvParser
*
* SOFTWARE HISTORSgwhvParserY
*
* Date Ticket# Engineer Description
* ------- ------- -------- -----------
* 08/23/11 Chin J Chen Initial coding from BufrSgwhvParser
* </pre>
*
* @author Chin J. Chen
* @version 1.0
*/
package gov.noaa.nws.ncep.edex.plugin.sgwhv.util;
import java.util.Calendar;
import java.util.List;
import gov.noaa.nws.ncep.edex.plugin.sgwhv.decoder.SgwhvSeparator;
import gov.noaa.nws.ncep.common.dataplugin.sgwhv.SgwhvRecord;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.edex.decodertools.bufr.BUFRDataDocument;
import com.raytheon.uf.edex.decodertools.bufr.descriptors.BUFRDescriptor;
import com.raytheon.uf.edex.decodertools.bufr.packets.IBUFRDataPacket;
import com.raytheon.uf.edex.decodertools.time.TimeTools;
public class SgwhvParser {
/**
* process BUFR SGWHV.
*
* @param sep
* the BufrSgwhv separator
*/
public static SgwhvRecord processSgwhv(SgwhvSeparator sep,
int subsetNum) {
int year = -1;
int month = -1;
int day = -1;
int hour = -1;
int min = -1;
int sec = -1;
SgwhvRecord sgwhvRec = null;
BUFRDataDocument record = (BUFRDataDocument) sep.next();
if (record != null) {
List<IBUFRDataPacket> parameterList = record.getList();
if (parameterList != null) {
sgwhvRec = new SgwhvRecord();
for (IBUFRDataPacket pp : parameterList) {
int d = pp.getReferencingDescriptor().getDescriptor();
if (d == BUFRDescriptor.createDescriptor(0, 1, 7)) {
if (pp.getValue() != null) {
Long satelliteId = (Long) pp.getValue();
sgwhvRec.setSatelliteId(satelliteId);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 4, 1)) {
year = ((Double) pp.getValue()).intValue();
} else if (d == BUFRDescriptor.createDescriptor(0, 4, 2)) {
month = ((Double) pp.getValue()).intValue();
} else if (d == BUFRDescriptor.createDescriptor(0, 4, 3)) {
day = ((Double) pp.getValue()).intValue();
} else if (d == BUFRDescriptor.createDescriptor(0, 4, 4)) {
hour = ((Double) pp.getValue()).intValue();
} else if (d == BUFRDescriptor.createDescriptor(0, 4, 5)) {
min = ((Double) pp.getValue()).intValue();
} else if (d == BUFRDescriptor.createDescriptor(0, 4, 6)) {
if (pp.getValue() != null) {
sec = ((Double) pp.getValue()).intValue();
}
} else if (d == BUFRDescriptor.createDescriptor(0, 5, 2)) {
if (pp.getValue() != null) {
sgwhvRec.setLat(((Double) pp.getValue()));
}
} else if (d == BUFRDescriptor.createDescriptor(0, 6, 2)) {
if (pp.getValue() != null) {
sgwhvRec.setLon(((Double) pp.getValue()));
}
} else if (d == BUFRDescriptor.createDescriptor(0, 11, 12)) {
if (pp.getValue() != null) {
Double wspd10 = (Double) pp.getValue();
sgwhvRec.setWspd10(wspd10);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 22, 21)) {
if (pp.getValue() != null) {
Double htwaves = (Double) pp.getValue();
sgwhvRec.setHtwaves(htwaves);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 22, 26)) {
if (pp.getValue() != null) {
Double sgwhSd = (Double) pp.getValue();
sgwhvRec.setSgwhSd(sgwhSd);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 10, 33)) {
if (pp.getValue() != null) {
Double altitude = (Double) pp.getValue();
sgwhvRec.setAltitude(altitude);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 21, 71)) {
if (pp.getValue() != null) {
Long peak = (Long) pp.getValue();
sgwhvRec.setPeak(peak);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 21, 77)) {
if (pp.getValue() != null) {
Double altCorrI = (Double) pp.getValue();
sgwhvRec.setAltCorrI(altCorrI);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 21, 78)) {
if (pp.getValue() != null) {
Double altCorrD = (Double) pp.getValue();
sgwhvRec.setAltCorrD(altCorrD);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 21, 79)) {
if (pp.getValue() != null) {
Double altCorrW = (Double) pp.getValue();
sgwhvRec.setAltCorrW(altCorrW);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 21, 82)) {
if (pp.getValue() != null) {
Double loopCorr = (Double) pp.getValue();
sgwhvRec.setLoopCorr(loopCorr);
}
} else if (d == BUFRDescriptor.createDescriptor(0, 21, 62)) {
if (pp.getValue() != null) {
Double bkst = (Double) pp.getValue();
sgwhvRec.setBkst(bkst);
}
}
}
/*
* Create time stamp.
*/
if ((year > 0) && (month > 0) && (day > 0) && (hour >= 0)) {
Calendar baseTime = TimeTools.getBaseCalendar(year, month,
day);
baseTime.set(Calendar.HOUR_OF_DAY, hour);
baseTime.set(Calendar.MINUTE, min);
baseTime.set(Calendar.SECOND, sec) ;
Calendar obstime = TimeTools.copy(baseTime);
sgwhvRec.setObsTime(obstime);
DataTime dt = new DataTime(obstime);
sgwhvRec.setDataTime(dt);
}
} else {
System.out.println(" There is no data in bulletin ");
}
}
return sgwhvRec;
}
}
| [
"joshua.t.love@saic.com"
] | joshua.t.love@saic.com |
3db41250ad277a5876561a5e03dde39e9687aaed | cdbd53ceb24f1643b5957fa99d78b8f4efef455a | /vertx-semper/aeon-eternal/aeon-inlet/src/main/java/io/vertx/tp/ipc/eon/ResponseParamsOrBuilder.java | 9def6a6b98b3b37139f4442d76f63b8c8fed4105 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | chundcm/vertx-zero | f3dcb692ae6b9cc4ced52386cab01e5896e69d80 | d2a2d096426c30d90be13b162403d66c8e72cc9a | refs/heads/master | 2023-04-27T18:41:47.489584 | 2023-04-23T01:53:40 | 2023-04-23T01:53:40 | 244,054,093 | 0 | 0 | Apache-2.0 | 2020-02-29T23:00:59 | 2020-02-29T23:00:58 | null | UTF-8 | Java | false | true | 556 | java | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: zero.status.proto
package io.vertx.tp.ipc.eon;
public interface ResponseParamsOrBuilder extends
// @@protoc_insertion_point(interface_extends:io.vertx.tp.ipc.eon.ResponseParams)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Size
* </pre>
*
* <code>int32 size = 1;</code>
*/
int getSize();
/**
* <pre>
* Interval us
* </pre>
*
* <code>int32 interval_us = 2;</code>
*/
int getIntervalUs();
}
| [
"silentbalanceyh@126.com"
] | silentbalanceyh@126.com |
fba758c6a1dba49fdc3df47d75dbcf517fdeaf3b | af06819e28e6e11df74c7c0f98ba33a6c31c22d1 | /src/util/SnapshotTest.java | d12f94fa2e0542a34bd6ec58536a8d7d75bd384f | [] | no_license | liuxiaochen0625/corejava | 06ade86903c839df20bddce2af397cf6dbab6b1b | 3c5c4a63e4f957549b074c9dd0c5f07c74176838 | refs/heads/master | 2021-01-17T08:57:54.004412 | 2016-04-12T01:59:42 | 2016-04-12T01:59:42 | 38,407,865 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,370 | java | /**
* 随机截取图片到桌面
* @author : liuxiaoqiang
* @date :Feb 1, 2016 11:36:36 AM
* @version 1.0
*
*/
package util;
import java.awt.AWTException;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import java.awt.image.BufferedImage;
import java.awt.image.RescaleOp;
import java.io.File;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.imageio.ImageIO;
import javax.swing.JFrame;
import javax.swing.filechooser.FileSystemView;
/**
* java截屏
* 运行后将当前屏幕截取,并最大化显示。
* 拖拽鼠标,选择自己需要的部分。
* 按Esc键保存图片到桌面,并退出程序。
* 点击右上角(没有可见的按钮),退出程序,不保存图片。
*
*/
public class SnapshotTest {
public static void main(String[] args) {
// 全屏运行
RectD rd = new RectD();
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice();
gd.setFullScreenWindow(rd);
}
}
class RectD extends JFrame {
private static final long serialVersionUID = 1L;
int orgx, orgy, endx, endy;
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
BufferedImage image;
BufferedImage tempImage;
BufferedImage saveImage;
Graphics g;
@Override
public void paint(Graphics g) {
RescaleOp ro = new RescaleOp(0.8f, 0, null);
tempImage = ro.filter(image, null);
g.drawImage(tempImage, 0, 0, this);
}
public RectD() {
snapshot();
setVisible(true);
// setSize(d);//最大化窗口
setDefaultCloseOperation(EXIT_ON_CLOSE);
this.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
orgx = e.getX();
orgy = e.getY();
}
});
this.addMouseMotionListener(new MouseMotionAdapter() {
public void mouseDragged(MouseEvent e) {
endx = e.getX();
endy = e.getY();
g = getGraphics();
g.drawImage(tempImage, 0, 0, RectD.this);
int x = Math.min(orgx, endx);
int y = Math.min(orgy, endy);
int width = Math.abs(endx - orgx)+1;
int height = Math.abs(endy - orgy)+1;
// 加上1,防止width或height为0
g.setColor(Color.BLUE);
g.drawRect(x-1, y-1, width+1, height+1);
//减1,加1都是为了防止图片将矩形框覆盖掉
saveImage = image.getSubimage(x, y, width, height);
g.drawImage(saveImage, x, y, RectD.this);
}
});
this.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
// 按Esc键退出
if (e.getKeyCode() == 27) {
saveToFile();
System.exit(0);
}
}
});
}
public void saveToFile() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyymmddHHmmss");
String name = sdf.format(new Date());
File path = FileSystemView.getFileSystemView().getHomeDirectory();
String format = "jpg";
File f = new File(path + File.separator + name + "." + format);
try {
ImageIO.write(saveImage, format, f);
} catch (IOException e) {
e.printStackTrace();
}
}
public void snapshot() {
try {
Robot robot = new Robot();
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
image = robot.createScreenCapture(new Rectangle(0, 0, d.width,
d.height));
} catch (AWTException e) {
e.printStackTrace();
}
}
}
| [
"liuxiaoqiang_0625@163.com"
] | liuxiaoqiang_0625@163.com |
86a648837a6303d630e3f9b3de37bbdc407b276f | c653e7d62af1dbfdc3af509e2fb0fd07d4a58474 | /implementation/src/test/java/io/smallrye/reactive/streams/utils/WrappedSubscriptionTest.java | 557c45640bcbf2981cb0b2bd5ea2d26a68b88b88 | [
"Apache-2.0"
] | permissive | smallrye/smallrye-reactive-streams-operators | 2fc90b4b9f9f5077ad6bbc1331f87067abf93c92 | 5358b84d4728ee280e3df4965e063e0eb62f9e16 | refs/heads/master | 2021-06-12T01:02:07.838046 | 2021-02-26T16:06:26 | 2021-02-26T16:06:26 | 139,009,007 | 20 | 15 | Apache-2.0 | 2021-03-25T18:01:54 | 2018-06-28T11:27:21 | Java | UTF-8 | Java | false | false | 1,312 | java | package io.smallrye.reactive.streams.utils;
import static org.assertj.core.api.Assertions.assertThat;
import java.util.concurrent.atomic.AtomicBoolean;
import org.junit.Test;
import org.reactivestreams.Subscription;
public class WrappedSubscriptionTest {
@Test
public void testWrappedSubscription() {
Subscription subscription = new Subscription() {
@Override
public void request(long n) {
}
@Override
public void cancel() {
}
};
WrappedSubscription wrapped = new WrappedSubscription(subscription, null);
assertThat(wrapped).isNotNull();
wrapped.request(10);
wrapped.cancel();
}
@Test
public void testWrappedSubscriptionWithCompletionCallback() {
Subscription subscription = new Subscription() {
@Override
public void request(long n) {
}
@Override
public void cancel() {
}
};
AtomicBoolean called = new AtomicBoolean();
WrappedSubscription wrapped = new WrappedSubscription(subscription, () -> called.set(true));
assertThat(wrapped).isNotNull();
wrapped.request(10);
wrapped.cancel();
assertThat(called).isTrue();
}
}
| [
"clement.escoffier@gmail.com"
] | clement.escoffier@gmail.com |
f054b4453a136c4c6f37c571e9cd893f1543d79e | 2d666e65b8fce172523b4814d34bb88fdccf4a92 | /accessmodifiers/pack/A.java | 0f47b94d3f16caeffc8a13402f509a14bf5177a4 | [] | no_license | agnelrayan/java | b95c89a31f075edfa8c4b4b3ff3c1734da89119a | 3f6ba7b48320957e0f930e37f910cd041e4121ae | refs/heads/master | 2021-01-01T16:46:57.881527 | 2018-06-08T11:46:20 | 2018-06-08T11:46:20 | 97,918,738 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package com.expertzlab.accessmodifiers.pack;
public class A {
int a=10;
int b=10;
protected void display(){
System.out.println("IN Display -Class A");
}
protected void msg(){
System.out.println("Hello");
}
protected void display2()
{
System.out.println("IN Display2-Class A");
}
}
| [
"agnelrayan@gmail.com"
] | agnelrayan@gmail.com |
c0fd2edbed93d2c8f1ab43931b869e221877b475 | fa401bdc2b642b909ce83b050d00d00e67036248 | /src/com/android/gphonemanager/adapter/ChannelInfoBean.java | bbaefcd89e4428506c668749611edbb09b28b93b | [] | no_license | liujingyi1/GPhoneManager | ad834ff667c74ec9628026789ac4dc0a715a35a5 | aa7a4ed66bc62257744b7026fe5b5078b0c72222 | refs/heads/master | 2020-09-10T03:49:50.716661 | 2019-11-14T07:51:48 | 2019-11-14T07:51:48 | 221,641,020 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,101 | java | package com.android.gphonemanager.adapter;
public class ChannelInfoBean {
private int id;
private int iconRes;
private String title;
private String describtion;
private int type;
private onGridViewItemClickListener onClickListener;
public ChannelInfoBean(int id, int iconRes, String title) {
this.id = id;
this.iconRes = iconRes;
this.title = title;
}
public void setId(int id) {
this.id = id;
}
public int getId() {
return id;
}
public void setIconRes(int iconRes) {
this.iconRes = iconRes;
}
public int getIconRes() {
return iconRes;
}
public void setTitle(String title) {
this.title = title;
}
public String getTitle() {
return title;
}
public onGridViewItemClickListener getOnClickListener() {
return onClickListener;
}
public void setOnClickListener(onGridViewItemClickListener onClickListener) {
this.onClickListener = onClickListener;
}
public interface onGridViewItemClickListener
{
public abstract void ongvItemClickListener(int position);
}
}
| [
"jingyi.liu@ragentek.com"
] | jingyi.liu@ragentek.com |
032619428a11119d0fe63171675cb7362ffdc2b0 | b57bc31c2a60bf935b9e8278b1264d9383f900f9 | /src/main/java/gr/uom/java/xmi/UMLClassMatcher.java | 919f62cbf78f512f25385a59ac427e4b5a6eaac6 | [
"MIT"
] | permissive | maldil/RefactoringMiner | f4b971cbe768700ba102924d8492d1bd03912fe8 | 53cc588f5219633311873dd2fa2e44e52465bf60 | refs/heads/master | 2023-04-12T00:14:42.284934 | 2022-06-09T06:38:15 | 2022-06-09T06:38:15 | 347,796,887 | 10 | 1 | MIT | 2021-06-12T08:14:51 | 2021-03-15T01:11:48 | Java | UTF-8 | Java | false | false | 2,151 | java | package gr.uom.java.xmi;
public interface UMLClassMatcher {
public boolean match(UMLClass removedClass, UMLClass addedClass, String renamedFile);
public static class Move implements UMLClassMatcher {
public boolean match(UMLClass removedClass, UMLClass addedClass, String renamedFile) {
return removedClass.hasSameNameAndKind(addedClass)
&& (removedClass.hasSameAttributesAndOperations(addedClass) || addedClass.getSourceFile().equals(renamedFile));
}
}
public static class RelaxedMove implements UMLClassMatcher {
public boolean match(UMLClass removedClass, UMLClass addedClass, String renamedFile) {
return removedClass.hasSameNameAndKind(addedClass)
&& (removedClass.hasCommonAttributesAndOperations(addedClass) || addedClass.getSourceFile().equals(renamedFile));
}
}
public static class ExtremelyRelaxedMove implements UMLClassMatcher {
public boolean match(UMLClass removedClass, UMLClass addedClass, String renamedFile) {
return removedClass.hasSameNameAndKind(addedClass)
&& (removedClass.hasAttributesAndOperationsWithCommonNames(addedClass) || addedClass.getSourceFile().equals(renamedFile));
}
}
public static class Rename implements UMLClassMatcher {
public boolean match(UMLClass removedClass, UMLClass addedClass, String renamedFile) {
return removedClass.hasSameKind(addedClass)
&& (removedClass.hasSameAttributesAndOperations(addedClass) || addedClass.getSourceFile().equals(renamedFile));
}
}
public static class RelaxedRename implements UMLClassMatcher {
public boolean match(UMLClass removedClass, UMLClass addedClass, String renamedFile) {
return removedClass.hasSameKind(addedClass)
&& (removedClass.hasCommonAttributesAndOperations(addedClass) || addedClass.getSourceFile().equals(renamedFile));
}
}
public static class ExtremelyRelaxedRename implements UMLClassMatcher {
public boolean match(UMLClass removedClass, UMLClass addedClass, String renamedFile) {
return removedClass.hasSameKind(addedClass)
&& (removedClass.hasAttributesAndOperationsWithCommonNames(addedClass) || addedClass.getSourceFile().equals(renamedFile));
}
}
}
| [
"tsantalis@gmail.com"
] | tsantalis@gmail.com |
90c47017231e2c9abdbbb243ba6dc4b43e8707d3 | ad6d1673c2937847221d45d0473a4dff44fab0a2 | /jdbi/src/test/java/org/skife/jdbi/v2/sqlobject/TestMapBinder.java | 0fe81073c7b1f75ec896096d2c9606da4c90522c | [
"Apache-2.0"
] | permissive | soitun/killbill-commons | a6edc4adacd5abf32213b1fcab22b72d3ac6d64d | eb0cb38f1d5ec9f62d97cf5687107c07b33d3c5c | refs/heads/master | 2023-07-26T14:43:47.003818 | 2023-07-13T20:18:13 | 2023-07-13T20:18:13 | 46,615,930 | 0 | 0 | Apache-2.0 | 2023-07-14T06:11:18 | 2015-11-21T13:14:58 | Java | UTF-8 | Java | false | false | 4,868 | java | /*
* Copyright 2004-2014 Brian McCallister
* Copyright 2010-2014 Ning, Inc.
* Copyright 2014-2020 Groupon, Inc
* Copyright 2020-2020 Equinix, Inc
* Copyright 2014-2020 The Billing Project, LLC
*
* The Billing Project 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.skife.jdbi.v2.sqlobject;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import org.h2.jdbcx.JdbcDataSource;
import org.junit.experimental.categories.Category;
import org.skife.jdbi.v2.DBI;
import org.skife.jdbi.v2.Handle;
import org.skife.jdbi.v2.JDBITests;
import org.skife.jdbi.v2.StatementContext;
import org.skife.jdbi.v2.sqlobject.customizers.Mapper;
import org.skife.jdbi.v2.tweak.ResultSetMapper;
import junit.framework.TestCase;
@Category(JDBITests.class)
public class TestMapBinder extends TestCase
{
private DBI dbi;
private Handle handle;
@Override
public void setUp() throws Exception
{
JdbcDataSource ds = new JdbcDataSource();
ds.setURL("jdbc:h2:mem:test");
dbi = new DBI(ds);
handle = dbi.open();
handle.execute("create table something (id int primary key, name varchar(100), a varchar(100), b int, c varchar(100))");
}
@Override
public void tearDown() throws Exception
{
handle.execute("drop table something");
handle.close();
}
public void testInsert() throws Exception
{
Spiffy s = handle.attach(Spiffy.class);
s.insert(allMap(5, "woo", 3, "too"));
Result elem = s.load(5);
assertEquals("too", elem.c);
assertEquals(3, elem.b);
}
public void testUpdate() throws Exception
{
Spiffy s = handle.attach(Spiffy.class);
s.insert(allMap(4, "woo", 1, "too"));
Map<String, Object> update = new HashMap<String, Object>();
update.put("a", "goo");
update.put("b", 2);
update.put("c", null);
assertEquals(1, s.update(4, update));
Result elem = s.load(4);
assertEquals("goo", elem.a);
assertEquals(2, elem.b);
assertEquals("too", elem.c);
}
public void testUpdatePrefix() throws Exception
{
Spiffy s = handle.attach(Spiffy.class);
s.insert(allMap(4, "woo", 1, "too"));
Map<Object, Object> update = new HashMap<Object, Object>();
update.put("b", 2);
update.put(new A(), "goo");
assertEquals(1, s.updatePrefix(4, update));
Result elem = s.load(4);
assertEquals("goo", elem.a);
assertEquals(1, elem.b); // filtered out by annotation value
assertEquals("too", elem.c);
}
private Map<String, Object> allMap(int id, Object a, int b, Object c)
{
Map<String, Object> map = new HashMap<String, Object>();
map.put("id", id);
map.put("a", a);
map.put("b", b);
map.put("c", c);
return map;
}
interface Spiffy
{
@SqlUpdate("insert into something (id, a, b, c) values (:id, :a, :b, :c)")
int insert(@BindMap Map<String, Object> bindings);
@SqlUpdate("update something set a=coalesce(:a, a), b=coalesce(:b, b), c=coalesce(:c, c) where id=:id")
int update(@Bind("id") int id, @BindMap Map<String, Object> updates);
@SqlUpdate("update something set a=coalesce(:asdf.a, a), c=coalesce(:asdf.c, c) where id=:id")
int updatePrefix(@Bind("id") int id, @BindMap(prefix="asdf", value={"a","c"}, implicitKeyStringConversion=true) Map<Object, Object> updates);
@SqlQuery("select * from something where id = :id")
@Mapper(ResultMapper.class)
Result load(@Bind("id") int id);
}
static class ResultMapper implements ResultSetMapper<Result>
{
@Override
public Result map(int index, ResultSet r, StatementContext ctx)
throws SQLException
{
Result ret = new Result();
ret.id = r.getInt("id");
ret.a = r.getString("a");
ret.b = r.getInt("b");
ret.c = r.getString("c");
return ret;
}
}
static class Result
{
String a, c;
int id, b;
}
static class A
{
@Override
public String toString()
{
return "a";
}
}
}
| [
"pierre@mouraf.org"
] | pierre@mouraf.org |
39df4735091558637b277761c4d59d1d0434ecd9 | c7b7b192033c5b02422d0131f4648deb94f90e93 | /src/thothbot/parallax/core/shared/geometries/ParametricGeometry.java | 0b570636a506c6a0b07475d463162c762caf6a5f | [
"CC-BY-3.0"
] | permissive | Yona-Appletree/parallax | f132f8504988378a04c16ba1aefa6aa59e5f05d8 | f26fffbd4f18248545900dde2ecd7d4ec4ff30a8 | refs/heads/master | 2021-01-18T09:10:50.434338 | 2013-01-12T00:02:05 | 2013-01-12T00:02:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,975 | java | /*
* Copyright 2012 Alex Usachev, thothbot@gmail.com
*
* This file is part of Parallax project.
*
* Parallax is free software: you can redistribute it and/or modify it
* under the terms of the Creative Commons Attribution 3.0 Unported License.
*
* Parallax 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 Creative Commons Attribution
* 3.0 Unported License. for more details.
*
* You should have received a copy of the the Creative Commons Attribution
* 3.0 Unported License along with Parallax.
* If not, see http://creativecommons.org/licenses/by/3.0/.
*/
package thothbot.parallax.core.shared.geometries;
import java.util.Arrays;
import thothbot.parallax.core.shared.core.Face3;
import thothbot.parallax.core.shared.core.Face4;
import thothbot.parallax.core.shared.core.Geometry;
import thothbot.parallax.core.shared.core.UV;
import thothbot.parallax.core.shared.core.Vector3;
/**
* Parametric Surfaces Geometry.
* <p>
* Based on the article <a href="http://prideout.net/blog/?p=44">prideout.net</a>
*
* @author thothbot
*
*/
public class ParametricGeometry extends Geometry
{
public static interface ParametricFunction
{
Vector3 run(double u, double v);
}
public ParametricGeometry(final ParametricFunction function, int slices, int stacks)
{
this(function, slices, stacks, false);
}
public ParametricGeometry(final ParametricFunction function, int slices, int stacks, boolean useTris)
{
super();
int sliceCount = slices + 1;
for ( int i = 0; i <= stacks; i ++ )
{
double v = i / (double)stacks;
for ( int j = 0; j <= slices; j ++ )
{
double u = j / (double)slices;
Vector3 p = function.run( u, v );
this.getVertices().add( p );
}
}
for ( int i = 0; i < stacks; i ++ )
{
for ( int j = 0; j < slices; j ++ )
{
int a = i * sliceCount + j;
int b = i * sliceCount + j + 1;
int c = (i + 1) * sliceCount + j;
int d = (i + 1) * sliceCount + j + 1;
UV uva = new UV( i / (double)slices, j / (double)stacks );
UV uvb = new UV( i / (double)slices, ( j + 1.0 ) / (double)stacks );
UV uvc = new UV( ( i + 1.0 ) / (double)slices, j / (double)stacks );
UV uvd = new UV( ( i + 1.0 ) / (double)slices, ( j + 1.0 ) / (double)stacks );
if ( useTris )
{
this.getFaces().add( new Face3( a, b, c ) );
this.getFaces().add( new Face3( b, d, c ) );
getFaceVertexUvs().get( 0 ).add( Arrays.asList( uva, uvb, uvc ) );
getFaceVertexUvs().get( 0 ).add( Arrays.asList( uvb, uvd, uvc ) );
}
else
{
this.getFaces().add( new Face4( a, b, d, c ) );
getFaceVertexUvs().get( 0 ).add( Arrays.asList( uva, uvb, uvc, uvd ) );
}
}
}
this.computeCentroids();
this.computeFaceNormals();
this.computeVertexNormals();
}
}
| [
"thothbot@gmail.com"
] | thothbot@gmail.com |
ba5899ccfb1b33318bc791b594fc994294547c65 | fbf95d693ad5beddfb6ded0be170a9e810a10677 | /finance/egov/egov-collection/src/main/java/org/egov/collection/integration/models/ResponseAtomMerchant.java | 0ebe880b635a5b3af17ae90f5737376f19e0e74f | [
"MIT",
"LicenseRef-scancode-generic-cla",
"GPL-1.0-or-later",
"GPL-3.0-or-later",
"LicenseRef-scancode-proprietary-license",
"GPL-3.0-only"
] | permissive | egovernments/DIGIT-OSS | 330cc364af1b9b66db8914104f64a0aba666426f | bf02a2c7eb783bf9fdf4b173faa37f402e05e96e | refs/heads/master | 2023-08-15T21:26:39.992558 | 2023-08-08T10:14:31 | 2023-08-08T10:14:31 | 353,807,330 | 25 | 91 | MIT | 2023-09-10T13:23:31 | 2021-04-01T19:35:55 | Java | UTF-8 | Java | false | false | 3,128 | java | /*
* eGov SmartCity eGovernance suite aims to improve the internal efficiency,transparency,
* accountability and the service delivery of the government organizations.
*
* Copyright (C) 2017 eGovernments Foundation
*
* The updated version of eGov suite of products as by eGovernments Foundation
* is available at http://www.egovernments.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/ or
* http://www.gnu.org/licenses/gpl.html .
*
* In addition to the terms of the GPL license to be adhered to in using this
* program, the following additional terms are to be complied with:
*
* 1) All versions of this program, verbatim or modified must carry this
* Legal Notice.
* Further, all user interfaces, including but not limited to citizen facing interfaces,
* Urban Local Bodies interfaces, dashboards, mobile applications, of the program and any
* derived works should carry eGovernments Foundation logo on the top right corner.
*
* For the logo, please refer http://egovernments.org/html/logo/egov_logo.png.
* For any further queries on attribution, including queries on brand guidelines,
* please contact contact@egovernments.org
*
* 2) Any misrepresentation of the origin of the material is prohibited. It
* is required that all modified versions of this material be marked in
* reasonable ways as different from the original version.
*
* 3) This license does not grant any rights to any user of the program
* with regards to rights under trademark law for use of the trade names
* or trademarks of eGovernments Foundation.
*
* In case of any queries, you can reach eGovernments Foundation at contact@egovernments.org.
*
*/
package org.egov.collection.integration.models;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "MERCHANT")
@XmlAccessorType(XmlAccessType.FIELD)
@XStreamAlias("MERCHANT")
public class ResponseAtomMerchant {
@XmlElement(name = "RESPONSE")
public ResponseAtom RESPONSE;
public ResponseAtom getRESPONSE() {
return RESPONSE;
}
public void setRESPONSE(ResponseAtom rESPONSE) {
RESPONSE = rESPONSE;
}
}
| [
"venki@egovernments.org"
] | venki@egovernments.org |
ae0ca9043d9736c8f43d476474ee59b9f1329257 | a84d0a4130035ec6b6855294b0e26ad9afc11b37 | /common-parent/jiandaohang-web/src/main/java/com/jdh/controller/BackgroundSpeController.java | 55b0fd1216ac4703851ccbe2d62123e032db358d | [] | no_license | ZengPengW/JDH | b4e7c15af9e0c47af4760526f2d6220ab5b2d639 | c819d2e143f2bca94239eb5fb247662ac5db1679 | refs/heads/master | 2022-12-09T20:08:38.892559 | 2020-04-01T08:32:15 | 2020-04-01T08:32:15 | 221,158,264 | 1 | 0 | null | 2022-12-06T00:33:30 | 2019-11-12T07:39:21 | JavaScript | UTF-8 | Java | false | false | 4,231 | java | package com.jdh.controller;
import com.jdh.feign.BackgroundService;
import com.jdh.feign.BackgroundSpeService;
import com.jdh.pojo.Background;
import com.jdh.pojo.BackgroundSpeDo;
import com.jdh.pojo.MyUser;
import com.jdh.utils.JdhResult;
import com.jdh.utils.PageDataGridResult;
import com.jdh.utils.UserContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 背景特效 controller
*/
@RestController
public class BackgroundSpeController {
@Autowired
private BackgroundSpeService backgroundSpeService;
@Autowired
private BackgroundService backgroundService;
/**
* 是否为空
* @param str
* @return 是true 否 false
*/
public boolean isEmpty(String str){
if(str==null)return true;
return str.trim().length() <= 0;
}
/**
* 获取所有背景特效
* @param transparent 是否透明 必选
* @param page 第几页 可选
* @param size 每页几条 可选
* @param field 排序字段名 可选
* @param order asc/desc 排序规则 可选
* @return
*/
@GetMapping("/bgSpe/transparent/{transparent}")
public PageDataGridResult<BackgroundSpeDo> getBackgroundSpeByTransparent(@PathVariable(name = "transparent") Boolean transparent, @RequestParam(required = false,name = "page") Integer page, @RequestParam(required = false,name = "size")Integer size, @RequestParam(required = false,name = "field")String field, @RequestParam(required = false,name = "order")String order){
//两个值必须同时存在 否则不排序
if(isEmpty(field)||isEmpty(order)){
field=null;
order=null;
}else {
field=field.trim();
order=order.trim();
if((!field.equals("1")&&!field.equals("2"))||(!order.equals("1")&&!order.equals("2"))){
field=null;
order=null;
}else {
//1.根据上传时间排序 2.根据热度排序
if(field.equals("1"))field="up_date";
else field="use_count";
//1.asc 2.desc
if(order.equals("1"))order="asc";
else order="desc";
}
}
return backgroundSpeService.getBackgroundSpeByTransparent(transparent,page,size,field,order);
}
// /**
// * 根据sid查询背景特效
// * @param sid
// * @return
// */
// @GetMapping("/bgSpe/sid/{sid}")
// public BackgroundSpeDo getBackgroundSpeBySid(@PathVariable Long sid){
// return backgroundSpeService.getBackgroundSpeBySid(sid);
// }
/**
* 根据sid改变背景特效
* @param sid
* @return
*/
@PostMapping ("/bgSpe/change/{sid}")
public JdhResult changeBackgroundSpeBySid(@PathVariable Long sid){
try {
//获取当前用户
MyUser currUser = UserContext.getCurrUser();
if(sid==null||currUser==null)throw new RuntimeException("参数错误,保存失败!");
BackgroundSpeDo backgroundSpe = backgroundSpeService.getBackgroundSpeBySid(sid);
if(backgroundSpe!=null){
//获取当前用户背景
Background background = backgroundService.getUserBackgroundById(currUser.getId());
//用户无背景 就添加
if(background==null){
background=new Background();
background.setSid(backgroundSpe.getSid());//设置此用户对应的 sid
background.setUid(currUser.getId());
backgroundService.saveBackground(background);
} else { //用户有背景 就更新
background.setSid(backgroundSpe.getSid());
backgroundService.updateBackground(background);
}
return JdhResult.success("背景特效,修改成功!!!");
}else {
return JdhResult.fail("不存在此特效,特效保存失败!");
}
}catch (Exception e){
return JdhResult.fail("参数错误,保存失败!");
}
}
}
| [
"44264584+ZengPengW@users.noreply.github.com"
] | 44264584+ZengPengW@users.noreply.github.com |
95e64642dd1c016bb06282b8e3e77569cedd1132 | 1d1df7ff556cc021531dd3167d167b9c1071be92 | /src/leetcode/editor/en/Leetcode0156BinaryTreeUpsideDown.java | 1b1144c342479ae4daf86be84e9ce9f839b6eb42 | [] | no_license | t1lu/leetcode_practice | c19eb4229c2d28f45fa4730ec8d703c9134c30c6 | 7acddda8262413af2eafff70b55f9b5851db4cc8 | refs/heads/master | 2023-08-01T01:44:37.861571 | 2021-09-20T08:07:28 | 2021-09-20T08:07:28 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,345 | java | //Given a binary tree where all the right nodes are either leaf nodes with a sib
//ling (a left node that shares the same parent node) or empty, flip it upside dow
//n and turn it into a tree where the original right nodes turned into left leaf n
//odes. Return the new root.
//
// Example:
//
//
//Input: [1,2,3,4,5]
//
// 1
// / \
// 2 3
// / \
//4 5
//
//Output: return the root of the binary tree [4,5,2,#,#,3,1]
//
// 4
// / \
// 5 2
// / \
// 3 1
//
//
// Clarification:
//
// Confused what [4,5,2,#,#,3,1] means? Read more below on how binary tree is se
//rialized on OJ.
//
// The serialization of a binary tree follows a level order traversal, where '#'
// signifies a path terminator where no node exists below.
//
// Here's an example:
//
//
// 1
// / \
// 2 3
// /
// 4
// \
// 5
//
//
// The above binary tree is serialized as [1,2,3,#,#,4,#,#,5].
// Related Topics Tree
// 👍 289 👎 891
package leetcode.editor.en;
import leetcode.editor.TreeNode;
// 2020-07-26 14:18:21
// Zeshi Yang
public class Leetcode0156BinaryTreeUpsideDown{
// Java: binary-tree-upside-down
public static void main(String[] args) {
Solution sol = new Leetcode0156BinaryTreeUpsideDown().new Solution();
// TO TEST
System.out.println();
}
//leetcode submit region begin(Prohibit modification and deletion)
/**
* 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 TreeNode upsideDownBinaryTree(TreeNode root) {
// corner case, base case
if (root == null) {
return null;
}
// base case
if (root.left == null) {
return root;
}
// general case
TreeNode newRoot = upsideDownBinaryTree(root.left);
root.left.left = root.right;
root.left.right = root;
root.left = null;
root.right = null;
return newRoot;
}
}
//leetcode submit region end(Prohibit modification and deletion)
} | [
"iyangzeshi@outlook.com"
] | iyangzeshi@outlook.com |
248ed0b389eb21a47f41d97ff51dba59de61d6f5 | 6dd79a56d5b04248cc3f3b9eefa5d5de34d0c7a4 | /CotizadorProduccion/src/com/qbe/cotizador/dao/entidad/CiudadDAO.java | 37b7fd98fbf4d93c00eca8a8af4112f8c80c111d | [] | no_license | luisitocaiza17/Cotizador | 7b3de15e0e68bfc4ef8dc4a2266b0f5ff3672a83 | 973e912254d1422709f696cbc05adc58f6bcf110 | refs/heads/master | 2021-10-15T09:05:52.576305 | 2019-02-05T15:49:52 | 2019-02-05T15:49:52 | 169,265,091 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,139 | java | package com.qbe.cotizador.dao.entidad;
import java.math.BigInteger;
import java.util.List;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.TypedQuery;
import com.qbe.cotizador.entitymanagerfactory.EntityManagerFactoryDAO;
import com.qbe.cotizador.model.AgriCotizacionAprobacion;
import com.qbe.cotizador.model.Ciudad;
import com.qbe.cotizador.model.Provincia;
public class CiudadDAO extends EntityManagerFactoryDAO<Ciudad>{
@PersistenceContext(name="CotizadorWebPC", unitName = "CotizadorWebPU" )
private EntityManager em;
@Override
protected EntityManager getEntityManager() {
if(em == null){
Context initCtx = null;
try {
initCtx = new InitialContext();
em = (javax.persistence.EntityManager) initCtx.lookup("java:comp/env/CotizadorWebPC");
} catch (NamingException e) {
e.printStackTrace();
}
}
return em;
}
public CiudadDAO() {
super(Ciudad.class);
}
public List<Ciudad> buscarTodos(){
return getEntityManager().createNamedQuery("Ciudad.buscarTodos").getResultList();
}
public Ciudad buscarPorId(String id){
Ciudad ciudad = new Ciudad();
List<Ciudad> query = getEntityManager().createNamedQuery("Ciudad.buscarPorId").setParameter("id", id).getResultList();
if(!query.isEmpty())
ciudad = query.get(0);
return ciudad;
}
public List<Ciudad> buscarPorProvincia(Provincia provincia){
return getEntityManager().createNamedQuery("Ciudad.buscarPorProvincia").setParameter("provincia", provincia).getResultList();
}
public Ciudad buscarPorNombre(String nombre){
Ciudad results = new Ciudad();
TypedQuery<Ciudad> query = null;
String stringQuery= "SELECT c FROM Ciudad c where (c.nombre =:nombre)";
//String valoresWhereQuery = "";
query = getEntityManager().createQuery(stringQuery, Ciudad.class);
query.setParameter("nombre",nombre);
results = query.getResultList().get(0);
return results;
}
} | [
"luisito_caiza17"
] | luisito_caiza17 |
b16dfe76c7f3cd1273596d531408a165dd1564b2 | d1a6d1e511df6db8d8dd0912526e3875c7e1797d | /genny_JavaWithoutLambdas/applicationModule/src/main/java/applicationModulepackageJava10/Foo752.java | 3924576c9f66b2b030923c53c0e6f2fa8fea3347 | [] | no_license | NikitaKozlov/generated-project-for-desugaring | 0bc1443ab3ddc84cd289331c726761585766aea7 | 81506b3711004185070ca4bb9a93482b70011d36 | refs/heads/master | 2020-03-20T00:35:06.996525 | 2018-06-12T09:30:37 | 2018-06-12T09:30:37 | 137,049,317 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 348 | java | package applicationModulepackageJava10;
public class Foo752 {
public void foo0() {
new applicationModulepackageJava10.Foo751().foo5();
}
public void foo1() {
foo0();
}
public void foo2() {
foo1();
}
public void foo3() {
foo2();
}
public void foo4() {
foo3();
}
public void foo5() {
foo4();
}
}
| [
"nikita.e.kozlov@gmail.com"
] | nikita.e.kozlov@gmail.com |
8a482a8453d5a36fa0ac607d46e8d610756ca284 | fed9778602010dd6abb59ea6948246a3100967e3 | /qywx-spring-boot-api/src/main/java/com/github/shuaidd/callback/AbstractCallBackChain.java | f464ef4f318620fa2c11b1ac43e8ae24bd9a2f12 | [] | no_license | duanmingv/qywx | 9aeb98945bb56da245308366e49bdf9700eca417 | b42d52966e49f88439d141fed1c92dcdbfe9e735 | refs/heads/master | 2023-07-01T03:55:24.224366 | 2021-08-06T23:14:23 | 2021-08-06T23:14:23 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,060 | java | package com.github.shuaidd.callback;
import com.github.shuaidd.event.BaseEventData;
import com.github.shuaidd.support.CallBackManager;
import java.util.Objects;
/**
* 描述
*
* @author ddshuai
*date 2021-07-20 15:51
**/
public abstract class AbstractCallBackChain implements CallBackChain {
private AbstractCallBackChain next;
public AbstractCallBackChain() {
CallBackManager.registerCallBack(this);
}
/**
* 处理实际业务回调逻辑
*
* @param applicationName 回调应用名
* @param eventData 回调数据
*/
public void handleData(String applicationName, BaseEventData eventData) {
if (match(applicationName, eventData)) {
handle(applicationName, eventData);
}
if (Objects.nonNull(next)) {
next.handleData(applicationName, eventData);
}
}
public AbstractCallBackChain getNext() {
return next;
}
public void setNext(AbstractCallBackChain callBackChain) {
this.next = callBackChain;
}
}
| [
"ddshuai@shinyway.com.cn"
] | ddshuai@shinyway.com.cn |
2929ea810e1bef27ae1ecdcd7fe28dc3e5f22b0c | ae5eb1a38b4d22c82dfd67c86db73592094edc4b | /project226/src/main/java/org/gradle/test/performance/largejavamultiproject/project226/p1132/Production22656.java | 6393ab9c14d34aafdbaa812f578e65221e8ec2f3 | [] | no_license | big-guy/largeJavaMultiProject | 405cc7f55301e1fd87cee5878a165ec5d4a071aa | 1cd6a3f9c59e9b13dffa35ad27d911114f253c33 | refs/heads/main | 2023-03-17T10:59:53.226128 | 2021-03-04T01:01:39 | 2021-03-04T01:01:39 | 344,307,977 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,971 | java | package org.gradle.test.performance.largejavamultiproject.project226.p1132;
public class Production22656 {
private Production22653 property0;
public Production22653 getProperty0() {
return property0;
}
public void setProperty0(Production22653 value) {
property0 = value;
}
private Production22654 property1;
public Production22654 getProperty1() {
return property1;
}
public void setProperty1(Production22654 value) {
property1 = value;
}
private Production22655 property2;
public Production22655 getProperty2() {
return property2;
}
public void setProperty2(Production22655 value) {
property2 = value;
}
private String property3;
public String getProperty3() {
return property3;
}
public void setProperty3(String value) {
property3 = value;
}
private String property4;
public String getProperty4() {
return property4;
}
public void setProperty4(String value) {
property4 = value;
}
private String property5;
public String getProperty5() {
return property5;
}
public void setProperty5(String value) {
property5 = value;
}
private String property6;
public String getProperty6() {
return property6;
}
public void setProperty6(String value) {
property6 = value;
}
private String property7;
public String getProperty7() {
return property7;
}
public void setProperty7(String value) {
property7 = value;
}
private String property8;
public String getProperty8() {
return property8;
}
public void setProperty8(String value) {
property8 = value;
}
private String property9;
public String getProperty9() {
return property9;
}
public void setProperty9(String value) {
property9 = value;
}
} | [
"sterling.greene@gmail.com"
] | sterling.greene@gmail.com |
dc6948aedb9ed9caa5dfd2dc9b9bb627e580e1d3 | e75be673baeeddee986ece49ef6e1c718a8e7a5d | /submissions/blizzard/Corpus/eclipse.pde.ui/3526.java | 366e32ab8105952e368b629532caab1a723eb545 | [
"MIT"
] | permissive | zhendong2050/fse18 | edbea132be9122b57e272a20c20fae2bb949e63e | f0f016140489961c9e3c2e837577f698c2d4cf44 | refs/heads/master | 2020-12-21T11:31:53.800358 | 2018-07-23T10:10:57 | 2018-07-23T10:10:57 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 370 | java | /**
* Test unsupported @noinstantiate tag on fields in a class in the default package
*/
public class test12 {
/**
* @noinstantiate
*/
public Object f1 = null;
/**
* @noinstantiate
*/
protected int f2 = 0;
/**
* @noinstantiate
*/
private static char[] f3 = {};
/**
* @noinstantiate
*/
long f4 = 0L;
}
| [
"tim.menzies@gmail.com"
] | tim.menzies@gmail.com |
c2b5c9c2beb5566eae7e4f88197745b076f985e4 | 2f1a9177b5816e80dbbb897fb909606a8f77c3eb | /extlib/com.ibm.domino.services/src/com/ibm/domino/services/rest/das/view/RestViewJsonServiceExt.java | c2e1b60a845920b652efaadd563fc5c3ecaf0a42 | [] | no_license | residori/xspstarterkit | 76caa60ecc3cd7780a3cff2433e671c0f84354d5 | 7d6fcce101edd35a5fe3c6df99c894f9570023a1 | refs/heads/master | 2020-12-26T09:50:59.653003 | 2014-06-16T19:47:34 | 2014-06-16T19:47:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,858 | java | /* ***************************************************************** */
/* Licensed Materials - Property of IBM */
/* */
/* Copyright IBM Corp. 1985, 2013 All Rights Reserved */
/* */
/* US Government Users Restricted Rights - Use, duplication or */
/* disclosure restricted by GSA ADP Schedule Contract with */
/* IBM Corp. */
/* */
/* ***************************************************************** */
package com.ibm.domino.services.rest.das.view;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.ibm.commons.util.io.json.JsonException;
import com.ibm.commons.util.io.json.JsonJavaObject;
import com.ibm.domino.services.ServiceException;
import com.ibm.domino.services.rest.das.RestDocumentNavigator;
public class RestViewJsonServiceExt extends RestViewJsonService {
protected List<IRestViewJsonEventListener> _listeners;
public RestViewJsonServiceExt(HttpServletRequest httpRequest, HttpServletResponse httpResponse,
ViewParameters parameters) {
super(httpRequest, httpResponse, parameters);
}
public void addEventListener(IRestViewJsonEventListener listener) {
if (_listeners == null) {
_listeners = new ArrayList<IRestViewJsonEventListener>();
}
_listeners.add(listener);
}
public void removeEventListener(IRestViewJsonEventListener listener) {
if (_listeners != null && _listeners.contains(listener)) {
_listeners.remove(listener);
}
}
@Override
protected void createDocument(RestViewNavigator viewNav, RestDocumentNavigator docNav, JsonJavaObject items)
throws ServiceException, JsonException, IOException {
for (IRestViewJsonEventListener l : _listeners) {
boolean more = l.queryCreateDocument(viewNav, docNav, items);
if (!more) { // anything but true means cancel the create...
return;
}
}
super.createDocument(viewNav, docNav, items);
for (IRestViewJsonEventListener l : _listeners) {
l.postCreateDocument(viewNav, docNav, items);
}
}
@Override
protected void updateDocument(RestViewNavigator viewNav, RestDocumentNavigator docNav, String id,
JsonJavaObject items) throws ServiceException, JsonException, IOException {
for (IRestViewJsonEventListener l : _listeners) {
boolean more = l.queryUpdateDocument(viewNav, docNav, id, items);
if (!more) { // anything but true means cancel the create...
return;
}
}
super.createDocument(viewNav, docNav, items);
for (IRestViewJsonEventListener l : _listeners) {
l.postUpdateDocument(viewNav, docNav, id, items);
}
}
@Override
protected void deleteDocument(RestViewNavigator viewNav, RestDocumentNavigator docNav, String id,
JsonJavaObject items) throws ServiceException, JsonException, IOException {
for (IRestViewJsonEventListener l : _listeners) {
boolean more = l.queryDeleteDocument(viewNav, docNav, id, items);
if (!more) { // anything but true means cancel the create...
return;
}
}
super.createDocument(viewNav, docNav, items);
for (IRestViewJsonEventListener l : _listeners) {
l.postDeleteDocument(viewNav, docNav, id, items);
}
}
}
| [
"nathan.freeman@redpilldevelopment.com"
] | nathan.freeman@redpilldevelopment.com |
991bcef89fc152a7e30483f50220c6b9d2871e58 | cfc49773b9d283c622dcec04b8507e58ecff9805 | /app/src/main/java/org/opentech/fragments/KeySpeakerFragment.java | b2dc727f45317607e7f23274b85e8851bcf26073 | [
"Apache-2.0"
] | permissive | paarth27/ots15-companion | 11bbc926dd51d5c1ddd69f2f85a61cc53c49f5e7 | 1581adf64267337c68c664eb963bf1a8dfd7907c | refs/heads/master | 2021-01-12T08:55:08.212229 | 2015-05-13T21:15:39 | 2015-05-13T21:15:39 | 76,717,805 | 1 | 0 | null | 2016-12-17T10:28:21 | 2016-12-17T10:28:21 | null | UTF-8 | Java | false | false | 1,162 | java | package org.opentech.fragments;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;
import org.opentech.activities.PersonInfoActivity;
import org.opentech.adapters.SpeakerAdapter;
import org.opentech.db.DatabaseManager;
import org.opentech.model.Speaker;
/**
* Created by Abhishek on 14/02/15.
*/
public class KeySpeakerFragment extends SmoothListFragment {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
DatabaseManager dbManager = DatabaseManager.getInstance();
SpeakerAdapter adapter = new SpeakerAdapter(getActivity().getApplicationContext(), dbManager.getSpeakers(true));
setListAdapter(adapter);
}
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
super.onListItemClick(l, v, position, id);
Speaker speaker = (Speaker) v.getTag();
Intent intent = new Intent(getActivity().getApplicationContext(), PersonInfoActivity.class);
intent.putExtra(PersonInfoActivity.SPEAKER, speaker);
startActivity(intent);
}
}
| [
"manan13056@iiitd.ac.in"
] | manan13056@iiitd.ac.in |
45a5a5a7e0184e5812c611d7a2ef675482ab20f0 | 659e20db34fb48152323f1390b86c2ab7a368000 | /util/Util/smile/math/distance/HammingDistance.java | a8916f795f3e65b77cae1207889ce6f5f5442eda | [] | no_license | yongquanf/GdeltMiner | 8bd82e6612a79985ba8fe31be78cab1460f8ff40 | 979c1b79badaa1f9945306fddc54e24efb3f76e1 | refs/heads/main | 2023-01-02T07:27:48.502836 | 2020-10-22T14:40:00 | 2020-10-22T14:40:00 | 305,691,185 | 2 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,837 | java | /*******************************************************************************
* Copyright (c) 2010 Haifeng Li
*
* 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 util.Util.smile.math.distance;
import java.util.BitSet;
/**
* In information theory, the Hamming distance between two strings of equal
* length is the number of positions for which the corresponding symbols are
* different. Put another way, it measures the minimum number of substitutions
* required to change one into the other, or the number of errors that
* transformed one string into the other. For a fixed length n, the Hamming
* distance is a metric on the vector space of the words of that length.
*
* @author Haifeng Li
*/
public class HammingDistance<T> implements Metric<T[]> {
private static final long serialVersionUID = 1L;
/**
* Constructor.
*/
private HammingDistance() {
}
@Override
public String toString() {
return "Hamming distance";
}
/**
* Returns Hamming distance between the two arrays.
*/
@Override
public double d(T[] x, T[] y) {
if (x.length != y.length)
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
int dist = 0;
for (int i = 0; i < x.length; i++) {
if (!x[i].equals(y[i]))
dist++;
}
return dist;
}
/**
* Returns Hamming distance between the two bytes.
*/
public static int d(byte x, byte y) {
return d((int)x, (int)y);
}
/**
* Returns Hamming distance between the two shorts.
*/
public static int d(short x, short y) {
return d((int)x, (int)y);
}
/**
* Returns Hamming distance between the two integers.
*/
public static int d(int x, int y) {
int dist = 0;
int val = x ^ y;
// Count the number of set bits (Knuth's algorithm)
while (val != 0) {
++dist;
val &= val - 1;
}
return dist;
}
/**
* Returns Hamming distance between the two long integers.
*/
public static int d(long x, long y) {
int dist = 0;
long val = x ^ y;
// Count the number of set bits (Knuth's algorithm)
while (val != 0) {
++dist;
val &= val - 1;
}
return dist;
}
/**
* Returns Hamming distance between the two byte arrays.
*/
public static int d(byte[] x, byte[] y) {
if (x.length != y.length)
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
int dist = 0;
for (int i = 0; i < x.length; i++) {
if (x[i] != y[i])
dist++;
}
return dist;
}
/**
* Returns Hamming distance between the two short arrays.
*/
public static int d(short[] x, short[] y) {
if (x.length != y.length)
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
int dist = 0;
for (int i = 0; i < x.length; i++) {
if (x[i] != y[i])
dist++;
}
return dist;
}
/**
* Returns Hamming distance between the two integer arrays.
*/
public static int d(int[] x, int[] y) {
if (x.length != y.length)
throw new IllegalArgumentException(String.format("Arrays have different length: x[%d], y[%d]", x.length, y.length));
int dist = 0;
for (int i = 0; i < x.length; i++) {
if (x[i] != y[i])
dist++;
}
return dist;
}
/**
* Returns Hamming distance between the two BitSets.
*/
public static int d(BitSet x, BitSet y) {
if (x.size() != y.size())
throw new IllegalArgumentException(String.format("BitSets have different length: x[%d], y[%d]", x.size(), y.size()));
int dist = 0;
for (int i = 0; i < x.size(); i++) {
if (x.get(i) != y.get(i))
dist++;
}
return dist;
}
}
| [
"quanyongf@126.com"
] | quanyongf@126.com |
ddb3f082799ee2e4443e7a323ead2302d9771fb9 | c34181d72eaa3449a40ae0a9bef60f4d2815bdba | /java-base-system/java-base-jvm/src/main/java/com/mmc/base/system/jvm/api/binary/MisBrinaryTest.java | 4a210ef5efb46c2967045f1d4a2bfdbf39f7e57e | [] | no_license | gaowei0115/java-base | a519468664a3da2ec3dc6a99b0458c65a75d66c1 | 4ba904f76562b276569f16278bed688984594819 | refs/heads/master | 2020-12-02T06:33:25.542176 | 2017-10-16T09:51:58 | 2017-10-16T09:51:58 | 96,853,512 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 724 | java | // Copyright (C) 2017-2017 GGWW All rights reserved
package com.mmc.base.system.jvm.api.binary;
/**
* className: MisBrinaryTest<br/>
* Description: 按位非~运算<br/>
* Author: GW<br/>
* CreateTime: 2017年9月1日<br/>
*
* History: (version) Author DateTime Note <br/>
*/
public class MisBrinaryTest {
public static void main(String[] args) {
System.out.println(~29);
System.out.println(Integer.toBinaryString(29));
System.out.println(Integer.toBinaryString(~29));
/**
* 原码:00000000000000000000000000011101
* 反码:01111111111111111111111111100010
* 补码:01111111111111111111111111100010
* 16 + 8 + 4
*
* 11101100
* 10010100
*/
}
}
| [
"gao_wei0115@sina.com"
] | gao_wei0115@sina.com |
bf8e0d00ae14f48cd521845cc1312c4a17f529db | ca11be43892052bb90646fbd30ea42768e4ac655 | /lib/src/main/java/com/github/rvesse/airline/CommandFactoryDefault.java | b9322b1d603358647a2cfa28171d8da99bd92092 | [
"Apache-2.0"
] | permissive | christian-raedel/airline | 645e39051d590639c1b222ec7171ec9445905fce | cef11794b8211cf5f2709ee9c6f3558ac29ac75f | refs/heads/master | 2021-01-22T16:00:24.684546 | 2015-07-22T16:47:15 | 2015-07-22T16:47:51 | 37,585,463 | 0 | 0 | null | 2015-06-17T09:22:26 | 2015-06-17T09:22:25 | Java | UTF-8 | Java | false | false | 314 | java | package com.github.rvesse.airline;
import com.github.rvesse.airline.parser.ParserUtil;
public class CommandFactoryDefault<T> implements CommandFactory<T> {
@SuppressWarnings("unchecked")
@Override
public T createInstance(Class<?> type) {
return (T) ParserUtil.createInstance(type);
}
}
| [
"rvesse@dotnetrdf.org"
] | rvesse@dotnetrdf.org |
ac75a27d212405468a9a1af3c4be4e4bb9dd76e7 | aec790b2ae56cefa3c943a58386106f080d37c69 | /RetrofitLearn/retrofitDemo/src/main/java/com/example/testing/myapplication/retrofit/GitHubAPI.java | 14ad239e94f7e9ba604df8b505c05456a3f161ac | [] | no_license | supercoeus/LearnTechDemo | 94bab285d0fcacc281faae0f57f9fa66d886e445 | 9ced9d014a178c1f0a6b78e57f5ebd4dcb173008 | refs/heads/master | 2021-01-19T03:47:44.483936 | 2016-09-09T10:07:15 | 2016-09-09T10:07:15 | 69,653,315 | 1 | 0 | null | 2016-09-30T09:25:39 | 2016-09-30T09:25:39 | null | UTF-8 | Java | false | false | 4,653 | java | package com.example.testing.myapplication.retrofit;
import com.example.testing.myapplication.bean.Repo;
import com.example.testing.myapplication.bean.User;
import java.util.List;
import java.util.Map;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import rx.Observable;
/**
* author: baiiu
* date: on 16/5/16 14:40
* description:
*
* github的API
*
* baiiu is an example user.
*/
public interface GitHubAPI {
/**
* ============================GET请求==============================
*/
/*
普通的
https://api.github.com/users/baiiu
*/
@GET("users/{user}") Call<User> userInfo(@Path("user") String user);
@GET("users/{user}") Call<String> userInfoString(@Path("user") String user);
@GET("users/{user}") Observable<User> userInfoRx(@Path("user") String user);
@GET("users/{user}") Observable<String> userInfoRxS(@Path("user") String user);
/*
带路径参数
使用 @Path 表示
https://api.github.com/users/baiiu/repos
*/
@GET("users/{user}/repos") Call<List<Repo>> listRepos(@Path("user") String user);
/*
带一个查询参数
使用 @Query 表示
https://api.github.com/group/baiiu/users?sort=desc
*/
@GET("group/{id}/users") Call<List<User>> groupList(@Path("id") int groupId,
@Query("sort") String sort);
/*
带很多查询参数,用map封装
@QueryMap
*/
@GET("group/{id}/users") Call<List<User>> groupList(@Path("id") int groupId,
@QueryMap Map<String, String> options);
/**
* ========================POST请求==============================
*/
/*
POST请求体的方式向服务器传入json字符串
@body 表示请求体,converter自动转换
*/
@POST("users/new") Call<User> createUser(@Body User user);
//======================POST请求提交==================================
/*
可查看了解:
[四种常见的 POST 提交数据方式](https://imququ.com/post/four-ways-to-post-data-in-http.html)
[Retrofit2 完全解析 探索与okhttp之间的关系](http://blog.csdn.net/lmj623565791/article/details/51304204)
*/
/*
以表单的方式传递简单的键值对
@FormUrlEncoded表示:
Content-Type: application/x-www-form-urlencoded; 这是最常见的POST提交方式
*/
@FormUrlEncoded @POST("user/edit") Call<User> updateUser(@Field("first_name") String first,
@Field("last_name") String last);
/*
以PUT表单的方式上传文件,并且可以携带参数
@Multipart表示:使用表单上传文件时
Content-Type:multipart/form-data;
@Part 表示每个部分
传文件时用MultipartBody.Part类型: @Part MultipartBody.Part photo
*/
@Multipart @PUT("user/photo") Call<User> updateUser(@Part("photo") RequestBody photo,
@Part("description") RequestBody description);
/*
多文件上传
@PartMap
可以在Map中put进一个或多个文件,并且还可以放键值对
示例:
File file = new File(Environment.getExternalStorageDirectory(), "messenger_01.png");
RequestBody photo = RequestBody.create(MediaType.parse("image/png", file);
Map<String,RequestBody> photos = new HashMap<>();
photos.put("photos\"; filename=\"icon.png", photo);
photos.put("username", RequestBody.create(null, "abc"));
Call<User> call = userBiz.registerUser(photos, RequestBody.create(null, "123"));
*/
@Multipart @PUT("register") Call<User> registerUser(@PartMap Map<String, RequestBody> params,
@Part("password") RequestBody password);
/*
文件下载,可以考虑使用OkHttp直接来做
Call<ResponseBody> call = userBiz.downloadTest();
call.enqueue(new Callback<ResponseBody>()
{
@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response)
{
InputStream is = response.body().byteStream();
//save file,异步处理
}
@Override
public void onFailure(Call<ResponseBody> call, Throwable t)
{
}
});
*/
@GET("download") Call<ResponseBody> downloadTest();
}
| [
"baiiu@foxmail.com"
] | baiiu@foxmail.com |
e21456d1c625b8159d934cf273c93db3c344108a | 3bc62f2a6d32df436e99507fa315938bc16652b1 | /struts/src/test/java/com/intellij/struts/StrutsModelTest.java | 46d0a14afb5c44ae19a76d89cda77d4faeb2cf69 | [
"Apache-2.0"
] | permissive | JetBrains/intellij-obsolete-plugins | 7abf3f10603e7fe42b9982b49171de839870e535 | 3e388a1f9ae5195dc538df0d3008841c61f11aef | refs/heads/master | 2023-09-04T05:22:46.470136 | 2023-06-11T16:42:37 | 2023-06-11T16:42:37 | 184,035,533 | 19 | 29 | Apache-2.0 | 2023-07-30T14:23:05 | 2019-04-29T08:54:54 | Java | UTF-8 | Java | false | false | 3,309 | java | /*
* Copyright 2000-2006 JetBrains s.r.o.
*
* 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.intellij.struts;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.struts.diagram.StrutsGraphDataModel;
import com.intellij.struts.diagram.StrutsObject;
import com.intellij.struts.dom.Action;
import com.intellij.struts.dom.ActionMappings;
import com.intellij.struts.dom.FormBean;
import com.intellij.struts.dom.StrutsConfig;
import com.intellij.struts.dom.tiles.Definition;
import com.intellij.struts.dom.tiles.TilesDefinitions;
import java.util.Collection;
import java.util.List;
/**
* @author Dmitry Avdeev
*/
public class StrutsModelTest extends StrutsTest {
public void testStrutsConfig() {
List<StrutsModel> model = StrutsManager.getInstance().getAllStrutsModels(getModule());
assertEquals("Config not found", 1, model.size());
StrutsConfig config = model.get(0).getMergedModel();
ActionMappings mappings = config.getActionMappings();
assertEquals(10, mappings.getActions().size());
}
public void testTilesDefinitions() {
List<TilesModel> model = StrutsManager.getInstance().getAllTilesModels(getModule());
assertSize(1, model);
TilesDefinitions config = model.get(0).getMergedModel();
List<Definition> defs = config.getDefinitions();
assertSize(5, defs);
}
public void testStrutsModel() {
StrutsModel model = StrutsManager.getInstance().getAllStrutsModels(getModule()).get(0);
assertNotNull("Config not found", model);
final int configsCount = 2;
assertSize(configsCount, model.getConfigFiles());
final int actionsCount = 10;
List<Action> actions = model.getActions();
assertSize(actionsCount, actions);
Action login = model.findAction("/login");
assertNotNull("Login action not found", login);
Action another = model.findAction("/anotherAction");
assertNotNull("Another action not found", another);
FormBean form = model.findFormBean("loginForm");
assertNotNull("Login form not found", form);
}
public void testDiagramModel() {
final VirtualFile virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(getTestDataPath() + "/WEB-INF/struts-config.xml");
assertNotNull(virtualFile);
final PsiFile xmlFile = myFixture.getPsiManager().findFile(virtualFile);
assertNotNull(xmlFile);
StrutsConfig config = StrutsManager.getInstance().getStrutsConfig(xmlFile);
final StrutsGraphDataModel graphDataModel = new StrutsGraphDataModel(config);
final Collection<StrutsObject> nodes = graphDataModel.getNodes();
assertSize(27, nodes);
final Collection<StrutsObject> edges = graphDataModel.getEdges();
assertSize(13, edges);
}
}
| [
"yole@jetbrains.com"
] | yole@jetbrains.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.