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
aa8eb527e3bbf811b43b3079a32fb9113689117c
40ad7f3cbfcc711d0fe40c2becde9b726dd35d86
/query/spark-2.2/q75/q75_jobid_9_stageid_24_taskid_19427_shuffleTask_36_execid_2_16128416.java
0596a8329e9eba1b58a7fe2c4ffdd188ac8c23a9
[]
no_license
kmadhugit/spark-tpcds-99-generated-code
f2ed0f40f031b58b6af2396b7248e776706dcc18
8483bdf3d8477e63bce1bb65493d2af5c9207ae7
refs/heads/master
2020-05-30T19:39:55.759974
2017-11-14T09:54:56
2017-11-14T09:54:56
83,679,481
1
1
null
2017-11-14T10:45:07
2017-03-02T13:15:25
Java
UTF-8
Java
false
false
1,676
java
/* 001 */ public SpecificOrdering generate(Object[] references) { /* 002 */ return new SpecificOrdering(references); /* 003 */ } /* 004 */ /* 005 */ class SpecificOrdering extends org.apache.spark.sql.catalyst.expressions.codegen.BaseOrdering { /* 006 */ /* 007 */ private Object[] references; /* 008 */ /* 009 */ /* 010 */ public SpecificOrdering(Object[] references) { /* 011 */ this.references = references; /* 012 */ /* 013 */ } /* 014 */ /* 015 */ /* 016 */ /* 017 */ public int compare(InternalRow a, InternalRow b) { /* 018 */ /* 019 */ InternalRow i = null; /* 020 */ /* 021 */ i = a; /* 022 */ boolean isNullA; /* 023 */ long primitiveA; /* 024 */ { /* 025 */ /* 026 */ boolean isNull = i.isNullAt(8); /* 027 */ long value = isNull ? -1L : (i.getLong(8)); /* 028 */ isNullA = isNull; /* 029 */ primitiveA = value; /* 030 */ } /* 031 */ i = b; /* 032 */ boolean isNullB; /* 033 */ long primitiveB; /* 034 */ { /* 035 */ /* 036 */ boolean isNull = i.isNullAt(8); /* 037 */ long value = isNull ? -1L : (i.getLong(8)); /* 038 */ isNullB = isNull; /* 039 */ primitiveB = value; /* 040 */ } /* 041 */ if (isNullA && isNullB) { /* 042 */ // Nothing /* 043 */ } else if (isNullA) { /* 044 */ return -1; /* 045 */ } else if (isNullB) { /* 046 */ return 1; /* 047 */ } else { /* 048 */ int comp = (primitiveA > primitiveB ? 1 : primitiveA < primitiveB ? -1 : 0); /* 049 */ if (comp != 0) { /* 050 */ return comp; /* 051 */ } /* 052 */ } /* 053 */ /* 054 */ /* 055 */ return 0; /* 056 */ } /* 057 */ }
[ "kavana.bhat@in.ibm.com" ]
kavana.bhat@in.ibm.com
fade72d5638ac16c973c1018bce5dccc0073e9fc
c0df2428579d71897098b1f9c1b76a44af38b675
/web-study-09/src/com/saeyan/controller/IdCheckServlet.java
d2caa9e268894e8f8a4604703b9ecff312a91a02
[]
no_license
osj4532/jsp_servlet
9ea8a0e74353175111c46145c056c75f893a6c79
b0647f14dd0224a2ab1998ecbd51e0ef6510ce61
refs/heads/master
2020-03-08T20:33:15.773905
2018-04-06T11:19:12
2018-04-06T11:19:12
128,384,856
0
0
null
null
null
null
UTF-8
Java
false
false
1,587
java
package com.saeyan.controller; import java.io.IOException; import javax.servlet.RequestDispatcher; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.saeyan.dao.MemberDAO; /** * Servlet implementation class IdCheckServlet */ @WebServlet("/idCheck.do") public class IdCheckServlet extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public IdCheckServlet() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub String userid= request.getParameter("userid"); MemberDAO mDao = MemberDAO.getInstance(); int result = mDao.confirmID(userid); request.setAttribute("userid", userid); request.setAttribute("result", result); RequestDispatcher dispatcher = request.getRequestDispatcher("member/idCheck.jsp"); dispatcher.forward(request, response); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "osj4532@daum.net" ]
osj4532@daum.net
e5faddb2ea413fcef59ee6e868f4fc62ab6a07c8
3e096dc4bd4df011aadaf236831fb2f5ba2f31f9
/src/com/hotent/core/bpmn20/entity/omgdi/DiagramElement.java
1d11d0482f6f68bb64409544f380dad1f193cfef
[]
no_license
hollykunge/newnewcosim
2a42d99e7337263df4d53e0fadf20cb6c6381362
dc3f86711a003f2608c75761792ea49c3da805d1
refs/heads/master
2020-03-29T09:15:05.705190
2019-07-22T08:48:09
2019-07-22T08:48:09
149,748,589
1
5
null
2019-07-22T08:48:10
2018-09-21T10:29:04
JavaScript
UTF-8
Java
false
false
5,777
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2013.03.13 at 11:13:53 ���� CST // package com.hotent.core.bpmn20.entity.omgdi; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyAttribute; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlID; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.namespace.QName; /** * <p>Java class for DiagramElement complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="DiagramElement"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="extension" minOccurs="0"> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;any namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * &lt;/element> * &lt;/sequence> * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /> * &lt;anyAttribute processContents='lax' namespace='##other'/> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DiagramElement", propOrder = { "extension" }) @XmlSeeAlso({ Node.class, Edge.class }) public abstract class DiagramElement { protected Extension extension; @XmlAttribute @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; @XmlAnyAttribute private Map<QName, String> otherAttributes = new HashMap<QName, String>(); /** * Gets the value of the extension property. * * @return * possible object is * {@link Extension } * */ public Extension getExtension() { return extension; } /** * Sets the value of the extension property. * * @param value * allowed object is * {@link Extension } * */ public void setExtension(Extension value) { this.extension = value; } /** * Gets the value of the id property. * * @return * possible object is * {@link String } * */ public String getId() { return id; } /** * Sets the value of the id property. * * @param value * allowed object is * {@link String } * */ public void setId(String value) { this.id = value; } /** * Gets a map that contains attributes that aren't bound to any typed property on this class. * * <p> * the map is keyed by the name of the attribute and * the value is the string value of the attribute. * * the map returned by this method is live, and you can add new attribute * by updating the map directly. Because of this design, there's no setter. * * * @return * always non-null */ public Map<QName, String> getOtherAttributes() { return otherAttributes; } /** * <p>Java class for anonymous complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;any namespace='##other' maxOccurs="unbounded" minOccurs="0"/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = { "any" }) public static class Extension { @XmlAnyElement(lax = true) protected List<Object> any; /** * Gets the value of the any property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the any property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAny().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link Object } * * */ public List<Object> getAny() { if (any == null) { any = new ArrayList<Object>(); } return this.any; } } }
[ "hollykunge@163.com" ]
hollykunge@163.com
685a91625a689fab93cce684ca68551871caa595
072216667ef59e11cf4994220ea1594538db10a0
/googleplay/com/google/android/finsky/services/ConsumptionAppDataCache.java
0ed14a71ff5d2e3ee05cf57dd2f6c220b778055d
[]
no_license
jackTang11/REMIUI
896037b74e90f64e6f7d8ddfda6f3731a8db6a74
48d65600a1b04931a510e1f036e58356af1531c0
refs/heads/master
2021-01-18T05:43:37.754113
2015-07-03T04:01:06
2015-07-03T04:01:06
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,213
java
package com.google.android.finsky.services; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.os.Handler; import android.os.Looper; import android.text.TextUtils; import android.util.SparseArray; import com.google.android.finsky.config.G; import com.google.android.finsky.utils.FinskyLog; import com.google.android.finsky.utils.Utils; import com.google.android.finsky.widget.consumption.ConsumptionAppDocList; import com.google.android.finsky.widget.consumption.NowPlayingWidgetProvider; import java.io.File; import java.util.Collection; import java.util.Iterator; import java.util.List; public class ConsumptionAppDataCache { private static final String CACHE_FILE_PREFIX; private static ConsumptionAppDataCache mInstance; private SparseArray<List<ConsumptionAppDoc>> mConsumptionAppData; private SparseArray<Integer> mDataLoadState; private final Handler mHandler; public ConsumptionAppDataCache() { this.mHandler = new Handler(Looper.getMainLooper()); this.mConsumptionAppData = new SparseArray(); this.mDataLoadState = new SparseArray(); } static { CACHE_FILE_PREFIX = ConsumptionAppDataCache.class.getSimpleName(); } public static ConsumptionAppDataCache get() { if (mInstance == null) { mInstance = new ConsumptionAppDataCache(); } return mInstance; } public boolean hasConsumptionAppData(int backendId) { Utils.ensureOnMainThread(); return getDataStateForBackend(backendId) == 2; } public boolean isLoadingData(int backendId) { Utils.ensureOnMainThread(); if (getDataStateForBackend(backendId) == 1) { return true; } return false; } private int getDataStateForBackend(int backendId) { Utils.ensureOnMainThread(); return this.mDataLoadState.get(backendId) != null ? ((Integer) this.mDataLoadState.get(backendId)).intValue() : 0; } public ConsumptionAppDocList getConsumptionAppData(int backendId) { Utils.ensureOnMainThread(); ConsumptionAppDocList docList = new ConsumptionAppDocList(backendId); if (hasConsumptionAppData(backendId)) { docList.addAll((Collection) this.mConsumptionAppData.get(backendId)); } return docList; } public int getConsumptionAppDataSize(int backendId) { Utils.ensureOnMainThread(); List<ConsumptionAppDoc> docList = (List) this.mConsumptionAppData.get(backendId); return docList == null ? 0 : docList.size(); } public void startLoading(int backendId) { Utils.ensureOnMainThread(); if (!hasConsumptionAppData(backendId)) { this.mDataLoadState.put(backendId, Integer.valueOf(1)); } } public void setConsumptionAppData(final Context context, final int backendId, final List<Bundle> data) { filter(data, backendId); if (Looper.myLooper() != Looper.getMainLooper()) { this.mHandler.post(new Runnable() { public void run() { ConsumptionAppDataCache.this.setConsumptionAppData(context, backendId, data); } }); } else if (data != null) { setConsumptionAppData(context, ConsumptionAppDocList.createFromBundles(backendId, data), true); } } public void setConsumptionAppData(final Context context, final ConsumptionAppDocList data, final boolean updateWidgets) { int backendId = data.getBackend(); if (Looper.myLooper() != Looper.getMainLooper()) { this.mHandler.post(new Runnable() { public void run() { ConsumptionAppDataCache.this.setConsumptionAppData(context, data, updateWidgets); } }); return; } boolean isDataDifferent = false; if (hasConsumptionAppData(backendId)) { if (getConsumptionAppData(backendId).equals(data)) { isDataDifferent = false; } else { isDataDifferent = true; } } else if (data.size() > 0) { isDataDifferent = true; } this.mConsumptionAppData.put(backendId, data); this.mDataLoadState.put(backendId, Integer.valueOf(2)); if (!isDataDifferent) { FinskyLog.d("data didn't change for backend=[%s], ignoring!", Integer.valueOf(backendId)); } else if (updateWidgets) { updateWidgets(context, backendId); } } public void updateWidgets(Context context, int backendId) { Intent intent = new Intent("com.android.vending.action.APPWIDGET_UPDATE_CONSUMPTION_DATA"); intent.setClass(context, NowPlayingWidgetProvider.class); intent.putExtra("backendId", backendId); context.sendBroadcast(intent); } void filter(List<Bundle> data, int backendId) { String filter = (String) G.consumptionAppDataFilter.get(); if (((Boolean) G.debugOptionsEnabled.get()).booleanValue() && !TextUtils.isEmpty(filter)) { String[] filterStrings = null; for (String backendFilter : filter.split(";")) { String[] tokens = backendFilter.trim().split(":"); int length = tokens.length; if (r0 != 2) { FinskyLog.d("Bad corpus filter expression %s", backendFilter); } else { int filterBackendId = Integer.parseInt(tokens[0]); if (filterBackendId == 0 || filterBackendId == backendId) { filterStrings = tokens[1].trim().split(","); } if (filterBackendId == backendId) { break; } } } if (filterStrings == null) { data.clear(); return; } int numFilterStrings = filterStrings.length; if (!filterStrings[numFilterStrings + -1].equals("...")) { while (data.size() > numFilterStrings) { data.remove(data.size() - 1); } } else { numFilterStrings--; } long now = System.currentTimeMillis(); for (int i = 0; i < data.size(); i++) { ((Bundle) data.get(i)).putLong("Play.LastUpdateTimeMillis", (long) (((float) now) - (8.64E7f * Float.parseFloat(filterStrings[Math.min(numFilterStrings - 1, i)])))); } if (FinskyLog.DEBUG) { FinskyLog.v("Filtered data for corpus %d:", Integer.valueOf(backendId)); Iterator i$ = data.iterator(); while (i$.hasNext()) { FinskyLog.v("%s", new ConsumptionAppDoc((Bundle) i$.next()).toString()); } } } } public static File getCacheFile(Context context, int backend) { File cacheDir = new File(context.getCacheDir(), "consumption"); cacheDir.mkdirs(); return new File(cacheDir, CACHE_FILE_PREFIX + "_" + backend + ".cache"); } }
[ "songjd@putao.com" ]
songjd@putao.com
42437c3cde61ed86eaa3538d1c3422cfb67df85a
53d677a55e4ece8883526738f1c9d00fa6560ff7
/com/tencent/mm/plugin/luckymoney/appbrand/ui/detail/c$a.java
d960111f2293b71914a7070f6396b336e2f0a807
[]
no_license
0jinxing/wechat-apk-source
544c2d79bfc10261eb36389c1edfdf553d8f312a
f75eefd87e9b9ecf2f76fc6d48dbba8e24afcf3d
refs/heads/master
2020-06-07T20:06:03.580028
2019-06-21T09:17:26
2019-06-21T09:17:26
193,069,132
9
4
null
null
null
null
UTF-8
Java
false
false
323
java
package com.tencent.mm.plugin.luckymoney.appbrand.ui.detail; abstract interface c$a { } /* Location: C:\Users\Lin\Downloads\dex-tools-2.1-SNAPSHOT\dex-tools-2.1-SNAPSHOT\classes7-dex2jar.jar * Qualified Name: com.tencent.mm.plugin.luckymoney.appbrand.ui.detail.c.a * JD-Core Version: 0.6.2 */
[ "172601673@qq.com" ]
172601673@qq.com
54a104ab58cf7cf0f0897606f5c3f81efd92e44f
b3c22d2b26180e9fa5b535e02a12108c28df549e
/ssh2/src/main/java/cn/tedu/entity/User.java
9c54f07553190103bfdc45d6a07b8d19cdecaa03
[]
no_license
kenyim001/Eclipse
bef78193911a34d023da62dcf7ef0b5d39475eaa
0df890550d3e7a639cc8f9e8fa55e1f856abd0ab
refs/heads/master
2020-03-14T11:17:47.693826
2018-04-30T10:36:49
2018-04-30T10:36:49
131,587,793
0
0
null
null
null
null
UTF-8
Java
false
false
1,982
java
package cn.tedu.entity; import java.io.Serializable; import java.sql.Date; public class User implements Serializable { public User() { } public User(Integer id, String name, String password, Integer age, Double salary, Date hiredate) { super(); this.id = id; this.name = name; this.password = password; this.age = age; this.salary = salary; this.hiredate = hiredate; } private Integer id; private String name; private String password; private Integer age; private Double salary; private Date hiredate; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Double getSalary() { return salary; } public void setSalary(Double salary) { this.salary = salary; } public Date getHiredate() { return hiredate; } public void setHiredate(Date hiredate) { this.hiredate = hiredate; } @Override public String toString() { return "User [id=" + id + ", name=" + name + ", password=" + password + ", age=" + age + ", salary=" + salary + ", hiredate=" + hiredate + "]"; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; User other = (User) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } }
[ "38854212+kenyim001@users.noreply.github.com" ]
38854212+kenyim001@users.noreply.github.com
ce3f2a4eb126d86b248c60423f47cf0abda5ecbe
3333f3c2d96dc72db45a2d570310cc2b3fa31f6c
/src/ru/itaros/lsbrl/structure/LSBReDict.java
25eada20e0efcf19449f9c6361d5454fc9ae8799
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
Itaros/LSBian-Framework
da9f252dcd694888c31e96fc886580f5d71b80b0
1a1008dab6416d475a16b2760f7b2b837d728ea1
refs/heads/master
2016-09-06T16:21:33.974477
2014-08-13T09:21:20
2014-08-13T09:21:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
631
java
package ru.itaros.lsbrl.structure; import java.util.ArrayList; public class LSBReDict { private ArrayList<LSBRegion> collection = new ArrayList<LSBRegion>(); public void add(LSBRegion region){ collection.add(region); } public LSBRegion[] getAllRegions(){ LSBRegion[] a = new LSBRegion[collection.size()]; return collection.toArray(a); } @Override public String toString() { StringBuilder b = new StringBuilder("LSBReDict:\n"); b.append("Entries: "+collection.size()+"\n"); for(LSBRegion id:collection){ b.append(">"); b.append(id.toString()); b.append("\n"); } return b.toString(); } }
[ "me@sg-studio.ru" ]
me@sg-studio.ru
46d0079f59e97df57771cce8166867310c79db32
8816c49f822571ceb4399814037aaee666b1bd33
/struts2d/src/org/crazyit/app/action/AuthorityDownAction.java
5311a5deb21ec200773c6b8bb1bf6b2c01d3fc5a
[]
no_license
YinXinLION/Servlet-Jsp
2b1b98eab75877e980bdab591610eba20585eaa1
a6af7ad943be874dbb6a5022d52320000b76f4c7
refs/heads/master
2020-07-31T17:12:07.566385
2016-11-18T07:02:44
2016-11-18T07:02:44
73,594,670
0
0
null
null
null
null
UTF-8
Java
false
false
1,389
java
package org.crazyit.app.action; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.*; import java.util.Map; import java.io.InputStream; /** * Description: * <br/>网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> * <br/>Copyright (C), 2001-2016, Yeeku.H.Lee * <br/>This program is protected by copyright laws. * <br/>Program Name: * <br/>Date: * @author Yeeku.H.Lee kongyeeku@163.com * @version 1.0 */ public class AuthorityDownAction implements Action { private String inputPath; public void setInputPath(String value) { inputPath = value; } public InputStream getTargetFile() throws Exception { // ServletContext提供getResourceAsStream()方法 // 返回指定文件对应的输入流 return ServletActionContext.getServletContext() .getResourceAsStream(inputPath); } public String execute() throws Exception { // 取得ActionContext实例 ActionContext ctx = ActionContext.getContext(); // 通过ActionContext访问用户的HttpSession Map session = ctx.getSession(); String user = (String)session.get("user"); // 判断Session里的user是否通过检查 if ( user != null && user.equals("lion")) { return SUCCESS; } ctx.put("tip", "您还没有登录,或者登录的用户名不正确,请重新登录!"); return LOGIN; } }
[ "yinxin19950816@gmail.com" ]
yinxin19950816@gmail.com
c13e43c309adf7aa8cddee0445b0c35275f52c0d
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/test/org/apache/camel/component/mllp/MllpAcknowledgementTimeoutExceptionTest.java
9a6404c73953a3ecf458b7e97b11b2b3816ba673
[]
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
8,185
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.camel.component.mllp; import MllpAcknowledgementTimeoutException.EXCEPTION_MESSAGE; import org.junit.Assert; import org.junit.Test; /** * Tests for the class. */ public class MllpAcknowledgementTimeoutExceptionTest extends MllpExceptionTestSupport { static final String ALTERNATE_EXCEPTION_MESSAGE = "Test Message"; MllpAcknowledgementTimeoutException instance; /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorOne() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpExceptionTestSupport.HL7_MESSAGE_BYTES); Assert.assertTrue(instance.getMessage().startsWith(EXCEPTION_MESSAGE)); Assert.assertNull(instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertNull(instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorTwo() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES); Assert.assertTrue(instance.getMessage().startsWith(EXCEPTION_MESSAGE)); Assert.assertNull(instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorThree() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.CAUSE); Assert.assertTrue(instance.getMessage().startsWith(EXCEPTION_MESSAGE)); Assert.assertSame(MllpExceptionTestSupport.CAUSE, instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertNull(instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorFour() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, MllpExceptionTestSupport.CAUSE); Assert.assertTrue(instance.getMessage().startsWith(EXCEPTION_MESSAGE)); Assert.assertSame(MllpExceptionTestSupport.CAUSE, instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorFive() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE, MllpExceptionTestSupport.HL7_MESSAGE_BYTES); Assert.assertTrue(instance.getMessage().startsWith(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE)); Assert.assertNull(instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertNull(instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorSix() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE, MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES); Assert.assertTrue(instance.getMessage().startsWith(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE)); Assert.assertNull(instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorSeven() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE, MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.CAUSE); Assert.assertTrue(instance.getMessage().startsWith(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE)); Assert.assertSame(MllpExceptionTestSupport.CAUSE, instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertNull(instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testConstructorEight() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE, MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, MllpExceptionTestSupport.CAUSE); Assert.assertTrue(instance.getMessage().startsWith(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE)); Assert.assertSame(MllpExceptionTestSupport.CAUSE, instance.getCause()); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_MESSAGE_BYTES, instance.hl7MessageBytes); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, instance.hl7AcknowledgementBytes); } /** * Description of test. * * @throws Exception * in the event of a test error. */ @Test public void testGetHl7Acknowledgement() throws Exception { instance = new MllpAcknowledgementTimeoutException(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE, MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, MllpExceptionTestSupport.CAUSE); Assert.assertArrayEquals(MllpExceptionTestSupport.HL7_ACKNOWLEDGEMENT_BYTES, instance.getHl7Acknowledgement()); instance = new MllpAcknowledgementTimeoutException(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE, MllpExceptionTestSupport.HL7_MESSAGE_BYTES, new byte[0], MllpExceptionTestSupport.CAUSE); Assert.assertNull(instance.getHl7Acknowledgement()); instance = new MllpAcknowledgementTimeoutException(MllpAcknowledgementTimeoutExceptionTest.ALTERNATE_EXCEPTION_MESSAGE, MllpExceptionTestSupport.HL7_MESSAGE_BYTES, MllpExceptionTestSupport.CAUSE); Assert.assertNull(instance.getHl7Acknowledgement()); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
63665423d268af890ef6d1e40bd4eb7b2b600c6e
7d169e796639b01c6b652f12effa1d59951b8345
/src/java/com/tulskiy/musique/audio/player/dsp/BeatVis.java
fcdc50e47da3271f26a5e8c9238f777f388f36ac
[ "Apache-2.0" ]
permissive
dubenju/javay
65555744a895ecbd345df07e5537072985095e3b
29284c847c2ab62048538c3973a9fb10090155aa
refs/heads/master
2021-07-09T23:44:55.086890
2020-07-08T13:03:50
2020-07-08T13:03:50
47,082,846
7
1
null
null
null
null
UTF-8
Java
false
false
2,944
java
/* * Copyright (c) 2008, 2009, 2010 Denis Tulskiy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * version 3 along with this work. If not, see <http://www.gnu.org/licenses/>. */ package com.tulskiy.musique.audio.player.dsp; /* import ddf.minim.analysis.BeatDetect; import ddf.minim.analysis.FFT; import ddf.minim.analysis.FourierTransform; import javax.swing.*; import java.awt.*; *//** * @Author: Denis Tulskiy * @Date: Jan 3, 2010 *//* public class BeatVis extends JPanel implements Processor { private BeatDetect beatDetect; private boolean hat, kick, snare; private JFrame frame; FourierTransform fft; public BeatVis() { beatDetect = new BeatDetect(); beatDetect.detectMode(BeatDetect.FREQ_ENERGY); beatDetect.setSensitivity(100); setBackground(Color.white); } public String getName() { return null; } @Override protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; g2d.setColor(Color.black); int spec = fft.specSize(); int w = getWidth() / spec; if (w == 0) w = 1; g2d.setColor(Color.green.darker()); int p = 0; for (int i = 0; i < spec; i++) { g2d.drawRect(p, getHeight(), w, (int) (getHeight() - fft.getBand(i) * 10)); p += w; } } public void process(float[] samples, int len) { if (frame == null) { frame = new JFrame(); frame.setContentPane(this); frame.setSize(300, 300); frame.setVisible(true); } try { // if (beatDetect.getTimeSize() != len) { // beatDetect = new BeatDetect(len, 44100); // beatDetect.setSensitivity(100); // } // beatDetect.detect(samples, len); // hat = kick = snare = false; // if (beatDetect.isHat()) { // hat = true; // } else if (beatDetect.isKick()) { // kick = true; // } else if (beatDetect.isSnare()) { // snare = true; // } if (fft == null) { fft = new FFT(len, 44100); } fft.forward(samples, len); repaint(); } catch (Exception e) { e.printStackTrace(); } } }*/
[ "dubenju@163.com" ]
dubenju@163.com
79e37dc4d52067497653ba0348c7c965ec2aa6d2
62e330c99cd6cedf20bc162454b8160c5e1a0df8
/basex-core/src/main/java/org/basex/query/func/strings/StringsSoundex.java
a5d8903b349abfe1457957f5c81557cc4cb15f83
[ "BSD-3-Clause" ]
permissive
nachawati/basex
76a717b069dcea3932fad5116e0a42a727052b58
0bc95648390ec3e91b8fd3e6ddb9ba8f19158807
refs/heads/master
2021-07-20T06:57:18.969297
2017-10-31T04:17:00
2017-10-31T04:17:00
106,351,382
0
0
null
2017-10-10T01:00:38
2017-10-10T01:00:38
null
UTF-8
Java
false
false
626
java
package org.basex.query.func.strings; import org.basex.query.*; import org.basex.query.func.*; import org.basex.query.value.item.*; import org.basex.util.*; import org.basex.util.similarity.*; /** * Function implementation. * * @author BaseX Team 2005-17, BSD License * @author Christian Gruen */ public final class StringsSoundex extends StandardFunc { @Override public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { final int[] cps = new TokenParser(toToken(exprs[0], qc)).toArray(); return Str.get(new TokenBuilder(Soundex.encode(cps)).finish()); } }
[ "mnachawa@gmu.edu" ]
mnachawa@gmu.edu
2a46b90c388a9f7526595dbf7d5794447471b534
7e6224578374f43c5fb93bd29893565579d4bd98
/modules/ExportPluginExample/src/main/java/org/gephi/plugins/example/exporter/JPGExporterBuilder.java
f12b5da579a3135de9c5fd49902ce30f024d4960
[]
no_license
gephi/gephi-plugins-bootcamp
f19847de5945de63e095629a8b2c734c5e78ef44
c52a90f4096aa1adf2db922f948f1d9f7a7192c1
refs/heads/master
2022-05-05T04:45:47.395237
2022-04-07T19:38:07
2022-04-07T19:38:07
2,816,214
37
61
null
2022-04-07T19:38:08
2011-11-20T22:53:20
Java
UTF-8
Java
false
false
2,604
java
/* Copyright 2008-2011 Gephi Authors : Mathieu Bastian <mathieu.bastian@gephi.org> Website : http://www.gephi.org This file is part of Gephi. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright 2011 Gephi Consortium. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 3 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at http://gephi.org/about/legal/license-notice/ or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each file and include the License files at /cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: "Portions Copyrighted [year] [name of copyright owner]" If you wish your version of this file to be governed by only the CDDL or only the GPL Version 3, indicate your decision by adding "[Contributor] elects to include this software in this distribution under the [CDDL or GPL Version 3] license." If you do not indicate a single choice of license, a recipient has the option to distribute your version of this file under either the CDDL, the GPL Version 3 or to extend the choice of license to its licensees as provided above. However, if you add GPL Version 3 code and therefore, elected the GPL Version 3 license, then the option applies only if the new code is made subject to such option by the copyright holder. Contributor(s): Portions Copyrighted 2011 Gephi Consortium. */ package org.gephi.plugins.example.exporter; import org.gephi.io.exporter.api.FileType; import org.gephi.io.exporter.spi.VectorExporter; import org.gephi.io.exporter.spi.VectorFileExporterBuilder; import org.openide.util.lookup.ServiceProvider; /** * Implementation of a exporter builder which adds the JPG export. * * @author Mathieu Bastian */ @ServiceProvider(service = VectorFileExporterBuilder.class) public class JPGExporterBuilder implements VectorFileExporterBuilder { @Override public VectorExporter buildExporter() { return new JPGExporter(); } @Override public FileType[] getFileTypes() { return new FileType[]{new FileType(".jpg", "JPG Files")}; } @Override public String getName() { return "jpg"; } }
[ "mathieu.bastian@gmail.com" ]
mathieu.bastian@gmail.com
1e02d833223daa9265934cf521fb41445bac4148
12eaf974dd5cda4584d69fb6978838f0453c753e
/src/day56/Rectangle.java
723662e1aaf021ad35f3e563475316c963abc20a
[]
no_license
hunals/JavaSpringPractice2019
58b1232676254086f213a15c4095b82a8da34e1b
81ace34df5595ace3b899b6be533a9773cff2537
refs/heads/master
2020-06-04T20:48:23.286332
2019-07-04T13:17:10
2019-07-04T13:17:10
192,184,248
0
0
null
null
null
null
UTF-8
Java
false
false
987
java
package day56; class Rectangle extends Shape{ int width; int height; public Rectangle(String color, int width, int height) { super(color); this.width = width; this.height = height; } public static void main(String[] args) { Rectangle s1 = new Rectangle("Red", 7, 10); s1.calculatePerimeter(); System.out.println( s1.calculateArea() ); System.out.println(s1); Circle s2 = new Circle("red" , 10) ; System.out.println(s2); s2.calculatePerimeter(); System.out.println( s2.calculateArea() ); } @Override public void calculatePerimeter() { System.out.println("Perimeter is: "+ 2*(width+height)); } @Override public double calculateArea() { return width*height; } @Override public String toString() { return "Rectangle [width=" + width + ", height=" + height + ", color=" + color + ", calculateArea()=" + calculateArea() + "]"; } }
[ "hunals06@hotmail.com" ]
hunals06@hotmail.com
5ed5a60b93b052e25770c9f9ec5113865de9e0b8
a4f182c714397b2097f20498497c9539fa5a527f
/app/src/main/java/com/lzyyd/hsq/wxapi/WXEntryActivity.java
33acc851640f6f5c294567ca91a18d41e400a8f8
[]
no_license
lilinkun/lzy
de36d9804603c293ffcb62c64c50afea88679192
80a646a16cf605795940449108fd848c0b0ecd17
refs/heads/master
2023-02-19T06:15:51.089562
2021-01-13T08:52:30
2021-01-13T08:52:30
288,416,310
0
0
null
null
null
null
UTF-8
Java
false
false
8,109
java
package com.lzyyd.hsq.wxapi; import android.content.Intent; import android.os.Bundle; import android.util.Log; import android.view.WindowManager; import android.widget.Toast; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.lzyyd.hsq.bean.WxUserInfo; import com.lzyyd.hsq.interf.IWxLoginListener; import com.lzyyd.hsq.interf.IWxPayListener; import com.lzyyd.hsq.util.HsqAppUtil; import com.lzyyd.hsq.util.OkHttpUtils; import com.tencent.mm.opensdk.constants.ConstantsAPI; import com.tencent.mm.opensdk.modelbase.BaseReq; import com.tencent.mm.opensdk.modelbase.BaseResp; import com.tencent.mm.opensdk.modelbiz.WXLaunchMiniProgram; import com.tencent.mm.opensdk.modelmsg.SendAuth; import com.tencent.mm.opensdk.openapi.IWXAPI; import com.tencent.mm.opensdk.openapi.IWXAPIEventHandler; import com.tencent.mm.opensdk.openapi.WXAPIFactory; import org.json.JSONException; import org.json.JSONObject; import androidx.appcompat.app.AppCompatActivity; public class WXEntryActivity extends AppCompatActivity implements IWXAPIEventHandler { private IWXAPI iwxapi; private String unionid; private String openid; public static int wxType = 0; public static IWxLoginListener iWxResult; public static IWxPayListener iWxPayListener; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // getSupportActionBar().hide(); // // 隐藏状态栏 getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); //接收到分享以及登录的intent传递handleIntent方法,处理结果 iwxapi = WXAPIFactory.createWXAPI(this, HsqAppUtil.APP_ID, false); iwxapi.handleIntent(getIntent(), this); } @Override public void onReq(BaseReq baseReq) { } private static final int RETURN_MSG_TYPE_SHARE = 2; //请求回调结果处理 @Override public void onResp(BaseResp resp) { Log.d("login", "onPayFinish, errCode = " + resp.errCode); if (resp.getType() == ConstantsAPI.COMMAND_LAUNCH_WX_MINIPROGRAM){ WXLaunchMiniProgram.Resp launchMiniProResp = (WXLaunchMiniProgram.Resp) resp; String extraData =launchMiniProResp.extMsg; //对应小程序组件 <button open-type="launchApp"> 中的 app-parameter 属性 String str = extraData.substring(extraData.length()-1); if (extraData.substring(extraData.length()-1).equals("1")){ iWxPayListener.setWxPaySuccess("支付成功"); finish(); }else { iWxPayListener.setWxPayFail("支付失败"); finish(); } }else { //登录回调 switch (resp.errCode) { case BaseResp.ErrCode.ERR_OK: if (wxType == HsqAppUtil.WXTYPE_LOGIN) { String code = ((SendAuth.Resp) resp).code; //获取用户信息 getAccessToken(code); } else { finish(); } break; case BaseResp.ErrCode.ERR_AUTH_DENIED://用户拒绝授权 finish(); break; case BaseResp.ErrCode.ERR_USER_CANCEL://用户取消 finish(); break; case BaseResp.ErrCode.ERR_BAN: Toast.makeText(this, "签名错误", Toast.LENGTH_LONG).show(); break; case RETURN_MSG_TYPE_SHARE: finish(); break; default: break; } } } private void getAccessToken(String code) { //获取授权 StringBuffer loginUrl = new StringBuffer(); loginUrl.append("https://api.weixin.qq.com/sns/oauth2/access_token") .append("?appid=") .append(HsqAppUtil.APP_ID) .append("&secret=") .append(HsqAppUtil.SECRET) .append("&code=") .append(code) .append("&grant_type=authorization_code"); OkHttpUtils.ResultCallback<String> resultCallback = new OkHttpUtils.ResultCallback<String>() { @Override public void onSuccess(final String response) { String access = null; String openId = null; try { JSONObject jsonObject = new JSONObject(response); access = jsonObject.getString("access_token"); openId = jsonObject.getString("openid"); } catch (JSONException e) { e.printStackTrace(); } //获取个人信息 String getUserInfo = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access + "&openid=" + openId; OkHttpUtils.ResultCallback<String> reCallback = new OkHttpUtils.ResultCallback<String>() { @Override public void onSuccess(String responses) { String nickName = null; String sex = null; String city = null; String province = null; String country = null; String headimgurl = null; try { JSONObject jsonObject = new JSONObject(responses); Gson gson = new GsonBuilder().create(); WxUserInfo wxInfomation = gson.fromJson(responses, WxUserInfo.class); openid = jsonObject.getString("openid"); nickName = jsonObject.getString("nickname"); sex = jsonObject.getString("sex"); city = jsonObject.getString("city"); province = jsonObject.getString("province"); country = jsonObject.getString("country"); headimgurl = jsonObject.getString("headimgurl"); unionid = jsonObject.getString("unionid"); // DBManager.getInstance(WXEntryActivity.this).insertWxInfo(wxInfomation); iWxResult.setWxLoginSuccess(wxInfomation); Intent intent = new Intent(); intent.putExtra("wxinfo", wxInfomation); setResult(RESULT_OK, intent); finish(); } catch (JSONException e) { e.printStackTrace(); } } @Override public void onFailure(Exception e) { // DBManager.getInstance(WXEntryActivity.this).deleteWxInfo(); Toast.makeText(WXEntryActivity.this, "登录失败", Toast.LENGTH_SHORT).show(); finish(); } }; OkHttpUtils.get(getUserInfo, reCallback); } @Override public void onFailure(Exception e) { // DBManager.getInstance(WXEntryActivity.this).deleteWxInfo(); Toast.makeText(WXEntryActivity.this, "登录失败", Toast.LENGTH_SHORT).show(); finish(); } }; OkHttpUtils.get(loginUrl.toString(), resultCallback); } @Override protected void onPause() { overridePendingTransition(0, 0); super.onPause(); } public static void setLoginListener(IWxLoginListener iWxResultListener) { iWxResult = iWxResultListener; } public static void setPayListener(IWxPayListener payListener){ iWxPayListener = payListener; } public static void wxType(int type) { wxType = type; } }
[ "294561531@qq.com" ]
294561531@qq.com
54a5458cd3a566460c4817a5fffc915c72011fa7
9875f036d48bfcbb5ab066d0b294ba64b3ead5f5
/core/src/test/java/io/wcm/config/core/management/util/TypeConversionTest.java
4f00e344b593cb1f122df5d9828afb1dfd0ab801
[ "Apache-2.0" ]
permissive
wcm-io/wcm-io-config
738cb56a5bdfe8ea35206d3367400653da7fdc75
d0c2014fe1ee235a700de291d3291cb60e63af9d
refs/heads/master
2023-03-18T18:49:18.004677
2017-02-08T21:28:41
2017-02-08T21:28:41
39,157,837
1
4
null
null
null
null
UTF-8
Java
false
false
4,718
java
/* * #%L * wcm.io * %% * Copyright (C) 2014 wcm.io * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ package io.wcm.config.core.management.util; import static io.wcm.config.core.management.util.TypeConversion.objectToString; import static io.wcm.config.core.management.util.TypeConversion.stringToObject; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; import org.junit.Test; public class TypeConversionTest { @Test public void testString() { assertConversion("value", "value", String.class); assertConversion(null, null, String.class); } @Test public void testStringArray() { assertConversion(new String[] { "value" }, "value", String[].class); assertConversion(new String[] { "value1", "value2" }, "value1;value2", String[].class); assertArrayEquals(new String[] { "value1", "value2", "" }, stringToObject("value1;value2;", String[].class)); assertConversion(null, null, String[].class); } @Test public void testStringArrayWithSpecialChars() { String[] values = new String[] { "value1", "value;2", "value=3", }; String convertedString = objectToString(values); assertEquals("value1;value\\;2;value\\=3", convertedString); String[] convertedValues = stringToObject(convertedString, String[].class); assertArrayEquals(values, convertedValues); } @Test public void testInteger() { assertConversion(55, "55", Integer.class); assertEquals((Integer)0, stringToObject("wurst", Integer.class)); assertConversion(null, null, Integer.class); } @Test public void testLong() { assertConversion(55L, "55", Long.class); assertEquals((Long)0L, stringToObject("wurst", Long.class)); assertConversion(null, null, Long.class); } @Test public void testDouble() { assertConversion(55d, "55.0", Double.class); assertConversion(55.123d, "55.123", Double.class); assertEquals((Double)0d, stringToObject("wurst", Double.class)); assertConversion(null, null, Double.class); } @Test public void testBoolean() { assertConversion(true, "true", Boolean.class); assertFalse(stringToObject("wurst", Boolean.class)); assertConversion(null, null, Boolean.class); } @Test public void testMap() { Map<String, String> map = new LinkedHashMap<>(); map.put("key1", "abc"); map.put("key2", "def"); map.put("key3", null); assertConversion(map, "key1=abc;key2=def;key3=", Map.class); assertEquals(map, stringToObject("key1=abc;key2=def;key3=;;=xyz", Map.class)); assertConversion(null, null, Map.class); } @Test public void testMapWithSpecialChars() { Map<String, String> map = new LinkedHashMap<>(); map.put("key1", "value1"); map.put("key;2", "value;2"); map.put("key=3", "value=3"); map.put("key=4;", "=value;4"); @SuppressWarnings("unchecked") Map<String, String> convertedMap = stringToObject(objectToString(map), Map.class); assertEquals(map, convertedMap); } @Test(expected = IllegalArgumentException.class) public void testToObjectIllegalType() { stringToObject("value", Date.class); } @Test(expected = IllegalArgumentException.class) public void testToStringIllegalType() { objectToString(new Date()); } /** * Asserts that conversions works in boths ways (stringToObject and objectToString) and returns the same value. * @param objectValue Object value * @param stringValue String value * @param type type */ private void assertConversion(Object objectValue, String stringValue, Class<?> type) { if (type == String[].class) { assertArrayEquals("stringToObject(" + stringValue + ")", (String[])objectValue, stringToObject(stringValue, String[].class)); } else { assertEquals("stringToObject(" + stringValue + ")", objectValue, stringToObject(stringValue, type)); } assertEquals("objectToString(" + objectValue + ")", stringValue, objectToString(objectValue)); } }
[ "sseifert@pro-vision.de" ]
sseifert@pro-vision.de
7a6ce2b1a1b1fb7947b4186999f895d4461809f4
0663c432ea3891b715e74271db43fe63db9f12ed
/17. Thread Classes/src/ru/itis/count_down_latch/ThreadPool.java
eaadce93423708c0da934a962779b0abd92573e7
[]
no_license
LegendaryZer0/Javalab2020
6e87e150471b366c96c62ecbd031002d8d46a511
f4e0990f9a56e4c4c244729f773d27ed094c1b49
refs/heads/master
2023-02-22T14:06:32.941442
2021-01-23T21:20:48
2021-01-23T21:20:48
319,705,841
0
0
null
null
null
null
UTF-8
Java
false
false
3,278
java
package ru.itis.count_down_latch; import java.util.Deque; import java.util.concurrent.ConcurrentLinkedDeque; import java.util.concurrent.CountDownLatch; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; /** * 07.09.2020 * 01. Threads * * @author Sidikov Marsel (First Software Engineering Platform) * @version v1.0 */ // wait, notify, synchronized public class ThreadPool implements TaskExecutor { // очередь задач private final Deque<Runnable> tasks; // пул потоков private final PoolWorker threads[]; private static final Lock lock = new ReentrantLock(); // счетчик, который будет считать - сколько потоков уже готово к работе? private final CountDownLatch readyCountDownLatch; // счетчик, который будет считать - сколько задач было завершено? private final CountDownLatch completeCountDownLatch; public ThreadPool(int threadsCount, CountDownLatch completeCountDownLatch) { this.tasks = new ConcurrentLinkedDeque<>(); this.threads = new PoolWorker[threadsCount]; readyCountDownLatch = new CountDownLatch(threadsCount); this.completeCountDownLatch = completeCountDownLatch; for (int i = 0; i < this.threads.length; i++) { this.threads[i] = new PoolWorker(); this.threads[i].start(); } } public void submit(Runnable task) { synchronized (tasks) { tasks.add(task); tasks.notify(); } } private class PoolWorker extends Thread { @Override public void run() { lock.lock(); // уменьшить количество потоков, которые я ожидаю readyCountDownLatch.countDown(); // i-- System.out.println(Thread.currentThread().getName() + " Готово потоков - " + (threads.length - readyCountDownLatch.getCount())); try { System.out.println(Thread.currentThread().getName() + " ушел в ожидание"); lock.unlock(); // мой поток теперь будет ждать, пока readyCountDownLatch не будет равен 0 readyCountDownLatch.await(); } catch (InterruptedException e) { throw new IllegalArgumentException(e); } System.out.println(Thread.currentThread().getName() + " вышел из ожидания"); Runnable task; while(true) { synchronized (tasks) { while (tasks.isEmpty()) { try { tasks.wait(); } catch (InterruptedException e) { throw new IllegalArgumentException(e); } } task = tasks.poll(); } System.out.println(Thread.currentThread().getName() + " начата загрузка файла"); task.run(); completeCountDownLatch.countDown(); } } } }
[ "sidikov.marsel@gmail.com" ]
sidikov.marsel@gmail.com
4eb384af8502919f4355430786149f57bcc257b9
be73270af6be0a811bca4f1710dc6a038e4a8fd2
/crash-reproduction-moho/results/XWIKI-13544-16-11-SPEA2-WeightedSum:TestLen:CallDiversity/org/xwiki/velocity/internal/DefaultVelocityEngine_ESTest.java
05ea5ebc7c80d86b6a20237600ecdf7724c56214
[]
no_license
STAMP-project/Botsing-multi-objectivization-using-helper-objectives-application
cf118b23ecb87a8bf59643e42f7556b521d1f754
3bb39683f9c343b8ec94890a00b8f260d158dfe3
refs/heads/master
2022-07-29T14:44:00.774547
2020-08-10T15:14:49
2020-08-10T15:14:49
285,804,495
0
0
null
null
null
null
UTF-8
Java
false
false
576
java
/* * This file was automatically generated by EvoSuite * Sun Jan 19 06:55:09 UTC 2020 */ package org.xwiki.velocity.internal; import org.junit.Test; import static org.junit.Assert.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class DefaultVelocityEngine_ESTest extends DefaultVelocityEngine_ESTest_scaffolding { @Test public void notGeneratedAnyTest() { // EvoSuite did not generate any tests } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
6c89e4f87673488c57bbe5ab156b5301a6a9db1e
5e7bc3cbaceaba8be2cb9de951198c5283844173
/components/data/MongodbData/src/test/java/demo/DemoMongodbApplication.java
6ff5893e5abaa550840b1e4b02c66c97d0ba6f6b
[]
no_license
lianshufeng/Fast
abbb162db05b4b0ece3db60a7eea0c38c686462a
0b29400c2ec88db033729e9dd645db9aa792d06f
refs/heads/master
2022-07-08T23:30:13.190635
2021-05-26T05:41:10
2021-05-26T05:41:10
130,854,753
9
1
null
2022-06-25T07:26:27
2018-04-24T12:58:53
Java
UTF-8
Java
false
false
745
java
package demo; import com.fast.dev.core.boot.ApplicationBootSuper; import com.fast.dev.core.mvc.MVCConfiguration; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Import; @ComponentScan("demo.simple") @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class}) public class DemoMongodbApplication extends ApplicationBootSuper { public static void main(String[] args){ SpringApplication.run(DemoMongodbApplication.class, args); } }
[ "251708339@qq.com" ]
251708339@qq.com
dabcc8518f16e8366b1135939563ee73080a50bb
e6d92a452598a33435edf1cf135486a3b79a1739
/src/com/massivecraft/massivecore/Lang.java
f11c54f12e308f76ec7d7eb9621347a2b099619f
[]
no_license
wolfwork/mcore
19d8eababa6fa5d78355c889ee7d43423be3ac5b
503bde35fbcb9e22ce9a15216325c9293abd3cad
refs/heads/master
2021-01-15T13:43:52.261906
2015-02-28T05:12:39
2015-02-28T05:12:39
19,666,137
0
0
null
2015-02-28T05:12:39
2014-05-11T12:54:01
Java
UTF-8
Java
false
false
728
java
package com.massivecraft.massivecore; public class Lang { public static final String PERM_DEFAULT_DENIED_FORMAT = "<b>You don't have permission to %s."; public static final String PERM_DEFAULT_DESCRIPTION = "do that"; public static final String COMMAND_SENDER_MUST_BE_PLAYER = "<b>This command can only be used by ingame players."; public static final String COMMAND_SENDER_MUSNT_BE_PLAYER = "<b>This command can not be used by ingame players."; public static final String COMMAND_TO_FEW_ARGS = "<b>Too few arguments. <i>Use like this:"; public static final String COMMAND_TO_MANY_ARGS = "<b>Strange arguments %s<b>."; public static final String COMMAND_TO_MANY_ARGS2 = "<i>Use the command like this:"; }
[ "olof@sylt.nu" ]
olof@sylt.nu
ae8646cf4a2ceedb2c05baf01faf39c010615cf9
89f0034faac613f49edce7d86e1ca1bdffe2fbdd
/myerpGWT/src/main/java/org/adempiere/model/AdFind.java
319e3931f79d5c2cdf1b7db36b93099f52c27f5f
[]
no_license
qq122343779/myerpGXT
3263cbb688f92839a8354bcba87e57fba73d937d
2173e093b74c7a3699027eb7776789477699a137
refs/heads/master
2021-01-17T11:44:50.496141
2014-02-17T00:20:54
2014-02-17T00:20:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,498
java
package org.adempiere.model; import java.math.*; import javax.persistence.*; /** * Auto-generated by: * org.adempiere.AdempiereCustomizer */ @Entity @Table(name="ad_find") public class AdFind extends org.adempiere.common.ADEntityBase { private static final long serialVersionUID = 1L; private Integer adClientId; private Integer adColumnId; private Integer adFindId; private Integer adOrgId; private String andor; private String created; private Integer createdby; private BigDecimal findId; private Boolean isactive; private String operation; private String updated; private Integer updatedby; private String value; private String value2; public AdFind() { } public AdFind(Integer adFindId) { this.adFindId = adFindId; } @Basic @Column(name="AD_CLIENT_ID", columnDefinition="INT", nullable=false) public Integer getAdClientId() { return adClientId; } public void setAdClientId(Integer adClientId) { this.adClientId = adClientId; } @Basic @Column(name="AD_COLUMN_ID", columnDefinition="INT", nullable=false) public Integer getAdColumnId() { return adColumnId; } public void setAdColumnId(Integer adColumnId) { this.adColumnId = adColumnId; } @Id @Column(name="AD_FIND_ID", columnDefinition="INT") public Integer getAdFindId() { return adFindId; } public void setAdFindId(Integer adFindId) { this.adFindId = adFindId; } @Basic @Column(name="AD_ORG_ID", columnDefinition="INT", nullable=false) public Integer getAdOrgId() { return adOrgId; } public void setAdOrgId(Integer adOrgId) { this.adOrgId = adOrgId; } @Basic @Column(nullable=false, length=1) public String getAndor() { return andor; } public void setAndor(String andor) { this.andor = andor; } @Basic @Column(columnDefinition="TIMESTAMP", nullable=false) public String getCreated() { return created; } public void setCreated(String created) { this.created = created; } @Basic @Column(columnDefinition="INT", nullable=false) public Integer getCreatedby() { return createdby; } public void setCreatedby(Integer createdby) { this.createdby = createdby; } @Basic @Column(name="FIND_ID", nullable=false) public BigDecimal getFindId() { return findId; } public void setFindId(BigDecimal findId) { this.findId = findId; } @Basic @Column(nullable=false) public Boolean isIsactive() { return isactive; } public void setIsactive(Boolean isactive) { this.isactive = isactive; } @Basic @Column(nullable=false, length=2) public String getOperation() { return operation; } public void setOperation(String operation) { this.operation = operation; } @Basic @Column(columnDefinition="TIMESTAMP", nullable=false) public String getUpdated() { return updated; } public void setUpdated(String updated) { this.updated = updated; } @Basic @Column(columnDefinition="INT", nullable=false) public Integer getUpdatedby() { return updatedby; } public void setUpdatedby(Integer updatedby) { this.updatedby = updatedby; } @Basic @Column(nullable=false, length=40) public String getValue() { return value; } public void setValue(String value) { this.value = value; } @Basic @Column(length=40) public String getValue2() { return value2; } public void setValue2(String value2) { this.value2 = value2; } }
[ "Administrator@Natural" ]
Administrator@Natural
5aad0eb86a8883afcdb1c88ba03b764a1b2ac211
518bf342bc4138982af3e2724e75f1d9ca3ba56c
/solutions/2519. Count the Number of K-Big Indices/2519.java
ac373b6e272fcd9700adc913ad5163d6d004377f
[ "MIT" ]
permissive
walkccc/LeetCode
dae85af7cc689882a84ee5011f0a13a19ad97f18
a27be41c174565d365cbfe785f0633f634a01b2a
refs/heads/main
2023-08-28T01:32:43.384999
2023-08-20T19:00:45
2023-08-20T19:00:45
172,231,974
692
302
MIT
2023-08-13T14:48:42
2019-02-23T15:46:23
C++
UTF-8
Java
false
false
1,162
java
class FenwickTree { public FenwickTree(int n) { sums = new int[n + 1]; } public void update(int i, int delta) { while (i < sums.length) { sums[i] += delta; i += lowbit(i); } } public int get(int i) { int sum = 0; while (i > 0) { sum += sums[i]; i -= lowbit(i); } return sum; } private int[] sums; private static int lowbit(int i) { return i & -i; } } class Solution { public int kBigIndices(int[] nums, int k) { final int n = nums.length; int ans = 0; FenwickTree leftTree = new FenwickTree(n); FenwickTree rightTree = new FenwickTree(n); // left[i] := # of nums < nums[i] with index < i. int[] left = new int[n]; // right[i] := # of nums < nums[i] with index > i. int[] right = new int[n]; for (int i = 0; i < n; ++i) { left[i] = leftTree.get(nums[i] - 1); leftTree.update(nums[i], 1); } for (int i = n - 1; i >= 0; --i) { right[i] = rightTree.get(nums[i] - 1); rightTree.update(nums[i], 1); } for (int i = 0; i < n; ++i) if (left[i] >= k && right[i] >= k) ++ans; return ans; } }
[ "me@pengyuc.com" ]
me@pengyuc.com
5cfdc79f5d4c4da3a5b5cf05f596eaf4ecadd8f9
f2e8ff44dfc770b729bdc3e88945001e2bf9a92b
/ch03/springbootsecurity2/src/main/java/com/hachicore/springbootsecurity2/account/Account.java
8a08d2d988933811913cd77f1b534acfa74ca861
[]
no_license
8c6t/spring_boot
f752420394da51a945e31ea585fa825f219fc403
7d9fa34cb4afd3b6f71dec5ab2127ec8e89a1c1b
refs/heads/master
2020-08-07T15:53:35.385250
2019-10-24T17:38:28
2019-10-24T17:38:28
213,514,599
0
0
null
null
null
null
UTF-8
Java
false
false
718
java
package com.hachicore.springbootsecurity2.account; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Account { @Id @GeneratedValue private Long id; private String username; private String password; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } }
[ "nkw8620@gmail.com" ]
nkw8620@gmail.com
c5eb70aaf59472ed290e121f64fd22c1e019d47a
f5a57a8fe70ff7042e27fdea36ccad3d1715e5b3
/lambda4j/src/test/java/org/lambda4j/operator/binary/ThrowableBinaryOperatorTest.java
bdc0ff76297a327b94989a692065ab10564b31be
[ "Apache-2.0" ]
permissive
djessich/lambda4j
035103413138f02801e07097d80bd477ab6beb72
c8f8f2a8693001f159c740464d3bf39bd1ed094c
refs/heads/master
2023-03-22T05:49:53.513219
2022-07-14T21:18:58
2022-07-14T21:18:58
40,265,220
0
0
null
null
null
null
UTF-8
Java
false
false
1,179
java
/* * Copyright (c) 2021 The lambda4j authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.lambda4j.operator.binary; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; class ThrowableBinaryOperatorTest { @Test void of_givenExpression_returnsFunctionalInterface() { ThrowableBinaryOperator<String, Throwable> operator = ThrowableBinaryOperator.of((t, u) -> t); Assertions.assertNotNull(operator); } @Test void of_givenNull_returnsNull() { ThrowableBinaryOperator<String, Throwable> operator = ThrowableBinaryOperator.of(null); Assertions.assertNull(operator); } }
[ "dominik.jessich@chello.at" ]
dominik.jessich@chello.at
537fc2b4069be45801871d6110f8b48a39c0cfa4
23d21d575da06d8a0f0c3a266915df321b5154eb
/java/samplecode/src/main/java/basic/Locking/Sample.java
b06bd7ebe61750817edd909ab922d2ed6fd5a183
[]
no_license
keepinmindsh/sample
180431ce7fce20808e65d885eab1ca3dca4a76a9
4169918f432e9008b4715f59967f3c0bd619d3e6
refs/heads/master
2023-04-30T19:26:44.510319
2023-04-23T12:43:43
2023-04-23T12:43:43
248,352,910
4
0
null
2023-03-05T23:20:43
2020-03-18T22:03:16
Java
UTF-8
Java
false
false
2,241
java
package basic.Locking; import javax.naming.InsufficientResourcesException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; public class Sample { public static ExecutorService executorService = Executors.newFixedThreadPool(1000); public static void main(String[] args) throws InsufficientResourcesException { executorService.execute(new Runnable() { @Override public void run() { try { new Sample().tranferMoney(new Account(), new Account(), "100000"); } catch (InsufficientResourcesException e) { e.printStackTrace(); } } }); } private static final Object tieLock = new Object(); public void tranferMoney(final Account fromAcct, final Account toAcct, final String amount) throws InsufficientResourcesException { class Helper { public void tranfer() throws InsufficientResourcesException { if (fromAcct.getBalance().compareTo(amount) < 0) { throw new InsufficientResourcesException(); } else { fromAcct.debit(amount); toAcct.credit(amount); } } } int fromHash = System.identityHashCode(fromAcct); int toHash = System.identityHashCode(toAcct); if(fromHash < toHash) { synchronized (fromAcct){ synchronized (toAcct){ new Helper().tranfer(); } } }else if(fromHash > toHash){ synchronized (toAcct){ synchronized (fromAcct){ new Helper().tranfer(); } } }else { synchronized (tieLock){ synchronized (fromAcct){ synchronized (toAcct){ new Helper().tranfer(); } } } } } } class Account { public String getBalance(){ return "5000"; } public void debit(String amount){ } public void credit(String amount){ } } class DollarAmount{ }
[ "keepinmindsh@gmail.com" ]
keepinmindsh@gmail.com
9f091acfb7fc66a659500cc64957a6db3ec19aa9
f609cb34b3538f6dac07d2d8144ce45b14ca8ac2
/src/coding/topic/_05_Sort.java
dec69c208903a6021c08f38a63957d38205a7550
[]
no_license
sahilmutreja/Algorithms
ca8f6f59039b01ea2c0ea7f7f6e51de7e9982141
a24f6e73c1ad4c863c67e957fcba781c4953ac80
refs/heads/master
2023-02-10T08:00:13.729659
2021-01-04T08:02:12
2021-01-04T08:02:12
null
0
0
null
null
null
null
UTF-8
Java
false
false
492
java
/** * @author Yunxiang He * @date 10/29/2018 */ package coding.topic; import coding.lintcode.__0559_Trie_Service; public interface _05_Sort { __0559_Trie_Service __0559_Trie_Service = null; // insertion sort // Quick Sort // QuickSort QuickSort = null; coding.temp._0973_K_Closest_Points_to_Origin _0973_K_Closest_Points_to_Origin = null; coding.temp._0215_Kth_Largest_Element_in_an_Array _0215_Kth_Largest_Element_in_an_Array = null; }
[ "155028525@qq.com" ]
155028525@qq.com
fc51f139c9e467163cb8d6a81df70696793b8470
cd5d72dd200c69f04b60d5d2844e52e4269b9d23
/src/main/java/com/itcalf/renhe/context/relationship/GetHotKeywordListTask.java
855b6b79bce53814d14cd9e236ef71182bc02e03
[]
no_license
TAEYANG9527/myHlProject
39a34f9f8936a5fb198b99ebb5ad72dae0aaaef6
926fd23afb581466a696b57619caaa7cb0928d44
refs/heads/master
2020-12-25T10:37:47.554659
2016-07-20T02:43:00
2016-07-20T02:43:00
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,278
java
package com.itcalf.renhe.context.relationship; import android.content.Context; import com.itcalf.renhe.BaseAsyncTask; import com.itcalf.renhe.Constants; import com.itcalf.renhe.dto.HotKeywordOperation; import com.itcalf.renhe.utils.HttpUtil; import java.util.HashMap; import java.util.Map; /** * Title: EditSummaryInfoProfessionTask.java<br> * Description: <br> * Copyright (c) 人和网版权所有 2014 <br> * Create DateTime: 2014-8-6 上午9:58:59 <br> * @author wangning */ public class GetHotKeywordListTask extends BaseAsyncTask<HotKeywordOperation> { private Context mContext; public GetHotKeywordListTask(Context mContext) { super(mContext); this.mContext = mContext; } @Override public void doPre() { } @Override public void doPost(HotKeywordOperation result) { } @Override protected HotKeywordOperation doInBackground(String... params) { Map<String, Object> reqParams = new HashMap<String, Object>(); reqParams.put("sid", params[0]);// reqParams.put("adSId", params[1]);// try { HotKeywordOperation mb = (HotKeywordOperation) HttpUtil.doHttpRequest(Constants.Http.HOT_SEARCH_LIST, reqParams, HotKeywordOperation.class, null); return mb; } catch (Exception e) { e.printStackTrace(); } return null; } }
[ "280832809@qq.com" ]
280832809@qq.com
11410e3dc6fc12c7f7c5cbde209d4d34c9f52cb7
e89277ec3c1b5980eed8c19939a65f2b80f2b60d
/src/org/sablecc/objectmacro/codegeneration/java/macro/DSeparator.java
af1185f475e2dc9ae62b78475202b578e4a6f3fa
[ "Apache-2.0" ]
permissive
SableCC/sablecc
b844c4e918fd09096075f1ec49f55b76e6c5b51f
378fc74a2e8213567149a6c676d79d7630e87640
refs/heads/master
2023-03-11T03:44:14.785650
2018-09-13T01:10:02
2018-09-13T01:10:02
328,567
107
18
Apache-2.0
2018-09-13T01:11:52
2009-10-06T14:42:08
Java
UTF-8
Java
false
false
480
java
/* This file was generated by SableCC's ObjectMacro. */ package org.sablecc.objectmacro.codegeneration.java.macro; class DSeparator extends Directive { DSeparator( String value) { super(value); } @Override String apply( Integer index, String macro, Integer list_size) { if (index == list_size - 1) { return macro; } return macro.concat(this.value); } }
[ "egagnon@j-meg.com" ]
egagnon@j-meg.com
2c2c90e1905b56ad4269965f86f4244d798d4c47
d67f6450b24fb08f2f61b74dcdecce3025ee3efc
/gemp-swccg-cards/src/main/java/com/gempukku/swccgo/cards/set211/dark/Card211_006.java
273f3bbbb0dde248543ad9f926816607195c28ed
[ "MIT" ]
permissive
cburyta/gemp-swccg-public
00a974d042195e69d3c104e61e9ee5bd48728f9a
05529086de91ecb03807fda820d98ec8a1465246
refs/heads/master
2023-01-09T12:45:33.347296
2020-10-26T14:39:28
2020-10-26T14:39:28
309,400,711
0
0
MIT
2020-11-07T04:57:04
2020-11-02T14:47:59
null
UTF-8
Java
false
false
2,315
java
package com.gempukku.swccgo.cards.set211.dark; import com.gempukku.swccgo.cards.AbstractAlien; import com.gempukku.swccgo.cards.conditions.OnCondition; import com.gempukku.swccgo.common.*; import com.gempukku.swccgo.filters.Filters; import com.gempukku.swccgo.game.PhysicalCard; import com.gempukku.swccgo.game.SwccgGame; import com.gempukku.swccgo.logic.conditions.Condition; import com.gempukku.swccgo.logic.modifiers.*; import java.util.LinkedList; import java.util.List; /** * Set: Set 11 * Type: Character * Subtype: Alien * Title: Sebulba (V) */ public class Card211_006 extends AbstractAlien { public Card211_006() { super(Side.DARK, 2, 3, 4, 2, 5, Title.Sebulba, Uniqueness.UNIQUE); setLore("Bad tempered Dug from Pixelito. He was about to turn Jar Jar into orange goo, until Anakin intervened."); setGameText("[Pilot] 2. Deploys free to Mos Espa. While on Tatooine, attrition against opponent is +1 here and your Force generation is +1. When You're A Slave? places a card in your Used Pile, may draw top card of your Reserve Deck."); addIcons(Icon.VIRTUAL_SET_11, Icon.TATOOINE, Icon.EPISODE_I, Icon.PILOT); setSpecies(Species.DUG); setVirtualSuffix(true); } @Override protected List<Modifier> getGameTextAlwaysOnModifiers(SwccgGame game, PhysicalCard self) { List<Modifier> modifiers = new LinkedList<Modifier>(); modifiers.add(new DeploysFreeToLocationModifier(self, Filters.Mos_Espa)); return modifiers; } @Override protected List<Modifier> getGameTextWhileActiveInPlayModifiers(SwccgGame game, final PhysicalCard self) { List<Modifier> modifiers = new LinkedList<Modifier>(); Condition onTatooineCondition = new OnCondition(self, Title.Tatooine); modifiers.add(new AddsPowerToPilotedBySelfModifier(self, 2)); modifiers.add(new AttritionModifier(self, Filters.here(self), onTatooineCondition, 1, game.getOpponent(self.getOwner()))); modifiers.add(new TotalForceGenerationModifier(self, onTatooineCondition, 1, self.getOwner())); modifiers.add(new ModifyGameTextModifier(self, Filters.title(Title.Youre_A_Slave), ModifyGameTextType.YOURE_A_SLAVE__DRAW_TOP_CARD_OF_RESERVE_DECK_WHEN_PLACING_A_CARD_IN_USED_PILE)); return modifiers; } }
[ "andrew@bender.io" ]
andrew@bender.io
29bcfb2aad5fac4ed8b132fa8633a1dfad230bea
8984bcba320937a1a4bfc446e8f723566bbf0a97
/rackspace/src/main/java/org/jclouds/rackspace/cloudfiles/blobstore/functions/ObjectToBlob.java
26d4ec71f9d5f4cbb0c60989aa76bb45cb9ff9c6
[ "Apache-2.0" ]
permissive
jlochhead/jclouds
798e37849849333f1c13b22e244d804234707ce6
5afc44b2b790435216257507bb37fbb708c56284
refs/heads/master
2021-01-23T21:48:01.949179
2010-06-23T22:43:39
2010-06-23T22:43:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,943
java
/** * * Copyright (C) 2009 Cloud Conscious, LLC. <info@cloudconscious.com> * * ==================================================================== * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ==================================================================== */ package org.jclouds.rackspace.cloudfiles.blobstore.functions; import static com.google.common.base.Preconditions.checkNotNull; import javax.inject.Inject; import javax.inject.Singleton; import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.domain.Blob.Factory; import org.jclouds.rackspace.cloudfiles.domain.CFObject; import com.google.common.base.Function; /** * @author Adrian Cole */ @Singleton public class ObjectToBlob implements Function<CFObject, Blob> { private final Blob.Factory blobFactory; private final ObjectToBlobMetadata object2BlobMd; @Inject ObjectToBlob(Factory blobFactory, ObjectToBlobMetadata object2BlobMd) { this.blobFactory = blobFactory; this.object2BlobMd = object2BlobMd; } public Blob apply(CFObject from) { if (from == null) return null; Blob blob = blobFactory.create(object2BlobMd.apply(from.getInfo())); if (from.getContentLength() != null) blob.setContentLength(from.getContentLength()); blob.setPayload(checkNotNull(from.getPayload(), "payload: " + from)); blob.setAllHeaders(from.getAllHeaders()); return blob; } }
[ "adrian.f.cole@3d8758e0-26b5-11de-8745-db77d3ebf521" ]
adrian.f.cole@3d8758e0-26b5-11de-8745-db77d3ebf521
60e4bf4336132d7dd523d1065b48220761c833d8
e3f41d7400a329b0eb59c6d439ba1f0e9e0fc772
/subprojects/core/src/main/groovy/org/gradle/messaging/remote/internal/inet/MulticastConnection.java
c1fee6ac7304a9e7a337b4f288abba8f8efbb36f
[]
no_license
bmuschko/gradle
176b893f26f2d15069d64022bcdac485e3e89d7c
8fc8237f8f9fa279b67f20b496f865bea7279e64
refs/heads/master
2021-01-17T22:42:04.400572
2011-10-01T05:13:29
2011-10-01T05:19:28
1,035,152
4
0
null
null
null
null
UTF-8
Java
false
false
3,487
java
/* * Copyright 2011 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.gradle.messaging.remote.internal.inet; import org.gradle.api.UncheckedIOException; import org.gradle.messaging.remote.internal.Connection; import org.gradle.messaging.remote.internal.MessageIOException; import org.gradle.messaging.remote.internal.MessageSerializer; import java.io.*; import java.net.DatagramPacket; import java.net.MulticastSocket; import java.net.SocketException; public class MulticastConnection<T> implements Connection<T> { private static final int MAX_MESSAGE_SIZE = 32*1024; private final MulticastSocket socket; private final SocketInetAddress address; private final MessageSerializer<T> serializer; private final SocketInetAddress localAddress; public MulticastConnection(SocketInetAddress address, MessageSerializer<T> serializer) { this.address = address; this.serializer = serializer; try { socket = new MulticastSocket(address.getPort()); socket.joinGroup(address.getAddress()); } catch (IOException e) { throw new UncheckedIOException(e); } localAddress = new SocketInetAddress(socket.getInetAddress(), socket.getLocalPort()); } @Override public String toString() { return String.format("multicast connection %s", address); } public void dispatch(T message) { try { ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); DataOutputStream dataOutputStream = new DataOutputStream(outputStream); serializer.write(message, dataOutputStream); dataOutputStream.close(); byte[] buffer = outputStream.toByteArray(); socket.send(new DatagramPacket(buffer, buffer.length, address.getAddress(), address.getPort())); } catch (Exception e) { throw new MessageIOException(String.format("Could not write multi-cast message on %s.", address), e); } } public T receive() { try { byte[] buffer = new byte[MAX_MESSAGE_SIZE]; DatagramPacket packet = new DatagramPacket(buffer, 0, buffer.length); socket.receive(packet); ByteArrayInputStream inputStream = new ByteArrayInputStream(packet.getData(), packet.getOffset(), packet.getLength()); DataInputStream dataInputStream = new DataInputStream(inputStream); return serializer.read(dataInputStream, localAddress, new SocketInetAddress(packet.getAddress(), packet.getPort())); } catch (SocketException e) { // Assume closed return null; } catch (Exception e) { throw new MessageIOException(String.format("Could not receive multi-cast message on %s", address), e); } } public void requestStop() { socket.close(); } public void stop() { requestStop(); } }
[ "adam.murdoch@gradleware.com" ]
adam.murdoch@gradleware.com
ba51998ba5afc37b218fadc94aa12c8bb9e04587
f12b5e4b5a3defb517390d32ccb5bd8ee45b3bf0
/cherry/src/main/java/com/youi/business/hardware/vo/VX86Detail.java
64c906eb582a66871841b845c5c981bb16360f31
[]
no_license
qq57694878/code
bbea5866b93c1c3a9a1e3f3593ad0d594d8aa177
24703f5da3cfb8fc82a3bccdece7798f178c3b99
refs/heads/master
2020-12-02T08:08:47.434437
2017-07-10T13:41:26
2017-07-10T13:41:30
96,774,251
0
0
null
null
null
null
UTF-8
Java
false
false
6,046
java
package com.youi.business.hardware.vo; /** * Created by jinliang on 2016/9/26. */ public class VX86Detail { /** * */ private Long id; /** * */ private Long room_id; /** * */ private Long cabinet_id; /** *品牌 */ private String brand; /** *名称 */ private String name; /** *型号 */ private String type; /** * */ private Long high; /** * */ private Long width; /** * */ private Long depth; /** *cpu型号 */ private String cpu_type; /** *频率(Hz) */ private String cpu_frequency; /** *核心数 */ private Long core_num; /** *当前cpu数 */ private Long cpu_current_num; /** *cpu最大数 */ private Long cpu_max_num; /** *内存类型 */ private String memory_type; /** *内存当前容量 */ private Long memory_current_capacity; /** *内存最大容量 */ private Long memory_max_capacity; /** *主板型号 */ private String mainboard_type; /** *存储接口类型 */ private String disk_interface_type; /** *磁盘容量 */ private Long disk_size; /** *当前磁盘数 */ private Long disk_current_num; /** *最大磁盘数 */ private Long disk_max_num; /** * */ private String disk_raid; /** *主要用途,1-业务服务器,2-虚拟化服务器,3-数据库服务器 */ private String main_usage; /** *其他描述 */ private String description; private String asset_num; public String getAsset_num() { return asset_num; } public void setAsset_num(String asset_num) { this.asset_num = asset_num; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Long getRoom_id() { return room_id; } public void setRoom_id(Long room_id) { this.room_id = room_id; } public Long getCabinet_id() { return cabinet_id; } public void setCabinet_id(Long cabinet_id) { this.cabinet_id = cabinet_id; } public String getBrand() { return brand; } public void setBrand(String brand) { this.brand = brand; } public String getType() { return type; } public void setType(String type) { this.type = type; } public Long getHigh() { return high; } public void setHigh(Long high) { this.high = high; } public Long getWidth() { return width; } public void setWidth(Long width) { this.width = width; } public Long getDepth() { return depth; } public void setDepth(Long depth) { this.depth = depth; } public String getCpu_type() { return cpu_type; } public void setCpu_type(String cpu_type) { this.cpu_type = cpu_type; } public String getCpu_frequency() { return cpu_frequency; } public void setCpu_frequency(String cpu_frequency) { this.cpu_frequency = cpu_frequency; } public Long getCore_num() { return core_num; } public void setCore_num(Long core_num) { this.core_num = core_num; } public Long getCpu_current_num() { return cpu_current_num; } public void setCpu_current_num(Long cpu_current_num) { this.cpu_current_num = cpu_current_num; } public Long getCpu_max_num() { return cpu_max_num; } public void setCpu_max_num(Long cpu_max_num) { this.cpu_max_num = cpu_max_num; } public String getMemory_type() { return memory_type; } public void setMemory_type(String memory_type) { this.memory_type = memory_type; } public Long getMemory_current_capacity() { return memory_current_capacity; } public void setMemory_current_capacity(Long memory_current_capacity) { this.memory_current_capacity = memory_current_capacity; } public Long getMemory_max_capacity() { return memory_max_capacity; } public void setMemory_max_capacity(Long memory_max_capacity) { this.memory_max_capacity = memory_max_capacity; } public String getMainboard_type() { return mainboard_type; } public void setMainboard_type(String mainboard_type) { this.mainboard_type = mainboard_type; } public String getDisk_interface_type() { return disk_interface_type; } public void setDisk_interface_type(String disk_interface_type) { this.disk_interface_type = disk_interface_type; } public Long getDisk_size() { return disk_size; } public void setDisk_size(Long disk_size) { this.disk_size = disk_size; } public Long getDisk_current_num() { return disk_current_num; } public void setDisk_current_num(Long disk_current_num) { this.disk_current_num = disk_current_num; } public Long getDisk_max_num() { return disk_max_num; } public void setDisk_max_num(Long disk_max_num) { this.disk_max_num = disk_max_num; } public String getDisk_raid() { return disk_raid; } public void setDisk_raid(String disk_raid) { this.disk_raid = disk_raid; } public String getMain_usage() { return main_usage; } public void setMain_usage(String main_usage) { this.main_usage = main_usage; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "57694878@qq.com" ]
57694878@qq.com
87d4b1d51d5a4e712ea20c269f405f56871ad145
8e2379860fe099f8c256b738be9244bdbe8080d7
/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContentGenerator.java
f22bcebaf954ccad3e658760fc4824c67808b841
[ "Apache-2.0" ]
permissive
shadow000fire/elasticsearch-groupby
0d61023315a4ed40471a7bc6c50a30a970f932a4
32385cdc76781b567ed98c2a9ef71777349bc3ef
refs/heads/master
2021-01-18T07:37:52.082708
2013-12-04T13:03:53
2013-12-04T13:03:53
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,329
java
/* * Licensed to ElasticSearch and Shay Banon under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. ElasticSearch 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.elasticsearch.common.xcontent.yaml; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.dataformat.yaml.YAMLParser; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.xcontent.XContentType; import org.elasticsearch.common.xcontent.json.JsonXContentGenerator; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; /** * */ public class YamlXContentGenerator extends JsonXContentGenerator { public YamlXContentGenerator(JsonGenerator generator) { super(generator); } @Override public XContentType contentType() { return XContentType.YAML; } @Override public void writeRawField(String fieldName, InputStream content, OutputStream bos) throws IOException { writeFieldName(fieldName); YAMLParser parser = YamlXContent.yamlFactory.createParser(content); try { parser.nextToken(); generator.copyCurrentStructure(parser); } finally { parser.close(); } } @Override public void writeRawField(String fieldName, byte[] content, OutputStream bos) throws IOException { writeFieldName(fieldName); YAMLParser parser = YamlXContent.yamlFactory.createParser(content); try { parser.nextToken(); generator.copyCurrentStructure(parser); } finally { parser.close(); } } @Override protected void writeObjectRaw(String fieldName, BytesReference content, OutputStream bos) throws IOException { writeFieldName(fieldName); YAMLParser parser; if (content.hasArray()) { parser = YamlXContent.yamlFactory.createParser(content.array(), content.arrayOffset(), content.length()); } else { parser = YamlXContent.yamlFactory.createParser(content.streamInput()); } try { parser.nextToken(); generator.copyCurrentStructure(parser); } finally { parser.close(); } } @Override public void writeRawField(String fieldName, byte[] content, int offset, int length, OutputStream bos) throws IOException { writeFieldName(fieldName); YAMLParser parser = YamlXContent.yamlFactory.createParser(content, offset, length); try { parser.nextToken(); generator.copyCurrentStructure(parser); } finally { parser.close(); } } }
[ "kimchy@gmail.com" ]
kimchy@gmail.com
dd3b751b03c508ab0ddff5226e2e7573b10d1361
5eae683a6df0c4b97ab1ebcd4724a4bf062c1889
/bin/ext-integration/sap/core/sapcore/src/de/hybris/platform/sap/core/runtime/SessionObjectFactory.java
f5388a977c42615d303a4524bd8bbd92fcf20bfd
[]
no_license
sujanrimal/GiftCardProject
1c5e8fe494e5c59cca58bbc76a755b1b0c0333bb
e0398eec9f4ec436d20764898a0255f32aac3d0c
refs/heads/master
2020-12-11T18:05:17.413472
2020-01-17T18:23:44
2020-01-17T18:23:44
233,911,127
0
0
null
2020-06-18T15:26:11
2020-01-14T18:44:18
null
UTF-8
Java
false
false
3,087
java
/* * [y] hybris Platform * * Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved. * * This software is the confidential and proprietary information of SAP * ("Confidential Information"). You shall not disclose such Confidential * Information and shall use it only in accordance with the terms of the * license agreement you entered into with SAP. */ package de.hybris.platform.sap.core.runtime; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.log4j.Logger; import org.springframework.beans.factory.ObjectFactory; /** * Factory for session objects for beans defined with scope <code>sapSession</code>. */ public class SessionObjectFactory { private static final Logger log = Logger.getLogger(SessionObjectFactory.class.getName()); private final Map<String, Object> sessionObjectMap = new ConcurrentHashMap<String, Object>(); private final Map<String, Runnable> destructionCallbacks = new ConcurrentHashMap<String, Runnable>(); /** * Gets session object from factory and creates it if necessary. * * @param beanName * Id or alias of the bean * @param objectFactory * Object factory to be used * @return Object Bean reference */ public synchronized Object getSessionObject(final String beanName, final ObjectFactory<?> objectFactory) { if (!sessionObjectMap.containsKey(beanName)) { final Object object = objectFactory.getObject(); sessionObjectMap.put(beanName, object); } return sessionObjectMap.get(beanName); } /** * Removes a session bean. * * @param beanName * Id or alias of the bean * @return Bean reference which has been removed */ public Object removeSessionObject(final String beanName) { return sessionObjectMap.remove(beanName); } /** * Destroy business object factory and hereby all objects. */ public synchronized void destroy() { try { // Call destroy-methods of all objects registered in // destructionCallbacks map performDestructionCallbacks(); sessionObjectMap.clear(); } catch (final Exception e) { log.error(e); log.error(e.toString()); } } /** * Registers bean for destroy-method call if declared with Spring. * * @param beanName * Id or alias of the bean * @param callback * Destruction callback * * @see org.springframework.beans.factory.config.Scope#registerDestructionCallback (java.lang.String, * java.lang.Runnable) */ public void registerDestroyObject(final String beanName, final Runnable callback) { destructionCallbacks.put(beanName, callback); } /** * Calls all destroy-methods declared with Spring. */ private void performDestructionCallbacks() { for (final Map.Entry<String, Runnable> entry : destructionCallbacks.entrySet()) { try { entry.getValue().run(); } catch (final Exception ex) { // Do only log and continue with destruction of remaining beans log.fatal("Exceptions occurred during destroy!", ex); } } destructionCallbacks.clear(); } }
[ "travis.d.crawford@accenture.com" ]
travis.d.crawford@accenture.com
ad8ee3559e6e5aa2c7b3c450a66d239f2d33774e
85cfc652459ca2f015aa8c8dc55240721632cee0
/bin/platform/ext/processing/testsrc/de/hybris/platform/processing/distributed/defaultimpl/ExecutionHandlerIntegrationTest.java
258c4c854a187b71a04fff23632c088c5a73b961
[]
no_license
varshadhamal/Hybris-test
43e5479b9909e41e6276dfde6b4f4ff1cdae9b0e
a29c6090680110ab733e2077772c9c477d497df6
refs/heads/master
2020-03-18T06:31:01.940494
2018-05-22T11:58:12
2018-05-22T11:58:12
134,400,503
0
1
null
null
null
null
UTF-8
Java
false
false
6,167
java
/* * [y] hybris Platform * * Copyright (c) 2000-2016 SAP SE * All rights reserved. * * This software is the confidential and proprietary information of SAP * Hybris ("Confidential Information"). You shall not disclose such * Confidential Information and shall use it only in accordance with the * terms of the license agreement you entered into with SAP Hybris. */ package de.hybris.platform.processing.distributed.defaultimpl; import static org.mockito.Matchers.notNull; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.verifyZeroInteractions; import static org.mockito.Mockito.when; import de.hybris.bootstrap.annotations.IntegrationTest; import de.hybris.platform.processing.distributed.defaultimpl.DistributedProcessHandler.ModelWithDependencies; import de.hybris.platform.processing.enums.BatchType; import de.hybris.platform.processing.enums.DistributedProcessState; import de.hybris.platform.processing.model.BatchModel; import de.hybris.platform.processing.model.DistributedProcessModel; import de.hybris.platform.processing.model.DistributedProcessWorkerTaskModel; import de.hybris.platform.servicelayer.ServicelayerTransactionalBaseTest; import de.hybris.platform.servicelayer.model.ModelService; import de.hybris.platform.task.TaskEvent; import de.hybris.platform.task.TaskService; import java.util.UUID; import javax.annotation.Resource; import org.junit.Before; import org.junit.Test; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @IntegrationTest public class ExecutionHandlerIntegrationTest extends ServicelayerTransactionalBaseTest { @Resource private ModelService modelService; @Mock private TaskService taskService; @Mock DistributedProcessHandler processHandler; @Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); } @Test public void shouldOnlyTriggerConditionWhenProcessMovedForward() { final ExecutionHandler handler = givenExecutionHandler(); final DistributedProcessModel process = givenProcess(); final BatchModel batch = givenBatch(process, BatchType.INPUT); final DistributedProcessWorkerTaskModel task = givenTask(batch); process.setCurrentExecutionId("MOVED_FORWARD"); handler.runWorkerTask(task); verifyZeroInteractions(processHandler); verify(taskService).triggerEvent(notNull(TaskEvent.class)); verifyNoMoreInteractions(taskService); } @Test public void shouldOnlyTriggerConditionWhenProcessIsAlreadyFinished() { final ExecutionHandler handler = givenExecutionHandler(); final DistributedProcessModel process = givenProcess(); final BatchModel batch = givenBatch(process, BatchType.INPUT); final DistributedProcessWorkerTaskModel task = givenTask(batch); process.setState(DistributedProcessState.SUCCEEDED); handler.runWorkerTask(task); verifyZeroInteractions(processHandler); verify(taskService).triggerEvent(notNull(TaskEvent.class)); verifyNoMoreInteractions(taskService); } @Test public void shouldOnlyTriggerConditionWhenStopHasBeenRequested() { final ExecutionHandler handler = givenExecutionHandler(); final DistributedProcessModel process = givenProcess(); final BatchModel batch = givenBatch(process, BatchType.INPUT); final DistributedProcessWorkerTaskModel task = givenTask(batch); process.setStopRequested(true); handler.runWorkerTask(task); verifyZeroInteractions(processHandler); verify(taskService).triggerEvent(notNull(TaskEvent.class)); verifyNoMoreInteractions(taskService); } @Test public void shouldUseProcessHandlerForProducingResultBatch() { final ExecutionHandler handler = givenExecutionHandler(); final DistributedProcessModel process = givenProcess(); final BatchModel batch = givenBatch(process, BatchType.INPUT); final DistributedProcessWorkerTaskModel task = givenTask(batch); final BatchModel resultBatch = givenBatch(process, BatchType.RESULT); when(processHandler.createResultBatch(notNull(BatchModel.class))) .thenReturn(ModelWithDependencies.singleModel(resultBatch)); handler.runWorkerTask(task); verify(processHandler).createResultBatch(batch); verify(taskService).triggerEvent(notNull(TaskEvent.class)); verifyNoMoreInteractions(processHandler, taskService); } @Test public void shouldOnlyTriggerConditionWhenHandlingExceptiond() { final ExecutionHandler handler = givenExecutionHandler(); final DistributedProcessModel process = givenProcess(); final BatchModel batch = givenBatch(process, BatchType.INPUT); final DistributedProcessWorkerTaskModel task = givenTask(batch); handler.handleErrorDuringBatchExecution(task); verifyZeroInteractions(processHandler); verify(taskService).triggerEvent(notNull(TaskEvent.class)); verifyNoMoreInteractions(taskService); } private DistributedProcessWorkerTaskModel givenTask(final BatchModel batch) { final DistributedProcessWorkerTaskModel task = modelService.create(DistributedProcessWorkerTaskModel.class); task.setContextItem(batch); task.setConditionId(UUID.randomUUID().toString()); task.setRunnerBean("alabama"); modelService.save(task); return task; } private BatchModel givenBatch(final DistributedProcessModel process, final BatchType type) { final BatchModel batch = modelService.create(BatchModel.class); batch.setId(UUID.randomUUID().toString()); batch.setExecutionId(process.getCurrentExecutionId()); batch.setRemainingWorkLoad(123); batch.setProcess(process); batch.setType(type); return batch; } private DistributedProcessModel givenProcess() { final DistributedProcessModel process = modelService.create(DistributedProcessModel.class); process.setCurrentExecutionId("EXECUTION"); process.setCode(UUID.randomUUID().toString()); process.setState(DistributedProcessState.WAITING_FOR_EXECUTION); modelService.save(process); return process; } private ExecutionHandler givenExecutionHandler() { return new ExecutionHandler(taskService, modelService) { @Override DistributedProcessHandler getHandler(final String handlerBeanId) { return processHandler; } }; } }
[ "varsha.d.saste@accenture.com" ]
varsha.d.saste@accenture.com
b3b49930f9bf01e7e1ae1399d7d710bc030e7185
6928f1c8d5b86d24a0e017fc9ac180ed3d9e72b1
/src/chapter05/ch13/ComparatorTest.java
553d928a028c275cc8c45884d02bf7033e115118
[]
no_license
minhee0327/fastcampus-java
5c25d4377b720945b83646c34eb6af43c0a541a3
57f03ccc0ab4ec97b7305e09a944f6a0b8a9fb6f
refs/heads/master
2023-05-22T18:11:15.092799
2021-06-14T02:28:12
2021-06-14T02:28:12
362,716,434
0
0
null
null
null
null
UTF-8
Java
false
false
988
java
package chapter05.ch13; import java.util.*; class Test implements Comparator<String>{ @Override public int compare(String o1, String o2) { return o1.compareTo(o2); } } public class ComparatorTest { public static void main(String[] args) { Set<String> ts = new TreeSet<>(new Test()); ts.add("user5"); ts.add("user3"); ts.add("user4"); ts.add("user2"); ts.add("user1"); // Treeset 의 Comparator 사용시에는 위처럼 class 에 implements 받아 구현한 후, 생성자로 넣어준다. // list 의 Comparator 사용시에는 아래처럼 Comparator 객체 생성해서 구현해서 사용한다. // Collections.sort(list, new Comparator<String>() { // @Override // public int compare(String o1, String o2) { // return o1.compareTo(o2); // } // }); for(String s: ts){ System.out.println(s); } } }
[ "queen.minhee@gmail.com" ]
queen.minhee@gmail.com
a87dd910809495054ced43bd21d2d74fcc654f5e
db921bdb69d8f48878843bcea8dff481f87af223
/app/src/main/java/com/campray/lesswalletandroid/listener/ApiHandleListener.java
5978f9835905251b197c24d3102f569c3bb0fad4
[]
no_license
CampRay/LessWalletAndroid
431e0d46df4e0c7d5f677b486a96600cc3682c77
44fd40aa2fe08878d6ec47726b5ff849fa8a3f68
refs/heads/master
2021-07-06T06:23:10.519959
2020-07-19T05:57:05
2020-07-19T05:57:05
133,894,586
0
0
null
null
null
null
UTF-8
Java
false
false
433
java
package com.campray.lesswalletandroid.listener; import com.campray.lesswalletandroid.util.AppException; /** * Created by Phills on 9/5/2017. * 访问服务器API接口事件侦听器 */ public abstract class ApiHandleListener<T> implements IListener { //当前进度:index是进度百分比数 public void onProgress(int index){}; //API访问完成 public abstract void done(T obj, AppException exception); }
[ "phills.li@campray.com" ]
phills.li@campray.com
4d224ac53e49177da52552c9436d399e577e6ae4
d5c4d2f5d42ab62dc1d5e9d33e44695c1e756d86
/mhr-b2b-client/src/src/main/java/au/gov/nehta/vendorlibrary/pcehr/clients/common/constant/FormatTypes.java
c50a11e1a8755fdbfeba09ab58664f9481438996
[ "LicenseRef-scancode-warranty-disclaimer", "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
shruthisetty/integration-toolkit-sample-code-java
9d39ba42c1967620172ee05e40721ce1140b956b
bde3f532de3cb8c5d090919da7e4f197f92bd483
refs/heads/master
2020-05-31T23:12:50.461233
2018-09-19T00:47:31
2018-09-19T00:47:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,311
java
/* * Copyright 2012 NEHTA * * Licensed under the NEHTA Open Source (Apache) License; you may not use this * file except in compliance with the License. A copy of the License is in the * 'license.txt' file, which should be provided with this work. * * 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.nehta.vendorlibrary.pcehr.clients.common.constant; /** * {@link au.gov.nehta.vendorlibrary.pcehr.clients.common.constant.FormatTypes} * Enum of format strings used with String.Format(). */ public enum FormatTypes { /** * Structure of error. */ ERROR_HEADER("%s: %s\n\n"); /** * Contains format string structure. */ private final String structure; /** * Constructor used to create a FormatTypes enum. * * @param structure String format structure. */ private FormatTypes(final String structure) { this.structure = structure; } /** * Retrieve the relevant string format. * * @return String. */ public String getStructure() { return structure; } }
[ "philip.wilford@digitalhealth.gov.au" ]
philip.wilford@digitalhealth.gov.au
914dab5f73e1d6c257c01bfaa1f8a76adb591d2e
24525ebc414e22380e2639876d36e6673dff9657
/common-support/src/main/java/com/sanerzone/common/support/persistence/dialect/db/SybaseDialect.java
63926c34382fb8e3431c7cbb13083d05ee3b9a1e
[]
no_license
yyf736057729/sms
a3b172b7b818411a22ccb7baeaeff1647c7cd106
02a72c7bbd712782888c3c897d5494d4052f4cc8
refs/heads/master
2020-04-22T14:19:39.377203
2019-02-13T04:30:02
2019-02-13T04:30:02
170,440,034
1
3
null
null
null
null
UTF-8
Java
false
false
1,476
java
/** * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved. */ package com.sanerzone.common.support.persistence.dialect.db; import com.sanerzone.common.support.persistence.dialect.Dialect; /** * Sybase数据库分页方言实现。 * 还未实现 * * @author poplar.yfyang * @version 1.0 2010-10-10 下午12:31 * @since JDK 1.5 */ public class SybaseDialect implements Dialect { public boolean supportsLimit() { return false; } @Override public String getLimitString(String sql, int offset, int limit) { return null; } /** * 将sql变成分页sql语句,提供将offset及limit使用占位符号(placeholder)替换. * <pre> * 如mysql * dialect.getLimitString("select * from user", 12, ":offset",0,":limit") 将返回 * select * from user limit :offset,:limit * </pre> * * @param sql 实际SQL语句 * @param offset 分页开始纪录条数 * @param offsetPlaceholder 分页开始纪录条数-占位符号 * @param limit 分页每页显示纪录条数 * @param limitPlaceholder 分页纪录条数占位符号 * @return 包含占位符的分页sql */ public String getLimitString(String sql, int offset, String offsetPlaceholder, int limit, String limitPlaceholder) { throw new UnsupportedOperationException("paged queries not supported"); } }
[ "13282810305@163.com" ]
13282810305@163.com
40f91a7ed8c848d4888c077693e2285df8e0154f
dfef02cfa575b2c0f4cbccb0216f3fef9d2fe9d1
/src/Notes/service/dto/LocationWithCountryDTO.java
40238f16114cf3e2f5333a4ca0423fc50f0f3b8f
[]
no_license
SaeidKazemi78/Complete-Spring-Security
a84943ea9f36e9557e7f52afdc2fce274b5e98c3
d395c0e23a30a5a9fa51c07cb5a178b50bacfeb8
refs/heads/master
2022-12-14T10:08:31.629509
2020-09-14T05:34:44
2020-09-14T05:34:44
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,318
java
package ir.donyapardaz.niopdc.base.service.dto; import ir.donyapardaz.niopdc.base.domain.Country; import ir.donyapardaz.niopdc.base.domain.enumeration.TranshipType; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; import java.io.Serializable; import java.time.ZonedDateTime; import java.util.Objects; /** * A DTO for the Location entity. */ public class LocationWithCountryDTO implements Serializable { private Long id; @NotNull @Size(min = 3, max = 42) private String name; @NotNull private String code; @Size(min = 5, max = 20) private String costAccount; private Integer level; private Long locationId; private Boolean haveBoundarySell; private Boolean beforeControl; private ZonedDateTime day; private Boolean canOpen; private Boolean canClose; private Country country; private TranshipType transhipType; private Boolean farCountry; private Boolean pumpBeforeControl; public Long getId() { return id; } public void setId(Long id) { this.id = id; } @NotNull public String getName() { return name; } public void setName(@NotNull String name) { this.name = name; } @NotNull public String getCode() { return code; } public void setCode(@NotNull String code) { this.code = code; } public String getCostAccount() { return costAccount; } public void setCostAccount(String costAccount) { this.costAccount = costAccount; } public Integer getLevel() { return level; } public void setLevel(Integer level) { this.level = level; } public Long getLocationId() { return locationId; } public void setLocationId(Long locationId) { this.locationId = locationId; } public Boolean getHaveBoundarySell() { return haveBoundarySell; } public void setHaveBoundarySell(Boolean haveBoundarySell) { this.haveBoundarySell = haveBoundarySell; } public Boolean getBeforeControl() { return beforeControl; } public void setBeforeControl(Boolean beforeControl) { this.beforeControl = beforeControl; } public ZonedDateTime getDay() { return day; } public void setDay(ZonedDateTime day) { this.day = day; } public Boolean getCanOpen() { return canOpen; } public void setCanOpen(Boolean canOpen) { this.canOpen = canOpen; } public Boolean getCanClose() { return canClose; } public void setCanClose(Boolean canClose) { this.canClose = canClose; } public Country getCountry() { return country; } public void setCountry(Country country) { this.country = country; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; LocationWithCountryDTO that = (LocationWithCountryDTO) o; return Objects.equals(id, that.id); } @Override public int hashCode() { return Objects.hash(id); } @Override public String toString() { return "LocationDTO{" + "id=" + id + ", name='" + name + '\'' + ", code='" + code + '\'' + ", costAccount='" + costAccount + '\'' + ", level=" + level + ", locationId=" + locationId + ", haveBoundarySell=" + haveBoundarySell + ", beforeControl=" + beforeControl + ", canOpen=" + canOpen + ", canClose=" + canClose + '}'; } public TranshipType getTranshipType() { return transhipType; } public void setTranshipType(TranshipType transhipType) { this.transhipType = transhipType; } public Boolean getFarCountry() { return farCountry; } public void setFarCountry(Boolean farCountry) { this.farCountry = farCountry; } public Boolean getPumpBeforeControl() { return pumpBeforeControl; } public void setPumpBeforeControl(Boolean pumpBeforeControl) { this.pumpBeforeControl = pumpBeforeControl; } }
[ "saeidkazemi78java@gmail.com" ]
saeidkazemi78java@gmail.com
7464660517c5e01a877049554690cad17e4575bd
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Csv-13/org.apache.commons.csv.CSVPrinter/BBC-F0-opt-80/21/org/apache/commons/csv/CSVPrinter_ESTest_scaffolding.java
93062bfd685e02eb4b0639e70cd4116879dbf5e1
[ "CC-BY-4.0", "MIT" ]
permissive
pderakhshanfar/EMSE-BBC-experiment
f60ac5f7664dd9a85f755a00a57ec12c7551e8c6
fea1a92c2e7ba7080b8529e2052259c9b697bbda
refs/heads/main
2022-11-25T00:39:58.983828
2022-04-12T16:04:26
2022-04-12T16:04:26
309,335,889
0
1
null
2021-11-05T11:18:43
2020-11-02T10:30:38
null
UTF-8
Java
false
false
5,211
java
/** * Scaffolding file used to store all the setups needed to run * tests automatically generated by EvoSuite * Sat Oct 23 00:45:50 GMT 2021 */ package org.apache.commons.csv; import org.evosuite.runtime.annotation.EvoSuiteClassExclude; import org.junit.BeforeClass; import org.junit.Before; import org.junit.After; import org.junit.AfterClass; import org.evosuite.runtime.sandbox.Sandbox; import org.evosuite.runtime.sandbox.Sandbox.SandboxMode; import static org.evosuite.shaded.org.mockito.Mockito.*; @EvoSuiteClassExclude public class CSVPrinter_ESTest_scaffolding { @org.junit.Rule public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule(); private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000); @BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "org.apache.commons.csv.CSVPrinter"; org.evosuite.runtime.GuiSupport.initialize(); org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); org.evosuite.runtime.classhandling.JDKClassResetter.init(); setSystemProperties(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); try { initMocksToAvoidTimeoutsInTheTests(); } catch(ClassNotFoundException e) {} } @AfterClass public static void clearEvoSuiteFramework(){ Sandbox.resetDefaultSecurityManager(); java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); } @Before public void initTestCase(){ threadStopper.storeCurrentThreads(); threadStopper.startRecordingTime(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); setSystemProperties(); org.evosuite.runtime.GuiSupport.setHeadless(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); org.evosuite.runtime.agent.InstrumentingAgent.activate(); } @After public void doneWithTestCase(){ threadStopper.killAndJoinClientThreads(); org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); org.evosuite.runtime.classhandling.JDKClassResetter.reset(); resetClasses(); org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); } public static void setSystemProperties() { java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); java.lang.System.setProperty("user.dir", "/experiment"); java.lang.System.setProperty("java.io.tmpdir", "/tmp"); } private static void initializeClasses() { org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(CSVPrinter_ESTest_scaffolding.class.getClassLoader() , "org.apache.commons.csv.Token", "org.apache.commons.csv.Constants", "org.apache.commons.csv.CSVRecord", "org.apache.commons.csv.Assertions", "org.apache.commons.csv.QuoteMode", "org.apache.commons.csv.CSVParser$1", "org.apache.commons.csv.CSVFormat", "org.apache.commons.csv.Lexer", "org.apache.commons.csv.CSVParser", "org.apache.commons.csv.Token$Type", "org.apache.commons.csv.CSVPrinter$1", "org.apache.commons.csv.CSVPrinter", "org.apache.commons.csv.ExtendedBufferedReader" ); } private static void initMocksToAvoidTimeoutsInTheTests() throws ClassNotFoundException { mock(Class.forName("java.sql.ResultSet", false, CSVPrinter_ESTest_scaffolding.class.getClassLoader())); } private static void resetClasses() { org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(CSVPrinter_ESTest_scaffolding.class.getClassLoader()); org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses( "org.apache.commons.csv.CSVPrinter", "org.apache.commons.csv.QuoteMode", "org.apache.commons.csv.CSVPrinter$1", "org.apache.commons.csv.Assertions", "org.apache.commons.csv.Constants", "org.apache.commons.csv.CSVFormat", "org.apache.commons.csv.CSVFormat$Predefined", "org.apache.commons.csv.CSVParser", "org.apache.commons.csv.Token", "org.apache.commons.csv.Token$Type", "org.apache.commons.csv.Lexer", "org.apache.commons.csv.ExtendedBufferedReader", "org.apache.commons.csv.CSVParser$1", "org.apache.commons.csv.CSVParser$2", "org.apache.commons.csv.CSVRecord" ); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
84cfecd2da97a3803f42377e5b2d98d46d1b9723
31f85bb1c5bc4ebd069dba54c1af7aeb0d7fb9e9
/CodeGymTasks/2.JavaCore/src/com/codegym/task/task14/task1410/Solution.java
b91a8add42c3600170874a803d95d111579718de
[]
no_license
emaphis/CodeGym
0b9e43ec6ebcda42afb47bd558e0433df21e9870
6e485e7e424e4e863fabe98793d031054812edc1
refs/heads/master
2020-05-20T08:16:58.351759
2019-08-01T03:14:20
2019-08-01T03:14:20
185,470,645
0
0
null
null
null
null
UTF-8
Java
false
false
596
java
package com.codegym.task.task14.task1410; /* Wine tasting */ public class Solution { public static void main(String[] args) { getDeliciousDrink().taste(); System.out.println(getWine().getCelebrationName()); System.out.println(getBubblyWine().getCelebrationName()); System.out.println(getWine().getCelebrationName()); } public static Drink getDeliciousDrink() { return new Wine(); } public static Wine getWine() { return new Wine(); } public static Wine getBubblyWine() { return new BubblyWine(); } }
[ "emaphis85@gmail.com" ]
emaphis85@gmail.com
f25b22864fbe387b833b3d332efd7a84995effe9
bd6e48743e8c50b454ff317c605ea2ddbd83c1f1
/Java/src/array/ReverseOfArray.java
8a4a9fef32c7b98c55e3a7179dc0ba2140a9df74
[]
no_license
Ravi1071B/Java
0295e8a435b9035f058bcc26370ea4ad462106db
562b9e419bb87ddb9a0c9b310b761ed41e0ac690
refs/heads/master
2020-04-29T11:10:54.638773
2019-03-17T11:01:41
2019-03-17T11:01:41
176,088,371
0
0
null
null
null
null
UTF-8
Java
false
false
290
java
package array; public class ReverseOfArray { public static void main(String[] args) { int[]a= {10,30,50}; for(int i=a.length-1;i>=0;i--) { System.out.println(a[i]); } } }
[ "USER@USER-PC" ]
USER@USER-PC
414661ca76fddcfe1b9c7d6c40881100edd7d79d
200c5765df7b534ded63b625eafb4def0ffa209f
/week2/JDBC/PlanetJDBC/src/main/java/com/revature/util/ConnectionFactory.java
ef8a150eb1ef378a8a83c8ac8873b933e8117d3a
[]
no_license
210726-Enterprise/demos
0df7c5d5d82d7d2d0c738fa4c6082f994e50a635
88586f45853ffe5ee81c0ab4a1fac8f663232e53
refs/heads/main
2023-08-15T01:01:28.287713
2021-09-29T16:23:47
2021-09-29T16:23:47
388,905,496
3
2
null
2021-07-28T16:56:02
2021-07-23T19:25:16
Java
UTF-8
Java
false
false
668
java
package com.revature.util; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; public class ConnectionFactory { private static final String URL = "jdbc:postgresql://localhost/postgres"; // "jdbc:postgresql://[ENDPOINT]/[DATABASE]" private static final String USERNAME = "postgres"; private static final String PASSWORD = "p4ssw0rd"; private static Connection connection; public static Connection getConnection() { try { connection = DriverManager.getConnection(URL,USERNAME,PASSWORD); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return connection; } }
[ "ben.arayathel@gmail.com" ]
ben.arayathel@gmail.com
2b1cc37b9ba8c6247ab986d1d53aecb389b999c4
152c3182014590dece2c1d7ea1a9e8f5d3ad86c5
/jpa.modeler/src/io/github/jeddict/jpa/modeler/widget/flow/association/OTOAssociationFlowWidget.java
14903cfe660fddc41c40c146fe53d5e43c50f84e
[ "Apache-2.0" ]
permissive
hendrickhan/jeddict
07782f6e01d173619492a97599cba13caf0f27d5
120738750f4f99be4288399232d7ad4d2481ff4f
refs/heads/master
2020-03-19T00:27:37.150808
2018-05-14T13:48:23
2018-05-14T13:48:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,755
java
/** * Copyright 2013-2018 the original author or authors from the Jeddict project (https://jeddict.github.io/). * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package io.github.jeddict.jpa.modeler.widget.flow.association; import io.github.jeddict.jpa.modeler.initializer.JPAModelerScene; import org.netbeans.modeler.specification.model.document.IModelerScene; import static io.github.jeddict.jpa.modeler.initializer.JPAModelerUtil.OTOR_SOURCE_ANCHOR_SHAPE; import static io.github.jeddict.jpa.modeler.initializer.JPAModelerUtil.OTOR_TARGET_ANCHOR_SHAPE; import org.netbeans.modeler.anchorshape.IconAnchorShape; import org.netbeans.modeler.widget.edge.info.EdgeWidgetInfo; /** * * @author Gaurav Gupta */ public abstract class OTOAssociationFlowWidget extends AssociationFlowWidget { private static final IconAnchorShape SOURCE_ANCHOR_SHAPE = new IconAnchorShape(OTOR_SOURCE_ANCHOR_SHAPE, true); private static final IconAnchorShape TARGET_ANCHOR_SHAPE = new IconAnchorShape(OTOR_TARGET_ANCHOR_SHAPE, true); public OTOAssociationFlowWidget(JPAModelerScene scene, EdgeWidgetInfo edge) { super(scene, edge); setSourceAnchorShape(SOURCE_ANCHOR_SHAPE); setTargetAnchorShape(TARGET_ANCHOR_SHAPE); } }
[ "gaurav.gupta.jc@gmail.com" ]
gaurav.gupta.jc@gmail.com
54efa4c98f0d55712ff441c8f9e71dd24d0fbb29
a82cbd9b6f694f2b21d13553e1b39a62a9c54fa1
/AndroidApp/OpenSource/src/main/java/com/qiyei/opensource/ui/activity/MMKVDemoActivity.java
0efc295b2b3e00e21c948b331ae809297a098477
[]
no_license
qiyei2015/EssayJoke
1fe49a7b5df24bbb4ba10c3c479cbe098baf88c3
0d56594aaeb89fe98e06293e283e6354d2dec9d3
refs/heads/master
2022-03-09T08:54:25.826988
2022-02-21T09:12:22
2022-02-21T09:12:22
89,912,628
72
31
null
2019-11-11T02:25:01
2017-05-01T09:38:48
Java
UTF-8
Java
false
false
654
java
package com.qiyei.opensource.ui.activity; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.widget.TextView; import com.qiyei.opensource.R; import com.tencent.mmkv.MMKV; public class MMKVDemoActivity extends AppCompatActivity { TextView mTextView; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mmkv_demo); mTextView = findViewById(R.id.tv1); MMKV mmkv = MMKV.defaultMMKV(); mTextView.setText(mmkv.decodeString("key1")); mmkv.encode("key1","hello mmkv"); } }
[ "1273482124@qq.com" ]
1273482124@qq.com
27b45c4525cf4498c083d7e8a693174bcfe9de93
e26a8434566b1de6ea6cbed56a49fdb2abcba88b
/model-cbrf-types/src/generated/java/com/prowidesoftware/swift/model/mx/dic/SystemMigration1.java
4c0380bad9090ca550d210e85f4ce929c8a764bc
[ "Apache-2.0" ]
permissive
adilkangerey/prowide-iso20022
6476c9eb8fafc1b1c18c330f606b5aca7b8b0368
3bbbd6804eb9dc4e1440680e5f9f7a1726df5a61
refs/heads/master
2023-09-05T21:41:47.480238
2021-10-03T20:15:26
2021-10-03T20:15:26
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,297
java
package com.prowidesoftware.swift.model.mx.dic; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; import javax.xml.datatype.XMLGregorianCalendar; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** * Data about participant migration to new payment system process. * * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SystemMigration1", propOrder = { "npsPtcptInd", "plandMgrtnDt", "balRcvdInd", "mgrtd", "lastDt" }) public class SystemMigration1 { @XmlElement(name = "NPSPtcptInd") protected Boolean npsPtcptInd; @XmlElement(name = "PlandMgrtnDt") @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar plandMgrtnDt; @XmlElement(name = "BalRcvdInd") protected Boolean balRcvdInd; @XmlElement(name = "Mgrtd") protected Boolean mgrtd; @XmlElement(name = "LastDt") @XmlSchemaType(name = "dateTime") protected XMLGregorianCalendar lastDt; /** * Gets the value of the npsPtcptInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isNPSPtcptInd() { return npsPtcptInd; } /** * Sets the value of the npsPtcptInd property. * * @param value * allowed object is * {@link Boolean } * */ public SystemMigration1 setNPSPtcptInd(Boolean value) { this.npsPtcptInd = value; return this; } /** * Gets the value of the plandMgrtnDt property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getPlandMgrtnDt() { return plandMgrtnDt; } /** * Sets the value of the plandMgrtnDt property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public SystemMigration1 setPlandMgrtnDt(XMLGregorianCalendar value) { this.plandMgrtnDt = value; return this; } /** * Gets the value of the balRcvdInd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isBalRcvdInd() { return balRcvdInd; } /** * Sets the value of the balRcvdInd property. * * @param value * allowed object is * {@link Boolean } * */ public SystemMigration1 setBalRcvdInd(Boolean value) { this.balRcvdInd = value; return this; } /** * Gets the value of the mgrtd property. * * @return * possible object is * {@link Boolean } * */ public Boolean isMgrtd() { return mgrtd; } /** * Sets the value of the mgrtd property. * * @param value * allowed object is * {@link Boolean } * */ public SystemMigration1 setMgrtd(Boolean value) { this.mgrtd = value; return this; } /** * Gets the value of the lastDt property. * * @return * possible object is * {@link XMLGregorianCalendar } * */ public XMLGregorianCalendar getLastDt() { return lastDt; } /** * Sets the value of the lastDt property. * * @param value * allowed object is * {@link XMLGregorianCalendar } * */ public SystemMigration1 setLastDt(XMLGregorianCalendar value) { this.lastDt = value; return this; } @Override public String toString() { return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE); } @Override public boolean equals(Object that) { return EqualsBuilder.reflectionEquals(this, that); } @Override public int hashCode() { return HashCodeBuilder.reflectionHashCode(this); } }
[ "sebastian@prowidesoftware.com" ]
sebastian@prowidesoftware.com
f056cd90308f43e977b4a8dfbe6b9e94931898d1
eb97ee5d4f19d7bf028ae9a400642a8c644f8fe3
/tags/2008-02-22/seasar2-2.4.23/s2jdbc-gen/s2jdbc-gen-core/src/main/java/org/seasar/extension/jdbc/gen/generator/JavaCodeGeneratorImpl.java
206309f7a91d6f13471c429cb4cf5b8cffb57f48
[]
no_license
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
2,450
java
/* * Copyright 2004-2008 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.extension.jdbc.gen.generator; import java.io.File; import java.io.OutputStreamWriter; import java.io.Writer; import java.nio.charset.Charset; import org.seasar.extension.jdbc.gen.JavaCode; import org.seasar.extension.jdbc.gen.JavaCodeGenerator; import org.seasar.extension.jdbc.gen.util.ConfigurationUtil; import org.seasar.extension.jdbc.gen.util.TemplateUtil; import org.seasar.extension.jdbc.gen.util.CloseableUtil; import org.seasar.framework.util.FileOutputStreamUtil; import freemarker.template.Configuration; import freemarker.template.Template; /** * @author taedium * */ public class JavaCodeGeneratorImpl implements JavaCodeGenerator { protected Configuration configuration; protected File baseDir; protected String encoding; public JavaCodeGeneratorImpl(Configuration configuration, File baseDir, String encoding) { this.configuration = configuration; this.baseDir = baseDir; this.encoding = encoding; } public void generate(JavaCode javaCode) { makeDirsIfNecessary(javaCode.getPackageDir(baseDir)); Writer writer = openWriter(javaCode.getFile(baseDir)); try { Template template = ConfigurationUtil.getTemplate(configuration, javaCode.getTemplateName()); TemplateUtil.process(template, javaCode, writer); } finally { CloseableUtil.close(writer); } } protected void makeDirsIfNecessary(File dir) { if (!dir.exists()) { dir.mkdirs(); } } protected Writer openWriter(File file) { return new OutputStreamWriter(FileOutputStreamUtil.create(file), Charset.forName(encoding)); } }
[ "koichik@319488c0-e101-0410-93bc-b5e51f62721a" ]
koichik@319488c0-e101-0410-93bc-b5e51f62721a
1211dbefba3022be956d1e1067d3df6da936b36f
1670139698fdf0c2359478bc7f46e6e4e9589e7a
/huochebanghuozhu/src/main/java/com/zhuye/huochebanghuozhu/widget/RoundedCornerImageView.java
ce69a1fc9f330d0a9576f117c6a2fb3716bc8f77
[]
no_license
jingzhixb/huochebang
c0d5037e2cd956e55d62cabfc5975fb9666af0f1
9890e53aad6dab92c3f92fd4ea87d5e4a4f27c37
refs/heads/master
2020-03-28T01:29:56.796000
2018-09-05T11:52:54
2018-09-05T11:52:54
147,509,424
1
1
null
null
null
null
UTF-8
Java
false
false
2,379
java
package com.zhuye.huochebanghuozhu.widget; import android.content.Context; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PorterDuff.Mode; import android.graphics.PorterDuffXfermode; import android.graphics.RectF; import android.support.v7.widget.AppCompatImageView; import android.util.AttributeSet; /** * 自定义圆角图片控件 * @author HerotCulb * @E-mail herotculb@live.com * @Createtime 2014-5-27 午1:11:11 */ public class RoundedCornerImageView extends AppCompatImageView { private final float density = getContext().getResources() .getDisplayMetrics().density; private float roundness; public RoundedCornerImageView(Context context) { super(context); init(); } public RoundedCornerImageView(Context context, AttributeSet attrs) { super(context, attrs); init(); } public RoundedCornerImageView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); init(); } @Override public void draw(Canvas canvas) { final Bitmap composedBitmap; final Bitmap originalBitmap; final Canvas composedCanvas; final Canvas originalCanvas; final Paint paint; final int height; final int width; width = getWidth(); height = getHeight(); composedBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); originalBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); composedCanvas = new Canvas(composedBitmap); originalCanvas = new Canvas(originalBitmap); paint = new Paint(); paint.setAntiAlias(true); paint.setColor(Color.BLACK); super.draw(originalCanvas); composedCanvas.drawARGB(0, 0, 0, 0); composedCanvas.drawRoundRect(new RectF(0, 0, width, height), this.roundness, this.roundness, paint); paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); composedCanvas.drawBitmap(originalBitmap, 0, 0, paint); canvas.drawBitmap(composedBitmap, 0, 0, new Paint()); } public float getRoundness() { return this.roundness / this.density; } public void setRoundness(float roundness) { this.roundness = roundness * this.density; } private void init() { //括号中的数字是调整图片弧度的 调成100为圆形图片 调成15为圆角图片 setRoundness(100); } }
[ "1390056147qq.com" ]
1390056147qq.com
cc2bfb5593711124040f771510d104f5cb53b2d6
a7c16658e092b90d92dd25a51ea58b7218190df2
/src/com/jiayue/vr/seekbar/internal/compat/SeekBarCompat.java
9151d3c883d5f94c6073ee6e391a0f988b0ddbfb
[]
no_license
wzyxzy/jiayue_1.0
9450a39882b1d610032ddb4d5922d10190000eb3
a7074e6ff43bc597bfb00e608f89dd15fe40a216
refs/heads/master
2022-07-01T15:29:33.479948
2020-05-09T11:41:35
2020-05-09T11:41:35
262,558,964
0
0
null
null
null
null
UTF-8
Java
false
false
5,172
java
/* * Copyright (c) Gustavo Claramunt (AnderWeb) 2014. * * 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.jiayue.vr.seekbar.internal.compat; import android.annotation.SuppressLint; import android.content.res.ColorStateList; import android.graphics.drawable.Drawable; import android.graphics.drawable.RippleDrawable; import android.os.Build; import androidx.annotation.NonNull; import androidx.core.graphics.drawable.DrawableCompat; import android.view.View; import android.view.ViewParent; import android.widget.TextView; import com.jiayue.vr.seekbar.internal.drawable.AlmostRippleDrawable; import com.jiayue.vr.seekbar.internal.drawable.MarkerDrawable; /** * Wrapper compatibility class to call some API-Specific methods * And offer alternate procedures when possible * * @hide */ public class SeekBarCompat { /** * Sets the custom Outline provider on API>=21. * Does nothing on API<21 * * @param view * @param markerDrawable */ public static void setOutlineProvider(View view, final MarkerDrawable markerDrawable) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { SeekBarCompatDontCrash.setOutlineProvider(view, markerDrawable); } } /** * Our DiscreteSeekBar implementation uses a circular drawable on API < 21 * because we don't set it as Background, but draw it ourselves * * @param colorStateList * @return */ public static Drawable getRipple(ColorStateList colorStateList) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return SeekBarCompatDontCrash.getRipple(colorStateList); } else { return new AlmostRippleDrawable(colorStateList); } } /** * Sets the color of the seekbar ripple * @param drawable * @param colorStateList The ColorStateList the track ripple will be changed to */ @SuppressLint("NewApi") public static void setRippleColor(@NonNull Drawable drawable, ColorStateList colorStateList) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { ((RippleDrawable) drawable).setColor(colorStateList); } else { ((AlmostRippleDrawable) drawable).setColor(colorStateList); } } /** * As our DiscreteSeekBar implementation uses a circular drawable on API < 21 * we want to use the same method to set its bounds as the Ripple's hotspot bounds. * * @param drawable * @param left * @param top * @param right * @param bottom */ public static void setHotspotBounds(Drawable drawable, int left, int top, int right, int bottom) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //We don't want the full size rect, Lollipop ripple would be too big int size = (right - left) / 8; DrawableCompat.setHotspotBounds(drawable, left + size, top + size, right - size, bottom - size); } else { drawable.setBounds(left, top, right, bottom); } } /** * android.support.v4.view.ViewCompat SHOULD include this once and for all!! * But it doesn't... * * @param view * @param background */ @SuppressWarnings("deprecation") public static void setBackground(View view, Drawable background) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { SeekBarCompatDontCrash.setBackground(view, background); } else { view.setBackgroundDrawable(background); } } /** * Sets the TextView text direction attribute when possible * * @param textView * @param textDirection * @see TextView#setTextDirection(int) */ public static void setTextDirection(TextView textView, int textDirection) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { SeekBarCompatDontCrash.setTextDirection(textView, textDirection); } } public static boolean isInScrollingContainer(ViewParent p) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { return SeekBarCompatDontCrash.isInScrollingContainer(p); } return false; } public static boolean isHardwareAccelerated(View view) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { return SeekBarCompatDontCrash.isHardwareAccelerated(view); } return false; } }
[ "xzywzy@gmail.com" ]
xzywzy@gmail.com
69eb39f3237ddb300a40caa0cd75a3982997e88c
3de3dae722829727edfdd6cc3b67443a69043475
/edexOsgi/com.raytheon.uf.common.registry.schemas.iso19115/src/org/isotc211/_2005/gmx/MLProjectedCRSType.java
5307f93466b7553fef73ff2cb22be723a8998767
[ "LicenseRef-scancode-public-domain", "Apache-2.0" ]
permissive
Unidata/awips2
9aee5b7ec42c2c0a2fa4d877cb7e0b399db74acb
d76c9f96e6bb06f7239c563203f226e6a6fffeef
refs/heads/unidata_18.2.1
2023-08-18T13:00:15.110785
2023-08-09T06:06:06
2023-08-09T06:06:06
19,332,079
161
75
NOASSERTION
2023-09-13T19:06:40
2014-05-01T00:59:04
Java
UTF-8
Java
false
false
2,473
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vJAXB 2.1.10 in JDK 6 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2012.01.10 at 10:39:12 AM CST // package org.isotc211._2005.gmx; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import net.opengis.gml._3.ProjectedCRSType; /** * <p>Java class for ML_ProjectedCRS_Type complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ML_ProjectedCRS_Type"> * &lt;complexContent> * &lt;extension base="{http://www.opengis.net/gml/3.2}ProjectedCRSType"> * &lt;sequence> * &lt;element name="alternativeExpression" type="{http://www.isotc211.org/2005/gmx}CrsAlt_PropertyType" maxOccurs="unbounded"/> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ML_ProjectedCRS_Type", propOrder = { "alternativeExpression" }) public class MLProjectedCRSType extends ProjectedCRSType { @XmlElement(required = true) protected List<CrsAltPropertyType> alternativeExpression; /** * Gets the value of the alternativeExpression property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the alternativeExpression property. * * <p> * For example, to add a new item, do as follows: * <pre> * getAlternativeExpression().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link CrsAltPropertyType } * * */ public List<CrsAltPropertyType> getAlternativeExpression() { if (alternativeExpression == null) { alternativeExpression = new ArrayList<CrsAltPropertyType>(); } return this.alternativeExpression; } }
[ "mjames@unidata.ucar.edu" ]
mjames@unidata.ucar.edu
f5abc96ad8974917f358bed6663a8515c961e013
b2b4a6bab187aaa35f5bfc324f0ef07d37c8914a
/tree/L100.java
1a96a9d075e18aef9c58bac2ec62c90c46872f8e
[]
no_license
fyiyu091/Leetcode
7dd908a39bde4c019bda98038538ddcbfaf2e9c7
54c0a823cbf742f4693bb8c7824d9d67221fc5bb
refs/heads/master
2023-07-19T05:37:41.645801
2021-08-31T03:25:25
2021-08-31T03:25:25
275,048,455
0
0
null
null
null
null
UTF-8
Java
false
false
466
java
package tree; /* Check if two binary tree are the same tree */ public class L100 { public boolean isSameTree(TreeNode p, TreeNode q) { if (p == null && q == null) { return true; } if (p == null || q == null) { return false; } if (p.val == q.val) { return isSameTree(p.left, q.left) && isSameTree(p.right, q.right); } else { return false; } } }
[ "yiyu091@gmail.com" ]
yiyu091@gmail.com
170a4da23a68b238298e18b0eada3ae8a9739981
74b0f12cf4ce1ef43b38d20c9c44b3bae5ab18ff
/src/com/amarinfingroup/net/database/ItemsetDbAdapter.java
86bc03a90cf94223cf0b8796a90a7d4cb3bfee4b
[]
no_license
Achaz/AmarinGroupODKProject
bebd074388d8f40fd0cb6368937b7203340cb27e
90bbb4e5432836b46293251df61bf7caa9d364b2
refs/heads/master
2021-01-20T05:28:59.582857
2015-03-18T15:38:30
2015-03-18T15:38:30
32,467,660
0
0
null
null
null
null
UTF-8
Java
false
false
7,352
java
package com.amarinfingroup.net.database; import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import com.amarinfingroup.net.application.Collect; import android.content.ContentValues; import android.database.Cursor; import android.database.SQLException; import android.database.sqlite.SQLiteDatabase; import android.util.Log; public class ItemsetDbAdapter { public static final String KEY_ID = "_id"; private static final String TAG = "ItemsetDbAdapter"; private DatabaseHelper mDbHelper; private SQLiteDatabase mDb; private static final String DATABASE_NAME = "itemsets.db"; private static final String DATABASE_TABLE = "itemset_"; private static final int DATABASE_VERSION = 2; private static final String ITEMSET_TABLE = "itemsets"; private static final String KEY_ITEMSET_HASH = "hash"; private static final String KEY_PATH = "path"; private static final String CREATE_ITEMSET_TABLE = "create table " + ITEMSET_TABLE + " (_id integer primary key autoincrement, " + KEY_ITEMSET_HASH + " text, " + KEY_PATH + " text " + ");"; /** * This class helps open, create, and upgrade the database file. */ private static class DatabaseHelper extends ODKSQLiteOpenHelper { DatabaseHelper() { super(Collect.METADATA_PATH, DATABASE_NAME, null, DATABASE_VERSION); } @Override public void onCreate(SQLiteDatabase db) { // create table to keep track of the itemsets db.execSQL(CREATE_ITEMSET_TABLE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { Log.w(TAG, "Upgrading database from version " + oldVersion + " to " + newVersion + ", which will destroy all old data"); // first drop all of our generated itemset tables Cursor c = db.query(ITEMSET_TABLE, null, null, null, null, null, null); if (c != null) { c.move(-1); while (c.moveToNext()) { String table = c.getString(c.getColumnIndex(KEY_ITEMSET_HASH)); db.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE + table); } c.close(); } // then drop the table tracking itemsets itself db.execSQL("DROP TABLE IF EXISTS " + ITEMSET_TABLE); onCreate(db); } } public ItemsetDbAdapter() { } /** * Open the database. If it cannot be opened, try to create a new instance * of the database. If it cannot be created, throw an exception to signal * the failure * * @return this (self reference, allowing this to be chained in an * initialization call) * @throws SQLException if the database could be neither opened or created */ public ItemsetDbAdapter open() throws SQLException { mDbHelper = new DatabaseHelper(); mDb = mDbHelper.getWritableDatabase(); return this; } public void close() { mDbHelper.close(); } public boolean createTable(String formHash, String pathHash, String[] columns, String path) { StringBuilder sb = new StringBuilder(); // get md5 of the path to itemset.csv, which is unique per form // the md5 is easier to use because it doesn't have chars like '/' sb.append("create table " + DATABASE_TABLE + pathHash + " (_id integer primary key autoincrement "); for (int j = 0; j < columns.length; j++) { // add double quotes in case the column is of label:lang sb.append(" , \"" + columns[j] + "\" text "); // create database with first line } sb.append(");"); String tableCreate = sb.toString(); Log.i(TAG, "create string: " + tableCreate); mDb.execSQL(tableCreate); ContentValues cv = new ContentValues(); cv.put(KEY_ITEMSET_HASH, formHash); cv.put(KEY_PATH, path); mDb.insert(ITEMSET_TABLE, null, cv); return true; } public boolean addRow(String tableName, String[] columns, String[] newRow) { ContentValues cv = new ContentValues(); // rows don't necessarily use all the columns // but a column is guaranteed to exist for a row (or else blow up) for (int i = 0; i < newRow.length; i++) { cv.put("\"" + columns[i] + "\"", newRow[i]); } mDb.insert(DATABASE_TABLE + tableName, null, cv); return true; } public boolean tableExists(String tableName) { // select name from sqlite_master where type = 'table' String selection = "type=? and name=?"; String selectionArgs[] = { "table", DATABASE_TABLE + tableName }; Cursor c = mDb.query("sqlite_master", null, selection, selectionArgs, null, null, null); boolean exists = false; if (c.getCount() == 1) { exists = true; } c.close(); return exists; } public void beginTransaction() { mDb.execSQL("BEGIN"); } public void commit() { mDb.execSQL("COMMIT"); } public Cursor query(String hash, String selection, String[] selectionArgs) throws SQLException { Cursor mCursor = mDb.query(true, DATABASE_TABLE + hash, null, selection, selectionArgs, null, null, null, null); return mCursor; } public void dropTable(String pathHash, String path) { // drop the table mDb.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE + pathHash); // and remove the entry from the itemsets table String where = KEY_PATH + "=?"; String[] whereArgs = { path }; mDb.delete(ITEMSET_TABLE, where, whereArgs); } public Cursor getItemsets(String path) { String selection = KEY_PATH + "=?"; String[] selectionArgs = { path }; Cursor c = mDb.query(ITEMSET_TABLE, null, selection, selectionArgs, null, null, null); return c; } public void delete(String path) { Cursor c = getItemsets(path); if (c != null) { if (c.getCount() == 1) { c.moveToFirst(); String table = getMd5FromString(c.getString(c.getColumnIndex(KEY_PATH))); mDb.execSQL("DROP TABLE IF EXISTS " + DATABASE_TABLE + table); } c.close(); } String where = KEY_PATH + "=?"; String[] whereArgs = { path }; mDb.delete(ITEMSET_TABLE, where, whereArgs); } public static String getMd5FromString(String toEncode) { MessageDigest md = null; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); Log.e("MD5", e.getMessage()); } md.update(toEncode.getBytes()); byte[] digest = md.digest(); BigInteger bigInt = new BigInteger(1,digest); String hashtext = bigInt.toString(16); return hashtext; } }
[ "jtugume123@gmail.com" ]
jtugume123@gmail.com
a00b02eb30b9d26caf797885175c73a24ee4b5b5
62004846647d35151a636714ee0fc5227e073bc7
/jike2014.12.16/jike_linux4/src/jk/o1office/ddh/timer/OrderHandler.java
fa4c1f202e0e171bfeaa247b30c280db282172ec
[]
no_license
yonghai/JKWebPortal
aa86d6c02b0c9ebec148cbb7167746c108d21e37
3e591ee5d39d57b0fdb5968d9ae59fa9fbcd4931
refs/heads/master
2021-01-15T23:01:59.284192
2015-01-23T07:15:51
2015-01-23T07:15:51
28,065,308
0
0
null
null
null
null
UTF-8
Java
false
false
718
java
package jk.o1office.ddh.timer; import jk.o1office.service.OrderService; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.scheduling.quartz.QuartzJobBean; /** * 每两个小时监测一次,是否有超过一个月的订单,有则存入订单历史表中 */ public class OrderHandler{ private OrderService orderService; public OrderService getOrderService() { return orderService; } public void setOrderService(OrderService orderService) { this.orderService = orderService; } public void execute() throws Exception{ System.out.println("定时程序...start"); orderService.moveOrder(); System.out.println("定时程序...end"); } }
[ "811067920@qq.com" ]
811067920@qq.com
e7318957c0d9d1d3df624058a20fc88dd386f6e1
0e507d99762738fef65d4d3b8b3510fb88b10cf6
/src/main/java/org/bian/dto/BQCollateralExchangeInputModel.java
b117d906ea14f6fac19de72cd450f2bc7ceef228
[ "Apache-2.0" ]
permissive
bianapis/sd-customer-position-v2.0
77be7f20aa95740e4860ce3e586809f73fb51b46
bc27edce0a4851c0c9e903d95f69cffa7d39a060
refs/heads/master
2020-07-11T08:50:46.171965
2019-09-03T08:48:40
2019-09-03T08:48:40
204,495,571
0
0
null
null
null
null
UTF-8
Java
false
false
2,796
java
package org.bian.dto; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.bian.dto.BQCashflowExchangeInputModelCashflowExchangeActionRequest; import javax.validation.Valid; /** * BQCollateralExchangeInputModel */ public class BQCollateralExchangeInputModel { private String customerPositionStateInstanceReference = null; private String collateralInstanceReference = null; private Object collateralExchangeActionTaskRecord = null; private BQCashflowExchangeInputModelCashflowExchangeActionRequest collateralExchangeActionRequest = null; /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the parent Customer Position State instance * @return customerPositionStateInstanceReference **/ public String getCustomerPositionStateInstanceReference() { return customerPositionStateInstanceReference; } public void setCustomerPositionStateInstanceReference(String customerPositionStateInstanceReference) { this.customerPositionStateInstanceReference = customerPositionStateInstanceReference; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::ISO20022andUNCEFACT::Identifier general-info: Reference to the Collateral instance * @return collateralInstanceReference **/ public String getCollateralInstanceReference() { return collateralInstanceReference; } public void setCollateralInstanceReference(String collateralInstanceReference) { this.collateralInstanceReference = collateralInstanceReference; } /** * `status: Not Mapped` core-data-type-reference: BIAN::DataTypesLibrary::CoreDataTypes::UNCEFACT::Binary general-info: The exchange service call consolidated processing record * @return collateralExchangeActionTaskRecord **/ public Object getCollateralExchangeActionTaskRecord() { return collateralExchangeActionTaskRecord; } public void setCollateralExchangeActionTaskRecord(Object collateralExchangeActionTaskRecord) { this.collateralExchangeActionTaskRecord = collateralExchangeActionTaskRecord; } /** * Get collateralExchangeActionRequest * @return collateralExchangeActionRequest **/ public BQCashflowExchangeInputModelCashflowExchangeActionRequest getCollateralExchangeActionRequest() { return collateralExchangeActionRequest; } public void setCollateralExchangeActionRequest(BQCashflowExchangeInputModelCashflowExchangeActionRequest collateralExchangeActionRequest) { this.collateralExchangeActionRequest = collateralExchangeActionRequest; } }
[ "team1@bian.org" ]
team1@bian.org
b0db46078491fa4b9f91405b2c509597d262ace5
7c82db10fc0d0448460f5cd308465c555967b081
/rm-datasource/src/main/java/io/mmtx/rm/datasource/exec/PlainExecutor.java
9b27a9bc5d67448f48e4edac328ff9940695eec6
[ "Apache-2.0" ]
permissive
qq962155660/mmtx
0d1dbf24f89180f9dec893459f0a577d04a8551b
b62729f464a97f065cf5c50c8b07026ddec6246a
refs/heads/master
2022-11-24T06:17:16.308311
2020-02-05T02:06:13
2020-02-05T02:06:13
235,230,686
0
0
Apache-2.0
2022-11-16T12:26:09
2020-01-21T01:19:03
Java
UTF-8
Java
false
false
1,626
java
/* * Copyright 1999-2019 Mmtx.io Group. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package io.mmtx.rm.datasource.exec; import java.sql.Statement; import io.mmtx.rm.datasource.StatementProxy; /** * The type Plain executor. * * @author sharajava * * @param <T> the type parameter * @param <S> the type parameter */ public class PlainExecutor<T, S extends Statement> implements Executor { private StatementProxy<S> statementProxy; private StatementCallback<T, S> statementCallback; /** * Instantiates a new Plain executor. * * @param statementProxy the statement proxy * @param statementCallback the statement callback */ public PlainExecutor(StatementProxy<S> statementProxy, StatementCallback<T, S> statementCallback) { this.statementProxy = statementProxy; this.statementCallback = statementCallback; } @Override public T execute(Object... args) throws Throwable { return statementCallback.execute(statementProxy.getTargetStatement(), args); } }
[ "962155660@qq.com" ]
962155660@qq.com
d516ab9d21dcbe40f1d97f435fa473a99cca9adc
689cdf772da9f871beee7099ab21cd244005bfb2
/classes/com/android/dazhihui/ui/widget/adv/aa.java
11dad8b1f5ef7ce87341f9775f35294aef564443
[]
no_license
waterwitness/dazhihui
9353fd5e22821cb5026921ce22d02ca53af381dc
ad1f5a966ddd92bc2ac8c886eb2060d20cf610b3
refs/heads/master
2020-05-29T08:54:50.751842
2016-10-08T08:09:46
2016-10-08T08:09:46
70,314,359
2
4
null
null
null
null
UTF-8
Java
false
false
441
java
package com.android.dazhihui.ui.widget.adv; import android.graphics.Bitmap; public class aa { public Bitmap a; public int b; public aa c = null; public aa(Bitmap paramBitmap, int paramInt) { this.a = paramBitmap; this.b = paramInt; } } /* Location: E:\apk\dazhihui2\classes-dex2jar.jar!\com\android\dazhihui\ui\widget\adv\aa.class * Java compiler version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "1776098770@qq.com" ]
1776098770@qq.com
15e578b89cf9e11563295816564d29a012b4cbc7
5e3235edf3de262f4d10b9e9e1fcc3bd13d6b8b1
/Code Snippet Repository/Spring/Spring5495.java
e5ae6c5396164feb96bee4c36db3dc1ff2cd63ca
[]
no_license
saber13812002/DeepCRM
3336a244d4852a364800af3181e03e868cf6f9f5
be3e5e50e34a042d5ba7259ff5ff75c08ab32bb9
refs/heads/master
2023-03-16T00:08:06.473699
2018-04-18T05:29:50
2018-04-18T05:29:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
943
java
@Test public void findField() { Field field = ReflectionUtils.findField(TestObjectSubclassWithPublicField.class, "publicField", String.class); assertNotNull(field); assertEquals("publicField", field.getName()); assertEquals(String.class, field.getType()); assertTrue("Field should be public.", Modifier.isPublic(field.getModifiers())); field = ReflectionUtils.findField(TestObjectSubclassWithNewField.class, "prot", String.class); assertNotNull(field); assertEquals("prot", field.getName()); assertEquals(String.class, field.getType()); assertTrue("Field should be protected.", Modifier.isProtected(field.getModifiers())); field = ReflectionUtils.findField(TestObjectSubclassWithNewField.class, "name", String.class); assertNotNull(field); assertEquals("name", field.getName()); assertEquals(String.class, field.getType()); assertTrue("Field should be private.", Modifier.isPrivate(field.getModifiers())); }
[ "Qing.Mi@my.cityu.edu.hk" ]
Qing.Mi@my.cityu.edu.hk
d81cf884ff3e0e949bc99ce94099d4ad480115df
e9731ade624bfcfddeb8757eda562407d94ca8b0
/src/main/java/cn/tju/dao/PradCOldMapper.java
7a8db8dc75c9c1076a1ed9f22273dabd92862bb6
[]
no_license
bijiaha0/processData
4188cbf828b0ad563abac8802906deb7c8041177
e6f3c090a7966dc579360c72937d9f7c7d5eee66
refs/heads/master
2020-05-25T01:47:00.900344
2019-05-20T03:57:37
2019-05-20T03:57:37
187,564,258
0
0
null
null
null
null
UTF-8
Java
false
false
358
java
package cn.tju.dao; import cn.tju.pojo.PradCOld; public interface PradCOldMapper { int deleteByPrimaryKey(Integer geneId); int insert(PradCOld record); int insertSelective(PradCOld record); PradCOld selectByPrimaryKey(Integer geneId); int updateByPrimaryKeySelective(PradCOld record); int updateByPrimaryKey(PradCOld record); }
[ "jiahao.bee@gmail.com" ]
jiahao.bee@gmail.com
8e11e529f4fe05fa41c7f0e3dd493c5ca92b32f0
50023378bef26739a7037fc04759663fcc66e4a8
/Leetcode/src/main/java/hou/forwz/Leetcode/hard/PalindromePairs.java
2965f234cb2465ed0e0759ae443c147a226fe816
[]
no_license
houweitao/Leetcode
dde59bfff97daa14f4634c2e158b318ae9b47944
78035bf2b2d9dff4fb9c8f0d2a6d4db6114186ef
refs/heads/master
2020-05-21T17:54:35.721046
2016-12-20T09:11:10
2016-12-20T09:11:10
62,659,590
2
0
null
null
null
null
UTF-8
Java
false
false
4,228
java
package hou.forwz.Leetcode.hard; import java.util.*; /** * @author houweitao * @date 2016年8月9日下午10:07:00 */ public class PalindromePairs { public static void main(String[] args) { PalindromePairs pp = new PalindromePairs(); String[] words = { "a", "" }; System.out.println(pp.palindromePairsMe(words)); } public List<List<Integer>> palindromePairsMe(String[] words) { List<List<Integer>> ret = new ArrayList<>(); if (words.length < 2) return ret; Map<String, Integer> map = new HashMap<>(); for (int i = 0; i < words.length; i++) { map.put(words[i], i); } if (map.containsKey("")) { for (int i = 0; i < words.length; i++) { if (words[i].equals("")) continue; if (isPalindrome(words[i])) { List<Integer> tmp = new ArrayList<>(); tmp.add(map.get("")); tmp.add(i); ret.add(tmp); List<Integer> tmp2 = new ArrayList<>(); tmp2.add(i); tmp2.add(map.get("")); ret.add(tmp2); } } } map.remove(""); for (int i = 0; i < words.length; i++) { String cur = words[i]; for (int j = 0; j <= cur.length(); j++) { String left = cur.substring(0, j); String right = cur.substring(j); if (isPalindrome(left)) { String need = new StringBuffer(right).reverse().toString(); if (map.containsKey(need)) { List<Integer> tmp = new ArrayList<>(); int pos = map.get(need); if (pos == i) continue; tmp.add(pos); tmp.add(i); ret.add(tmp); } } if (isPalindrome(right)) { String need = new StringBuffer(left).reverse().toString(); if (map.containsKey(need)) { List<Integer> tmp = new ArrayList<>(); int pos = map.get(need); if (pos == i) continue; tmp.add(i); tmp.add(pos); ret.add(tmp); } } } } return ret; } public List<List<Integer>> palindromePairs(String[] words) { List<List<Integer>> pairs = new LinkedList<>(); if (words == null) return pairs; HashMap<String, Integer> map = new HashMap<>(); for (int i = 0; i < words.length; ++i) map.put(words[i], i); for (int i = 0; i < words.length; ++i) { int l = 0, r = 0; while (l <= r) { String s = words[i].substring(l, r); Integer j = map.get(new StringBuilder(s).reverse().toString()); if (j != null && i != j && isPalindrome(words[i].substring(l == 0 ? r : 0, l == 0 ? words[i].length() : l))) pairs.add(Arrays.asList(l == 0 ? new Integer[] { i, j } : new Integer[] { j, i })); if (r < words[i].length()) ++r; else ++l; } } return pairs; } public List<List<Integer>> palindromePairs2(String[] words) { List<List<Integer>> ret = new ArrayList<>(); if (words == null || words.length < 2) return ret; Map<String, Integer> map = new HashMap<String, Integer>(); for (int i = 0; i < words.length; i++) map.put(words[i], i); for (int i = 0; i < words.length; i++) { // System.out.println(words[i]); for (int j = 0; j <= words[i].length(); j++) { // notice it should // be "j <= // words[i].length()" String str1 = words[i].substring(0, j); String str2 = words[i].substring(j); if (isPalindrome(str1)) { String str2rvs = new StringBuilder(str2).reverse().toString(); if (map.containsKey(str2rvs) && map.get(str2rvs) != i) { List<Integer> list = new ArrayList<Integer>(); list.add(map.get(str2rvs)); list.add(i); ret.add(list); // System.out.printf("isPal(str1): %s\n", // list.toString()); } } if (isPalindrome(str2)) { String str1rvs = new StringBuilder(str1).reverse().toString(); // check "str.length() != 0" to avoid duplicates if (map.containsKey(str1rvs) && map.get(str1rvs) != i && str2.length() != 0) { List<Integer> list = new ArrayList<Integer>(); list.add(i); list.add(map.get(str1rvs)); ret.add(list); // System.out.printf("isPal(str2): %s\n", // list.toString()); } } } } return ret; } private boolean isPalindrome(String s) { for (int i = 0; i < s.length() / 2; ++i) if (s.charAt(i) != s.charAt(s.length() - 1 - i)) return false; return true; } }
[ "hou103880@163.com" ]
hou103880@163.com
1c59fd519bc8e1c8ebe897428943d7d508f2a7ea
e64c2201c1cf2adf9197c77aab2676670de9bf4c
/src/main/java/leetcode/Count_of_Range_Sum.java
7cffe9ec0f6e84e95d1716f01860c3ff2a9034dc
[]
no_license
zengxianbing/JavaStudy
45016f3910606988403f16bd1b5f0e60d52de7b2
9a4593cf4b6f79ada4677bdd87a045ff04ee721a
refs/heads/master
2020-04-06T04:29:17.203382
2016-07-04T01:11:47
2016-07-04T01:11:47
62,491,476
0
0
null
null
null
null
UTF-8
Java
false
false
1,002
java
package leetcode; /** * Title: <br> * <p/> * Description: <br> * <p/> * Created by zengxianbing on 2016/1/11. * * @author <a href=mailto:zengxianbing163@163.com>曾宪兵</a> */ public class Count_of_Range_Sum { public static int countRangeSum(int[] nums,int lower,int upper) { if(nums.length==0) return 0; long[] sum = new long[nums.length + 1]; for (int i = 0; i < nums.length; i++) { sum[i+1]=sum[i]+nums[i]; System.out.println("sum[i+1]:"+sum[i+1]+"sum[i]:"+sum[i]+"nums[i]:"+nums[i]); } int ans=0; for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j <= nums.length; j++) { if (lower <= sum[j] - sum[i] && sum[j] - sum[i] <= upper) { ans++; } } } return ans; } public static void main(String[] args) { countRangeSum(new int[]{-2, 5, -1},-2,2); } }
[ "1121466030@qq.com" ]
1121466030@qq.com
d7d94a1536e8a6b61c2a7a5aaed8a5d40f041543
75c4712ae3f946db0c9196ee8307748231487e4b
/src/main/java/com/alipay/api/domain/FileSignature.java
fab6b11b100b2820ebfd0e1142a5e27eedb469bc
[ "Apache-2.0" ]
permissive
yuanbaoMarvin/alipay-sdk-java-all
70a72a969f464d79c79d09af8b6b01fa177ac1be
25f3003d820dbd0b73739d8e32a6093468d9ed92
refs/heads/master
2023-06-03T16:54:25.138471
2021-06-25T14:48:21
2021-06-25T14:48:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,008
java
package com.alipay.api.domain; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; /** * 签约文件签章描述信息 * * @author auto create * @since 1.0, 2017-12-20 15:24:35 */ public class FileSignature extends AlipayObject { private static final long serialVersionUID = 6359229291669199547L; /** * 签约主体证件号,关联principal对象 */ @ApiField("cert_no") private String certNo; /** * 图章id/图章模板id */ @ApiField("seal_id") private String sealId; /** * 签章位置描述 */ @ApiField("seal_position") private SealPosition sealPosition; /** * 电子图章类型 1 : 图章模板自动合成 2 : 托管图章编号 */ @ApiField("seal_type") private Long sealType; /** * 签约原因描述,可展示在PDF签名区 */ @ApiField("sign_reason") private String signReason; /** * 电子签章类型 1:仅数字证书文档签名 2:仅图章 3:数字证书文档签名,加盖图章 */ @ApiField("signature_type") private Long signatureType; public String getCertNo() { return this.certNo; } public void setCertNo(String certNo) { this.certNo = certNo; } public String getSealId() { return this.sealId; } public void setSealId(String sealId) { this.sealId = sealId; } public SealPosition getSealPosition() { return this.sealPosition; } public void setSealPosition(SealPosition sealPosition) { this.sealPosition = sealPosition; } public Long getSealType() { return this.sealType; } public void setSealType(Long sealType) { this.sealType = sealType; } public String getSignReason() { return this.signReason; } public void setSignReason(String signReason) { this.signReason = signReason; } public Long getSignatureType() { return this.signatureType; } public void setSignatureType(Long signatureType) { this.signatureType = signatureType; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
259e934859c29ccee6258b5f7d803101724aec59
84c6f89a168610f5cdbf2e5208065b2db217d095
/library/src/main/java/com/daimajia/slider/library/Tricks/InfinitePagerAdapter.java
4b4fa7805a61d56927ecc5823282d4be91e05732
[]
no_license
EzzalddeenAli/android-rapid
8834f326ee92ede592d0c3d1c9a1f358ff38d3af
c7ed421cb3e10481f83f8d5ac14e00dd52b8cdb2
refs/heads/master
2020-12-02T09:31:10.008363
2018-05-21T08:43:45
2018-05-21T08:43:45
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,034
java
package com.daimajia.slider.library.Tricks; import android.os.Parcelable; import android.support.v4.view.PagerAdapter; import android.util.Log; import android.view.View; import android.view.ViewGroup; import com.daimajia.slider.library.SliderAdapter; /** * A PagerAdapter that wraps around another PagerAdapter to handle paging wrap-around. * Thanks to: https://github.com/antonyt/InfiniteViewPager */ public class InfinitePagerAdapter extends PagerAdapter { private static final String TAG = "InfinitePagerAdapter"; private static final boolean DEBUG = false; private SliderAdapter adapter; public InfinitePagerAdapter(SliderAdapter adapter) { this.adapter = adapter; } public SliderAdapter getRealAdapter(){ return this.adapter; } @Override public int getCount() { // warning: scrolling to very high values (1,000,000+) results in // strange drawing behaviour return Integer.MAX_VALUE; } /** * @return the {@link #getCount()} result of the wrapped adapter */ public int getRealCount() { return adapter.getCount(); } @Override public int getItemPosition(Object object) { return POSITION_NONE; } @Override public Object instantiateItem(ViewGroup container, int position) { if(getRealCount() == 0){ return null; } int virtualPosition = position % getRealCount(); debug("instantiateItem: real position: " + position); debug("instantiateItem: virtual position: " + virtualPosition); // only expose virtual position to the inner adapter return adapter.instantiateItem(container, virtualPosition); } @Override public void destroyItem(ViewGroup container, int position, Object object) { if(getRealCount() == 0){ return; } int virtualPosition = position % getRealCount(); debug("destroyItem: real position: " + position); debug("destroyItem: virtual position: " + virtualPosition); // only expose virtual position to the inner adapter adapter.destroyItem(container, virtualPosition, object); } /* * Delegate rest of methods directly to the inner adapter. */ @Override public void finishUpdate(ViewGroup container) { adapter.finishUpdate(container); } @Override public boolean isViewFromObject(View view, Object object) { return adapter.isViewFromObject(view, object); } @Override public void restoreState(Parcelable bundle, ClassLoader classLoader) { adapter.restoreState(bundle, classLoader); } @Override public Parcelable saveState() { return adapter.saveState(); } @Override public void startUpdate(ViewGroup container) { adapter.startUpdate(container); } /* * End delegation */ private void debug(String message) { if (DEBUG) { Log.d(TAG, message); } } }
[ "642404044@qq.com" ]
642404044@qq.com
e376ba7f3b0394cb3afa5d445021e81bc596e347
dc1dbb7e5a4b95bf44170d2f51fd08b3814f2ac9
/data_defect4j/preprossed_method_corpus/Time/23/org/joda/time/DateTimeComparator_toString_243.java
3c849ee0ecff03d9de9dbc9f4787187e488fbc51
[]
no_license
hvdthong/NetML
dca6cf4d34c5799b400d718e0a6cd2e0b167297d
9bb103da21327912e5a29cbf9be9ff4d058731a5
refs/heads/master
2021-06-30T15:03:52.618255
2020-10-07T01:58:48
2020-10-07T01:58:48
150,383,588
1
1
null
2018-09-26T07:08:45
2018-09-26T07:08:44
null
UTF-8
Java
false
false
991
java
org joda time date time compar datetimecompar compar compar date date object recognis link org joda time convert convert manag convertermanag convert manag convertermanag object recognis compar readabl instant readableinst string calendar date long millisecond date time compar datetimecompar thread safe immut author gui allard author stephen colebourn author brian neill o'neil date time compar datetimecompar compar object serializ debug string debug string string string tostr lower limit ilowerlimit upper limit iupperlimit date time compar datetimecompar lower limit ilowerlimit lower limit ilowerlimit getnam date time compar datetimecompar lower limit ilowerlimit lower limit ilowerlimit getnam upper limit iupperlimit upper limit iupperlimit getnam
[ "hvdthong@gmail.com" ]
hvdthong@gmail.com
b91ff071fbc6b5338001d3259c7e94f9b4d312cc
8afb5afd38548c631f6f9536846039ef6cb297b9
/_OVERFLOW/Resource-Store/01_Questions/_JAVA/349_Intersection_of_Two_Arrays.java
8cd389dc0c33de0b3178406e2590ac4153803346
[ "MIT" ]
permissive
bgoonz/UsefulResourceRepo2.0
d87588ffd668bb498f7787b896cc7b20d83ce0ad
2cb4b45dd14a230aa0e800042e893f8dfb23beda
refs/heads/master
2023-03-17T01:22:05.254751
2022-08-11T03:18:22
2022-08-11T03:18:22
382,628,698
10
12
MIT
2022-10-10T14:13:54
2021-07-03T13:58:52
null
UTF-8
Java
false
false
608
java
class Solution { public int[] intersection(int[] nums1, int[] nums2) { Set<Integer> set = new HashSet<>(); Set<Integer> intersection = new HashSet<>(); for (int i = 0; i < nums1.length; i++) { set.add(nums1[i]); } for (int i = 0; i < nums2.length; i++) { if (set.contains(nums2[i])) { intersection.add(nums2[i]); } } int[] result = new int[intersection.size()]; int idx = 0; for (int i : intersection) { result[idx++] = i; } return result; } }
[ "bryan.guner@gmail.com" ]
bryan.guner@gmail.com
e805e9f6ae6329f331af0a049070a89762ac986b
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/25/25_44b331d4d1aa130de382db98da224cd0ee9d80f6/CmsNewsletterResourcesCollector/25_44b331d4d1aa130de382db98da224cd0ee9d80f6_CmsNewsletterResourcesCollector_s.java
16ce40f891168c5f7ffc651796ee305e37a7abf1
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
5,872
java
/* * File : $Source: /alkacon/cvs/alkacon/com.alkacon.opencms.newsletter/src/com/alkacon/opencms/newsletter/admin/CmsNewsletterResourcesCollector.java,v $ * Date : $Date: 2007/11/30 11:57:27 $ * Version: $Revision: 1.8 $ * * This file is part of the Alkacon OpenCms Add-On Module Package * * Copyright (c) 2007 Alkacon Software GmbH (http://www.alkacon.com) * * The Alkacon OpenCms Add-On Module Package 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. * * The Alkacon OpenCms Add-On Module Package 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 the Alkacon OpenCms Add-On Module Package. * If not, see http://www.gnu.org/licenses/. * * For further information about Alkacon Software GmbH, please see the * company website: http://www.alkacon.com. * * For further information about OpenCms, please see the * project website: http://www.opencms.org. */ package com.alkacon.opencms.newsletter.admin; import com.alkacon.opencms.newsletter.CmsNewsletterMailData; import com.alkacon.opencms.newsletter.CmsNewsletterManager; import org.opencms.file.CmsGroup; import org.opencms.file.CmsObject; import org.opencms.file.CmsProperty; import org.opencms.file.CmsResourceFilter; import org.opencms.main.CmsException; import org.opencms.main.CmsIllegalArgumentException; import org.opencms.main.OpenCms; import org.opencms.util.CmsStringUtil; import org.opencms.util.CmsUUID; import org.opencms.workplace.explorer.CmsResourceUtil; import org.opencms.workplace.list.A_CmsListExplorerDialog; import org.opencms.workplace.list.A_CmsListResourceCollector; import org.opencms.workplace.list.CmsListItem; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; /** * Collector for newsletters.<p> * * @author Andreas Zahner * * @version $Revision $ * * @since 7.0.3 */ public class CmsNewsletterResourcesCollector extends A_CmsListResourceCollector { /** Parameter of the default collector name. */ public static final String COLLECTOR_NAME = "newsletterresources"; /** * Constructor, creates a new instance.<p> * * @param wp the workplace object */ public CmsNewsletterResourcesCollector(A_CmsListExplorerDialog wp) { super(wp); } /** * @see org.opencms.file.collectors.I_CmsResourceCollector#getCollectorNames() */ public List getCollectorNames() { List names = new ArrayList(); names.add(COLLECTOR_NAME); return names; } /** * @see org.opencms.workplace.list.A_CmsListResourceCollector#getResources(org.opencms.file.CmsObject, java.util.Map) */ public List getResources(CmsObject cms, Map params) throws CmsException { String typeName = CmsNewsletterMailData.RESOURCETYPE_NEWSLETTER_NAME; try { typeName = CmsNewsletterManager.getMailDataResourceTypeName(); } catch (Exception e) { // should never happen } int typeId = OpenCms.getResourceManager().getResourceType(typeName).getTypeId(); CmsResourceFilter filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireType(typeId); return cms.readResources("/", filter, true); } /** * @see org.opencms.workplace.list.A_CmsListResourceCollector#setAdditionalColumns(org.opencms.workplace.list.CmsListItem, org.opencms.workplace.explorer.CmsResourceUtil) */ protected void setAdditionalColumns(CmsListItem item, CmsResourceUtil resUtil) { // set the column data for the newsletter send info if present String value = ""; try { CmsProperty property = resUtil.getCms().readPropertyObject( (String)item.get(A_CmsListExplorerDialog.LIST_COLUMN_NAME), CmsNewsletterManager.PROPERTY_NEWSLETTER_DATA, false); value = property.getValue(); if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) { // format the information List vals = CmsStringUtil.splitAsList(value, CmsProperty.VALUE_LIST_DELIMITER); Date date = new Date(Long.parseLong((String)vals.get(0))); String groupId = (String)vals.get(1); String groupName = ""; try { CmsGroup group = resUtil.getCms().readGroup(new CmsUUID(groupId)); groupName = group.getSimpleName(); } catch (CmsException e) { // group does not exist groupName = Messages.get().getBundle(getWp().getLocale()).key(Messages.GUI_NEWSLETTER_LIST_DATA_SEND_GROUPDUMMY_0); } value = Messages.get().getBundle(getWp().getLocale()).key(Messages.GUI_NEWSLETTER_LIST_DATA_SEND_AT_2, date, groupName); } else { // show the "never sent" message value = Messages.get().getBundle(getWp().getLocale()).key(Messages.GUI_NEWSLETTER_LIST_DATA_SEND_NEVER_0); } } catch (CmsException e) { // should never happen } try { item.set(CmsNewsletterListSend.LIST_COLUMN_DATA, value); } catch (CmsIllegalArgumentException e) { // column not present, ignore } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
abbb2b68b7107efe35055f7a66cf1f12da41d210
41d16fe73f95e5ab86b0b087198356c331d13424
/lib_common/src/main/java/com/qunar/im/base/module/AvailableRoomResponse.java
3ef290887dba961684855e3fdaddb9f183da5715
[]
no_license
forgetW/farady_im
eb116b70bafd819936af40af6149eb6f7789bf79
d0c59f99c195a85fab3624211871c54e79ebf8cf
refs/heads/main
2023-05-03T22:33:33.090405
2021-05-11T08:46:04
2021-05-11T08:46:04
366,306,354
0
0
null
null
null
null
UTF-8
Java
false
false
2,383
java
package com.qunar.im.base.module; import java.util.List; public class AvailableRoomResponse { /** * ret : true * errcode : 0 * errmsg : * data : [{"description":"白板、会服物资","roomName":"印度洋","capacity":8,"roomId":13,"canUse":0},{"description":"白板、会服物资","roomName":"太平洋","capacity":8,"roomId":12,"canUse":0},{"description":"白板、会服物资","roomName":"北冰洋","capacity":6,"roomId":11,"canUse":0}] */ private boolean ret; private int errcode; private String errmsg; private List<DataBean> data; public boolean isRet() { return ret; } public void setRet(boolean ret) { this.ret = ret; } public int getErrcode() { return errcode; } public void setErrcode(int errcode) { this.errcode = errcode; } public String getErrmsg() { return errmsg; } public void setErrmsg(String errmsg) { this.errmsg = errmsg; } public List<DataBean> getData() { return data; } public void setData(List<DataBean> data) { this.data = data; } public static class DataBean { /** * description : 白板、会服物资 * roomName : 印度洋 * capacity : 8 * roomId : 13 * canUse : 0 */ private String description; private String roomName; private int capacity; private int roomId; private int canUse; public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getRoomName() { return roomName; } public void setRoomName(String roomName) { this.roomName = roomName; } public int getCapacity() { return capacity; } public void setCapacity(int capacity) { this.capacity = capacity; } public int getRoomId() { return roomId; } public void setRoomId(int roomId) { this.roomId = roomId; } public int getCanUse() { return canUse; } public void setCanUse(int canUse) { this.canUse = canUse; } } }
[ "503425930@qq.com" ]
503425930@qq.com
f6a43c82ca1366913e3ec2c4c6d91e76f0b4fe35
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/16/16_c18b699c60ee5cd8ca940b5926594b09d4a532e6/TransactionStartCommand/16_c18b699c60ee5cd8ca940b5926594b09d4a532e6_TransactionStartCommand_t.java
3c000af6af47a55dda69b8a9850a80444e65650c
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
2,196
java
/** * Copyright 2013 Red Hat, Inc. and/or its affiliates. * * Licensed under the Eclipse Public License version 1.0, available at * http://www.eclipse.org/legal/epl-v10.html */ package org.jboss.forge.addon.shell.command.transaction; import javax.inject.Inject; import org.jboss.forge.addon.resource.ResourceFactory; import org.jboss.forge.addon.resource.transaction.ResourceTransaction; import org.jboss.forge.addon.shell.ui.AbstractShellCommand; import org.jboss.forge.addon.ui.context.UIBuilder; import org.jboss.forge.addon.ui.context.UIContext; import org.jboss.forge.addon.ui.context.UIExecutionContext; import org.jboss.forge.addon.ui.input.UIInput; import org.jboss.forge.addon.ui.metadata.UICommandMetadata; import org.jboss.forge.addon.ui.metadata.WithAttributes; import org.jboss.forge.addon.ui.result.Result; import org.jboss.forge.addon.ui.result.Results; import org.jboss.forge.addon.ui.util.Metadata; /** * Starts a {@link ResourceTransaction} * * @author <a href="ggastald@redhat.com">George Gastaldi</a> */ public class TransactionStartCommand extends AbstractShellCommand { @Inject ResourceFactory resourceFactory; @Inject @WithAttributes(label = "Timeout", shortName = 't', defaultValue = "0") private UIInput<Integer> timeout; @Override public UICommandMetadata getMetadata(UIContext context) { return Metadata.from(super.getMetadata(context), getClass()).name("transaction-start") .description("Starts a transaction"); } @Override public void initializeUI(UIBuilder builder) throws Exception { builder.add(timeout); } @Override public Result execute(UIExecutionContext shellContext) throws Exception { ResourceTransaction transaction = resourceFactory.getTransaction(); if (transaction.isStarted()) { return Results.fail("Resource Transaction is already started"); } if (timeout.getValue() != null) { transaction.setTransactionTimeout(timeout.getValue()); } transaction.begin(); return Results.success("Resource Transaction started"); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
ee785f48dd1a4939053cae1961d73e79a5165896
026f78c99f0fdd18285a13c18e8678d543fe6d39
/src/main/java/org/bukkit/entity/Spider.java
1e0edc04f3adc31b5fec6eacbc4d591a67fc008e
[]
no_license
Meaglin/Buck---It
a1cd0eda82c5b2751903fe9b74badbd6dff09d40
9193f453187e4264c8c566f30fb337439a7e0e32
refs/heads/master
2021-01-15T21:45:17.938326
2011-10-14T01:10:56
2011-10-14T01:10:56
1,342,201
3
0
null
null
null
null
UTF-8
Java
false
false
156
java
/** * */ package org.bukkit.entity; /** * Represents a Spider. * * @author Cogito * */ public interface Spider extends Monster { }
[ "dinnerbone@dinnerbone.com" ]
dinnerbone@dinnerbone.com
ed507999d2f3d8873ca61910ca0d1d31a36808c7
805b2a791ec842e5afdd33bb47ac677b67741f78
/Mage.Sets/src/mage/sets/mastersedition/JacquesLeVert.java
6bfcfe53193a834834aabf2d12c6f93252a6c21d
[]
no_license
klayhamn/mage
0d2d3e33f909b4052b0dfa58ce857fbe2fad680a
5444b2a53beca160db2dfdda0fad50e03a7f5b12
refs/heads/master
2021-01-12T19:19:48.247505
2015-08-04T20:25:16
2015-08-04T20:25:16
39,703,242
2
0
null
2015-07-25T21:17:43
2015-07-25T21:17:42
null
UTF-8
Java
false
false
2,181
java
/* * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are * permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``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 BetaSteward_at_googlemail.com 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. * * The views and conclusions contained in the software and documentation are those of the * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ package mage.sets.mastersedition; import java.util.UUID; /** * * @author LevelX2 */ public class JacquesLeVert extends mage.sets.legends.JacquesLeVert { public JacquesLeVert(UUID ownerId) { super(ownerId); this.cardNumber = 147; this.expansionSetCode = "MED"; } public JacquesLeVert(final JacquesLeVert card) { super(card); } @Override public JacquesLeVert copy() { return new JacquesLeVert(this); } }
[ "ludwig.hirth@online.de" ]
ludwig.hirth@online.de
3717a25074f6042a8eefacaaf07c7de4b44b3d1c
f9c19d5c06467ae091cc123caefeaa76c43a5ae2
/src/test/java/com/firstdev/stdmng/web/rest/errors/ExceptionTranslatorIntTest.java
d29d9a5898b4cd2c00acdc9d7fcc16a6f21289dd
[]
no_license
limingjia74110/jhipster-sample-application
dd9bfac70026fac4e3408547343d8142af4e5a85
eb2907dd2371b38c56e5bcfe06738dec2e7e3a46
refs/heads/master
2020-03-24T13:01:55.393122
2018-07-29T05:15:07
2018-07-29T05:15:07
142,732,900
0
0
null
null
null
null
UTF-8
Java
false
false
6,533
java
package com.firstdev.stdmng.web.rest.errors; import com.firstdev.stdmng.JhipsterSampleApplicationApp; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.http.MediaType; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.zalando.problem.spring.web.advice.MediaTypes; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** * Test class for the ExceptionTranslator controller advice. * * @see ExceptionTranslator */ @RunWith(SpringRunner.class) @SpringBootTest(classes = JhipsterSampleApplicationApp.class) public class ExceptionTranslatorIntTest { @Autowired private ExceptionTranslatorTestController controller; @Autowired private ExceptionTranslator exceptionTranslator; @Autowired private MappingJackson2HttpMessageConverter jacksonMessageConverter; private MockMvc mockMvc; @Before public void setup() { mockMvc = MockMvcBuilders.standaloneSetup(controller) .setControllerAdvice(exceptionTranslator) .setMessageConverters(jacksonMessageConverter) .build(); } @Test public void testConcurrencyFailure() throws Exception { mockMvc.perform(get("/test/concurrency-failure")) .andExpect(status().isConflict()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_CONCURRENCY_FAILURE)); } @Test public void testMethodArgumentNotValid() throws Exception { mockMvc.perform(post("/test/method-argument").content("{}").contentType(MediaType.APPLICATION_JSON)) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value(ErrorConstants.ERR_VALIDATION)) .andExpect(jsonPath("$.fieldErrors.[0].objectName").value("testDTO")) .andExpect(jsonPath("$.fieldErrors.[0].field").value("test")) .andExpect(jsonPath("$.fieldErrors.[0].message").value("NotNull")); } @Test public void testParameterizedError() throws Exception { mockMvc.perform(get("/test/parameterized-error")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.param0").value("param0_value")) .andExpect(jsonPath("$.params.param1").value("param1_value")); } @Test public void testParameterizedError2() throws Exception { mockMvc.perform(get("/test/parameterized-error2")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("test parameterized error")) .andExpect(jsonPath("$.params.foo").value("foo_value")) .andExpect(jsonPath("$.params.bar").value("bar_value")); } @Test public void testMissingServletRequestPartException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-part")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testMissingServletRequestParameterException() throws Exception { mockMvc.perform(get("/test/missing-servlet-request-parameter")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")); } @Test public void testAccessDenied() throws Exception { mockMvc.perform(get("/test/access-denied")) .andExpect(status().isForbidden()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.403")) .andExpect(jsonPath("$.detail").value("test access denied!")); } @Test public void testUnauthorized() throws Exception { mockMvc.perform(get("/test/unauthorized")) .andExpect(status().isUnauthorized()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.401")) .andExpect(jsonPath("$.path").value("/test/unauthorized")) .andExpect(jsonPath("$.detail").value("test authentication failed!")); } @Test public void testMethodNotSupported() throws Exception { mockMvc.perform(post("/test/access-denied")) .andExpect(status().isMethodNotAllowed()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.405")) .andExpect(jsonPath("$.detail").value("Request method 'POST' not supported")); } @Test public void testExceptionWithResponseStatus() throws Exception { mockMvc.perform(get("/test/response-status")) .andExpect(status().isBadRequest()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.400")) .andExpect(jsonPath("$.title").value("test response status")); } @Test public void testInternalServerError() throws Exception { mockMvc.perform(get("/test/internal-server-error")) .andExpect(status().isInternalServerError()) .andExpect(content().contentType(MediaTypes.PROBLEM)) .andExpect(jsonPath("$.message").value("error.http.500")) .andExpect(jsonPath("$.title").value("Internal Server Error")); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
d548ff9107c11517f1f717e61d954f604c19f727
774d36285e48bd429017b6901a59b8e3a51d6add
/sources/com/criteo/publisher/p057p/C2499a.java
c1aeeb9490469459e62d1802057a13f15cfcff41
[]
no_license
jorge-luque/hb
83c086851a409e7e476298ffdf6ba0c8d06911db
b467a9af24164f7561057e5bcd19cdbc8647d2e5
refs/heads/master
2023-08-25T09:32:18.793176
2020-10-02T11:02:01
2020-10-02T11:02:01
300,586,541
0
0
null
null
null
null
UTF-8
Java
false
false
785
java
package com.criteo.publisher.p057p; import android.content.ComponentName; import android.webkit.WebView; import android.webkit.WebViewClient; import com.criteo.publisher.C2387i; /* renamed from: com.criteo.publisher.p.a */ public class C2499a extends WebViewClient { /* renamed from: a */ private final C2502c f7989a; /* renamed from: b */ private final ComponentName f7990b; /* renamed from: c */ private final C2500b f7991c = C2387i.m9085U().mo10257J(); public C2499a(C2502c cVar, ComponentName componentName) { this.f7989a = cVar; this.f7990b = componentName; } public boolean shouldOverrideUrlLoading(WebView webView, String str) { this.f7991c.mo10507a(str, this.f7990b, this.f7989a); return true; } }
[ "jorge.luque@taiger.com" ]
jorge.luque@taiger.com
1824dc5bd009193ba9bc9f7955906d8a47245433
b52fa223f54b51cc271e1cbfc4c28aa76e734718
/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/extraction/utils/TemplateUtils.java
a6f22c2d21f243802d7782445ef38c04782da8f2
[ "ISC", "Apache-2.0", "BSD-3-Clause", "OFL-1.1" ]
permissive
itharavi/flink
1d0b7e711df93d3a13eae42da71a08dc45aaf71f
f0f9343a35ff21017e2406614b34a9b1f2712330
refs/heads/master
2023-08-03T02:53:12.278756
2020-01-08T05:58:54
2020-01-10T15:51:31
233,090,272
3
1
Apache-2.0
2023-07-23T02:28:35
2020-01-10T16:47:58
null
UTF-8
Java
false
false
5,114
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.flink.table.types.extraction.utils; import org.apache.flink.annotation.Internal; import org.apache.flink.table.annotation.FunctionHint; import org.apache.flink.table.catalog.DataTypeLookup; import org.apache.flink.table.functions.UserDefinedFunction; import javax.annotation.Nullable; import java.lang.reflect.Method; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; import static org.apache.flink.table.types.extraction.utils.ExtractionUtils.collectAnnotationsOfClass; import static org.apache.flink.table.types.extraction.utils.ExtractionUtils.collectAnnotationsOfMethod; import static org.apache.flink.table.types.extraction.utils.ExtractionUtils.extractionError; /** * Utilities for extracting and dealing with templates. */ @Internal final class TemplateUtils { /** * Retrieve global templates from function class. */ static Set<FunctionTemplate> extractGlobalFunctionTemplates( DataTypeLookup lookup, Class<? extends UserDefinedFunction> function) { return asFunctionTemplates(lookup, collectAnnotationsOfClass(FunctionHint.class, function)); } /** * Retrieve local templates from function method. */ static Set<FunctionTemplate> extractLocalFunctionTemplates(DataTypeLookup lookup, Method method) { return asFunctionTemplates(lookup, collectAnnotationsOfMethod(FunctionHint.class, method)); } /** * Converts {@link FunctionHint}s to {@link FunctionTemplate}. */ static Set<FunctionTemplate> asFunctionTemplates(DataTypeLookup lookup, Set<FunctionHint> hints) { return hints.stream() .map(hint -> { try { return FunctionTemplate.fromAnnotation(lookup, hint); } catch (Throwable t) { throw extractionError(t, "Error in function hint annotation."); } }) .collect(Collectors.toSet()); } /** * Find a template that only specifies a result. */ static Set<FunctionResultTemplate> findResultOnlyTemplates( Set<FunctionTemplate> functionTemplates, Function<FunctionTemplate, FunctionResultTemplate> accessor) { return functionTemplates.stream() .filter(t -> t.getSignatureTemplate() == null && accessor.apply(t) != null) .map(accessor) .collect(Collectors.toSet()); } /** * Hints that only declare a result (either accumulator or output). */ static @Nullable FunctionResultTemplate findResultOnlyTemplate( Set<FunctionResultTemplate> globalResultOnly, Set<FunctionResultTemplate> localResultOnly, Set<FunctionTemplate> explicitMappings, Function<FunctionTemplate, FunctionResultTemplate> accessor) { final Set<FunctionResultTemplate> resultOnly = Stream.concat( globalResultOnly.stream(), localResultOnly.stream()) .collect(Collectors.toSet()); final Set<FunctionResultTemplate> allResults = Stream.concat( resultOnly.stream(), explicitMappings.stream().map(accessor)) .collect(Collectors.toSet()); if (resultOnly.size() == 1 && allResults.size() == 1) { return resultOnly.stream().findFirst().orElse(null); } // different results is only fine as long as those come from a mapping if (resultOnly.size() > 1 || (!resultOnly.isEmpty() && !explicitMappings.isEmpty())) { throw extractionError("Function hints that lead to ambiguous results are not allowed."); } return null; } /** * Hints that map a signature to a result. */ static Set<FunctionTemplate> findResultMappingTemplates( Set<FunctionTemplate> globalTemplates, Set<FunctionTemplate> localTemplates, Function<FunctionTemplate, FunctionResultTemplate> accessor) { return Stream.concat(globalTemplates.stream(), localTemplates.stream()) .filter(t -> t.getSignatureTemplate() != null && accessor.apply(t) != null) .collect(Collectors.toSet()); } /** * Hints that only declare an input. */ static Set<FunctionSignatureTemplate> findInputOnlyTemplates( Set<FunctionTemplate> global, Set<FunctionTemplate> local, Function<FunctionTemplate, FunctionResultTemplate> accessor) { return Stream.concat(global.stream(), local.stream()) .filter(t -> t.getSignatureTemplate() != null && accessor.apply(t) == null) .map(FunctionTemplate::getSignatureTemplate) .collect(Collectors.toSet()); } private TemplateUtils() { // no instantiation } }
[ "twalthr@apache.org" ]
twalthr@apache.org
42cd691c25c2aa6735a8f0d9a92da78855de1602
a70bb22000cd7c6cfb01aa1db33164d92bf42a59
/tmall_MQ/src/main/java/com/rumo/thread2/countlatch/Player.java
41834d7b08f247ce4895e0d4503ba5c2da398b29
[]
no_license
zixuncool/springboot-all
ef6cc0281a92b8a6a41706966aaec3aad6c1c04b
478333f32ff28477613e95ffdf11e7acc21fd488
refs/heads/master
2020-05-19T10:19:15.819966
2018-10-10T12:00:09
2018-10-10T12:00:09
184,964,876
0
0
null
null
null
null
UTF-8
Java
false
false
2,442
java
package com.rumo.thread2.countlatch; // _ooOoo_ // o8888888o // 88" . "88 // (| -_- |) // O\ = /O // ____/`---'\____ // . ' \\| |// `. // / \\||| : |||// \ // / _||||| -:- |||||- \ // | | \\\ - /// | | // | \_| ''\---/'' | | // \ .-\__ `-` ___/-. / // ___`. .' /--.--\ `. . __ // ."" '< `.___\_<|>_/___.' >'"". // | | : `- \`.;`\ _ /`;.`/ - ` : | | // \ \ `-. \_ __\ /__ _/ .-` / / // ======`-.____`-.___\_____/___.-`____.-'====== // `=---=' // // ............................................. // 佛祖镇楼 BUG辟易 // 佛曰: // 写字楼里写字间,写字间里程序员; // 程序人员写程序,又拿程序换酒钱。 // 酒醒只在网上坐,酒醉还来网下眠; // 酒醉酒醒日复日,网上网下年复年。 // 但愿老死电脑间,不愿鞠躬老板前; // 奔驰宝马贵者趣,公交自行程序员。 // 别人笑我忒疯癫,我笑自己命太贱; // 不见满街漂亮妹,哪个归得程序员? import java.util.concurrent.CountDownLatch; /** * @ClassName : com.rumo.thread2.countlatch.Player * @Description: todo * @Author:mofeng * @Date 2018/7/27 17:05 * @Version 1.0 */ public class Player extends Thread { private static int count = 1; private final int id = count ++; private static CountDownLatch countDownLatch = new CountDownLatch(3); public void run(){ System.out.println("玩家【"+id+"】进场了..."); countDownLatch.countDown();//线程挂起 } public static void main(String[] args){ try { new Player().start(); new Player().start(); new Player().start(); countDownLatch.await();//阻塞主线程 System.out.println("玩家已经到齐,准备开始发牌...."); }catch (Exception ex){ } } }
[ "xuchengfeifei@163.com" ]
xuchengfeifei@163.com
2005c826431a05f6b2adf43558d584016108bfa7
2f9ff75d69186bb8e05d77ebcc082eb77d8ad399
/common.settlement.sdk/src/main/java/com/guohuai/account/api/response/FinanceUserResp.java
dd675e71d48bcc183d386d42a16de17fdf92e43d
[]
no_license
songpanyong/p-boot
db19956d6db7cf0d517f9800e0142c8c29b26757
1cc47792746b3123e8814a6d940de99ac97a3c35
refs/heads/master
2020-03-10T04:45:52.264469
2018-04-12T05:50:27
2018-04-12T05:50:27
129,200,605
2
5
null
null
null
null
UTF-8
Java
false
false
794
java
package com.guohuai.account.api.response; import java.sql.Timestamp; import lombok.Data; import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(callSuper = false) public class FinanceUserResp extends BaseResponse { private static final long serialVersionUID = -4621221866479224344L; private String oid; private String userType; private String systemUid; // 用户业务系统ID private String userOid; // 用户ID private String systemSource; // 来源系统 private String name; // 姓名 private String idCard; // 身份证号 private String bankName; // 开户行 private String cardNo; // 银行账号 private String phone; // 手机号 private String remark; // 备注 private Timestamp updateTime; // 更新时间 private Timestamp createTime; // 创建时间 }
[ "songpanyong@163.com" ]
songpanyong@163.com
802afd5661c5a7b90ac2a078283c428e0cf124eb
00226070b79ee1cad284922457d0b66e6c7b0142
/src/main/java/io/ReportarEnLineaSimulacion/client/api/CargaDeCuentasDePersonasFsicasApi.java
bbb284d13b8d49704c3e335b632a5e8e8595e25a
[]
no_license
APIHub-CdC/reportar-en-linea-simulacion-client-java
e992020ae31f76db46d24b272cbdf5df1dbc3930
6f75da67d435568d95966e0e1668736fe7ea6308
refs/heads/master
2022-06-05T19:01:10.061726
2021-11-11T17:13:03
2021-11-11T17:13:03
216,111,245
0
0
null
2022-05-20T21:12:31
2019-10-18T21:44:25
Java
UTF-8
Java
false
false
4,814
java
package io.ReportarEnLineaSimulacion.client.api; import io.ReportarEnLineaSimulacion.client.ApiClient; import io.ReportarEnLineaSimulacion.client.ApiException; import io.ReportarEnLineaSimulacion.client.ApiResponse; import io.ReportarEnLineaSimulacion.client.Configuration; import io.ReportarEnLineaSimulacion.client.Pair; import io.ReportarEnLineaSimulacion.client.ProgressRequestBody; import io.ReportarEnLineaSimulacion.client.ProgressResponseBody; import com.google.gson.reflect.TypeToken; import java.io.IOException; import io.ReportarEnLineaSimulacion.client.model.CargasPFRegistrarRequest; import io.ReportarEnLineaSimulacion.client.model.CargasResponse; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class CargaDeCuentasDePersonasFsicasApi<T> { private ApiClient apiClient; public CargaDeCuentasDePersonasFsicasApi() { this(Configuration.getDefaultApiClient()); } public CargaDeCuentasDePersonasFsicasApi(ApiClient apiClient) { this.apiClient = apiClient; } public ApiClient getApiClient() { return apiClient; } public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } public okhttp3.Call registrarCall(String xApiKey, CargasPFRegistrarRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { Object localVarPostBody = request; String localVarPath = "/"; List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); if (xApiKey != null) localVarHeaderParams.put("x-api-key", apiClient.parameterToString(xApiKey)); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json" }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) localVarHeaderParams.put("Accept", localVarAccept); final String[] localVarContentTypes = { "application/json" }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); if (progressListener != null) { apiClient.getHttpClient().networkInterceptors().add(new okhttp3.Interceptor() { @Override public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws IOException { okhttp3.Response originalResponse = chain.proceed(chain.request()); return originalResponse.newBuilder() .body(new ProgressResponseBody(originalResponse.body(), progressListener)).build(); } }); } String[] localVarAuthNames = new String[] {}; return apiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAuthNames, progressRequestListener); } private okhttp3.Call registrarValidateBeforeCall(String xApiKey, CargasPFRegistrarRequest request, final ProgressResponseBody.ProgressListener progressListener, final ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { if (xApiKey == null) { throw new ApiException("Missing the required parameter 'xApiKey' when calling registrar(Async)"); } if (request == null) { throw new ApiException("Missing the required parameter 'request' when calling registrar(Async)"); } okhttp3.Call call = registrarCall(xApiKey, request, progressListener, progressRequestListener); return call; } public CargasResponse registrar(String xApiKey, CargasPFRegistrarRequest request) throws ApiException { ApiResponse<CargasResponse> resp = registrarWithHttpInfo(xApiKey, request); return resp.getData(); } public ApiResponse<CargasResponse> registrarWithHttpInfo(String xApiKey, CargasPFRegistrarRequest request) throws ApiException { okhttp3.Call call = registrarValidateBeforeCall(xApiKey, request, null, null); Type localVarReturnType = new TypeToken<CargasResponse>() { }.getType(); return apiClient.execute(call, localVarReturnType); } public T registrarGenerico(String xApiKey, CargasPFRegistrarRequest request) throws ApiException { ApiResponse<T> resp = registrarWithHttpInfoGenerico(xApiKey, request); return resp.getData(); } public ApiResponse<T> registrarWithHttpInfoGenerico(String xApiKey, CargasPFRegistrarRequest request) throws ApiException { okhttp3.Call call = registrarValidateBeforeCall(xApiKey, request, null, null); Type localVarReturnType = new TypeToken<T>() { }.getType(); return apiClient.execute(call, localVarReturnType); } }
[ "bryantcancino@gmail.com" ]
bryantcancino@gmail.com
9f3249b085bb2a9349224e2c9ef36e5af7fb1eb1
eb5f5353f49ee558e497e5caded1f60f32f536b5
/javax/xml/transform/FactoryFinder.java
2067f1de165ff2980116b0ffe173b944b8acbcff
[]
no_license
mohitrajvardhan17/java1.8.0_151
6fc53e15354d88b53bd248c260c954807d612118
6eeab0c0fd20be34db653f4778f8828068c50c92
refs/heads/master
2020-03-18T09:44:14.769133
2018-05-23T14:28:24
2018-05-23T14:28:24
134,578,186
0
2
null
null
null
null
UTF-8
Java
false
false
7,774
java
package javax.xml.transform; import java.io.File; import java.io.PrintStream; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Iterator; import java.util.Properties; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; class FactoryFinder { private static final String DEFAULT_PACKAGE = "com.sun.org.apache.xalan.internal."; private static boolean debug; private static final Properties cacheProps; static volatile boolean firstTime; private static final SecuritySupport ss; FactoryFinder() {} private static void dPrint(String paramString) { if (debug) { System.err.println("JAXP: " + paramString); } } private static Class<?> getProviderClass(String paramString, ClassLoader paramClassLoader, boolean paramBoolean1, boolean paramBoolean2) throws ClassNotFoundException { try { if (paramClassLoader == null) { if (paramBoolean2) { return Class.forName(paramString, false, FactoryFinder.class.getClassLoader()); } paramClassLoader = ss.getContextClassLoader(); if (paramClassLoader == null) { throw new ClassNotFoundException(); } return Class.forName(paramString, false, paramClassLoader); } return Class.forName(paramString, false, paramClassLoader); } catch (ClassNotFoundException localClassNotFoundException) { if (paramBoolean1) { return Class.forName(paramString, false, FactoryFinder.class.getClassLoader()); } throw localClassNotFoundException; } } static <T> T newInstance(Class<T> paramClass, String paramString, ClassLoader paramClassLoader, boolean paramBoolean1, boolean paramBoolean2) throws TransformerFactoryConfigurationError { assert (paramClass != null); boolean bool = false; if ((System.getSecurityManager() != null) && (paramString != null) && (paramString.startsWith("com.sun.org.apache.xalan.internal."))) { paramClassLoader = null; bool = true; } try { Class localClass = getProviderClass(paramString, paramClassLoader, paramBoolean1, bool); if (!paramClass.isAssignableFrom(localClass)) { throw new ClassCastException(paramString + " cannot be cast to " + paramClass.getName()); } Object localObject = null; if (!paramBoolean2) { localObject = newInstanceNoServiceLoader(paramClass, localClass); } if (localObject == null) { localObject = localClass.newInstance(); } if (debug) { dPrint("created new instance of " + localClass + " using ClassLoader: " + paramClassLoader); } return (T)paramClass.cast(localObject); } catch (ClassNotFoundException localClassNotFoundException) { throw new TransformerFactoryConfigurationError(localClassNotFoundException, "Provider " + paramString + " not found"); } catch (Exception localException) { throw new TransformerFactoryConfigurationError(localException, "Provider " + paramString + " could not be instantiated: " + localException); } } private static <T> T newInstanceNoServiceLoader(Class<T> paramClass, Class<?> paramClass1) { if (System.getSecurityManager() == null) { return null; } try { Method localMethod = paramClass1.getDeclaredMethod("newTransformerFactoryNoServiceLoader", new Class[0]); int i = localMethod.getModifiers(); if ((!Modifier.isPublic(i)) || (!Modifier.isStatic(i))) { return null; } Class localClass = localMethod.getReturnType(); if (paramClass.isAssignableFrom(localClass)) { Object localObject = localMethod.invoke(null, (Object[])null); return (T)paramClass.cast(localObject); } throw new ClassCastException(localClass + " cannot be cast to " + paramClass); } catch (ClassCastException localClassCastException) { throw new TransformerFactoryConfigurationError(localClassCastException, localClassCastException.getMessage()); } catch (NoSuchMethodException localNoSuchMethodException) { return null; } catch (Exception localException) {} return null; } static <T> T find(Class<T> paramClass, String paramString) throws TransformerFactoryConfigurationError { assert (paramClass != null); String str1 = paramClass.getName(); dPrint("find factoryId =" + str1); try { String str2 = ss.getSystemProperty(str1); if (str2 != null) { dPrint("found system property, value=" + str2); return (T)newInstance(paramClass, str2, null, true, true); } } catch (SecurityException localSecurityException) { if (debug) { localSecurityException.printStackTrace(); } } try { if (firstTime) { synchronized (cacheProps) { if (firstTime) { String str3 = ss.getSystemProperty("java.home") + File.separator + "lib" + File.separator + "jaxp.properties"; File localFile = new File(str3); firstTime = false; if (ss.doesFileExist(localFile)) { dPrint("Read properties file " + localFile); cacheProps.load(ss.getFileInputStream(localFile)); } } } } ??? = cacheProps.getProperty(str1); if (??? != null) { dPrint("found in $java.home/jaxp.properties, value=" + (String)???); return (T)newInstance(paramClass, (String)???, null, true, true); } } catch (Exception localException) { if (debug) { localException.printStackTrace(); } } Object localObject1 = findServiceProvider(paramClass); if (localObject1 != null) { return (T)localObject1; } if (paramString == null) { throw new TransformerFactoryConfigurationError(null, "Provider for " + str1 + " cannot be found"); } dPrint("loaded from fallback value: " + paramString); return (T)newInstance(paramClass, paramString, null, true, true); } private static <T> T findServiceProvider(Class<T> paramClass) throws TransformerFactoryConfigurationError { try { (T)AccessController.doPrivileged(new PrivilegedAction() { public T run() { ServiceLoader localServiceLoader = ServiceLoader.load(val$type); Iterator localIterator = localServiceLoader.iterator(); if (localIterator.hasNext()) { return (T)localIterator.next(); } return null; } }); } catch (ServiceConfigurationError localServiceConfigurationError) { RuntimeException localRuntimeException = new RuntimeException("Provider for " + paramClass + " cannot be created", localServiceConfigurationError); TransformerFactoryConfigurationError localTransformerFactoryConfigurationError = new TransformerFactoryConfigurationError(localRuntimeException, localRuntimeException.getMessage()); throw localTransformerFactoryConfigurationError; } } static { debug = false; cacheProps = new Properties(); firstTime = true; ss = new SecuritySupport(); try { String str = ss.getSystemProperty("jaxp.debug"); debug = (str != null) && (!"false".equals(str)); } catch (SecurityException localSecurityException) { debug = false; } } } /* Location: C:\Program Files (x86)\Java\jre1.8.0_151\lib\rt.jar!\javax\xml\transform\FactoryFinder.class * Java compiler version: 8 (52.0) * JD-Core Version: 0.7.1 */
[ "mohit.rajvardhan@ericsson.com" ]
mohit.rajvardhan@ericsson.com
e44460e0e906edc9a67a7536e6b91c382480af1f
875d88ee9cf7b40c9712178d1ee48f0080fa0f8a
/geronimo-jpa_2.1_spec/src/main/java/javax/persistence/spi/PersistenceProvider.java
2b54a5c71798e9b3bc29b8edc6fd8bada4aa2b32
[ "Apache-2.0", "W3C", "W3C-19980720" ]
permissive
jgallimore/geronimo-specs
b152164488692a7e824c73a9ba53e6fb72c6a7a3
09c09bcfc1050d60dcb4656029e957837f851857
refs/heads/trunk
2022-12-15T14:02:09.338370
2020-09-14T18:21:46
2020-09-14T18:21:46
284,994,475
0
1
Apache-2.0
2020-09-14T18:21:47
2020-08-04T13:51:47
Java
UTF-8
Java
false
false
1,537
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. */ // // This source code implements specifications defined by the Java // Community Process. In order to remain compliant with the specification // DO NOT add / change / or delete method signatures! // package javax.persistence.spi; import javax.persistence.EntityManagerFactory; import java.util.Map; public interface PersistenceProvider { public EntityManagerFactory createEntityManagerFactory(String emName, Map map); public EntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo info, Map map); public void generateSchema(PersistenceUnitInfo info, Map map); public boolean generateSchema(String persistenceUnitName, Map map); public ProviderUtil getProviderUtil(); }
[ "gawor@apache.org" ]
gawor@apache.org
54b8517721c4d14e86aebc79f6e33ee269d2b179
e53b7a02300de2b71ac429d9ec619d12f21a97cc
/src/com/coda/efinance/schemas/groupmaster/AddResponseVerb.java
7761948fe9a78b5d13d2c42a983e97e8ce93e8e3
[]
no_license
phi2039/coda_xmli
2ad13c08b631d90a26cfa0a02c9c6c35416e796f
4c391b9a88f776c2bf636e15d7fcc59b7fcb7531
refs/heads/master
2021-01-10T05:36:22.264376
2015-12-03T16:36:23
2015-12-03T16:36:23
47,346,047
0
0
null
null
null
null
UTF-8
Java
false
false
3,226
java
// // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> // Any modifications to this file will be lost upon recompilation of the source schema. // Generated on: 2015.12.03 at 01:44:04 AM EST // package com.coda.efinance.schemas.groupmaster; import java.io.Serializable; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import com.coda.efinance.schemas.common.Companies; import com.coda.efinance.schemas.common.ResponseVerb; /** * Contains the responses to your requests with this verb. * * <p>Java class for AddResponseVerb complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="AddResponseVerb"&gt; * &lt;complexContent&gt; * &lt;extension base="{http://www.coda.com/efinance/schemas/common}ResponseVerb"&gt; * &lt;sequence&gt; * &lt;element name="Companies" type="{http://www.coda.com/efinance/schemas/common}Companies" minOccurs="0"/&gt; * &lt;element name="Response" type="{http://www.coda.com/efinance/schemas/groupmaster}AddResponse" maxOccurs="unbounded" minOccurs="0"/&gt; * &lt;/sequence&gt; * &lt;/extension&gt; * &lt;/complexContent&gt; * &lt;/complexType&gt; * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "AddResponseVerb", propOrder = { "companies", "response" }) public class AddResponseVerb extends ResponseVerb implements Serializable { @XmlElement(name = "Companies") protected Companies companies; @XmlElement(name = "Response") protected List<AddResponse> response; /** * Gets the value of the companies property. * * @return * possible object is * {@link Companies } * */ public Companies getCompanies() { return companies; } /** * Sets the value of the companies property. * * @param value * allowed object is * {@link Companies } * */ public void setCompanies(Companies value) { this.companies = value; } /** * Gets the value of the response property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the response property. * * <p> * For example, to add a new item, do as follows: * <pre> * getResponse().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link AddResponse } * * */ public List<AddResponse> getResponse() { if (response == null) { response = new ArrayList<AddResponse>(); } return this.response; } }
[ "climber2039@gmail.com" ]
climber2039@gmail.com
2f784964084ef6d6fc249097b9c8344673658456
ca030864a3a1c24be6b9d1802c2353da4ca0d441
/classes7.dex_source_from_JADX/com/facebook/feed/rows/sections/SubStoryFooterPartDefinitionProvider.java
c557c98da4fcb1790042ae37207bfa6fc8a5ddb0
[]
no_license
pxson001/facebook-app
87aa51e29195eeaae69adeb30219547f83a5b7b1
640630f078980f9818049625ebc42569c67c69f7
refs/heads/master
2020-04-07T20:36:45.758523
2018-03-07T09:04:57
2018-03-07T09:04:57
124,208,458
4
0
null
null
null
null
UTF-8
Java
false
false
1,118
java
package com.facebook.feed.rows.sections; import android.view.View; import com.facebook.feed.environment.CanShowVideoInFullScreen; import com.facebook.feed.rows.core.parts.MultiRowSinglePartDefinition; import com.facebook.feed.rows.core.props.FeedProps; import com.facebook.feedplugins.base.footer.FooterLevel; import com.facebook.feedplugins.base.footer.ui.Footer; import com.facebook.feedplugins.graphqlstory.footer.FooterBackgroundPartDefinition; import com.facebook.graphql.model.GraphQLStory; import com.facebook.inject.AbstractAssistedProvider; /* compiled from: [createTargetProfileFromComposerTargetData] Empty targetName */ public class SubStoryFooterPartDefinitionProvider extends AbstractAssistedProvider<SubStoryFooterPartDefinition> { public final <V extends View & Footer> SubStoryFooterPartDefinition<V> m23557a(MultiRowSinglePartDefinition<FeedProps<GraphQLStory>, Void, CanShowVideoInFullScreen, V> multiRowSinglePartDefinition, FooterLevel footerLevel) { return new SubStoryFooterPartDefinition(FooterBackgroundPartDefinition.a(this), multiRowSinglePartDefinition, footerLevel); } }
[ "son.pham@jmango360.com" ]
son.pham@jmango360.com
e6307040c0c341f3e97fafe4edfebc7f23922004
495f61e7c513c03f25526a99b23c4ff201fd1264
/NoSQL/bin/nosql/Estudiante.java
c2d262f756c6a6b48ab402667004aa8ffb5e4df8
[]
no_license
Domiciano/DBNoSQL
4d5f814b471f63079ee666808f2edc4105781ca9
fc5a95ad6883ace881a76fb549528c049f4e1066
refs/heads/master
2020-04-05T22:30:56.842739
2018-11-15T15:49:34
2018-11-15T15:49:34
157,258,959
0
0
null
null
null
null
UTF-8
Java
false
false
682
java
package nosql; public class Estudiante { private String nombre; private String apellido; private String codigo; public Estudiante() { //Requerimiento } public Estudiante(String nombre, String apellido, String codigo) { this.nombre = nombre; this.apellido = apellido; this.codigo = codigo; } public String getNombre() { return nombre; } public void setNombre(String nombre) { this.nombre = nombre; } public String getApellido() { return apellido; } public void setApellido(String apellido) { this.apellido = apellido; } public String getCodigo() { return codigo; } public void setCodigo(String codigo) { this.codigo = codigo; } }
[ "domiciano.rincon@correounivalle.edu.co" ]
domiciano.rincon@correounivalle.edu.co
af7e729370b94f57fc9594cad040ea1f84dd21d9
cb2e0b45e47ebeb518f1c8d7d12dfa0680aed01c
/openbanking-api-model/src/main/gen/com/laegler/openbanking/model/OBBranchAndFinancialInstitutionIdentification61.java
45a238d48e10d4c4c820b5ded442aced627a5351
[ "MIT" ]
permissive
thlaegler/openbanking
4909cc9e580210267874c231a79979c7c6ec64d8
924a29ac8c0638622fba7a5674c21c803d6dc5a9
refs/heads/develop
2022-12-23T15:50:28.827916
2019-10-30T09:11:26
2019-10-31T05:43:04
213,506,933
1
0
MIT
2022-11-16T11:55:44
2019-10-07T23:39:49
HTML
UTF-8
Java
false
false
4,453
java
package com.laegler.openbanking.model; import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.laegler.openbanking.model.OBPostalAddress6; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.*; /** * Financial institution servicing an account for the debtor. */ @ApiModel(description = "Financial institution servicing an account for the debtor.") @Validated @javax.annotation.Generated(value = "class com.laegler.openbanking.codegen.language.OpenbankingModelCodegen", date = "2019-10-19T07:45:56.431+13:00") public class OBBranchAndFinancialInstitutionIdentification61 { @JsonProperty("Identification") private String identification = null; @JsonProperty("Name") private String name = null; @JsonProperty("PostalAddress") private OBPostalAddress6 postalAddress = null; @JsonProperty("SchemeName") private String schemeName = null; public OBBranchAndFinancialInstitutionIdentification61 identification(String identification) { this.identification = identification; return this; } /** * Get identification * @return identification **/ @ApiModelProperty(value = "") @Size(min=1,max=35) public String getIdentification() { return identification; } public void setIdentification(String identification) { this.identification = identification; } public OBBranchAndFinancialInstitutionIdentification61 name(String name) { this.name = name; return this; } /** * Get name * @return name **/ @ApiModelProperty(value = "") @Size(min=1,max=140) public String getName() { return name; } public void setName(String name) { this.name = name; } public OBBranchAndFinancialInstitutionIdentification61 postalAddress(OBPostalAddress6 postalAddress) { this.postalAddress = postalAddress; return this; } /** * Get postalAddress * @return postalAddress **/ @ApiModelProperty(value = "") @Valid public OBPostalAddress6 getPostalAddress() { return postalAddress; } public void setPostalAddress(OBPostalAddress6 postalAddress) { this.postalAddress = postalAddress; } public OBBranchAndFinancialInstitutionIdentification61 schemeName(String schemeName) { this.schemeName = schemeName; return this; } /** * Get schemeName * @return schemeName **/ @ApiModelProperty(value = "") public String getSchemeName() { return schemeName; } public void setSchemeName(String schemeName) { this.schemeName = schemeName; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } OBBranchAndFinancialInstitutionIdentification61 obBranchAndFinancialInstitutionIdentification61 = (OBBranchAndFinancialInstitutionIdentification61) o; return Objects.equals(this.identification, obBranchAndFinancialInstitutionIdentification61.identification) && Objects.equals(this.name, obBranchAndFinancialInstitutionIdentification61.name) && Objects.equals(this.postalAddress, obBranchAndFinancialInstitutionIdentification61.postalAddress) && Objects.equals(this.schemeName, obBranchAndFinancialInstitutionIdentification61.schemeName); } @Override public int hashCode() { return Objects.hash(identification, name, postalAddress, schemeName); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class OBBranchAndFinancialInstitutionIdentification61 {\n"); sb.append(" identification: ").append(toIndentedString(identification)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" postalAddress: ").append(toIndentedString(postalAddress)).append("\n"); sb.append(" schemeName: ").append(toIndentedString(schemeName)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "thomas.laegler@googlemail.com" ]
thomas.laegler@googlemail.com
ae3feebcc312ec28581bbb30efe50a57ce08067a
fd2291cc298b764dbb652a4f309ef897e020f36e
/oax-parent/oax-task/src/main/java/com/oax/api/ApiClient.java
fb6ec6ee937346712abb30d311ad107d69588d51
[]
no_license
liurenzhong000/oax
cc3c9a3e10e9653b37835597e347cbd0317a445a
e7d3aea952034a0c4393f5684cda26b130c86520
refs/heads/master
2022-07-02T18:52:40.407991
2019-12-05T05:36:26
2019-12-05T05:36:26
226,020,593
1
3
null
2022-06-29T17:49:31
2019-12-05T05:07:00
Java
UTF-8
Java
false
false
6,996
java
package com.oax.api; import java.io.IOException; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import javax.xml.bind.DatatypeConverter; import com.fasterxml.jackson.core.type.TypeReference; import com.oax.domain.*; import okhttp3.MediaType; import okhttp3.OkHttpClient; import okhttp3.OkHttpClient.Builder; import okhttp3.Request; import okhttp3.RequestBody; import okhttp3.Response; public class ApiClient { static final int CONN_TIMEOUT = 3; static final int READ_TIMEOUT = 3; static final int WRITE_TIMEOUT = 3; static final MediaType JSON = MediaType.parse("application/json"); static final OkHttpClient client = createOkHttpClient(); final String accessKeyId; final String accessKeySecret; final String assetPassword; static String API_HOST; static String API_URL; /** * 创建一个ApiClient实例 * * @param accessKeyId AccessKeyId * @param accessKeySecret AccessKeySecret */ public ApiClient(String accessKeyId, String accessKeySecret) { this.accessKeyId = accessKeyId; this.accessKeySecret = accessKeySecret; this.assetPassword = null; } /** * 创建一个ApiClient实例 * * @param accessKeyId AccessKeyId * @param accessKeySecret AccessKeySecret * @param assetPassword AssetPassword */ public ApiClient(String accessKeyId, String accessKeySecret, String assetPassword) { this.accessKeyId = accessKeyId; this.accessKeySecret = accessKeySecret; this.assetPassword = assetPassword; } /** * 创建一个ApiClient实例 * * @param accessKeyId AccessKeyId * @param accessKeySecret AccessKeySecret * @param assetPassword AssetPassword */ public ApiClient(String accessKeyId, String accessKeySecret, String assetPassword,String apiHost,String apiUrl) { this.accessKeyId = accessKeyId; this.accessKeySecret = accessKeySecret; this.assetPassword = assetPassword; ApiClient.API_HOST = apiHost; ApiClient.API_URL = apiUrl; } /** * GET /v1/account/accounts 查询当前用户的所有账户(即account-id) * * @return */ public AccountsResponse<?> accounts() { AccountsResponse<?> resp = get("/v1/account/accounts", null, new TypeReference<AccountsResponse<List<Accounts>>>() { }); return resp; } /** * 创建订单(未执行) * * @param request CreateOrderRequest object. * @return Order id. */ public Long createOrder(CreateOrderRequest request) { ApiResponse<Long> resp = post("/v1/order/orders", request, new TypeReference<ApiResponse<Long>>() {}); return resp.checkAndReturn(); } /** * 执行订单 * * @param orderId The id of created order. * @return Order id. */ public String placeOrder(long orderId) { ApiResponse<String> resp = post("/v1/order/orders/" + orderId + "/place", null, new TypeReference<ApiResponse<String>>() {}); return resp.checkAndReturn(); } /** * GET /market/depth 获取 Market Depth 数据 * * @param request * @return */ public DepthResponse<?> depth(DepthRequest request) { HashMap<String, String> map = new HashMap<String, String>(); map.put("symbol", request.getSymbol()); map.put("type", request.getType()); DepthResponse<?> resp = get("/market/depth", map, new TypeReference<DepthResponse<List<Depth>>>() {}); return resp; } /** * GET /market/trade 获取最近的交易记录 * @param request * @return */ public TradeResponse<?> trade(TradeRequest request){ HashMap<String, String> map = new HashMap(); map.put("symbol", request.getSymbol()); TradeResponse<?> resp = get("/market/trade", map, new TypeReference<TradeResponse<List<TradeData<TradeDetail>>>>() {}); return resp; } <T> T get(String uri, Map<String, String> params, TypeReference<T> ref) { if (params == null) { params = new HashMap<>(); } return call("GET", uri, null, params, ref); } <T> T post(String uri, Object object, TypeReference<T> ref) { return call("POST", uri, object, new HashMap<String, String>(), ref); } <T> T call(String method, String uri, Object object, Map<String, String> params, TypeReference<T> ref) { ApiSignature sign = new ApiSignature(); sign.createSignature(this.accessKeyId, this.accessKeySecret, method, API_HOST, uri, params); try { Request.Builder builder = null; if ("POST".equals(method)) { RequestBody body = RequestBody.create(JSON, DepthResponse.JsonUtil.writeValue(object)); builder = new Request.Builder().url(API_URL + uri + "?" + toQueryString(params)).post(body); } else { builder = new Request.Builder().url(API_URL + uri + "?" + toQueryString(params)).get(); } if (this.assetPassword != null) { builder.addHeader("AuthData", authData()); } Request request = builder.build(); Response response = client.newCall(request).execute(); String s = response.body().string(); return DepthResponse.JsonUtil.readValue(s, ref); } catch (IOException e) { throw new ApiException(e); } } String authData() { MessageDigest md = null; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } md.update(this.assetPassword.getBytes(StandardCharsets.UTF_8)); md.update("hello, moto".getBytes(StandardCharsets.UTF_8)); Map<String, String> map = new HashMap<>(); map.put("assetPwd", DatatypeConverter.printHexBinary(md.digest()).toLowerCase()); try { return ApiSignature.urlEncode(DepthResponse.JsonUtil.writeValue(map)); } catch (IOException e) { throw new RuntimeException("Get json failed: " + e.getMessage()); } } String toQueryString(Map<String, String> params) { return String.join("&", params.entrySet().stream().map((entry) -> { return entry.getKey() + "=" + ApiSignature.urlEncode(entry.getValue()); }).collect(Collectors.toList())); } static OkHttpClient createOkHttpClient() { return new Builder().connectTimeout(CONN_TIMEOUT, TimeUnit.SECONDS) .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS).writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS) .build(); } }
[ "liurenzhong_c@163.com" ]
liurenzhong_c@163.com
3effcafb4cac69263d302e586d8e72d53ddb122f
a730bc5b5233e359094edd9d9995416ea0bbb6c7
/String-3/countYZ.java
3792c96bc9610b89e109d37bf187075adaeb3737
[]
no_license
gautamkumar11/CodingBat-Solutions
54b1b0ffcbbf612b5219dd51002415f194e0d8b7
b2dc96b5e8ec66edae67fffa10ed14a008338b0e
refs/heads/master
2023-01-29T01:28:44.417691
2020-12-10T16:06:31
2020-12-10T16:06:31
319,372,595
0
0
null
null
null
null
UTF-8
Java
false
false
788
java
/* Given a string, count the number of words ending in 'y' or 'z' -- so the 'y' in "heavy" and the 'z' in "fez" count, but not the 'y' in "yellow" (not case sensitive). We'll say that a y or z is at the end of a word if there is not an alphabetic letter immediately following it. (Note: Character.isLetter(char) tests if a char is an alphabetic letter.) countYZ("fez day") → 2 countYZ("day fez") → 2 countYZ("day fyyyz") → 2 */public int countYZ(String str) { int len = str.length(); int count = 0; str = str.toLowerCase(); for(int i=0; i < len; i++) { if(str.charAt(i) == 'y' || str.charAt(i) == 'z') { if(i+1 == len) { count++; } if(i<len-1 && !Character.isLetter(str.charAt(i+1))) { count++; } } } return count; }
[ "kumargautam11gk@gmail.com" ]
kumargautam11gk@gmail.com
bcec18a807156f7d2936907f2cfc87b4839258b7
b7e226d6a855ddfea361c1882bf0e343da30430d
/uwifi_backoffice_bak/src/com/kdgz/uwifi/backoffice/interceptor/UserValidationInterceptor.java
a8c3fcf8242507969924241a0ad77a3c3698008d
[]
no_license
xiaolowe/uwifi_backoffice
de87d388e920841c5464bd8de25d9b70d1d07815
809a51fdbbb1001e728d5b43c5b491efee881d6d
refs/heads/master
2020-12-06T16:57:05.228078
2018-05-20T14:38:54
2018-05-20T14:38:54
66,903,660
0
1
null
null
null
null
UTF-8
Java
false
false
1,957
java
package com.kdgz.uwifi.backoffice.interceptor; import java.util.List; import org.apache.commons.lang3.StringUtils; import com.jfinal.aop.Interceptor; import com.jfinal.core.ActionInvocation; import com.kdgz.uwifi.backoffice.constant.Constants; import com.kdgz.uwifi.backoffice.model.Businessinfo; import com.kdgz.uwifi.backoffice.model.Userbiz; /** * 用户权限拦截器 * */ public class UserValidationInterceptor implements Interceptor { @Override public void intercept(ActionInvocation ai) { Boolean islogin = (Boolean) ai.getController() .getSessionAttr("isLogin"); if (islogin == null || islogin.equals(Boolean.FALSE.booleanValue()) ) { ai.getController().redirect("/site/index"); } else { // 将账号关联的店铺Id存入Session // 登录昵称 String loginName = ai.getController().getSessionAttr("loginName"); String sessionBusIds = ai.getController().getSessionAttr("businessids"); if(StringUtils.isEmpty(sessionBusIds)) { StringBuilder sb = new StringBuilder(); // 超级管理员账号 if(Constants.ADMIN_USERNAME.equals(loginName)) { List<Businessinfo> businessList = Businessinfo.dao.getBussinessIdList(); for (Businessinfo businessinfo : businessList) { sb.append(businessinfo.getInt("id")); sb.append(","); } } else { Integer userid = ai.getController().getSessionAttr("userid"); List<Userbiz> listBus = Userbiz.dao.selectBusinessByUid(userid); if (listBus != null && listBus.size() > 0) { for (int i = 0; i < listBus.size(); i++) { Userbiz userbiz = listBus.get(i); sb.append(userbiz.getInt("businessid")); sb.append(","); } } } String businessids = sb.toString(); if (sb.length() > 0) { businessids = businessids.substring(0, businessids.length() - 1); } ai.getController().setSessionAttr("businessids", businessids); } ai.invoke(); } } }
[ "xiaolowe@gmail.com" ]
xiaolowe@gmail.com
c8a365345ea88b3b16a28c208217a8f9494375cd
ee78f53edac6c07fdea5c49389e9c25ff81dab35
/Patterns_and_OOD/GOF_from_WIKI_java/src/com/ap/behavioral/iterator/IteratorProgram.java
ce7bedd2328b517bbfb40b7e1808e318c934de87
[]
no_license
AndrewPonyk/ProgrammingOther
028a2d34999798f4d652dfd546aec3ed10b1b596
f659413edb72cf3f8eef65954ca309118660c5e7
refs/heads/master
2023-03-18T13:35:05.973408
2023-03-13T18:52:02
2023-03-13T18:52:02
15,011,534
2
0
null
2022-12-15T23:23:18
2013-12-07T19:30:32
Java
UTF-8
Java
false
false
652
java
package com.ap.behavioral.iterator; import java.util.ArrayList; public class IteratorProgram { public static void main(String[] args) { ConcreteAggregate a = new ConcreteAggregate(); a.setThis(0, "Item A"); a.setThis(1, "Item B"); a.setThis(5, "Item C"); // Create Iterator and provide aggregate ConcreteIterator i = new ConcreteIterator(a); System.out.println("Iterating over collection:"); Object item = i.First(); while (item != null) { System.out.println(item); item = i.Next(); } } }
[ "andrew9999@ukr.net" ]
andrew9999@ukr.net
ec10c53d006611cd3dc2defb259dce0cb8836780
a4a51084cfb715c7076c810520542af38a854868
/src/main/java/com/shopee/app/data/viewmodel/chat/ChatOrderMessage.java
e14b58909e32287950b258a66441723e9b1eaf7a
[]
no_license
BharathPalanivelu/repotest
ddaf56a94eb52867408e0e769f35bef2d815da72
f78ae38738d2ba6c9b9b4049f3092188fabb5b59
refs/heads/master
2020-09-30T18:55:04.802341
2019-12-02T10:52:08
2019-12-02T10:52:08
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,571
java
package com.shopee.app.data.viewmodel.chat; import com.facebook.common.internal.Objects; import com.shopee.app.util.au; import java.util.List; public class ChatOrderMessage extends ChatMessage { private long checkoutId; private String currency; private List<String> imageList; private int listType; private String orderSN; private String orderStatus; private int returnRequested; private long totalPrice; public long getCheckoutId() { return this.checkoutId; } public void setCheckoutId(long j) { this.checkoutId = j; } public long getTotalPrice() { return this.totalPrice; } public String getTotalPriceStr() { return au.a(this.totalPrice, this.currency); } public void setTotalPrice(long j) { this.totalPrice = j; } public String getCurrency() { return this.currency; } public void setCurrency(String str) { this.currency = str; } public String getOrderStatus() { return this.orderStatus; } public void setOrderStatus(String str) { this.orderStatus = str; } public List<String> getImageList() { return this.imageList; } public void setImageList(List<String> list) { this.imageList = list; } public int getListType() { return this.listType; } public void setListType(int i) { this.listType = i; } public String getOrderSN() { return this.orderSN; } public void setOrderSN(String str) { this.orderSN = str; } public void setReturnRequested(int i) { this.returnRequested = i; } public int isReturnRequested() { return this.returnRequested; } public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ChatOrderMessage) || !super.equals(obj)) { return false; } ChatOrderMessage chatOrderMessage = (ChatOrderMessage) obj; if (this.checkoutId != chatOrderMessage.checkoutId || this.totalPrice != chatOrderMessage.totalPrice || this.listType != chatOrderMessage.listType || this.returnRequested != chatOrderMessage.returnRequested || !Objects.equal(this.orderSN, chatOrderMessage.orderSN) || !Objects.equal(this.currency, chatOrderMessage.currency) || !Objects.equal(this.orderStatus, chatOrderMessage.orderStatus) || !Objects.equal(this.imageList, chatOrderMessage.imageList)) { return false; } return true; } }
[ "noiz354@gmail.com" ]
noiz354@gmail.com
7aafd47df52ba7bf0440e1f70805f9de64cc0515
d4478885f8bd7c14ff5340b361564bfe3466a820
/service/src/main/java/com/github/hotire/springcore/boot/AutoConfiguration.java
64aa4b0545cf3062d413cad8fb4bdade0b2bf199
[]
no_license
gnoyes-mik/spring-core
49588b0163dfa64a8e3ff1efc5b93034721dd931
3b944fcc709f823d92061f7ff77374e8419b99c7
refs/heads/master
2023-07-27T10:10:12.970956
2021-07-27T15:13:48
2021-07-27T15:13:48
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,240
java
package com.github.hotire.springcore.boot; import java.util.List; import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.boot.autoconfigure.AutoConfigurationPackage; import org.springframework.boot.autoconfigure.AutoConfigurationPackages; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.context.annotation.Configuration; import lombok.extern.slf4j.Slf4j; /** * EnableAutoConfiguration has AutoConfigurationPackage annoation * * @Import(AutoConfigurationPackages.Registrar.class) * * @see org.springframework.boot.autoconfigure.SpringBootApplication * @see EnableAutoConfiguration * @see AutoConfigurationPackage * @see org.springframework.boot.autoconfigure.AutoConfigurationPackages.Registrar is ImportBeanDefinitionRegistrar */ @Slf4j @Configuration public class AutoConfiguration implements BeanFactoryAware { @Override public void setBeanFactory(BeanFactory beanFactory) throws BeansException { final List<String> basePackages = AutoConfigurationPackages.get(beanFactory); basePackages.forEach(log::info); } }
[ "gngh0101@gmail.com" ]
gngh0101@gmail.com
1d4c379dfac420a2556d1fb814f9eef917a9576b
b4b4308085fd0e6d9d75fbcebc1499ba422e0bd9
/src/main/java/tuantu/demo/jhip/repository/ThuChiRepository.java
b877a8564dac650ddd1f2bf7d01df484ee77440d
[]
no_license
masterit3000/testJhipster2
75da659d64b1946b140e0b947899331317d462e8
5a1ccc501675b99f666f63a72fb202bbed680d6b
refs/heads/master
2021-06-26T22:37:37.062779
2018-06-17T05:23:20
2018-06-17T05:23:20
136,970,232
0
1
null
2020-09-18T10:16:47
2018-06-11T19:14:20
TypeScript
UTF-8
Java
false
false
356
java
package tuantu.demo.jhip.repository; import tuantu.demo.jhip.domain.ThuChi; import org.springframework.stereotype.Repository; import org.springframework.data.jpa.repository.*; /** * Spring Data JPA repository for the ThuChi entity. */ @SuppressWarnings("unused") @Repository public interface ThuChiRepository extends JpaRepository<ThuChi, Long> { }
[ "masterit3000@gmail.com" ]
masterit3000@gmail.com
6601ab78b9b0ff1c960604473911b9ebf4496a42
daab099e44da619b97a7a6009e9dee0d507930f3
/rt/sun/net/dns/ResolverConfiguration.java
0281288762fcc6a3a6d70a3fe26b159b796e8fec
[]
no_license
xknower/source-code-jdk-8u211
01c233d4f498d6a61af9b4c34dc26bb0963d6ce1
208b3b26625f62ff0d1ff6ee7c2b7ee91f6c9063
refs/heads/master
2022-12-28T17:08:25.751594
2020-10-09T03:24:14
2020-10-09T03:24:14
278,289,426
0
0
null
null
null
null
UTF-8
Java
false
false
2,096
java
/* */ package sun.net.dns; /* */ /* */ import java.util.List; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract class ResolverConfiguration /* */ { /* 42 */ private static final Object lock = new Object(); /* */ /* */ /* */ /* */ /* */ private static ResolverConfiguration provider; /* */ /* */ /* */ /* */ /* */ /* */ public static ResolverConfiguration open() { /* 54 */ synchronized (lock) { /* 55 */ if (provider == null) { /* 56 */ provider = new ResolverConfigurationImpl(); /* */ } /* 58 */ return provider; /* */ } /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract List<String> searchlist(); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract List<String> nameservers(); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public abstract Options options(); /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public static abstract class Options /* */ { /* */ public int attempts() { /* 97 */ return -1; /* */ } /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public int retrans() { /* 112 */ return -1; /* */ } /* */ } /* */ } /* Location: D:\tools\env\Java\jdk1.8.0_211\rt.jar!\sun\net\dns\ResolverConfiguration.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "xknower@126.com" ]
xknower@126.com
e453bab949397112478159efebc051f324ac553b
065c1f648e8dd061a20147ff9c0dbb6b5bc8b9be
/eclipsejdt_cluster/52828/src_1.java
d9be7621496f5befc47880e1e4ad72d3c61f3798
[]
no_license
martinezmatias/GenPat-data-C3
63cfe27efee2946831139747e6c20cf952f1d6f6
b360265a6aa3bb21bd1d64f1fc43c3b37d0da2a4
refs/heads/master
2022-04-25T17:59:03.905613
2020-04-15T14:41:34
2020-04-15T14:41:34
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,473
java
/******************************************************************************* * Copyright (c) 2000, 2007 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.jdt.internal.core.search.matching; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.jdt.core.*; import org.eclipse.jdt.core.search.*; import org.eclipse.jdt.internal.compiler.env.AccessRuleSet; import org.eclipse.jdt.internal.compiler.util.SuffixConstants; import org.eclipse.jdt.internal.core.LocalVariable; import org.eclipse.jdt.internal.core.index.Index; import org.eclipse.jdt.internal.core.search.IndexQueryRequestor; import org.eclipse.jdt.internal.core.search.JavaSearchScope; import org.eclipse.jdt.internal.core.util.Util; public class LocalVariablePattern extends VariablePattern { LocalVariable localVariable; public LocalVariablePattern(LocalVariable localVariable, int limitTo, int matchRule) { super(LOCAL_VAR_PATTERN, localVariable.getElementName().toCharArray(), limitTo, matchRule); this.localVariable = localVariable; } public void findIndexMatches(Index index, IndexQueryRequestor requestor, SearchParticipant participant, IJavaSearchScope scope, IProgressMonitor progressMonitor) { IPackageFragmentRoot root = (IPackageFragmentRoot)this.localVariable.getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); String documentPath; String relativePath; if (root.isArchive()) { IType type = (IType)this.localVariable.getAncestor(IJavaElement.TYPE); relativePath = (type.getFullyQualifiedName('/')).replace('.', '/') + SuffixConstants.SUFFIX_STRING_class; documentPath = root.getPath() + IJavaSearchScope.JAR_FILE_ENTRY_SEPARATOR + relativePath; } else { IPath path = this.localVariable.getPath(); documentPath = path.toString(); relativePath = Util.relativePath(path, 1/*remove project segment*/); } if (scope instanceof JavaSearchScope) { JavaSearchScope javaSearchScope = (JavaSearchScope) scope; // Get document path access restriction from java search scope // Note that requestor has to verify if needed whether the document violates the access restriction or not AccessRuleSet access = javaSearchScope.getAccessRuleSet(relativePath, index.containerPath); if (access != JavaSearchScope.NOT_ENCLOSED) { // scope encloses the path if (!requestor.acceptIndexMatch(documentPath, this, participant, access)) throw new OperationCanceledException(); } } else if (scope.encloses(documentPath)) { if (!requestor.acceptIndexMatch(documentPath, this, participant, null)) throw new OperationCanceledException(); } } protected StringBuffer print(StringBuffer output) { if (this.findDeclarations) { output.append(this.findReferences ? "LocalVarCombinedPattern: " //$NON-NLS-1$ : "LocalVarDeclarationPattern: "); //$NON-NLS-1$ } else { output.append("LocalVarReferencePattern: "); //$NON-NLS-1$ } output.append(this.localVariable.toStringWithAncestors()); return super.print(output); } }
[ "375833274@qq.com" ]
375833274@qq.com
d0019e1b419863678e8dad9aa112bf3d5fc2894c
78c1a775ddad9dc8df885254b6ae9f6c7687be2f
/src/main/java/icecube/daq/payload/ICopyable.java
030c7fa9972e7491405107feb25f47f5da120ee6
[]
no_license
dglo/payload
ca491ad6084ae8c0efb86630285096a61ae4063f
34311c72ae1a34e1ab956ea3da6ebea826cce094
refs/heads/main
2021-07-08T21:17:37.483837
2020-03-24T13:32:31
2020-03-24T13:32:31
78,038,025
0
0
null
null
null
null
UTF-8
Java
false
false
299
java
package icecube.daq.payload; /** * Object which can be deep-copied. */ public interface ICopyable { /** * This method allows a deepCopy of itself. * @return Object which is a copy of the object which implements this * interface. */ Object deepCopy(); }
[ "dglo@icecube.wisc.edu" ]
dglo@icecube.wisc.edu
b3b615c1155004d977cfe9f2244ea3daf236dd26
a988f9a28ac664984c979de8ac495ae15ebc7600
/ms-gateway-ui/src/main/java/org/xdemo/example/springmvc/controller/SessionController.java
c37ce06a28da8929938653e9b7926c4279f3f6b7
[ "MIT" ]
permissive
wmengbeyond/ms-gateway
dd7d8d1812ad15e9ee25ba93651285849f412107
bf6d54a51d99050c1816897953d97768c463577e
refs/heads/master
2020-06-15T08:50:09.262164
2016-11-27T14:11:01
2016-11-27T14:11:01
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,177
java
package org.xdemo.example.springmvc.controller; import javax.servlet.http.HttpSession; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ModelAttribute; 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.bind.annotation.SessionAttributes; import org.xdemo.example.springmvc.bean.User; /** * @author <a href="http://www.xdemo.org">xdemo.org</a> */ @Controller @SessionAttributes(value="user") @RequestMapping("/session") public class SessionController { @RequestMapping(method=RequestMethod.GET) public String setUser(ModelMap map){ User user=new User(); user.setAddress("xxx"); user.setUserName("yyy"); map.put("user", user); return "request/userForm"; } @ResponseBody @RequestMapping(value="getUser",method=RequestMethod.GET) public String getUser(@ModelAttribute("user")User user){ System.out.println(user.getUserName()); return user.getUserName(); } }
[ "595208882@qq.com" ]
595208882@qq.com
d1fcf24e216563e48562f1f1d82d5013a1d97a82
25729cf0666fb83f0c9b7553cd647b6c33968886
/src/main/freesql/cn/com/ebmp/freesql/ognl/SetPropertyAccessor.java
efcc831608eb04b718730c91fee5da951dd31473
[]
no_license
545473750/zswxglxt
1b55f94d8c0c8c0de47a0180406cdcdacc2ff756
2a7b7aeba7981bd723f99db400c99d0decb6de43
refs/heads/master
2020-04-23T15:42:36.490753
2014-08-11T00:08:39
2014-08-11T00:08:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,831
java
//-------------------------------------------------------------------------- // Copyright (c) 1998-2004, Drew Davidson and Luke Blanshard // 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 Drew Davidson nor the names of its contributors // may be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE // COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS // OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED // AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH // DAMAGE. //-------------------------------------------------------------------------- package cn.com.ebmp.freesql.ognl; import java.util.Map; import java.util.Set; /** * Implementation of PropertyAccessor that uses numbers and dynamic subscripts * as properties to index into Lists. * * @author Luke Blanshard (blanshlu@netscape.net) * @author Drew Davidson (drew@ognl.org) */ public class SetPropertyAccessor extends ObjectPropertyAccessor implements PropertyAccessor // This // is // here // to // make // javadoc // show // this // class // as // an // implementor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { Set set = (Set) target; if (name instanceof String) { Object result; if (name.equals("size")) { result = new Integer(set.size()); } else { if (name.equals("iterator")) { result = set.iterator(); } else { if (name.equals("isEmpty")) { result = set.isEmpty() ? Boolean.TRUE : Boolean.FALSE; } else { result = super.getProperty(context, target, name); } } } return result; } throw new NoSuchPropertyException(target, name); } }
[ "545473750@qq.com" ]
545473750@qq.com
f344241137f32c7c6ea8ffaa0e860d696bd524cd
a11c75903ebab66ede3f0816440114b36d01b732
/user/src/com/google/gwt/i18n/shared/impl/cldr/DateTimeFormatInfoImpl_ssy_ER.java
1145a4ae4c26e13f3edfbec9ff736618c665d924
[ "Apache-2.0" ]
permissive
manolo/gwt
70c4ffc7ecc81689dd0880e38bbed5dfbb0e0570
f9025bf901d164f3b7a670fd0f3e7b84d4aa0708
refs/heads/master
2021-01-17T05:46:52.823233
2014-10-08T17:34:50
2014-10-08T17:34:50
null
0
0
null
null
null
null
UTF-8
Java
false
false
971
java
/* * Copyright 2014 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.google.gwt.i18n.shared.impl.cldr; // DO NOT EDIT - GENERATED FROM CLDR AND ICU DATA // cldrVersion=25 // date=$Date: 2013-07-20 19:27:45 +0200 (Sat, 20 Jul 2013) $ // number=$Revision: 9061 $ // type=ssy /** * Implementation of DateTimeFormatInfo for the "ssy_ER" locale. */ public class DateTimeFormatInfoImpl_ssy_ER extends DateTimeFormatInfoImpl_ssy { }
[ "manolo@vaadin.com" ]
manolo@vaadin.com
0357a45b49731cd9c4219c5eb4e45679e492f636
c74c2e590b6c6f967aff980ce465713b9e6fb7ef
/game-logic-reset/src/main/java/com/bdoemu/gameserver/dataholders/QuestData.java
0627338f0ab42af5ba1061ff2f136c90b0da60f4
[]
no_license
lingfan/bdoemu
812bb0abb219ddfc391adadf68079efa4af43353
9c49b29bfc9c5bfe3192b2a7fb1245ed459ef6c1
refs/heads/master
2021-01-01T13:10:13.075388
2019-12-02T09:23:20
2019-12-02T09:23:20
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,688
java
package com.bdoemu.gameserver.dataholders; import com.bdoemu.commons.reload.IReloadable; import com.bdoemu.commons.reload.Reloadable; import com.bdoemu.commons.utils.ServerInfoUtils; import com.bdoemu.core.startup.StartupComponent; import com.bdoemu.gameserver.model.creature.player.quests.templates.QuestTemplate; import com.bdoemu.gameserver.service.database.SQLiteDatabaseFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import java.util.concurrent.atomic.AtomicReference; /** * @ClassName QuestData * @Description 探索数据 * @Author JiangBangMing * @Date 2019/7/9 17:30 * VERSION 1.0 */ @Reloadable(name = "quest", group = "sqlite") @StartupComponent("Data") public class QuestData implements IReloadable { private static final Logger log; private static final AtomicReference<Object> instance; static { log = LoggerFactory.getLogger((Class) QuestData.class); instance = new AtomicReference<Object>(); } private HashMap<Integer, HashMap<Integer, QuestTemplate>> templates; private QuestData() { this.templates = new HashMap<Integer, HashMap<Integer, QuestTemplate>>(); this.load(); } public static QuestData getInstance() { Object value = QuestData.instance.get(); if (value == null) { synchronized (QuestData.instance) { value = QuestData.instance.get(); if (value == null) { final QuestData actualValue = new QuestData(); value = ((actualValue == null) ? QuestData.instance : actualValue); QuestData.instance.set(value); } } } return (QuestData) ((value == QuestData.instance) ? null : value); } private void load() { ServerInfoUtils.printSection("QuestData Loading"); try (final Connection con = SQLiteDatabaseFactory.getInstance().getCon(); final Statement statement = con.createStatement(); final ResultSet rs = statement.executeQuery("SELECT * FROM 'Quest_Table'")) { int disabledByContentOptions = 0; while (rs.next()) { final QuestTemplate template = new QuestTemplate(rs); if (ContentsGroupOptionData.getInstance().isContentsGroupOpen(template.getContentsGroupKey())) { if (!this.templates.containsKey(template.getQuestGroupId())) { this.templates.put(template.getQuestGroupId(), new HashMap<Integer, QuestTemplate>()); } this.templates.get(template.getQuestGroupId()).put(template.getQuestId(), template); } else { ++disabledByContentOptions; } } QuestData.log.info("Loaded {} QuestTemplate group's. ({} disabled by ContentsGroupOptionData)", (Object) this.templates.size(), (Object) disabledByContentOptions); } catch (SQLException ex) { QuestData.log.error("Failed load QuestTemplate", (Throwable) ex); } } @Override public void reload() { this.load(); } public QuestTemplate getTemplate(final int groupId, final int questId) { final HashMap<Integer, QuestTemplate> data = this.templates.get(groupId); if (data == null) { return null; } return data.get(questId); } public HashMap<Integer, QuestTemplate> getTemplates(final int groupId) { return this.templates.get(groupId); } }
[ "511459965@qq.com" ]
511459965@qq.com
a4d74700d51b5296dfbf877bcacd1479d0abfb19
6952d6f9690985a1f83cc361b377bd580d2f7c32
/src/main/java/com/jade/config/LoggingAspectConfiguration.java
6be74513a0d665d8047d6d13da50b7704a2d4492
[]
no_license
jhorber95/Jade-application
4198e8329e3e12aea7cf815ed6c9939cf7ae8070
187de9260c3f6133df932e5e63b1b70559033b41
refs/heads/master
2023-07-24T11:58:40.872090
2023-05-16T00:57:33
2023-05-16T00:57:33
188,865,959
0
1
null
2023-07-07T21:46:38
2019-05-27T15:13:20
Java
UTF-8
Java
false
false
478
java
package com.jade.config; import com.jade.aop.logging.LoggingAspect; import io.github.jhipster.config.JHipsterConstants; import org.springframework.context.annotation.*; import org.springframework.core.env.Environment; @Configuration @EnableAspectJAutoProxy public class LoggingAspectConfiguration { @Bean @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT) public LoggingAspect loggingAspect(Environment env) { return new LoggingAspect(env); } }
[ "jhipster-bot@jhipster.tech" ]
jhipster-bot@jhipster.tech
bdb2193dd5ff4e9b8a69833cf8684ed2a09cce95
31d09ad67dfffe0ba97432286d07e42b05e50d4e
/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverKey.java
94ef0c12a953c0891a30bf6889700348c4efe57c
[ "Apache-2.0" ]
permissive
MarcelRaschke/bazel
0d92735e1afd4022156a59e3dbbe155c7791a7b2
1b2cf8d596a98abe3f02f711903435e060f76720
refs/heads/master
2023-08-31T11:44:09.493078
2022-03-16T15:35:12
2022-03-16T15:38:01
157,019,885
1
2
Apache-2.0
2023-04-04T00:14:50
2018-11-10T20:43:46
Java
UTF-8
Java
false
false
3,251
java
// Copyright 2021 The Bazel Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.devtools.build.lib.skyframe; import com.google.devtools.build.lib.actions.ActionLookupKey; import com.google.devtools.build.lib.analysis.TopLevelArtifactContext; import com.google.devtools.build.skyframe.SkyFunctionName; import com.google.devtools.build.skyframe.SkyKey; import java.util.Objects; /** * Wraps an {@link ActionLookupKey}. The evaluation of this SkyKey is the entry point of analyzing * the {@link ActionLookupKey} and executing the associated actions. */ public final class BuildDriverKey implements SkyKey { private final ActionLookupKey actionLookupKey; private final TopLevelArtifactContext topLevelArtifactContext; private final TestType testType; private final boolean strictActionConflictCheck; public BuildDriverKey( ActionLookupKey actionLookupKey, TopLevelArtifactContext topLevelArtifactContext, boolean strictActionConflictCheck) { this( actionLookupKey, topLevelArtifactContext, strictActionConflictCheck, /*testType=*/ TestType.NOT_TEST); } public BuildDriverKey( ActionLookupKey actionLookupKey, TopLevelArtifactContext topLevelArtifactContext, boolean strictActionConflictCheck, TestType testType) { this.actionLookupKey = actionLookupKey; this.topLevelArtifactContext = topLevelArtifactContext; this.strictActionConflictCheck = strictActionConflictCheck; this.testType = testType; } public TopLevelArtifactContext getTopLevelArtifactContext() { return topLevelArtifactContext; } public ActionLookupKey getActionLookupKey() { return actionLookupKey; } public boolean isTest() { return TestType.NOT_TEST.equals(testType); } public TestType getTestType() { return testType; } public boolean strictActionConflictCheck() { return strictActionConflictCheck; } @Override public SkyFunctionName functionName() { return SkyFunctions.BUILD_DRIVER; } @Override public boolean equals(Object other) { if (other instanceof BuildDriverKey) { BuildDriverKey otherBuildDriverKey = (BuildDriverKey) other; return actionLookupKey.equals(otherBuildDriverKey.actionLookupKey) && topLevelArtifactContext.equals(otherBuildDriverKey.topLevelArtifactContext); } return false; } @Override public int hashCode() { return Objects.hash(actionLookupKey, topLevelArtifactContext); } @Override public final String toString() { return String.format("ActionLookupKey: %s; TestType: %s", actionLookupKey, testType); } enum TestType { NOT_TEST, PARALLEL, EXCLUSIVE } }
[ "copybara-worker@google.com" ]
copybara-worker@google.com
c4bdb7bfa891000b7b72a58c54d0001685646c34
5126ac74da0fca4dc8c70f0a02dbde8edbc3d011
/1982-COMMONLIB-CLASES/src/portal/com/eje/tools/Excel.java
81ccd358e80f7dbf66bef4d8ca6f61b188e695d1
[]
no_license
franciscovillegas/1982-COMMONLIBS
be834b52bfa4fee132544b567359c5d71730c053
17c30a811f0bc2348b033b8ef2be9d91fa5c9517
refs/heads/master
2020-06-13T05:46:12.017269
2019-06-30T20:10:58
2019-06-30T20:10:58
194,552,549
0
0
null
null
null
null
UTF-8
Java
false
false
4,981
java
package portal.com.eje.tools; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.text.NumberFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; import cl.ejedigital.tool.strings.MyString; public class Excel extends File implements Iterator { /*VERSION 2.0*/ private int hojaActual =0; private boolean estaOK= true; private HSSFWorkbook wb = null; private HSSFRow filaActual; public Excel(String ruta) throws IOException { super(ruta); if(!exists()) { System.out.println("ERROR!!!!! No existe el archivo"); estaOK = false; } if(!isFile()) { System.out.println("ERROR!!!!! No es un archivo"); estaOK = false; } if(estaOK) { FileInputStream fi = new FileInputStream(this); POIFSFileSystem fs = new POIFSFileSystem(fi); fi.close(); wb = new HSSFWorkbook(fs); setHoja(1); } } public void close() { } public void setHoja(int hoja) { if(hoja <= getCantHojas() && hoja > 0) { hojaActual = hoja-1; filaActual = getFirstRow(wb.getSheetAt(hojaActual)); } else { System.out.println("La hoja no es valida"); } } public Iterator getRowIterator() { return this; } public ArrayList getNombreCampos() { ArrayList pila = new ArrayList(); try { HSSFSheet sheet = wb.getSheetAt(hojaActual); HSSFRow row = getFirstRow(sheet); for(int posCol=row.getFirstCellNum();posCol<row.getLastCellNum();posCol++) { HSSFCell cell = row.getCell((short)posCol); String celda = getValCell(cell); if(!"".equals(celda.trim())) { pila.add(celda); } } } catch (Exception e) { e.printStackTrace(); } return pila; } private String getValCell(HSSFCell cell) { String valor = null; if(cell != null) { switch(cell.getCellType()){ case HSSFCell.CELL_TYPE_BLANK: { valor =""; break; } case HSSFCell.CELL_TYPE_BOOLEAN: { valor = String.valueOf(cell.getBooleanCellValue()); } case HSSFCell.CELL_TYPE_NUMERIC: { NumberFormat f = NumberFormat.getInstance(); f.setGroupingUsed(false); valor = f.format(cell.getNumericCellValue()); break; } case HSSFCell.CELL_TYPE_STRING: { valor = cell.getRichStringCellValue().getString(); break; } case HSSFCell.CELL_TYPE_FORMULA: { valor = String.valueOf(cell.getNumericCellValue()); break; } case HSSFCell.CELL_TYPE_ERROR: { valor = "#N/A"; break; } } } return valor; } public HSSFRow getFirstRow(HSSFSheet sheet) { int firstRow = sheet.getFirstRowNum(); boolean encontroOrigen = false; HSSFRow row = null; try { row = sheet.getRow(firstRow); while(!encontroOrigen) { while(row == null) { row = sheet.getRow(++firstRow); } for(int posCol=row.getFirstCellNum();posCol<row.getLastCellNum();posCol++) { String valor = getValCell(row.getCell((short)posCol)); if(valor != null && !"".equals(valor) ) { encontroOrigen = true; break; } } if(!encontroOrigen) { row = null; } } } catch (Exception e) { e.printStackTrace(); } return row; } public int getCantHojas() { return wb.getNumberOfSheets(); } public ArrayList getNombreHojas() { ArrayList hojas = new ArrayList(); try { for(int i=0;i<getCantHojas();i++) { hojas.add(wb.getSheetName(i)); } } catch (Exception e) { e.printStackTrace(); } return hojas; } public void gotoStart() { filaActual = getFirstRow(wb.getSheetAt(hojaActual)); } public boolean hasNext() { return filaActual != null && filaActual.getRowNum() < wb.getSheetAt(hojaActual).getLastRowNum(); } public Object next() { HashMap lista = new HashMap(); filaActual = wb.getSheetAt(hojaActual).getRow(filaActual.getRowNum()+1); int i = 0 ; if(filaActual != null) { for(int posCol=filaActual.getFirstCellNum();posCol<filaActual.getLastCellNum();posCol++) { HSSFCell cell = filaActual.getCell((short)posCol); String celda = getValCell(cell); String key = String.valueOf(i++); lista.put(key, celda); } } return lista; } public void remove() { System.out.println("No se permite borrar"); } }
[ "francisco.villegas@peoplemanager.cl" ]
francisco.villegas@peoplemanager.cl
e0e9fc2f0fc69bcde31d597ce701260745754ce2
502563a9902ec79e6d918a6d300760b585d82cd9
/caffeine/src/main/java/com/github/benmanes/caffeine/cache/LocalManualCache.java
c4c30af2ef4db25a4e95de82241783c1a1789266
[ "Apache-2.0" ]
permissive
JunqiangYang/caffeine
a41e21e3bd3219aece3e9a5f47b96d364f5f24dc
689b72607e9639261c21fb39cfc2072ee3e741d9
refs/heads/master
2020-03-16T00:13:16.991296
2018-05-01T13:39:07
2018-05-02T08:22:10
132,410,735
1
0
null
null
null
null
UTF-8
Java
false
false
2,380
java
/* * Copyright 2015 Ben Manes. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.github.benmanes.caffeine.cache; import java.util.Map; import java.util.concurrent.ConcurrentMap; import java.util.function.Function; import javax.annotation.Nullable; import com.github.benmanes.caffeine.cache.stats.CacheStats; /** * This class provides a skeletal implementation of the {@link Cache} interface to minimize the * effort required to implement a {@link LocalCache}. * * @author ben.manes@gmail.com (Ben Manes) */ interface LocalManualCache<C extends LocalCache<K, V>, K, V> extends Cache<K, V> { /** Returns the backing {@link LocalCache} data store. */ C cache(); @Override default long estimatedSize() { return cache().estimatedSize(); } @Override default void cleanUp() { cache().cleanUp(); } @Override default @Nullable V getIfPresent(Object key) { return cache().getIfPresent(key, /* recordStats */ true); } @Override default @Nullable V get(K key, Function<? super K, ? extends V> mappingFunction) { return cache().computeIfAbsent(key, mappingFunction); } @Override default Map<K, V> getAllPresent(Iterable<?> keys) { return cache().getAllPresent(keys); } @Override default void put(K key, V value) { cache().put(key, value); } @Override default void putAll(Map<? extends K, ? extends V> map) { cache().putAll(map); } @Override default void invalidate(Object key) { cache().remove(key); } @Override default void invalidateAll(Iterable<?> keys) { cache().invalidateAll(keys); } @Override default void invalidateAll() { cache().clear(); } @Override default CacheStats stats() { return cache().statsCounter().snapshot(); } @Override default ConcurrentMap<K, V> asMap() { return cache(); } }
[ "ben.manes@gmail.com" ]
ben.manes@gmail.com
bb2d3a53944632f99f97921d5e48994af998d6f6
e05cf54cd7f2a6a3f95797f0ad4b6891156b82f3
/out/smali/android/support/v4/view/accessibility/AccessibilityRecordCompat$AccessibilityRecordIcsMr1Impl.java
86013352b2a21149151a8c80e2a4f64e888c1de1
[]
no_license
chenxiaoyoyo/KROutCode
fda014c0bdd9c38b5b79203de91634a71b10540b
f879c2815c4e1d570b6362db7430cb835a605cf0
refs/heads/master
2021-01-10T13:37:05.853091
2016-02-04T08:03:57
2016-02-04T08:03:57
49,871,343
0
0
null
null
null
null
UTF-8
Java
false
false
2,337
java
package android.support.v4.view.accessibility; class AccessibilityRecordCompat$AccessibilityRecordIcsMr1Impl { void a() { int a; a=0;// .class Landroid/support/v4/view/accessibility/AccessibilityRecordCompat$AccessibilityRecordIcsMr1Impl; a=0;// .super Landroid/support/v4/view/accessibility/AccessibilityRecordCompat$AccessibilityRecordIcsImpl; a=0;// .source "SourceFile" a=0;// a=0;// a=0;// # direct methods a=0;// .method constructor <init>()V a=0;// .locals 0 a=0;// a=0;// .prologue a=0;// .line 476 a=0;// invoke-direct {p0}, Landroid/support/v4/view/accessibility/AccessibilityRecordCompat$AccessibilityRecordIcsImpl;-><init>()V a=0;// a=0;// #p0=(Reference,Landroid/support/v4/view/accessibility/AccessibilityRecordCompat$AccessibilityRecordIcsMr1Impl;); a=0;// return-void a=0;// .end method a=0;// a=0;// a=0;// # virtual methods a=0;// .method public getMaxScrollX(Ljava/lang/Object;)I a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 479 a=0;// invoke-static {p1}, Landroid/support/v4/view/accessibility/AccessibilityRecordCompatIcsMr1;->getMaxScrollX(Ljava/lang/Object;)I a=0;// a=0;// move-result v0 a=0;// a=0;// #v0=(Integer); a=0;// return v0 a=0;// .end method a=0;// a=0;// .method public getMaxScrollY(Ljava/lang/Object;)I a=0;// .locals 1 a=0;// a=0;// .prologue a=0;// .line 484 a=0;// invoke-static {p1}, Landroid/support/v4/view/accessibility/AccessibilityRecordCompatIcsMr1;->getMaxScrollY(Ljava/lang/Object;)I a=0;// a=0;// move-result v0 a=0;// a=0;// #v0=(Integer); a=0;// return v0 a=0;// .end method a=0;// a=0;// .method public setMaxScrollX(Ljava/lang/Object;I)V a=0;// .locals 0 a=0;// a=0;// .prologue a=0;// .line 489 a=0;// invoke-static {p1, p2}, Landroid/support/v4/view/accessibility/AccessibilityRecordCompatIcsMr1;->setMaxScrollX(Ljava/lang/Object;I)V a=0;// a=0;// .line 490 a=0;// return-void a=0;// .end method a=0;// a=0;// .method public setMaxScrollY(Ljava/lang/Object;I)V a=0;// .locals 0 a=0;// a=0;// .prologue a=0;// .line 494 a=0;// invoke-static {p1, p2}, Landroid/support/v4/view/accessibility/AccessibilityRecordCompatIcsMr1;->setMaxScrollY(Ljava/lang/Object;I)V a=0;// a=0;// .line 495 a=0;// return-void a=0;// .end method }}
[ "chenyouzi@sogou-inc.com" ]
chenyouzi@sogou-inc.com