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
19753470bf6d8fd4d2c6ab49445b8f0552b9c526
4729acfca28e8ff347564129581444639efc188c
/app/src/main/java/com/example/quanlinhanvien/Danh_Sach.java
e7b7369cbbb2bbaa9a816bab153b45e907d781b6
[]
no_license
minhtien99tn/MinhTien
eac6e81b14d74719941cdf0b8f36b4e3952dcb81
53a33987650770bb574d9437330ae8ee2ea90aec
refs/heads/master
2022-04-11T01:00:28.729376
2020-04-11T09:43:44
2020-04-11T09:43:44
254,833,422
0
0
null
null
null
null
UTF-8
Java
false
false
3,432
java
package com.example.quanlinhanvien; import androidx.appcompat.app.AppCompatActivity; import android.app.Dialog; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.AdapterView; import android.widget.Button; import android.widget.ListAdapter; import android.widget.ListView; import android.widget.Toast; import java.util.ArrayList; import java.util.List; public class Danh_Sach extends AppCompatActivity { public ListView lvDanhSach; public ListNhanVienAdapter adapter; private ArrayList<NhanVien> arrayList; String table_name = "nhanvien"; public int maNV ; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_danh__sach); lvDanhSach = findViewById(R.id.lvDanhSach); loadData(table_name); clickListView(); } private void clickListView() { lvDanhSach.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { // Intent intent = new Intent(Danh_Sach.this,ChiTietNhanVien.class); // Bundle bundle = new Bundle(); // bundle.putInt("id",arrayList.get(position).getMaNV()); // intent.putExtras(bundle); // startActivity(intent); // Log.e("id gui", String.valueOf(arrayList.get(position).getMaNV())); // get id nhân viên maNV = arrayList.get(position).getMaNV(); ShowDiaLogConfirm(); } }); } private void ShowDiaLogConfirm() { final Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.custom_dialog_layout); Button btSua = dialog.findViewById(R.id.lvSua); Button btXoa = dialog.findViewById(R.id.lvXoa); dialog.show(); btSua.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Danh_Sach.this,ChiTietNhanVien.class); Bundle bundle = new Bundle(); bundle.putInt("id",maNV); intent.putExtras(bundle); startActivity(intent); Log.e("id gui", String.valueOf(maNV)); dialog.cancel(); } }); btXoa.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Xoa(); dialog.cancel(); } }); } private void Xoa() { Database_NV database_nv = new Database_NV(this); database_nv.delete_ID_NV(maNV,table_name); adapter.notifyDataSetChanged(); arrayList.clear(); loadData(table_name); } // đổ dữ liệu lên list view private void loadData(String table_name) { arrayList = new ArrayList<>(); Database_NV database_nv = new Database_NV(this); arrayList = database_nv.getAllNhanVien(table_name); adapter = new ListNhanVienAdapter(this,R.layout.item,arrayList); lvDanhSach.setAdapter(adapter); database_nv.close(); } }
[ "=" ]
=
cf2aa9e78384294930ce8e9fd5aaad5d6461a6c9
183931eedd8ed7ff685e22cb055f86f12a54d707
/HerbertSchildt/src/chap09_Package_Interface/Incomplete.java
ceb5d76cf4a34afe1fc0788c4ad4f56cca657a15
[]
no_license
cynepCTAPuk/headFirstJava
94a87be8f6958ab373cd1640a5bdb9c3cc3bf166
7cb45f6e2336bbc78852d297ad3474fd491e5870
refs/heads/master
2023-08-16T06:51:14.206516
2023-08-08T16:44:11
2023-08-08T16:44:11
154,661,091
0
1
null
2023-01-06T21:32:31
2018-10-25T11:40:54
Java
UTF-8
Java
false
false
165
java
package chap09_Package_Interface; abstract class Incomplete implements Callback { int a, b; void show() { System.out.println(a + " " + b); } }
[ "CTAPuk@gmail.com" ]
CTAPuk@gmail.com
04a9fd9323508471093b5a94d87cf8d11257f8db
f551ac18a556af60d50d32a175c8037aa95ec3ac
/base/com/enation/app/base/core/service/impl/AccessRecorder.java
bb6f81a2145dbf83f239162f608d002463d4fb46
[]
no_license
yexingf/cxcar
06dfc7b7970f09dae964827fcf65f19fa39d35d1
0ddcf144f9682fa2847b9a350be91cedec602c60
refs/heads/master
2021-05-15T05:40:04.396174
2018-01-09T09:46:18
2018-01-09T09:46:18
116,647,698
0
5
null
null
null
null
UTF-8
Java
false
false
7,976
java
package com.enation.app.base.core.service.impl; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import com.enation.app.base.core.model.Member; import com.enation.app.base.core.service.IAccessRecorder; import com.enation.eop.resource.model.Access; import com.enation.eop.resource.model.EopSite; import com.enation.eop.resource.model.ThemeUri; import com.enation.eop.sdk.context.EopContext; import com.enation.eop.sdk.database.BaseSupport; import com.enation.eop.sdk.user.UserServiceFactory; import com.enation.framework.context.spring.SpringContextHolder; import com.enation.framework.context.webcontext.ThreadContextHolder; import com.enation.framework.database.Page; import com.enation.framework.util.DateUtil; import com.enation.framework.util.RequestUtil; import com.enation.framework.util.ip.IPSeeker; /** * 访问记录器 * * @author kingapex 2010-7-23下午03:47:25 */ public class AccessRecorder extends BaseSupport implements IAccessRecorder { /** * 每次都从session中得到上一次的访问,如果不为空则计算停留时间,并记录上一次访问信息<br/> * 存在问题:无法记录最后一次访问 */ @Override public int record(ThemeUri themeUri) { HttpServletRequest request = ThreadContextHolder.getHttpRequest(); Access access = new Access(); access.setAccess_time((int) (System.currentTimeMillis() / 1000)); access.setIp(request.getRemoteAddr()); access.setPage(themeUri.getPagename()); access.setUrl(RequestUtil.getRequestUrl(request)); access.setPoint(themeUri.getPoint()); access.setArea(new IPSeeker().getCountry(access.getIp())); Member member = UserServiceFactory.getUserService().getCurrentMember(); if (member != null) access.setMembername(member.getUname()); Access last_access = (Access) ThreadContextHolder.getSessionContext().getAttribute("user_access"); if (last_access != null) { int stay_time = access.getAccess_time() - last_access.getAccess_time(); last_access.setStay_time(stay_time); int last = (int) (System.currentTimeMillis() / 1000 - 3600); // 上一个小时的秒数 String sql = "select count(0) from access where ip=? and url=? and access_time>=?"; // 记录一个小小时内不重复的ip int count = this.baseDaoSupport.queryForInt(sql, last_access.getIp(), last_access.getUrl(), last); if (count == 0) { EopSite site = EopContext.getContext().getCurrentSite(); int point = site.getPoint(); if (point == -1 || site.getIsimported() == 1) {// -1的点数表示不限制积分只记录访问记录 this.baseDaoSupport.insert("access", last_access); return 1; } if (point > access.getPoint()) { // 更新当前站点各积分 this.daoSupport.execute("update eop_site set point=point-? where id=?", last_access.getPoint(), site.getId()); this.baseDaoSupport.insert("access", last_access); site.setPoint(site.getPoint() - last_access.getPoint()); } else { return 0; } } } ThreadContextHolder.getSessionContext().setAttribute("user_access", access); return 1; } @Override public Page list(String starttime, String endtime, int pageNo, int pageSize) { // 默认的结束时间为当前 int now = (int) (System.currentTimeMillis() / 1000); // 默认开始时间为当前时间的前30天 int stime = (now - 3600 * 24 * 30); // 用户输入了开始时间,则以输入的时间为准 if (starttime != null) { stime = (int) (DateUtil.toDate(starttime, "yyyy-MM-dd").getTime() / 1000); } // 用户输入了结束时间,则以输入的时间为准 if (endtime != null) { now = (int) (DateUtil.toDate(endtime, "yyyy-MM-dd").getTime() / 1000); } String sql = "select ip,max(access_time) access_time,max(membername) mname,floor(access_time/86400) daytime,count(0) count,sum(stay_time) sum_stay_time,max(access_time) maxtime,min(access_time) mintime,sum(point) point from access where access_time>=? and access_time<=? group by ip,floor(access_time/86400) order by access_time desc"; sql = baseDaoSupport.buildPageSql(sql, pageNo, pageSize); List list = baseDaoSupport.queryForList(sql, stime, now); sql = "select count(0) from (select access_time from access where access_time>=? and access_time<=? group by ip, floor(access_time/86400)) tb"; int count = this.baseDaoSupport.queryForInt(sql, stime, now); Page page = new Page(0, count, pageSize, list); return page; } /** * 读取某个ip,某天的详细流量 * * @param ip * @param daytime * @return */ @Override public List detaillist(String ip, String daytime) { String sql = "select * from access where ip=? and floor(access_time/86400)=? order by access_time asc "; return this.baseDaoSupport.queryForList(sql, ip, daytime); } @Override public void export() { // 读取所有站点信息 String sql = "select * from eop_site "; List<Map> list = this.daoSupport.queryForList(sql); // 为每个用户开启一个线程导出上个月的流量数据 for (Map map : list) { AccessExporter accessExporter = SpringContextHolder.getBean("accessExporter"); accessExporter.setContext( Integer.valueOf(map.get("userid").toString()), Integer.valueOf(map.get("id").toString())); Thread thread = new Thread(accessExporter); thread.start(); } } @Override public Map<String, Long> census() { /** 日流量及日积分累计 **/ // 今天开始秒数 int todaystart = (int) (DateUtil.toDate(DateUtil.toString(new Date(), "yyyy-MM-dd 00:00"), "yyyy-MM-dd mm:ss").getTime() / 1000); // 今天 结束秒数 int todayend = (int) (System.currentTimeMillis() / 1000); // 日访问量 String sql = "select count(0) from access where access_time>=? and access_time<=?"; long todayaccess = this.baseDaoSupport.queryForLong(sql, todaystart, todayend); // 日累计消耗积分 sql = "select sum(point) from access where access_time>=? and access_time<=?"; long todaypoint = this.baseDaoSupport.queryForLong(sql, todaystart, todayend); /** 月流量及月积分累计 **/ String[] currentMonth = DateUtil.getCurrentMonth(); // 得到本月第一天和最后一天的字串数组 int monthstart = (int) (DateUtil.toDate(currentMonth[0], "yyyy-MM-dd").getTime() / 1000); // 本月第一天的秒数 int monthend = (int) (DateUtil.toDate(currentMonth[1], "yyyy-MM-dd").getTime() / 1000); // 本月最后一天的秒数 // 月访问量 sql = "select count(0) from access where access_time>=? and access_time<=?"; long monthaccess = this.baseDaoSupport.queryForLong(sql, monthstart, monthend); // 月消耗积分累计 sql = "select sum(point) from access where access_time>=? and access_time<=?"; long monthpoint = this.baseDaoSupport.queryForLong(sql, monthstart, monthend); /** 年流量及年积分累计 **/ // 查询历史(从开始至上个月) sql = "select sumpoint,sumaccess from eop_site where id=?"; List<Map> list = this.daoSupport.queryForList(sql, EopContext.getContext().getCurrentSite().getId()); if (list.isEmpty() || list == null || list.size() == 0) { throw new RuntimeException("站点[" + EopContext.getContext().getCurrentSite().getId() + "]不存在"); } Map siteData = list.get(0); long sumaccess = Long.valueOf("" + siteData.get("sumaccess")); long sumpoint = Long.valueOf("" + siteData.get("sumpoint")); // 累加本月 sumaccess += monthaccess; sumpoint += monthpoint; /** 压入统计数据map **/ Map<String, Long> sData = new HashMap<String, Long>(); sData.put("todayaccess", todayaccess); // 日访问量 sData.put("todaypoint", todaypoint); // 日消费积分 sData.put("monthaccess", monthaccess); // 月访问量 sData.put("monthpoint", monthpoint); // 月消费积分 sData.put("sumaccess", sumaccess); // 年访问量 sData.put("sumpoint", sumpoint); // 年消费积分 return sData; } }
[ "274674758_ye@sina.com" ]
274674758_ye@sina.com
bfefc09012832dc8cd81d7f296b2cfed0769e325
478106dd8b16402cc17cc39b8d65f6cd4e445042
/l2junity-gameserver/src/main/java/org/l2junity/gameserver/model/events/impl/character/player/OnPlayerEquipItem.java
0c020715ed261fa54c54d095063dadb63e6d535f
[]
no_license
czekay22/L2JUnderGround
9f014cf87ddc10d7db97a2810cc5e49d74e26cdf
1597b28eab6ec4babbf333c11f6abbc1518b6393
refs/heads/master
2020-12-30T16:58:50.979574
2018-09-28T13:38:02
2018-09-28T13:38:02
91,043,466
1
0
null
null
null
null
UTF-8
Java
false
false
1,546
java
/* * Copyright (C) 2004-2015 L2J Unity * * This file is part of L2J Unity. * * L2J Unity is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J Unity is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package org.l2junity.gameserver.model.events.impl.character.player; import org.l2junity.gameserver.model.actor.instance.PlayerInstance; import org.l2junity.gameserver.model.events.EventType; import org.l2junity.gameserver.model.events.impl.IBaseEvent; import org.l2junity.gameserver.model.items.instance.ItemInstance; /** * @author UnAfraid */ public class OnPlayerEquipItem implements IBaseEvent { private final PlayerInstance _activeChar; private final ItemInstance _item; public OnPlayerEquipItem(PlayerInstance activeChar, ItemInstance item) { _activeChar = activeChar; _item = item; } public PlayerInstance getActiveChar() { return _activeChar; } public ItemInstance getItem() { return _item; } @Override public EventType getType() { return EventType.ON_PLAYER_EQUIP_ITEM; } }
[ "unafraid89@gmail.com" ]
unafraid89@gmail.com
70a1cfa36a5d07978dd3857882172f28b0b570a8
daab099e44da619b97a7a6009e9dee0d507930f3
/rt/com/sun/xml/internal/ws/server/ServerSchemaValidationTube.java
7b17d3458aa2d97f55a8cb1f08375c69b4aac82a
[]
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
6,105
java
/* */ package com.sun.xml.internal.ws.server; /* */ /* */ import com.sun.xml.internal.ws.api.SOAPVersion; /* */ import com.sun.xml.internal.ws.api.WSBinding; /* */ import com.sun.xml.internal.ws.api.message.Message; /* */ import com.sun.xml.internal.ws.api.message.Packet; /* */ import com.sun.xml.internal.ws.api.model.SEIModel; /* */ import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; /* */ import com.sun.xml.internal.ws.api.pipe.NextAction; /* */ import com.sun.xml.internal.ws.api.pipe.Tube; /* */ import com.sun.xml.internal.ws.api.pipe.TubeCloner; /* */ import com.sun.xml.internal.ws.api.pipe.helper.AbstractTubeImpl; /* */ import com.sun.xml.internal.ws.api.server.WSEndpoint; /* */ import com.sun.xml.internal.ws.fault.SOAPFaultBuilder; /* */ import com.sun.xml.internal.ws.model.CheckedExceptionImpl; /* */ import com.sun.xml.internal.ws.util.pipe.AbstractSchemaValidationTube; /* */ import java.util.logging.Level; /* */ import java.util.logging.Logger; /* */ import javax.xml.transform.Source; /* */ import javax.xml.validation.Schema; /* */ import javax.xml.validation.Validator; /* */ import javax.xml.ws.WebServiceException; /* */ import org.xml.sax.SAXException; /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ public class ServerSchemaValidationTube /* */ extends AbstractSchemaValidationTube /* */ { /* 57 */ private static final Logger LOGGER = Logger.getLogger(ServerSchemaValidationTube.class.getName()); /* */ /* */ private final Schema schema; /* */ /* */ private final Validator validator; /* */ /* */ private final boolean noValidation; /* */ private final SEIModel seiModel; /* */ private final WSDLPort wsdlPort; /* */ /* */ public ServerSchemaValidationTube(WSEndpoint endpoint, WSBinding binding, SEIModel seiModel, WSDLPort wsdlPort, Tube next) { /* 68 */ super(binding, next); /* 69 */ this.seiModel = seiModel; /* 70 */ this.wsdlPort = wsdlPort; /* */ /* 72 */ if (endpoint.getServiceDefinition() != null) { /* 73 */ AbstractSchemaValidationTube.MetadataResolverImpl mdresolver = new AbstractSchemaValidationTube.MetadataResolverImpl(this, endpoint.getServiceDefinition()); /* 74 */ Source[] sources = getSchemaSources(endpoint.getServiceDefinition(), mdresolver); /* 75 */ for (Source source : sources) { /* 76 */ LOGGER.fine("Constructing service validation schema from = " + source.getSystemId()); /* */ } /* */ /* 79 */ if (sources.length != 0) { /* 80 */ this.noValidation = false; /* 81 */ this.sf.setResourceResolver(mdresolver); /* */ try { /* 83 */ this.schema = this.sf.newSchema(sources); /* 84 */ } catch (SAXException e) { /* 85 */ throw new WebServiceException(e); /* */ } /* 87 */ this.validator = this.schema.newValidator(); /* */ return; /* */ } /* */ } /* 91 */ this.noValidation = true; /* 92 */ this.schema = null; /* 93 */ this.validator = null; /* */ } /* */ /* */ protected Validator getValidator() { /* 97 */ return this.validator; /* */ } /* */ /* */ protected boolean isNoValidation() { /* 101 */ return this.noValidation; /* */ } /* */ /* */ /* */ public NextAction processRequest(Packet request) { /* 106 */ if (isNoValidation() || !this.feature.isInbound() || !request.getMessage().hasPayload() || request.getMessage().isFault()) { /* 107 */ return super.processRequest(request); /* */ } /* */ try { /* 110 */ doProcess(request); /* 111 */ } catch (SAXException se) { /* 112 */ LOGGER.log(Level.WARNING, "Client Request doesn't pass Service's Schema Validation", se); /* */ /* */ /* */ /* 116 */ SOAPVersion soapVersion = this.binding.getSOAPVersion(); /* 117 */ Message faultMsg = SOAPFaultBuilder.createSOAPFaultMessage(soapVersion, (CheckedExceptionImpl)null, se, soapVersion.faultCodeClient); /* */ /* 119 */ return doReturnWith(request.createServerResponse(faultMsg, this.wsdlPort, this.seiModel, this.binding)); /* */ } /* */ /* 122 */ return super.processRequest(request); /* */ } /* */ /* */ /* */ public NextAction processResponse(Packet response) { /* 127 */ if (isNoValidation() || !this.feature.isOutbound() || response.getMessage() == null || !response.getMessage().hasPayload() || response.getMessage().isFault()) { /* 128 */ return super.processResponse(response); /* */ } /* */ try { /* 131 */ doProcess(response); /* 132 */ } catch (SAXException se) { /* */ /* 134 */ throw new WebServiceException(se); /* */ } /* 136 */ return super.processResponse(response); /* */ } /* */ /* */ protected ServerSchemaValidationTube(ServerSchemaValidationTube that, TubeCloner cloner) { /* 140 */ super(that, cloner); /* */ /* 142 */ this.schema = that.schema; /* 143 */ this.validator = this.schema.newValidator(); /* 144 */ this.noValidation = that.noValidation; /* 145 */ this.seiModel = that.seiModel; /* 146 */ this.wsdlPort = that.wsdlPort; /* */ } /* */ /* */ public AbstractTubeImpl copy(TubeCloner cloner) { /* 150 */ return new ServerSchemaValidationTube(this, cloner); /* */ } /* */ } /* Location: D:\tools\env\Java\jdk1.8.0_211\rt.jar!\com\sun\xml\internal\ws\server\ServerSchemaValidationTube.class * Java compiler version: 8 (52.0) * JD-Core Version: 1.1.3 */
[ "xknower@126.com" ]
xknower@126.com
04b7f9b3cf1fb7af1240d8617c6dfccc5282e130
d60e287543a95a20350c2caeabafbec517cabe75
/LACCPlus/Hadoop/2671_2.java
b778237ebca24b10c7e8da70d03628d18fa62ef2
[ "MIT" ]
permissive
sgholamian/log-aware-clone-detection
242067df2db6fd056f8d917cfbc143615c558b2c
9993cb081c420413c231d1807bfff342c39aa69a
refs/heads/main
2023-07-20T09:32:19.757643
2021-08-27T15:02:50
2021-08-27T15:02:50
337,837,827
0
0
null
null
null
null
UTF-8
Java
false
false
541
java
//,temp,TestWebHdfsFileSystemContract.java,188,198,temp,TestToken.java,108,119 //,3 public class xxx { @Test public void testDecodeWritableArgSanityCheck() throws Exception { Token<AbstractDelegationTokenIdentifier> token = new Token<AbstractDelegationTokenIdentifier>(); try { token.decodeFromUrlString(null); fail("Should have thrown HadoopIllegalArgumentException"); } catch (HadoopIllegalArgumentException e) { Token.LOG.info("Test decodeWritable() sanity check success."); } } };
[ "sgholami@uwaterloo.ca" ]
sgholami@uwaterloo.ca
9c20d86b4cec9c0d5daebd0167cf430b9585c811
ed5159d056e98d6715357d0d14a9b3f20b764f89
/test/irvine/oeis/a067/A067333Test.java
54d4c5a6f349967fc8e9ebe1715ded0baa28722d
[]
no_license
flywind2/joeis
c5753169cf562939b04dd246f8a2958e97f74558
e5efd6971a0062ac99f4fae21a7c78c9f9e74fea
refs/heads/master
2020-09-13T18:34:35.080552
2019-11-19T05:40:55
2019-11-19T05:40:55
null
0
0
null
null
null
null
UTF-8
Java
false
false
195
java
package irvine.oeis.a067; import irvine.oeis.AbstractSequenceTest; /** * Tests the corresponding class. * @author Sean A. Irvine */ public class A067333Test extends AbstractSequenceTest { }
[ "sean.irvine@realtimegenomics.com" ]
sean.irvine@realtimegenomics.com
ca45f76c318cbe917a0886bba1bcedf394cf22a0
5765c87fd41493dff2fde2a68f9dccc04c1ad2bd
/Variant Programs/2-2/1/server/LongerInitialization.java
8bed1dcc7405a7c3b900470e34eb49f73d6b3623
[ "MIT" ]
permissive
hjc851/Dataset2-HowToDetectAdvancedSourceCodePlagiarism
42e4c2061c3f8da0dfce760e168bb9715063645f
a42ced1d5a92963207e3565860cac0946312e1b3
refs/heads/master
2020-08-09T08:10:08.888384
2019-11-25T01:14:23
2019-11-25T01:14:23
214,041,532
0
0
null
null
null
null
UTF-8
Java
false
false
2,330
java
package server; import shipper.Yardmaster; import server.Controller; import server.Sue; import java.util.Comparator; import java.util.PriorityQueue; public class LongerInitialization extends server.Controller { private java.util.PriorityQueue<Sue> fixJumping; private java.util.Comparator<Sue> reference; public LongerInitialization() { this.reference = new ActComparable(); this.fixJumping = new java.util.PriorityQueue<>(5, reference); } private class ActComparable implements Comparator<Sue> { public int compare(Sue pl, Sue f2) { int p2Other = pl.canChairmanAmount() - pl.catchJettingWhen(); int ajRetaining = f2.canChairmanAmount() - f2.catchJettingWhen(); if (p2Other < ajRetaining) { return -1; } if (p2Other > ajRetaining) { return 1; } return 0; } } public String callbackConstitute() { return "SRT:"; } public void weapMark() { if (flowProcedures != null) { flowProcedures.placedJettingWhen(flowProcedures.catchJettingWhen() + 1); if (flowProcedures.catchJettingWhen() == flowProcedures.canChairmanAmount()) { flowProcedures.dictatedLossMeter(this.goPrevailingClick()); this.performedTreat.addLast(flowProcedures); flowProcedures = null; this.dikTorch = true; } } if (!fixJumping.isEmpty() && flowProcedures != null) { int flowAdditional = flowProcedures.canChairmanAmount() - flowProcedures.catchJettingWhen(); int glimpseUnexpended = fixJumping.peek().canChairmanAmount() - fixJumping.peek().catchJettingWhen(); if (glimpseUnexpended < flowAdditional) { fixJumping.add(flowProcedures); flowProcedures = null; this.dikTorch = true; } } if (this.dikTorch && flowProcedures == null) { this.unexhaustedTelaMoment--; if (unexhaustedTelaMoment == 0) { this.dikTorch = false; this.unexhaustedTelaMoment = Yardmaster.SentYears; } } else { if (flowProcedures == null && !fixJumping.isEmpty()) { flowProcedures = fixJumping.poll(); burdensMethods(flowProcedures); flowProcedures.orderedOriginateChance(this.goPrevailingClick()); } } } public void workElect(Sue treat) { fixJumping.add(treat); } }
[ "hayden.cheers@me.com" ]
hayden.cheers@me.com
4831e1df1bde4c20b9eab039056d9325111b9499
09b7f281818832efb89617d6f6cab89478d49930
/root/modules/sharepoint/amp/source/java/org/alfresco/module/vti/metadata/model/DwsData.java
208c90dec4cda184aa83352fc69202afd5bdcbae
[]
no_license
verve111/alfresco3.4.d
54611ab8371a6e644fcafc72dc37cdc3d5d8eeea
20d581984c2d22d5fae92e1c1674552c1427119b
refs/heads/master
2023-02-07T14:00:19.637248
2020-12-25T10:19:17
2020-12-25T10:19:17
323,932,520
1
1
null
null
null
null
UTF-8
Java
false
false
5,702
java
/* * Copyright (C) 2005-2010 Alfresco Software Limited. * * This file is part of Alfresco * * Alfresco 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. * * Alfresco is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with Alfresco. If not, see <http://www.gnu.org/licenses/>. */ package org.alfresco.module.vti.metadata.model; import java.io.Serializable; import java.util.List; /** * <p>The GetDwsData class is used to store general information about the Document * Workspace site as well as its members, documents, links, and tasks.</p> * * @author AndreyAk * */ public class DwsData implements Serializable { private static final long serialVersionUID = 7388705900532472455L; private String title; private String lastUpdate; private UserBean user; private List<MemberBean> members; private List<AssigneeBean> assignees; private List<TaskBean> tasksList; private List<DocumentBean> documentsList; private List<LinkBean> linksList; private boolean minimal; private String docLibUrl; /** * @param title * @param lastUpdate * @param user * @param members * @param assignees * @param tasksList * @param documentsList * @param linksList */ public DwsData(String title, String lastUpdate, UserBean user, List<MemberBean> members, List<AssigneeBean> assignees, List<TaskBean> tasksList, List<DocumentBean> documentsList, List<LinkBean> linksList, boolean minimal) { super(); this.title = title; this.lastUpdate = lastUpdate; this.user = user; this.members = members; this.assignees = assignees; this.tasksList = tasksList; this.documentsList = documentsList; this.linksList = linksList; this.minimal = minimal; } /** * Default constructor */ public DwsData() { } /** * * @return the assignees */ public List<AssigneeBean> getAssignees() { return assignees; } /** * * @param assignees the assignees to set */ public void setAssignees(List<AssigneeBean> assignees) { this.assignees = assignees; } /** * * @return the title */ public String getTitle() { return title; } /** * <p>Sets the dws title.</p> * * @param title the title to set */ public void setTitle(String title) { this.title = title; } /** * * @return the lastUpdate */ public String getLastUpdate() { return lastUpdate; } /** * <p>Sets the last update date.</p> * * @param lastUpdate the lastUpdate to set */ public void setLastUpdate(String lastUpdate) { this.lastUpdate = lastUpdate; } /** * * @return the user */ public UserBean getUser() { return user; } /** * <p>Sets the current user.</p> * * @param user the user to set */ public void setUser(UserBean user) { this.user = user; } /** * * @return the members */ public List<MemberBean> getMembers() { return members; } /** * <p>Sets the list of the dws members.</p> * * @param members the members to set */ public void setMembers(List<MemberBean> members) { this.members = members; } /** * @return the tasksList */ public List<TaskBean> getTasksList() { return tasksList; } /** * <p>Sets the list of dws tasks.</p> * * @param tasksList the tasksList to set */ public void setTasksList(List<TaskBean> tasksList) { this.tasksList = tasksList; } /** * @return the documentsList */ public List<DocumentBean> getDocumentsList() { return documentsList; } /** * <p>Sets the list of dws documents.</p> * * @param documentsList the documentsList to set */ public void setDocumentsList(List<DocumentBean> documentsList) { this.documentsList = documentsList; } /** * @return the linksList */ public List<LinkBean> getLinksList() { return linksList; } /** * <p>Sets the list of dws links.</p> * * @param linksList the linksList to set */ public void setLinksList(List<LinkBean> linksList) { this.linksList = linksList; } /** * @return the minimal */ public boolean isMinimal() { return minimal; } /** * @param minimal the minimal to set */ public void setMinimal(boolean minimal) { this.minimal = minimal; } /** * <p>Sets the url of the document library for the dws.</p> * * @param docLibUrl the docLibUrl to set */ public void setDocLibUrl(String docLibUrl) { this.docLibUrl = docLibUrl; } /** * * @return the docLibUrl */ public String getDocLibUrl() { return docLibUrl; } }
[ "verve111@mail.ru" ]
verve111@mail.ru
5152c479bb2d75ca9d7a665a2143946e57ba6f8f
12952ca4f2bd3dfe29e8f3c0938d6b6d465c8e1a
/lzw-CMS-Facade/src/main/java/com/deehow/model/SendMsg.java
de5687929995ad70f443349bce518eefe88718e0
[]
no_license
lzw1017400172/EC
277e012d9c8392879e7f95d8b338c5027396bfff
2b3ab54098739968afe7b1d382c1ae73634ff45f
refs/heads/master
2020-04-14T12:04:22.095057
2019-01-02T11:02:09
2019-01-02T11:02:09
163,830,001
0
0
null
null
null
null
UTF-8
Java
false
false
1,177
java
package com.deehow.model; import java.io.Serializable; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; @ApiModel @SuppressWarnings("serial") public class SendMsg implements Serializable { @ApiModelProperty(value = "短信类型:1.用户注册验证码2.登录确认验证码3.修改密码验证码4.身份验证验证码5.信息变更验证码6.活动确认验证码", required = true) private String msgType; @ApiModelProperty(value = "手机号", required = true) private String phone; @ApiModelProperty(value = "短信参数", required = false) private String params; @ApiModelProperty(value = "发送人", required = false) private String sender; public String getMsgType() { return msgType; } public void setMsgType(String msgType) { this.msgType = msgType; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getParams() { return params; } public void setParams(String params) { this.params = params; } public String getSender() { return sender; } public void setSender(String sender) { this.sender = sender; } }
[ "admin@example.com" ]
admin@example.com
a868122231991f13d77479ba7b0e27ffa9921b51
d4c6bbb6d916d21f591e428d51e9db824c8388ca
/src/test/java/com/kennycason/soroban/parser/PrefixParserTest.java
8e73d4f72918b8d00c29107ea71fab24f43ca61d
[]
no_license
kennycason/recursive_descent
8ec35d19ae2c910fe6346c12d43ef0db2f4436ef
92bbe6b9b518a5164b57134b16fd4e4ab1f5c055
refs/heads/master
2021-01-10T08:18:26.162834
2016-03-08T05:21:52
2016-03-08T05:21:52
53,384,700
0
0
null
null
null
null
UTF-8
Java
false
false
2,735
java
package com.kennycason.soroban.parser; import com.kennycason.soroban.lexer.tokenizer.CharacterStream; import com.kennycason.soroban.lexer.tokenizer.ExpressionTokenizer; import com.kennycason.soroban.parser.prefix.ast.AstNode; import com.kennycason.soroban.parser.prefix.PrefixParser; import org.junit.Test; import static org.junit.Assert.assertEquals; /** * Created by kenny on 3/2/16. */ public class PrefixParserTest { private final ExpressionTokenizer expressionTokenizer = new ExpressionTokenizer(); private final PrefixParser prefixParser = new PrefixParser(); @Test public void prefixFunctions() { final AstNode root = parse("sin(10)"); assertEquals("sin", root.getToken().getValue()); assertEquals(1, root.getChildren().size()); assertEquals("10", root.getChildren().get(0).getToken().getValue()); final AstNode root2 = parse("cos(x)"); assertEquals("cos", root2.getToken().getValue()); assertEquals(1, root2.getChildren().size()); assertEquals("x", root2.getChildren().get(0).getToken().getValue()); final AstNode root3 = parse("cos(sin(x))"); assertEquals("cos", root3.getToken().getValue()); assertEquals(1, root3.getChildren().size()); assertEquals("sin", root3.getChildren().get(0).getToken().getValue()); assertEquals(1, root3.getChildren().get(0).getChildren().size()); assertEquals("x", root3.getChildren().get(0).getChildren().get(0).getToken().getValue()); final AstNode root4 = parse("add(10 20)"); assertEquals("add", root4.getToken().getValue()); assertEquals(2, root4.getChildren().size()); assertEquals("10", root4.getChildren().get(0).getToken().getValue()); assertEquals("20", root4.getChildren().get(1).getToken().getValue()); } @Test public void nestedTest() { final AstNode root5 = parse("add(sin(10) cos(20))"); assertEquals("add", root5.getToken().getValue()); assertEquals(2, root5.getChildren().size()); assertEquals("sin", root5.getChildren().get(0).getToken().getValue()); assertEquals(1, root5.getChildren().get(0).getChildren().size()); assertEquals("10", root5.getChildren().get(0).getChildren().get(0).getToken().getValue()); assertEquals("cos", root5.getChildren().get(1).getToken().getValue()); assertEquals(1, root5.getChildren().get(1).getChildren().size()); assertEquals("20", root5.getChildren().get(1).getChildren().get(0).getToken().getValue()); } private AstNode parse(final String expr) { return prefixParser.parse( expressionTokenizer.tokenize(new CharacterStream(expr))); } }
[ "kenneth.cason@gmail.com" ]
kenneth.cason@gmail.com
33b8f7717ba535c625f36bf8b216eed5c7c083db
d593ad37a82a6396effceaf11679e70fddcabc06
/stepbystep/DBAdvLabCustomer/src/com/andro/CustomerListActivity.java
ed8b70a4aa07640f43d4104ab7ca106da60745c6
[]
no_license
psh667/android
8a18ea22c8c977852ba2cd9361a8489586e06f05
8f7394de8e26ce5106d9828cf95eb1617afca757
refs/heads/master
2018-12-27T23:30:46.988404
2013-09-09T13:16:46
2013-09-09T13:16:46
12,700,292
3
5
null
null
null
null
UHC
Java
false
false
3,788
java
package com.andro; import android.app.Activity; import android.content.Intent; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteException; import android.graphics.Color; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.LinearLayout; import android.widget.TextView; public class CustomerListActivity extends Activity implements OnClickListener { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.query); LinearLayout layout = (LinearLayout) findViewById(R.id.customers); try { // DBManager 객체 생성(DB 존재 않으면 생성) DBManager dbmgr = new DBManager(this); // DB 연결 SQLiteDatabase sdb = dbmgr.getReadableDatabase(); // SQL문 실행 결과를 cursor 객체로 받음 String sql = "select name, sex, sms, interest " + " from customers "; Cursor cursor = sdb.rawQuery(sql, null); int i=0; // cursor 객체로 할당된 members 테이블 데이터를 한 행씩 이동하면서 출력함 while(cursor.moveToNext()) { // 행의 첫 번째 열(0), ..., 네 번째 열(3)을 각각 추출함 String name = cursor.getString(0); String sex = cursor.getString(1); String sms = cursor.getString(2); String interest = cursor.getString(3); TextView tv_list = new TextView(this); // TextView로 데이터를 추가하면서 출력함 tv_list.append(name); tv_list.setTextSize(20); tv_list.setTextColor(Color.rgb(255, 255, 0)); tv_list.setBackgroundColor(Color.rgb(0, 0, 255)); layout.addView(tv_list); tv_list.setId(i); tv_list.setOnClickListener(this); tv_list.setTag(name); TextView tv_list2 = new TextView(this); // TextView로 데이터를 추가하면서 출력함 tv_list2.append(sex + "\n"); tv_list2.append(sms + "\n"); tv_list2.append(interest); layout.addView(tv_list2); i++; } // 등록된 고객이 없는 경우의 설명 if (i == 0) { TextView tv_desc = new TextView(this); tv_desc.append("등록된 고객이 없습니다!"); layout.addView(tv_desc); } // cursor 객체 닫음 cursor.close(); // dbmgr 객체 닫음 dbmgr.close(); } catch (SQLiteException e) { // DB 접속 또는 조회 시 에러 발생할 때 TextView tv_err = new TextView(this); // tv_desc.append("등록된 고객이 없습니다!"); tv_err.append(e.getMessage()); layout.addView(tv_err); } } // '등록' 버튼이 클릭되었을 때 public void onClick(View v) { Intent it = new Intent(); // 현재 클래스(this)에서 호출할 클래스(JoinLabActivity.class) 지정 it = new Intent(this, CustomerDetailActivity.class); // 입력한 성명의 값을 저장 it.putExtra("it_name", (String)v.getTag()); // 인텐트에서 지정한 액티비티 실행 startActivity(it); // 현재 엑티비티 종료 finish(); } }
[ "paksan@daum.net" ]
paksan@daum.net
35ee3b7e283b68dc61cbc85c6be33a039b9392e6
5c509e06e96b9f1e4bfa4a0e342d2b89ab930ead
/org.jiemamy.eclipse.core.ui/src/org/jiemamy/eclipse/core/ui/editor/action/FitNodeConstraintAction.java
aace5c50be49f475ab470a12c2a40dbe059f03bf
[ "Apache-2.0" ]
permissive
Jiemamy/jiemamy-eclipse-plugin
872281e54ef38dc4e212f6f8d72f6a0c8ce443e1
5519c2805825bec33dc902979b44f01f50cdb982
refs/heads/master
2021-03-12T19:15:15.934429
2012-03-03T01:31:24
2012-03-03T01:31:24
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,147
java
/* * Copyright 2007-2012 Jiemamy Project and the Others. * Created on 2008/08/03 * * This file is part of Jiemamy. * * 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.jiemamy.eclipse.core.ui.editor.action; import org.eclipse.gef.GraphicalViewer; import org.eclipse.gef.commands.Command; import org.eclipse.gef.commands.CommandStack; import org.jiemamy.JiemamyContext; import org.jiemamy.eclipse.core.ui.TODO; import org.jiemamy.eclipse.core.ui.editor.diagram.node.ChangeNodeConstraintCommand; import org.jiemamy.model.SimpleJmNode; import org.jiemamy.model.geometory.JmRectangle; /** * ノードのサイズをフィット(デフォルトサイズに変更)させるアクション。 * * @author daisuke */ public class FitNodeConstraintAction extends AbstractJiemamyAction { /** * インスタンスを生成する。 * * @param viewer ビューア */ public FitNodeConstraintAction(GraphicalViewer viewer) { super(Messages.FitNodeConstraintAction_name, viewer); } @Override public void run() { JiemamyContext context = (JiemamyContext) getViewer().getContents().getModel(); Object model = getViewer().getFocusEditPart().getModel(); if (model instanceof SimpleJmNode) { SimpleJmNode node = (SimpleJmNode) model; CommandStack stack = getViewer().getEditDomain().getCommandStack(); JmRectangle boundary = node.getBoundary(); JmRectangle newBoundary = new JmRectangle(boundary.x, boundary.y, -1, -1); Command command = new ChangeNodeConstraintCommand(context, TODO.DIAGRAM_INDEX, node, newBoundary, getViewer()); stack.execute(command); } } }
[ "dai.0304@gmail.com" ]
dai.0304@gmail.com
3ff40b2b12bb792c3de3c6bbffaef0f977a5fed8
94f4276a0708da5f2e8335d1d3734ba57edc4015
/jooby/src/main/java/org/jooby/internal/reqparam/UploadParamConverter.java
816b58ca3e88d637325a44fb42d012cd5a7fac35
[ "Apache-2.0" ]
permissive
dylanleung/jooby
0773fe0c26130e67d884da8eec8d11b912699a3a
54ba1fffd086ac8bf041660b10f91859a51648bd
refs/heads/master
2021-05-28T15:31:15.524152
2015-03-09T00:08:54
2015-03-09T00:08:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,310
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.jooby.internal.reqparam; import org.jooby.ParamConverter; import org.jooby.Upload; import com.google.inject.TypeLiteral; public class UploadParamConverter implements ParamConverter { @Override public Object convert(final TypeLiteral<?> toType, final Object[] values, final Context ctx) throws Exception { if (Upload.class == toType.getRawType() && values[0] instanceof Upload) { return values[0]; } else { return ctx.convert(toType, values); } } }
[ "espina.edgar@gmail.com" ]
espina.edgar@gmail.com
01d07a2e495ae0d208364aa935fa3b7756af92ba
e0c271f609dce516ee3d063c6d7472ea689442ff
/IEDUWeb/src/SQL/MyDBCP.java
9f6916281a8987a78e89a65900d0734c9c7bf2fa
[]
no_license
bym90/Java-Web
d99edb4b61b0daa94abc71f1fcc66e4c9328ce44
74cf88a9e78799b5b5f4191b0d58af28474a9d88
refs/heads/master
2021-01-12T16:14:26.007241
2016-10-26T01:40:01
2016-10-26T01:40:01
71,954,347
0
0
null
null
null
null
UTF-8
Java
false
false
2,220
java
package SQL; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.Statement; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.sql.DataSource; /* * 커넥션 풀을 사용해서 커넥션을 시키는 유틸리티 클래스 */ public class MyDBCP { DataSource ds = null; public MyDBCP() { // 1. context.xml 파일에 등록한 내용을 알아내기 휘애서 // context.xml 파일을 읽을수 있는 클래스를 생성 try { Context context = new InitialContext(); // 2. context.xml 파일 중에서 커넥션 풀에 관련된 내용을 찾는다 // context.xml에서 제공하는 리소스를 찾는 방법 // 1> "java:comp/env/찾고자하는 리소스 이름 ds = (DataSource) context.lookup("java:comp/env/jdbc/mydb"); } catch (Exception e) { e.printStackTrace(); } } public Connection getCON() { Connection con = null; try { con = ds.getConnection(); } catch (Exception e) { e.printStackTrace(); } return con; } public Statement getSTMT(Connection con) { Statement stmt = null; try { stmt = con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); } catch (Exception e) { e.printStackTrace(); } return stmt; } public PreparedStatement getPSTMT(String sql, Connection con) { PreparedStatement pstmt = null; try { pstmt = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); } catch (Exception e) { e.printStackTrace(); } return pstmt; } public void close(Object obj) { try { if (obj instanceof Connection) { Connection temp = (Connection) obj; temp.close(); } else if (obj instanceof Statement) { Statement temp = (Statement) obj; temp.close(); } else if (obj instanceof ResultSet) { ResultSet temp = (ResultSet) obj; temp.close(); } else if (obj instanceof PreparedStatement) { PreparedStatement temp = (PreparedStatement) obj; temp.close(); } } catch (Exception e) { e.printStackTrace(); } } }
[ "qodudals90@naver.com" ]
qodudals90@naver.com
5e33714a9738584d1adf2fe5a77383d075097fbe
907ea8b2e3af5035ee640c95c646d6a04a192d41
/xTotem/bin/source/be/ac/ulg/montefiore/run/totem/scenario/model/FastIPMetric.java
047b64cde509a5bbcc509a6352f87a5d6602ccb3
[]
no_license
cuchy/TTools
8869ee47d3c489d95fa2c8b454757aee521cd705
37527c5a60360f0ddef7398a34296ab332810e0c
refs/heads/master
2021-01-11T10:39:05.100786
2016-11-05T21:25:29
2016-11-05T21:25:29
72,948,537
0
1
null
null
null
null
UTF-8
Java
false
false
6,402
java
/* TOTEM-v3.2 June 18 2008*/ /* * =========================================================== * TOTEM : A TOolbox for Traffic Engineering Methods * =========================================================== * * (C) Copyright 2004-2006, by Research Unit in Networking RUN, University of Liege. All Rights Reserved. * * Project Info: http://totem.run.montefiore.ulg.ac.be * * This library is free software; you can redistribute it and/or modify it under the terms * of the GNU General Public License version 2.0 as published by the Free Software Foundation; * * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this * library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307, USA. * * [Java is a trademark or registered trademark of Sun Microsystems, Inc. * in the United States and other countries.] */ package be.ac.ulg.montefiore.run.totem.scenario.model; import java.io.IOException; import java.util.Iterator; import java.util.List; import org.apache.log4j.Logger; import be.ac.ucl.poms.repository.FastIPMetricGeneration.FastIPMetricGeneration; import be.ac.ulg.montefiore.run.totem.scenario.model.jaxb.impl.FastIPMetricImpl; import be.ac.ulg.montefiore.run.totem.scenario.exception.EventExecutionException; import be.ac.ulg.montefiore.run.totem.scenario.facade.ScenarioExecutionContext; import be.ac.ulg.montefiore.run.totem.util.FileFunctions; import be.ac.ulg.montefiore.run.totem.util.DoubleArrayAnalyse; import be.ac.ulg.montefiore.run.totem.domain.facade.InterDomainManager; import be.ac.ulg.montefiore.run.totem.domain.exception.InvalidDomainException; import be.ac.ulg.montefiore.run.totem.domain.exception.LinkNotFoundException; import be.ac.ulg.montefiore.run.totem.domain.exception.NodeNotFoundException; import be.ac.ulg.montefiore.run.totem.domain.model.Domain; import be.ac.ulg.montefiore.run.totem.trafficMatrix.model.TrafficMatrix; import be.ac.ulg.montefiore.run.totem.trafficMatrix.facade.TrafficMatrixManager; import be.ac.ulg.montefiore.run.totem.trafficMatrix.exception.InvalidTrafficMatrixException; import be.ac.ulg.montefiore.run.totem.repository.model.TotemActionList; import be.ac.ulg.montefiore.run.totem.repository.model.TotemAction; import be.ac.ucl.poms.repository.model.*; import be.ac.ucl.poms.repository.model.UpdateIGPWeightsAction; /** * This class implements an event that generates heuristic weights for IGP routing * and prints the result * <p>Creation date: 20-March-2008 * * @author Hakan Umit (hakan.umit@uclouvain.be) */ public class FastIPMetric extends FastIPMetricImpl implements Event { private static final Logger logger = Logger.getLogger(FastIPMetric.class); public FastIPMetric() {} /** * @see be.ac.ulg.montefiore.run.totem.scenario.model.Event#action() */ public EventResult action() throws EventExecutionException { logger.info("Processing a compute MCF event."); FastIPMetricGeneration mcf; try { if ((!this.isSetDataFile()) && (!this.isSetResultFile())) { mcf = new FastIPMetricGeneration(); } else { String dataFile = "mcf1.dat"; String resultFile = "mcf1.out"; if (this.isSetDataFile()) dataFile = this.getDataFile(); if (this.isSetResultFile()) resultFile = this.getResultFile(); String newDataFile = FileFunctions.getFilenameFromContext(ScenarioExecutionContext.getContext(), dataFile); String newResultFile = FileFunctions.getFilenameFromContext(ScenarioExecutionContext.getContext(), resultFile); mcf = new FastIPMetricGeneration(newDataFile,newResultFile); } Domain domain; TrafficMatrix tm; if ((this.isSetASID()) && (this.isSetTMID())) { domain = InterDomainManager.getInstance().getDomain(this.getASID()); tm = TrafficMatrixManager.getInstance().getTrafficMatrix(this.getASID(), this.getTMID()); } else if ((this.isSetASID()) && (!this.isSetTMID())) { domain = InterDomainManager.getInstance().getDomain(this.getASID()); tm = TrafficMatrixManager.getInstance().getDefaultTrafficMatrix(this.getASID()); } else if ((!this.isSetASID()) && (this.isSetTMID())) { domain = InterDomainManager.getInstance().getDefaultDomain();; tm = TrafficMatrixManager.getInstance().getTrafficMatrix(domain.getASID(), this.getTMID()); } else { domain = InterDomainManager.getInstance().getDefaultDomain(); tm = TrafficMatrixManager.getInstance().getDefaultTrafficMatrix(); } if ((this.isRunGLPSOL()) && (this._RunGLPSOL)) { TotemActionList actionList = mcf.computeLP(domain, tm); double[] newLinkWeights = null; for (Iterator iter = actionList.iterator(); iter.hasNext();) { TotemAction action = (TotemAction) iter.next(); if (action instanceof UpdateIGPWeightsAction) { newLinkWeights = ((UpdateIGPWeightsAction)action).getWeights(); } action.execute(); } return new EventResult(newLinkWeights); } else { System.out.println("Only create the data file"); mcf.createUtilDataFile(domain,tm); EventResult er = new EventResult(); er.setMessage("Data file created."); return er; } } catch (InvalidDomainException e) { throw new EventExecutionException(e); } catch (InvalidTrafficMatrixException e) { throw new EventExecutionException(e); } catch (IOException e) { throw new EventExecutionException(e); } catch (LinkNotFoundException e) { throw new EventExecutionException(e); } catch (NodeNotFoundException e) { throw new EventExecutionException(e); } catch(Exception e) { logger.error("An exception occurred. Message: "+e.getMessage()); throw new EventExecutionException(e); } } }
[ "vivisolla@gmail.com" ]
vivisolla@gmail.com
066a4a84f43ebcdf81858de8e63a688c270b0b5a
22d6a5ece092b379acdc354790b3214216c4d33e
/siscarLogic/src/geniar/siscar/model/Pumps.java
b5cc8e62f72f0b1fa25b53f3043ef3d7d0af943a
[]
no_license
josealvarohincapie/carritos
82dd4927b4fab38ce6f393eebcdcf54da4eada85
b60ff02175facdbbd2ebc441a24e460200a18dd9
refs/heads/master
2021-01-25T04:08:59.955637
2015-03-04T03:44:59
2015-03-04T03:44:59
32,355,348
0
1
null
null
null
null
UTF-8
Java
false
false
3,836
java
package geniar.siscar.model; import java.util.HashSet; import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; /** * Pumps entity. * * @author MyEclipse Persistence Tools */ @Entity @Table(name = "PUMPS", schema = "", uniqueConstraints = {}) public class Pumps implements java.io.Serializable { // Fields /** * */ private static final long serialVersionUID = 1L; private Long pumCodigo; private FuelTanks fuelTanks; private String pumNombre; private Long pumVecesUtilizado; private Set<ServiceRegistry> serviceRegistries = new HashSet<ServiceRegistry>( 0); private Set<DialyMovementPumps> dialyMovementPumpses = new HashSet<DialyMovementPumps>( 0); // Constructors /** default constructor */ public Pumps() { } /** minimal constructor */ public Pumps(Long pumCodigo, String pumNombre) { this.pumCodigo = pumCodigo; this.pumNombre = pumNombre; } /** full constructor */ public Pumps(Long pumCodigo, FuelTanks fuelTanks, String pumNombre, Long pumVecesUtilizado, Set<ServiceRegistry> serviceRegistries, Set<DialyMovementPumps> dialyMovementPumpses) { this.pumCodigo = pumCodigo; this.fuelTanks = fuelTanks; this.pumNombre = pumNombre; this.pumVecesUtilizado = pumVecesUtilizado; this.serviceRegistries = serviceRegistries; this.dialyMovementPumpses = dialyMovementPumpses; } // Property accessors @Id @SequenceGenerator(name = "PUMP_GEN", sequenceName = "SQ_PUMP", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "PUMP_GEN") @Column(name = "PUM_CODIGO", unique = true, nullable = false, insertable = true, updatable = true, precision = 22, scale = 0) public Long getPumCodigo() { return this.pumCodigo; } public void setPumCodigo(Long pumCodigo) { this.pumCodigo = pumCodigo; } @ManyToOne(cascade = {}, fetch = FetchType.LAZY) @JoinColumn(name = "FTA_CODIGO", unique = false, nullable = true, insertable = true, updatable = true) public FuelTanks getFuelTanks() { return this.fuelTanks; } public void setFuelTanks(FuelTanks fuelTanks) { this.fuelTanks = fuelTanks; } @Column(name = "PUM_NOMBRE", unique = false, nullable = false, insertable = true, updatable = true, length = 30) public String getPumNombre() { return this.pumNombre; } public void setPumNombre(String pumNombre) { this.pumNombre = pumNombre; } @Column(name = "PUM_VECES_UTILIZADO", unique = false, nullable = true, insertable = true, updatable = true, precision = 38, scale = 0) public Long getPumVecesUtilizado() { return this.pumVecesUtilizado; } public void setPumVecesUtilizado(Long pumVecesUtilizado) { this.pumVecesUtilizado = pumVecesUtilizado; } @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "pumps") public Set<ServiceRegistry> getServiceRegistries() { return this.serviceRegistries; } public void setServiceRegistries(Set<ServiceRegistry> serviceRegistries) { this.serviceRegistries = serviceRegistries; } @OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.LAZY, mappedBy = "pumps") public Set<DialyMovementPumps> getDialyMovementPumpses() { return this.dialyMovementPumpses; } public void setDialyMovementPumpses( Set<DialyMovementPumps> dialyMovementPumpses) { this.dialyMovementPumpses = dialyMovementPumpses; } }
[ "alvarohincapie@gmail.com@cf57b016-9254-9918-2bcb-82f70f16b22d" ]
alvarohincapie@gmail.com@cf57b016-9254-9918-2bcb-82f70f16b22d
4d11a16a00d24e6f0c771e9f5bdee1711783e598
68cb4d647309ac0892d5968a9a3d2156e5c1dabd
/day27/src/cn/itcast/demo4/Output.java
61cdc19daa7be28bf4669163815bf858e5e72a9d
[]
no_license
chaiguolong/JavaSE
651c4eb1179d05912cbc8d8a5d1930ca6ce9bad4
bb9629843ebafea221365b43c471ae3aa663b1c5
refs/heads/master
2021-07-25T09:46:34.190516
2018-07-30T08:17:49
2018-07-30T08:17:49
130,962,634
0
0
null
null
null
null
UTF-8
Java
false
false
527
java
package cn.itcast.demo4; /* * 输出线程,对资源对象Resource中成员变量,输出值 */ public class Output implements Runnable { private Resource r ; public Output(Resource r){ this.r = r; } public void run() { while(true){ synchronized(r){ //判断标记,是false,等待 if(!r.flag){ try{r.wait();}catch(Exception ex){} } System.out.println(r.name+".."+r.sex); //标记改成false,唤醒对方线程 r.flag = false; r.notify(); } } } }
[ "584238433@qq.com" ]
584238433@qq.com
176bfa57065c351953b923c7b46dbd4571fb8723
80b94774514475fcdbbb2b67a33a169de3b19875
/Exemplos/Exemplo - GCM/src/com/example/exemplo/gcm/MainActivity.java
fc393e686d70758f05b7e5f8d3e4c420453bad22
[]
no_license
novaeslucas/curso-android
cc1f9371ff8b39ddb62194c63cc4bb9c6e635a50
7f6cf60d7abccc83c43e68703b3451386caa7acb
refs/heads/master
2021-01-18T09:22:23.301854
2013-01-10T23:25:07
2013-01-10T23:25:07
null
0
0
null
null
null
null
MacCentralEurope
Java
false
false
2,817
java
package com.example.exemplo.gcm; import android.app.Activity; import android.os.AsyncTask; import android.os.Bundle; import com.google.android.gcm.GCMRegistrar; /** * Passos necessários: * * 0. Adicionar nos Extras * * 1. Ir no Console https://code.google.com/apis/console/ * * 2. Criar um Projeto e anotar o projectId. 2.1. Ir em Services 2.2. Habilitar * Google Cloud Messaging for Android 2.3. Ir em API Access 2.4. Clicar em * Create New Server API - É melhor para colocar uma whitelist de IPs de * servidores que podem acessar. 2.5. Anotar a Chave criada. * * 3. Copiar as bibliotecas da SDK * * 4. Alterar o AndroidManifest.xml * * 4.1. Adicionar permissčo própria. Nčo é necessário para Android 4.1 * <permission android:name="my_app_package.permission.C2D_MESSAGE" * android:protectionLevel="signature" /> <uses-permission * android:name="my_app_package.permission.C2D_MESSAGE" /> * * 4.2. Pedir outras permissões <uses-permission * android:name="com.google.android.c2dm.permission.RECEIVE" /> <uses-permission * android:name="android.permission.INTERNET" /> <uses-permission * android:name="android.permission.GET_ACCOUNTS" /> <uses-permission * android:name="android.permission.WAKE_LOCK" /> * * 4.3. Adicionar o BroadcastReceiver <receiver * android:name="com.google.android.gcm.GCMBroadcastReceiver" * android:permission="com.google.android.c2dm.permission.SEND" > * <intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" * /> <action android:name="com.google.android.c2dm.intent.REGISTRATION" /> * <category android:name="my_app_package" /> </intent-filter> </receiver> * * 4.4. Adicionar o seu próprio Servićo <service * android:name=".GCMIntentService" /> * * 5. Criar o Servićo que estende de GCMBaseIntentService 5.1. Sobrescrever os * métodos * * 6. Criar a MainActivity * * @author Marlon Silva Carvalho * @since 1.0.0 */ public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); configureGCM(); } /** * Configuring Google Cloud Messaging. */ private void configureGCM() { GCMRegistrar.checkDevice(this); GCMRegistrar.checkManifest(this); final String regId = GCMRegistrar.getRegistrationId(this); if (regId == null || "".equals(regId)) { GCMRegistrar.register(this, GCMIntentService.SENDER_ID); } else { if (!GCMRegistrar.isRegisteredOnServer(this)) { new AsyncTask<Void, String, Void>() { @Override protected Void doInBackground(Void... params) { Webservice.register(MainActivity.this, "marloncarvalho", regId); return null; } }.execute(); } else { // GCMRegistrar.unregister(this); } } } }
[ "marlon.carvalho@gmail.com" ]
marlon.carvalho@gmail.com
7a2d8616fd27189809eb10ebbb6bdb9e912e2292
6252c165657baa6aa605337ebc38dd44b3f694e2
/org.eclipse.epsilon.egl.sync/Scalability-Tests/boiler-To-Generate-1000-Files/boiler-To-Generate-1000-Files/syncregions-1000Files/TemperatureController4802.java
e69deeeffa40d3f491ee4a4ec91ad5ffed2bf0bd
[]
no_license
soha500/EglSync
00fc49bcc73f7f7f7fb7641d0561ca2b9a8ea638
55101bc781349bb14fefc178bf3486e2b778aed6
refs/heads/master
2021-06-23T02:55:13.464889
2020-12-11T19:10:01
2020-12-11T19:10:01
139,832,721
0
1
null
2019-05-31T11:34:02
2018-07-05T10:20:00
Java
UTF-8
Java
false
false
371
java
package syncregions; public class TemperatureController4802 { public int execute(int temperature4802, int targetTemperature4802) { //sync _bfpnFUbFEeqXnfGWlV4802, behaviour 1-if(temperatureDifference > 0 && boilerStatus == true) { return 1; } else if (temperatureDifference < 0 && boilerStatus == false) { return 2; } else return 0; //endSync } }
[ "sultanalmutairi@172.20.10.2" ]
sultanalmutairi@172.20.10.2
20eaa7ce1f9b750b52ad57b5c6bfa1ede4410251
79fef0eb7d43ad32b181a732e51a422ae88a0ed0
/app/src/main/java/com/example/dapindao/utils/BaseActivity.java
8e2b2806028646c4d938a6ab3b63ebb629d324d2
[]
no_license
zhujiammy/DaPinDao
5dfe53566fc82ba2e5750fe08dc99311c2d7e946
ba993b05b8bf72d7cd1447071a079ea9394dc2b2
refs/heads/master
2020-07-14T17:15:23.784467
2019-09-11T11:43:23
2019-09-11T11:43:23
205,360,562
0
1
null
null
null
null
UTF-8
Java
false
false
4,094
java
package com.example.dapindao.utils; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.content.res.Configuration; import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.wifi.WifiManager; import android.os.Build; import android.os.Bundle; import android.view.KeyEvent; import android.view.View; import android.view.WindowManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; /** * BaseActivity是所有Activity的基类,把一些公共的方法放到里面,如基础样式设置,权限封装,网络状态监听等 * <p> */ public abstract class BaseActivity extends AppCompatActivity{ @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 隐藏标题栏 if (getSupportActionBar() != null) getSupportActionBar().hide(); // 沉浸效果 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); } // 添加到Activity工具类 ActivityUtil.getInstance().addActivity(this); // 执行初始化方法 init(); IntentFilter filter = new IntentFilter(); filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION); filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION); filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION); registerReceiver(new NetworkConnectChangedReceiver(), filter); } // 抽象 - 初始化方法,可以对数据进行初始化 protected abstract void init(); @Override protected void onResume() { super.onResume(); Resources resources = this.getResources(); Configuration configuration = resources.getConfiguration(); configuration.fontScale = 1; resources.updateConfiguration(configuration, resources.getDisplayMetrics()); } @Override protected void onDestroy() { // Activity销毁时,提示系统回收 // System.gc(); // 移除Activity ActivityUtil.getInstance().removeActivity(this); super.onDestroy(); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { // 点击手机上的返回键,返回上一层 if (keyCode == KeyEvent.KEYCODE_BACK) { // 移除Activity ActivityUtil.getInstance().removeActivity(this); this.finish(); } return super.onKeyDown(keyCode, event); } /** * 权限检查方法,false代表没有该权限,ture代表有该权限 */ public boolean hasPermission(String... permissions) { for (String permission : permissions) { if (ContextCompat.checkSelfPermission(this, permission) != PackageManager.PERMISSION_GRANTED) { return false; } } return true; } /** * 权限请求方法 */ public void requestPermission(int code, String... permissions) { ActivityCompat.requestPermissions(this, permissions, code); } /** * 处理请求权限结果事件 * * @param requestCode 请求码 * @param permissions 权限组 * @param grantResults 结果集 */ @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { super.onRequestPermissionsResult(requestCode, permissions, grantResults); doRequestPermissionsResult(requestCode, grantResults); } /** * 处理请求权限结果事件 * * @param requestCode 请求码 * @param grantResults 结果集 */ public void doRequestPermissionsResult(int requestCode, @NonNull int[] grantResults) { } }
[ "945529210@qq.com" ]
945529210@qq.com
0218fc01762829e7d92ac7b40d340f021e0f6060
39e32f672b6ef972ebf36adcb6a0ca899f49a094
/dcm4chee-dashboard/tags/DCM4CHEE_WEB_3_0_1/dcm4chee-dashboard-ui/src/main/java/org/dcm4chee/dashboard/ui/DashboardPanel.java
b369cb69e6ba5241240d373a6ec66c38923cc271
[ "Apache-2.0" ]
permissive
medicayun/medicayundicom
6a5812254e1baf88ad3786d1b4cf544821d4ca0b
47827007f2b3e424a1c47863bcf7d4781e15e814
refs/heads/master
2021-01-23T11:20:41.530293
2017-06-05T03:11:47
2017-06-05T03:11:47
93,123,541
0
2
null
null
null
null
UTF-8
Java
false
false
2,700
java
/* ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is part of dcm4che, an implementation of DICOM(TM) in * Java(TM), hosted at http://sourceforge.net/projects/dcm4che. * * The Initial Developer of the Original Code is * Agfa-Gevaert AG. * Portions created by the Initial Developer are Copyright (C) 2008 * the Initial Developer. All Rights Reserved. * * Contributor(s): * See listed authors below. * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ package org.dcm4chee.dashboard.ui; import org.dcm4chee.dashboard.ui.filesystem.FileSystemPanel; import org.dcm4chee.dashboard.ui.messaging.QueuePanel; import org.dcm4chee.dashboard.ui.report.ReportPanel; import org.dcm4chee.dashboard.ui.systeminfo.SystemInfoPanel; import org.dcm4chee.web.common.secure.SecureAjaxTabbedPanel; /** * @author Robert David <robert.david@agfa.com> * @version $Revision$ $Date$ * @since 07.04.2010 */ public class DashboardPanel extends SecureAjaxTabbedPanel { private static final long serialVersionUID = 1L; public DashboardPanel(String id) { super(id); addModule(FileSystemPanel.class, null); addModule(ReportPanel.class, null); addModule(SystemInfoPanel.class, null); addModule(QueuePanel.class, null); } public static String getModuleName() { return "dashboard"; } }
[ "liliang_lz@icloud.com" ]
liliang_lz@icloud.com
b6067fe0c6b3889c0f8741ed8b072691f6be4543
d585e7319121e317f2430e34faeeedc0ff921abf
/src/com/cbai/common/page/Paginable.java
87eed9dedbb8e2288e43703fe34248501bde24ae
[]
no_license
facaimeng/fuwubao
95aef2376663f80dc4c0adc795e1ca4b020352a5
56bdfd568d855bfb28b69ae583a5e43ac1777df1
refs/heads/master
2022-08-18T23:31:17.978487
2020-05-18T23:31:45
2020-05-18T23:31:45
265,088,397
0
0
null
null
null
null
UTF-8
Java
false
false
663
java
package com.cbai.common.page; /** * 分页接口 */ public interface Paginable { /** * 总记录数 * * @return */ public int getTotalCount(); /** * 总页数 * * @return */ public int getTotalPage(); /** * 每页记录数 * * @return */ public int getPageSize(); /** * 当前页号 * * @return */ public int getPageNo(); /** * 是否第一页 * * @return */ public boolean isFirstPage(); /** * 是否最后一页 * * @return */ public boolean isLastPage(); /** * 返回下页的页号 */ public int getNextPage(); /** * 返回上页的页号 */ public int getPrePage(); }
[ "249590716@qq.com" ]
249590716@qq.com
82f6471e32553728bced68d596e957be506d85dd
756237569f046fe0207f095ae0552fa1becb6b22
/app/src/main/java/com/gmm/asasystembar/DemoActivity.java
84998f6e34f3b77c3857989201adba20b146f8f8
[]
no_license
zhangquanit/UI-StatusBar
80a5da232b23c9fbc1f50f1cbbdbbcdd4f1ac727
6087821d85a8b5d665eb3217fae68d53fae82895
refs/heads/master
2021-10-10T18:28:12.964292
2019-01-15T08:58:54
2019-01-15T08:58:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,021
java
package com.gmm.asasystembar; import android.annotation.TargetApi; import android.content.Context; import android.graphics.Color; import android.os.Build; import android.os.Bundle; import android.support.annotation.IntRange; import android.support.annotation.RequiresApi; import android.support.v7.app.AppCompatActivity; import android.view.Gravity; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; import android.widget.FrameLayout; public class DemoActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_demo); //clear all flag findViewById(R.id.clear_all).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { getWindow().getDecorView().setSystemUiVisibility(0); } }); /** * show lightStatusBar require api 23 * 小米魅族等需要单独设置 * MIUI 6+ FlyMe 4+ */ findViewById(R.id.lightStatusBar).setOnClickListener(new View.OnClickListener() { @TargetApi(Build.VERSION_CODES.M) @Override public void onClick(View view) { int flag = getWindow().getDecorView().getSystemUiVisibility(); // flag |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; // //// flag |=(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS //// | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); // getWindow().getDecorView().setSystemUiVisibility(flag); // getWindow().setStatusBarColor(Color.TRANSPARENT); View decor = getWindow().getDecorView(); flag |= (WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); getWindow().setStatusBarColor(Color.TRANSPARENT); decor.setSystemUiVisibility(flag); } }); //show transparentStatusBar require api 21 /** * Android 5.0 ~ Android 6.0 * Android 5.0 之后我们可以对状态栏进行着色,通过设置flag */ findViewById(R.id.transparentStatusBar).setOnClickListener(new View.OnClickListener() { @TargetApi(Build.VERSION_CODES.LOLLIPOP) @Override public void onClick(View view) { int flag = getWindow().getDecorView().getSystemUiVisibility(); flag |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; getWindow().setStatusBarColor(Color.TRANSPARENT); //设置状态栏颜色 getWindow().getDecorView().setSystemUiVisibility(flag); } }); //add decorview findViewById(R.id.add_decocview).setOnClickListener(new View.OnClickListener() { @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) @Override public void onClick(View view) { /* AsaSystemBar.from(DemoActivity.this) .addStatusBarView(true) .process();*/ int flag = getWindow().getDecorView().getSystemUiVisibility(); flag |= View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE; getWindow().setStatusBarColor(Color.TRANSPARENT); getWindow().getDecorView().setSystemUiVisibility(flag); ViewGroup viewGroup = (ViewGroup) getWindow().getDecorView(); setupStatusBarView(DemoActivity.this, viewGroup); } }); } /** * see {@link <a href="https://github.com/jgilfelt/SystemBarTint"></a>} */ private View mStatusBarTintView; private void setupStatusBarView(Context context, ViewGroup decorViewGroup) { mStatusBarTintView = new View(context); FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, getStatusBarOffsetPx(context)); params.gravity = Gravity.TOP; /* if (mNavBarAvailable && !mConfig.isNavigationAtBottom()) { params.rightMargin = mConfig.getNavigationBarWidth(); }*/ mStatusBarTintView.setLayoutParams(params); mStatusBarTintView.setBackgroundColor(Color.RED); decorViewGroup.addView(mStatusBarTintView); } @IntRange(from = 0, to = 75) public static int getStatusBarOffsetPx(Context context) { Context appContext = context.getApplicationContext(); int result = 0; int resourceId = appContext.getResources().getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = appContext.getResources().getDimensionPixelSize(resourceId); } return result; } }
[ "zhangquanit@126.com" ]
zhangquanit@126.com
eb7ccd7dbbd612167270303bfc2ebfe2e07d6ba8
25c63b83a1f412e59108115814734075e98e0d15
/src/cn/digitalpublishing/util/PoiClass.java
7f835889587dfbad31e1c7a413ee5077a027b166
[]
no_license
yxxcrtd/ContentResource
224918bd876a942a8ac72d74897b50efcec041d5
74d52c53d7e7e47ae05b173b9eec5e54a66fd11e
refs/heads/master
2020-05-31T21:29:12.374579
2019-06-06T02:20:05
2019-06-06T02:20:05
190,499,218
0
0
null
null
null
null
UTF-8
Java
false
false
4,400
java
package cn.digitalpublishing.util; import java.io.FileInputStream; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFDateUtil; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; public class PoiClass { private Workbook workbook = null; // 工作部对象 private List<HashMap<String,Object>> mapData=null; private String[] header=null; private Sheet sheet = null; // 工作表 public int totalRows = 0; // 总行数 public int totalColumns = 0; // 总列数 public String[] getHeader() { return header; } public void setHeader(String[] header) { this.header = header; } public List<HashMap<String,Object>> getDatas(){ return mapData; } public PoiClass(String filename) throws Exception{ this(new FileInputStream(filename)); } public PoiClass(FileInputStream inputStream) throws Exception { workbook = WorkbookFactory.create(inputStream); if(workbook.getNumberOfSheets()>0){ this.sheet = this.workbook.getSheetAt(0); this.totalRows=this.sheet.getPhysicalNumberOfRows(); //System.out.println("Sheet0\"" + sheet + "\" has " + totalRows + " row(s)."); if(totalRows>0){ this.totalColumns=this.sheet.getRow(0).getPhysicalNumberOfCells(); //System.out.println("Sheet0\"" + sheet + "\" has " + totalColumns + " colume(s)."); } } } public boolean Parse(Boolean hasheader)throws Exception{ try { if(sheet!=null){ Boolean headComplate=false; mapData=new ArrayList<HashMap<String,Object>>(); Integer rows = sheet.getPhysicalNumberOfRows(); if(hasheader && !headComplate){ header=new String[totalColumns]; } for (int r = 0; r < rows; r++) { // 表格首行为列标题,提取列标题--------------------- Row row = sheet.getRow(r); if (row == null) { continue; } HashMap<String,Object> map=(hasheader && !headComplate)?null:new HashMap<String,Object>(); for (int c = 0; c < totalColumns; c++) { String value=null; Cell cell = row.getCell(c); if(cell!=null){ if (cell.getCellType() == Cell.CELL_TYPE_STRING) value= cell.getStringCellValue(); else if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC){ if(HSSFDateUtil.isCellDateFormatted(cell)){ SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); value =sdf.format(HSSFDateUtil.getJavaDate(cell.getNumericCellValue())); }else{ DecimalFormat df = new DecimalFormat("0"); value = df.format(cell.getNumericCellValue()); } } } if (hasheader && !headComplate){ if(value==null || "".equals(value.trim())){ throw new Exception("标题行不能包含空值!"); } header[c]=value.trim().toLowerCase(); if(c+1==totalColumns){ headComplate=true; } continue; } if(map!=null){ map.put(header[c], value); } } if(map!=null){ mapData.add(map); } } } } catch (Exception e) { e.printStackTrace(); } return true; } public static void main(String[] args) throws Exception { String excel="C:\\Users\\jack\\Desktop\\date.xlsx"; PoiClass pc=new PoiClass(excel); pc.Parse(true); // List<String> excels=FileUtil.getFiles("C:\\Users\\jack\\Desktop\\upload\\ashgate", "*.xls", false); // if(excels!=null &&excels.size()>0){ // for(String str:excels){ // PoiClass pc=new PoiClass(str); // pc.Parse(true); // String[] header=pc.getHeader(); // if(!pc.getDatas().get(0).containsKey("bic") && !pc.getDatas().get(0).containsKey("subjecttype(bic/bisac/dewey)")){ // System.out.println(str); // } // if(header!=null &&header.length>0){ // for(String h:header){ // System.out.print(h + "\t"); // } // }else{ // System.out.print("错误!" + str); // } // System.out.print("\n"); // } // // } } }
[ "yxxcrtd@gmail.com" ]
yxxcrtd@gmail.com
6f8699bdef2f2b62d3009641b401ddcf83a553c9
2ab03c4f54dbbb057beb3a0349b9256343b648e2
/JavaAdvanced/JAdvancedStringExercises/src/SumBigNumbers.java
80ec9df3564fcb209150d194c9ca8a21626f08bd
[ "MIT" ]
permissive
tabria/Java
8ef04c0ec5d5072d4e7bf15e372e7c2b600a1cea
9bfc733510b660bc3f46579a1cc98ff17fb955dd
refs/heads/master
2021-05-05T11:50:05.175943
2018-03-07T06:53:54
2018-03-07T06:53:54
104,714,168
0
1
null
null
null
null
UTF-8
Java
false
false
1,837
java
import java.util.Scanner; public class SumBigNumbers { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String numberOne = new StringBuilder(scanner.nextLine()).reverse().toString(); String numberTwo = new StringBuilder(scanner.nextLine()).reverse().toString(); numberOne = removeLeadingZeros(numberOne); numberTwo = removeLeadingZeros(numberTwo); StringBuilder sb = new StringBuilder(); int cycles = numberOne.length() > numberTwo.length() ? numberOne.length() : numberTwo.length(); int offset = 0; for (int i = 0; i <cycles ; i++) { int currentNumberOne = getDigitFromNumber(numberOne, i); int currentNumberTwo = getDigitFromNumber(numberTwo, i); int sum = currentNumberOne + currentNumberTwo + offset; int lastDigit = sum % 10; int deviation = sum -lastDigit; offset = deviation > 9 ? deviation/10 : deviation ; sb.append(lastDigit); } if (offset !=0) { sb.append(offset); } sb.reverse(); System.out.println(sb.toString()); } private static String removeLeadingZeros(String numberStr) { while(true) { int lastDigit = Character.getNumericValue(numberStr.charAt(numberStr.length()-1)); if(lastDigit == 0) { numberStr = numberStr.substring(0, numberStr.length()-1); } else { break; } } return numberStr; } private static int getDigitFromNumber(String numberStr, int index) { int digit = 0; try { digit = Character.getNumericValue(numberStr.charAt(index)); } catch (Exception e ){ } return digit; } }
[ "forexftg@yahoo.com" ]
forexftg@yahoo.com
1f8f7953291a6274110f15d0e56a4c905d2bd5c2
0dc06e5cc1b49a092245f5caf9ab6ee573b727ec
/TestXidio/src/com/comcast/xidio/testCases/subscription/XidioSubscriptionChannelHighlightedContentTest.java
aad1af1b663d5f3fbaa21a8a8bdf4f4a30abcbf8
[]
no_license
sandeeptiku2012/ComcastRobotium
d64122d1aa89ba5d19cd2574e07053a933c9a1bb
f9f5d061ba4b09d54ff294aaad346044823c29b5
refs/heads/master
2016-09-06T05:43:03.717164
2014-01-06T12:56:49
2014-01-06T12:56:49
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,885
java
package com.comcast.xidio.testCases.subscription; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import android.test.ActivityInstrumentationTestCase2; import android.util.Log; import android.view.KeyEvent; import com.comcast.xidio.core.common.GetSolo; import com.comcast.xidio.core.constant.TestConstants; import com.comcast.xidio.loginUtil.LoginUtil; import com.comcast.xidio.model.GetSubscriptionList; import com.jayway.android.robotium.solo.Solo; import com.xfinity.xidio.FirstRun; import com.xfinity.xidio.core.XidioApplication; public class XidioSubscriptionChannelHighlightedContentTest extends ActivityInstrumentationTestCase2<FirstRun> { private Solo solo; private JSONObject response; private JSONObject currChannel; String userId; public XidioSubscriptionChannelHighlightedContentTest() { super(FirstRun.class); } @Override protected void setUp() throws Exception { GetSolo.getInstance().setUpSolo(getInstrumentation(),getActivity()); solo=GetSolo.getInstance().getSoloObject(); solo.sleep(TestConstants.SLEEP_TIME_SETUP); super.setUp(); } public void testXidioSubscriptionChannelHighlightedContent() { //passing through the first Run Activity solo.waitForActivity(TestConstants.FIRST_RUN); solo.sleep(TestConstants.SLEEP_TIME_1000); LoginUtil.authenticateUser(solo, getInstrumentation()); // solo.sendKey(KeyEvent.KEYCODE_DPAD_UP); // solo.sendKey(KeyEvent.KEYCODE_DPAD_UP); // solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN); // solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN); solo.waitForActivity(TestConstants.MAIN_ACTIVITY); solo.sleep(TestConstants.SLEEP_TIME_5000); //starting the test main Activity JSONArray subscribedChannels = GetSubscriptionList.getInstance().getSubscriptionList(XidioApplication.getLastLoggedInUser()); if(subscribedChannels==null || subscribedChannels.length()==0) { solo.sleep(TestConstants.SLEEP_TIME_5000); solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER); solo.sleep(TestConstants.SLEEP_TIME_2000); assertTrue(solo.searchText(TestConstants.SUBSCRIBE)); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_RIGHT); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_CENTER); solo.sleep(TestConstants.SLEEP_TIME_5000); solo.sendKey(KeyEvent.KEYCODE_BACK); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_UP); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_UP); subscribedChannels = GetSubscriptionList.getInstance().getSubscriptionList(XidioApplication.getLastLoggedInUser()); } solo.sleep(TestConstants.SLEEP_TIME_5000); solo.sendKey(KeyEvent.KEYCODE_DPAD_UP); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_RIGHT); assertTrue(solo.searchText(TestConstants.SUBSCRIPTIONS)); solo.sleep(TestConstants.SLEEP_TIME_2000); solo.sendKey(KeyEvent.KEYCODE_DPAD_DOWN); solo.sleep(TestConstants.SLEEP_TIME_2000); for(int i=0;i<subscribedChannels.length();i++) { try { currChannel=subscribedChannels.getJSONObject(i); assertTrue(solo.searchText(currChannel.getString("title").trim())); break; } catch (JSONException e) { Log.e("Exception:", "Exception occured in XidioSubscriptionChannelHighlightedContent test", e); } } solo.sendKey(KeyEvent.KEYCODE_BACK); solo.sleep(TestConstants.SLEEP_TIME_2000); assertTrue(solo.waitForActivity(TestConstants.MAIN_ACTIVITY)); } @Override protected void tearDown() throws Exception { solo.finishOpenedActivities(); super.tearDown(); } }
[ "manju1375@gmail.com" ]
manju1375@gmail.com
1c54011fca395c850765ce5a26506b7b4dd2cdd7
a0c6a2feacb72ab3cac884faa625dbe70c84770c
/src/com/aypi/events/PlayerJoin.java
82e7e756f712b073658cbd40cad462e7bf2ab590
[]
no_license
Huminecraft/AYPI
8cc3b7fe270923008140651caadb70b3b4b043a1
ad054633a56e84a715158bbaae3e5365fa6893f6
refs/heads/master
2021-08-07T15:34:57.747056
2020-04-19T16:57:20
2020-04-19T16:57:20
157,255,309
0
0
null
null
null
null
UTF-8
Java
false
false
627
java
package com.aypi.events; import org.bukkit.Location; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; import com.aypi.Aypi; import com.aypi.utils.Zone; import com.aypi.utils.ZonePriorityBuffer; public class PlayerJoin implements Listener { @EventHandler public void onPlayerMove(PlayerJoinEvent e) { Player player = e.getPlayer(); Location loc = player.getLocation(); for (Zone zone : Aypi.getZoneManager().getZones()) { if (zone.containLocation(loc)) { zone.addEntity(player); } } } }
[ "unconfigured@null.spigotmc.org" ]
unconfigured@null.spigotmc.org
2fc8029d56d6e89a46579d6b97130ece84d75613
6967c77c6ccf286919576f4bce9bd861592f68e0
/mvp4g2-processor/src/test/resources/com/github/mvp4g/mvp4g2/processor/eventbus/filterAnnotationOnAMethod/IMockShellView.java
d3ad5fdd67f9ca4dbfbe38bfb92a43412304ae0e
[ "Apache-2.0" ]
permissive
mvp4g/mvp4g2
3caaf07f504487675ab4e8539dcccd5276fc2694
24f65ac7ad70b70dd12dc84af6a654c46b13a51a
refs/heads/master
2021-01-10T06:55:38.716424
2019-06-17T09:04:46
2019-06-17T09:04:46
46,654,747
24
5
Apache-2.0
2018-05-01T10:11:13
2015-11-22T09:55:03
Java
UTF-8
Java
false
false
258
java
package com.github.mvp4g.mvp4g2.processor.eventbus.filterAnnotationOnAMethod; import com.github.mvp4g.mvp4g2.core.ui.IsLazyReverseView; public interface IMockShellView extends IsLazyReverseView<IMockShellView.Presenter> { interface Presenter { } }
[ "frank.hossfeld@googlemail.com" ]
frank.hossfeld@googlemail.com
4c5ce3cb76fa69126ca4a4dfdcf20ecc90915f32
3b26a0d39305e54c859c80f040170f928f23a644
/UniversalMediaPlayer/java/com/android/pump/provider/KnowledgeGraph.java
588246cf303f766aca1015251932a795fbf1a7c2
[]
no_license
MyMagma/apps
cfd74d98c7b81d4bc2f4b4946484a7be1b3bb4ef
128d43ae1aa967328b32225f5eb162fb3b6569d3
refs/heads/master
2020-12-27T06:49:24.811808
2020-02-02T17:32:35
2020-02-02T17:32:35
237,800,995
1
1
null
null
null
null
UTF-8
Java
false
false
7,830
java
/* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.pump.provider; import android.net.Uri; import androidx.annotation.AnyThread; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.WorkerThread; import com.android.pump.db.Album; import com.android.pump.db.Artist; import com.android.pump.db.DataProvider; import com.android.pump.db.Episode; import com.android.pump.db.Movie; import com.android.pump.db.Series; import com.android.pump.util.Clog; import com.android.pump.util.Http; import java.io.IOException; import java.nio.charset.StandardCharsets; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONTokener; @WorkerThread public final class KnowledgeGraph implements DataProvider { private static final String TAG = Clog.tag(KnowledgeGraph.class); private static final DataProvider INSTANCE = new KnowledgeGraph(); private KnowledgeGraph() { } @AnyThread public static @NonNull DataProvider getInstance() { return INSTANCE; } @Override public boolean populateArtist(@NonNull Artist artist) throws IOException { boolean updated = false; // Artist may be of type "Person" or "MusicGroup" JSONObject result = getResultFromKG(artist.getName(), "Person", "MusicGroup"); String imageUrl = getImageUrl(result); if (imageUrl != null) { updated |= artist.setHeadshotUri(Uri.parse(imageUrl)); } String detailedDescription = getDetailedDescription(result); if (detailedDescription != null) { updated |= artist.setDescription(detailedDescription); } return updated; } @Override public boolean populateAlbum(@NonNull Album album) throws IOException { // Return if album art is already retrieved from the media file if (album.getAlbumArtUri() != null) { return false; } boolean updated = false; JSONObject result = getResultFromKG(album.getTitle(), "MusicAlbum"); // TODO: (b/128383917) Investigate how to filter search results String imageUrl = getImageUrl(result); if (imageUrl != null) { updated |= album.setAlbumArtUri(Uri.parse(imageUrl)); } String detailedDescription = getDetailedDescription(result); if (detailedDescription != null) { updated |= album.setDescription(detailedDescription); } return updated; } @Override public boolean populateMovie(@NonNull Movie movie) throws IOException { boolean updated = false; JSONObject result = getResultFromKG(movie.getTitle(), "Movie"); String imageUrl = getImageUrl(result); if (imageUrl != null) { updated |= movie.setPosterUri(Uri.parse(imageUrl)); } String detailedDescription = getDetailedDescription(result); if (detailedDescription != null) { updated |= movie.setDescription(detailedDescription); } return updated; } @Override public boolean populateSeries(@NonNull Series series) throws IOException { boolean updated = false; JSONObject result = getResultFromKG(series.getTitle(), "TVSeries"); String imageUrl = getImageUrl(result); if (imageUrl != null) { updated |= series.setPosterUri(Uri.parse(imageUrl)); } String detailedDescription = getDetailedDescription(result); if (detailedDescription != null) { updated |= series.setDescription(detailedDescription); } return updated; } @Override public boolean populateEpisode(@NonNull Episode episode) throws IOException { boolean updated = false; JSONObject result = getResultFromKG(episode.getSeries().getTitle(), "TVEpisode"); String imageUrl = getImageUrl(result); if (imageUrl != null) { updated |= episode.setPosterUri(Uri.parse(imageUrl)); } String detailedDescription = getDetailedDescription(result); if (detailedDescription != null) { updated |= episode.setDescription(detailedDescription); } return updated; } private @NonNull JSONObject getResultFromKG(String title, String... types) throws IOException { try { JSONObject root = (JSONObject) getContent(getContentUri(title, types)); JSONArray items = root.getJSONArray("itemListElement"); JSONObject item = (JSONObject) items.get(0); JSONObject result = item.getJSONObject("result"); if (!title.equals(result.getString("name"))) { throw new IOException("Failed to find result for " + title); } return result; } catch (JSONException e) { throw new IOException("Failed to find result for " + title); } } private @Nullable String getImageUrl(@NonNull JSONObject result) { String imageUrl = null; try { JSONObject imageObj = result.optJSONObject("image"); if (imageObj != null) { String url = imageObj.getString("contentUrl"); if (url != null) { // TODO (b/125143807): Remove once HTTPS scheme urls are retrieved. imageUrl = url.replaceFirst("^http://", "https://"); } } } catch (JSONException e) { Clog.w(TAG, "Failed to parse image url", e); } return imageUrl; } private @Nullable String getDescription(@NonNull JSONObject result) { String description = null; try { description = result.getString("description"); } catch (JSONException e) { Clog.w(TAG, "Failed to parse description", e); } return description; } private @Nullable String getDetailedDescription(@NonNull JSONObject result) { String detailedDescription = null; try { JSONObject descriptionObj = result.optJSONObject("detailedDescription"); if (descriptionObj != null) { detailedDescription = descriptionObj.getString("articleBody"); } } catch (JSONException e) { Clog.w(TAG, "Failed to parse detailed description", e); } return detailedDescription; } private static @NonNull Uri getContentUri(@NonNull String title, @NonNull String... types) { Uri.Builder ub = new Uri.Builder(); ub.scheme("https"); ub.authority("kgsearch.googleapis.com"); ub.appendPath("v1"); ub.appendEncodedPath("entities:search"); ub.appendQueryParameter("key", ApiKeys.KG_API); ub.appendQueryParameter("limit", "1"); ub.appendQueryParameter("query", title); for (String type : types) { ub.appendQueryParameter("types", type); } return ub.build(); } private static @NonNull Object getContent(@NonNull Uri uri) throws IOException, JSONException { return new JSONTokener(new String(Http.get(uri.toString()), StandardCharsets.UTF_8)) .nextValue(); } }
[ "user@email.edu" ]
user@email.edu
00b796553b0da74c4cd6b170aa858bb4f52e6465
1ca86d5d065372093c5f2eae3b1a146dc0ba4725
/testing-modules/junit5-annotations/src/test/java/com/surya/junit5/registerextension/RegisterExtensionUnitTest.java
6f5eb84e32fcd5ab7d62ba02d870b2a32fa0abbf
[]
no_license
Suryakanta97/DemoExample
1e05d7f13a9bc30f581a69ce811fc4c6c97f2a6e
5c6b831948e612bdc2d9d578a581df964ef89bfb
refs/heads/main
2023-08-10T17:30:32.397265
2021-09-22T16:18:42
2021-09-22T16:18:42
391,087,435
0
1
null
null
null
null
UTF-8
Java
false
false
937
java
package com.surya.junit5.registerextension; import com.surya.junit5.registerextension.RegisterExtensionSampleExtension; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.RegisterExtension; /** * This test demonstrates the use of the same extension in two ways. * 1. Once as instance level field: Only method level callbacks are called. * 2. Once as class level static field: All methods are called. */ public class RegisterExtensionUnitTest { @RegisterExtension static RegisterExtensionSampleExtension staticExtension = new RegisterExtensionSampleExtension("static version"); @RegisterExtension RegisterExtensionSampleExtension instanceLevelExtension = new RegisterExtensionSampleExtension("instance version"); @Test public void demoTest() { Assertions.assertEquals("instance version", instanceLevelExtension.getType()); } }
[ "suryakanta97@github.com" ]
suryakanta97@github.com
0c3775fd940545da6683d8c34ec32354ad348fa1
8cdf7cbb4865c93dc4fe16d9ef0e95861fcd45f4
/eshop-coupon/src/main/java/com/hxm/eshop/coupon/dao/CouponSpuCategoryRelationDao.java
8cbaec047f4ae3407cbe5267ff978c1ab7fbfd80
[]
no_license
z596593851/eshop
698d7798e4c41fe6852abb23dfd189c884840f69
35e35b290859280621672209c06cc78534d8d0f9
refs/heads/master
2023-06-24T19:13:41.207294
2021-07-07T06:16:04
2021-07-07T06:16:04
361,741,550
1
0
null
null
null
null
UTF-8
Java
false
false
434
java
package com.hxm.eshop.coupon.dao; import com.hxm.eshop.coupon.entity.CouponSpuCategoryRelationEntity; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.apache.ibatis.annotations.Mapper; /** * 优惠券分类关联 * * @author xiaoming * @email z596593851@gmail.com * @date 2021-05-08 14:48:37 */ @Mapper public interface CouponSpuCategoryRelationDao extends BaseMapper<CouponSpuCategoryRelationEntity> { }
[ "huxiaoming02@58.com" ]
huxiaoming02@58.com
eea11c8ab388e458c992c47856969edb8b527b39
83159c3fd3d440b976b0d744d1112ca325e9943d
/src/main/java/ua/kiev/prog/automation/framework/product/app/progkievua/forum/ModaratePage.java
b6273addc31d608082d9cf7e37ab0942ea557fa1
[]
no_license
PotapIhor/automation-framework
bf186059a53c64a9e879fc47d64f946f503f17e7
8a320a80e05e3957189d03d6410a74db0bf62866
refs/heads/master
2020-03-21T13:39:22.975967
2018-07-02T17:14:49
2018-07-02T17:14:49
138,618,279
0
0
null
null
null
null
UTF-8
Java
false
false
830
java
package ua.kiev.prog.automation.framework.product.app.progkievua.forum; import org.openqa.selenium.By; import ua.kiev.prog.automation.framework.core.product.Component; import ua.kiev.prog.automation.framework.product.app.progkievua.Forum; import ua.kiev.prog.automation.framework.product.app.progkievua.forum.base.ForumPageObject; public class ModaratePage extends ForumPageObject { @Override protected Class<? extends Component> componentClass() { return Forum.class; } //нЕКИЙ ЭЛЕМЕНТ который загружается последний на странице и свидетельствует о том, что страница гоова @Override protected By readyLocator() { return null; } @Override public By TopLinks() { return null; } }
[ "johndoe@example.com" ]
johndoe@example.com
d963221f79887edb32c2a76027ef7253b8f6af9d
7ad843a5b11df711f58fdb8d44ed50ae134deca3
/JDK/JDK1.8/src/java/lang/NumberFormatException.java
16869b6d52d51caa9aa8443e5e0e5612dbee6834
[ "MIT" ]
permissive
JavaScalaDeveloper/java-source
f014526ad7750ad76b46ff475869db6a12baeb4e
0e6be345eaf46cfb5c64870207b4afb1073c6cd0
refs/heads/main
2023-07-01T22:32:58.116092
2021-07-26T06:42:32
2021-07-26T06:42:32
362,427,367
0
0
null
null
null
null
UTF-8
Java
false
false
1,315
java
/* * Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package java.lang; /** * Thrown to indicate that the application has attempted to convert * a string to one of the numeric types, but that the string does not * have the appropriate format. * * @author unascribed * @see java.lang.Integer#parseInt(String) * @since JDK1.0 */ public class NumberFormatException extends IllegalArgumentException { static final long serialVersionUID = -2848938806368998894L; /** * Constructs a <code>NumberFormatException</code> with no detail message. */ public NumberFormatException () { super(); } /** * Constructs a <code>NumberFormatException</code> with the * specified detail message. * * @param s the detail message. */ public NumberFormatException (String s) { super (s); } /** * Factory method for making a <code>NumberFormatException</code> * given the specified input which caused the error. * * @param s the input causing the error */ static NumberFormatException forInputString(String s) { return new NumberFormatException("For input string: \"" + s + "\""); } }
[ "panzha@dian.so" ]
panzha@dian.so
efff9f361c853511e362b8b4db1f89b4f95d1ad0
764419bfba54f2701729abbc4423e856c8d22f09
/sm-shop/src/test/java/com/salesmanager/test/shop/integration/tax/TaxRateIntegrationTest.java
70ba50cdc7b708932e19920ac3781af4367dce22
[ "Apache-2.0" ]
permissive
shopizer-ecommerce/shopizer
972c86b7bebc607bfa7b6138ddb47fa3c1e90cc7
054a3bde1ea8894d13b0a8fb4e28f9db17262224
refs/heads/main
2023-08-30T16:24:57.981774
2023-04-26T02:47:50
2023-04-26T02:47:50
6,789,509
3,532
3,174
Apache-2.0
2023-09-13T14:37:38
2012-11-21T03:42:39
Java
UTF-8
Java
false
false
4,195
java
package com.salesmanager.test.shop.integration.tax; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import java.math.BigDecimal; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; import org.springframework.http.HttpEntity; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringRunner; import com.salesmanager.shop.application.ShopApplication; import com.salesmanager.shop.model.entity.Entity; import com.salesmanager.shop.model.entity.EntityExists; import com.salesmanager.shop.model.tax.PersistableTaxClass; import com.salesmanager.shop.model.tax.PersistableTaxRate; import com.salesmanager.shop.model.tax.TaxRateDescription; import com.salesmanager.test.shop.common.ServicesTestSupport; @SpringBootTest(classes = ShopApplication.class, webEnvironment = WebEnvironment.RANDOM_PORT) @RunWith(SpringRunner.class) public class TaxRateIntegrationTest extends ServicesTestSupport { @Test public void manageTaxClass() throws Exception { //create tax class PersistableTaxClass taxClass = new PersistableTaxClass(); taxClass.setCode("TESTTX"); taxClass.setName("Test tax class"); final HttpEntity<PersistableTaxClass> taxClassEntity = new HttpEntity<>(taxClass, getHeader()); final ResponseEntity<Entity> response = testRestTemplate.postForEntity(String.format("/api/v1/private/tax/class/"), taxClassEntity, Entity.class); Entity e = response.getBody(); assertNotNull(e.getId()); assertTrue(e.getId() > 0); final HttpEntity<String> httpEntity = new HttpEntity<>(getHeader()); //tax class exists final ResponseEntity<EntityExists> exists = testRestTemplate.exchange(String.format("/api/v1/private/tax/class/unique?code=" + taxClass.getCode()), HttpMethod.GET, httpEntity, EntityExists.class); assertTrue(exists.getBody().isExists()); /** //list 1 taxClass @SuppressWarnings("rawtypes") final ResponseEntity<ReadableEntityList> listOfTaxClasses = testRestTemplate.exchange(String.format("/private/tax/class"), HttpMethod.GET, httpEntity, ReadableEntityList.class); assertTrue(listOfTaxClasses.getBody().getRecordsTotal() == 1); **/ } @Test public void manageTaxRates() throws Exception { //create tax class PersistableTaxRate taxRate = new PersistableTaxRate(); taxRate.setCode("taxcode1"); taxRate.setCountry("US"); taxRate.setPriority(0); taxRate.setRate(new BigDecimal(5)); taxRate.setStore("DEFAULT"); taxRate.setTaxClass("DEFAULT"); taxRate.setZone("NY"); //descriptions TaxRateDescription en = new TaxRateDescription(); en.setLanguage("en"); en.setName("TaxCode1EN"); en.setDescription("TaxCode1EN description"); TaxRateDescription fr = new TaxRateDescription(); fr.setLanguage("fr"); fr.setName("TaxCode1FR"); fr.setDescription("TaxCode1fr description"); taxRate.getDescriptions().add(en); taxRate.getDescriptions().add(fr); final HttpEntity<PersistableTaxRate> taxClassEntity = new HttpEntity<>(taxRate, getHeader()); final ResponseEntity<Entity> response = testRestTemplate.postForEntity(String.format("/api/v1/private/tax/rate/"), taxClassEntity, Entity.class); Entity e = response.getBody(); assertNotNull(e.getId()); assertTrue(e.getId() > 0); final HttpEntity<String> httpEntity = new HttpEntity<>(getHeader()); //tax class exists final ResponseEntity<EntityExists> exists = testRestTemplate.exchange(String.format("/api/v1/private/tax/rate/unique?code=" + taxRate.getCode()), HttpMethod.GET, httpEntity, EntityExists.class); assertTrue(exists.getBody().isExists()); } }
[ "csamson777@yahoo.com" ]
csamson777@yahoo.com
b47e0cb42c846d5cda11c3e5f6f9088a7a738a36
51c2a501abfdfc22b6ea1cda2328cc5310b16767
/src/main/java/com/alibaba/druid/sql/ast/statement/SQLAlterTableDropPrimaryKey.java
5e93b530efc9cf333535a1156bcaa088344eaefc
[ "Apache-2.0" ]
permissive
dazen/druid
1e34bf07cb7a61122a4acf2da241860900878444
183572a9d330810dacabc9c729d8f666a6a67a93
refs/heads/master
2021-01-18T10:22:50.911316
2015-08-05T08:32:47
2015-08-05T08:32:47
40,251,980
1
0
null
2015-08-05T15:04:33
2015-08-05T15:04:33
null
UTF-8
Java
false
false
994
java
/* * Copyright 1999-2011 Alibaba Group Holding Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.alibaba.druid.sql.ast.statement; import com.alibaba.druid.sql.ast.SQLObjectImpl; import com.alibaba.druid.sql.visitor.SQLASTVisitor; public class SQLAlterTableDropPrimaryKey extends SQLObjectImpl implements SQLAlterTableItem { @Override protected void accept0(SQLASTVisitor visitor) { visitor.visit(this); visitor.endVisit(this); } }
[ "szujobs@hotmail.com" ]
szujobs@hotmail.com
3259ca5b04d83f493ea2e4814665a2c2aae6b4c3
87a0ddd63ad59eece0b7964a22a710c43f333ad5
/src/main/java/com/baizhitong/resource/model/res/ResExerciseStructure.java
c0ae876f0e624c5acc56d43e9115db45db4c423e
[]
no_license
royxpf/cloud
b41101f87b4edf3e228266f533836d1951768959
84f81431536c11ebe98fc67773e0c8a1223f7b7b
refs/heads/master
2020-06-27T02:13:56.374981
2017-04-25T07:48:42
2017-04-25T07:48:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,996
java
package com.baizhitong.resource.model.res; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table; /** * @author lusm 练习结构实体类 */ @Entity @Table(name = "res_exercise_structure") public class ResExerciseStructure implements Serializable { private static final long serialVersionUID = 1L; /** 主键 */ private @Id Integer id; /** 练习Id */ private Integer exerciseId; /** 本题型顺序号 */ private Integer orderInExercise; /** 学科题型编码 */ private String questionTypeSubjectCode; /** 题型总分 */ private Double typeScore; /** 题型内可否随机出题 */ private Integer canRandomInType; /** 题目内可否乱序出题 */ private Integer canRandomInQuestion; /** 题型小题数量 */ private Integer typeNumber; /** 题型说明 */ private String typeDesc; /** 题型排序 */ private Integer typeSort; /** 所属板块(不需要了吧?) */ private String plate; /** 难度系数描述 */ private String difficultyDescription; /** 答案不允许上传附件 */ private Integer flagNoAttachment; /** 答题只能上传图片 */ private Integer flagOnlyPhotos; /** 答题防粘贴 */ private Integer flagPreventPaste; /** 最低字数限 */ private Integer minChars; /** 音视频播放次数 */ private Integer audioPlayTimes; /** 音视频播放间隔 */ private Integer audioPlayInterval; /** 音视频播放方式 */ private Integer audioPlayType; /** 音频播放单词间的间隔时间 */ private Integer audioPlayWordInterval; /** 小题是连续序号还是独立序号 */ private Integer flagOrderSeriesOrIndep; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public Integer getExerciseId() { return exerciseId; } public void setExerciseId(Integer exerciseId) { this.exerciseId = exerciseId; } public String getQuestionTypeSubjectCode() { return questionTypeSubjectCode; } public void setQuestionTypeSubjectCode(String questionTypeSubjectCode) { this.questionTypeSubjectCode = questionTypeSubjectCode; } public Double getTypeScore() { return typeScore; } public void setTypeScore(Double typeScore) { this.typeScore = typeScore; } public Integer getcanRandomInType() { return canRandomInType; } public void setcanRandomInType(Integer canRandomInType) { this.canRandomInType = canRandomInType; } public Integer getTypeNumber() { return typeNumber; } public void setTypeNumber(Integer typeNumber) { this.typeNumber = typeNumber; } public String getTypeDesc() { return typeDesc; } public void setTypeDesc(String typeDesc) { this.typeDesc = typeDesc; } public Integer getTypeSort() { return typeSort; } public void setTypeSort(Integer typeSort) { this.typeSort = typeSort; } public String getPlate() { return plate; } public void setPlate(String plate) { this.plate = plate; } public String getDifficultyDescription() { return difficultyDescription; } public void setDifficultyDescription(String difficultyDescription) { this.difficultyDescription = difficultyDescription; } public Integer getFlagOnlyPhotos() { return flagOnlyPhotos; } public void setFlagOnlyPhotos(Integer flagOnlyPhotos) { this.flagOnlyPhotos = flagOnlyPhotos; } public Integer getFlagPreventPaste() { return flagPreventPaste; } public void setFlagPreventPaste(Integer flagPreventPaste) { this.flagPreventPaste = flagPreventPaste; } public Integer getMinChars() { return minChars; } public void setMinChars(Integer minChars) { this.minChars = minChars; } public Integer getAudioPlayTimes() { return audioPlayTimes; } public void setAudioPlayTimes(Integer audioPlayTimes) { this.audioPlayTimes = audioPlayTimes; } public Integer getAudioPlayInterval() { return audioPlayInterval; } public void setAudioPlayInterval(Integer audioPlayInterval) { this.audioPlayInterval = audioPlayInterval; } public Integer getAudioPlayType() { return audioPlayType; } public void setAudioPlayType(Integer audioPlayType) { this.audioPlayType = audioPlayType; } public Integer getAudioPlayWordInterval() { return audioPlayWordInterval; } public void setAudioPlayWordInterval(Integer audioPlayWordInterval) { this.audioPlayWordInterval = audioPlayWordInterval; } public Integer getFlagOrderSeriesOrIndep() { return flagOrderSeriesOrIndep; } public void setFlagOrderSeriesOrIndep(Integer flagOrderSeriesOrIndep) { this.flagOrderSeriesOrIndep = flagOrderSeriesOrIndep; } public Integer getOrderInExercise() { return orderInExercise; } public void setOrderInExercise(Integer orderInExercise) { this.orderInExercise = orderInExercise; } public Integer getCanRandomInQuestion() { return canRandomInQuestion; } public void setCanRandomInQuestion(Integer canRandomInQuestion) { this.canRandomInQuestion = canRandomInQuestion; } public Integer getFlagNoAttachment() { return flagNoAttachment; } public void setFlagNoAttachment(Integer flagNoAttachment) { this.flagNoAttachment = flagNoAttachment; } }
[ "2636011620@qq.com" ]
2636011620@qq.com
aa1b3f61f79e0d27ed6c6cf8c9ea738e7824f2a9
fe94bb01bbaf452ab1752cb3c1d1e4ecf297b9be
/src/main/java/com/opencart/setting/ModelSettingStoreResource.java
adb52d4059f2289d80a1d034cc58de1db102ec34
[]
no_license
gmai2006/opencart
9d3b037f09294973112bafbadd22d5edd8457de5
dba44adabf4b8eab3bdb07062c887ba0a2a5405f
refs/heads/master
2020-12-31T06:13:33.113098
2018-01-24T07:35:45
2018-01-24T07:35:45
80,637,392
0
0
null
null
null
null
UTF-8
Java
false
false
1,791
java
/************************************************************************* * * DATASCIENCE9 LLC CONFIDENTIAL * __________________ * * [2018] Datascience9 LLC * All Rights Reserved. * * NOTICE: All information contained herein is, and remains * the property of Datascience9 LLC and its suppliers, * if any. The intellectual and technical concepts contained * herein are proprietary to Datascience9 LLC * and its suppliers and may be covered by U.S. and Foreign Patents, * patents in process, and are protected by trade secret or copyright law. * Dissemination of this information or reproduction of this material * is strictly forbidden unless prior written permission is obtained * from Datascience9 LLC. * @author Paul Mai - Datascience9 LLC */ package com.opencart.setting; import static java.util.Objects.requireNonNull; import java.util.List; import java.util.logging.Logger; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import com.google.inject.Inject; import javax.ws.rs.core.MediaType; import com.opencart.entity.*; import com.opencart.entity.service.*; @Path("/") @Produces(MediaType.APPLICATION_JSON) public class ModelSettingStoreResource { private final static Logger logger = Logger.getLogger(ModelSettingStoreResource.class.getName()); private final ModelSettingStoreService service; @Inject protected ModelSettingStoreResource(final ModelSettingStoreService service) { requireNonNull(service); this.service = service; } @Path("/getStores") @GET public List<OcStore> getStores() { //TOTO //Normally no business logic should in RESTful but may be form validation can be here //TODO return service.getStores(); } }
[ "gmai2006@gmail.com" ]
gmai2006@gmail.com
c64165477efe1e068cd7baad9a45949b4e12e398
de3145ba9eee5c2aa81bc0d1d98b77c97bfb7bc6
/services/order/src/main/java/com/jemmy/services/order/model/domain/OmcShipping.java
a617402ce5d80fd32406080255e22de86cfa5712
[ "Apache-2.0" ]
permissive
hijemmy/spring-cloud-blueprint
63c718f66847d691924e4f35fd3d6edd666f1bf9
8ffa25bd59eb68df76dcf4978d4657f5be08b6c4
refs/heads/master
2020-04-01T03:37:22.347292
2018-11-28T03:44:14
2018-11-28T03:44:14
152,829,128
0
0
null
null
null
null
UTF-8
Java
false
false
2,178
java
/* * Copyright (c) 2018. paascloud.net All Rights Reserved. * 项目名称:paascloud快速搭建企业级分布式微服务平台 * 类名称:OmcShipping.java * 创建人:刘兆明 * 联系方式:paascloud.net@gmail.com * 开源地址: https://github.com/paascloud * 博客地址: http://blog.paascloud.net * 项目官网: http://paascloud.net */ package com.jemmy.services.order.model.domain; import com.jemmy.common.core.mybatis.BaseEntity; import lombok.Data; import lombok.EqualsAndHashCode; import javax.persistence.Column; import javax.persistence.Table; /** * The class Omc shipping. * * @author paascloud.net@gmail.com */ @EqualsAndHashCode(callSuper = true) @Data @Table(name = "pc_omc_shipping") public class OmcShipping extends BaseEntity { private static final long serialVersionUID = 7337074530378267740L; /** * 用户id */ @Column(name = "user_id") private Long userId; /** * 收货姓名 */ @Column(name = "receiver_name") private String receiverName; /** * 收货固定电话 */ @Column(name = "receiver_phone_no") private String receiverPhoneNo; /** * 收货移动电话 */ @Column(name = "receiver_mobile_no") private String receiverMobileNo; /** * 收货人省ID */ @Column(name = "province_id") private Long provinceId; /** * 省份 */ @Column(name = "province_name") private String provinceName; /** * 收货人城市ID */ @Column(name = "city_id") private Long cityId; /** * 收货人城市名称 */ @Column(name = "city_name") private String cityName; /** * 区/县 */ @Column(name = "district_name") private String districtName; /** * 区/县 编码 */ @Column(name = "district_id") private Long districtId; /** * 街道ID */ @Column(name = "street_id") private Long streetId; /** * 接到名称 */ @Column(name = "street_name") private String streetName; /** * 详细地址 */ @Column(name = "detail_address") private String detailAddress; /** * 邮编 */ @Column(name = "receiver_zip_code") private String receiverZipCode; /** * 邮编 */ @Column(name = "default_address") private Integer defaultAddress; }
[ "caiqingh2006@126.com" ]
caiqingh2006@126.com
bb344d4e5b5b05c90924d0bc8c8c5c9919a1dc87
8bc8e94e7d9d2a6c6aaae2a03b1280a1baa5dd23
/src/apple/coreservices/struct/DXInfo.java
df4ac3329b8ad240f9a74b056013f5c10e4152a7
[]
no_license
VadimZharkov/natj-mac-example
fd5eb814371bde26d7b77c54edbeebb3fa667851
94af6b2c1d01fb3f9ebd28550d5996fe49fe3ddc
refs/heads/master
2020-06-22T00:09:07.333774
2019-07-18T12:44:25
2019-07-18T12:44:25
197,585,255
1
0
null
null
null
null
UTF-8
Java
false
false
2,375
java
/* Copyright 2014-2016 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package apple.coreservices.struct; import org.moe.natj.c.StructObject; import org.moe.natj.c.ann.Structure; import org.moe.natj.c.ann.StructureField; import org.moe.natj.general.NatJ; import org.moe.natj.general.Pointer; import org.moe.natj.general.ann.ByValue; import org.moe.natj.general.ann.Generated; import apple.struct.Point; @Generated @Structure(alignment = 2) public final class DXInfo extends StructObject { static { NatJ.register(); } private static long __natjCache; @Generated public DXInfo() { super(DXInfo.class); } @Generated protected DXInfo(Pointer peer) { super(peer); } @Generated @StructureField(order = 0, isGetter = true) @ByValue public native Point frScroll(); @Generated @StructureField(order = 0, isGetter = false) public native void setFrScroll(@ByValue Point value); @Generated @StructureField(order = 1, isGetter = true) public native int frOpenChain(); @Generated @StructureField(order = 1, isGetter = false) public native void setFrOpenChain(int value); @Generated @StructureField(order = 2, isGetter = true) public native byte frScript(); @Generated @StructureField(order = 2, isGetter = false) public native void setFrScript(byte value); @Generated @StructureField(order = 3, isGetter = true) public native byte frXFlags(); @Generated @StructureField(order = 3, isGetter = false) public native void setFrXFlags(byte value); @Generated @StructureField(order = 4, isGetter = true) public native short frComment(); @Generated @StructureField(order = 4, isGetter = false) public native void setFrComment(short value); @Generated @StructureField(order = 5, isGetter = true) public native int frPutAway(); @Generated @StructureField(order = 5, isGetter = false) public native void setFrPutAway(int value); }
[ "vadim.zharkov@gmail.com" ]
vadim.zharkov@gmail.com
a5c8a8ef7580f706669f2f4d75fac1cf138c5ed8
9d32980f5989cd4c55cea498af5d6a413e08b7a2
/A1_7_1_1/src/main/java/android/provider/SearchIndexablesProvider.java
ae994ef2bbcbbd2c5b7a278696952b0beafbe31d
[]
no_license
liuhaosource/OppoFramework
e7cc3bcd16958f809eec624b9921043cde30c831
ebe39acabf5eae49f5f991c5ce677d62b683f1b6
refs/heads/master
2023-06-03T23:06:17.572407
2020-11-30T08:40:07
2020-11-30T08:40:07
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,333
java
package android.provider; import android.Manifest.permission; import android.content.ContentProvider; import android.content.ContentValues; import android.content.Context; import android.content.UriMatcher; import android.content.pm.ProviderInfo; import android.database.Cursor; import android.net.Uri; import android.provider.SearchIndexablesContract.NonIndexableKey; import android.provider.SearchIndexablesContract.RawData; import android.provider.SearchIndexablesContract.XmlResource; public abstract class SearchIndexablesProvider extends ContentProvider { private static final int MATCH_NON_INDEXABLE_KEYS_CODE = 3; private static final int MATCH_RAW_CODE = 2; private static final int MATCH_RES_CODE = 1; private static final String TAG = "IndexablesProvider"; private String mAuthority; private UriMatcher mMatcher; public abstract Cursor queryNonIndexableKeys(String[] strArr); public abstract Cursor queryRawData(String[] strArr); public abstract Cursor queryXmlResources(String[] strArr); public void attachInfo(Context context, ProviderInfo info) { this.mAuthority = info.authority; this.mMatcher = new UriMatcher(-1); this.mMatcher.addURI(this.mAuthority, SearchIndexablesContract.INDEXABLES_XML_RES_PATH, 1); this.mMatcher.addURI(this.mAuthority, SearchIndexablesContract.INDEXABLES_RAW_PATH, 2); this.mMatcher.addURI(this.mAuthority, SearchIndexablesContract.NON_INDEXABLES_KEYS_PATH, 3); if (!info.exported) { throw new SecurityException("Provider must be exported"); } else if (!info.grantUriPermissions) { throw new SecurityException("Provider must grantUriPermissions"); } else if (permission.READ_SEARCH_INDEXABLES.equals(info.readPermission)) { super.attachInfo(context, info); } else { throw new SecurityException("Provider must be protected by READ_SEARCH_INDEXABLES"); } } public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) { switch (this.mMatcher.match(uri)) { case 1: return queryXmlResources(null); case 2: return queryRawData(null); case 3: return queryNonIndexableKeys(null); default: throw new UnsupportedOperationException("Unknown Uri " + uri); } } public String getType(Uri uri) { switch (this.mMatcher.match(uri)) { case 1: return XmlResource.MIME_TYPE; case 2: return RawData.MIME_TYPE; case 3: return NonIndexableKey.MIME_TYPE; default: throw new IllegalArgumentException("Unknown URI " + uri); } } public final Uri insert(Uri uri, ContentValues values) { throw new UnsupportedOperationException("Insert not supported"); } public final int delete(Uri uri, String selection, String[] selectionArgs) { throw new UnsupportedOperationException("Delete not supported"); } public final int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) { throw new UnsupportedOperationException("Update not supported"); } }
[ "dstmath@163.com" ]
dstmath@163.com
3811c8ed22ba0140107a9b5bf82dd12c1c620b36
13ea5da0b7b8d4ba87d622a5f733dcf6b4c5f1e3
/crash-reproduction-new-fitness/results/XWIKI-13196-1-13-Single_Objective_GGA-IntegrationSingleObjective-BasicBlockCoverage/org/xwiki/model/reference/EntityReference_ESTest.java
82eca55a350d24cca06fa8f6598f1c29e5e841d3
[ "MIT", "CC-BY-4.0" ]
permissive
STAMP-project/Botsing-basic-block-coverage-application
6c1095c6be945adc0be2b63bbec44f0014972793
80ea9e7a740bf4b1f9d2d06fe3dcc72323b848da
refs/heads/master
2022-07-28T23:05:55.253779
2022-04-20T13:54:11
2022-04-20T13:54:11
285,771,370
0
0
null
null
null
null
UTF-8
Java
false
false
1,144
java
/* * This file was automatically generated by EvoSuite * Sat May 16 20:58:17 UTC 2020 */ package org.xwiki.model.reference; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; import org.xwiki.model.EntityType; import org.xwiki.model.reference.EntityReference; @RunWith(EvoRunner.class) @EvoRunnerParameters(useVFS = true, useJEE = true) public class EntityReference_ESTest extends EntityReference_ESTest_scaffolding { @Test(timeout = 4000) public void test0() throws Throwable { String string0 = ""; String string1 = "] does not belong to the parents chain of the reference ["; EntityType entityType0 = EntityType.SPACE; EntityReference entityReference0 = new EntityReference("] does not belong to the parents chain of the reference [", entityType0); EntityReference entityReference1 = entityReference0.getRoot(); entityReference0.getType(); // Undeclared exception! entityReference1.setName(""); } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
0d4add0ff5deda93799ea15446c41352a823d4c8
0012475da934534fb0d23555cd99c7800903d232
/src/main/java/com/lgc/ctps/sgpa/web/rest/errors/BadRequestAlertException.java
670e020f623feac9b3dbff8067bdf80e2bb7f080
[]
no_license
iorran/sgpa
38c75c3d4870e98fbe70a1c506bd911cba0f2efa
a6bc6ed6dbd4f151c1d229b58edb79e662406e8d
refs/heads/master
2021-04-12T08:45:43.060777
2018-03-23T19:45:23
2018-03-23T19:45:23
125,948,162
0
0
null
2018-03-20T03:30:57
2018-03-20T02:19:24
Java
UTF-8
Java
false
false
1,266
java
package com.lgc.ctps.sgpa.web.rest.errors; import org.zalando.problem.AbstractThrowableProblem; import org.zalando.problem.Status; import java.net.URI; import java.util.HashMap; import java.util.Map; public class BadRequestAlertException extends AbstractThrowableProblem { private final String entityName; private final String errorKey; public BadRequestAlertException(String defaultMessage, String entityName, String errorKey) { this(ErrorConstants.DEFAULT_TYPE, defaultMessage, entityName, errorKey); } public BadRequestAlertException(URI type, String defaultMessage, String entityName, String errorKey) { super(type, defaultMessage, Status.BAD_REQUEST, null, null, null, getAlertParameters(entityName, errorKey)); this.entityName = entityName; this.errorKey = errorKey; } public String getEntityName() { return entityName; } public String getErrorKey() { return errorKey; } private static Map<String, Object> getAlertParameters(String entityName, String errorKey) { Map<String, Object> parameters = new HashMap<>(); parameters.put("message", "error." + errorKey); parameters.put("params", entityName); return parameters; } }
[ "jhipster-bot@users.noreply.github.com" ]
jhipster-bot@users.noreply.github.com
b76d5b3d0b1d0683443c88d3417f1af85436bfeb
e21d17cdcd99c5d53300a7295ebb41e0f876bbcb
/22_Chapters_Edition/src/main/resources/ExampleCodes/typeinfo/SnowRemovalRobot.java
259e04014151449b2598625818dc340acc6989c7
[]
no_license
lypgod/Thinking_In_Java_4th_Edition
dc42a377de28ae51de2c4000a860cd3bc93d0620
5dae477f1a44b15b9aa4944ecae2175bd5d8c10e
refs/heads/master
2020-04-05T17:39:55.720961
2018-11-11T12:07:56
2018-11-11T12:08:26
157,070,646
0
0
null
null
null
null
UTF-8
Java
false
false
1,367
java
package ExampleCodes.typeinfo;//: typeinfo/SnowRemovalRobot.java import java.util.*; public class SnowRemovalRobot implements Robot { private String name; public SnowRemovalRobot(String name) {this.name = name;} public String name() { return name; } public String model() { return "SnowBot Series 11"; } public List<Operation> operations() { return Arrays.asList( new Operation() { public String description() { return name + " can shovel snow"; } public void command() { System.out.println(name + " shoveling snow"); } }, new Operation() { public String description() { return name + " can chip ice"; } public void command() { System.out.println(name + " chipping ice"); } }, new Operation() { public String description() { return name + " can clear the roof"; } public void command() { System.out.println(name + " clearing roof"); } } ); } public static void main(String[] args) { Robot.Test.test(new SnowRemovalRobot("Slusher")); } } /* Output: Robot name: Slusher Robot model: SnowBot Series 11 Slusher can shovel snow Slusher shoveling snow Slusher can chip ice Slusher chipping ice Slusher can clear the roof Slusher clearing roof *///:~
[ "lypgod@hotmail.com" ]
lypgod@hotmail.com
0d9efc56516f15ef65319feb9eac92b3d26f80c3
7198994bd71ffb464916bc7f1c3164bb14d65f77
/library/src/main/java/cn/app/library/dialog/styleddialog/view/SuperHolder.java
7d544409b9cd1c5d93a268112b4188d2381c30e3
[]
no_license
nakupenda178/lklib
78f00b7f7a0aaf42389107638d810e0c5ffc407b
7cc36badfe0cf8a1d2b17e579c9fd04adf3d3eb7
refs/heads/master
2020-07-05T04:29:54.729597
2018-05-04T06:54:21
2018-05-04T06:54:21
null
0
0
null
null
null
null
UTF-8
Java
false
false
771
java
package cn.app.library.dialog.styleddialog.view; import android.content.Context; import android.support.annotation.LayoutRes; import android.view.View; import cn.app.library.dialog.styleddialog.config.ConfigBean; /** * Created by Administrator on 2016/4/15 0015. */ public abstract class SuperHolder { public View rootView; public SuperHolder(Context context){ rootView = View.inflate(context,setLayoutRes(),null); findViews(); } protected abstract void findViews(); protected abstract @LayoutRes int setLayoutRes(); /** * 一般情况下,实现这个方法就足够了 * @param context * @param bean */ public abstract void assingDatasAndEvents(Context context, ConfigBean bean); }
[ "zhaolin.tongwei@gmail.com" ]
zhaolin.tongwei@gmail.com
8dbaf0a3c161998b765c13680f1b0beea9edfb2f
a7c083799a8b0765091aea7916d8819a76abe2f1
/LeetCode/src/com/bsb/leetcode/vip/bytedance/T62.java
655cd1f75f443c619765ad261e1d8252c4d3ee06
[]
no_license
challengerzsz/Algorithm
121cc2109f75f73b8a9cad892f5195258c898f5e
3baded2d7626d86fa2a31191394f35b7f865a2cd
refs/heads/master
2021-05-26T05:51:11.892323
2020-04-23T14:16:57
2020-04-23T14:16:57
127,735,766
0
0
null
null
null
null
UTF-8
Java
false
false
778
java
package com.bsb.leetcode.vip.bytedance; import java.util.Arrays; /** * @author : zengshuaizhi * @date : 2020-03-31 20:20 */ public class T62 { // 不同路径 // dfs可以做 但是大量回溯加重复计算 可以用记忆化优化 但是不是最优解 public int uniquePaths(int m, int n) { // dp[i][j]表示走到{i, j}有多少种走法 int[][] dp = new int[n][m]; Arrays.fill(dp[0], 1); for (int i = 0; i < n; i++) dp[i][0] = 1; for (int i = 1; i < n; i++) { for (int j = 1; j < m; j++) { dp[i][j] = dp[i - 1][j] + dp[i][j - 1]; } } return dp[n - 1][m - 1]; } public static void main(String[] args) { new T62().uniquePaths(3, 2); } }
[ "challengerzsz@126.com" ]
challengerzsz@126.com
6aff8df74db7b2941fb1d5ad4275163b8140c26c
a841d3c21395168f761656293d45c71f924b98fd
/hybris/bin/custom/johndeere/johndeerestorefront/web/src/com/deere/storefront/interceptors/beforecontroller/RequireHardLoginBeforeControllerHandler.java
e707234a037b23115e087ae46f9e5c58ad46aebb
[]
no_license
vinayj344/johndeere
7add3c82175159d56a84538441c3f6ec49115e0e
cbf87ca7d3dd012214f01a0d5de60c69e8e508db
refs/heads/master
2020-03-26T16:29:55.733222
2018-08-22T13:43:49
2018-08-22T13:43:49
145,105,874
0
0
null
2018-08-22T13:43:50
2018-08-17T10:14:04
Java
UTF-8
Java
false
false
3,763
java
/* * [y] hybris Platform * * Copyright (c) 2017 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 com.deere.storefront.interceptors.beforecontroller; import java.lang.annotation.Annotation; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Required; import org.springframework.core.annotation.AnnotationUtils; import org.springframework.security.web.RedirectStrategy; import org.springframework.web.method.HandlerMethod; import de.hybris.platform.acceleratorstorefrontcommons.annotations.RequireHardLogIn; import de.hybris.platform.acceleratorstorefrontcommons.interceptors.BeforeControllerHandler; import com.deere.storefront.security.evaluator.impl.RequireHardLoginEvaluator; /** */ public class RequireHardLoginBeforeControllerHandler implements BeforeControllerHandler { private static final Logger LOG = Logger.getLogger(RequireHardLoginBeforeControllerHandler.class); public static final String SECURE_GUID_SESSION_KEY = "acceleratorSecureGUID"; private String loginUrl; private String loginAndCheckoutUrl; private RedirectStrategy redirectStrategy; private RequireHardLoginEvaluator requireHardLoginEvaluator; protected String getLoginUrl() { return loginUrl; } @Required public void setLoginUrl(final String loginUrl) { this.loginUrl = loginUrl; } protected RedirectStrategy getRedirectStrategy() { return redirectStrategy; } @Required public void setRedirectStrategy(final RedirectStrategy redirectStrategy) { this.redirectStrategy = redirectStrategy; } public String getLoginAndCheckoutUrl() { return loginAndCheckoutUrl; } @Required public void setLoginAndCheckoutUrl(final String loginAndCheckoutUrl) { this.loginAndCheckoutUrl = loginAndCheckoutUrl; } protected RequireHardLoginEvaluator getRequireHardLoginEvaluator() { return requireHardLoginEvaluator; } @Required public void setRequireHardLoginEvaluator(RequireHardLoginEvaluator requireHardLoginEvaluator) { this.requireHardLoginEvaluator = requireHardLoginEvaluator; } @Override public boolean beforeController(final HttpServletRequest request, final HttpServletResponse response, final HandlerMethod handler) throws Exception { // We only care if the request is secure if (request.isSecure()) { // Check if the handler has our annotation final RequireHardLogIn annotation = findAnnotation(handler, RequireHardLogIn.class); if (annotation != null) { boolean redirect = requireHardLoginEvaluator.evaluate(request, response); if (redirect) { LOG.warn("Redirection required"); getRedirectStrategy().sendRedirect(request, response, getRedirectUrl(request)); return false; } } } return true; } protected String getRedirectUrl(final HttpServletRequest request) { if (request != null && request.getServletPath().contains("checkout")) { return getLoginAndCheckoutUrl(); } else { return getLoginUrl(); } } protected <T extends Annotation> T findAnnotation(final HandlerMethod handlerMethod, final Class<T> annotationType) { // Search for method level annotation final T annotation = handlerMethod.getMethodAnnotation(annotationType); if (annotation != null) { return annotation; } // Search for class level annotation return AnnotationUtils.findAnnotation(handlerMethod.getBeanType(), annotationType); } }
[ "vinay.j344@gmail.com" ]
vinay.j344@gmail.com
25f9f31f728b1093cae1b44d5315f21c7957706e
d6b467da7999bb29ef659768890d4138b8e38195
/chinaw/src/com/wuxi/app/activity/homepage/fantasticwuxi/ChannelActivity.java
511b9fbf4cabfedbc0e4e59d009dd428a35d3d4b
[]
no_license
ChinaWuxiandroid/chianwuxi_android
0975b6ece55af95182b13616aad92ce2d3121928
320fb895583c11bf5d7b2701ef3c8b459492cadf
refs/heads/master
2023-06-07T09:04:06.527140
2023-06-06T04:01:16
2023-06-06T04:01:16
12,722,746
0
1
null
null
null
null
UTF-8
Java
false
false
5,896
java
/* * (#)ChannelActivity.java 1.0 2013-8-29 2013-8-29 GMT+08:00 */ package com.wuxi.app.activity.homepage.fantasticwuxi; import java.util.List; import android.annotation.SuppressLint; import android.os.Bundle; import android.os.Handler; import android.os.Message; import android.support.v4.app.FragmentTransaction; import android.view.View; import android.widget.ImageButton; import android.widget.Toast; import com.wuxi.app.BaseFragment; import com.wuxi.app.R; import com.wuxi.app.activity.BaseSlideActivity; import com.wuxi.app.engine.ChannelService; import com.wuxi.app.fragment.commonfragment.NavigatorWithContentFragment; import com.wuxi.app.fragment.homepage.fantasticwuxi.ChannelContentListFragment; import com.wuxi.app.fragment.homepage.fantasticwuxi.CityMapFragment; import com.wuxi.app.listeners.InitializContentLayoutListner; import com.wuxi.app.util.CacheUtil; import com.wuxi.app.util.Constants; import com.wuxi.app.util.LogUtil; import com.wuxi.app.view.TitleScrollLayout; import com.wuxi.domain.Channel; import com.wuxi.domain.MenuItem; import com.wuxi.exception.NetException; /** * @author wanglu 泰得利通 魅力锡城Activity 频道最外层activity * @version $1.0, 2013-8-29 2013-8-29 GMT+08:00 * */ public class ChannelActivity extends BaseSlideActivity implements InitializContentLayoutListner { private TitleScrollLayout mtitleScrollLayout; private static final int MANCOTENT_ID = R.id.model_main; private static final int TITLE__LOAD_SUCESS = 0; private static final int TITLE_LOAD_ERROR = 1; protected static final String TAG = "ChannelFragment"; public static final String SHOWCHANNEL_LAYOUT_INDEXKEY = Constants.CheckPositionKey.LEVEL_TWO__KEY; private ImageButton ib_nextItems; private List<Channel> titleChannels;// 头部频道 private int perCount = 4; @SuppressLint("HandlerLeak") private Handler handler = new Handler() { public void handleMessage(android.os.Message msg) { String tip = ""; if (msg.obj != null) { tip = msg.obj.toString(); } switch (msg.what) { case TITLE__LOAD_SUCESS: showTitleData(); break; case TITLE_LOAD_ERROR: Toast.makeText(ChannelActivity.this, tip, Toast.LENGTH_SHORT) .show(); break; } }; }; @Override protected void findMainContentViews(View view) { Bundle bundle = getIntent().getExtras(); int showIndex = 0; if (bundle != null) { showIndex = bundle.getInt(SHOWCHANNEL_LAYOUT_INDEXKEY);// } mtitleScrollLayout = (TitleScrollLayout) view.findViewById(R.id.title_scroll_action);// 头部控件 mtitleScrollLayout.setInitializContentLayoutListner(this);// 设置绑定内容界面监听器 mtitleScrollLayout.setPerscreenCount(perCount); int screenIndex = showIndex / perCount;// 第几屏 int showScreenIndex = showIndex % perCount;// 屏的 mtitleScrollLayout.setShowItemIndex(showScreenIndex);// 设置显示的默认布局 mtitleScrollLayout.setmCurScreen(screenIndex); ib_nextItems = (ImageButton) view.findViewById(R.id.btn_next_screen);// 头部下一个按钮 ib_nextItems.setOnClickListener(this); loadTitleData(); } @Override public void bindContentLayout(BaseFragment fragment) { bindFragment(fragment); } /** * * wanglu 泰得利通 加载头部Channel */ @SuppressWarnings("unchecked") public void loadTitleData() { if (CacheUtil.get(menuItem.getChannelId()) != null) {// 从缓存获取 titleChannels = (List<Channel>) CacheUtil.get(menuItem.getChannelId()); showTitleData(); return; } new Thread(new Runnable() { @Override public void run() { ChannelService channelService = new ChannelService( ChannelActivity.this); try { titleChannels = channelService.getSubChannels(menuItem.getChannelId()); if (null != titleChannels) { handler.sendEmptyMessage(TITLE__LOAD_SUCESS); } else { Message message = handler.obtainMessage(); message.obj = "error"; handler.sendEmptyMessage(TITLE_LOAD_ERROR); } } catch (NetException e) { LogUtil.i(TAG, "出错"); e.printStackTrace(); Message message = handler.obtainMessage(); message.obj = e.getMessage(); handler.sendEmptyMessage(TITLE_LOAD_ERROR); } } } ).start(); } /** * 显示头部数据 wanglu 泰得利通 */ private void showTitleData() { initializSubFragmentsLayout(); mtitleScrollLayout.initChannelScreen( ChannelActivity.this, getLayoutInflater(), titleChannels);// 初始化头部空间 // initData(titleChannels.get(0));// 默认显示第一个channel的子channel页 } @Override public void onClick(View v) { super.onClick(v); switch (v.getId()) { case R.id.btn_next_screen:// 下一屏 mtitleScrollLayout.goNextScreen(); break; } } private void bindFragment(BaseFragment fragment) { FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); ft.replace(MANCOTENT_ID, fragment);// 替换内容界面 ft.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE); ft.commitAllowingStateLoss(); } public void setMenuItem(MenuItem menuItem) { this.menuItem = menuItem; } public void initializSubFragmentsLayout() { for (Channel channel : titleChannels) { if (channel.getChannelName().equals("城市地图")) { channel.setContentFragment(CityMapFragment.class); } else if (channel.getChildrenChannelsCount() > 0) { channel.setContentFragment(NavigatorWithContentFragment.class); } else if (channel.getChildrenContentsCount() > 0) { channel.setContentFragment(ChannelContentListFragment.class); } } } @Override protected int getLayoutId() { return R.layout.fragment_chanel_layout; } @Override protected String getTitleText() { return menuItem.getName(); } @Override public void redirectFragment(MenuItem showMenuItem, int showMenuPositon, int subMenuPostion) { } }
[ "wanglu0919@163.com" ]
wanglu0919@163.com
6bedaf2d5bd5f45e901963cea8c2f2f36d2673cc
89aa449b020d2f6ea00fdd8ea184fc3b470f16d5
/src/AlgorithmAndDataStructureTests/LeetCode/Question118/ListNode.java
2e8115ac42218526fbb4879f9ce5fec4b2d03e25
[]
no_license
zoebbmm/CodeTests
56ea2f9cc3cf6083b1baa2c2b0c4875309bc5e30
384edbd526558b38dc165bb4e0f22ad1f4d94456
refs/heads/master
2021-01-23T07:59:37.797605
2017-03-28T14:11:44
2017-03-28T14:11:44
86,468,094
0
0
null
null
null
null
UTF-8
Java
false
false
223
java
package AlgorithmAndDataStructureTests.LeetCode.Question118; /** * Created by weizhou on 10/31/16. */ public class ListNode { int data; ListNode next; public ListNode(int d) { this.data = d; } }
[ "zoebbmm@gmail.com" ]
zoebbmm@gmail.com
5ed3efdcc1b65ea1509a484b297d12718991f6cf
b0f2249198ba35cfe7f5e3cebbe4413eef264f14
/src/main/java/nd/esp/service/lifecycle/support/busi/SessionUtil.java
7632151b89287e005e0d7d040366552e8416bb8f
[]
no_license
434480761/wisdom_knowledge
f5f520cfb07685fd97d2d1a5970630a00b1fc69f
1ee22a3536c1247f7b78f6815befbd104670119b
refs/heads/master
2021-04-28T23:39:24.844625
2017-01-05T06:26:29
2017-01-05T06:26:29
77,729,017
0
2
null
null
null
null
UTF-8
Java
false
false
4,365
java
package nd.esp.service.lifecycle.support.busi; import com.nd.gaea.client.http.WafSecurityHttpClient; import nd.esp.service.lifecycle.support.Constant; import nd.esp.service.lifecycle.support.Constant.CSInstanceInfo; import nd.esp.service.lifecycle.utils.StringUtils; import java.util.HashMap; import java.util.Map; public class SessionUtil { private static Map<String,Map<String,Object>> cacheSessions = new HashMap<String,Map<String,Object>>(); //默认创建session的用户id public final static String DEAFULT_SESSION_USERID="777"; /** * 调用cs接口获取session * * @param uid 用户id * * @return session id */ public static String createSession(String uid) { return SessionUtil.createSession(uid, Constant.CS_INSTANCE_MAP.get(Constant.CS_DEFAULT_INSTANCE).getUrl(), Constant.CS_INSTANCE_MAP.get(Constant.CS_DEFAULT_INSTANCE).getPath(), Constant.CS_INSTANCE_MAP.get(Constant.CS_DEFAULT_INSTANCE).getServiceId()); } /** * 调用cs接口获取session * * @param uid 用户id * @param url 获取session的api * @param path 请求session的作用path * @param serviceId 服务id * */ public static String createSession(String uid, String url, String path, String serviceId) { if (cacheSessions.containsKey(uid + "@" + serviceId + path)) { Map<String, Object> sessionBefore = cacheSessions.get(uid + "@" + serviceId + path); long expireTime = Long.parseLong(String.valueOf(sessionBefore.get("expire_at"))); if (expireTime - System.currentTimeMillis() > 6000000) { return String.valueOf(sessionBefore.get("session")); } } Map<String, Object> requestBody = new HashMap<String, Object>(); requestBody.put("path", path); requestBody.put("service_id", serviceId); requestBody.put("uid",uid); requestBody.put("role",Constant.FILE_OPERATION_ROLE); requestBody.put("expires",Constant.FILE_OPERATION_EXPIRETIME); WafSecurityHttpClient wafSecurityHttpClient = new WafSecurityHttpClient(Constant.WAF_CLIENT_RETRY_COUNT); url = url + "/sessions"; Map<String, Object> session = wafSecurityHttpClient.postForObject( url, requestBody, Map.class); cacheSessions.put(uid+"@"+serviceId+path, session); return String.valueOf(session.get("session")); } /** * @desc: 获取session * @createtime: 2015年6月25日 * @author: liuwx * @param uid * @param instanceInfo * @return */ public static String createSession(String uid,CSInstanceInfo instanceInfo){ return SessionUtil.createSession(uid, instanceInfo.getUrl(), instanceInfo.getPath(), instanceInfo.getServiceId()); } /** * @desc: 获取session uid使用默认值 * @createtime: 2015年6月25日 * @author: liuwx * @param instanceInfo * @return */ public static String createSession(CSInstanceInfo instanceInfo){ return createSession(DEAFULT_SESSION_USERID, instanceInfo); } /** * @desc:获取Href中对应的cs实例key ${ref-path}/edu * @createtime: 2015年6月25日 * @author: liuwx * @param href * @see Constant.CSInstanceInfo * @see Constant#CS_INSTANCE_MAP * @return */ public static String getHrefInstanceKey(String href){ if(StringUtils.isEmpty(href)){ throw new IllegalArgumentException("href必须不为空"); } if(href.indexOf("/") < 0){ throw new IllegalArgumentException("href格式不对"); } int secondSlash = href.indexOf("/", href.indexOf("/")+1); return href.substring(0, secondSlash); } public static void main(String[] args) { String s="${ref-path}/edu/esp/coursewares/4108bde5-470d-404e-a252-29d915dce254.pkg/main.xml"; System.out.println(s.substring(0,s.indexOf("/", s.indexOf("/")+1))); System.out.println(s.indexOf("/", s.indexOf("/")+1)); System.out.println(getHrefInstanceKey(s)); } }
[ "901112@nd.com" ]
901112@nd.com
721d6ae95c71a07bb56552ecc178814e019c6c2f
78659f07e348174c71bda8af5febc4d1f7fda8cc
/src/com/techzhai/dao/ArticleDao.java
cfc9c92ab9b537a444e2949ef9beec8428e12a88
[]
no_license
TaXueWWL/Technology_Zhai_Blog
28f2f144d38f4c6f74f75978a4b52cccdf7e173f
2be200618b5e50a78b50fa33f2f531d8d25621cf
refs/heads/master
2020-04-03T07:50:24.290426
2016-07-04T02:43:21
2016-07-04T02:43:21
62,435,456
2
0
null
2016-07-02T05:26:48
2016-07-02T05:26:48
null
UTF-8
Java
false
false
716
java
package com.techzhai.dao; import java.util.List; import com.techzhai.model.ArticleBean; /** * 文章部分处理的dao * @author duanjigui * 2016.6.30 */ public interface ArticleDao { public void saveArticle(ArticleBean articleBean); //保存一篇文章 public List<ArticleBean> fetchAllArticle(); //获取所有文章的列表 public void deletArticle(ArticleBean articleBean); //删除指定的文章 public void modifyArticle(ArticleBean articleBean); //修改指定文章 public ArticleBean fetchArticleById(int articleId); //根据文章id查看文章信息 public List<ArticleBean> fetchArticelistByTypeId(int type_id); //通过文章类型id获取对应类型下所有文章 }
[ "1210812591@qq.com" ]
1210812591@qq.com
72bd03629f61a0708603972fe9f3b9b9ad0c662f
3370a0d2a9e3c73340b895de3566f6e32aa3ca4a
/alwin-middleware-grapescode/alwin-core/src/main/java/com/codersteam/alwin/core/service/impl/scheduler/strategy/UpdateCompaniesInvolvementSchedulerExecution.java
1aacb9fba134e2a4d785049e4a922e9438972548
[]
no_license
Wilczek01/alwin-projects
8af8e14601bd826b2ec7b3a4ce31a7d0f522b803
17cebb64f445206320fed40c3281c99949c47ca3
refs/heads/master
2023-01-11T16:37:59.535951
2020-03-24T09:01:01
2020-03-24T09:01:01
249,659,398
0
0
null
2023-01-07T16:18:14
2020-03-24T09:02:28
Java
UTF-8
Java
false
false
1,487
java
package com.codersteam.alwin.core.service.impl.scheduler.strategy; import com.codersteam.alwin.common.scheduler.SchedulerTaskType; import com.codersteam.alwin.core.api.service.scheduler.SchedulerExecutionInfoService; import com.codersteam.alwin.core.service.impl.customer.UpdateCompaniesInvolvementService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.lang.invoke.MethodHandles; /** * Zadanie cykliczne uaktualnienia zaangażowania firm z otwartym zleceniem windykacyjnym * * @author Michal Horowic */ public class UpdateCompaniesInvolvementSchedulerExecution extends SchedulerExecution { private static final Logger LOG = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass()); private static final String DESCRIPTION = "Update company involvement"; private final UpdateCompaniesInvolvementService involvementService; public UpdateCompaniesInvolvementSchedulerExecution(final SchedulerExecutionInfoService schedulerExecutionService, final UpdateCompaniesInvolvementService involvementService) { super(schedulerExecutionService, SchedulerTaskType.UPDATE_COMPANIES_INVOLVEMENT); this.involvementService = involvementService; } @Override protected void executeScheduler() { involvementService.updateCompaniesInvolvement(); } @Override protected Logger getLogger() { return LOG; } @Override protected String getDescription() { return DESCRIPTION; } }
[ "grogus@ad.aliorleasing.pl" ]
grogus@ad.aliorleasing.pl
d9f304fd24b384837123d735d25c8a0a85454d1a
dd61b553197f7072942a636fc38151d6434ca557
/0001-0050/26/src/Solution.java
5650376a26e0ec5caa8ef9e8f691f1823a36dbdc
[]
no_license
yeshaoting/LeetCode-Solution-Java
4064d1756ca3b3720ee72b83c18c8a5c88c098fc
f02993fad941047b2cc307d373eb2bb3a69f3f38
refs/heads/master
2020-07-06T22:50:47.382887
2019-07-13T00:40:54
2019-07-13T00:40:54
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,141
java
import java.util.Arrays; // https://leetcode-cn.com/problems/remove-duplicates-from-sorted-array/description/ // 常规题目:这里利用到数组的有序性,如果遇到和上一个一样的元素,就什么都不做 public class Solution { public int removeDuplicates(int[] nums) { int len = nums.length; if (len == 0) { return 0; } int pre = nums[0]; int l = 1; for (int i = 1; i < len; i++) { if (nums[i] != pre) { // 注意顺序:先更新值,再递增脚标 pre = nums[i]; nums[l] = nums[i]; l++; } } // 注意 l 是遍历到的与之前不同元素的个数,要把第 1 个元素算进去,所以要加 1 return l; } public static void main(String[] args) { int[] nums = {1, 1, 2, 2, 2, 3, 3, 4, 4, 4}; Solution solution = new Solution(); int ret = solution.removeDuplicates(nums); System.out.println(ret); System.out.println(Arrays.toString(nums)); } }
[ "121088825@qq.com" ]
121088825@qq.com
c63c53cabb8caa39e7eefaef8f75ea86393ba978
96f8d42c474f8dd42ecc6811b6e555363f168d3e
/baike/sources/qsbk/app/adapter/ParticipateAdapter.java
2b54dd4d905e3207cf71c51284659a29df7b9d2a
[]
no_license
aheadlcx/analyzeApk
050b261595cecc85790558a02d79739a789ae3a3
25cecc394dde4ed7d4971baf0e9504dcb7fabaca
refs/heads/master
2020-03-10T10:24:49.773318
2018-04-13T09:44:45
2018-04-13T09:44:45
129,332,351
6
2
null
null
null
null
UTF-8
Java
false
false
7,029
java
package qsbk.app.adapter; import android.app.Activity; import android.text.TextUtils; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import android.widget.TextView; import com.facebook.common.executors.UiThreadImmediateExecutorService; import com.facebook.drawee.backends.pipeline.Fresco; import com.facebook.imagepipeline.request.ImageRequest; import java.util.ArrayList; import java.util.HashMap; import org.json.JSONArray; import org.json.JSONObject; import qsbk.app.QsbkApp; import qsbk.app.R; import qsbk.app.adapter.ArticleAdapter.AcrossChangeDate; import qsbk.app.adapter.ArticleAdapter.ViewHolder; import qsbk.app.model.Article; import qsbk.app.model.ParticipateArticle; import qsbk.app.model.RssArticle.Type; import qsbk.app.utils.LogUtil; import qsbk.app.utils.UIHelper; import qsbk.app.utils.UIHelper$Theme; import qsbk.app.widget.DiggerBar; public class ParticipateAdapter extends BaseVideoAdapter { private static HashMap<String, SubscribeIcon> e = null; public static class SubscribeIcon { public String day_icon_url; public String night_icon_url; public String text; public String type; public String getIconUrl() { return UIHelper.isNightTheme() ? this.night_icon_url : this.day_icon_url; } public String getText() { return TextUtils.isEmpty(this.text) ? "" : this.text; } public String toString() { return "SubscribeIcon{type='" + this.type + '\'' + ", text='" + this.text + '\'' + ", day_icon_url='" + this.day_icon_url + '\'' + ", night_icon_url='" + this.night_icon_url + '\'' + '}'; } } class a extends ViewHolder { DiggerBar b; TextView c; final /* synthetic */ ParticipateAdapter d; public a(ParticipateAdapter participateAdapter, View view) { this.d = participateAdapter; super(participateAdapter, view); this.b = (DiggerBar) view.findViewById(R.id.diggerbar); this.c = (TextView) view.findViewById(R.id.type); } } public ParticipateAdapter(Activity activity, ListView listView, ArrayList<Object> arrayList, String str, String str2) { this(activity, listView, arrayList, str, str2, null); } public ParticipateAdapter(Activity activity, ListView listView, ArrayList<Object> arrayList, String str, String str2, AcrossChangeDate acrossChangeDate) { super(activity, listView, arrayList, str, str2, acrossChangeDate); } public static SubscribeIcon getSubscribIcons(String str) { if (e == null) { e = new HashMap(); try { JSONObject optJSONObject = QsbkApp.indexConfig.optJSONObject("subscribe_icon"); LogUtil.d("subscribe_icon"); String optString = optJSONObject.optString("prefix"); JSONArray optJSONArray = optJSONObject.optJSONArray("conf"); if (optJSONArray != null && optJSONArray.length() > 0) { for (int i = 0; i < optJSONArray.length(); i++) { JSONObject optJSONObject2 = optJSONArray.optJSONObject(i); SubscribeIcon subscribeIcon = new SubscribeIcon(); subscribeIcon.type = optJSONObject2.optString("type"); subscribeIcon.text = optJSONObject2.optString("text"); subscribeIcon.day_icon_url = optString + optJSONObject2.optString("day"); subscribeIcon.night_icon_url = optString + optJSONObject2.optString(UIHelper$Theme.THEME_NIGHT); LogUtil.d("put subicon:" + subscribeIcon.toString()); e.put(subscribeIcon.type, subscribeIcon); } } } catch (Exception e) { e.printStackTrace(); } } return (SubscribeIcon) e.get(str); } public static void initType(ParticipateArticle participateArticle, TextView textView) { String str = participateArticle.type; if (Type.SUB.equals(str) && participateArticle.containsAction("publish")) { str = "publish"; } textView.setVisibility(0); int paddingLeft = textView.getPaddingLeft(); int paddingRight = textView.getPaddingRight(); int paddingTop = textView.getPaddingTop(); int paddingBottom = textView.getPaddingBottom(); String str2 = ""; SubscribeIcon subscribIcons = getSubscribIcons(str); if (subscribIcons != null) { str2 = subscribIcons.getText(); if (subscribIcons.type.equals(Type.NEARBY)) { textView.setText(" " + String.format("%s·%s", new Object[]{participateArticle.city, participateArticle.district})); } else { textView.setText(" " + str2); } String iconUrl = subscribIcons.getIconUrl(); textView.setTag(iconUrl); if (TextUtils.isEmpty(iconUrl)) { textView.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null); textView.setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom); } else { Fresco.getImagePipeline().fetchDecodedImage(ImageRequest.fromUri(iconUrl), textView.getContext().getApplicationContext()).subscribe(new cm(textView, iconUrl, paddingLeft, paddingTop, paddingRight, paddingBottom), UiThreadImmediateExecutorService.getInstance()); } } else { textView.setVisibility(8); } if (participateArticle.qiushiTopic != null && participateArticle.qiushiTopic.hasEvent()) { textView.setVisibility(8); } } public View getView(int i, View view, ViewGroup viewGroup) { return super.getView(i, view, viewGroup); } protected ViewHolder a(View view) { return new a(this, view); } protected void a(Article article, ViewHolder viewHolder, int i, View view) { super.a(article, viewHolder, i, view); if ((article instanceof ParticipateArticle) && (viewHolder instanceof a)) { a((ParticipateArticle) article, (a) viewHolder); b((ParticipateArticle) article, (a) viewHolder); } } protected int a() { return R.layout.layout_article_item; } private void a(ParticipateArticle participateArticle, a aVar) { initType(participateArticle, aVar.c); aVar.unlikeView.setVisibility(8); } private void b(ParticipateArticle participateArticle, a aVar) { aVar.b.setVisibility(participateArticle.hasOwnComment() ? 0 : 8); aVar.b.belongTo(participateArticle.id); aVar.b.removeAllViews(); if (participateArticle.hasOwnComment()) { aVar.b.addText("", "评论了:" + participateArticle.mOwnComment.content + (participateArticle.mOwnComment.hasImage() ? "[图片]" : "")); } } }
[ "aheadlcxzhang@gmail.com" ]
aheadlcxzhang@gmail.com
bdcb957f868439a4da1bff21bd9a5aeb579583e9
842307fcb7954fbf3d8471d08619a09cf8a8be23
/android_webview/nonembedded/java/src/org/chromium/android_webview/services/NonembeddedSafeModeActionsList.java
ce7bbfd4d7f9c68d26b33e24955f1d0c2e96c7df
[ "BSD-3-Clause" ]
permissive
wahello/chromium
3e2ecac308f746c1ee36562776506c2ea991d606
4b228fefd9c51cc19978f023b96d9858e7d1da95
refs/heads/main
2023-04-06T02:10:37.393447
2023-03-25T04:12:57
2023-03-25T04:12:57
131,737,050
0
0
null
null
null
null
UTF-8
Java
false
false
887
java
// Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.android_webview.services; import org.chromium.android_webview.common.SafeModeAction; /** * Exposes the SafeModeActions supported by nonembedded Component Updater services. */ public final class NonembeddedSafeModeActionsList { // Do not instantiate this class. private NonembeddedSafeModeActionsList() {} /** * A list of SafeModeActions supported by nonembedded WebView processes. The set of actions to * be executed will be specified by the nonembedded SafeModeService, however each action (if * specified by the service) will be executed in the order listed below. */ public static final SafeModeAction[] sList = { new ComponentUpdaterResetSafeModeAction(), }; }
[ "chromium-scoped@luci-project-accounts.iam.gserviceaccount.com" ]
chromium-scoped@luci-project-accounts.iam.gserviceaccount.com
ebe6ddc7883cfdb0d2a6c74ad1889b4e8e778d2f
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/8/8_266b4f1797244ccd8bf062de010fcc522e48601a/Preferences/8_266b4f1797244ccd8bf062de010fcc522e48601a_Preferences_t.java
12f85dd7ab8fd32889feab795374dfbf63df45cd
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
4,516
java
/* * Copyright (C) 2010 Felix Bechstein * * This file is part of SMSdroid. * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software * Foundation; either version 3 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * this program; If not, see <http://www.gnu.org/licenses/>. */ package de.ub0r.android.smsdroid; import android.content.Context; import android.content.SharedPreferences; import android.os.Bundle; import android.preference.PreferenceActivity; import android.preference.PreferenceManager; /** * Preferences. * * @author flx */ public class Preferences extends PreferenceActivity { /** Preference's name: vibrate on receive. */ static final String PREFS_VIBRATE = "receive_vibrate"; /** Preference's name: sound on receive. */ static final String PREFS_SOUND = "receive_sound"; /** Preference's name: led color. */ private static final String PREFS_LED_COLOR = "receive_led_color"; /** Preference's name: led flash. */ private static final String PREFS_LED_FLASH = "receive_led_flash"; /** Preference's name: vibrator pattern. */ private static final String PREFS_VIBRATOR_PATTERN = "receive_vibrate_mode"; /** Preference's name: hide ads. */ static final String PREFS_HIDEADS = "hideads"; /** Preference's name: enable notifications. */ static final String PREFS_NOTIFICATION_ENABLE = "notification_enable"; /** Prefernece's name: sort messages upside down. */ static final String PREFS_MSGLIST_SORT = "sort_messages_upsidedown"; /** Prefernece's name: show contact's photo. */ static final String PREFS_CONTACT_PHOTO = "show_contact_photo"; /** Preference's name: theme. */ private static final String PREFS_THEME = "theme"; /** Theme: black. */ private static final String THEME_BLACK = "black"; /** Theme: light. */ private static final String THEME_LIGHT = "light"; /** * {@inheritDoc} */ @Override public final void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); // final int theme = Preferences.getTheme(this); // this.setTheme(theme); this.addPreferencesFromResource(R.xml.prefs); } /** * Get Theme from Preferences. * * @param context * {@link Context} * @return theme */ static final int getTheme(final Context context) { final SharedPreferences p = PreferenceManager .getDefaultSharedPreferences(context); final String s = p.getString(PREFS_THEME, THEME_BLACK); if (s != null && THEME_LIGHT.equals(s)) { return android.R.style.Theme_Light; } return android.R.style.Theme_Black; } /** * Get LED color pattern from Preferences. * * @param context * {@link Context} * @return pattern */ static final int getLEDcolor(final Context context) { final SharedPreferences p = PreferenceManager .getDefaultSharedPreferences(context); final String s = p.getString(PREFS_LED_COLOR, "65280"); return Integer.parseInt(s); } /** * Get LED flash pattern from Preferences. * * @param context * {@link Context} * @return pattern */ static final int[] getLEDflash(final Context context) { final SharedPreferences p = PreferenceManager .getDefaultSharedPreferences(context); final String s = p.getString(PREFS_LED_FLASH, "500_2000"); final String[] ss = s.split("_"); final int[] ret = new int[2]; ret[0] = Integer.parseInt(ss[0]); ret[1] = Integer.parseInt(ss[1]); return ret; } /** * Get vibrator pattern from Preferences. * * @param context * {@link Context} * @return pattern */ static final long[] getVibratorPattern(final Context context) { final SharedPreferences p = PreferenceManager .getDefaultSharedPreferences(context); final String s = p.getString(PREFS_VIBRATOR_PATTERN, "0"); final String[] ss = s.split("_"); final int l = ss.length; final long[] ret = new long[l]; for (int i = 0; i < l; i++) { ret[i] = Long.parseLong(ss[i]); } return ret; } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
1dcbae20f498f5902dfe774394b881584a01566f
4c09637e52c3c53a896a351c6e59dd1ad938b5b3
/WebChatAjax/src/java/model/MessageModel.java
89e62ccbdc019cf523db43bb18cf23df4cc71102
[]
no_license
huyhue/PROJECTS-WEB
20f9e3da9ef09a0565aedb97030d4003ae234103
cadbcb6cb81aa719bc697de9e1f054ca639d84e4
refs/heads/main
2023-05-14T17:21:43.694583
2021-06-04T14:23:14
2021-06-04T14:23:14
358,826,288
0
0
null
null
null
null
UTF-8
Java
false
false
735
java
package model; import dao.DatabaseDAO; import entity.Messages; import java.util.ArrayList; import java.util.Date; import java.util.List; public class MessageModel { DatabaseDAO databaseDAO = new DatabaseDAO(); public void createNewMessage(int userId, int RoomId, String content, Date dateUploaded) { databaseDAO.createNewMessage(userId, RoomId, content, dateUploaded); } public ArrayList<Messages> getAllMessageInRoom(int roomID) { return databaseDAO.getAllMessageInRoom(roomID); } public void AddNewBannerWord(String word){ databaseDAO.AddNewBannerWord(word); } public List<String> getAllBannerWords() { return databaseDAO.getAllBannerWordst(); } }
[ "tpgiahuy5@gmail.com" ]
tpgiahuy5@gmail.com
4b4abc4a99989755acf4df1ca09a41b9b67fb31b
45d1e88d4275045417b1128b1978bb277de4136c
/A15.SpringCloud/B02.GuiGuCloud/cloud-provider-hystrix-payment8001/src/main/java/com/atguigu/springcloud/PaymentHystrixMain8001.java
1d64aa97c391e5c45e25018d800595765a32168d
[ "Apache-2.0" ]
permissive
huaxueyihao/NoteOfStudy
2c1f95ef30e264776d0bbf72fb724b0fe9aceee4
061e62c97f4fa04fa417fd08ecf1dab361c20b87
refs/heads/master
2022-07-12T04:11:02.960324
2021-01-24T02:47:54
2021-01-24T02:47:54
228,293,820
0
0
Apache-2.0
2022-06-21T03:49:20
2019-12-16T03:19:50
Java
UTF-8
Java
false
false
1,313
java
package com.atguigu.springcloud; import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker; import org.springframework.cloud.netflix.eureka.EnableEurekaClient; import org.springframework.context.annotation.Bean; @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) @EnableEurekaClient @EnableCircuitBreaker public class PaymentHystrixMain8001 { public static void main(String[] args) { SpringApplication.run(PaymentHystrixMain8001.class, args); } @Bean public ServletRegistrationBean getServlet(){ HystrixMetricsStreamServlet streamServlet = new HystrixMetricsStreamServlet(); ServletRegistrationBean registrationBean = new ServletRegistrationBean(streamServlet); registrationBean.setLoadOnStartup(1); registrationBean.addUrlMappings("/hystrix.stream"); registrationBean.setName("HystrixMetricsStreamServlet"); return registrationBean; } }
[ "837403116@qq.com" ]
837403116@qq.com
28f211dfa1184ce6ccb8c15fb4e53a3ca3912f46
fda2f41ff66ff6eeae2b94ef98e88a9ee3c8ff4c
/lib/src/main/java/com/qflbai/mvvm/utils/bluetooth/BluetoothUtil.java
fa0c04e8dc73d22fed4e0258ee6410868daf23e2
[]
no_license
qflbai/AndroidJetpack
04847dfb53b6949c9ec85fae9bc3a7c7b40d12bc
edd0375b98950e3675acf2bb1c25b8c63780fb8b
refs/heads/master
2020-03-27T15:09:16.204116
2018-12-07T09:53:15
2018-12-07T09:53:15
146,700,639
0
0
null
null
null
null
UTF-8
Java
false
false
2,638
java
package com.qflbai.mvvm.utils.bluetooth; import java.text.NumberFormat; /** * ProjectName: outpdaTotal * PackageName: com.suntech.outpdatotal.util.http * ClassDesc: 蓝牙设备 * CreateUser: Corey * CreateDate: 2017/6/1 0001 12:01 * UpdateUser: ****** * UpdateDate: ****** * UpdateDesc: ****** * CopyRight(c) 2016 Shenzhen Sun-Tech Digital Technology Co.Ltd. All rights reserved. */ public class BluetoothUtil { private static Integer maxVoltage = 4200; //蓝牙设备的最高电量值 private static Integer minVoltage = 3500; //蓝牙设备的最低电量值 private static String TAG = "BluetoothUtil"; private static final String enterChar = "\r\n"; /** * 根据当前电压值,计算出电量的百分比 * @param currentVoltage 单位为毫伏 * @return */ public static String getDeviceVoltage(String currentVoltage) { Integer current = Integer.parseInt(currentVoltage); NumberFormat numberFormat = NumberFormat.getInstance(); // 设置精确到小数点后0位 numberFormat.setMaximumFractionDigits(0); String result = numberFormat.format((float)(current - minVoltage) / (float)(maxVoltage - minVoltage) * 100); result += "%"; return result; } /** * 去掉data的第一个和最后一个字符串(即去掉“{”和“}”) add by corey20170527 * @param data * @return */ public static String dealBluetoothString(String data){ if(null == data || data.length() == 0) return null; //判断:如果第一个字符是 IMConfig.BLURTOOTH_LEFT_CHAR 则去掉该字符 if(data.substring(0, 1).equals("{")) { data = data.substring(1, data.length()); } //判断:如果最后一个字符是 IMConfig.BLURTOOTH_RIGHT_CHAR 则去掉该字符 if(data.substring(data.length()-1, data.length()).equals("}")){ data = data.substring(0, data.length()-1); } return data; } /** * 删除回车符 * @param data * @return */ public static String removeEnterChar(String data) { String returnString; if(data.contains(enterChar)) { returnString = data.replace(enterChar, ""); return returnString; } else { return data; } } /** * 返回扫码结果的加密文与明文 * @param data * @return */ public static String[] getTwoScanResult(String data) { String[] returnArr; returnArr = data.split(","); return returnArr; } }
[ "qflbai@163.com" ]
qflbai@163.com
c3c40d51d7bd3d691f6079fe7004b341abbac476
b5c485493f675bcc19dcadfecf9e775b7bb700ed
/jee-utility/src/main/java/org/cyk/utility/log/AbstractLogEventPropertyAccessorImpl.java
349d09da3d246903353f6b2e926ea2e5046d33fa
[]
no_license
devlopper/org.cyk.utility
148a1aafccfc4af23a941585cae61229630b96ec
14ec3ba5cfe0fa14f0e2b1439ef0f728c52ec775
refs/heads/master
2023-03-05T23:45:40.165701
2021-04-03T16:34:06
2021-04-03T16:34:06
16,252,993
1
0
null
2022-10-12T20:09:48
2014-01-26T12:52:24
Java
UTF-8
Java
false
false
313
java
package org.cyk.utility.log; import java.io.Serializable; import org.cyk.utility.__kernel__.object.dynamic.AbstractObject; public abstract class AbstractLogEventPropertyAccessorImpl extends AbstractObject implements LogEventPropertyAccessor, Serializable { private static final long serialVersionUID = 1L; }
[ "Christian@CYK-HP-LAPTOP" ]
Christian@CYK-HP-LAPTOP
4d90f43058f31228228ab8ddb38e312466c5ea25
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_1006559.java
93c107bb13b38be7811cf2fd2c295f68a612b80f
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
211
java
public static String slurp(InputStream in){ Scanner s=new Scanner(in).useDelimiter("\\A"); return s.hasNext() ? s.next().replaceAll("\r\n","\n").replaceAll("\n",System.getProperty("line.separator")) : ""; }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
a7b7c245620d4b24c7f717657ec5d036dce408fe
58da62dfc6e145a3c836a6be8ee11e4b69ff1878
/src/main/java/com/alipay/api/domain/FengdiePreviewQueryRespModel.java
ed306859749c7e47d231354d48acfb03004b2f16
[ "Apache-2.0" ]
permissive
zhoujiangzi/alipay-sdk-java-all
00ef60ed9501c74d337eb582cdc9606159a49837
560d30b6817a590fd9d2c53c3cecac0dca4449b3
refs/heads/master
2022-12-26T00:27:31.553428
2020-09-07T03:39:05
2020-09-07T03:39:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
810
java
package com.alipay.api.domain; import java.util.List; import com.alipay.api.AlipayObject; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.internal.mapping.ApiListField; /** * 获取云凤蝶站点页面预览数据返回值模型 * * @author auto create * @since 1.0, 2018-10-22 16:59:00 */ public class FengdiePreviewQueryRespModel extends AlipayObject { private static final long serialVersionUID = 3297832178412616751L; /** * 云凤蝶页面预览数据列表 */ @ApiListField("list") @ApiField("fengdie_preview_pages_model") private List<FengdiePreviewPagesModel> list; public List<FengdiePreviewPagesModel> getList() { return this.list; } public void setList(List<FengdiePreviewPagesModel> list) { this.list = list; } }
[ "ben.zy@antfin.com" ]
ben.zy@antfin.com
ed8c1851b31a030b64ceb2b31a0e1224e1bec144
c282f9b5f679da55dd85e44cbd91790da069bde4
/modules/server/src-gen/main/java/br/com/kerubin/api/financeiro/contaspagar/entity/contabancaria/ContaBancariaController.java
8ef4c9cf5eb061eb0c61a7a94ea45dc9d4d08294
[]
no_license
lobokoch/contas-pagar
54085d5488ee3a192db4dc290fa0488045673a53
9745856a8cd0e6d6b181bd05afc85fc179f83e62
refs/heads/master
2021-07-20T18:27:37.691247
2020-06-29T01:17:12
2020-06-29T01:17:12
189,776,592
0
0
null
null
null
null
UTF-8
Java
false
false
6,013
java
/********************************************************************************************** Code generated by MKL Plug-in Copyright: Kerubin - kerubin.platform@gmail.com WARNING: DO NOT CHANGE THIS CODE BECAUSE THE CHANGES WILL BE LOST IN THE NEXT CODE GENERATION. ***********************************************************************************************/ package br.com.kerubin.api.financeiro.contaspagar.entity.contabancaria; import java.util.stream.Collectors; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.transaction.annotation.Transactional; import org.springframework.http.ResponseEntity; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import br.com.kerubin.api.financeiro.contaspagar.common.PageResult; import br.com.kerubin.api.financeiro.contaspagar.entity.agenciabancaria.AgenciaBancariaAutoComplete; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import java.util.Collection; import java.util.List; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.web.bind.annotation.RequestParam; @RestController @RequestMapping("financeiro/contas_pagar/entities/contaBancaria") @Api(value = "ContaBancaria", tags = {"ContaBancaria"}, description = "Operations for Conta bancária") public class ContaBancariaController { @Autowired private ContaBancariaService contaBancariaService; @Autowired ContaBancariaDTOConverter contaBancariaDTOConverter; @Transactional @PostMapping @ApiOperation(value = "Creates a new Conta bancária") public ResponseEntity<ContaBancaria> create(@Valid @RequestBody ContaBancaria contaBancaria) { ContaBancariaEntity contaBancariaEntity = contaBancariaService.create(contaBancariaDTOConverter.convertDtoToEntity(contaBancaria)); return ResponseEntity.status(HttpStatus.CREATED).body(contaBancariaDTOConverter.convertEntityToDto(contaBancariaEntity)); } @Transactional(readOnly = true) @GetMapping("/{id}") @ApiOperation(value = "Retrieves Conta bancária") public ResponseEntity<ContaBancaria> read(@PathVariable java.util.UUID id) { try { ContaBancariaEntity contaBancariaEntity = contaBancariaService.read(id); return ResponseEntity.ok(contaBancariaDTOConverter.convertEntityToDto(contaBancariaEntity)); } catch(IllegalArgumentException e) { return ResponseEntity.notFound().build(); } } @Transactional @PutMapping("/{id}") @ApiOperation(value = "Updates Conta bancária") public ResponseEntity<ContaBancaria> update(@PathVariable java.util.UUID id, @Valid @RequestBody ContaBancaria contaBancaria) { try { ContaBancariaEntity contaBancariaEntity = contaBancariaService.update(id, contaBancariaDTOConverter.convertDtoToEntity(contaBancaria)); return ResponseEntity.ok(contaBancariaDTOConverter.convertEntityToDto(contaBancariaEntity)); } catch(IllegalArgumentException e) { return ResponseEntity.notFound().build(); } } @ResponseStatus(HttpStatus.NO_CONTENT) @DeleteMapping("/{id}") @ApiOperation(value = "Deletes Conta bancária") public void delete(@PathVariable java.util.UUID id) { contaBancariaService.delete(id); } @ResponseStatus(HttpStatus.NO_CONTENT) @PostMapping("/deleteInBulk") @ApiOperation(value = "Delete a list of Conta bancária by ids.") public void deleteInBulk(@RequestBody java.util.List<java.util.UUID> idList) { contaBancariaService.deleteInBulk(idList); } @Transactional(readOnly = true) @GetMapping @ApiOperation(value = "Retrieves a list of Conta bancária") public PageResult<ContaBancaria> list(ContaBancariaListFilter contaBancariaListFilter, Pageable pageable) { Page<ContaBancariaEntity> page = contaBancariaService.list(contaBancariaListFilter, pageable); List<ContaBancaria> content = page.getContent().stream().map(pe -> contaBancariaDTOConverter.convertEntityToDto(pe)).collect(Collectors.toList()); PageResult<ContaBancaria> pageResult = new PageResult<>(content, page.getNumber(), page.getSize(), page.getTotalElements()); return pageResult; } @Transactional(readOnly = true) @GetMapping("/autoComplete") @ApiOperation(value = "Retrieves a list of Conta bancária with a query param") public Collection<ContaBancariaAutoComplete> autoComplete(@RequestParam("query") String query) { Collection<ContaBancariaAutoComplete> result = contaBancariaService.autoComplete(query); return result; } @GetMapping("/contaBancariaNumeroContaAutoComplete") @ApiOperation(value = "Retrieves a list of Conta bancária with a query param") public Collection<ContaBancariaNumeroContaAutoComplete> contaBancariaNumeroContaAutoComplete(@RequestParam("query") String query) { Collection<ContaBancariaNumeroContaAutoComplete> result = contaBancariaService.contaBancariaNumeroContaAutoComplete(query); return result; } // Begin relationships autoComplete @Transactional(readOnly = true) @GetMapping("/agenciaBancariaAgenciaAutoComplete") @ApiOperation(value = "Retrieves a list of AgenciaBancariaAutoComplete by query agenciaBancariaAgenciaAutoComplete over ContaBancaria with a query param") public Collection<AgenciaBancariaAutoComplete> agenciaBancariaAgenciaAutoComplete(@RequestParam("query") String query) { Collection<AgenciaBancariaAutoComplete> result = contaBancariaService.agenciaBancariaAgenciaAutoComplete(query); return result; } // End relationships autoComplete }
[ "lobokoch@gmail.com" ]
lobokoch@gmail.com
95e6a497002d4f67d8498201d3e72fe93480e0e3
8c2a8f03d0246d90477fcd9217eb49fc62979d3b
/xml/impl/src/com/intellij/lang/html/structureView/Html5SectionsNodeProvider.java
49ad3fbba26ea203239538e1fcbeb017c0d1d2c6
[ "Apache-2.0" ]
permissive
rene-schulz/github-discussions
f228f5552837ae1252165319d27a4e8ea67a21c6
5cf1b2cec10a2f37b2259ccb65a36e76b4f61301
refs/heads/master
2021-01-12T22:54:34.350896
2013-03-03T09:48:04
2013-03-03T09:48:04
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,066
java
/* * Copyright 2000-2013 JetBrains s.r.o. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.intellij.lang.html.structureView; import com.intellij.ide.util.FileStructureNodeProvider; import com.intellij.ide.util.treeView.smartTree.ActionPresentation; import com.intellij.ide.util.treeView.smartTree.ActionPresentationData; import com.intellij.ide.util.treeView.smartTree.TreeElement; import com.intellij.openapi.actionSystem.Shortcut; import com.intellij.openapi.keymap.KeymapManager; import com.intellij.openapi.util.PropertyOwner; import com.intellij.psi.filters.XmlTagFilter; import com.intellij.psi.scope.processor.FilterElementProcessor; import com.intellij.psi.xml.XmlDocument; import com.intellij.psi.xml.XmlFile; import com.intellij.psi.xml.XmlTag; import com.intellij.xml.XmlBundle; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; public class Html5SectionsNodeProvider implements FileStructureNodeProvider<Html5SectionTreeElement>, PropertyOwner { public static final String ACTION_ID = "HTML5_OUTLINE_MODE"; public static final String HTML5_OUTLINE_PROVIDER_PROPERTY = "html5.sections.node.provider"; @NotNull public String getName() { return ACTION_ID; } @NotNull public ActionPresentation getPresentation() { return new ActionPresentationData(XmlBundle.message("html5.outline.mode"), null, null); } public String getCheckBoxText() { return XmlBundle.message("html5.outline.mode"); } public Shortcut[] getShortcut() { return KeymapManager.getInstance().getActiveKeymap().getShortcuts("FileStructurePopup"); } @NotNull public String getPropertyName() { return HTML5_OUTLINE_PROVIDER_PROPERTY; } public Collection<Html5SectionTreeElement> provideNodes(final TreeElement node) { if (!(node instanceof HtmlFileTreeElement)) return Collections.emptyList(); final XmlFile xmlFile = ((HtmlFileTreeElement)node).getElement(); final XmlDocument document = xmlFile == null ? null : xmlFile.getDocument(); if (document == null) return Collections.emptyList(); final List<XmlTag> rootTags = new ArrayList<XmlTag>(); document.processElements(new FilterElementProcessor(XmlTagFilter.INSTANCE, rootTags), document); final Collection<Html5SectionTreeElement> result = new ArrayList<Html5SectionTreeElement>(); for (XmlTag tag : rootTags) { result.addAll(Html5SectionsProcessor.processAndGetRootSections(tag)); } return result; } }
[ "alexander.doroshko@jetbrains.com" ]
alexander.doroshko@jetbrains.com
41240aa2cdd3c0f35d5e5f2144040fc7647d24c3
b4fcf9983e219761cc0e5c2e00198d1f6a854e3b
/app/src/main/java/com/angcyo/dexfixdemo/MainActivity.java
6c8bde91de58572c2b8eccf74b3b4784be841c3a
[ "Apache-2.0" ]
permissive
hx-git/DexFixDemo
4ba1540401b94f32ad4b888c5549506e65a3ee52
71125522d23502ed6bb40956dbd3aaa9fb72a6d3
refs/heads/master
2020-04-02T06:27:59.804009
2017-03-22T10:09:57
2017-03-22T10:11:05
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,574
java
package com.angcyo.dexfixdemo; import android.os.Bundle; import android.os.Environment; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.Toolbar; import android.view.View; public class MainActivity extends AppCompatActivity { static String patchFilePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/dex/"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { //测试补丁输出 Demo.test(); } }); findViewById(R.id.button_view).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { try { //打补丁 Fix.injectDexElements(MainActivity.this, patchFilePath); } catch (Exception e) { e.printStackTrace(); T_.show(e.getMessage()); } } }); /**复制补丁文件到SD卡*/ UI.copyAssetsTo(this, "classes2.dex", patchFilePath + "out_dex.dex"); } }
[ "angcyo@126.com" ]
angcyo@126.com
829b265d699baf70a9ac8e2feaf4e726668fa27a
6d9d90789f91d4010c30344409aad49fa99099e3
/lucene-core/src/main/java/org/apache/lucene/search/FieldDocSortedHitQueue.java
6880f985a6a1ff0032d734edb817bbd4c84036fd
[ "Apache-2.0" ]
permissive
bighaidao/lucene
8c2340f399c60742720e323a0b0c0a70b2651147
bd5d75e31526b599296c3721bc2081a3bde3e251
refs/heads/master
2021-08-07T07:01:42.438869
2012-08-22T09:16:08
2012-08-22T09:16:08
8,878,381
1
2
Apache-2.0
2021-08-02T17:05:32
2013-03-19T12:48:16
Java
UTF-8
Java
false
false
4,770
java
package org.apache.lucene.search; /** * 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. */ import org.apache.lucene.util.PriorityQueue; import java.io.IOException; import java.text.Collator; import java.util.Locale; /** * Expert: Collects sorted results from Searchable's and collates them. * The elements put into this queue must be of type FieldDoc. * * <p>Created: Feb 11, 2004 2:04:21 PM * * @since lucene 1.4 */ class FieldDocSortedHitQueue extends PriorityQueue<FieldDoc> { volatile SortField[] fields = null; // used in the case where the fields are sorted by locale // based strings volatile Collator[] collators = null; volatile FieldComparator<?>[] comparators = null; /** * Creates a hit queue sorted by the given list of fields. * @param fields Fieldable names, in priority order (highest priority first). * @param size The number of hits to retain. Must be greater than zero. */ FieldDocSortedHitQueue (int size) { initialize (size); } /** * Allows redefinition of sort fields if they are <code>null</code>. * This is to handle the case using ParallelMultiSearcher where the * original list contains AUTO and we don't know the actual sort * type until the values come back. The fields can only be set once. * This method should be synchronized external like all other PQ methods. * @param fields */ @SuppressWarnings({"unchecked","rawtypes"}) void setFields (SortField[] fields) throws IOException { this.fields = fields; this.collators = hasCollators (fields); comparators = new FieldComparator[fields.length]; for(int fieldIDX=0;fieldIDX<fields.length;fieldIDX++) { comparators[fieldIDX] = fields[fieldIDX].getComparator(1, fieldIDX); } } /** Returns the fields being used to sort. */ SortField[] getFields() { return fields; } /** Returns an array of collators, possibly <code>null</code>. The collators * correspond to any SortFields which were given a specific locale. * @param fields Array of sort fields. * @return Array, possibly <code>null</code>. */ private Collator[] hasCollators (final SortField[] fields) { if (fields == null) return null; Collator[] ret = new Collator[fields.length]; for (int i=0; i<fields.length; ++i) { Locale locale = fields[i].getLocale(); if (locale != null) ret[i] = Collator.getInstance (locale); } return ret; } /** * Returns whether <code>a</code> is less relevant than <code>b</code>. * @param a ScoreDoc * @param b ScoreDoc * @return <code>true</code> if document <code>a</code> should be sorted after document <code>b</code>. */ @Override @SuppressWarnings({"unchecked","rawtypes"}) protected final boolean lessThan(final FieldDoc docA, final FieldDoc docB) { final int n = fields.length; int c = 0; for (int i=0; i<n && c==0; ++i) { final int type = fields[i].getType(); if (type == SortField.STRING) { final String s1 = (String) docA.fields[i]; final String s2 = (String) docB.fields[i]; // null values need to be sorted first, because of how FieldCache.getStringIndex() // works - in that routine, any documents without a value in the given field are // put first. If both are null, the next SortField is used if (s1 == null) { c = (s2 == null) ? 0 : -1; } else if (s2 == null) { c = 1; } else if (fields[i].getLocale() == null) { c = s1.compareTo(s2); } else { c = collators[i].compare(s1, s2); } } else { final FieldComparator<Object> comp = (FieldComparator<Object>) comparators[i]; c = comp.compareValues(docA.fields[i], docB.fields[i]); } // reverse sort if (fields[i].getReverse()) { c = -c; } } // avoid random sort order that could lead to duplicates (bug #31241): if (c == 0) return docA.doc > docB.doc; return c > 0; } }
[ "joergprante@gmail.com" ]
joergprante@gmail.com
83fc6f1bdb3a6a9e5038daa3d87cd3a218633399
f1a85ae8b9d5d9d9a848c4c8d9c2410b9726e194
/library/expandablelayout_library/build/generated/source/r/androidTest/debug/android/support/compat/R.java
5dc1b83bdbb90dce76f4f972f02cfe22df65f4cc
[]
no_license
P79N6A/as
45dc7c76d58cdc62e3e403c9da4a1c16c4234568
a57ee2a3eb2c73cc97c3fb130b8e389899b19d99
refs/heads/master
2020-04-20T05:55:10.175425
2019-02-01T08:49:15
2019-02-01T08:49:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,919
java
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * gradle plugin from the resource data it found. It * should not be modified by hand. */ package android.support.compat; public final class R { public static final class attr { public static final int font = 0x7f0100c7; public static final int fontProviderAuthority = 0x7f0100c0; public static final int fontProviderCerts = 0x7f0100c3; public static final int fontProviderFetchStrategy = 0x7f0100c4; public static final int fontProviderFetchTimeout = 0x7f0100c5; public static final int fontProviderPackage = 0x7f0100c1; public static final int fontProviderQuery = 0x7f0100c2; public static final int fontStyle = 0x7f0100c6; public static final int fontWeight = 0x7f0100c8; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f080000; } public static final class color { public static final int notification_action_color_filter = 0x7f090000; public static final int notification_icon_bg_color = 0x7f090028; public static final int ripple_material_light = 0x7f090032; public static final int secondary_text_default_material_light = 0x7f090034; } public static final class dimen { public static final int compat_button_inset_horizontal_material = 0x7f06004f; public static final int compat_button_inset_vertical_material = 0x7f060050; public static final int compat_button_padding_horizontal_material = 0x7f060051; public static final int compat_button_padding_vertical_material = 0x7f060052; public static final int compat_control_corner_material = 0x7f060053; public static final int notification_action_icon_size = 0x7f06005d; public static final int notification_action_text_size = 0x7f06005e; public static final int notification_big_circle_margin = 0x7f06005f; public static final int notification_content_margin_start = 0x7f060012; public static final int notification_large_icon_height = 0x7f060060; public static final int notification_large_icon_width = 0x7f060061; public static final int notification_main_column_padding_top = 0x7f060013; public static final int notification_media_narrow_margin = 0x7f060014; public static final int notification_right_icon_size = 0x7f060062; public static final int notification_right_side_padding_top = 0x7f060010; public static final int notification_small_icon_background_padding = 0x7f060063; public static final int notification_small_icon_size_as_large = 0x7f060064; public static final int notification_subtext_size = 0x7f060065; public static final int notification_top_pad = 0x7f060066; public static final int notification_top_pad_large_text = 0x7f060067; } public static final class drawable { public static final int notification_action_background = 0x7f020053; public static final int notification_bg = 0x7f020054; public static final int notification_bg_low = 0x7f020055; public static final int notification_bg_low_normal = 0x7f020056; public static final int notification_bg_low_pressed = 0x7f020057; public static final int notification_bg_normal = 0x7f020058; public static final int notification_bg_normal_pressed = 0x7f020059; public static final int notification_icon_background = 0x7f02005a; public static final int notification_template_icon_bg = 0x7f02005f; public static final int notification_template_icon_low_bg = 0x7f020060; public static final int notification_tile_bg = 0x7f02005b; public static final int notify_panel_notification_icon_bg = 0x7f02005c; } public static final class id { public static final int action_container = 0x7f0a0080; public static final int action_divider = 0x7f0a008b; public static final int action_image = 0x7f0a0081; public static final int action_text = 0x7f0a0082; public static final int actions = 0x7f0a008c; public static final int async = 0x7f0a0030; public static final int blocking = 0x7f0a0031; public static final int chronometer = 0x7f0a0088; public static final int forever = 0x7f0a0032; public static final int icon = 0x7f0a0056; public static final int icon_group = 0x7f0a008d; public static final int info = 0x7f0a0089; public static final int italic = 0x7f0a0033; public static final int line1 = 0x7f0a0005; public static final int line3 = 0x7f0a0006; public static final int normal = 0x7f0a0010; public static final int notification_background = 0x7f0a0083; public static final int notification_main_column = 0x7f0a0085; public static final int notification_main_column_container = 0x7f0a0084; public static final int right_icon = 0x7f0a008a; public static final int right_side = 0x7f0a0086; public static final int tag_transition_group = 0x7f0a000a; public static final int text = 0x7f0a000b; public static final int text2 = 0x7f0a000c; public static final int time = 0x7f0a0087; public static final int title = 0x7f0a000d; } public static final class integer { public static final int status_bar_notification_info_maxnum = 0x7f0b0004; } public static final class layout { public static final int notification_action = 0x7f03001b; public static final int notification_action_tombstone = 0x7f03001c; public static final int notification_template_custom_big = 0x7f03001d; public static final int notification_template_icon_group = 0x7f03001e; public static final int notification_template_part_chronometer = 0x7f03001f; public static final int notification_template_part_time = 0x7f030020; } public static final class string { public static final int status_bar_notification_info_overflow = 0x7f050012; } public static final class style { public static final int TextAppearance_Compat_Notification = 0x7f070073; public static final int TextAppearance_Compat_Notification_Info = 0x7f070074; public static final int TextAppearance_Compat_Notification_Line2 = 0x7f0700f3; public static final int TextAppearance_Compat_Notification_Time = 0x7f070075; public static final int TextAppearance_Compat_Notification_Title = 0x7f070076; public static final int Widget_Compat_NotificationActionContainer = 0x7f070077; public static final int Widget_Compat_NotificationActionText = 0x7f070078; } public static final class styleable { public static final int[] FontFamily = { 0x7f0100c0, 0x7f0100c1, 0x7f0100c2, 0x7f0100c3, 0x7f0100c4, 0x7f0100c5 }; public static final int FontFamily_fontProviderAuthority = 0; public static final int FontFamily_fontProviderPackage = 1; public static final int FontFamily_fontProviderQuery = 2; public static final int FontFamily_fontProviderCerts = 3; public static final int FontFamily_fontProviderFetchStrategy = 4; public static final int FontFamily_fontProviderFetchTimeout = 5; public static final int[] FontFamilyFont = { 0x01010532, 0x01010533, 0x0101053f, 0x7f0100c6, 0x7f0100c7, 0x7f0100c8 }; public static final int FontFamilyFont_android_font = 0; public static final int FontFamilyFont_android_fontWeight = 1; public static final int FontFamilyFont_android_fontStyle = 2; public static final int FontFamilyFont_fontStyle = 3; public static final int FontFamilyFont_font = 4; public static final int FontFamilyFont_fontWeight = 5; } }
[ "254191389@qq.com" ]
254191389@qq.com
2d0b43c440b9ba8d0d60fa5d7080312e92844505
a2440dbe95b034784aa940ddc0ee0faae7869e76
/modules/lwjgl/openxr/src/generated/java/org/lwjgl/openxr/EXTViewConfigurationDepthRange.java
40fae60771dd79c714f3b72e70bd1b199d86c3cf
[ "LGPL-2.0-or-later", "CC-BY-4.0", "LicenseRef-scancode-unknown-license-reference", "LicenseRef-scancode-generic-cla", "GPL-2.0-only", "Apache-2.0", "GPL-1.0-or-later", "LGPL-2.0-only", "MIT", "BSD-3-Clause", "LicenseRef-scancode-free-unknown", "LicenseRef-scancode-public-domain", "BSD-2-Clause" ]
permissive
LWJGL/lwjgl3
8972338303520c5880d4a705ddeef60472a3d8e5
67b64ad33bdeece7c09b0f533effffb278c3ecf7
refs/heads/master
2023-08-26T16:21:38.090410
2023-08-26T16:05:52
2023-08-26T16:05:52
7,296,244
4,835
1,004
BSD-3-Clause
2023-09-10T12:03:24
2012-12-23T15:40:04
Java
UTF-8
Java
false
false
2,105
java
/* * Copyright LWJGL. All rights reserved. * License terms: https://www.lwjgl.org/license * MACHINE GENERATED FILE, DO NOT EDIT */ package org.lwjgl.openxr; /** * The <a href="https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#XR_EXT_view_configuration_depth_range">XR_EXT_view_configuration_depth_range</a> extension. * * <p>For XR systems there may exist a per view recommended min/max depth range at which content should be rendered into the virtual world. The depth range may be driven by several factors, including user comfort, or fundamental capabilities of the system.</p> * * <p>Displaying rendered content outside the recommended min/max depth range would violate the system requirements for a properly integrated application, and can result in a poor user experience due to observed visual artifacts, visual discomfort, or fatigue. The near/far depth values will fall in the range of (0..+infinity] where max({@code recommendedNearZ}, {@code minNearZ}) &lt; min({@code recommendedFarZ}, {@code maxFarZ}). Infinity is defined matching the standard library definition such that std::isinf will return true for a returned infinite value.</p> * * <p>In order to provide the application with the appropriate depth range at which to render content for each {@link XrViewConfigurationView}, this extension provides additional view configuration information, as defined by {@link XrViewConfigurationDepthRangeEXT}, to inform the application of the min/max recommended and absolute distances at which content should be rendered for that view.</p> */ public final class EXTViewConfigurationDepthRange { /** The extension specification version. */ public static final int XR_EXT_view_configuration_depth_range_SPEC_VERSION = 1; /** The extension name. */ public static final String XR_EXT_VIEW_CONFIGURATION_DEPTH_RANGE_EXTENSION_NAME = "XR_EXT_view_configuration_depth_range"; /** Extends {@code XrStructureType}. */ public static final int XR_TYPE_VIEW_CONFIGURATION_DEPTH_RANGE_EXT = 1000046000; private EXTViewConfigurationDepthRange() {} }
[ "iotsakp@gmail.com" ]
iotsakp@gmail.com
4c0dd3fd00bac0213c3f74d31afdef22a7a99316
180e78725121de49801e34de358c32cf7148b0a2
/dataset/protocol1/java-design-patterns/learning/7891/MessageCollectorMemberTest.java
e33df1d1b7aa27c458b7ede17a38324faeafcb82
[]
no_license
ASSERT-KTH/synthetic-checkstyle-error-dataset
40e8d1e0a7ebe7f7711def96a390891a6922f7bd
40c057e1669584bfc6fecf789b5b2854660222f3
refs/heads/master
2023-03-18T12:50:55.410343
2019-01-25T09:54:39
2019-01-25T09:54:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,343
java
/** * The MIT License * Copyright (c) 2014 Ilkka Seppälä * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package com.iluwatar.databus.members; import com.iluwatar.databus.data.MessageData; import com.iluwatar.databus.data.StartingData; import org.junit.jupiter.api.Test; import java.time.LocalDateTime; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; /** * Tests for {@link MessageCollectorMember}. * * @author Paul Campbell (pcampbell@kemitix.net) */ public class MessageCollectorMemberTest { @Test public void collectMessageFromMessageData() { //given final String message = "message"; final MessageData messageData = new MessageData(message); final MessageCollectorMember collector = new MessageCollectorMember("collector"); //when collector.accept(messageData); //then assertTrue(collector.getMessages().contains(message)); } @Test public void collectIgnoresMessageFromOtherDataTypes() { //given final StartingData startingData = new StartingData(LocalDateTime.now()); final MessageCollectorMember collector = new MessageCollectorMember("collector"); //when collector.accept(startingData); //then assertEquals(0, collector.getMessages().size()); } }
[ "bloriot97@gmail.com" ]
bloriot97@gmail.com
2e59b28f758d477a5c80eebc19752696823a120c
369fb1910ab0aee739a247b5b5ffcea04bf54da5
/component-orm/src/main/java/com/fty1/orm/extension/injector/methods/LogicUpdateById.java
34df095d7563d0c29f7d6702df882c0e7c6cf4a5
[]
no_license
Cray-Bear/starters
f0318e30c239fefd1a5079a45faf1bcc0cf34d39
b6537789af56988bcb1d617cc4e6e1a1ef7dfc92
refs/heads/master
2020-04-08T11:27:42.993024
2019-03-24T15:15:17
2019-03-24T15:15:17
159,306,956
0
0
null
null
null
null
UTF-8
Java
false
false
2,462
java
/* * Copyright (c) 2011-2019, hubin (jobob@qq.com). * <p> * Licensed under the Apache License, Version 2.0 (the "License"); you may not * use this file except in compliance with the License. You may obtain a copy of * the License at * <p> * https://www.apache.org/licenses/LICENSE-2.0 * <p> * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. */ package com.fty1.orm.extension.injector.methods; import com.fty1.orm.core.enums.SqlMethod; import com.fty1.orm.core.metadata.TableInfo; import com.fty1.orm.core.toolkit.StringPool; import com.fty1.orm.extension.injector.AbstractLogicMethod; import com.fty1.orm.extension.plugins.OptimisticLockerInterceptor; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.SqlSource; /** * 根据 ID 更新有值字段 * * @author hubin * @since 2018-04-06 */ public class LogicUpdateById extends AbstractLogicMethod { @Override public MappedStatement injectMappedStatement(Class<?> mapperClass, Class<?> modelClass, TableInfo tableInfo) { String sql; boolean logicDelete = tableInfo.isLogicDelete(); SqlMethod sqlMethod = SqlMethod.UPDATE_BY_ID; StringBuilder append = new StringBuilder("<if test=\"et instanceof java.util.Map\">") .append("<if test=\"et.").append(OptimisticLockerInterceptor.MP_OPTLOCK_VERSION_ORIGINAL).append("!=null\">") .append(" AND ${et.").append(OptimisticLockerInterceptor.MP_OPTLOCK_VERSION_COLUMN) .append("}=#{et.").append(OptimisticLockerInterceptor.MP_OPTLOCK_VERSION_ORIGINAL).append(StringPool.RIGHT_BRACE) .append("</if></if>"); if (logicDelete) { append.append(tableInfo.getLogicDeleteSql(true, false)); } sql = String.format(sqlMethod.getSql(), tableInfo.getTableName(), sqlSet(logicDelete, false, tableInfo, false, ENTITY, ENTITY_DOT), tableInfo.getKeyColumn(), ENTITY_DOT + tableInfo.getKeyProperty(), append); SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, modelClass); return addUpdateMappedStatement(mapperClass, modelClass, sqlMethod.getMethod(), sqlSource); } }
[ "1798900899@qq.com" ]
1798900899@qq.com
f44f7ed3ec4736bfae87d81ca6dbc29873d0339e
f2468a53b5c1c29b5348e063c2a60ef05c09e099
/src/main/java/com/yibo/designpattern/creational/singleton/ThreadLocalInstance.java
11e93a31fa2ebe852bbf8fc2fd11a5334dde991a
[]
no_license
jjhyb/design-pattern
707d736c5076aa117a5691e2be67a4f65a6fd76d
a5a0672c5032db13ba6f48499d6b7faf262d5ebb
refs/heads/master
2022-06-10T15:16:08.840020
2020-05-01T16:19:37
2020-05-01T16:19:37
260,504,237
0
0
null
null
null
null
UTF-8
Java
false
false
594
java
package com.yibo.designpattern.creational.singleton; /** * @author: huangyibo * @Date: 2020/4/6 22:46 * @Description: 保证同一线程拿到的是同一个实例 */ public class ThreadLocalInstance { private static final ThreadLocal<ThreadLocalInstance> threadLocal = new ThreadLocal<ThreadLocalInstance>(){ @Override protected ThreadLocalInstance initialValue() { return new ThreadLocalInstance(); } }; private ThreadLocalInstance(){ } public static ThreadLocalInstance getInstance(){ return threadLocal.get(); } }
[ "718649016@qq.com" ]
718649016@qq.com
2c7bb4662e9dd658f87b5bc6ace513bda9636627
69a4f2d51ebeea36c4d8192e25cfb5f3f77bef5e
/methods/Method_54341.java
cdc2c702861416f519d2acaef4924059803c6e94
[]
no_license
P79N6A/icse_20_user_study
5b9c42c6384502fdc9588430899f257761f1f506
8a3676bc96059ea2c4f6d209016f5088a5628f3c
refs/heads/master
2020-06-24T08:25:22.606717
2019-07-25T15:31:16
2019-07-25T15:31:16
null
0
0
null
null
null
null
UTF-8
Java
false
false
140
java
/** * Returns the value of the {@code numBlit} field. */ @NativeType("uint32_t") public int numBlit(){ return nnumBlit(address()); }
[ "sonnguyen@utdallas.edu" ]
sonnguyen@utdallas.edu
0a29687d2d348bdabaa8005820b0d407e73b1faa
27b052c54bcf922e1a85cad89c4a43adfca831ba
/src/lP.java
a6a011913fb98204b75570ddb225d52bf4a82fc2
[]
no_license
dreadiscool/YikYak-Decompiled
7169fd91f589f917b994487045916c56a261a3e8
ebd9e9dd8dba0e657613c2c3b7036f7ecc3fc95d
refs/heads/master
2020-04-01T10:30:36.903680
2015-04-14T15:40:09
2015-04-14T15:40:09
33,902,809
3
0
null
null
null
null
UTF-8
Java
false
false
2,540
java
import android.os.IBinder; class lP implements lN { private IBinder a; lP(IBinder paramIBinder) { this.a = paramIBinder; } /* Error */ public void a(com.google.android.gms.maps.model.StreetViewPanoramaOrientation paramStreetViewPanoramaOrientation) { // Byte code: // 0: invokestatic 22 android/os/Parcel:obtain ()Landroid/os/Parcel; // 3: astore_2 // 4: invokestatic 22 android/os/Parcel:obtain ()Landroid/os/Parcel; // 7: astore_3 // 8: aload_2 // 9: ldc 24 // 11: invokevirtual 28 android/os/Parcel:writeInterfaceToken (Ljava/lang/String;)V // 14: aload_1 // 15: ifnull +41 -> 56 // 18: aload_2 // 19: iconst_1 // 20: invokevirtual 32 android/os/Parcel:writeInt (I)V // 23: aload_1 // 24: aload_2 // 25: iconst_0 // 26: invokevirtual 38 com/google/android/gms/maps/model/StreetViewPanoramaOrientation:writeToParcel (Landroid/os/Parcel;I)V // 29: aload_0 // 30: getfield 15 lP:a Landroid/os/IBinder; // 33: iconst_1 // 34: aload_2 // 35: aload_3 // 36: iconst_0 // 37: invokeinterface 44 5 0 // 42: pop // 43: aload_3 // 44: invokevirtual 47 android/os/Parcel:readException ()V // 47: aload_3 // 48: invokevirtual 50 android/os/Parcel:recycle ()V // 51: aload_2 // 52: invokevirtual 50 android/os/Parcel:recycle ()V // 55: return // 56: aload_2 // 57: iconst_0 // 58: invokevirtual 32 android/os/Parcel:writeInt (I)V // 61: goto -32 -> 29 // 64: astore 4 // 66: aload_3 // 67: invokevirtual 50 android/os/Parcel:recycle ()V // 70: aload_2 // 71: invokevirtual 50 android/os/Parcel:recycle ()V // 74: aload 4 // 76: athrow // Local variable table: // start length slot name signature // 0 77 0 this lP // 0 77 1 paramStreetViewPanoramaOrientation com.google.android.gms.maps.model.StreetViewPanoramaOrientation // 3 68 2 localParcel1 android.os.Parcel // 7 60 3 localParcel2 android.os.Parcel // 64 11 4 localObject Object // Exception table: // from to target type // 8 47 64 finally // 56 61 64 finally } public IBinder asBinder() { return this.a; } } /* Location: C:\Users\dreadiscool\Desktop\tools\classes-dex2jar.jar * Qualified Name: lP * JD-Core Version: 0.7.0.1 */
[ "paras@protrafsolutions.com" ]
paras@protrafsolutions.com
58ea758be692b1852f7c83a7ff4bf8848027b556
1325cc190c5d0633ad03ef028f4ab8bf5a52c095
/src/ClassKeduaExtendsPertama.java
a1673bb5c6af8e17f718106f7d3ea3316a747303
[]
no_license
arfinadevi28/PBO-Inheritance
a88f9ab5678271043a2d628565733c2d21a1f4f0
4869b82ac778f5877e255023b860afd980792dd8
refs/heads/master
2020-08-30T06:49:43.016234
2019-10-29T14:08:11
2019-10-29T14:08:11
218,296,385
0
0
null
null
null
null
UTF-8
Java
false
false
412
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author ARVINA */ public class ClassKeduaExtendsPertama { private int b = 8; protected void BacaSuper () { System.out.println ("Nilai b :"+b); terprotek (); info (); } }
[ "you@example.com" ]
you@example.com
6d6bedfe3779a94485d975671f501c0ba8959f52
d6ee2d061163ab44566f45327629636daac3fa69
/java23/src/com/bit/event/Ex01.java
974f383a0ce9d89084e8f6cf39ae37be37dc71c6
[]
no_license
bit01class/java2019
e51cd168d45af590f03d97a0f7d99862fd79a30a
94797a544660af4f30712bd023385a76edf1b38d
refs/heads/master
2020-05-03T18:30:45.341761
2019-06-28T03:07:40
2019-06-28T03:07:40
178,764,401
3
0
null
null
null
null
UHC
Java
false
false
1,156
java
package com.bit.event; import java.awt.Frame; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; public class Ex01 extends Frame implements WindowListener{ public Ex01() { addWindowListener(this);// 이벤트 등록 setSize(300,200); setLocation(100-1280,100); setVisible(true); } public static void main(String[] args) { Ex01 me = new Ex01(); System.out.println("메인끝"); } /// 이벤트 들 /// public void windowOpened(WindowEvent e) { System.out.println("창이 열림..."); } public void windowClosing(WindowEvent e) { System.out.println("창닫기..."); //System.exit(0); dispose(); } public void windowClosed(WindowEvent e) { System.out.println("프로그램 종료시 수행하고 싶은 일..."); } public void windowIconified(WindowEvent e) { System.out.println("최소화..."); } public void windowDeiconified(WindowEvent e) { System.out.println("비최소화..."); } public void windowActivated(WindowEvent e) { System.out.println("활성화..."); } public void windowDeactivated(WindowEvent e) { System.out.println("비활성화..."); } }
[ "bit01class@gmail.com" ]
bit01class@gmail.com
0a1696005cc2f92b7c84c023ad1c2238af0f395f
07af209df92e6c247d12f76b91f2f2e2edfb46f0
/Other_tutorials/JSF/JSF tutorialpoint/TutorialpointJsfSpringIntegrationProject/src/com/tutorialspoint/test/UserData.java
fdb37f4fa77f94223b34da62b10610303bf4ef7c
[]
no_license
michaelzherdev/Java
7d19bf3358ce5d4cbb4774cdf86488aef9d26bb4
5b71e9b42814304d1128d696c91bb97f301a5d99
refs/heads/master
2021-01-10T06:31:36.341504
2015-10-15T19:31:46
2015-10-15T19:31:46
44,328,179
0
0
null
null
null
null
UTF-8
Java
false
false
503
java
package com.tutorialspoint.test; import java.io.Serializable; public class UserData implements Serializable { private static final long serialVersionUID = 1L; private MessageService messageService; public MessageService getMessageService() { return messageService; } public void setMessageService(MessageService messageService) { this.messageService = messageService; } public String getGreetingMessage(){ return messageService.getGreetingMessage(); } }
[ "michaelzherdev@gmail.com" ]
michaelzherdev@gmail.com
359566696c1a3394ea2cff2d6886b79aa49cd0b4
2b0694f0563192e2d148d130164e94faf3b4e12f
/Android3D游戏开发技术详解与典型案例-OpenGLES1/第22章/CountrysideRacing/src/com/bn/carracer/ViewOver.java
e8b5d54118ed370347df932e5380e805807d6766
[]
no_license
bxh7425014/BookCode
4757956275cf540e9996b9064d981f6da75c9602
8996b36e689861d55662d15c5db8b0eb498c864b
refs/heads/master
2020-05-23T00:48:51.430340
2017-02-06T01:04:25
2017-02-06T01:04:25
84,735,079
9
3
null
null
null
null
GB18030
Java
false
false
2,151
java
package com.bn.carracer; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.view.MotionEvent; import android.view.SurfaceHolder; import android.view.SurfaceView; import static com.bn.carracer.Constant.*; public class ViewOver extends SurfaceView implements SurfaceHolder.Callback{ Activity_GL_Racing activity;//声明引用 Bitmap over;//设置界面背景 float screenWidth=480;//图片宽度 float x_Offset=Activity_GL_Racing.screenWidth/2-screenWidth/2; Paint paint;//画笔 public ViewOver(Activity_GL_Racing activity) { super(activity); // TODO Auto-generated constructor stub this.activity=activity; getHolder().addCallback(this); paint=new Paint(); over=BitmapFactory.decodeResource(this.getResources(), R.drawable.over); } @Override public boolean onTouchEvent(MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: int x = (int) event.getX();//获取X坐标 int y = (int) event.getY(); if(x>135+x_Offset&&x<343+x_Offset&&y>122&&y<193)//点击主菜单 { activity.toAnotherView(LOADING);//返回值主菜单 } if(x>135+x_Offset&&x<343+x_Offset&&y>193&&y<265)//点击在玩一次 { activity.toAnotherView(ENTER_MENU);//进入游戏 } break; } return true; } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawBitmap(over, Activity_GL_Racing.screenWidth/2-screenWidth/2,0, paint); } @Override public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) { // TODO Auto-generated method stub } @Override public void surfaceCreated(SurfaceHolder holder) { // TODO Auto-generated method stub Canvas canvas = holder.lockCanvas();//获取画布 try{ synchronized(holder){ onDraw(canvas);//绘制 } } catch(Exception e){ e.printStackTrace(); } finally{ if(canvas != null){ holder.unlockCanvasAndPost(canvas); } } } @Override public void surfaceDestroyed(SurfaceHolder holder) { // TODO Auto-generated method stub } }
[ "bxh7425014@163.com" ]
bxh7425014@163.com
c0682bd2d897b90ab17e540bcd9cea171c8e563a
31db60fe49ef7d31f3fc29221a69b97c19c59bb3
/src/main/resources/oracle-db/kv-18.1.19/src/oracle/kv/impl/tif/FeederPartReaderCbk.java
b317e891f2f5120711e8315689a91eae71d1870e
[ "Apache-2.0", "Zlib", "MIT", "CC0-1.0", "FSFAP", "BSD-3-Clause" ]
permissive
joelnewcom/embeddedOracleKv
d39cc4db1aa26962d7a1c721b87aa55a23124c3e
138d23c66ae91d8e367b5456e4c5ab85dc47fcdc
refs/heads/master
2021-06-25T20:24:13.850335
2019-06-02T19:43:27
2019-06-02T19:43:27
134,009,219
0
0
Apache-2.0
2020-10-13T01:06:34
2018-05-18T22:19:51
Java
UTF-8
Java
false
false
8,187
java
/*- * Copyright (C) 2011, 2018 Oracle and/or its affiliates. All rights reserved. * * This file was distributed by Oracle as part of a version of Oracle NoSQL * Database made available at: * * http://www.oracle.com/technetwork/database/database-technologies/nosqldb/downloads/index.html * * Please see the LICENSE file included in the top-level directory of the * appropriate version of Oracle NoSQL Database for a copy of the license and * additional information. */ package oracle.kv.impl.tif; import com.sleepycat.je.log.LogEntryType; import com.sleepycat.je.rep.GroupShutdownException; import com.sleepycat.je.rep.InsufficientLogException; import com.sleepycat.je.rep.subscription.Subscription; import com.sleepycat.je.rep.subscription.SubscriptionStatus; import com.sleepycat.je.utilint.InternalException; import com.sleepycat.je.utilint.VLSN; import oracle.kv.impl.rep.subscription.partreader.PartitionReader; import oracle.kv.impl.rep.subscription.partreader.PartitionReaderCallBack; import oracle.kv.impl.topo.PartitionId; import java.util.concurrent.BlockingQueue; import java.util.concurrent.TimeoutException; import java.util.logging.Logger; /** * Default callback to process each entry received from partition migration * stream. */ class FeederPartReaderCbk implements PartitionReaderCallBack { private final PartitionId partitionId; private final SubscriptionManager manager; private final BlockingQueue<DataItem> inputQueue; private final PartitionReader reader; private final Subscription repStreamConsumer; private final Logger logger; FeederPartReaderCbk(SubscriptionManager manager, PartitionId partitionId, Logger logger) { this.partitionId = partitionId; this.manager = manager; this.logger = logger; reader = manager.getPartitionReaderMap().get(partitionId); repStreamConsumer = manager.getRepStreamConsumer(); inputQueue = manager.getInputQueuePartReader(); } /** * callback function to process a COPY or PUT operation * * @param pid id of partition * @param vlsn vlsn of operation * @param exp expiration time * @param key key to copy or put * @param value value part of operation */ @Override public void processCopy(PartitionId pid, long vlsn, long exp, byte[] key, byte[] value) { final DataItem entry = new DataItem(new VLSN(vlsn), DataItem.TXN_ID_COPY_IN_PARTTRANS, key, value); entry.setPartitionId(pid); processEntry(entry); } /** * callback function to process a COPY or PUT operation * * @param pid id of partition * @param vlsn vlsn of operation * @param exp expiration time * @param key key to copy or put * @param value value part of operation * @param txnId id of transaction */ @Override public void processPut(PartitionId pid, long vlsn, long exp, byte[] key, byte[] value, long txnId) { final DataItem entry = new DataItem(new VLSN(vlsn), txnId, key, value); entry.setPartitionId(pid); processEntry(entry); } /** * callback function to process a DEL operation * * @param pid id of partition * @param vlsn vlsn of operation * @param key key to delete * @param txnId id of transaction */ @Override public void processDel(PartitionId pid, long vlsn, byte[] key, long txnId) { final DataItem entry = new DataItem(new VLSN(vlsn), txnId, key); entry.setPartitionId(pid); processEntry(entry); } /** * callback function to process a PREPARE operation * * @param pid id of partition * @param txnId id of transaction */ @Override public void processPrepare(PartitionId pid, long txnId) { /* useless to TIF, skip */ } /** * callback function to COMMIT a transaction * * @param pid id of partition * @param txnId id of transaction */ @Override public void processCommit(PartitionId pid, long txnId) { /* * current migration stream implementation does not send VLSN for * transaction resolution such as COMMIT and ABORT, we tentatively * use a NULL VLSN. TIF need take it in consideration when consuming * VLSN from entries from migration stream. */ final DataItem entry = new DataItem(VLSN.NULL_VLSN, txnId, LogEntryType.LOG_TXN_COMMIT); entry.setPartitionId(pid); processEntry(entry); } /** * callback function to ABORT a transaction * * @param pid id of partition * @param txnId id of transaction */ @Override public void processAbort(PartitionId pid, long txnId) { final DataItem entry = new DataItem(VLSN.NULL_VLSN, txnId, LogEntryType.LOG_TXN_ABORT); entry.setPartitionId(pid); processEntry(entry); } /** * callback function to process EOD * * @param pid id of partition */ @Override public synchronized void processEOD(PartitionId pid) { final SubscriptionManager.SubscriptionFilter filter = manager.getSubscriptionFilter(); final VLSN highVLSN = new VLSN(reader.getHighestVLSN()); logger.info(partitionId + " transfer is done at high vlsn " + highVLSN); /* add this partition to completed partitions in filter */ filter.addPartition(pid); try { /* the first partition done, start ongoing rep from high vlsn */ if (filter.getCompletePartitions().size() == 1) { assert (repStreamConsumer != null); if (!repStreamConsumer.getSubscriptionStatus() .equals(SubscriptionStatus.SUCCESS)) { /* start rep stream if not started */ repStreamConsumer.start(highVLSN.getNext()); /* no exception, subscription is successful */ assert (repStreamConsumer.getSubscriptionStatus() .equals( SubscriptionStatus.SUCCESS)); logger.info("successfully start rep stream consumer " + "from VLSN " + highVLSN.getNext() + " after finishing " + partitionId); } else { logger.info("the rep stream consumer has already started " + "when " + partitionId + " is done."); } } /* the last partition done, change state to ongoing */ if (manager.allPartComplete()) { manager.setSubscriptionState(SubscriptionState .REPLICATION_STREAM); } } catch (InsufficientLogException | IllegalArgumentException | TimeoutException | GroupShutdownException | InternalException e) { logger.warning("Unable to subscribe from VLSN " + highVLSN.getNext() + " after finishing " + partitionId + "" + ", reason: " + e.getMessage()); manager.shutdown(SubscriptionState.ERROR); } } /* action applied to each entry. user can override */ private void processEntry(DataItem entry) { while (true) { try { inputQueue.put(entry); return; } catch (InterruptedException e) { /* This might have to get smarter. */ logger.warning(partitionId + ": interrupted input " + "queue operation put, retrying"); } } } }
[ "joel.neukom@gmx.ch" ]
joel.neukom@gmx.ch
962c81aed92153a64b396c82fb7774a1e64b5c30
3c054fafee61418e484e4f8efc264f5ce0696e33
/vertx-orientdb-examples/src/main/java/org/cstamas/vertx/orientdb/examples/ServiceWriterVerticle.java
94f1fcd42880e1670bb10e39b1fb37b19d75e3b6
[ "Apache-2.0" ]
permissive
cstamas/vertx-orientdb
71e99253aa054476898b434838b3ac2ee1351a98
bc3c1ca700d788ba87ca402ae07c5ddf8d7c34b5
refs/heads/master
2021-06-07T00:52:56.296956
2017-11-21T14:51:50
2017-11-21T14:53:10
57,416,385
8
1
null
null
null
null
UTF-8
Java
false
false
1,356
java
package org.cstamas.vertx.orientdb.examples; import io.vertx.core.AbstractVerticle; import io.vertx.core.Future; import io.vertx.core.eventbus.Message; import io.vertx.core.eventbus.MessageConsumer; import io.vertx.core.json.JsonObject; import io.vertx.core.logging.Logger; import io.vertx.core.logging.LoggerFactory; import org.cstamas.vertx.orientdb.examples.service.DocumentDatabaseService; /** * OrientDB test verticle. */ public class ServiceWriterVerticle extends AbstractVerticle { private static final Logger log = LoggerFactory.getLogger(ServiceWriterVerticle.class); private MessageConsumer<JsonObject> consumer; @Override public void start(final Future<Void> startFuture) throws Exception { DocumentDatabaseService documentDatabaseService = DocumentDatabaseService.createProxy(vertx, "test"); consumer = vertx.eventBus().consumer("write", (Message<JsonObject> m) -> { documentDatabaseService.insert( "test", new JsonObject().put("name", "name").put("value", "value"), h -> { if (h.succeeded()) { log.info("Written OID " + h.result()); } else { log.error("Error", h.cause()); } } ); } ); super.start(startFuture); } }
[ "tamas@cservenak.net" ]
tamas@cservenak.net
0c106da27b0f87494133455a7911c6b588994be7
a9914626c19f4fbcb5758a1953a4efe4c116dfb9
/L2JTW_DataPack_Ertheia/dist/game/data/scripts/quests/TerritoryWarScripts/Q00735_MakeSpearsDull.java
75a22d27eea2ade12616c450b91daee1c9c56213
[]
no_license
mjsxjy/l2jtw_datapack
ba84a3bbcbae4adbc6b276f9342c248b6dd40309
c6968ae0475a076080faeead7f94bda1bba3def7
refs/heads/master
2021-01-19T18:21:37.381390
2015-08-03T00:20:39
2015-08-03T00:20:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,644
java
/* * Copyright (C) 2004-2014 L2J DataPack * * This file is part of L2J DataPack. * * L2J DataPack is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * L2J DataPack is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ package quests.TerritoryWarScripts; import com.l2jserver.gameserver.network.NpcStringId; /** * Make Spears Dull! (735) * @author Gigiikun */ public final class Q00735_MakeSpearsDull extends TerritoryWarSuperClass { public Q00735_MakeSpearsDull() { super(735, Q00735_MakeSpearsDull.class.getSimpleName(), "Make Spears Dull"); CLASS_IDS = new int[] { 23, 101, 36, 108, 8, 93, 2, 88, 3, 89, 48, 114, 46, 113, 55, 117, 9, 92, 24, 102, 37, 109, 34, 107, 21, 100, 127, 131, 128, 132, 129, 133, 130, 134, 135, 136 }; RANDOM_MIN = 15; RANDOM_MAX = 20; npcString = new NpcStringId[] { NpcStringId.YOU_HAVE_DEFEATED_S2_OF_S1_WARRIORS_AND_ROGUES, NpcStringId.YOU_WEAKENED_THE_ENEMYS_ATTACK }; } }
[ "rocknow@9bd44e3e-6552-0410-907e-a6ca40b856b6" ]
rocknow@9bd44e3e-6552-0410-907e-a6ca40b856b6
0b99129025ffce2b504ed6dbf012ec06c678fa72
bb9140f335d6dc44be5b7b848c4fe808b9189ba4
/Extra-DS/Corpus/class/aspectj/2450.java
2461bd142b04e44b9c46b6e7ccdebd86b6e85356
[]
no_license
masud-technope/EMSE-2019-Replication-Package
4fc04b7cf1068093f1ccf064f9547634e6357893
202188873a350be51c4cdf3f43511caaeb778b1e
refs/heads/master
2023-01-12T21:32:46.279915
2022-12-30T03:22:15
2022-12-30T03:22:15
186,221,579
5
3
null
null
null
null
UTF-8
Java
false
false
4,274
java
/* ******************************************************************* * Copyright (c) 2003 Contributors. * All rights reserved. * This program and the accompanying materials are made available * under the terms of the Common Public License v1.0 * which accompanies this distribution and is available at * http://www.eclipse.org/legal/cpl-v10.html * * Contributors: * Matthew Webster initial implementation * ******************************************************************/ package org.aspectj.ajde; import java.io.File; import java.io.IOException; import java.util.jar.JarEntry; import java.util.jar.JarFile; import org.aspectj.util.FileUtil; public class OutxmlTest extends AjdeTestCase { public static final String PROJECT_DIR = "OutxmlTest"; public static final String BIN_DIR = "bin"; public static final String OUTJAR_NAME = "/bin/test.jar"; public static final String DEFAULT_AOPXML_NAME = "META-INF/aop.xml"; public static final String CUSTOM_AOPXML_NAME = "custom/aop.xml"; /* * Ensure the output directory is clean */ protected void setUp() throws Exception { super.setUp(PROJECT_DIR); FileUtil.deleteContents(openFile(BIN_DIR)); } /* * Clean up afterwards */ protected void tearDown() throws Exception { super.tearDown(); FileUtil.deleteContents(openFile(BIN_DIR)); openFile(BIN_DIR).delete(); } /** * Aim: Test "-outxml" option produces the correct xml file * */ public void testOutxmlToFile() { // System.out.println("OutxmlTest.testOutxmlToFile() outputpath='" + ideManager.getProjectProperties().getOutputPath() + "'"); assertTrue("Build failed", doSynchronousBuild("outxml-to-file.lst")); assertTrue("Build warnings", ideManager.getCompilationSourceLineTasks().isEmpty()); File aopxml = openFile(BIN_DIR + "/" + DEFAULT_AOPXML_NAME); assertTrue(DEFAULT_AOPXML_NAME + " missing", aopxml.exists()); } /** * Aim: Test "-outxmlfile filename" option produces the correct * xml file * */ public void testOutxmlfileToFile() { assertTrue("Build failed", doSynchronousBuild("outxmlfile-to-file.lst")); assertTrue("Build warnings", ideManager.getCompilationSourceLineTasks().isEmpty()); File aopxml = openFile(BIN_DIR + "/" + CUSTOM_AOPXML_NAME); assertTrue(CUSTOM_AOPXML_NAME + " missing", aopxml.exists()); } /** * Aim: Test "-outxml" option produces the correct * xml entry in outjar file * */ public void testOutxmlToOutjar() { File outjar = openFile(OUTJAR_NAME); ideManager.getProjectProperties().setOutJar(outjar.getAbsolutePath()); assertTrue("Build failed", doSynchronousBuild("outxml-to-outjar.lst")); assertTrue("Build warnings", ideManager.getCompilationSourceLineTasks().isEmpty()); File aopxml = openFile(BIN_DIR + "/" + DEFAULT_AOPXML_NAME); assertFalse(DEFAULT_AOPXML_NAME + " should not exisit", aopxml.exists()); assertJarContainsEntry(outjar, DEFAULT_AOPXML_NAME); } /** * Aim: Test "-outxmlfile filename" option produces the correct * xml entry in outjar file * */ public void testOutxmlfileToOutjar() { // System.out.println("OutxmlTest.testOutxmlToOutjar() outputpath='" + ideManager.getProjectProperties().getOutputPath() + "'"); File outjar = openFile(OUTJAR_NAME); ideManager.getProjectProperties().setOutJar(outjar.getAbsolutePath()); assertTrue("Build failed", doSynchronousBuild("outxmlfile-to-outjar.lst")); assertTrue("Build warnings", ideManager.getCompilationSourceLineTasks().isEmpty()); File aopxml = openFile(BIN_DIR + "/" + CUSTOM_AOPXML_NAME); assertFalse(CUSTOM_AOPXML_NAME + " should not exisit", aopxml.exists()); assertJarContainsEntry(outjar, CUSTOM_AOPXML_NAME); } private void assertJarContainsEntry(File file, String entryName) { try { JarFile jarFile = new JarFile(file); JarEntry jarEntry = jarFile.getJarEntry(entryName); assertNotNull(entryName + " missing", jarEntry); } catch (IOException ex) { fail(ex.toString()); } } }
[ "masudcseku@gmail.com" ]
masudcseku@gmail.com
4cab5ef41848dc8df2cf4ff0391e8e67c177f848
4ef431684e518b07288e8b8bdebbcfbe35f364e4
/em-tests/test-core/src/main/java/com/ca/apm/test/atc/performance/TimelinePerformanceTest.java
7cbfa2355826cd6b9b0379463c27df342aae09f9
[]
no_license
Sarojkswain/APMAutomation
a37c59aade283b079284cb0a8d3cbbf79f3480e3
15659ce9a0030c2e9e5b992040e05311fff713be
refs/heads/master
2020-03-30T00:43:23.925740
2018-09-27T23:42:04
2018-09-27T23:42:04
150,540,177
0
0
null
null
null
null
UTF-8
Java
false
false
2,377
java
/* * Copyright (c) 2015 CA. All rights reserved. * * This software and all information contained therein is confidential and * proprietary and shall not be duplicated, used, disclosed or disseminated in * any way except as authorized by the applicable license agreement, without * the express written permission of CA. All authorized reproductions must be * marked with this language. * * EXCEPT AS SET FORTH IN THE APPLICABLE LICENSE AGREEMENT, TO THE EXTENT * PERMITTED BY APPLICABLE LAW, CA PROVIDES THIS SOFTWARE WITHOUT WARRANTY OF * ANY KIND, INCLUDING WITHOUT LIMITATION, ANY IMPLIED WARRANTIES OF * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL CA BE * LIABLE TO THE END USER OR ANY THIRD PARTY FOR ANY LOSS OR DAMAGE, DIRECT OR * INDIRECT, FROM THE USE OF THIS SOFTWARE, INCLUDING WITHOUT LIMITATION, LOST * PROFITS, BUSINESS INTERRUPTION, GOODWILL, OR LOST DATA, EVEN IF CA IS * EXPRESSLY ADVISED OF SUCH LOSS OR DAMAGE. */ package com.ca.apm.test.atc.performance; import org.testng.annotations.Parameters; import org.testng.annotations.Test; import com.ca.apm.test.atc.common.Timeline; import com.ca.apm.test.atc.common.UI; import com.ca.apm.test.atc.common.UI.Role; public class TimelinePerformanceTest extends PerformanceTest implements RepeatableTest { private int counter = 0; @Test @Parameters({ "testIterations" }) public void testDecreasingEndTime(int iterations) { try { UI ui = getUI(); ui.login(Role.ADMIN); ui.getLeftNavigationPanel().goToMapViewPage(); ui.getRibbon().expandTimelineToolbar(); ui.getTimeline().turnOnLiveMode(); ui.getCanvas().waitForUpdate(); runTest(this, iterations); } catch (Exception e) { // TODO Auto-generated catch block } } @Override public void oneLoop() { UI ui = getUI(); Timeline timeline = ui.getTimeline(); timeline.openStartTimeCalendar(); if ((counter / 10) % 2 == 0) { timeline.getStartTimeCalendarMinuteDecreaseBtn().click(); } else { timeline.getStartTimeCalendarMinuteIncreaseBtn().click(); } timeline.calendarApply(); ui.getCanvas().waitForUpdate(); counter++; } }
[ "sarojkswain@gmail.com" ]
sarojkswain@gmail.com
33673cfc8d51a8c8988897882854a00a61b649cc
f8bdf5083165cc95c8e1ad19053a8031ddd575ca
/core/src/main/java/com/memory/platform/rpc/dubbo/DubboFilter.java
758a37dc7067949d31efe40aa65295e2ca55fe60
[]
no_license
ladanniel/-
1ec0c7cba535b8cfbd2e20dc5785ea8d8b70b759
c6953ebeb2eafb27c6e72a78c6551e12b441f518
refs/heads/master
2020-04-26T11:34:03.761608
2019-03-03T02:20:51
2019-03-03T02:20:51
173,521,158
0
1
null
null
null
null
UTF-8
Java
false
false
881
java
package com.memory.platform.rpc.dubbo; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import com.alibaba.dubbo.rpc.Filter; import com.alibaba.dubbo.rpc.Invocation; import com.alibaba.dubbo.rpc.Invoker; import com.alibaba.dubbo.rpc.Result; import com.alibaba.dubbo.rpc.RpcContext; import com.alibaba.dubbo.rpc.RpcException; import com.memory.platform.core.AppUtil; import com.memory.platform.entity.member.Account; /* * bylil 消费者拦截器 * 传入token账号 * */ @Aspect @Component public class DubboFilter implements Filter{ @Override public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException { Account account = AppUtil.getLoginUser(); if(account!=null) { RpcContext.getContext().setAttachment("tokenID", account.getToken()); } return invoker.invoke(invocation); } }
[ "ldanniel@sina.com" ]
ldanniel@sina.com
d9502068a9fb2a350abd1fd4ac087e9d32bc443f
7f69e2b6ec47fdfd7088f63eda64c80d9f1f1b0f
/Web2SMS_Common_DALayer/src/main/java/com/edafa/web2sms/dalayer/dao/interfaces/AccountSenderDaoLocal.java
260527e268919b476f7779f1ba50ce3becff321b
[]
no_license
MahmoudFouadMohamed/WEB2SMS
53246564d5c0098737222aa602955238e60338c2
1693b5a1749a7f1ebfa0fc4d15d1e3117759efc9
refs/heads/master
2020-05-17T01:49:23.308128
2019-04-25T19:37:06
2019-04-25T19:37:06
183,435,780
0
0
null
null
null
null
UTF-8
Java
false
false
1,060
java
package com.edafa.web2sms.dalayer.dao.interfaces; import java.util.List; import javax.ejb.Local; import com.edafa.web2sms.dalayer.exception.DBException; import com.edafa.web2sms.dalayer.model.AccountSender; @Local public interface AccountSenderDaoLocal { void create(AccountSender sender) throws DBException; void edit(AccountSender sender) throws DBException; void remove(AccountSender sender) throws DBException; AccountSender find(Object id) throws DBException; List<AccountSender> findAll() throws DBException; List<AccountSender> findRange(int[] range) throws DBException; int count() throws DBException; List<AccountSender> findByAccountId(String accountId) throws DBException; // AccountSender findBySenderName(String sender) throws DBException; void removeAllByAccountId(String acctId) throws DBException; int CountByAccountId(String accountId) throws DBException; // int CountBySenderName(String sender) throws DBException; AccountSender findByAccountIdAndSenderName(String accountId, String sender) throws DBException; }
[ "mahmoud.fouad@edafa.com" ]
mahmoud.fouad@edafa.com
7762ce9b525faace10262a100be37c7e000fbbf3
24d8cf871b092b2d60fc85d5320e1bc761a7cbe2
/iText/rev2818-3988/left-trunk-3988/rups/com/lowagie/rups/view/itext/PagesTable.java
e8617dd83bd3a30346f262d029fb01903a0875cb
[]
no_license
joliebig/featurehouse_fstmerge_examples
af1b963537839d13e834f829cf51f8ad5e6ffe76
1a99c1788f0eb9f1e5d8c2ced3892d00cd9449ad
refs/heads/master
2016-09-05T10:24:50.974902
2013-03-28T16:28:47
2013-03-28T16:28:47
9,080,611
3
2
null
null
null
null
UTF-8
Java
false
false
4,075
java
package com.lowagie.rups.view.itext; import java.util.ArrayList; import java.util.Enumeration; import java.util.Observable; import java.util.Observer; import javax.swing.JTable; import javax.swing.event.ListSelectionEvent; import com.lowagie.rups.controller.PdfReaderController; import com.lowagie.rups.model.ObjectLoader; import com.lowagie.rups.model.TreeNodeFactory; import com.lowagie.rups.view.PageNavigationListener; import com.lowagie.rups.view.itext.treenodes.PdfObjectTreeNode; import com.lowagie.rups.view.itext.treenodes.PdfPageTreeNode; import com.lowagie.rups.view.itext.treenodes.PdfPagesTreeNode; import com.lowagie.rups.view.itext.treenodes.PdfTrailerTreeNode; import com.lowagie.rups.view.models.JTableAutoModel; import com.lowagie.rups.view.models.JTableAutoModelInterface; import com.lowagie.text.pdf.PdfName; import com.lowagie.text.pdf.PdfPageLabels; public class PagesTable extends JTable implements JTableAutoModelInterface, Observer { protected ArrayList<PdfPageTreeNode> list = new ArrayList<PdfPageTreeNode>(); protected PdfReaderController controller; protected PageNavigationListener listener; public PagesTable(PdfReaderController controller, PageNavigationListener listener) { this.controller = controller; this.listener = listener; } public void update(Observable observable, Object obj) { if (obj == null) { list = new ArrayList<PdfPageTreeNode>(); repaint(); return; } if (obj instanceof ObjectLoader) { ObjectLoader loader = (ObjectLoader)obj; String[] pagelabels = PdfPageLabels.getPageLabels(loader.getReader()); int i = 0; TreeNodeFactory factory = loader.getNodes(); PdfTrailerTreeNode trailer = controller.getPdfTree().getRoot(); PdfObjectTreeNode catalog = factory.getChildNode(trailer, PdfName.ROOT); PdfPagesTreeNode pages = (PdfPagesTreeNode)factory.getChildNode(catalog, PdfName.PAGES); if (pages == null) { return; } Enumeration p = pages.depthFirstEnumeration(); PdfObjectTreeNode child; StringBuffer buf; while (p.hasMoreElements()) { child = (PdfObjectTreeNode)p.nextElement(); if (child instanceof PdfPageTreeNode) { buf = new StringBuffer("Page "); buf.append(++i); if (pagelabels != null) { buf.append(" ( "); buf.append(pagelabels[i - 1]); buf.append(" )"); } child.setUserObject(buf.toString()); list.add((PdfPageTreeNode)child); } } } setModel(new JTableAutoModel(this)); } public int getColumnCount() { return 2; } public int getRowCount() { return list.size(); } public Object getValueAt(int rowIndex, int columnIndex) { if (getRowCount() == 0) return null; switch (columnIndex) { case 0: return "Object " + list.get(rowIndex).getNumber(); case 1: return list.get(rowIndex); } return null; } public String getColumnName(int columnIndex) { switch (columnIndex) { case 0: return "Object"; case 1: return "Page"; default: return null; } } @Override public void valueChanged(ListSelectionEvent evt) { if (evt != null) super.valueChanged(evt); if (controller == null) return; if (getRowCount() > 0) { controller.selectNode(list.get(getSelectedRow())); if (listener != null) listener.gotoPage(getSelectedRow() + 1); } } private static final long serialVersionUID = -6523261089453886508L; }
[ "joliebig@fim.uni-passau.de" ]
joliebig@fim.uni-passau.de
7456c17230a843031305ff20069d7544814b15e2
93aa731ad4520b33cb1291c578794e65b13dd883
/src/clasesbase/Matematica.java
cd55932678767c180fddac4e8a9b891b3b683567
[]
no_license
alexHokuto/ClasesBase
3312e7eb4122076668ad99e6232e482e8f1d12cb
f49c08b52f56b67984862f6df12723ecd75fae98
refs/heads/master
2021-01-25T00:46:34.780428
2014-01-27T01:30:09
2014-01-27T01:30:09
null
0
0
null
null
null
null
UTF-8
Java
false
false
4,952
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package clasesbase; import java.math.BigDecimal; import java.math.MathContext; import java.math.RoundingMode; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.util.Locale; import java.util.Random; /** * * @author usuario */ public class Matematica { static double generarRandomDouble(int num){ Random rndNumbers = new Random(num); double rndNumber = rndNumbers.nextGaussian() * 1000; String pattern = "######.##"; DecimalFormat f = new DecimalFormat(pattern, new DecimalFormatSymbols(Locale.US)); String cadena= f.format(rndNumber); double montoFinal=Double.valueOf(cadena); return montoFinal; } static int generarRandomInteger(int num){ Random rndNumbers = new Random(num); double rndNumber = rndNumbers.nextGaussian() * 1000; int numeroFinal= (int) rndNumber; return numeroFinal; } static String customFormat(String pattern, double value) { DecimalFormat myFormatter = new DecimalFormat(pattern, new DecimalFormatSymbols(Locale.US)); String output = myFormatter.format(value); return output; } static String customFormat(String pattern, int value) { DecimalFormat myFormatter = new DecimalFormat(pattern, new DecimalFormatSymbols(Locale.US)); String output = myFormatter.format(value); return output; } public void mostrarRandonDouble(String pattern){ for (int i = 0; i < 3; i++) { double randomDouble= generarRandomDouble(i+999); System.out.println("randomDouble: " + randomDouble + " Formato:" + customFormat(pattern, randomDouble)); } } public void mostrarRandonInteger(String pattern){ for (int i = 0; i < 3; i++) { int randomInteger= this.generarRandomInteger(i+999); System.out.println("randomInteger: " + randomInteger + " Formato:" + customFormat(pattern, randomInteger) ); } } static BigDecimal sumarBigDecimal(double num1, double num2, int precisionDecimal){ // create MathContext object with 4 precision // MathContext mc = new MathContext(4); BigDecimal numUno= new BigDecimal(num1); BigDecimal sumar; sumar= numUno.add(new BigDecimal(num2)); return sumar.setScale(precisionDecimal, RoundingMode.HALF_UP); } static BigDecimal restarBigDecimal(double num1, double num2, int precisionDecimal){ BigDecimal numUno= new BigDecimal(num1); BigDecimal restar; restar= numUno.subtract(new BigDecimal(num2)); return restar.setScale(precisionDecimal, RoundingMode.HALF_UP); } static BigDecimal multiplicarBigDecimal(double num1, double num2, int precisionDecimal){ BigDecimal numUno= new BigDecimal(num1); BigDecimal multiplicar; multiplicar= numUno.multiply(new BigDecimal(num2)); return multiplicar.setScale(precisionDecimal, RoundingMode.HALF_UP); } static BigDecimal dividirBigDecimal(double num1, double num2, int precisionDecimal){ BigDecimal numUno= new BigDecimal(num1); BigDecimal dividir; dividir= numUno.divide(new BigDecimal(num2), precisionDecimal, RoundingMode.HALF_UP); return dividir; } public static void main(String[] args) { Matematica matematica= new Matematica(); String patternUno= "###,###.####"; String patternDos= "000000.00000"; matematica.mostrarRandonDouble(patternUno); matematica.mostrarRandonInteger(patternDos); String sumarBigDecimal= Matematica.sumarBigDecimal(1040.739, 30.12, 5).toString(); System.out.println("Sumar BigDecimal: " + sumarBigDecimal); double sumar= Matematica.sumarBigDecimal(1040.739, 30.12, 5).doubleValue(); System.out.println(patternUno + " " + Matematica.customFormat(patternUno, sumar)); System.out.println(patternDos + " " + Matematica.customFormat(patternDos, sumar)); String restarBigDecimal= Matematica.restarBigDecimal(40.75, 30.121, 4).toString(); System.out.println("Sumar BigDecimal: " + restarBigDecimal); double multiplicar= Matematica.multiplicarBigDecimal(140.739, 30.12, 5).doubleValue(); System.out.println("Multiplicar " + patternUno + " " + Matematica.customFormat(patternUno, multiplicar)); double dividir= Matematica.dividirBigDecimal(1540.739, 3.12, 5).doubleValue(); System.out.println(dividir); System.out.println("Dividir " + patternUno + " " + Matematica.customFormat(patternUno, dividir)); } }
[ "usuario@usuario-PC" ]
usuario@usuario-PC
3e9aeda26aea2d046c4366423fec135caa58f603
c42531b0f0e976dd2b11528504e349d5501249ae
/York GC Members App/MHSystems/app/src/main/java/com/mh/systems/york/web/models/HCapCertificate.java
3ca9ddcceefc8e5dcadef6d899a9f9d2a686fb44
[ "MIT" ]
permissive
Karan-nassa/MHSystems
4267cc6939de7a0ff5577c22b88081595446e09e
a0e20f40864137fff91784687eaf68e5ec3f842c
refs/heads/master
2021-08-20T05:59:06.864788
2017-11-28T08:02:39
2017-11-28T08:02:39
112,189,266
0
0
null
null
null
null
UTF-8
Java
false
false
3,904
java
package com.mh.systems.york.web.models; import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; public class HCapCertificate { @SerializedName("ClubName") @Expose private String ClubName; @SerializedName("IssueDate") @Expose private String IssueDate; @SerializedName("PlayerName") @Expose private String PlayerName; @SerializedName("CDHID") @Expose private String CDHID; @SerializedName("HisOrHer") @Expose private String HisOrHer; @SerializedName("ExactHCap") @Expose private String ExactHCap; @SerializedName("PlayHCap") @Expose private String PlayHCap; @SerializedName("SignedBy") @Expose private String SignedBy; @SerializedName("MHSBanner") @Expose private String MHSBanner; @SerializedName("SignatureImageUri") @Expose private String SignatureImageUri; /** * * @return * The ClubName */ public String getClubName() { return ClubName; } /** * * @param ClubName * The ClubName */ public void setClubName(String ClubName) { this.ClubName = ClubName; } /** * * @return * The IssueDate */ public String getIssueDate() { return IssueDate; } /** * * @param IssueDate * The IssueDate */ public void setIssueDate(String IssueDate) { this.IssueDate = IssueDate; } /** * * @return * The PlayerName */ public String getPlayerName() { return PlayerName; } /** * * @param PlayerName * The PlayerName */ public void setPlayerName(String PlayerName) { this.PlayerName = PlayerName; } /** * * @return * The CDHID */ public String getCDHID() { return CDHID; } /** * * @param CDHID * The CDHID */ public void setCDHID(String CDHID) { this.CDHID = CDHID; } /** * * @return * The HisOrHer */ public String getHisOrHer() { return HisOrHer; } /** * * @param HisOrHer * The HisOrHer */ public void setHisOrHer(String HisOrHer) { this.HisOrHer = HisOrHer; } /** * * @return * The ExactHCap */ public String getExactHCap() { return ExactHCap; } /** * * @param ExactHCap * The ExactHCap */ public void setExactHCap(String ExactHCap) { this.ExactHCap = ExactHCap; } /** * * @return * The PlayHCap */ public String getPlayHCap() { return PlayHCap; } /** * * @param PlayHCap * The PlayHCap */ public void setPlayHCap(String PlayHCap) { this.PlayHCap = PlayHCap; } /** * * @return * The SignedBy */ public String getSignedBy() { return SignedBy; } /** * * @param SignedBy * The SignedBy */ public void setSignedBy(String SignedBy) { this.SignedBy = SignedBy; } /** * * @return * The MHSBanner */ public String getMHSBanner() { return MHSBanner; } /** * * @param MHSBanner * The MHSBanner */ public void setMHSBanner(String MHSBanner) { this.MHSBanner = MHSBanner; } /** * * @return * The SignatureImageUri */ public String getSignatureImageUri() { return SignatureImageUri; } /** * * @param SignatureImageUri * The SignatureImageUri */ public void setSignatureImageUri(String SignatureImageUri) { this.SignatureImageUri = SignatureImageUri; } }
[ "karan@ucreate.co.in" ]
karan@ucreate.co.in
d93933a63cb323968bada3a662f78e9d650d4db2
22a8c41442174cf317878be4c9b191d6f86c8ec4
/src/main/java/model/beans/PersonBasicInformation.java
0819814762885b2d1cac36a7ece65e07efa82195
[]
no_license
skuarch/admin
0e15e1eb7ff223c988c8e5d84c2ed5515ce550fc
a27b5939eba0765825a0b9c359302a8e0cafb69f
refs/heads/master
2021-01-13T01:30:15.953994
2015-08-16T15:14:04
2015-08-16T15:14:04
35,173,051
0
0
null
null
null
null
UTF-8
Java
false
false
3,707
java
package model.beans; import java.io.Serializable; /** * * @author skuarch */ public class PersonBasicInformation implements Serializable { private long id; private String name; private String lastName; private String email; private String phone; private int zipCode; private String lastLogin; private String country; private String addressAll; private String gender; private String city; private String type; private String registrationDate; private String state; private String key; private long personId; private long personType; private boolean isPartner; private boolean isAffiliate; private boolean isCompany; public PersonBasicInformation() { } public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getLastName() { return lastName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public int getZipCode() { return zipCode; } public void setZipCode(int zipCode) { this.zipCode = zipCode; } public String getLastLogin() { return lastLogin; } public void setLastLogin(String lastLogin) { this.lastLogin = lastLogin; } public String getCountry() { return country; } public void setCountry(String country) { this.country = country; } public String getAddressAll() { return addressAll; } public void setAddressAll(String addressAll) { this.addressAll = addressAll; } public String getGender() { return gender; } public void setGender(String gender) { this.gender = gender; } public String getCity() { return city; } public void setCity(String city) { this.city = city; } public String getType() { return type; } public void setType(String type) { this.type = type; } public String getRegistrationDate() { return registrationDate; } public void setRegistrationDate(String registrationDate) { this.registrationDate = registrationDate; } public String getState() { return state; } public void setState(String state) { this.state = state; } public String getKey() { return key; } public void setKey(String key) { this.key = key; } public long getPersonId() { return personId; } public void setPersonId(long personId) { this.personId = personId; } public boolean isIsPartner() { return isPartner; } public void setIsPartner(boolean isPartner) { this.isPartner = isPartner; } public boolean isIsAffiliate() { return isAffiliate; } public void setIsAffiliate(boolean isAffiliate) { this.isAffiliate = isAffiliate; } public long getPersonType() { return personType; } public void setPersonType(long personType) { this.personType = personType; } public boolean isIsCompany() { return isCompany; } public void setIsCompany(boolean isCompany) { this.isCompany = isCompany; } }
[ "skuarch@yahoo.com.mx" ]
skuarch@yahoo.com.mx
475ba59d5d5d2bee46b24423e36250c50b8e923c
834184ae7fb5fc951ec4ca76d0ab4d74224817a0
/src/main/java/com/nswt/platform/pub/NoUtil.java
ea39c0c997dbace97f9b075370f16d3168f5eabe
[]
no_license
mipcdn/NswtOldPF
3bf9974be6ffbc32b2d52ef2e39adbe495185c7e
fe7be46f12b3874a7f19967c0808870d8e465f5a
refs/heads/master
2020-08-09T16:44:47.585700
2017-01-11T13:26:37
2017-01-11T13:26:37
null
0
0
null
null
null
null
GB18030
Java
false
false
8,103
java
/** * 作者:NSWT<br> * 日期:2016-7-5<br> * 邮件:nswt@nswt.com.cn<br> */ package com.nswt.platform.pub; import java.sql.SQLException; import com.nswt.framework.Config; import com.nswt.framework.data.DBConn; import com.nswt.framework.data.DBConnPool; import com.nswt.framework.data.DataAccess; import com.nswt.framework.data.DataTable; import com.nswt.framework.data.QueryBuilder; import com.nswt.framework.utility.StringUtil; import com.nswt.schema.ZDMaxNoSchema; import com.nswt.schema.ZDMaxNoSet; public class NoUtil { private static ZDMaxNoSet MaxNoSet; private static Object mutex = new Object(); public static String getMaxNo(String noType) { return getMaxNo(noType, "SN"); } public static String getMaxNoLoal(String noType) { return getMaxNoLocal(noType, "SN"); } public static long getMaxID(String noType, String subType) { // 注释掉本段逻辑,统一使用lock方式。在本地模式下,如果有多个应用同时部署在生产环境中,会导致主键冲突 // if (Config.isDebugMode()) { return getMaxIDUseLock(noType, subType); // } // return getMaxIDLocal(noType, subType); } public synchronized static long getMaxIDUseLock(String noType, String subType) { DBConn conn = DBConnPool.getConnection("Default", false, false);// 不能使用阻塞型事务中的连接 DataAccess da = new DataAccess(conn); try { da.setAutoCommit(false); QueryBuilder qb = new QueryBuilder("select MxValue from ZDMaxNo where NoType=? and NoSubType=?", noType, subType); if (Config.isOracle()) { qb.append(" for update"); } Object mxValue = da.executeOneValue(qb); if (mxValue != null) { long t = Long.parseLong(mxValue.toString()) + 1; qb = new QueryBuilder("update ZDMaxNo set MxValue=? where NoType=? and NoSubType=?", t, noType); qb.add(subType); da.executeNoQuery(qb); da.commit(); return t; } else { ZDMaxNoSchema maxno = new ZDMaxNoSchema(); maxno.setNoType(noType); maxno.setNoSubType(subType); maxno.setMxValue(1); maxno.setLength(10); maxno.setDataAccess(da); if (maxno.insert()) { da.commit(); return 1; } else { throw new RuntimeException("获取最大号时发生错误!"); } } } catch (Exception e) { try { da.rollback(); } catch (SQLException e1) { e1.printStackTrace(); } throw new RuntimeException("获取最大号时发生错误:" + e.getMessage()); } finally { try { da.setAutoCommit(true); da.close(); } catch (SQLException e) { e.printStackTrace(); } } } /** * 得到类型为noType位长为length的编码 */ public static String getMaxNo(String noType, int length) { long t = getMaxID(noType, "SN"); String no = String.valueOf(t); if (no.length() > length) { return no.substring(0, length); } return StringUtil.leftPad(no, '0', length); } /** * 得到类型为noType位长为length且前缀为prefix的编码 */ public static String getMaxNo(String noType, String prefix, int length) { long t = getMaxID(noType, prefix); String no = String.valueOf(t); if (no.length() > length) { return no.substring(0, length); } return prefix + StringUtil.leftPad(no, '0', length); } public synchronized static String getMaxNoUseLock(String noType, String subType) { DataAccess da = new DataAccess(); try { da.setAutoCommit(false); QueryBuilder qb = new QueryBuilder("select MxValue,Length from ZDMaxNo where NoType=? and NoSubType=?", noType, subType); if (Config.isOracle()) { qb.append(" for update"); } DataTable dt = qb.executeDataTable(); if (dt.getRowCount() > 0) { long t = Long.parseLong(dt.getString(0, "MxValue")) + 1; int length = Integer.parseInt(dt.getString(0, "Length")); String no = String.valueOf(t); if (length > 0) { no = StringUtil.leftPad(no, '0', length); } qb = new QueryBuilder("update ZDMaxNo set MxValue=? where NoType=? and NoSubType=?", t, noType); qb.add(subType); da.executeNoQuery(qb); da.commit(); return no; } else { ZDMaxNoSchema maxno = new ZDMaxNoSchema(); maxno.setNoType(noType); maxno.setNoSubType(subType); maxno.setMxValue(1); maxno.setLength(10); maxno.setDataAccess(da); if (maxno.insert()) { da.commit(); return "0000000001"; } else { throw new RuntimeException("获取最大号时发生错误!"); } } } catch (Exception e) { try { da.rollback(); } catch (SQLException e1) { e1.printStackTrace(); } throw new RuntimeException("获取最大号时发生错误:" + e.getMessage()); } finally { try { da.setAutoCommit(true); da.close(); } catch (SQLException e) { e.printStackTrace(); } } } public synchronized static long getMaxIDLocal(String noType, String subType) { if (MaxNoSet == null) { init(); } ZDMaxNoSchema maxno = null; if (MaxNoSet != null) { for (int i = 0; i < MaxNoSet.size(); i++) { maxno = MaxNoSet.get(i); if (maxno.getNoType().equals(noType) && maxno.getNoSubType().equals(subType)) { synchronized (mutex) { maxno.setMxValue(maxno.getMxValue() + 1); if (!maxno.update()) { throw new RuntimeException("生成最大号错误,MaxNoType=" + noType + ",MaxSubType=" + subType); } return maxno.getMxValue(); } } } } else { synchronized (mutex) { MaxNoSet = new ZDMaxNoSet(); maxno = new ZDMaxNoSchema(); maxno.setNoType(noType); maxno.setNoSubType(subType); maxno.setLength(0); maxno.setMxValue(1); maxno.insert(); MaxNoSet.add(maxno); return 1; } } // 运行到此处是因为这是新加的MaxNoType synchronized (mutex) { maxno = new ZDMaxNoSchema(); maxno.setNoType(noType); maxno.setNoSubType(subType); maxno.setLength(10); maxno.setMxValue(1); maxno.insert(); MaxNoSet.add(maxno); return 1; } } public static long getMaxID(String noType) { return getMaxID(noType, "ID"); } public static long getMaxIDLocal(String noType) { return getMaxIDLocal(noType, "ID"); } public static String getMaxNo(String noType, String subType) { if (Config.isDebugMode()) { return getMaxNoUseLock(noType, subType); } return getMaxNoLocal(noType, subType); } public synchronized static String getMaxNoLocal(String noType, String subType) { if (MaxNoSet == null) { init(); } ZDMaxNoSchema maxno = null; if (MaxNoSet != null) { for (int i = 0; i < MaxNoSet.size(); i++) { maxno = MaxNoSet.get(i); if (maxno.getNoType().equals(noType) && maxno.getNoSubType().equals(subType)) { synchronized (mutex) { maxno.setMxValue(maxno.getMxValue() + 1); if (!maxno.update()) { throw new RuntimeException("生成最大号错误,NoType=" + noType + ",MaxSubType=" + subType); } if (maxno.getLength() <= 0) { return String.valueOf(maxno.getMxValue()); } return StringUtil.leftPad(String.valueOf(maxno.getMxValue()), '0', (int) maxno.getLength()); } } } } else { synchronized (mutex) { MaxNoSet = new ZDMaxNoSet(); maxno = new ZDMaxNoSchema(); maxno.setNoType(noType); maxno.setNoSubType(subType); maxno.setLength(10); maxno.setMxValue(1); maxno.insert(); MaxNoSet.add(maxno); return "0000000001"; } } // 运行到此处是因为这是新加的NoType synchronized (mutex) { maxno = new ZDMaxNoSchema(); maxno.setNoType(noType); maxno.setNoSubType(subType); maxno.setLength(10); maxno.setMxValue(1); maxno.insert(); MaxNoSet.add(maxno); return "0000000001"; } } private static synchronized void init() { if (MaxNoSet != null) { return; } ZDMaxNoSchema maxno = new ZDMaxNoSchema(); MaxNoSet = maxno.query(); } }
[ "18611949252@163.como" ]
18611949252@163.como
26176fbe5040dde90e74db7183f66d910b5434a9
4d6f449339b36b8d4c25d8772212bf6cd339f087
/netreflected/src/Core/PresentationCore,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35/system/windows/media/animation/ByteAnimationBase.java
6aeff0193cd05f360d3cac7a0557552b4a92acc4
[ "MIT" ]
permissive
lvyitian/JCOReflector
299a64550394db3e663567efc6e1996754f6946e
7e420dca504090b817c2fe208e4649804df1c3e1
refs/heads/master
2022-12-07T21:13:06.208025
2020-08-28T09:49:29
2020-08-28T09:49:29
null
0
0
null
null
null
null
UTF-8
Java
false
false
7,671
java
/* * MIT License * * Copyright (c) 2020 MASES s.r.l. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /************************************************************************************** * <auto-generated> * This code was generated from a template using JCOReflector * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. * </auto-generated> *************************************************************************************/ package system.windows.media.animation; import org.mases.jcobridge.*; import org.mases.jcobridge.netreflection.*; import java.util.ArrayList; // Import section import system.windows.media.animation.AnimationTimeline; import system.windows.media.animation.AnimationClock; import system.windows.media.animation.ByteAnimationBase; /** * The base .NET class managing System.Windows.Media.Animation.ByteAnimationBase, PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. Extends {@link NetObject}. * <p> * * See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Media.Animation.ByteAnimationBase" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Media.Animation.ByteAnimationBase</a> */ public class ByteAnimationBase extends AnimationTimeline { /** * Fully assembly qualified name: PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 */ public static final String assemblyFullName = "PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; /** * Assembly name: PresentationCore */ public static final String assemblyShortName = "PresentationCore"; /** * Qualified class name: System.Windows.Media.Animation.ByteAnimationBase */ public static final String className = "System.Windows.Media.Animation.ByteAnimationBase"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { return bridge.GetType(className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName)); } catch (JCException e) { return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } public ByteAnimationBase(Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOBridgeInstance.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public Object getJCOInstance() { return classInstance; } public void setJCOInstance(JCObject instance) { classInstance = instance; super.setJCOInstance(classInstance); } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link ByteAnimationBase}, a cast assert is made to check if types are compatible. */ public static ByteAnimationBase cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new ByteAnimationBase(from.getJCOInstance()); } // Constructors section public ByteAnimationBase() throws Throwable { } // Methods section public byte GetCurrentValue(byte defaultOriginValue, byte defaultDestinationValue, AnimationClock animationClock) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.resources.MissingManifestResourceException, system.ObjectDisposedException, system.InvalidOperationException, system.globalization.CultureNotFoundException, system.PlatformNotSupportedException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (byte)classInstance.Invoke("GetCurrentValue", defaultOriginValue, defaultDestinationValue, animationClock == null ? null : animationClock.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public NetObject GetCurrentValue(NetObject defaultOriginValue, NetObject defaultDestinationValue, AnimationClock animationClock) throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.ArgumentNullException, system.InvalidOperationException, system.PlatformNotSupportedException, system.IndexOutOfRangeException, system.NotSupportedException, system.resources.MissingManifestResourceException, system.ObjectDisposedException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objGetCurrentValue = (JCObject)classInstance.Invoke("GetCurrentValue", defaultOriginValue == null ? null : defaultOriginValue.getJCOInstance(), defaultDestinationValue == null ? null : defaultDestinationValue.getJCOInstance(), animationClock == null ? null : animationClock.getJCOInstance()); return new NetObject(objGetCurrentValue); } catch (JCNativeException jcne) { throw translateException(jcne); } } public ByteAnimationBase CloneNewByteAnimationBase() throws Throwable, system.InvalidOperationException, system.ArgumentNullException, system.FormatException, system.ArgumentOutOfRangeException, system.ArgumentException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject objClone = (JCObject)classInstance.Invoke("Clone"); return new ByteAnimationBase(objClone); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Properties section // Instance Events section }
[ "mario.mastrodicasa@masesgroup.com" ]
mario.mastrodicasa@masesgroup.com
5be60e75a29eb166bbd6acd7808058b97c0a5d97
4fecde4635dcef6185bac75b79d86aca8567ead8
/subprojects/griffon-core/src/main/java/org/codehaus/griffon/runtime/core/AbstractContext.java
66a8d1e6ef306aa7711fdd6c879b52e13b651327
[ "Apache-2.0" ]
permissive
manoliou/griffon
a9d884f770cbad69f682e94c03b9b125c4f277bc
b1a1120f1de285ddb2fc29d9cc1de4f4205820c9
refs/heads/master
2021-01-22T17:22:38.121249
2015-11-13T00:55:17
2015-11-13T00:55:17
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,184
java
/* * Copyright 2008-2015 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * 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.codehaus.griffon.runtime.core; import griffon.core.Context; import javax.annotation.Nonnull; import javax.annotation.Nullable; /** * @author Andres Almiray * @since 2.2.0 */ public abstract class AbstractContext implements Context { protected Context parentContext; public AbstractContext(@Nullable Context parentContext) { this.parentContext = parentContext; } @Nullable @Override @SuppressWarnings("unchecked") public <T> T get(@Nonnull String key, @Nullable T defaultValue) { T value = (T) get(key); return value != null ? value : defaultValue; } @Nullable @Override public Object getAt(@Nonnull String key) { return get(key); } @Nullable @Override public <T> T getAt(@Nonnull String key, @Nullable T defaultValue) { return get(key, defaultValue); } @Nullable @Override public Object get(@Nonnull String key) { if (hasKey(key)) { return doGet(key); } else if (parentContext != null) { return parentContext.get(key); } else { return null; } } @Override public void destroy() { parentContext = null; } @Override public boolean containsKey(@Nonnull String key) { if (hasKey(key)) { return true; } else if (parentContext != null) { return parentContext.containsKey(key); } return false; } @Nullable protected abstract Object doGet(@Nonnull String key); }
[ "aalmiray@gmail.com" ]
aalmiray@gmail.com
6e727df8997aff4ab81ff1af84a684a213e0b2b8
cddfa397136f747f6670508c06d5e33285b6159b
/dictionary-informer/src/main/java/ru/ezhov/dictionary/ApplicationTray.java
d1b359d4931e067442ce7ce68fc67cb31633c7d7
[ "MIT" ]
permissive
ezhov-da/dictionary
31c162c11b399ff554ba93a632b2b85747016a55
400ef68f0aac9f5cf37b574d3120225a908619c6
refs/heads/master
2021-06-23T17:26:30.974514
2020-12-12T11:10:42
2020-12-12T11:10:42
124,290,742
0
0
MIT
2020-12-11T23:08:43
2018-03-07T20:29:42
Java
UTF-8
Java
false
false
1,141
java
package ru.ezhov.dictionary; import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.io.IOException; public class ApplicationTray { private final JFrame frame; public ApplicationTray(JFrame frame) { this.frame = frame; } public void init() throws AWTException, IOException { if (SystemTray.isSupported()) { SystemTray systemTray = SystemTray.getSystemTray(); TrayIcon trayIcon = new TrayIcon(ImageIO.read(getClass().getResource("/dictionary_16x16.png"))); trayIcon.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON1) { // frame.setVisible(!frame.isVisible()); } else if (e.getButton() == MouseEvent.BUTTON3) { System.exit(0); } } }); systemTray.add(trayIcon); } } }
[ "ezhdenis@yandex.ru" ]
ezhdenis@yandex.ru
9265856ea1368375bb61713145f52f243288c87a
ec7ec2a3b91f4688054c9e6b76a0e59c5df5441b
/MyPlaceOrderMS/src/main/java/com/coursecube/dto/OrderItemDTO.java
e68ade8bdd297e38ff861c08499157cc5ab97340
[]
no_license
lekhrajprasad/mybookstore-v1.1
b13852cb3bc2d44a1680f44440d3d8b874190fa7
41601a08a1758bc93867f6d47c7ef310cd91e63a
refs/heads/main
2023-02-15T06:00:30.186347
2021-01-08T10:37:23
2021-01-08T10:37:23
310,351,866
0
0
null
null
null
null
UTF-8
Java
false
false
1,564
java
package com.coursecube.dto; import java.io.Serializable; public class OrderItemDTO implements Serializable{ private static final long serialVersionUID = -3659874692302061790L; private Integer orderItemId; private Integer orderId; private Integer bookId; private int qty; private double cost; public OrderItemDTO() { } public OrderItemDTO(Integer orderItemId, Integer bookId, int qty, double cost) { super(); this.orderItemId = orderItemId; this.bookId = bookId; this.qty = qty; this.cost = cost; } public Integer getOrderItemId() { return orderItemId; } public void setOrderItemId(Integer orderItemId) { this.orderItemId = orderItemId; } public Integer getOrderId() { return orderId; } public void setOrderId(Integer orderId) { this.orderId = orderId; } public Integer getBookId() { return bookId; } public void setBookId(Integer bookId) { this.bookId = bookId; } public int getQty() { return qty; } public void setQty(int qty) { this.qty = qty; } public double getCost() { return cost; } public void setCost(double cost) { this.cost = cost; } @Override public String toString() { return "OrderItem{" + "orderItemId=" + orderItemId + ", orderId=" + orderId + ", bookId=" + bookId + ", qty=" + qty + ", cost=" + cost + '}'; } }
[ "lekhraj.prasad@gmail.com" ]
lekhraj.prasad@gmail.com
9b3ca464c8b9fbd013fadab4c414d797061ecaeb
e05a290f18b0ae8089709f4fbe92f3f49042daee
/authentication/authentication-core/src/test/java/io/mosip/authentication/core/util/MaskUtilTest.java
8ba172fa83cd633b257cc8bf40caae2c7c2bf076
[]
no_license
Aswin-MN/personal
25e6d6bf306e61a236d0ea886d33ea621bb7dc56
d096fa6ab16e13a66a82be0325cf4d117d3669f3
refs/heads/master
2021-10-11T16:24:08.604019
2019-01-28T12:52:41
2019-01-28T12:52:41
166,238,628
0
1
null
null
null
null
UTF-8
Java
false
false
875
java
package io.mosip.authentication.core.util; import static org.junit.Assert.*; import org.junit.Test; /** * The Class MaskUtilTest. * * @author Manoj SP * */ public class MaskUtilTest { /** * Test mask email. */ @Test public void testMaskEmail() { assertEquals("XXaXXhXXh@mail.com", MaskUtil.maskEmail("umamahesh@mail.com")); } /** * Test mask mobile number. */ @Test public void testMaskMobileNumber() { assertEquals("XXXXXX7890", MaskUtil.maskMobile("1234567890")); } @Test public void testGenerateMaskValue() { assertEquals("XXXX34654512324", MaskUtil.generateMaskValue("123234654512324", 4)); } @Test public void testGenerateMaskValue2() { assertNotEquals("XXXX34654512324", MaskUtil.generateMaskValue("123234654512324", 8)); } }
[ "info@mosip.io" ]
info@mosip.io
88d141031d5cf739ec14f56aa5be6ca329d0d033
764c94d4cf116b0e4d98a38e842e4e6a0468a666
/ebaysdkcore/src/main/java/com/ebay/soap/eBLBaseComponents/ItemRatingDetailsType.java
a1788d86f614a442c6e6fa4cdd65d6556f87a0f1
[]
no_license
linus87/ebaysdk
26dde361dbb75e03fca137eaf6a61c5e892f1303
2fb2cbade57ae654fa83ae1b7c5f3e4f741b1fc1
refs/heads/master
2023-07-19T10:34:02.644641
2021-06-01T13:30:36
2021-06-01T13:30:36
150,661,586
1
0
null
2023-07-18T06:53:34
2018-09-28T00:06:01
Java
UTF-8
Java
false
false
4,807
java
package com.ebay.soap.eBLBaseComponents; 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.XmlAnyElement; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlType; import org.w3c.dom.Element; /** * * Applicable to sites that support the Detailed Seller Ratings feature. * The <b>ItemRatingDetailsType</b> contains detailed seller ratings for an order line item in one area. When buyers leave an overall Feedback rating (positive, neutral, or negative) for a seller, they also can leave ratings in four areas: item as described, communication, shipping time, and charges for shipping and handling. Users retrieve detailed ratings as averages of the ratings left by buyers. * * * <p>Java class for ItemRatingDetailsType complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="ItemRatingDetailsType"> * &lt;complexContent> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;sequence> * &lt;element name="RatingDetail" type="{urn:ebay:apis:eBLBaseComponents}FeedbackRatingDetailCodeType" minOccurs="0"/> * &lt;element name="Rating" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/> * &lt;any/> * &lt;/sequence> * &lt;/restriction> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ItemRatingDetailsType", propOrder = { "ratingDetail", "rating", "any" }) public class ItemRatingDetailsType implements Serializable { private final static long serialVersionUID = 12343L; @XmlElement(name = "RatingDetail") protected FeedbackRatingDetailCodeType ratingDetail; @XmlElement(name = "Rating") protected Integer rating; @XmlAnyElement(lax = true) protected List<Object> any; /** * Gets the value of the ratingDetail property. * * @return * possible object is * {@link FeedbackRatingDetailCodeType } * */ public FeedbackRatingDetailCodeType getRatingDetail() { return ratingDetail; } /** * Sets the value of the ratingDetail property. * * @param value * allowed object is * {@link FeedbackRatingDetailCodeType } * */ public void setRatingDetail(FeedbackRatingDetailCodeType value) { this.ratingDetail = value; } /** * Gets the value of the rating property. * * @return * possible object is * {@link Integer } * */ public Integer getRating() { return rating; } /** * Sets the value of the rating property. * * @param value * allowed object is * {@link Integer } * */ public void setRating(Integer value) { this.rating = value; } /** * * * @return * array of * {@link Object } * {@link Element } * */ public Object[] getAny() { if (this.any == null) { return new Object[ 0 ] ; } return ((Object[]) this.any.toArray(new Object[this.any.size()] )); } /** * * * @return * one of * {@link Object } * {@link Element } * */ public Object getAny(int idx) { if (this.any == null) { throw new IndexOutOfBoundsException(); } return this.any.get(idx); } public int getAnyLength() { if (this.any == null) { return 0; } return this.any.size(); } /** * * * @param values * allowed objects are * {@link Object } * {@link Element } * */ public void setAny(Object[] values) { this._getAny().clear(); int len = values.length; for (int i = 0; (i<len); i ++) { this.any.add(values[i]); } } protected List<Object> _getAny() { if (any == null) { any = new ArrayList<Object>(); } return any; } /** * * * @param value * allowed object is * {@link Object } * {@link Element } * */ public Object setAny(int idx, Object value) { return this.any.set(idx, value); } }
[ "lyan2@ebay.com" ]
lyan2@ebay.com
2edaa28b4eaa0f4a5bc72f2f05138a03ee82ff68
4e8d52f594b89fa356e8278265b5c17f22db1210
/WebServiceArtifacts/XigniteHistorical/com/xignite/services/QueryByTypes.java
74b19b01e9c70fb41f25f26d74605ec7cfe00037
[]
no_license
ouniali/WSantipatterns
dc2e5b653d943199872ea0e34bcc3be6ed74c82e
d406c67efd0baa95990d5ee6a6a9d48ef93c7d32
refs/heads/master
2021-01-10T05:22:19.631231
2015-05-26T06:27:52
2015-05-26T06:27:52
36,153,404
1
2
null
null
null
null
UTF-8
Java
false
false
1,263
java
package com.xignite.services; import javax.xml.bind.annotation.XmlEnum; import javax.xml.bind.annotation.XmlEnumValue; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for QueryByTypes. * * <p>The following schema fragment specifies the expected content contained within this class. * <p> * <pre> * &lt;simpleType name="QueryByTypes"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;enumeration value="ExDate"/> * &lt;enumeration value="RecordDate"/> * &lt;enumeration value="PaymentDate"/> * &lt;/restriction> * &lt;/simpleType> * </pre> * */ @XmlType(name = "QueryByTypes") @XmlEnum public enum QueryByTypes { @XmlEnumValue("ExDate") EX_DATE("ExDate"), @XmlEnumValue("RecordDate") RECORD_DATE("RecordDate"), @XmlEnumValue("PaymentDate") PAYMENT_DATE("PaymentDate"); private final String value; QueryByTypes(String v) { value = v; } public String value() { return value; } public static QueryByTypes fromValue(String v) { for (QueryByTypes c: QueryByTypes.values()) { if (c.value.equals(v)) { return c; } } throw new IllegalArgumentException(v); } }
[ "ouni_ali@yahoo.fr" ]
ouni_ali@yahoo.fr
d2f233eccc17a9f7cca90a1a9a09177c3c4c39ba
48e835e6f176a8ac9ae3ca718e8922891f1e5a18
/benchmark/validation/org/pentaho/di/trans/steps/symmetriccrypto/secretkeygenerator/SecretKeyGeneratorMetaTest.java
74211872d2842d2368c160b042acbc1f84044de1
[]
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
1,790
java
/** * ! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.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.pentaho.di.trans.steps.symmetriccrypto.secretkeygenerator; import org.junit.ClassRule; import org.junit.Test; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.junit.rules.RestorePDIEngineEnvironment; import org.pentaho.di.trans.step.StepMetaInterface; import org.pentaho.di.trans.steps.loadsave.LoadSaveTester; import org.pentaho.di.trans.steps.loadsave.initializer.InitializerInterface; public class SecretKeyGeneratorMetaTest implements InitializerInterface<StepMetaInterface> { LoadSaveTester loadSaveTester; Class<SecretKeyGeneratorMeta> testMetaClass = SecretKeyGeneratorMeta.class; @ClassRule public static RestorePDIEngineEnvironment env = new RestorePDIEngineEnvironment(); @Test public void testSerialization() throws KettleException { loadSaveTester.testSerialization(); } }
[ "benjamin.danglot@inria.fr" ]
benjamin.danglot@inria.fr
0231d67c76d43cec0185b075ac966ba616801c8b
ae5eb1a38b4d22c82dfd67c86db73592094edc4b
/project82/src/main/java/org/gradle/test/performance/largejavamultiproject/project82/p412/Production8243.java
efda249ebb3c534497bc742d3fa5d61f0e414e98
[]
no_license
big-guy/largeJavaMultiProject
405cc7f55301e1fd87cee5878a165ec5d4a071aa
1cd6a3f9c59e9b13dffa35ad27d911114f253c33
refs/heads/main
2023-03-17T10:59:53.226128
2021-03-04T01:01:39
2021-03-04T01:01:39
344,307,977
0
0
null
null
null
null
UTF-8
Java
false
false
1,959
java
package org.gradle.test.performance.largejavamultiproject.project82.p412; public class Production8243 { private Production8240 property0; public Production8240 getProperty0() { return property0; } public void setProperty0(Production8240 value) { property0 = value; } private Production8241 property1; public Production8241 getProperty1() { return property1; } public void setProperty1(Production8241 value) { property1 = value; } private Production8242 property2; public Production8242 getProperty2() { return property2; } public void setProperty2(Production8242 value) { property2 = value; } private String property3; public String getProperty3() { return property3; } public void setProperty3(String value) { property3 = value; } private String property4; public String getProperty4() { return property4; } public void setProperty4(String value) { property4 = value; } private String property5; public String getProperty5() { return property5; } public void setProperty5(String value) { property5 = value; } private String property6; public String getProperty6() { return property6; } public void setProperty6(String value) { property6 = value; } private String property7; public String getProperty7() { return property7; } public void setProperty7(String value) { property7 = value; } private String property8; public String getProperty8() { return property8; } public void setProperty8(String value) { property8 = value; } private String property9; public String getProperty9() { return property9; } public void setProperty9(String value) { property9 = value; } }
[ "sterling.greene@gmail.com" ]
sterling.greene@gmail.com
e6c5c77f73e2cbb5366e76d72062dad0265e12da
146a30bee123722b5b32c0022c280bbe7d9b6850
/depsWorkSpace/bc-java-master/core/src/test/java/org/mightyfish/crypto/tls/test/MockTlsClient.java
2f792d4a7fa1ecf4668a4a2ebd274bfc81cb7387
[ "LicenseRef-scancode-warranty-disclaimer", "MIT" ]
permissive
GLC-Project/java-experiment
1d5aa7b9974c8ae572970ce6a8280e6a65417837
b03b224b8d5028dd578ca0e7df85d7d09a26688e
refs/heads/master
2020-12-23T23:47:57.341646
2016-02-13T16:20:45
2016-02-13T16:20:45
237,313,620
0
1
null
2020-01-30T21:56:54
2020-01-30T21:56:53
null
UTF-8
Java
false
false
6,496
java
package org.mightyfish.crypto.tls.test; import java.io.IOException; import java.io.PrintStream; import java.util.Hashtable; import java.util.Vector; import org.mightyfish.asn1.x509.Certificate; import org.mightyfish.crypto.tls.AlertDescription; import org.mightyfish.crypto.tls.AlertLevel; import org.mightyfish.crypto.tls.CertificateRequest; import org.mightyfish.crypto.tls.ClientCertificateType; import org.mightyfish.crypto.tls.DefaultTlsClient; import org.mightyfish.crypto.tls.MaxFragmentLength; import org.mightyfish.crypto.tls.ProtocolVersion; import org.mightyfish.crypto.tls.SignatureAlgorithm; import org.mightyfish.crypto.tls.SignatureAndHashAlgorithm; import org.mightyfish.crypto.tls.TlsAuthentication; import org.mightyfish.crypto.tls.TlsCredentials; import org.mightyfish.crypto.tls.TlsExtensionsUtils; import org.mightyfish.crypto.tls.TlsSession; import org.mightyfish.util.Arrays; import org.mightyfish.util.encoders.Hex; class MockTlsClient extends DefaultTlsClient { TlsSession session; MockTlsClient(TlsSession session) { this.session = session; } public TlsSession getSessionToResume() { return this.session; } public void notifyAlertRaised(short alertLevel, short alertDescription, String message, Throwable cause) { PrintStream out = (alertLevel == AlertLevel.fatal) ? System.err : System.out; out.println("TLS client raised alert: " + AlertLevel.getText(alertLevel) + ", " + AlertDescription.getText(alertDescription)); if (message != null) { out.println("> " + message); } if (cause != null) { cause.printStackTrace(out); } } public void notifyAlertReceived(short alertLevel, short alertDescription) { PrintStream out = (alertLevel == AlertLevel.fatal) ? System.err : System.out; out.println("TLS client received alert: " + AlertLevel.getText(alertLevel) + ", " + AlertDescription.getText(alertDescription)); } // public int[] getCipherSuites() // { // return Arrays.concatenate(super.getCipherSuites(), // new int[] // { // CipherSuite.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, // CipherSuite.TLS_ECDHE_RSA_WITH_ESTREAM_SALSA20_SHA1, // CipherSuite.TLS_ECDHE_RSA_WITH_SALSA20_SHA1, // CipherSuite.TLS_RSA_WITH_ESTREAM_SALSA20_SHA1, // CipherSuite.TLS_RSA_WITH_SALSA20_SHA1, // }); // } public Hashtable getClientExtensions() throws IOException { Hashtable clientExtensions = TlsExtensionsUtils.ensureExtensionsInitialised(super.getClientExtensions()); TlsExtensionsUtils.addEncryptThenMACExtension(clientExtensions); // TODO[draft-ietf-tls-session-hash-01] Enable once code-point assigned (only for compatible server though) // TlsExtensionsUtils.addExtendedMasterSecretExtension(clientExtensions); TlsExtensionsUtils.addMaxFragmentLengthExtension(clientExtensions, MaxFragmentLength.pow2_9); TlsExtensionsUtils.addTruncatedHMacExtension(clientExtensions); return clientExtensions; } public void notifyServerVersion(ProtocolVersion serverVersion) throws IOException { super.notifyServerVersion(serverVersion); System.out.println("TLS client negotiated " + serverVersion); } public TlsAuthentication getAuthentication() throws IOException { return new TlsAuthentication() { public void notifyServerCertificate(org.mightyfish.crypto.tls.Certificate serverCertificate) throws IOException { Certificate[] chain = serverCertificate.getCertificateList(); System.out.println("TLS client received server certificate chain of length " + chain.length); for (int i = 0; i != chain.length; i++) { Certificate entry = chain[i]; // TODO Create fingerprint based on certificate signature algorithm digest System.out.println(" fingerprint:SHA-256 " + TlsTestUtils.fingerprint(entry) + " (" + entry.getSubject() + ")"); } } public TlsCredentials getClientCredentials(CertificateRequest certificateRequest) throws IOException { short[] certificateTypes = certificateRequest.getCertificateTypes(); if (certificateTypes == null || !Arrays.contains(certificateTypes, ClientCertificateType.rsa_sign)) { return null; } SignatureAndHashAlgorithm signatureAndHashAlgorithm = null; Vector sigAlgs = certificateRequest.getSupportedSignatureAlgorithms(); if (sigAlgs != null) { for (int i = 0; i < sigAlgs.size(); ++i) { SignatureAndHashAlgorithm sigAlg = (SignatureAndHashAlgorithm) sigAlgs.elementAt(i); if (sigAlg.getSignature() == SignatureAlgorithm.rsa) { signatureAndHashAlgorithm = sigAlg; break; } } if (signatureAndHashAlgorithm == null) { return null; } } return TlsTestUtils.loadSignerCredentials(context, new String[] { "x509-client.pem", "x509-ca.pem" }, "x509-client-key.pem", signatureAndHashAlgorithm); } }; } public void notifyHandshakeComplete() throws IOException { super.notifyHandshakeComplete(); TlsSession newSession = context.getResumableSession(); if (newSession != null) { byte[] newSessionID = newSession.getSessionID(); String hex = Hex.toHexString(newSessionID); if (this.session != null && Arrays.areEqual(this.session.getSessionID(), newSessionID)) { System.out.println("Resumed session: " + hex); } else { System.out.println("Established session: " + hex); } this.session = newSession; } } }
[ "a.eslampanah@live.com" ]
a.eslampanah@live.com
700a38ae33e42d6ded4fcf08a7b40282a1a4fa4f
98cd05709ca4528e6955b8d090c9d3d588439f51
/app/src/main/java/com/aanglearning/parentapp/gallery/GalleryInteractorImpl.java
28034e3826f8d7e87c849112eea90184150d8316
[]
no_license
vinkrish/parent-app
6b2b3bb6f65438eea505014c289eb90d0e47ff3d
21ca49b5619a2ca1748f8ced5beaa631e8081011
refs/heads/master
2021-03-30T17:45:40.148759
2018-04-22T10:24:53
2018-04-22T10:24:53
82,896,275
0
1
null
null
null
null
UTF-8
Java
false
false
4,538
java
package com.aanglearning.parentapp.gallery; import com.aanglearning.parentapp.App; import com.aanglearning.parentapp.R; import com.aanglearning.parentapp.api.ApiClient; import com.aanglearning.parentapp.api.GalleryApi; import com.aanglearning.parentapp.model.Album; import com.aanglearning.parentapp.model.ChildInfo; import com.aanglearning.parentapp.model.DeletedAlbum; import java.util.List; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; /** * Created by Vinay on 30-10-2017. */ class GalleryInteractorImpl implements GalleryInteractor { @Override public void getAlbumsAboveId(ChildInfo childInfo, long id, final OnFinishedListener listener) { GalleryApi api = ApiClient.getAuthorizedClient().create(GalleryApi.class); Call<List<Album>> queue = api.getAlbumAboveId(childInfo.getSchoolId(), childInfo.getClassId(), childInfo.getSectionId(), id); queue.enqueue(new Callback<List<Album>>() { @Override public void onResponse(Call<List<Album>> call, Response<List<Album>> response) { if(response.isSuccessful()) { listener.onRecentAlbumsReceived(response.body()); } else { listener.onError(App.getInstance().getString(R.string.request_error)); } } @Override public void onFailure(Call<List<Album>> call, Throwable t) { listener.onError(App.getInstance().getString(R.string.network_error)); } }); } @Override public void getAlbums(ChildInfo childInfo, final OnFinishedListener listener) { GalleryApi api = ApiClient.getAuthorizedClient().create(GalleryApi.class); Call<List<Album>> queue = api.getAlbums(childInfo.getSchoolId(), childInfo.getClassId(), childInfo.getSectionId()); queue.enqueue(new Callback<List<Album>>() { @Override public void onResponse(Call<List<Album>> call, Response<List<Album>> response) { if(response.isSuccessful()) { listener.onAlbumsReceived(response.body()); } else { listener.onError(App.getInstance().getString(R.string.request_error)); } } @Override public void onFailure(Call<List<Album>> call, Throwable t) { listener.onError(App.getInstance().getString(R.string.network_error)); } }); } @Override public void getRecentDeletedAlbums(ChildInfo childInfo, long id, final OnFinishedListener listener) { GalleryApi api = ApiClient.getAuthorizedClient().create(GalleryApi.class); Call<List<DeletedAlbum>> queue = api.getDeletedAlbumsAboveId(childInfo.getSchoolId(), childInfo.getClassId(), childInfo.getSectionId(), id); queue.enqueue(new Callback<List<DeletedAlbum>>() { @Override public void onResponse(Call<List<DeletedAlbum>> call, Response<List<DeletedAlbum>> response) { if(response.isSuccessful()) { listener.onDeletedAlbumsReceived(response.body()); } else { listener.onError(App.getInstance().getString(R.string.request_error)); } } @Override public void onFailure(Call<List<DeletedAlbum>> call, Throwable t) { listener.onError(App.getInstance().getString(R.string.network_error)); } }); } @Override public void getDeletedAlbums(ChildInfo childInfo, final OnFinishedListener listener) { GalleryApi api = ApiClient.getAuthorizedClient().create(GalleryApi.class); Call<List<DeletedAlbum>> queue = api.getDeletedAlbums(childInfo.getSchoolId(), childInfo.getClassId(), childInfo.getSectionId()); queue.enqueue(new Callback<List<DeletedAlbum>>() { @Override public void onResponse(Call<List<DeletedAlbum>> call, Response<List<DeletedAlbum>> response) { if(response.isSuccessful()) { listener.onDeletedAlbumsReceived(response.body()); } else { listener.onError(App.getInstance().getString(R.string.request_error)); } } @Override public void onFailure(Call<List<DeletedAlbum>> call, Throwable t) { listener.onError(App.getInstance().getString(R.string.network_error)); } }); } }
[ "vinaykrishna1989@gmail.com" ]
vinaykrishna1989@gmail.com